on master help sign in
Update trampoline docs to new interface.
commitdf135b8c9b45638250cd0c309da3579c54637bb6 authorMax New <maxsnew@gmail.com> dateMon 20 Jan 2014, 14:40 (13 years ago) parentb471661
1 file changed+3−3
libraries/Trampoline.elm+3−3
libraries/Trampoline.elm+3−3
@@ -19,9 +19,9 @@ main = asText <| fac 1000000000000
1919Trampolining allows for long-running tail-recursive loops to be run without pushing calls onto the stack:
2020```haskell
2121facT : Int -> Int -> Trampoline Int
22−facT n acc = Trampoline <| if n <= 0
23− then Left acc
24− else Right <| \() -> facT (n - 1) (n * acc)
22+facT n acc = if n <= 0
23+ then Done acc
24+ else Continue <| \() -> facT (n - 1) (n * acc)
2525fac : Int -> Int
2626fac n = trampoline <| facT n 0
2727