]> Git — Sourcephile - haskell/symantic.git/blob - TFHOE/Raw.hs
init
[haskell/symantic.git] / TFHOE / Raw.hs
1 module TFHOE.Raw where
2
3 -- * Type 'Raw'
4
5 -- | Data type on the wire.
6 data Raw
7 = Raw String [Raw]
8 deriving (Show)
9
10 read_safe :: Read a => String -> Either String a
11 read_safe s =
12 case reads s of
13 [(x, "")] -> Right x
14 _ -> Left $ "Read error: " ++ s