generic-data-0.6.0.1: Deriving instances with GHC.Generics and related utilities

Safe HaskellNone
LanguageHaskell2010

Generic.Data.Internal.Data

Description

Generic representations as data types.

Synopsis

Documentation

newtype Data r p Source #

Synthetic data type.

A wrapper to view a generic Rep as the datatype it's supposed to represent, without needing a declaration.

Constructors

Data 

Fields

Instances
Monad r => Monad (Data r) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

(>>=) :: Data r a -> (a -> Data r b) -> Data r b #

(>>) :: Data r a -> Data r b -> Data r b #

return :: a -> Data r a #

fail :: String -> Data r a #

Functor r => Functor (Data r) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

fmap :: (a -> b) -> Data r a -> Data r b #

(<$) :: a -> Data r b -> Data r a #

Applicative r => Applicative (Data r) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

pure :: a -> Data r a #

(<*>) :: Data r (a -> b) -> Data r a -> Data r b #

liftA2 :: (a -> b -> c) -> Data r a -> Data r b -> Data r c #

(*>) :: Data r a -> Data r b -> Data r b #

(<*) :: Data r a -> Data r b -> Data r a #

Foldable r => Foldable (Data r) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

fold :: Monoid m => Data r m -> m #

foldMap :: Monoid m => (a -> m) -> Data r a -> m #

foldr :: (a -> b -> b) -> b -> Data r a -> b #

foldr' :: (a -> b -> b) -> b -> Data r a -> b #

foldl :: (b -> a -> b) -> b -> Data r a -> b #

foldl' :: (b -> a -> b) -> b -> Data r a -> b #

foldr1 :: (a -> a -> a) -> Data r a -> a #

foldl1 :: (a -> a -> a) -> Data r a -> a #

toList :: Data r a -> [a] #

null :: Data r a -> Bool #

length :: Data r a -> Int #

elem :: Eq a => a -> Data r a -> Bool #

maximum :: Ord a => Data r a -> a #

minimum :: Ord a => Data r a -> a #

sum :: Num a => Data r a -> a #

product :: Num a => Data r a -> a #

Traversable r => Traversable (Data r) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

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

sequenceA :: Applicative f => Data r (f a) -> f (Data r a) #

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

sequence :: Monad m => Data r (m a) -> m (Data r a) #

Contravariant r => Contravariant (Data r) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

contramap :: (a -> b) -> Data r b -> Data r a #

(>$) :: b -> Data r b -> Data r a #

Eq1 r => Eq1 (Data r) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

liftEq :: (a -> b -> Bool) -> Data r a -> Data r b -> Bool #

Ord1 r => Ord1 (Data r) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

liftCompare :: (a -> b -> Ordering) -> Data r a -> Data r b -> Ordering #

GShow1 r => Show1 (Data r) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

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

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

Alternative r => Alternative (Data r) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

empty :: Data r a #

(<|>) :: Data r a -> Data r a -> Data r a #

some :: Data r a -> Data r [a] #

many :: Data r a -> Data r [a] #

MonadPlus r => MonadPlus (Data r) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

mzero :: Data r a #

mplus :: Data r a -> Data r a -> Data r a #

Generic1 (Data r :: Type -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Associated Types

type Rep1 (Data r) :: k -> Type #

Methods

from1 :: Data r a -> Rep1 (Data r) a #

to1 :: Rep1 (Data r) a -> Data r a #

GBounded r => Bounded (Data r p) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

minBound :: Data r p #

maxBound :: Data r p #

GEnum StandardEnum r => Enum (Data r p) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

succ :: Data r p -> Data r p #

pred :: Data r p -> Data r p #

toEnum :: Int -> Data r p #

fromEnum :: Data r p -> Int #

enumFrom :: Data r p -> [Data r p] #

enumFromThen :: Data r p -> Data r p -> [Data r p] #

enumFromTo :: Data r p -> Data r p -> [Data r p] #

enumFromThenTo :: Data r p -> Data r p -> Data r p -> [Data r p] #

Eq (r p) => Eq (Data r p) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

(==) :: Data r p -> Data r p -> Bool #

(/=) :: Data r p -> Data r p -> Bool #

Ord (r p) => Ord (Data r p) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

compare :: Data r p -> Data r p -> Ordering #

(<) :: Data r p -> Data r p -> Bool #

(<=) :: Data r p -> Data r p -> Bool #

(>) :: Data r p -> Data r p -> Bool #

(>=) :: Data r p -> Data r p -> Bool #

max :: Data r p -> Data r p -> Data r p #

min :: Data r p -> Data r p -> Data r p #

(GShow1 r, Show p) => Show (Data r p) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

showsPrec :: Int -> Data r p -> ShowS #

show :: Data r p -> String #

showList :: [Data r p] -> ShowS #

(Functor r, Contravariant r) => Generic (Data r p) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Associated Types

type Rep (Data r p) :: Type -> Type #

Methods

from :: Data r p -> Rep (Data r p) x #

to :: Rep (Data r p) x -> Data r p #

Semigroup (r p) => Semigroup (Data r p) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

(<>) :: Data r p -> Data r p -> Data r p #

sconcat :: NonEmpty (Data r p) -> Data r p #

stimes :: Integral b => b -> Data r p -> Data r p #

Monoid (r p) => Monoid (Data r p) Source # 
Instance details

Defined in Generic.Data.Internal.Data

Methods

mempty :: Data r p #

mappend :: Data r p -> Data r p -> Data r p #

mconcat :: [Data r p] -> Data r p #

type Rep1 (Data r :: Type -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Data

type Rep1 (Data r :: Type -> Type) = r
type Rep (Data r p) Source # 
Instance details

Defined in Generic.Data.Internal.Data

type Rep (Data r p) = r

toData :: Generic a => a -> Data (Rep a) p Source #

Conversion between a generic type and the synthetic type made using its representation.

fromData :: Generic a => Data (Rep a) p -> a Source #

Inverse of fromData.