A Sexpr is an S-expressionin the style of Rivest's Canonical S-expressions. Atoms may be of any type, but String and ByteString have special support. Rivest's implementation of S-expressions is unusual in supporting MIME type hints for each atom. See http:people.csail.mit.edurivestSexp.txt
- data Sexpr s
- isAtom :: Sexpr a -> Bool
- isList :: Sexpr a -> Bool
- atom :: a -> Sexpr a
- list :: [Sexpr a] -> Sexpr a
- unAtom :: Sexpr s -> s
- unList :: Sexpr s -> [Sexpr s]
- hintedAtom :: String -> a -> Sexpr a
- hint :: Sexpr a -> Maybe String
- defaultHint :: String
- isTokenChar :: Char -> Bool
- isInitialTokenChar :: Char -> Bool
- isQuoteableChar :: Char -> Bool
A predicate for identifying atoms, whether or not they have explicit hints.
Extract the sub-S-expressions of a List. If all you intend to do is traverse or map over that list, the Functor instance of S-expressions may work just fine.
Extract the hint of an atom. Lists do not have hints, but all atoms have hints.
Any atom whose hint is not specified is assumed to be text/plain; charset=iso-8859-1. This is that default value.
Character predicates to support encoding
Tokens may internally contain any of the characters legitimate to begin tokens, or any numeral.
Tokens may begin with any alphabetic character or the characters