Safe Haskell | None |
---|---|
Language | Haskell2010 |
- decode :: ByteString -> Either String Sexp
- parseSexp :: FilePath -> ByteString -> Either String Sexp
- parseSexps :: FilePath -> ByteString -> Either String [Sexp]
- parseSexpWithPos :: Position -> ByteString -> Either String Sexp
- parseSexpsWithPos :: Position -> ByteString -> Either String [Sexp]
- encode :: Sexp -> ByteString
- format :: Sexp -> ByteString
- type Sexp = Fix (Compose (LocatedBy Position) SexpF)
- pattern Atom :: Atom -> Sexp
- pattern Number :: Scientific -> Sexp
- pattern Symbol :: Text -> Sexp
- pattern String :: Text -> Sexp
- pattern ParenList :: [Sexp] -> Sexp
- pattern BracketList :: [Sexp] -> Sexp
- pattern BraceList :: [Sexp] -> Sexp
- pattern Modified :: Prefix -> Sexp -> Sexp
- data SexpF e
- = AtomF !Atom
- | ParenListF [e]
- | BracketListF [e]
- | BraceListF [e]
- | ModifiedF !Prefix e
- data Atom
- = AtomNumber !Scientific
- | AtomString !Text
- | AtomSymbol !Text
- data Prefix
- data LocatedBy a e = !a :< e
- data Position = Position FilePath !Int !Int
- newtype Compose k k1 (f :: k -> *) (g :: k1 -> k) (a :: k1) :: forall k k1. (k -> *) -> (k1 -> k) -> k1 -> * = Compose {
- getCompose :: f (g a)
- newtype Fix (f :: * -> *) :: (* -> *) -> * = Fix (f (Fix f))
- dummyPos :: Position
- fromSimple :: Fix SexpF -> Fix (Compose (LocatedBy Position) SexpF)
- toSimple :: Fix (Compose (LocatedBy Position) SexpF) -> Fix SexpF
Parse and print
parseSexps :: FilePath -> ByteString -> Either String [Sexp] Source #
Parse multiple Sexp
from a string.
parseSexpWithPos :: Position -> ByteString -> Either String Sexp Source #
Parse a Sexp
from a string, starting from a given
position. Useful for embedding into other parsers.
parseSexpsWithPos :: Position -> ByteString -> Either String [Sexp] Source #
Parse multiple Sexp
from a string, starting from a given
position. Useful for embedding into other parsers.
Type
type Sexp = Fix (Compose (LocatedBy Position) SexpF) Source #
S-expression type annotated with positions. Useful for further parsing.
pattern Number :: Scientific -> Sexp Source #
pattern BracketList :: [Sexp] -> Sexp Source #
Internal types
S-expression functor
AtomF !Atom | |
ParenListF [e] | |
BracketListF [e] | |
BraceListF [e] | |
ModifiedF !Prefix e |
S-expression atom type
S-expression quotation type
Annotation functor for positions
!a :< e |
Bifunctor LocatedBy Source # | |
Functor (LocatedBy a) Source # | |
Foldable (LocatedBy a) Source # | |
Traversable (LocatedBy a) Source # | |
Eq p => Eq1 (LocatedBy p) Source # | |
NFData (Fix (Compose * * (LocatedBy Position) SexpF)) Source # | |
(Eq e, Eq a) => Eq (LocatedBy a e) Source # | |
(Ord e, Ord a) => Ord (LocatedBy a e) Source # | |
(Show e, Show a) => Show (LocatedBy a e) Source # | |
Generic (LocatedBy a e) Source # | |
type Rep (LocatedBy a e) Source # | |
Position: file name, line number, column number
newtype Compose k k1 (f :: k -> *) (g :: k1 -> k) (a :: k1) :: forall k k1. (k -> *) -> (k1 -> k) -> k1 -> * infixr 9 #
Right-to-left composition of functors. The composition of applicative functors is always applicative, but the composition of monads is not always a monad.
Compose infixr 9 | |
|
Functor f => Generic1 k (Compose * k f g) | |
NFData (Fix (Compose * * (LocatedBy Position) SexpF)) # | |
(Functor f, Functor g) => Functor (Compose * * f g) | Since: 4.9.0.0 |
(Applicative f, Applicative g) => Applicative (Compose * * f g) | Since: 4.9.0.0 |
(Foldable f, Foldable g) => Foldable (Compose * * f g) | Since: 4.9.0.0 |
(Traversable f, Traversable g) => Traversable (Compose * * f g) | Since: 4.9.0.0 |
(Eq1 f, Eq1 g) => Eq1 (Compose * * f g) | Since: 4.9.0.0 |
(Ord1 f, Ord1 g) => Ord1 (Compose * * f g) | Since: 4.9.0.0 |
(Read1 f, Read1 g) => Read1 (Compose * * f g) | Since: 4.9.0.0 |
(Show1 f, Show1 g) => Show1 (Compose * * f g) | Since: 4.9.0.0 |
(Alternative f, Applicative g) => Alternative (Compose * * f g) | Since: 4.9.0.0 |
(NFData1 f, NFData1 g) => NFData1 (Compose * * f g) | Since: 1.4.3.0 |
(Eq1 f, Eq1 g, Eq a) => Eq (Compose * * f g a) | Since: 4.9.0.0 |
(Data (f (g a)), Typeable * k2, Typeable * k1, Typeable (k2 -> k1) g, Typeable (k1 -> *) f, Typeable k2 a) => Data (Compose k1 k2 f g a) | |
(Ord1 f, Ord1 g, Ord a) => Ord (Compose * * f g a) | Since: 4.9.0.0 |
(Read1 f, Read1 g, Read a) => Read (Compose * * f g a) | Since: 4.9.0.0 |
(Show1 f, Show1 g, Show a) => Show (Compose * * f g a) | Since: 4.9.0.0 |
Generic (Compose k1 k2 f g a) | |
(NFData1 f, NFData1 g, NFData a) => NFData (Compose * * f g a) | Since: 1.4.3.0 |
type Rep1 k (Compose * k f g) | |
type Rep (Compose k1 k2 f g a) | |
newtype Fix (f :: * -> *) :: (* -> *) -> * #
Eq1 f => Eq (Fix f) | |
(Typeable (* -> *) f, Data (f (Fix f))) => Data (Fix f) | |
Ord1 f => Ord (Fix f) | |
Read1 f => Read (Fix f) | |
Show1 f => Show (Fix f) | |
NFData (Fix (Compose * * (LocatedBy Position) SexpF)) # | |
NFData (Fix SexpF) # | |
Functor f => Recursive (Fix f) | |
Functor f => Corecursive (Fix f) | |
type Base (Fix f) | |