mello-0.2.1: No-fuss syntax with s-expressions
Safe HaskellSafe-Inferred
LanguageGHC2021

Mello.Syntax

Synopsis

Documentation

newtype Sym Source #

Constructors

Sym 

Fields

Instances

Instances details
IsString Sym Source # 
Instance details

Defined in Mello.Syntax

Methods

fromString :: String -> Sym #

Show Sym Source # 
Instance details

Defined in Mello.Syntax

Methods

showsPrec :: Int -> Sym -> ShowS #

show :: Sym -> String #

showList :: [Sym] -> ShowS #

Eq Sym Source # 
Instance details

Defined in Mello.Syntax

Methods

(==) :: Sym -> Sym -> Bool #

(/=) :: Sym -> Sym -> Bool #

Ord Sym Source # 
Instance details

Defined in Mello.Syntax

Methods

compare :: Sym -> Sym -> Ordering #

(<) :: Sym -> Sym -> Bool #

(<=) :: Sym -> Sym -> Bool #

(>) :: Sym -> Sym -> Bool #

(>=) :: Sym -> Sym -> Bool #

max :: Sym -> Sym -> Sym #

min :: Sym -> Sym -> Sym #

ToSexp Sym Source # 
Instance details

Defined in Mello.Print

Methods

toSexp :: Sym -> Sexp Source #

Pretty Sym Source # 
Instance details

Defined in Mello.Syntax

Methods

pretty :: Sym -> Doc ann #

prettyList :: [Sym] -> Doc ann #

Monad m => MatchSexp e k m Sym Source # 
Instance details

Defined in Mello.Match

Methods

matchSexp :: MatchT e k m Sym Source #

data Atom Source #

Leaves of S-expression trees

Instances

Instances details
IsString Atom Source # 
Instance details

Defined in Mello.Syntax

Methods

fromString :: String -> Atom #

Num Atom Source # 
Instance details

Defined in Mello.Syntax

Methods

(+) :: Atom -> Atom -> Atom #

(-) :: Atom -> Atom -> Atom #

(*) :: Atom -> Atom -> Atom #

negate :: Atom -> Atom #

abs :: Atom -> Atom #

signum :: Atom -> Atom #

fromInteger :: Integer -> Atom #

Show Atom Source # 
Instance details

Defined in Mello.Syntax

Methods

showsPrec :: Int -> Atom -> ShowS #

show :: Atom -> String #

showList :: [Atom] -> ShowS #

Eq Atom Source # 
Instance details

Defined in Mello.Syntax

Methods

(==) :: Atom -> Atom -> Bool #

(/=) :: Atom -> Atom -> Bool #

Ord Atom Source # 
Instance details

Defined in Mello.Syntax

Methods

compare :: Atom -> Atom -> Ordering #

(<) :: Atom -> Atom -> Bool #

(<=) :: Atom -> Atom -> Bool #

(>) :: Atom -> Atom -> Bool #

(>=) :: Atom -> Atom -> Bool #

max :: Atom -> Atom -> Atom #

min :: Atom -> Atom -> Atom #

ToSexp Atom Source # 
Instance details

Defined in Mello.Print

Methods

toSexp :: Atom -> Sexp Source #

Pretty Atom Source # 
Instance details

Defined in Mello.Syntax

Methods

pretty :: Atom -> Doc ann #

prettyList :: [Atom] -> Doc ann #

Monad m => MatchSexp e k m Atom Source # 
Instance details

Defined in Mello.Match

Methods

matchSexp :: MatchT e k m Atom Source #

data Brace Source #

Instances

Instances details
Bounded Brace Source # 
Instance details

Defined in Mello.Text

Enum Brace Source # 
Instance details

Defined in Mello.Text

Show Brace Source # 
Instance details

Defined in Mello.Text

Methods

showsPrec :: Int -> Brace -> ShowS #

show :: Brace -> String #

showList :: [Brace] -> ShowS #

Eq Brace Source # 
Instance details

Defined in Mello.Text

Methods

(==) :: Brace -> Brace -> Bool #

(/=) :: Brace -> Brace -> Bool #

Ord Brace Source # 
Instance details

Defined in Mello.Text

Methods

compare :: Brace -> Brace -> Ordering #

(<) :: Brace -> Brace -> Bool #

(<=) :: Brace -> Brace -> Bool #

(>) :: Brace -> Brace -> Bool #

(>=) :: Brace -> Brace -> Bool #

max :: Brace -> Brace -> Brace #

min :: Brace -> Brace -> Brace #

