-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | No-fuss syntax with s-expressions -- -- Please see the README on GitHub at -- https://github.com/ejconlon/mello#readme @package mello @version 0.3.0 module Mello.Text data Brace BraceParen :: Brace BraceCurly :: Brace BraceSquare :: Brace openBraceChar :: Brace -> Char closeBraceChar :: Brace -> Char readOpenBrace :: Char -> Maybe Brace readCloseBrace :: Char -> Maybe Brace isSymStart :: Char -> Bool isSymCont :: Char -> Bool isListStart :: Char -> Bool isListEnd :: Char -> Bool isCharStart :: Char -> Bool isStringStart :: Char -> Bool isQuoteStart :: Char -> Bool isUnquoteStart :: Char -> Bool isCommentStart :: Char -> Bool isDocCont :: Char -> Bool isNumStart :: Char -> Bool isAtomStart :: Char -> Bool instance GHC.Enum.Bounded Mello.Text.Brace instance GHC.Enum.Enum Mello.Text.Brace instance GHC.Show.Show Mello.Text.Brace instance GHC.Classes.Ord Mello.Text.Brace instance GHC.Classes.Eq Mello.Text.Brace module Mello.Syntax newtype Sym Sym :: Text -> Sym [unSym] :: Sym -> Text -- | Leaves of S-expression trees data Atom AtomSym :: !Sym -> Atom AtomInt :: !Integer -> Atom AtomSci :: !Scientific -> Atom AtomStr :: !Text -> Atom AtomChar :: !Char -> Atom data AtomType AtomTypeSym :: AtomType AtomTypeInt :: AtomType AtomTypeSci :: AtomType AtomTypeStr :: AtomType AtomTypeChar :: AtomType data Brace BraceParen :: Brace BraceCurly :: Brace BraceSquare :: Brace newtype Doc Doc :: Seq Text -> Doc [unDoc] :: Doc -> Seq Text -- | An S-expression data SexpF r SexpAtomF :: !Atom -> SexpF r SexpListF :: !Brace -> !Seq r -> SexpF r SexpQuoteF :: r -> SexpF r SexpUnquoteF :: r -> SexpF r SexpDocF :: !Doc -> r -> SexpF r newtype Sexp Sexp :: SexpF Sexp -> Sexp [unSexp] :: Sexp -> SexpF Sexp data SexpType SexpTypeAtom :: !AtomType -> SexpType SexpTypeList :: !Brace -> SexpType SexpTypeQuote :: SexpType SexpTypeUnquote :: SexpType SexpTypeDoc :: SexpType pattern SexpAtom :: Atom -> Sexp pattern SexpList :: Brace -> Seq Sexp -> Sexp pattern SexpQuote :: Sexp -> Sexp pattern SexpUnquote :: Sexp -> Sexp pattern SexpDoc :: Doc -> Sexp -> Sexp instance Prettyprinter.Internal.Pretty Mello.Syntax.Sym instance Data.String.IsString Mello.Syntax.Sym instance GHC.Classes.Ord Mello.Syntax.Sym instance GHC.Classes.Eq Mello.Syntax.Sym instance GHC.Show.Show Mello.Syntax.Sym instance GHC.Show.Show Mello.Syntax.Atom instance GHC.Classes.Ord Mello.Syntax.Atom instance GHC.Classes.Eq Mello.Syntax.Atom instance GHC.Enum.Bounded Mello.Syntax.AtomType instance GHC.Enum.Enum Mello.Syntax.AtomType instance GHC.Show.Show Mello.Syntax.AtomType instance GHC.Classes.Ord Mello.Syntax.AtomType instance GHC.Classes.Eq Mello.Syntax.AtomType instance GHC.Classes.Ord Mello.Syntax.Doc instance GHC.Classes.Eq Mello.Syntax.Doc instance GHC.Show.Show Mello.Syntax.Doc instance Data.Traversable.Traversable Mello.Syntax.SexpF instance Data.Foldable.Foldable Mello.Syntax.SexpF instance GHC.Base.Functor Mello.Syntax.SexpF instance GHC.Show.Show r => GHC.Show.Show (Mello.Syntax.SexpF r) instance GHC.Classes.Ord r => GHC.Classes.Ord (Mello.Syntax.SexpF r) instance GHC.Classes.Eq r => GHC.Classes.Eq (Mello.Syntax.SexpF r) instance Prettyprinter.Internal.Pretty Mello.Syntax.Sexp instance Data.String.IsString Mello.Syntax.Sexp instance GHC.Num.Num Mello.Syntax.Sexp instance GHC.Classes.Ord Mello.Syntax.Sexp instance GHC.Classes.Eq Mello.Syntax.Sexp instance GHC.Show.Show Mello.Syntax.Sexp instance GHC.Show.Show Mello.Syntax.SexpType instance GHC.Classes.Ord Mello.Syntax.SexpType instance GHC.Classes.Eq Mello.Syntax.SexpType instance Mello.Syntax.IsSexp Mello.Syntax.Sexp instance Data.Functor.Foldable.Recursive Mello.Syntax.Sexp instance Data.Functor.Foldable.Corecursive Mello.Syntax.Sexp instance GHC.Num.Num (Mello.Syntax.SexpF a) instance Data.String.IsString (Mello.Syntax.SexpF r) instance Prettyprinter.Internal.Pretty r => Prettyprinter.Internal.Pretty (Mello.Syntax.SexpF r) instance GHC.Num.Num Mello.Syntax.Atom instance Data.String.IsString Mello.Syntax.Atom instance Prettyprinter.Internal.Pretty Mello.Syntax.Atom module Mello.Print class ToSexp a toSexp :: ToSexp a => a -> Sexp toSexpDoc :: ToSexp a => a -> Doc ann toSexpText :: ToSexp a => a -> Text instance Mello.Print.ToSexp Mello.Syntax.Sexp instance (GHC.Base.Functor f, Mello.Print.ToSexp (f Mello.Syntax.Sexp)) => Mello.Print.ToSexp (Bowtie.Fix.Fix f) instance Mello.Print.ToSexp s => Mello.Print.ToSexp (Bowtie.Anno.Anno k s) instance (GHC.Base.Functor f, Mello.Print.ToSexp (f Mello.Syntax.Sexp)) => Mello.Print.ToSexp (Bowtie.Memo.Memo f k) instance Mello.Print.ToSexp Mello.Syntax.Atom instance Mello.Print.ToSexp Mello.Syntax.Sym instance Mello.Print.ToSexp GHC.Num.Integer.Integer instance Mello.Print.ToSexp GHC.Types.Int instance Mello.Print.ToSexp Data.Scientific.Scientific instance Mello.Print.ToSexp Data.Text.Internal.Text instance Mello.Print.ToSexp GHC.Base.String instance Mello.Print.ToSexp GHC.Types.Char module Mello.Match data MatchErr e r MatchErrType :: !SexpType -> MatchErr e r MatchErrTypeAtom :: MatchErr e r MatchErrTypeQuote :: MatchErr e r MatchErrTypeUnquote :: MatchErr e r MatchErrTypeDoc :: MatchErr e r MatchErrNotEq :: !Atom -> MatchErr e r MatchErrListElem :: !Int -> MatchErr e r MatchErrListRem :: MatchErr e r MatchErrAlt :: !Seq (Text, r) -> MatchErr e r MatchErrEmbed :: !e -> MatchErr e r newtype LocMatchErr e k LocMatchErr :: Anno k (MatchErr e (LocMatchErr e k)) -> LocMatchErr e k [unLocMatchErr] :: LocMatchErr e k -> Anno k (MatchErr e (LocMatchErr e k)) data MatchT e k m a type MatchM e k = MatchT e k Identity runMatchT :: MatchT e k m a -> Memo SexpF k -> m (Either (LocMatchErr e k) a) runMatchM :: MatchM e k a -> Memo SexpF k -> Either (LocMatchErr e k) a data SeqMatchT e k m a type SeqMatchM e k = SeqMatchT e k Identity annoM :: Monad m => MatchT e k m a -> MatchT e k m (Anno k a) memoM :: Monad m => MatchT e k m (f (Memo f k)) -> MatchT e k m (Memo f k) embedM :: Monad m => e -> MatchT e k m a matchM :: Monad m => (SexpF (Memo SexpF k) -> Either (MatchErr e (LocMatchErr e k)) a) -> MatchT e k m a listM :: Monad m => Brace -> SeqMatchT e k m a -> MatchT e k m a lookM :: Monad m => Brace -> [(Text, MatchT e k m (), SeqMatchT e k m a)] -> MatchT e k m a elemM :: MatchT e k m a -> SeqMatchT e k m a restM :: MatchT e k m a -> SeqMatchT e k m (Seq a) repeatM :: SeqMatchT e k m a -> SeqMatchT e k m (Seq a) remainingM :: SeqMatchT e k m Int altM :: Monad m => [(Text, MatchT e k m a)] -> MatchT e k m a anySymM :: Monad m => MatchT e k m Sym symM :: Monad m => Sym -> MatchT e k m () anyIntM :: Monad m => MatchT e k m Integer intM :: Monad m => Integer -> MatchT e k m () anySciM :: Monad m => MatchT e k m Scientific sciM :: Monad m => Scientific -> MatchT e k m () anyStrM :: Monad m => MatchT e k m Text strM :: Monad m => Text -> MatchT e k m () anyCharM :: Monad m => MatchT e k m Char charM :: Monad m => Char -> MatchT e k m () anyAtomM :: Monad m => MatchT e k m Atom quoteM :: Monad m => MatchT e k m (Memo SexpF k) unquoteM :: Monad m => MatchT e k m (Memo SexpF k) docM :: Monad m => MatchT e k m a -> MatchT e k m (Doc, a) class (Monad m) => MatchSexp e k m a matchSexp :: MatchSexp e k m a => MatchT e k m a fromSexpT :: MatchSexp e () m a => Sexp -> m (Either (LocMatchErr e ()) a) fromSexp :: MatchSexp e () Identity a => Sexp -> Either (LocMatchErr e ()) a fromAnnoSexpT :: MatchSexp e k m a => Memo SexpF k -> m (Either (LocMatchErr e k) a) fromAnnoSexp :: MatchSexp e k Identity a => Memo SexpF k -> Either (LocMatchErr e k) a proxyM :: MatchSexp e k m a => Proxy a -> MatchT e k m a instance (GHC.Show.Show r, GHC.Show.Show e) => GHC.Show.Show (Mello.Match.MatchErr e r) instance (GHC.Classes.Ord r, GHC.Classes.Ord e) => GHC.Classes.Ord (Mello.Match.MatchErr e r) instance (GHC.Classes.Eq r, GHC.Classes.Eq e) => GHC.Classes.Eq (Mello.Match.MatchErr e r) instance (GHC.Classes.Ord k, GHC.Classes.Ord e) => GHC.Classes.Ord (Mello.Match.LocMatchErr e k) instance (GHC.Classes.Eq k, GHC.Classes.Eq e) => GHC.Classes.Eq (Mello.Match.LocMatchErr e k) instance (GHC.Show.Show k, GHC.Show.Show e) => GHC.Show.Show (Mello.Match.LocMatchErr e k) instance GHC.Base.Monad m => GHC.Base.Monad (Mello.Match.MatchT e k m) instance GHC.Base.Monad m => GHC.Base.Applicative (Mello.Match.MatchT e k m) instance GHC.Base.Functor m => GHC.Base.Functor (Mello.Match.MatchT e k m) instance GHC.Show.Show k => GHC.Show.Show (Mello.Match.S k) instance GHC.Classes.Ord k => GHC.Classes.Ord (Mello.Match.S k) instance GHC.Classes.Eq k => GHC.Classes.Eq (Mello.Match.S k) instance GHC.Base.Monad m => Mello.Match.MatchSexp e k m Mello.Syntax.Sexp instance GHC.Base.Monad m => Mello.Match.MatchSexp e k m (Bowtie.Memo.Memo Mello.Syntax.SexpF k) instance Mello.Match.MatchSexp e k m s => Mello.Match.MatchSexp e k m (Bowtie.Anno.Anno k s) instance GHC.Base.Monad m => Mello.Match.MatchSexp e k m Mello.Syntax.Atom instance GHC.Base.Monad m => Mello.Match.MatchSexp e k m Mello.Syntax.Sym instance GHC.Base.Monad m => Mello.Match.MatchSexp e k m GHC.Num.Integer.Integer instance GHC.Base.Monad m => Mello.Match.MatchSexp e k m Data.Scientific.Scientific instance GHC.Base.Monad m => Mello.Match.MatchSexp e k m Data.Text.Internal.Text instance GHC.Base.Monad m => Mello.Match.MatchSexp e k m GHC.Types.Char instance GHC.Base.Functor m => GHC.Base.Functor (Mello.Match.SeqMatchT e k m) instance GHC.Base.Monad m => GHC.Base.Applicative (Mello.Match.SeqMatchT e k m) instance GHC.Base.Monad m => GHC.Base.Monad (Mello.Match.SeqMatchT e k m) instance Control.Monad.Trans.Class.MonadTrans (Mello.Match.MatchT e k) instance Control.Monad.Reader.Class.MonadReader r m => Control.Monad.Reader.Class.MonadReader r (Mello.Match.MatchT e k m) instance Control.Monad.State.Class.MonadState s m => Control.Monad.State.Class.MonadState s (Mello.Match.MatchT e k m) instance Control.Monad.Error.Class.MonadError x m => Control.Monad.Error.Class.MonadError x (Mello.Match.MatchT e k m) instance (Data.Typeable.Internal.Typeable e, GHC.Show.Show e, Data.Typeable.Internal.Typeable k, GHC.Show.Show k) => GHC.Exception.Type.Exception (Mello.Match.LocMatchErr e k) instance (Data.Typeable.Internal.Typeable e, GHC.Show.Show e, Data.Typeable.Internal.Typeable r, GHC.Show.Show r) => GHC.Exception.Type.Exception (Mello.Match.MatchErr e r) module Mello.Recognize instance GHC.Show.Show Mello.Recognize.RecogElem instance GHC.Classes.Ord Mello.Recognize.RecogElem instance GHC.Classes.Eq Mello.Recognize.RecogElem instance GHC.Show.Show Mello.Recognize.RecogErr instance GHC.Classes.Ord Mello.Recognize.RecogErr instance GHC.Classes.Eq Mello.Recognize.RecogErr instance GHC.Show.Show Mello.Recognize.RecogState instance GHC.Classes.Ord Mello.Recognize.RecogState instance GHC.Classes.Eq Mello.Recognize.RecogState instance GHC.Show.Show Mello.Recognize.CharCase instance GHC.Classes.Ord Mello.Recognize.CharCase instance GHC.Classes.Eq Mello.Recognize.CharCase module Mello.Parse type OffsetSpan = Span Int type OffsetSexp = Memo SexpF OffsetSpan data Loc Loc :: !Int -> !Int -> !Int -> Loc [locLine] :: Loc -> !Int [locCol] :: Loc -> !Int [locOffset] :: Loc -> !Int type LocSpan = Span Loc type LocSexp = Memo SexpF LocSpan -- | A parser for S-expressions sexpParser :: Monad m => ParserT e m OffsetSexp parseSexp :: Text -> Either (Err Void) LocSexp parseSexpI :: Text -> IO (Either (Err Void) LocSexp) instance GHC.Show.Show Mello.Parse.Loc instance GHC.Classes.Ord Mello.Parse.Loc instance GHC.Classes.Eq Mello.Parse.Loc module Mello data Brace BraceParen :: Brace BraceCurly :: Brace BraceSquare :: Brace