5-- An IO monad with exception handling
7record IOExcept' (f:FFI) err a where
9 runIOExcept : IO' f (Either err a)
11Functor (IOExcept' f e) where
12 map f (IOM fn) = IOM (map (map f) fn)
14Applicative (IOExcept' f e) where
15 pure x = IOM (pure (pure x))
16 (IOM f) <*> (IOM a) = IOM [| f <*> a |]
18Monad (IOExcept' f e) where
19 (IOM x) >>= f = IOM $ x >>= either (pure . Left) (runIOExcept . f)
21ioe_lift : IO' f a -> IOExcept' f err a
22ioe_lift op = IOM $ map Right op
24ioe_fail : err -> IOExcept' f err a
25ioe_fail e = IOM $ pure (Left e)
27ioe_run : IOExcept' f err a -> (err -> IO' f b) -> (a -> IO' f b) -> IO' f b
28ioe_run (IOM act) err ok = either err ok !act
30IOExcept : Type -> Type -> Type
31IOExcept = IOExcept' FFI_C
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