newtype Doc Source #

Constructors

Doc 

Fields

Instances

Instances details
Show Doc Source # 
Instance details

Defined in Mello.Syntax

Methods

showsPrec :: Int -> Doc -> ShowS #

show :: Doc -> String #

showList :: [Doc] -> ShowS #

Eq Doc Source # 
Instance details

Defined in Mello.Syntax

Methods

(==) :: Doc -> Doc -> Bool #

(/=) :: Doc -> Doc -> Bool #

Ord Doc Source # 
Instance details

Defined in Mello.Syntax

Methods

compare :: Doc -> Doc -> Ordering #

(<) :: Doc -> Doc -> Bool #

(<=) :: Doc -> Doc -> Bool #

(>) :: Doc -> Doc -> Bool #

(>=) :: Doc -> Doc -> Bool #

max :: Doc -> Doc -> Doc #

min :: Doc -> Doc -> Doc #

data SexpF r Source #

An S-expression

Instances

Instances details
Foldable SexpF Source # 
Instance details

Defined in Mello.Syntax

Methods

fold :: Monoid m => SexpF m -> m #

foldMap :: Monoid m => (a -> m) -> SexpF a -> m #

foldMap' :: Monoid m => (a -> m) -> SexpF a -> m #

foldr :: (a -> b -> b) -> b -> SexpF a -> b #

foldr' :: (a -> b -> b) -> b -> SexpF a -> b #

foldl :: (b -> a -> b) -> b -> SexpF a -> b #

foldl' :: (b -> a -> b) -> b -> SexpF a -> b #

foldr1 :: (a -> a -> a) -> SexpF a -> a #

foldl1 :: (a -> a -> a) -> SexpF a -> a #

toList :: SexpF a -> [a] #

null :: SexpF a -> Bool #

length :: SexpF a -> Int #

elem :: Eq a => a -> SexpF a -> Bool #

maximum :: Ord a => SexpF a -> a #

minimum :: Ord a => SexpF a -> a #

sum :: Num a => SexpF a -> a #

product :: Num a => SexpF a -> a #

Traversable SexpF Source # 
Instance details

Defined in Mello.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> SexpF a -> f (SexpF b) #

sequenceA :: Applicative f => SexpF (f a) -> f (SexpF a) #

mapM :: Monad m => (a -> m b) -> SexpF a -> m (SexpF b) #

sequence :: Monad m => SexpF (m a) -> m (SexpF a) #

Functor SexpF Source # 
Instance details

Defined in Mello.Syntax

Methods

fmap :: (a -> b) -> SexpF a -> SexpF b #

(<$) :: a -> SexpF b -> SexpF a #

Monad m => MatchSexp e k m (Memo SexpF k) Source # 
Instance details

Defined in Mello.Match

Methods

matchSexp :: MatchT e k m (Memo SexpF k) Source #

IsString (SexpF r) Source # 
Instance details

Defined in Mello.Syntax

Methods

fromString :: String -> SexpF r #

Num (SexpF a) Source # 
Instance details

Defined in Mello.Syntax

Methods

(+) :: SexpF a -> SexpF a -> SexpF a #

(-) :: SexpF a -> SexpF a -> SexpF a #

(*) :: SexpF a -> SexpF a -> SexpF a #

negate :: SexpF a -> SexpF a #

abs :: SexpF a -> SexpF a #

signum :: SexpF a -> SexpF a #

fromInteger :: Integer -> SexpF a #

Show r => Show (SexpF r) Source # 
Instance details

Defined in Mello.Syntax

Methods

showsPrec :: Int -> SexpF r -> ShowS #

show :: SexpF r -> String #

showList :: [SexpF r] -> ShowS #

Eq r => Eq (SexpF r) Source # 
Instance details

Defined in Mello.Syntax

Methods

(==) :: SexpF r -> SexpF r -> Bool #

(/=) :: SexpF r -> SexpF r -> Bool #

Ord r => Ord (SexpF r) Source # 
Instance details

Defined in Mello.Syntax

Methods

compare :: SexpF r -> SexpF r -> Ordering #

(<) :: SexpF r -> SexpF r -> Bool #

(<=) :: SexpF r -> SexpF r -> Bool #

(>) :: SexpF r -> SexpF r -> Bool #

(>=) :: SexpF r -> SexpF r -> Bool #

max :: SexpF r -> SexpF r -> SexpF r #

min :: SexpF r -> SexpF r -> SexpF r #

Pretty r => Pretty (SexpF r) Source # 
Instance details

