| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Bytestrings: IO operations |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --guardedness --cubical-compatible #-} |
| 8 |
|
| 9 |
module Data.Bytestring.IO where |
| 10 |
|
| 11 |
open import Agda.Builtin.String using (String) |
| 12 |
open import IO using (IO; lift) |
| 13 |
open import Data.Bytestring.Base using (Bytestring) |
| 14 |
open import Data.Unit.Base using (⊤) |
| 15 |
|
| 16 |
import Data.Bytestring.IO.Primitive as Prim |
| 17 |
|
| 18 |
readFile : String → IO Bytestring |
| 19 |
readFile fp = lift (Prim.readFile fp) |
| 20 |
|
| 21 |
writeFile : String → Bytestring → IO ⊤ |
| 22 |
writeFile fp str = lift (Prim.writeFile fp str) |