Generate an infinite arithmetic progression, starting from given
elements, similar to
[x,y..]. For better user experience
consider enabling
{-# LANGUAGE PostfixOperators #-}:
>>> :set -XPostfixOperators
>>> Data.List.Infinite.take 10 ((1,3)....)
[1,3,5,7,9,11,13,15,17,19]
Beware that for finite types
(....) applies
cycle atop
of
[x,y..]:
>>> :set -XPostfixOperators
>>> Data.List.Infinite.take 10 ((EQ,GT)....)
[EQ,GT,EQ,GT,EQ,GT,EQ,GT,EQ,GT]
Remember that
Int is a finite type as well: for a sufficiently
large step of progression
y - x one may observe
((x ::
Int, y)....) cycling back to emit
x fairly soon.