-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | EDN parsing and encoding
--   
--   A EDN parsing and encoding library.
--   
--   Based on "specs" published at
--   <a>https://github.com/edn-format/edn</a>.
@package hedn
@version 0.2.0.1

module Data.EDN.AST.Types.Tagged
data Tagged tag a

-- | <pre>
--   #prefix/tag value
--   </pre>
Tagged :: !tag -> !tag -> !a -> Tagged tag a

-- | <pre>
--   value
--   </pre>
NoTag :: !a -> Tagged tag a
stripTag :: Tagged tag a -> a
instance GHC.Base.Functor (Data.EDN.AST.Types.Tagged.Tagged tag)
instance (Data.Data.Data tag, Data.Data.Data a) => Data.Data.Data (Data.EDN.AST.Types.Tagged.Tagged tag a)
instance (GHC.Show.Show tag, GHC.Show.Show a) => GHC.Show.Show (Data.EDN.AST.Types.Tagged.Tagged tag a)
instance (GHC.Classes.Ord tag, GHC.Classes.Ord a) => GHC.Classes.Ord (Data.EDN.AST.Types.Tagged.Tagged tag a)
instance (GHC.Classes.Eq tag, GHC.Classes.Eq a) => GHC.Classes.Eq (Data.EDN.AST.Types.Tagged.Tagged tag a)

module Data.EDN.AST.Types.Value
type TaggedValue = Tagged Text Value
data Value

-- | <pre>
--   nil
--   </pre>
Nil :: Value

-- | <pre>
--   true | false
--   </pre>
Boolean :: !Bool -> Value

-- | <pre>
--   "a string"
--   </pre>
String :: !Text -> Value

-- | <pre>
--   c
--   </pre>
Character :: !Char -> Value

-- | <pre>
--   a-prefix/a-symbol
--   </pre>
Symbol :: !Text -> !Text -> Value

-- | <pre>
--   :a-keyword
--   </pre>
Keyword :: !Text -> Value

-- | <pre>
--   42
--   </pre>
Integer :: !Int -> Value

-- | <pre>
--   3.14
--   </pre>
Floating :: !Double -> Value

-- | <pre>
--   (a list)
--   </pre>
List :: !EDNList -> Value

-- | <pre>
--   [a vector]
--   </pre>
Vec :: !EDNVec -> Value

-- | <pre>
--   {:a map}
--   </pre>
Map :: !EDNMap -> Value

-- | <pre>
--   #{a set}
--   </pre>
Set :: !EDNSet -> Value
type EDNList = [TaggedValue]
type EDNVec = Vector TaggedValue
type EDNMap = Map TaggedValue TaggedValue
type EDNSet = Set TaggedValue
mkList :: Foldable f => f TaggedValue -> Value
mkVec :: Foldable f => f TaggedValue -> Value
mkMap :: Foldable f => f (TaggedValue, TaggedValue) -> Value
mkSet :: Foldable f => f TaggedValue -> Value
instance Data.Data.Data Data.EDN.AST.Types.Value.Value
instance GHC.Show.Show Data.EDN.AST.Types.Value.Value
instance GHC.Classes.Ord Data.EDN.AST.Types.Value.Value
instance GHC.Classes.Eq Data.EDN.AST.Types.Value.Value

module Data.EDN.AST.Types
type Parser = Parsec Void Text

module Data.EDN.AST.Printer

-- | Render EDN document to <a>Text</a>
renderText :: TaggedValue -> Text

-- | Prepare <a>TaggedValue</a>
prettyTaggedValue :: TaggedValue -> Doc a

-- | Prepare <a>Value</a>
prettyValue :: Value -> Doc a

module Data.EDN.AST.Lexer
dropWS :: Parser ()

-- | Whitespace will be consumed after every lexeme automatically, but not
--   before it.
lexeme :: Parser a -> Parser a
symbol :: Text -> Parser Text
integer :: Parser Int
hexadecimal :: Parser Int
floating :: Parser Double

module Data.EDN.AST.Parser
parseText :: Monad m => String -> Text -> m TaggedValue
parseDoc :: Parser TaggedValue
parseTagged :: Parser TaggedValue
parseValue :: Parser Value
parseDiscard :: Parser ()
parseNil :: Parser Value
parseBool :: Parser Value
parseNumber :: Parser Value
parseKeyword :: Parser Value
parseSymbol :: Parser Value
parseCollections :: Parser Value
tagChars :: [Char]
keywordInitialChars :: [Char]
keywordChars :: [Char]
symbolInitialChars :: [Char]
symbolChars :: [Char]
digitChars :: [Char]
lowerChars :: [Char]
upperChars :: [Char]
miscChars :: [Char]


