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

Mello.Match

Documentation

data MatchErr e r Source #

Instances

Instances details
(Typeable e, Show e, Typeable r, Show r) => Exception (MatchErr e r) Source # 
Instance details

Defined in Mello.Match

(Show r, Show e) => Show (MatchErr e r) Source # 
Instance details

Defined in Mello.Match

Methods

showsPrec :: Int -> MatchErr e r -> ShowS #

show :: MatchErr e r -> String #

showList :: [MatchErr e r] -> ShowS #

(Eq r, Eq e) => Eq (MatchErr e r) Source # 
Instance details

Defined in Mello.Match

Methods

(==) :: MatchErr e r -> MatchErr e r -> Bool #

(/=) :: MatchErr e r -> MatchErr e r -> Bool #

(Ord r, Ord e) => Ord (MatchErr e r) Source # 
Instance details

Defined in Mello.Match

Methods

compare :: MatchErr e r -> MatchErr e r -> Ordering #

(<) :: MatchErr e r -> MatchErr e r -> Bool #

(<=) :: MatchErr e r -> MatchErr e r -> Bool #

(>) :: MatchErr e r -> MatchErr e r -> Bool #

(>=) :: MatchErr e r -> MatchErr e r -> Bool #

max :: MatchErr e r -> MatchErr e r -> MatchErr e r #

min :: MatchErr e r -> MatchErr e r -> MatchErr e r #

newtype LocMatchErr e k Source #

Constructors

LocMatchErr 

Fields

Instances

Instances details
(Typeable e, Show e, Typeable k, Show k) => Exception (LocMatchErr e k) Source # 
Instance details

Defined in Mello.Match

(Show k, Show e) => Show (LocMatchErr e k) Source # 
Instance details

Defined in Mello.Match

Methods

showsPrec :: Int -> LocMatchErr e k -> ShowS #

show :: LocMatchErr e k -> String #

showList :: [LocMatchErr e k] -> ShowS #

(Eq k, Eq e) => Eq (LocMatchErr e k) Source # 
Instance details

Defined in Mello.Match

Methods

(==) :: LocMatchErr e k -> LocMatchErr e k -> Bool #

(/=) :: LocMatchErr e k -> LocMatchErr e k -> Bool #

(Ord k, Ord e) => Ord (LocMatchErr e k) Source # 
Instance details

Defined in Mello.Match

Methods

compare :: LocMatchErr e k -> LocMatchErr e k -> Ordering #

(<) :: LocMatchErr e k -> LocMatchErr e k -> Bool #

(<=) :: LocMatchErr e k -> LocMatchErr e k -> Bool #

(>) :: LocMatchErr e k -> LocMatchErr e k -> Bool #

(>=) :: LocMatchErr e k -> LocMatchErr e k -> Bool #

max :: LocMatchErr e k -> LocMatchErr e k -> LocMatchErr e k #

min :: LocMatchErr e k -> LocMatchErr e k -> LocMatchErr e k #

data MatchT e k m a Source #

Instances

Instances details
MonadError x m => MonadError x (MatchT e k m) Source # 
Instance details

Defined in Mello.Match

Methods

throwError :: x -> MatchT e k m a #

catchError :: MatchT e k m a -> (x -> MatchT e k m a) -> MatchT e k m a #

MonadReader r m => MonadReader r (MatchT e k m) Source # 
Instance details

Defined in Mello.Match

Methods

ask :: MatchT e k m r #

local :: (r -> r) -> MatchT e k m a -> MatchT e k m a #

reader :: (r -> a) -> MatchT e k m a #

MonadState s m => MonadState s (MatchT e k m) Source # 
Instance details

Defined in Mello.Match

Methods

get :: MatchT e k m s #

put :: s -> MatchT e k m () #

state :: (s -> (a, s)) -> MatchT e k m a #

MonadTrans (MatchT e k) Source # 
Instance details

Defined in Mello.Match

Methods

lift :: Monad m => m a -> MatchT e k m a #

Monad m => Applicative (MatchT e k m) Source # 
Instance details

Defined in Mello.Match

Methods

pure :: a -> MatchT e k m a #

(<*>) :: MatchT e k m (a -> b) -> MatchT e k m a -> MatchT e k m b #

liftA2 :: (a -> b -> c) -> MatchT e k m a -> MatchT e k m b -> MatchT e k m c #

(*>) :: MatchT e k m a -> MatchT e k m b -> MatchT e k m b #

(<*) :: MatchT e k m a -> MatchT e k m b -> MatchT e k m a #

Functor m => Functor (MatchT e k m) Source # 
Instance details

Defined in Mello.Match

Methods

fmap :: (a -> b) -> MatchT e k m a -> MatchT e k m b #

(<$) :: a -> MatchT e k m b -> MatchT e k m a #

Monad m => Monad (MatchT e k m) Source # 
Instance details

Defined in Mello.Match

Methods