Defined in Mello.Syntax

Methods

pretty :: SexpF r -> Doc ann #

prettyList :: [SexpF r] -> Doc ann #

newtype Sexp Source #

Constructors

Sexp 

Fields

Instances

Instances details
IsString Sexp Source # 
Instance details

Defined in Mello.Syntax

Methods

fromString :: String -> Sexp #

Num Sexp Source # 
Instance details

Defined in Mello.Syntax

Methods

(+) :: Sexp -> Sexp -> Sexp #

(-) :: Sexp -> Sexp -> Sexp #

(*) :: Sexp -> Sexp -> Sexp #

negate :: Sexp -> Sexp #

abs :: Sexp -> Sexp #

signum :: Sexp -> Sexp #

fromInteger :: Integer -> Sexp #

Show Sexp Source # 
Instance details

Defined in Mello.Syntax

Methods

showsPrec :: Int -> Sexp -> ShowS #

show :: Sexp -> String #

showList :: [Sexp] -> ShowS #

Eq Sexp Source # 
Instance details

Defined in Mello.Syntax

Methods

(==) :: Sexp -> Sexp -> Bool #

(/=) :: Sexp -> Sexp -> Bool #

Ord Sexp Source # 
Instance details

Defined in Mello.Syntax

Methods

compare :: Sexp -> Sexp -> Ordering #

(<) :: Sexp -> Sexp -> Bool #

(<=) :: Sexp -> Sexp -> Bool #

(>) :: Sexp -> Sexp -> Bool #

(>=) :: Sexp -> Sexp -> Bool #

max :: Sexp -> Sexp -> Sexp #

min :: Sexp -> Sexp -> Sexp #

ToSexp Sexp Source # 
Instance details

Defined in Mello.Print

Methods

toSexp :: Sexp -> Sexp Source #

Pretty Sexp Source # 
Instance details

Defined in Mello.Syntax

Methods

pretty :: Sexp -> Doc ann #

prettyList :: [Sexp] -> Doc ann #

Corecursive Sexp Source # 
Instance details

Defined in Mello.Syntax

Methods

embed :: Base Sexp Sexp -> Sexp #

ana :: (a -> Base Sexp a) -> a -> Sexp #

apo :: (a -> Base Sexp (Either Sexp a)) -> a -> Sexp #

postpro :: Recursive Sexp => (forall b. Base Sexp b -> Base Sexp b) -> (a -> Base Sexp a) -> a -> Sexp #

gpostpro :: (Recursive Sexp, Monad m) => (forall b. m (Base Sexp b) -> Base Sexp (m b)) -> (forall c. Base Sexp c -> Base Sexp c) -> (a -> Base Sexp (m a)) -> a -> Sexp #

Recursive Sexp Source # 
Instance details

Defined in Mello.Syntax

Methods

project :: Sexp -> Base Sexp Sexp #

cata :: (Base Sexp a -> a) -> Sexp -> a #

para :: (Base Sexp (Sexp, a) -> a) -> Sexp -> a #

gpara :: (Corecursive Sexp, Comonad w) => (forall b. Base Sexp (w b) -> w (Base Sexp b)) -> (Base Sexp (EnvT Sexp w a) -> a) -> Sexp -> a #

prepro :: Corecursive Sexp => (forall b. Base Sexp b -> Base Sexp b) -> (Base Sexp a -> a) -> Sexp -> a #

gprepro :: (Corecursive Sexp, Comonad w) => (forall b. Base Sexp (w b) -> w (Base Sexp b)) -> (forall c. Base Sexp c -> Base Sexp c) -> (Base Sexp (w a) -> a) -> Sexp -> a #

Monad m => MatchSexp e k m Sexp Source # 
Instance details

Defined in Mello.Match

Methods

matchSexp :: MatchT e k m Sexp Source #

type Base Sexp Source # 
Instance details

Defined in Mello.Syntax

type Base Sexp = SexpF

data SexpType Source #

Instances

Instances details
Show SexpType Source # 
Instance details

Defined in Mello.Syntax

Eq SexpType Source # 
Instance details

Defined in Mello.Syntax

Ord SexpType Source # 
Instance details

Defined in Mello.Syntax

pattern SexpAtom :: Atom -> Sexp Source #

pattern SexpList :: Brace -> Seq Sexp -> Sexp Source #

pattern SexpQuote :: Sexp -> Sexp Source #

pattern SexpUnquote :: Sexp -> Sexp Source #

pattern SexpDoc :: Doc -> Sexp -> Sexp Source #