-- | Generic continuation-based parser
module Data.EDN.Class.Parser

-- | Run a <a>Parser</a> reporting to an <a>Either</a>.
parseEither :: (a -> Parser b) -> a -> Either String b

-- | Run a <a>Parser</a> reporting to arbitrary <a>Monad</a> with
--   <a>fail</a>.
parseM :: Monad m => (a -> Parser b) -> a -> m b

-- | A continuation-based parser type.
newtype Parser a
Parser :: (forall f r. Failure f r -> Success a f r -> f r) -> Parser a
[runParser] :: Parser a -> forall f r. Failure f r -> Success a f r -> f r

-- | Success continuation.
type Success a f r = a -> f r

-- | Failure continuation.
type Failure f r = Expected -> String -> f r

-- | Megaparsec-style collection of elements expected by combined parser
--   alternatives.
type Expected = [Label]

-- | Single element expected by a parser. <a>String</a> because
--   <a>MonadFail</a> method.
type Label = String
instance GHC.Base.Functor Data.EDN.Class.Parser.Parser
instance GHC.Base.Applicative Data.EDN.Class.Parser.Parser
instance GHC.Base.Alternative Data.EDN.Class.Parser.Parser
instance Control.Monad.Fail.MonadFail Data.EDN.Class.Parser.Parser
instance GHC.Base.Monad Data.EDN.Class.Parser.Parser
instance GHC.Base.MonadPlus Data.EDN.Class.Parser.Parser
instance GHC.Base.Semigroup (Data.EDN.Class.Parser.Parser a)
instance GHC.Base.Monoid (Data.EDN.Class.Parser.Parser a)

module Data.EDN.Class

-- | A type that can be converted to EDN AST.
class ToEDN a
toEDN :: ToEDN a => a -> TaggedValue
toEDNv :: ToEDN a => a -> Value
toEDNtagged :: ToEDN a => Text -> Text -> a -> TaggedValue

-- | A type that can be converted from EDN, with a possibility of failure.
--   
--   When writing an instance, use <a>unexpected</a> or <a>fail</a> to make
--   a conversion fail, e.g. if an <a>Map</a> is missing a required key, or
--   the value is of the wrong type.
class FromEDN a
parseEDN :: FromEDN a => TaggedValue -> Parser a
parseEDNv :: FromEDN a => Value -> Parser a

-- | Apply appropriate parsers for a value to decode AST.
fromEDN :: (FromEDN a, Monad m) => TaggedValue -> m a
withTagged :: Text -> Text -> (Value -> Parser a) -> TaggedValue -> Parser a
withNoTag :: (Value -> Parser a) -> TaggedValue -> Parser a
withNil :: Parser a -> Value -> Parser a
withBoolean :: (Bool -> Parser a) -> Value -> Parser a
withString :: (Text -> Parser a) -> Value -> Parser a
withCharacter :: (Char -> Parser a) -> Value -> Parser a
withSymbol :: (Text -> Text -> Parser a) -> Value -> Parser a
withKeyword :: (Text -> Parser a) -> Value -> Parser a
withTextual :: (Text -> Parser a) -> Value -> Parser a
withInteger :: (Int -> Parser a) -> Value -> Parser a
withIntegral :: Integral i => (i -> Parser a) -> Value -> Parser a
withFloating :: (Double -> Parser a) -> Value -> Parser a
withFractional :: Fractional f => (f -> Parser a) -> Value -> Parser a
withList :: (EDNList -> Parser a) -> Value -> Parser a
withVec :: (EDNVec -> Parser a) -> Value -> Parser a
withMap :: (EDNMap -> Parser a) -> Value -> Parser a
withSet :: (EDNSet -> Parser a) -> Value -> Parser a

-- | Report an decoding error due to unexpected AST node given. The
--   <a>Parser</a> combines and reports alternatives expected.
unexpected :: Value -> Label -> Parser a

-- | Megaparsec-style collection of elements expected by combined parser
--   alternatives.
type Expected = [Label]

