{-# OPTIONS_GHC -Wall -Werror #-}
module Text.SExpression.Types
( Parser
, SExpr(..)
) where
import Data.Void (Void)
import Text.Megaparsec (Parsec)
type Parser = Parsec Void String
data SExpr =
Atom String
| List [SExpr]
| ConsList [SExpr] SExpr
| Number Integer
| String String
| Bool Bool
deriving (SExpr -> SExpr -> Bool
(SExpr -> SExpr -> Bool) -> (SExpr -> SExpr -> Bool) -> Eq SExpr
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SExpr -> SExpr -> Bool
$c/= :: SExpr -> SExpr -> Bool
== :: SExpr -> SExpr -> Bool
$c== :: SExpr -> SExpr -> Bool
Eq, ReadPrec [SExpr]
ReadPrec SExpr
Int -> ReadS SExpr
ReadS [SExpr]
(Int -> ReadS SExpr)
-> ReadS [SExpr]
-> ReadPrec SExpr
-> ReadPrec [SExpr]
-> Read SExpr
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SExpr]
$creadListPrec :: ReadPrec [SExpr]
readPrec :: ReadPrec SExpr
$creadPrec :: ReadPrec SExpr
readList :: ReadS [SExpr]
$creadList :: ReadS [SExpr]
readsPrec :: Int -> ReadS SExpr
$creadsPrec :: Int -> ReadS SExpr
Read, Int -> SExpr -> ShowS
[SExpr] -> ShowS
SExpr -> String
(Int -> SExpr -> ShowS)
-> (SExpr -> String) -> ([SExpr] -> ShowS) -> Show SExpr
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SExpr] -> ShowS
$cshowList :: [SExpr] -> ShowS
show :: SExpr -> String
$cshow :: SExpr -> String
showsPrec :: Int -> SExpr -> ShowS
$cshowsPrec :: Int -> SExpr -> ShowS
Show)