(>>=) :: MatchT e k m a -> (a -> MatchT e k m b) -> MatchT e k m b #

(>>) :: MatchT e k m a -> MatchT e k m b -> MatchT e k m b #

return :: a -> MatchT e k m a #

type MatchM e k = MatchT e k Identity Source #

runMatchT :: MatchT e k m a -> Memo SexpF k -> m (Either (LocMatchErr e k) a) Source #

runMatchM :: MatchM e k a -> Memo SexpF k -> Either (LocMatchErr e k) a Source #

data SeqMatchT e k m a Source #

Instances

Instances details
Monad m => Applicative (SeqMatchT e k m) Source # 
Instance details

Defined in Mello.Match

Methods

pure :: a -> SeqMatchT e k m a #

(<*>) :: SeqMatchT e k m (a -> b) -> SeqMatchT e k m a -> SeqMatchT e k m b #

liftA2 :: (a -> b -> c) -> SeqMatchT e k m a -> SeqMatchT e k m b -> SeqMatchT e k m c #

(*>) :: SeqMatchT e k m a -> SeqMatchT e k m b -> SeqMatchT e k m b #

(<*) :: SeqMatchT e k m a -> SeqMatchT e k m b -> SeqMatchT e k m a #

Functor m => Functor (SeqMatchT e k m) Source # 
Instance details

Defined in Mello.Match

Methods

fmap :: (a -> b) -> SeqMatchT e k m a -> SeqMatchT e k m b #

(<$) :: a -> SeqMatchT e k m b -> SeqMatchT e k m a #

Monad m => Monad (SeqMatchT e k m) Source # 
Instance details

Defined in Mello.Match

Methods

(>>=) :: SeqMatchT e k m a -> (a -> SeqMatchT e k m b) -> SeqMatchT e k m b #

(>>) :: SeqMatchT e k m a -> SeqMatchT e k m b -> SeqMatchT e k m b #

return :: a -> SeqMatchT e k m a #

annoM :: Monad m => MatchT e k m a -> MatchT e k m (Anno k a) Source #

memoM :: Monad m => MatchT e k m (f (Memo f k)) -> MatchT e k m (Memo f k) Source #

embedM :: Monad m => e -> MatchT e k m a Source #

matchM :: Monad m => (SexpF (Memo SexpF k) -> Either (MatchErr e (LocMatchErr e k)) a) -> MatchT e k m a Source #

listM :: Monad m => Brace -> SeqMatchT e k m a -> MatchT e k m a Source #

lookM :: Monad m => Brace -> [(Text, MatchT e k m (), SeqMatchT e k m a)] -> MatchT e k m a Source #

elemM :: MatchT e k m a -> SeqMatchT e k m a Source #

restM :: MatchT e k m a -> SeqMatchT e k m (Seq a) Source #

repeatM :: SeqMatchT e k m a -> SeqMatchT e k m (Seq a) Source #

altM :: Monad m => [(Text, MatchT e k m a)] -> MatchT e k m a Source #

anySymM :: Monad m => MatchT e k m Sym Source #

symM :: Monad m => Sym -> MatchT e k m () Source #

intM :: Monad m => Integer -> MatchT e k m () Source #

sciM :: Monad m => Scientific -> MatchT e k m () Source #

strM :: Monad m => Text -> MatchT e k m () Source #

charM :: Monad m => Char -> MatchT e k m () Source #

quoteM :: Monad m => MatchT e k m (Memo SexpF k) Source #

unquoteM :: Monad m => MatchT e k m (Memo SexpF k) Source #

docM :: Monad m => MatchT e k m a -> MatchT e k m (Doc, a) Source #

class Monad m => MatchSexp e k m a where Source #

Methods

matchSexp :: MatchT e k m a Source #

Instances

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

Defined in Mello.Match

Methods

matchSexp :: MatchT e k m Atom Source #

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

Defined in Mello.Match

Methods

matchSexp :: MatchT e k m Sexp Source #

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

Defined in Mello.Match

Methods

matchSexp :: MatchT e k m Sym Source #

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

Defined in Mello.Match

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

Defined in Mello.Match

Methods

matchSexp :: MatchT e k m Text Source #

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

Defined in Mello.Match

Methods

matchSexp :: MatchT e k m Integer Source #

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

Defined in Mello.Match

Methods

matchSexp :: MatchT e k m Char Source #

MatchSexp e k m s => MatchSexp e k m (Anno k s) Source # 
Instance details

Defined in Mello.Match

Methods

matchSexp :: MatchT e k m (Anno k s) Source #

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 #

fromSexpT :: MatchSexp e () m a => Sexp -> m (Either (LocMatchErr e ()) a) Source #

fromAnnoSexpT :: MatchSexp e k m a => Memo SexpF k -> m (Either (LocMatchErr e k) a) Source #

proxyM :: MatchSexp e k m a => Proxy a -> MatchT e k m a Source #