@@ -26,13 +26,15 @@ sExpToString (List l) = "(" ++ intercalate " " (map sExpToString l) ++ "
26class SExpable a where
26class SExpable a where
27 toSExp :: a -> SExp
27 toSExp :: a -> SExp
29+instance SExpable SExp where
29instance SExpable Bool where
32instance SExpable Bool where
30 toSExp True = BoolAtom True
33 toSExp True = BoolAtom True
31 toSExp False = BoolAtom False
34 toSExp False = BoolAtom False
33instance SExpable String where
36instance SExpable String where
34− toSExp (':' : xs) = SymbolAtom xs
35− toSExp s = StringAtom s
37+ toSExp s = StringAtom s
37instance SExpable Integer where
39instance SExpable Integer where
38 toSExp n = IntegerAtom n
40 toSExp n = IntegerAtom n