-- | Single element expected by a parser. <a>String</a> because
--   <a>MonadFail</a> method.
type Label = String

-- | Get ix-th element of <a>EDNVec</a> or fail with appropriate message.
vecGet :: FromEDN a => Int -> EDNVec -> Parser a

-- | Get a value from <a>EDNMap</a> and apply a parser to it
mapGetP :: Monad m => TaggedValue -> (TaggedValue -> m a) -> EDNMap -> m a

-- | Get a value from <a>EDNMap</a> for a <a>Keyword</a> key.
mapGetKeyword :: FromEDN a => Text -> EDNMap -> Parser a

-- | Get a value from <a>EDNMap</a> for a <a>String</a> key.
mapGetString :: FromEDN a => Text -> EDNMap -> Parser a

-- | Get a value from <a>EDNMap</a> for a <a>Symbol</a> (empty namespace)
--   key.
mapGetSymbol :: FromEDN a => Text -> EDNMap -> Parser a

-- | Get a value from <a>EDNMap</a> for a <a>Symbol</a> (empty namespace)
--   key.
mapGetSymbolNS :: FromEDN a => Text -> Text -> EDNMap -> Parser a
instance Data.EDN.Class.FromEDN Data.EDN.AST.Types.Value.TaggedValue
instance Data.EDN.Class.FromEDN Data.EDN.AST.Types.Value.Value
instance Data.EDN.Class.FromEDN Data.Void.Void
instance Data.EDN.Class.FromEDN ()
instance Data.EDN.Class.FromEDN GHC.Types.Bool
instance Data.EDN.Class.FromEDN Data.Text.Internal.Text
instance Data.EDN.Class.FromEDN Data.Text.Internal.Lazy.Text
instance Data.EDN.Class.FromEDN GHC.Types.Char
instance Data.EDN.Class.FromEDN GHC.Types.Int
instance Data.EDN.Class.FromEDN GHC.Types.Double
instance Data.EDN.Class.FromEDN a => Data.EDN.Class.FromEDN (GHC.Maybe.Maybe a)
instance Data.EDN.Class.FromEDN a => Data.EDN.Class.FromEDN [a]
instance Data.EDN.Class.FromEDN a => Data.EDN.Class.FromEDN (Data.Vector.Vector a)
instance (Data.EDN.Class.FromEDN a, GHC.Classes.Ord a) => Data.EDN.Class.FromEDN (Data.Set.Internal.Set a)
instance (Data.EDN.Class.FromEDN k, Data.EDN.Class.FromEDN v, GHC.Classes.Ord k) => Data.EDN.Class.FromEDN (Data.Map.Internal.Map k v)
instance (Data.EDN.Class.FromEDN a, Data.EDN.Class.FromEDN b) => Data.EDN.Class.FromEDN (a, b)
instance (Data.EDN.Class.FromEDN a, Data.EDN.Class.FromEDN b, Data.EDN.Class.FromEDN c) => Data.EDN.Class.FromEDN (a, b, c)
instance (Data.EDN.Class.FromEDN a, Data.EDN.Class.FromEDN b, Data.EDN.Class.FromEDN c, Data.EDN.Class.FromEDN d) => Data.EDN.Class.FromEDN (a, b, c, d)
instance Data.EDN.Class.FromEDN Data.Time.Clock.Internal.UTCTime.UTCTime
instance Data.EDN.Class.FromEDN Data.UUID.Types.Internal.UUID
instance Data.EDN.Class.ToEDN Data.EDN.AST.Types.Value.TaggedValue
instance Data.EDN.Class.ToEDN Data.EDN.AST.Types.Value.Value
instance Data.EDN.Class.ToEDN Data.Void.Void
instance Data.EDN.Class.ToEDN ()
instance Data.EDN.Class.ToEDN GHC.Types.Bool
instance Data.EDN.Class.ToEDN Data.Text.Internal.Text
instance Data.EDN.Class.ToEDN Data.Text.Internal.Lazy.Text
instance Data.EDN.Class.ToEDN GHC.Types.Char
instance Data.EDN.Class.ToEDN GHC.Types.Int
instance Data.EDN.Class.ToEDN GHC.Types.Double
instance Data.EDN.Class.ToEDN a => Data.EDN.Class.ToEDN (GHC.Maybe.Maybe a)
instance Data.EDN.Class.ToEDN a => Data.EDN.Class.ToEDN [a]
instance Data.EDN.Class.ToEDN a => Data.EDN.Class.ToEDN (Data.Vector.Vector a)
instance Data.EDN.Class.ToEDN a => Data.EDN.Class.ToEDN (Data.Set.Internal.Set a)
instance (Data.EDN.Class.ToEDN k, Data.EDN.Class.ToEDN v) => Data.EDN.Class.ToEDN (Data.Map.Internal.Map k v)
instance (Data.EDN.Class.ToEDN a, Data.EDN.Class.ToEDN b) => Data.EDN.Class.ToEDN (a, b)
instance (Data.EDN.Class.ToEDN a, Data.EDN.Class.ToEDN b, Data.EDN.Class.ToEDN c) => Data.EDN.Class.ToEDN (a, b, c)
instance (Data.EDN.Class.ToEDN a, Data.EDN.Class.ToEDN b, Data.EDN.Class.ToEDN c, Data.EDN.Class.ToEDN d) => Data.EDN.Class.ToEDN (a, b, c, d)
instance Data.EDN.Class.ToEDN Data.Time.Clock.Internal.UTCTime.UTCTime
instance Data.EDN.Class.ToEDN Data.UUID.Types.Internal.UUID

