evancz/Elm — pull request #378 by maxsnew (2013-12-07 20:48:23+00:00)
Title: Add Lazy Evaluation/Streams Library

Basic library for efficient lazy evaluation. Includes support for infinite streams.

This example fibonacci is really fast (and way faster than without memoizing):
```elm
import Mouse
import open Lazy

fibs : Stream Int
fibs = S { hd = 0
, tl = thunk (\() ->
S { hd = 1
, tl = thunk (\() ->
zipWith (+) fibs (tl fibs))
})
}

main = above (asText . take 200 <| fibs) . asText <~ (fibs `observeWhen` Mouse.clicks)
```

I haven't done the docs yet since I figure we will want to discuss the API anyway.

I can start a thread on the mailing list if you want to but I figured I should have it implemented first anyway so people can check it out for themselves.