Safe Haskell | None |
---|

S-Expressions are represented by `Sexp`

. Conversions of
arbitrary types to and from `Sexp`

are done via the `Sexpable`

type
class.

The default implementation of Sexpable's `toSexp`

and `fromSexp`

require the type to have a `Data`

instance. In other words, if a
type is representable (which most types are), it is also
`Sexpable`

.

data MyType = Foo { unFoo :: Int } deriving ( Data, Show, Typeable ) instance Sexpable MyType

- data Sexp
- = List [Sexp]
- | Atom ByteString

- class Sexpable a where
- escape :: ByteString -> ByteString
- unescape :: ByteString -> ByteString

# S-Expressions

A `ByteString`

-based S-Expression. Conceptually, a `Sexp`

is
either an single atom represented by a `ByteString`

, or a list of
`Sexp`

.

Type class for things that can be converted to and from S-Expressions.

# Helpers

escape :: ByteString -> ByteStringSource

unescape :: ByteString -> ByteStringSource

The inverse of `escape`

.