@@ -8,6 +8,8 @@ import Data.List
8-- import qualified Data.Text as T
8-- import qualified Data.Text as T
9import Text.Parsec
9import Text.Parsec
11data SExp = SexpList [SExp]
13data SExp = SexpList [SExp]
12 | StringAtom String
14 | StringAtom String
13 | BoolAtom Bool
15 | BoolAtom Bool
@@ -42,6 +44,14 @@ instance SExpable Integer where
42instance SExpable Int where
44instance SExpable Int where
43 toSExp n = IntegerAtom (toInteger n)
45 toSExp n = IntegerAtom (toInteger n)
48+instance SExpable Name where
49+ toSExp (UN s) = SexpList [SymbolAtom "UN", StringAtom s]
50+ toSExp (NS s ns) = SexpList [SymbolAtom "NS", toSExp s, toSExp ns]
51+ toSExp (MN n s) = SexpList [SymbolAtom "MN", toSExp n, toSExp s]
52+ toSExp NErased = SexpList [SymbolAtom "NErased"]
45instance (SExpable a) => SExpable (Maybe a) where
55instance (SExpable a) => SExpable (Maybe a) where
46 toSExp Nothing = SexpList [SymbolAtom "Nothing"]
56 toSExp Nothing = SexpList [SymbolAtom "Nothing"]
47 toSExp (Just a) = SexpList [SymbolAtom "Just", toSExp a]
57 toSExp (Just a) = SexpList [SymbolAtom "Just", toSExp a]