| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Primitive Bytestrings: IO operations |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible #-} |
| 8 |
|
| 9 |
module Data.Bytestring.IO.Primitive where |
| 10 |
|
| 11 |
open import Agda.Builtin.String using (String) |
| 12 |
open import Agda.Builtin.Unit using (⊤) |
| 13 |
open import Data.Bytestring.Primitive using (Bytestring) |
| 14 |
open import IO.Primitive.Core using (IO) |
| 15 |
|
| 16 |
postulate |
| 17 |
readFile : String → IO Bytestring |
| 18 |
writeFile : String → Bytestring → IO ⊤ |
| 19 |
|
| 20 |
{-# FOREIGN GHC import qualified Data.Text as T #-} |
| 21 |
{-# FOREIGN GHC import Data.ByteString #-} |
| 22 |
{-# COMPILE GHC readFile = Data.ByteString.readFile . T.unpack #-} |
| 23 |
{-# COMPILE GHC writeFile = Data.ByteString.writeFile . T.unpack #-} |