extensible-0.6: Extensible, efficient, optics-friendly data types and effects

Copyright(c) Fumiaki Kinoshita 2018
LicenseBSD3
MaintainerFumiaki Kinoshita <fumiexcel@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Data.Extensible.Dictionary

Contents

Description

Reification of constraints using extensible data types. Also includes orphan instances.

Synopsis

Documentation

library :: forall c xs. Forall c xs => xs :& Comp Dict c Source #

Reify a collection of dictionaries, as you wish.

type WrapForall c h = Forall (Instance1 c h) Source #

Forall upon a wrapper

class c (h x) => Instance1 c h x Source #

Composition for a class and a wrapper

Instances
c (h x) => Instance1 (c :: k2 -> Constraint) (h :: k1 -> k2) (x :: k1) Source # 
Instance details

Defined in Data.Extensible.Dictionary

class (f x, g x) => And f g x Source #

Instances
(f x, g x) => And (f :: k -> Constraint) (g :: k -> Constraint) (x :: k) Source # 
Instance details

Defined in Data.Extensible.Dictionary

Orphan instances

Unbox a => Vector Vector (Identity a) Source # 
Instance details

Unbox a => MVector MVector (Identity a) Source # 
Instance details

Generate xs => ProductBC ((:&) xs :: (k -> Type) -> Type) Source # 
Instance details

Methods

bdicts :: AllB c ((:&) xs) => xs :& Dict c #

ConstraintsB ((:/) xs :: (k -> Type) -> Type) Source # 
Instance details

Associated Types

type AllB c ((:/) xs) :: Constraint #

Methods

baddDicts :: AllB c ((:/) xs) => (xs :/ f) -> xs :/ Product (Dict c) f #

ConstraintsB ((:&) xs :: (k -> Type) -> Type) Source # 
Instance details

Associated Types

type AllB c ((:&) xs) :: Constraint #

Methods

baddDicts :: AllB c ((:&) xs) => (xs :& f) -> xs :& Product (Dict c) f #

Generate xs => ProductB ((:&) xs :: (k -> Type) -> Type) Source # 
Instance details

Methods

bprod :: (xs :& f) -> (xs :& g) -> xs :& Product f g #

buniq :: (forall (a :: k0). f a) -> xs :& f #

TraversableB ((:/) xs :: (k -> Type) -> Type) Source # 
Instance details

Methods

btraverse :: Applicative t => (forall (a :: k0). f a -> t (g a)) -> (xs :/ f) -> t (xs :/ g) #

TraversableB ((:&) xs :: (k -> Type) -> Type) Source # 
Instance details

Methods

btraverse :: Applicative t => (forall (a :: k0). f a -> t (g a)) -> (xs :& f) -> t (xs :& g) #

FunctorB ((:/) xs :: (k -> Type) -> Type) Source # 
Instance details

Methods

bmap :: (forall (a :: k0). f a -> g a) -> (xs :/ f) -> xs :/ g #

FunctorB ((:&) xs :: (k -> Type) -> Type) Source # 
Instance details

Methods

bmap :: (forall (a :: k0). f a -> g a) -> (xs :& f) -> xs :& g #

WrapForall Unbox h (x ': xs) => Vector Vector ((x ': xs) :& h) Source # 
Instance details

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) ((x ': xs) :& h) -> m (Vector ((x ': xs) :& h)) #

basicUnsafeThaw :: PrimMonad m => Vector ((x ': xs) :& h) -> m (Mutable Vector (PrimState m) ((x ': xs) :& h)) #

basicLength :: Vector ((x ': xs) :& h) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector ((x ': xs) :& h) -> Vector ((x ': xs) :& h) #

basicUnsafeIndexM :: Monad m => Vector ((x ': xs) :& h) -> Int -> m ((x ': xs) :& h) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) ((x ': xs) :& h) -> Vector ((x ': xs) :& h) -> m () #

elemseq :: Vector ((x ': xs) :& h) -> ((x ': xs) :& h) -> b -> b #

WrapForall Unbox h (x ': xs) => MVector MVector ((x ': xs) :& h) Source # 
Instance details

Methods