module Data.EDN

-- | Decode EDN document into AST and parse value using its <a>FromEDN</a>
--   instance.
decodeText :: (FromEDN a, Monad m) => String -> Text -> m a

-- | Convert value to AST using <a>ToEDN</a> instance and render it.
encodeText :: ToEDN a => a -> Text
parseText :: Monad m => String -> Text -> m TaggedValue

-- | Render EDN document to <a>Text</a>
renderText :: TaggedValue -> Text
type TaggedValue = Tagged Text Value
data Tagged tag a

-- | <pre>
--   #prefix/tag value
--   </pre>
Tagged :: !tag -> !tag -> !a -> Tagged tag a

-- | <pre>
--   value
--   </pre>
NoTag :: !a -> Tagged tag a
stripTag :: Tagged tag a -> a
data Value

-- | <pre>
--   nil
--   </pre>
Nil :: Value

-- | <pre>
--   true | false
--   </pre>
Boolean :: !Bool -> Value

-- | <pre>
--   "a string"
--   </pre>
String :: !Text -> Value

-- | <pre>
--   c
--   </pre>
Character :: !Char -> Value

-- | <pre>
--   a-prefix/a-symbol
--   </pre>
Symbol :: !Text -> !Text -> Value

-- | <pre>
--   :a-keyword
--   </pre>
Keyword :: !Text -> Value

-- | <pre>
--   42
--   </pre>
Integer :: !Int -> Value

-- | <pre>
--   3.14
--   </pre>
Floating :: !Double -> Value

-- | <pre>
--   (a list)
--   </pre>
List :: !EDNList -> Value

-- | <pre>
--   [a vector]
--   </pre>
Vec :: !EDNVec -> Value

-- | <pre>
--   {:a map}
--   </pre>
Map :: !EDNMap -> Value

-- | <pre>
--   #{a set}
--   </pre>
Set :: !EDNSet -> Value
type EDNList = [TaggedValue]
type EDNVec = Vector TaggedValue
type EDNMap = Map TaggedValue TaggedValue
type EDNSet = Set TaggedValue
mkList :: Foldable f => f TaggedValue -> Value
mkVec :: Foldable f => f TaggedValue -> Value
mkMap :: Foldable f => f (TaggedValue, TaggedValue) -> Value
mkSet :: Foldable f => f TaggedValue -> Value

-- | A type that can be converted to EDN AST.
class ToEDN a
toEDN :: ToEDN a => a -> TaggedValue
toEDNv :: ToEDN a => a -> Value
toEDNtagged :: ToEDN a => Text -> Text -> a -> TaggedValue

-- | A type that can be converted from EDN, with a possibility of failure.
--   
--   When writing an instance, use <a>unexpected</a> or <a>fail</a> to make
--   a conversion fail, e.g. if an <a>Map</a> is missing a required key, or
--   the value is of the wrong type.
class FromEDN a
parseEDN :: FromEDN a => TaggedValue -> Parser a
parseEDNv :: FromEDN a => Value -> Parser a

