3-- An IO monad with exception handling
5data IOExcept : Type -> Type -> Type where
6 ioM : IO (Either err a) -> IOExcept err a
8instance Functor (IOExcept e) where
9 map f (ioM fn) = ioM (map (map f) fn)
11instance Applicative (IOExcept e) where
12 pure x = ioM (pure (pure x))
13 (ioM f) <$> (ioM a) = ioM (do f' <- f; a' <- a
16instance Monad (IOExcept e) where
17 (ioM x) >>= k = ioM (do x' <- x;
19 Right a => let (ioM ka) = k a in
21 Left err => return (Left err))
23ioe_lift : IO a -> IOExcept err a
24ioe_lift op = ioM (do op' <- op
27ioe_fail : err -> IOExcept err a
28ioe_fail e = ioM (return (Left e))
30ioe_run : IOExcept err a -> (err -> IO b) -> (a -> IO b) -> IO b
31ioe_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