Monadic fractals
There are an awful lot of monad tutorials out there. Monads as containers is one I saw a link to on haskell-cafe today, and it gives a rather amazing application of the list monad:
f x | x == '#' = "# #"
| otherwise = " "
"#" >>= f >>= f >>= f >>= f
= "# # # # # # # # # # # # # # # #"
And we have a fractal!
[ Entry posted at: Sun 17 Dec 2006 03:22:53 UTC | 0 comment(s)... | Cat: Geeky ]