7This appendix gives interfaces for the core effects provided by the
15 module Effect.Exception
19 import Control.IOExcept
21 EXCEPTION : Type -> EFFECT
23 raise : a -> Eff b [EXCEPTION a]
25 instance Handler (Exception a) Maybe
26 instance Handler (Exception a) List
27 instance Handler (Exception a) (Either a)
28 instance Handler (Exception a) (IOExcept a)
29 instance Show a => Handler (Exception a) IO
39 import Control.IOExcept
41 FILE_IO : Type -> EFFECT
43 data OpenFile : Mode -> Type
45 open : (fname : String)
47 -> Eff Bool [FILE_IO ()]
48 (\res => [FILE_IO (case res of
51 close : Eff () [FILE_IO (OpenFile m)] [FILE_IO ()]
53 readLine : Eff String [FILE_IO (OpenFile Read)]
54 writeLine : String -> Eff () [FILE_IO (OpenFile Write)]
55 eof : Eff Bool [FILE_IO (OpenFile Read)]
57 instance Handler FileIO IO
72 srand : Integer -> Eff m () [RND]
73 rndInt : Integer -> Integer -> Eff m Integer [RND]
74 rndFin : (k : Nat) -> Eff m (Fin (S k)) [RND]
76 instance Handler Random m
89 select : List a -> Eff m a [SELECT]
91 instance Handler Selection Maybe
92 instance Handler Selection List
103 STATE : Type -> EFFECT
105 get : Eff m x [STATE x]
106 put : x -> Eff m () [STATE x]
107 putM : y -> Eff m () [STATE x] [STATE y]
108 update : (x -> x) -> Eff m () [STATE x]
110 instance Handler State m
120 import Control.IOExcept
124 putChar : Handler StdIO m => Char -> Eff m () [STDIO]
125 putStr : Handler StdIO m => String -> Eff m () [STDIO]
126 putStrLn : Handler StdIO m => String -> Eff m () [STDIO]
128 getStr : Handler StdIO m => Eff m String [STDIO]
129 getChar : Handler StdIO m => Eff m Char [STDIO]
131 instance Handler StdIO IO
132 instance Handler StdIO (IOExcept a)
143 import Control.IOExcept
147 getArgs : Handler System e => Eff e (List String) [SYSTEM]
148 time : Handler System e => Eff e Int [SYSTEM]
149 getEnv : Handler System e => String -> Eff e (Maybe String) [SYSTEM]
151 instance Handler System IO
152 instance Handler System (IOExcept a)
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