5import Control.Monad.Eff (Eff)
6import Control.Monad.Eff.Console (CONSOLE, log)
8class IsStream el s | s -> el where
9 cons :: el -> (Unit -> s) -> s
10 uncons :: s -> { head :: el, tail :: s }
12data Stream a = Stream a (Unit -> Stream a)
14instance streamIsStream :: IsStream a (Stream a) where
15 cons x xs = Stream x xs
16 uncons (Stream x f) = { head: x, tail: f unit }
18test :: forall el s. IsStream el s => s -> s
19test s = case uncons s of
20 { head, tail } -> cons head \_ -> tail
22main :: Eff (console :: CONSOLE) Unit
24 let dones :: Stream String
25 dones = cons "Done" \_ -> dones
26 log (uncons (test dones)).head
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list