schema-0.0.3: Encoding-independent schemas for Haskell data types.
Safe HaskellNone
LanguageHaskell2010

Data.Schema

Documentation

data SchemaF a Source #

Constructors

Empty 
Atom Type 
List a 
Prod [a] 
Field String a 
Sum (Maybe DatatypeName) [a] 
Con String a 
Module String [a] 
Schema [a] 

Instances

Instances details
Functor SchemaF Source # 
Instance details

Defined in Data.Schema.Type

Methods

fmap :: (a -> b) -> SchemaF a -> SchemaF b #

(<$) :: a -> SchemaF b -> SchemaF a #

Foldable SchemaF Source # 
Instance details

Defined in Data.Schema.Type

Methods

fold :: Monoid m => SchemaF m -> m #

foldMap :: Monoid m => (a -> m) -> SchemaF a -> m #

foldMap' :: Monoid m => (a -> m) -> SchemaF a -> m #

foldr :: (a -> b -> b) -> b -> SchemaF a -> b #

foldr' :: (a -> b -> b) -> b -> SchemaF a -> b #

foldl :: (b -> a -> b) -> b -> SchemaF a -> b #

foldl' :: (b -> a -> b) -> b -> SchemaF a -> b #

foldr1 :: (a -> a -> a) -> SchemaF a -> a #

foldl1 :: (a -> a -> a) -> SchemaF a -> a #

toList :: SchemaF a -> [a] #

null :: SchemaF a -> Bool #

length :: SchemaF a -> Int #

elem :: Eq a => a -> SchemaF a -> Bool #

maximum :: Ord a => SchemaF a -> a #

minimum :: Ord a => SchemaF a -> a #

sum :: Num a => SchemaF a -> a #

product :: Num a => SchemaF a -> a #

Traversable SchemaF Source # 
Instance details

Defined in Data.Schema.Type

Methods

traverse :: Applicative f => (a -> f b) -> SchemaF a -> f (SchemaF b) #

sequenceA :: Applicative f => SchemaF (f a) -> f (SchemaF a) #

mapM :: Monad m => (a -> m b) -> SchemaF a -> m (SchemaF b) #

sequence :: Monad m => SchemaF (m a) -> m (SchemaF a) #

Semigroup Schema Source # 
Instance details

Defined in Data.Schema.Type

Eq1 SchemaF Source # 
Instance details

Defined in Data.Schema.Type

Methods

liftEq :: (a -> b -> Bool) -> SchemaF a -> SchemaF b -> Bool #

Read1 SchemaF Source # 
Instance details

Defined in Data.Schema.Type

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (SchemaF a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [SchemaF a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (SchemaF a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [SchemaF a] #

Show1 SchemaF Source # 
Instance details

Defined in Data.Schema.Type

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> SchemaF a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [SchemaF a] -> ShowS #

Eq a => Eq (SchemaF a) Source # 
Instance details

Defined in Data.Schema.Type

Methods

(==) :: SchemaF a -> SchemaF a -> Bool #

(/=) :: SchemaF a -> SchemaF a -> Bool #

Read a => Read (SchemaF a) Source # 
Instance details

Defined in Data.Schema.Type

Show a => Show (SchemaF a) Source # 
Instance details

Defined in Data.Schema.Type

Methods

showsPrec :: Int -> SchemaF a -> ShowS #

show :: SchemaF a -> String #

showList :: [SchemaF a] -> ShowS #

Generic (SchemaF a) Source # 
Instance details

Defined in Data.Schema.Type

Associated Types

type Rep (SchemaF a) :: Type -> Type #

Methods

from :: SchemaF a -> Rep (SchemaF a) x #

to :: Rep (SchemaF a) x -> SchemaF a #

Generic1 SchemaF Source # 
Instance details

Defined in Data.Schema.Type

Associated Types

type Rep1 SchemaF :: k -> Type #

Methods

from1 :: forall (a :: k). SchemaF a -> Rep1 SchemaF a #

to1 :: forall (a :: k). Rep1 SchemaF a -> SchemaF a #

type Rep (SchemaF a) Source # 
Instance details

Defined in Data.Schema.Type

type Rep (SchemaF a)
type Rep1 SchemaF Source # 
Instance details

Defined in Data.Schema.Type

data Type Source #

Instances

Instances details
Eq Type Source # 
Instance details

Defined in Data.Schema.Type

Methods

(==) :: Type -> Type -> Bool #

(/=) :: Type -> Type -> Bool #

Read Type Source # 
Instance details

Defined in Data.Schema.Type

Show Type Source # 
Instance details

Defined in Data.Schema.Type

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

data Builder a Source #

Constructors

Builder 

Fields

Instances

Instances details
Functor Builder Source # 
Instance details

Defined in Data.Schema.Builder

Methods

fmap :: (a -> b) -> Builder a -> Builder b #

(<$) :: a -> Builder b -> Builder a #

Applicative Builder Source # 
Instance details

Defined in Data.Schema.Builder

Methods

pure :: a -> Builder a #

(<*>) :: Builder (a -> b) -> Builder a -> Builder b #

liftA2 :: (a -> b -> c) -> Builder a -> Builder b -> Builder c #

(*>) :: Builder a -> Builder b -> Builder b #

(<*) :: Builder a -> Builder b -> Builder a #

Read a => Read (Builder a) Source # 
Instance details

Defined in Data.Schema.Builder

Show a => Show (Builder a) Source # 
Instance details

Defined in Data.Schema.Builder

Methods

showsPrec :: Int -> Builder a -> ShowS #

show :: Builder a -> String #

showList :: [Builder a] -> ShowS #

Semigroup (Builder a) Source # 
Instance details

Defined in Data.Schema.Builder

Methods

(<>) :: Builder a -> Builder a -> Builder a #

sconcat :: NonEmpty (Builder a) -> Builder a #

stimes :: Integral b => b -> Builder a -> Builder a #

class ToSchema a where Source #

Minimal complete definition

Nothing

Methods

toSchema :: Builder a Source #

default toSchema :: (Generic a, GToSchema (Rep a)) => Builder a Source #

Instances

Instances details
ToSchema a => ToSchema [a] Source # 
Instance details

Defined in Data.Schema.Builder

Methods

toSchema :: Builder [a] Source #