> | IRef
> | Cap
> | GiveAwayCap
+> | ErrVal
> deriving (Enum, Eq)
Which are shown with:
> show IRef = "iref"
> show Cap = "cap"
> show GiveAwayCap = "give_away_cap"
+> show ErrVal = "errval"
> instance Read TypeBuiltin where
> readsPrec _ = \s -> case s of
> "iref" -> [(IRef, "")]
> "cap" -> [(Cap, "")]
> "give_away_cap" -> [(GiveAwayCap, "")]
+> "errval" -> [(ErrVal, "")]
> _ -> error $ "Undefined builtin type " ++ s
Hence, we can define: