@@ -12,6 +12,7 @@ open import Codata.Musical.Notation
12
12
open import Codata.Musical.Costring
13
13
open import Data.Unit.Polymorphic
14
14
open import Data.String
15
+ import Data.Unit as Unit0
15
16
open import Function
16
17
import IO.Primitive as Prim
17
18
open import Level
@@ -145,28 +146,32 @@ readFile f = lift (Prim.readFile f)
145
146
readFiniteFile : String → IO String
146
147
readFiniteFile f = lift (Prim.readFiniteFile f)
147
148
148
- writeFile∞ : String → Costring → IO ⊤
149
- writeFile∞ f s = ignore (lift (Prim.writeFile f s))
149
+ private
150
+ lift′ : Prim.IO Unit0.⊤ → IO {a} ⊤
151
+ lift′ io = lift (io Prim.>>= λ _ → Prim.return _)
152
+
153
+ writeFile∞ : String → Costring → IO {a} ⊤
154
+ writeFile∞ f s = lift′ (Prim.writeFile f s)
150
155
151
- writeFile : String → String → IO ⊤
156
+ writeFile : String → String → IO {a} ⊤
152
157
writeFile f s = writeFile∞ f (toCostring s)
153
158
154
- appendFile∞ : String → Costring → IO ⊤
155
- appendFile∞ f s = ignore ( lift (Prim.appendFile f s) )
159
+ appendFile∞ : String → Costring → IO {a} ⊤
160
+ appendFile∞ f s = lift′ (Prim.appendFile f s)
156
161
157
- appendFile : String → String → IO ⊤
162
+ appendFile : String → String → IO {a} ⊤
158
163
appendFile f s = appendFile∞ f (toCostring s)
159
164
160
- putStr∞ : Costring → IO ⊤
161
- putStr∞ s = ignore ( lift (Prim.putStr s) )
165
+ putStr∞ : Costring → IO {a} ⊤
166
+ putStr∞ s = lift′ (Prim.putStr s)
162
167
163
- putStr : String → IO ⊤
168
+ putStr : String → IO {a} ⊤
164
169
putStr s = putStr∞ (toCostring s)
165
170
166
- putStrLn∞ : Costring → IO ⊤
167
- putStrLn∞ s = ignore ( lift (Prim.putStrLn s) )
171
+ putStrLn∞ : Costring → IO {a} ⊤
172
+ putStrLn∞ s = lift′ (Prim.putStrLn s)
168
173
169
- putStrLn : String → IO ⊤
174
+ putStrLn : String → IO {a} ⊤
170
175
putStrLn s = putStrLn∞ (toCostring s)
171
176
172
177
-- Note that the commands writeFile, appendFile, putStr and putStrLn
0 commit comments