basicLength :: MVector s ((x ': xs) :& h) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s ((x ': xs) :& h) -> MVector s ((x ': xs) :& h) #

basicOverlaps :: MVector s ((x ': xs) :& h) -> MVector s ((x ': xs) :& h) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) ((x ': xs) :& h)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) ((x ': xs) :& h) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> ((x ': xs) :& h) -> m (MVector (PrimState m) ((x ': xs) :& h)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) ((x ': xs) :& h) -> Int -> m ((x ': xs) :& h) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) ((x ': xs) :& h) -> Int -> ((x ': xs) :& h) -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) ((x ': xs) :& h) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) ((x ': xs) :& h) -> ((x ': xs) :& h) -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) ((x ': xs) :& h) -> MVector (PrimState m) ((x ': xs) :& h) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) ((x ': xs) :& h) -> MVector (PrimState m) ((x ': xs) :& h) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) ((x ': xs) :& h) -> Int -> m (MVector (PrimState m) ((x ': xs) :& h)) #

Unbox a => Unbox (Identity a) Source # 
Instance details

WrapForall Bounded h xs => Bounded (xs :& h) Source # 
Instance details

Methods

minBound :: xs :& h #

maxBound :: xs :& h #

WrapForall Eq h xs => Eq (xs :/ h) Source # 
Instance details

Methods

(==) :: (xs :/ h) -> (xs :/ h) -> Bool #

(/=) :: (xs :/ h) -> (xs :/ h) -> Bool #

WrapForall Eq h xs => Eq (xs :& h) Source # 
Instance details

Methods

(==) :: (xs :& h) -> (xs :& h) -> Bool #

(/=) :: (xs :& h) -> (xs :& h) -> Bool #

(Eq (xs :/ h), WrapForall Ord h xs) => Ord (xs :/ h) Source # 
Instance details

Methods

compare :: (xs :/ h) -> (xs :/ h) -> Ordering #

(<) :: (xs :/ h) -> (xs :/ h) -> Bool #

(<=) :: (xs :/ h) -> (xs :/ h) -> Bool #

(>) :: (xs :/ h) -> (xs :/ h) -> Bool #

(>=) :: (xs :/ h) -> (xs :/ h) -> Bool #

max :: (xs :/ h) -> (xs :/ h) -> xs :/ h #

min :: (xs :/ h) -> (xs :/ h) -> xs :/ h #

(Eq (xs :& h), WrapForall Ord h xs) => Ord (xs :& h) Source # 
Instance details

Methods

compare :: (xs :& h) -> (xs :& h) -> Ordering #

(<) :: (xs :& h) -> (xs :& h) -> Bool #

(<=) :: (xs :& h) -> (xs :& h) -> Bool #

(>) :: (xs :& h) -> (xs :& h) -> Bool #

(>=) :: (xs :& h) -> (xs :& h) -> Bool #

max :: (xs :& h) -> (xs :& h) -> xs :& h #

min :: (xs :& h) -> (xs :& h) -> xs :& h #

WrapForall Show h xs => Show (xs :/ h) Source # 
Instance details

Methods

showsPrec :: Int -> (xs :/ h) -> ShowS #

show :: (xs :/ h) -> String #

showList :: [xs :/ h] -> ShowS #

WrapForall Show h xs => Show (xs :& h) Source # 
Instance details

Methods

showsPrec :: Int -> (xs :& h) -> ShowS #

show :: (xs :& h) -> String #

showList :: [xs :& h] -> ShowS #

WrapForall Semigroup h xs => Semigroup (xs :& h) Source # 
Instance details

Methods

(<>) :: (xs :& h) -> (xs :& h) -> xs :& h #

sconcat :: NonEmpty (xs :& h) -> xs :& h #

stimes :: Integral b => b -> (xs :& h) -> xs :& h #

(WrapForall Semigroup h xs, WrapForall Monoid h xs) => Monoid (xs :& h) Source # 
Instance details

Methods

mempty :: xs :& h #

mappend :: (xs :& h) -> (xs :& h) -> xs :& h #

mconcat :: [xs :& h] -> xs :& h #

WrapForall Lift h xs => Lift (xs :/ h) Source # 
Instance details

Methods

lift :: (xs :/ h) -> Q Exp #

WrapForall Lift h xs => Lift (xs :& h) Source # 
Instance details

Methods

lift :: (xs :& h) -> Q Exp #

WrapForall Arbitrary h xs => Arbitrary (xs :/ h) Source # 
Instance details

Methods

arbitrary :: Gen (xs :/ h) #

shrink :: (xs :/ h) -> [xs :/ h] #

WrapForall Arbitrary h xs => Arbitrary (xs :& h) Source # 
Instance details

Methods

arbitrary :: Gen (xs :& h) #

shrink :: (xs :& h) -> [xs :& h] #

WrapForall Hashable h xs => Hashable (xs :/ h) Source # 
Instance details

Methods

hashWithSalt :: Int -> (xs :/ h) -> Int #

hash :: (xs :/ h) -> Int #

WrapForall Hashable h xs => Hashable (xs :& h) Source # 
Instance details

Methods

hashWithSalt :: Int -> (xs :& h) -> Int #

hash :: (xs :& h) -> Int #

Forall (KeyTargetAre KnownSymbol (Instance1 ToJSON h)) xs => ToJSON (xs :& Nullable (Field h :: Assoc Symbol v -> Type)) Source # 
Instance details

Methods

toJSON :: (xs :& Nullable (Field h)) -> Value #

toEncoding :: (xs :& Nullable (Field h)) -> Encoding #

toJSONList :: [xs :& Nullable (Field h)] -> Value #

toEncodingList :: [xs :& Nullable (Field h)] -> Encoding #

Forall (KeyTargetAre KnownSymbol (Instance1 ToJSON h)) xs => ToJSON (xs :& (Field h :: Assoc Symbol v -> Type)) Source # 
Instance details

Methods

toJSON :: (xs :& Field h) -> Value #

toEncoding :: (xs :& Field h) -> Encoding #

toJSONList :: [xs :& Field h] -> Value #

toEncodingList :: [xs :& Field h] -> Encoding #

Forall (KeyTargetAre KnownSymbol (Instance1 FromJSON h)) xs => FromJSON (xs :& Nullable (Field h :: Assoc Symbol v -> Type)) Source # 
Instance details

Forall (KeyTargetAre KnownSymbol (Instance1 FromJSON h)) xs => FromJSON (xs :& (Field h :: Assoc Symbol v -> Type)) Source #

parseJSON Null is called for missing fields.

Instance details

Methods

parseJSON :: Value -> Parser (xs :& Field h) #

parseJSONList :: Value -> Parser [xs :& Field h] #

WrapForall FromField h xs => FromRecord (xs :& h) Source # 
Instance details

Methods

parseRecord :: Record -> Parser (xs :& h) #

WrapForall ToField h xs => ToRecord (xs :& h) Source # 
Instance details

Methods

toRecord :: (xs :& h) -> Record #

Forall (KeyTargetAre KnownSymbol (Instance1 FromField h)) xs => FromNamedRecord (xs :& (Field h :: Assoc Symbol v -> Type)) Source # 
Instance details

Forall (KeyTargetAre KnownSymbol (Instance1 ToField h)) xs => ToNamedRecord (xs :& (Field h :: Assoc Symbol v -> Type)) Source # 
Instance details

Methods

toNamedRecord :: (xs :& Field h) -> NamedRecord #

WrapForall NFData h xs => NFData (xs :/ h) Source # 
Instance details

Methods

rnf :: (xs :/ h) -> () #

WrapForall NFData h xs => NFData (xs :& h) Source # 
Instance details

Methods

rnf :: (xs :& h) -> () #

WrapForall Pretty h xs => Pretty (xs :/ h) Source # 
Instance details

Methods

pretty :: (xs :/ h) -> Doc ann #

prettyList :: [xs :/ h] -> Doc ann #

WrapForall Pretty h xs => Pretty (xs :& h) Source # 
Instance details

Methods

pretty :: (xs :& h) -> Doc ann #

prettyList :: [xs :& h] -> Doc ann #

WrapForall Unbox h (x ': xs) => Unbox ((x ': xs) :& h) Source # 
Instance details