5-- An IO monad with exception handling
7data IOExcept : Type -> Type -> Type where
8 ioM : IO (Either err a) -> IOExcept err a
10instance Functor (IOExcept e) where
11 fmap f (ioM fn) = ioM (fmap (fmap f) fn)
13instance Applicative (IOExcept e) where
14 pure x = ioM (pure (pure x))
15 (ioM f) <$> (ioM a) = ioM (do f' <- f; a' <- a
18instance Monad (IOExcept e) where
20 (ioM x) >>= k = ioM (do x' <- x;
22 Right a => let (ioM ka) = k a in
24 Left err => return (Left err))
26ioe_lift : IO a -> IOExcept err a
27ioe_lift op = ioM (do op' <- op
30ioe_fail : err -> IOExcept err a
31ioe_fail e = ioM (return (Left e))
33ioe_run : IOExcept err a -> (err -> IO b) -> (a -> IO b) -> IO b
34ioe_run (ioM act) err ok = do act' <- act
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