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


-- | Describe schemas for your Haskell data types.
--   
--   Please see the README on GitHub at
--   <a>https://github.com/alonsodomin/haskell-schema#readme</a>
@package hschema-aeson
@version 0.0.1.1

module Data.Schema.JSON.Internal.Serializer
newtype JsonSerializer a
JsonSerializer :: (a -> Value) -> JsonSerializer a
[runJsonSerializer] :: JsonSerializer a -> a -> Value
newtype JsonDeserializer a
JsonDeserializer :: (Value -> Parser a) -> JsonDeserializer a
[runJsonDeserializer] :: JsonDeserializer a -> Value -> Parser a
class ToJsonSerializer s
toJsonSerializer :: ToJsonSerializer s => s ~> JsonSerializer
class ToJsonDeserializer s
toJsonDeserializer :: ToJsonDeserializer s => s ~> JsonDeserializer
toJsonSerializerAlg :: ToJsonSerializer p => HAlgebra (SchemaF p) JsonSerializer
toJsonDeserializerAlg :: ToJsonDeserializer p => HAlgebra (SchemaF p) JsonDeserializer
instance (Data.Schema.JSON.Internal.Serializer.ToJsonDeserializer p, Data.Schema.JSON.Internal.Serializer.ToJsonDeserializer q) => Data.Schema.JSON.Internal.Serializer.ToJsonDeserializer (Data.Functor.Sum.Sum p q)
instance Data.Schema.JSON.Internal.Serializer.ToJsonDeserializer p => Data.Schema.JSON.Internal.Serializer.ToJsonDeserializer (Data.Schema.Internal.Types.Schema p)
instance (Data.Schema.JSON.Internal.Serializer.ToJsonSerializer p, Data.Schema.JSON.Internal.Serializer.ToJsonSerializer q) => Data.Schema.JSON.Internal.Serializer.ToJsonSerializer (Data.Functor.Sum.Sum p q)
instance Data.Schema.JSON.Internal.Serializer.ToJsonSerializer p => Data.Schema.JSON.Internal.Serializer.ToJsonSerializer (Data.Schema.Internal.Types.Schema p)
instance GHC.Base.Functor Data.Schema.JSON.Internal.Serializer.JsonDeserializer
instance GHC.Base.Applicative Data.Schema.JSON.Internal.Serializer.JsonDeserializer
instance Data.Functor.Contravariant.Contravariant Data.Schema.JSON.Internal.Serializer.JsonSerializer

module Data.Schema.JSON.Internal.Types
data JsonPrimitive (f :: (* -> *)) (a :: *)
[JsonNumber] :: JsonPrimitive f Scientific
[JsonText] :: JsonPrimitive f Text
[JsonBool] :: JsonPrimitive f Bool
[JsonArray] :: f a -> JsonPrimitive f (Vector a)
[JsonMap] :: f a -> JsonPrimitive f (HashMap Text a)
type JsonType = HMutu JsonPrimitive Schema

-- | Simple JSON schema type
type JsonSchema = Schema JsonType

-- | Simple JSON field type
type JsonField o a = Field JsonSchema o a
instance Data.Schema.JSON.Internal.Serializer.ToJsonSerializer Data.Schema.JSON.Internal.Types.JsonType
instance Data.Schema.JSON.Internal.Serializer.ToJsonDeserializer Data.Schema.JSON.Internal.Types.JsonType
instance Test.Schema.QuickCheck.Internal.Gen.ToGen Data.Schema.JSON.Internal.Types.JsonType
instance Data.Schema.PrettyPrint.ToSchemaDoc Data.Schema.JSON.Internal.Types.JsonType
instance Data.Schema.PrettyPrint.ToSchemaLayout Data.Schema.JSON.Internal.Types.JsonType

module Data.Schema.JSON
type JsonType = HMutu JsonPrimitive Schema

-- | Simple JSON schema type
type JsonSchema = Schema JsonType

-- | Simple JSON field type
type JsonField o a = Field JsonSchema o a
newtype JsonSerializer a
JsonSerializer :: (a -> Value) -> JsonSerializer a
[runJsonSerializer] :: JsonSerializer a -> a -> Value
newtype JsonDeserializer a
JsonDeserializer :: (Value -> Parser a) -> JsonDeserializer a
[runJsonDeserializer] :: JsonDeserializer a -> Value -> Parser a
class ToJsonSerializer s
toJsonSerializer :: ToJsonSerializer s => s ~> JsonSerializer
class ToJsonDeserializer s
toJsonDeserializer :: ToJsonDeserializer s => s ~> JsonDeserializer
data JsonPrimitive (f :: (* -> *)) (a :: *)
[JsonNumber] :: JsonPrimitive f Scientific
[JsonText] :: JsonPrimitive f Text
[JsonBool] :: JsonPrimitive f Bool
[JsonArray] :: f a -> JsonPrimitive f (Vector a)
[JsonMap] :: f a -> JsonPrimitive f (HashMap Text a)
instance (Data.Schema.Internal.Types.HasSchema a, Data.Schema.JSON.Internal.Serializer.ToJsonSerializer (Data.Schema.Internal.Types.PrimitivesOf a)) => Data.Aeson.Types.ToJSON.ToJSON a
instance (Data.Schema.Internal.Types.HasSchema a, Data.Schema.JSON.Internal.Serializer.ToJsonDeserializer (Data.Schema.Internal.Types.PrimitivesOf a)) => Data.Aeson.Types.FromJSON.FromJSON a

module Data.Schema.JSON.Simple

-- | Define a text primitive
text :: JsonSchema Text

-- | Define a string primitive
string :: JsonSchema String

-- | Define a scientific number primitive
number :: JsonSchema Scientific

-- | Define an integral primitive
int :: Integral a => JsonSchema a

-- | Define a floating point primitive
real :: RealFloat a => JsonSchema a
array :: JsonSchema a -> JsonSchema (Vector a)
list :: JsonSchema a -> JsonSchema [a]
hash :: JsonSchema a -> JsonSchema (HashMap Text a)
