Hi Mike,
thanks, those number patterns are much more difficult to code than fractals -- sadly, less spectacular
Started studying more deeply Haskell, -- another
λ language .. rather fascinating :
no iteration at all
completely "profound" lazy (i think i found a soulmate
)
but, very compact ... translated a few things from Lisp / Scheme :
the single recursive fibo
fibo (a,b,0) = a
fibo (a,b,i)= fibo(b,a+b,i-1)
fib (x) = fibo(1,1,x)
----------------------------------------
working with lists it splits the list in the car and cdr as (x:xs) --- list defined by using brackets
fact [1] = 1
fact (x:xs) = x*fact(xs)
----------------------------------------
defining mapping is very easy : (named mmap, it already has map of course)
mmap f [] = []
mmap f (x:xs) = f x : mmap f xs
in the REPL
*Main> mmap (/ 2) [1..5]
[0.5,1.0,1.5,2.0,2.5]
well, interesting ...
consing is done by ":" p.e. 0 : [1,2] -> [0,1,2] (same as (cons 0 (list 1 2)) )
best Rob