class IO a where
write :: OutputStream -> a -> <Proc> ()
read :: InputStream -> <Proc> a
- ioSize :: a -> Integer
+ ioSize :: a -> <Proc> Integer
ioSize _ = fail "ioSize not implemented"
read = readString
ioSize = ioSizeString
-instance IO DoubleArray where
- write = writeDoubleArray
- read = readDoubleArray
- //ioSize v = do
- // l = length v
- // ioSizeLength l + 8 * l
-
instance (IO a) => IO (Maybe a) where
read s = if read s
then Just (read s)