extensible-0.9.1: Extensible, efficient, optics-friendly data types and effects
Copyright(c) Fumiaki Kinoshita 2018
LicenseBSD3
MaintainerFumiaki Kinoshita <fumiexcel@gmail.com>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Extensible.Dictionary

Description

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

Synopsis

Documentation

library :: forall c xs. Forall c xs => xs :& Compose 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

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

Defined in Data.Extensible.Dictionary

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

Instances

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

Defined in Data.Extensible.Dictionary

Orphan instances

(Lookup xs k v, Wrapper h, Repr h v ~ a) => HasField (k :: k) (RecordOf h xs) a Source # 
Instance details

Methods

getField :: RecordOf h xs -> a #

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

Methods

lift :: Quote m => (xs :& h) -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => (xs :& h) -> Code m (xs :& h) #

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

Methods

lift :: Quote m => (xs :/ h) -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => (xs :/ h) -> Code m (xs :/ h) #

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

Methods

basicUnsafeFreeze :: Mutable Vector s ((x ': xs) :& h) -> ST s (Vector ((x ': xs) :& h)) #

basicUnsafeThaw :: Vector ((x ': xs) :& h) -> ST s (Mutable Vector s ((x ': xs) :& h)) #

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

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

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

basicUnsafeCopy :: Mutable Vector s ((x ': xs) :& h) -> Vector ((x ': xs) :& h) -> ST s () #

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 :: Int -> ST s (MVector s ((x ': xs) :& h)) #

basicInitialize :: MVector s ((x ': xs) :& h) -> ST s () #

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

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

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

basicClear :: MVector s ((x ': xs) :& h) -> ST s () #

basicSet :: MVector s ((x ': xs) :& h) -> ((x ': xs) :& h) -> ST s () #

basicUnsafeCopy :: MVector s ((x ': xs) :& h) -> MVector s ((x ': xs) :& h) -> ST s () #

basicUnsafeMove :: MVector s ((x ': xs) :& h) -> MVector s ((x ': xs) :& h) -> ST s () #

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

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] #

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] #

omittedField :: Maybe (xs :& Field h) #

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

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 #

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

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 #

omitField :: (xs :& Nullable (Field h)) -> Bool #

(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 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 Bounded h xs => Bounded (xs :& h) Source # 
Instance details

Methods

minBound :: xs :& h #

maxBound :: 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 #

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

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

Methods

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

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 ToField h xs => ToRecord (xs :& h) Source # 
Instance details

Methods

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

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 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 Eq h xs, WrapForall Hashable h xs) => Hashable (xs :& h) Source # 
Instance details

Methods

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

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

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

Methods

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

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

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

Associated Types

type Delta (xs :& h) #

Methods

patch :: (xs :& h) -> Delta (xs :& h) -> xs :& h #

diff :: (xs :& h) -> (xs :& h) -> Maybe (Delta (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

Forall (KeyIs KnownSymbol :: Assoc Symbol v -> Constraint) xs => DefaultOrdered (RecordOf h xs) Source # 
Instance details

Methods

headerOrder :: RecordOf h xs -> Header #