-- | Apply appropriate parsers for a value to decode AST.
fromEDN :: (FromEDN a, Monad m) => TaggedValue -> m a
withTagged :: Text -> Text -> (Value -> Parser a) -> TaggedValue -> Parser a
withNoTag :: (Value -> Parser a) -> TaggedValue -> Parser a
withNil :: Parser a -> Value -> Parser a
withBoolean :: (Bool -> Parser a) -> Value -> Parser a
withString :: (Text -> Parser a) -> Value -> Parser a
withCharacter :: (Char -> Parser a) -> Value -> Parser a
withSymbol :: (Text -> Text -> Parser a) -> Value -> Parser a
withKeyword :: (Text -> Parser a) -> Value -> Parser a
withTextual :: (Text -> Parser a) -> Value -> Parser a
withInteger :: (Int -> Parser a) -> Value -> Parser a
withIntegral :: Integral i => (i -> Parser a) -> Value -> Parser a
withFloating :: (Double -> Parser a) -> Value -> Parser a
withFractional :: Fractional f => (f -> Parser a) -> Value -> Parser a
withList :: (EDNList -> Parser a) -> Value -> Parser a
withVec :: (EDNVec -> Parser a) -> Value -> Parser a
withMap :: (EDNMap -> Parser a) -> Value -> Parser a
withSet :: (EDNSet -> Parser a) -> Value -> Parser a

-- | Report an decoding error due to unexpected AST node given. The
--   <a>Parser</a> combines and reports alternatives expected.
unexpected :: Value -> Label -> Parser a

-- | Get ix-th element of <a>EDNVec</a> or fail with appropriate message.
vecGet :: FromEDN a => Int -> EDNVec -> Parser a

-- | Get a value from <a>EDNMap</a> for a <a>Keyword</a> key.
mapGetKeyword :: FromEDN a => Text -> EDNMap -> Parser a

-- | Get a value from <a>EDNMap</a> for a <a>String</a> key.
mapGetString :: FromEDN a => Text -> EDNMap -> Parser a

-- | Get a value from <a>EDNMap</a> for a <a>Symbol</a> (empty namespace)
--   key.
mapGetSymbol :: FromEDN a => Text -> EDNMap -> Parser a

-- | Get a value from <a>EDNMap</a> for a <a>Symbol</a> (empty namespace)
--   key.
mapGetSymbolNS :: FromEDN a => Text -> Text -> EDNMap -> Parser a

module Data.EDN.QQ

-- | Quasiquoter for <a>TaggedValue</a>.
--   
--   <pre>
--   Tagged "foo" "bar" Nil === [edn| #foo/bar nil |]
--   </pre>
edn :: QuasiQuoter

-- | Quasiquoter for untagged <a>Value</a> wrapped in a List.
--   
--   <pre>
--   [ednList| #foo/bar nil |]
--   ===
--   List [ Tagged "foo" "bar" Nil ]
--   </pre>
ednList :: QuasiQuoter

-- | Quasiquoter for untagged <a>Value</a> wrapped in a Map.
--   
--   <pre>
--   [ednMap| :key value |]
--   ===
--   Map [ (NoTag (Keyword "key"), NoTag (Symbol "" "value")) ]
--   </pre>
ednMap :: QuasiQuoter

-- | Quasiquoter for untagged <a>Value</a> wrapped in a Vec.
--   
--   <pre>
--   [ednVec| #foo/bar nil |]
--   ===
--   Vec [ Tagged "foo" "bar" Nil ]
--   </pre>
ednVec :: QuasiQuoter

-- | Quasiquoter for untagged <a>Value</a> wrapped in a Set.
--   
--   <pre>
--   [ednList| #foo/bar nil |]
--   ===
--   List [ Tagged "foo" "bar" Nil ]
--   </pre>
ednSet :: QuasiQuoter

-- | Specializable QuasiQuoter for compile-time decoding.
--   
--   <pre>
--   ednPerson = fromEDN @Person
--   </pre>
--   
--   And in another module (a TH restriction):
--   
--   <pre>
--   theFred = [ednPerson| #myapp/Person { :first "Fred" } |]
--   </pre>
fromEDN :: forall a. (Lift a, FromEDN a) => QuasiQuoter
instance Data.Data.Data a => Language.Haskell.TH.Syntax.Lift (Data.EDN.AST.Types.Tagged.Tagged Data.Text.Internal.Text a)
instance Language.Haskell.TH.Syntax.Lift Data.EDN.AST.Types.Value.Value
