-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Description
Consider the following program:
module Main where
import Prelude
import qualified Node.Buffer as B
import Control.Monad.Eff.Console (log)
main = do
let buf = B.fromArray [0]
let x = B.read B.UInt8 0 buf
B.write B.UInt8 1 0 buf
let y = B.read B.UInt8 0 buf
log ("x = " ++ show x)
log ("y = " ++ show y)
Output:
x = 0
y = 1
This seems to be a subversion of the type system. I think we should require Eff to read or write from a buffer. Since they can be used in a similar way to IORef in Haskell, perhaps we also should require Eff to create them, like Haskell does.
(Unfortunately this program doesn't actually run at the moment but that problem is fixed by #4)
Metadata
Metadata
Assignees
Labels
No labels