Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Supporting definitions used by both the simple and the advanced interface
To use the anonymous records library, you will want to use either the simple
interface in Data.Record.Anon.Simple or the advanced interface in
Data.Record.Anon.Advanced. This module provides definitions that are used
by both. Moreover, unlike .Simple
and .Advanced
, this module is designed
to be imported unqualified. A typical import section will therefore look
something like
import Data.Record.Anon import Data.Record.Anon.Simple (Record) import qualified Data.Record.Anon.Simple as Anon
In addition, since the classes and type families defined here as handled by the plugin, you will also want to enable that:
{-# OPTIONS_GHC -fplugin=Data.Record.Anon.Plugin #-}
Synopsis
- pattern (:=) :: a -> b -> Pair a b
- type Row k = [Pair Symbol k]
- type family Merge :: Row k -> Row k -> Row k
- class AllFields (r :: Row k) (c :: k -> Constraint)
- class KnownFields (r :: Row k)
- class SubRow (r :: Row k) (r' :: Row k)
- class RowHasField (n :: Symbol) (r :: Row k) (a :: k) | n r -> a
- data Field n
- class KnownHash (s :: Symbol) where
- type family FieldTypes (f :: k -> Type) (r :: Row k) :: [(Symbol, Type)]
- type family SimpleFieldTypes (r :: Row Type) :: [(Symbol, Type)]
- data Some (f :: k -> Type) where
- data Reflected c where
- data Product (f :: k -> Type) (g :: k -> Type) (a :: k) = Pair (f a) (g a)
- data Proxy (t :: k) = Proxy
- newtype ((f :: l -> Type) :.: (g :: k -> l)) (p :: k) = Comp (f (g p))
- newtype I a = I a
- newtype K a (b :: k) = K a
- unI :: I a -> a
- newtype ((f :: k -> Type) -.-> (g :: k -> Type)) (a :: k) = Fn {
- apFn :: f a -> g a
- class f (g x) => Compose (f :: k -> Constraint) (g :: k1 -> k) (x :: k1)
- data Dict (c :: k -> Constraint) (a :: k) where
- Dict :: forall {k} (c :: k -> Constraint) (a :: k). c a => Dict c a
- class HasField (x :: k) r a | x r -> a where
- hasField :: r -> (a -> r, a)
- class KnownSymbol (n :: Symbol)
Rows
type Row k = [Pair Symbol k] Source #
Row: type-level list of field names and corresponding field types
type family Merge :: Row k -> Row k -> Row k Source #
Merge two rows
See merge
for detailed discussion.
Constraints
class AllFields (r :: Row k) (c :: k -> Constraint) Source #
Require that c x
holds for every (n := x)
in r
.
Instances
(KnownFields r, Show a) => AllFields (r :: Row k) (Compose Show (K a :: k -> Type) :: k -> Constraint) Source # | |
Defined in Data.Record.Anon.Plugin.Internal.Runtime fieldDicts :: DictAllFields k0 r (Compose Show (K a)) | |
(KnownFields r, Eq a) => AllFields (r :: Row k) (Compose Eq (K a :: k -> Type) :: k -> Constraint) Source # | |
Defined in Data.Record.Anon.Plugin.Internal.Runtime fieldDicts :: DictAllFields k0 r (Compose Eq (K a)) | |
(KnownFields r, Ord a) => AllFields (r :: Row k) (Compose Ord (K a :: k -> Type) :: k -> Constraint) Source # | |
Defined in Data.Record.Anon.Plugin.Internal.Runtime fieldDicts :: DictAllFields k0 r (Compose Ord (K a)) |
class KnownFields (r :: Row k) Source #
Require that all field names in r
are known
class SubRow (r :: Row k) (r' :: Row k) Source #
Subrecords
If SubRow r r'
holds, we can project (or create a lens) r
to r'
.
See project
for detailed discussion.
class RowHasField (n :: Symbol) (r :: Row k) (a :: k) | n r -> a Source #
Specialized form of HasField
RowHasField n r a
holds if there is an (n := a)
in r
.
Fields
Proxy for a field name, with IsLabel
instance
The IsLabel
instance makes it possible to write
#foo
to mean
Field (Proxy @"foo")
Instances
(n ~ n', KnownSymbol n, KnownHash n) => IsLabel n' (Field n) Source # | |
Defined in Data.Record.Anon.Internal.Advanced |
class KnownHash (s :: Symbol) where Source #
Symbol (type-level string) with compile-time computed hash
Instances are computed on the fly by the plugin.
Type-level metadata
This is primarily for interop with generics-sop
.
type family FieldTypes (f :: k -> Type) (r :: Row k) :: [(Symbol, Type)] Source #
Type-level metadata
FieldTypes Maybe [ "a" := Int, "b" := Bool ] == [ '("a", Maybe Int), '("b", Maybe Bool) ]
type family SimpleFieldTypes (r :: Row Type) :: [(Symbol, Type)] Source #
Like FieldTypes
, but for the simple API (no functor argument)
SimpleFieldTypes [ "a" := Int, "b" := Bool ] == [ '("a", Int), '("b", Bool) ]
Type utilities
data Reflected c where Source #
Evidence of some constraint c
This is like Dict
, but without the functor argument.
Re-exports
data Product (f :: k -> Type) (g :: k -> Type) (a :: k) #
Lifted product of functors.
Pair (f a) (g a) |
Instances
Generic1 (Product f g :: k -> Type) | |
(FromJSON1 f, FromJSON1 g) => FromJSON1 (Product f g) | |
(ToJSON1 f, ToJSON1 g) => ToJSON1 (Product f g) | |
Defined in Data.Aeson.Types.ToJSON liftToJSON :: (a -> Value) -> ([a] -> Value) -> Product f g a -> Value # liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Product f g a] -> Value # liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Product f g a -> Encoding # liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Product f g a] -> Encoding # | |
(MonadFix f, MonadFix g) => MonadFix (Product f g) | Since: base-4.9.0.0 |
Defined in Data.Functor.Product | |
(MonadZip f, MonadZip g) => MonadZip (Product f g) | Since: base-4.9.0.0 |
(Foldable f, Foldable g) => Foldable (Product f g) | Since: base-4.9.0.0 |
Defined in Data.Functor.Product fold :: Monoid m => Product f g m -> m # foldMap :: Monoid m => (a -> m) -> Product f g a -> m # foldMap' :: Monoid m => (a -> m) -> Product f g a -> m # foldr :: (a -> b -> b) -> b -> Product f g a -> b # foldr' :: (a -> b -> b) -> b -> Product f g a -> b # foldl :: (b -> a -> b) -> b -> Product f g a -> b # foldl' :: (b -> a -> b) -> b -> Product f g a -> b # foldr1 :: (a -> a -> a) -> Product f g a -> a # foldl1 :: (a -> a -> a) -> Product f g a -> a # toList :: Product f g a -> [a] # null :: Product f g a -> Bool # length :: Product f g a -> Int # elem :: Eq a => a -> Product f g a -> Bool # maximum :: Ord a => Product f g a -> a # minimum :: Ord a => Product f g a -> a # | |
(Eq1 f, Eq1 g) => Eq1 (Product f g) | Since: base-4.9.0.0 |
(Ord1 f, Ord1 g) => Ord1 (Product f g) | Since: base-4.9.0.0 |
Defined in Data.Functor.Product | |
(Read1 f, Read1 g) => Read1 (Product f g) | Since: base-4.9.0.0 |
Defined in Data.Functor.Product liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Product f g a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Product f g a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Product f g a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Product f g a] # | |
(Show1 f, Show1 g) => Show1 (Product f g) | Since: base-4.9.0.0 |
(Traversable f, Traversable g) => Traversable (Product f g) | Since: base-4.9.0.0 |
Defined in Data.Functor.Product | |
(Alternative f, Alternative g) => Alternative (Product f g) | Since: base-4.9.0.0 |
(Applicative f, Applicative g) => Applicative (Product f g) | Since: base-4.9.0.0 |
Defined in Data.Functor.Product | |
(Functor f, Functor g) => Functor (Product f g) | Since: base-4.9.0.0 |
(Monad f, Monad g) => Monad (Product f g) | Since: base-4.9.0.0 |
(MonadPlus f, MonadPlus g) => MonadPlus (Product f g) | Since: base-4.9.0.0 |
(NFData1 f, NFData1 g) => NFData1 (Product f g) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
(Hashable1 f, Hashable1 g) => Hashable1 (Product f g) | |
Defined in Data.Hashable.Class | |
(FromJSON1 f, FromJSON1 g, FromJSON a) => FromJSON (Product f g a) | |
(ToJSON1 f, ToJSON1 g, ToJSON a) => ToJSON (Product f g a) | |
Defined in Data.Aeson.Types.ToJSON | |
(Typeable a, Typeable f, Typeable g, Typeable k, Data (f a), Data (g a)) => Data (Product f g a) | Since: base-4.9.0.0 |
Defined in Data.Functor.Product gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> Product f g a -> c (Product f g a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Product f g a) # toConstr :: Product f g a -> Constr # dataTypeOf :: Product f g a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Product f g a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Product f g a)) # gmapT :: (forall b. Data b => b -> b) -> Product f g a -> Product f g a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Product f g a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Product f g a -> r # gmapQ :: (forall d. Data d => d -> u) -> Product f g a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Product f g a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Product f g a -> m (Product f g a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Product f g a -> m (Product f g a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Product f g a -> m (Product f g a) # | |
(Monoid (f a), Monoid (g a)) => Monoid (Product f g a) | Since: base-4.16.0.0 |
(Semigroup (f a), Semigroup (g a)) => Semigroup (Product f g a) | Since: base-4.16.0.0 |
Generic (Product f g a) | |
(Read1 f, Read1 g, Read a) => Read (Product f g a) | Since: base-4.9.0.0 |
(Show1 f, Show1 g, Show a) => Show (Product f g a) | Since: base-4.9.0.0 |
(NFData1 f, NFData1 g, NFData a) => NFData (Product f g a) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
(Eq1 f, Eq1 g, Eq a) => Eq (Product f g a) | Since: base-4.9.0.0 |
(Ord1 f, Ord1 g, Ord a) => Ord (Product f g a) | Since: base-4.9.0.0 |
Defined in Data.Functor.Product compare :: Product f g a -> Product f g a -> Ordering # (<) :: Product f g a -> Product f g a -> Bool # (<=) :: Product f g a -> Product f g a -> Bool # (>) :: Product f g a -> Product f g a -> Bool # (>=) :: Product f g a -> Product f g a -> Bool # | |
(Hashable1 f, Hashable1 g, Hashable a) => Hashable (Product f g a) | |
Defined in Data.Hashable.Class | |
type Rep1 (Product f g :: k -> Type) | Since: base-4.9.0.0 |
Defined in Data.Functor.Product type Rep1 (Product f g :: k -> Type) = D1 ('MetaData "Product" "Data.Functor.Product" "base" 'False) (C1 ('MetaCons "Pair" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 g))) | |
type Rep (Product f g a) | Since: base-4.9.0.0 |
Defined in Data.Functor.Product type Rep (Product f g a) = D1 ('MetaData "Product" "Data.Functor.Product" "base" 'False) (C1 ('MetaCons "Pair" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (g a)))) |
Proxy
is a type that holds no data, but has a phantom parameter of
arbitrary type (or even kind). Its use is to provide type information, even
though there is no value available of that type (or it may be too costly to
create one).
Historically,
is a safer alternative to the
Proxy
:: Proxy
a
idiom.undefined
:: a
>>>
Proxy :: Proxy (Void, Int -> Int)
Proxy
Proxy can even hold types of higher kinds,
>>>
Proxy :: Proxy Either
Proxy
>>>
Proxy :: Proxy Functor
Proxy
>>>
Proxy :: Proxy complicatedStructure
Proxy
Instances
Generic1 (Proxy :: k -> Type) | |
FromJSON1 (Proxy :: Type -> Type) | |
ToJSON1 (Proxy :: TYPE LiftedRep -> Type) | |
Defined in Data.Aeson.Types.ToJSON liftToJSON :: (a -> Value) -> ([a] -> Value) -> Proxy a -> Value # liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Proxy a] -> Value # liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Proxy a -> Encoding # liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Proxy a] -> Encoding # | |
Foldable (Proxy :: TYPE LiftedRep -> Type) | Since: base-4.7.0.0 |
Defined in Data.Foldable fold :: Monoid m => Proxy m -> m # foldMap :: Monoid m => (a -> m) -> Proxy a -> m # foldMap' :: Monoid m => (a -> m) -> Proxy a -> m # foldr :: (a -> b -> b) -> b -> Proxy a -> b # foldr' :: (a -> b -> b) -> b -> Proxy a -> b # foldl :: (b -> a -> b) -> b -> Proxy a -> b # foldl' :: (b -> a -> b) -> b -> Proxy a -> b # foldr1 :: (a -> a -> a) -> Proxy a -> a # foldl1 :: (a -> a -> a) -> Proxy a -> a # elem :: Eq a => a -> Proxy a -> Bool # maximum :: Ord a => Proxy a -> a # minimum :: Ord a => Proxy a -> a # | |
Eq1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Ord1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
Read1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
Show1 (Proxy :: TYPE LiftedRep -> Type) | Since: base-4.9.0.0 |
Traversable (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
Alternative (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Applicative (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
Functor (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
Monad (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
MonadPlus (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
NFData1 (Proxy :: TYPE LiftedRep -> Type) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
Hashable1 (Proxy :: Type -> Type) | |
Defined in Data.Hashable.Class | |
FromJSON (Proxy a) | |
ToJSON (Proxy a) | |
Defined in Data.Aeson.Types.ToJSON | |
Data t => Data (Proxy t) | Since: base-4.7.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Proxy t -> c (Proxy t) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Proxy t) # toConstr :: Proxy t -> Constr # dataTypeOf :: Proxy t -> DataType # dataCast1 :: Typeable t0 => (forall d. Data d => c (t0 d)) -> Maybe (c (Proxy t)) # dataCast2 :: Typeable t0 => (forall d e. (Data d, Data e) => c (t0 d e)) -> Maybe (c (Proxy t)) # gmapT :: (forall b. Data b => b -> b) -> Proxy t -> Proxy t # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Proxy t -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Proxy t -> r # gmapQ :: (forall d. Data d => d -> u) -> Proxy t -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Proxy t -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) # | |
Monoid (Proxy s) | Since: base-4.7.0.0 |
Semigroup (Proxy s) | Since: base-4.9.0.0 |
Bounded (Proxy t) | Since: base-4.7.0.0 |
Enum (Proxy s) | Since: base-4.7.0.0 |
Generic (Proxy t) | |
Ix (Proxy s) | Since: base-4.7.0.0 |
Defined in Data.Proxy | |
Read (Proxy t) | Since: base-4.7.0.0 |
Show (Proxy s) | Since: base-4.7.0.0 |
NFData (Proxy a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
Eq (Proxy s) | Since: base-4.7.0.0 |
Ord (Proxy s) | Since: base-4.7.0.0 |
Hashable (Proxy a) | |
Defined in Data.Hashable.Class | |
type Rep1 (Proxy :: k -> Type) | Since: base-4.6.0.0 |
type Rep (Proxy t) | Since: base-4.6.0.0 |
newtype ((f :: l -> Type) :.: (g :: k -> l)) (p :: k) infixr 7 #
Composition of functors.
Like Compose
, but kind-polymorphic
and with a shorter name.
Comp (f (g p)) |
Instances
(Foldable f, Foldable g) => Foldable (f :.: g) | Since: sop-core-0.2.5.0 |
Defined in Data.SOP.BasicFunctors fold :: Monoid m => (f :.: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :.: g) a -> m # foldMap' :: Monoid m => (a -> m) -> (f :.: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :.: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :.: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :.: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :.: g) a -> b # foldr1 :: (a -> a -> a) -> (f :.: g) a -> a # foldl1 :: (a -> a -> a) -> (f :.: g) a -> a # toList :: (f :.: g) a -> [a] # length :: (f :.: g) a -> Int # elem :: Eq a => a -> (f :.: g) a -> Bool # maximum :: Ord a => (f :.: g) a -> a # minimum :: Ord a => (f :.: g) a -> a # | |
(Eq1 f, Eq1 g) => Eq1 (f :.: g) | Since: sop-core-0.2.4.0 |
(Ord1 f, Ord1 g) => Ord1 (f :.: g) | Since: sop-core-0.2.4.0 |
Defined in Data.SOP.BasicFunctors | |
(Read1 f, Read1 g) => Read1 (f :.: g) | Since: sop-core-0.2.4.0 |
Defined in Data.SOP.BasicFunctors | |
(Show1 f, Show1 g) => Show1 (f :.: g) | Since: sop-core-0.2.4.0 |
(Traversable f, Traversable g) => Traversable (f :.: g) | Since: sop-core-0.2.5.0 |
Defined in Data.SOP.BasicFunctors | |
(Applicative f, Applicative g) => Applicative (f :.: g) | Since: sop-core-0.2.5.0 |
(Functor f, Functor g) => Functor (f :.: g) | |
(NFData1 f, NFData1 g) => NFData1 (f :.: g) | Since: sop-core-0.2.5.0 |
Defined in Data.SOP.BasicFunctors | |
Monoid (f (g x)) => Monoid ((f :.: g) x) | Since: sop-core-0.4.0.0 |
Semigroup (f (g x)) => Semigroup ((f :.: g) x) | Since: sop-core-0.4.0.0 |
Generic ((f :.: g) p) | |
(Read1 f, Read1 g, Read a) => Read ((f :.: g) a) | |
(Show1 f, Show1 g, Show a) => Show ((f :.: g) a) | |
NFData (f (g a)) => NFData ((f :.: g) a) | Since: sop-core-0.2.5.0 |
Defined in Data.SOP.BasicFunctors | |
(Eq1 f, Eq1 g, Eq a) => Eq ((f :.: g) a) | |
(Ord1 f, Ord1 g, Ord a) => Ord ((f :.: g) a) | |
Defined in Data.SOP.BasicFunctors | |
type Rep ((f :.: g) p) | |
Defined in Data.SOP.BasicFunctors |
The identity type functor.
Like Identity
, but with a shorter name.
I a |
Instances
Foldable I | |
Defined in Data.SOP.BasicFunctors fold :: Monoid m => I m -> m # foldMap :: Monoid m => (a -> m) -> I a -> m # foldMap' :: Monoid m => (a -> m) -> I a -> m # foldr :: (a -> b -> b) -> b -> I a -> b # foldr' :: (a -> b -> b) -> b -> I a -> b # foldl :: (b -> a -> b) -> b -> I a -> b # foldl' :: (b -> a -> b) -> b -> I a -> b # foldr1 :: (a -> a -> a) -> I a -> a # foldl1 :: (a -> a -> a) -> I a -> a # elem :: Eq a => a -> I a -> Bool # maximum :: Ord a => I a -> a # | |
Eq1 I | Since: sop-core-0.2.4.0 |
Ord1 I | Since: sop-core-0.2.4.0 |
Defined in Data.SOP.BasicFunctors | |
Read1 I | Since: sop-core-0.2.4.0 |
Show1 I | Since: sop-core-0.2.4.0 |
Traversable I | |
Applicative I | |
Functor I | |
Monad I | |
NFData1 I | Since: sop-core-0.2.5.0 |
Defined in Data.SOP.BasicFunctors | |
Monoid a => Monoid (I a) | Since: sop-core-0.4.0.0 |
Semigroup a => Semigroup (I a) | Since: sop-core-0.4.0.0 |
Generic (I a) | |
Read a => Read (I a) | |
Show a => Show (I a) | |
NFData a => NFData (I a) | Since: sop-core-0.2.5.0 |
Defined in Data.SOP.BasicFunctors | |
Eq a => Eq (I a) | |
Ord a => Ord (I a) | |
type Rep (I a) | |
Defined in Data.SOP.BasicFunctors |
The constant type functor.
Like Constant
, but kind-polymorphic
in its second argument and with a shorter name.
K a |
Instances
(KnownFields r, Show a) => AllFields (r :: Row k) (Compose Show (K a :: k -> Type) :: k -> Constraint) Source # | |
Defined in Data.Record.Anon.Plugin.Internal.Runtime fieldDicts :: DictAllFields k0 r (Compose Show (K a)) | |
(KnownFields r, Eq a) => AllFields (r :: Row k) (Compose Eq (K a :: k -> Type) :: k -> Constraint) Source # | |
Defined in Data.Record.Anon.Plugin.Internal.Runtime fieldDicts :: DictAllFields k0 r (Compose Eq (K a)) | |
(KnownFields r, Ord a) => AllFields (r :: Row k) (Compose Ord (K a :: k -> Type) :: k -> Constraint) Source # | |
Defined in Data.Record.Anon.Plugin.Internal.Runtime fieldDicts :: DictAllFields k0 r (Compose Ord (K a)) | |
Eq2 (K :: Type -> Type -> Type) | Since: sop-core-0.2.4.0 |
Ord2 (K :: Type -> Type -> Type) | Since: sop-core-0.2.4.0 |
Defined in Data.SOP.BasicFunctors | |
Read2 (K :: Type -> Type -> Type) | Since: sop-core-0.2.4.0 |
Defined in Data.SOP.BasicFunctors liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (K a b) # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [K a b] # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (K a b) # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [K a b] # | |
Show2 (K :: Type -> TYPE LiftedRep -> Type) | Since: sop-core-0.2.4.0 |
NFData2 (K :: Type -> Type -> Type) | Since: sop-core-0.2.5.0 |
Defined in Data.SOP.BasicFunctors | |
Foldable (K a :: TYPE LiftedRep -> Type) | |
Defined in Data.SOP.BasicFunctors fold :: Monoid m => K a m -> m # foldMap :: Monoid m => (a0 -> m) -> K a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> K a a0 -> m # foldr :: (a0 -> b -> b) -> b -> K a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> K a a0 -> b # foldl :: (b -> a0 -> b) -> b -> K a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> K a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> K a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> K a a0 -> a0 # elem :: Eq a0 => a0 -> K a a0 -> Bool # maximum :: Ord a0 => K a a0 -> a0 # minimum :: Ord a0 => K a a0 -> a0 # | |
Eq a => Eq1 (K a :: Type -> Type) | Since: sop-core-0.2.4.0 |
Ord a => Ord1 (K a :: Type -> Type) | Since: sop-core-0.2.4.0 |
Defined in Data.SOP.BasicFunctors | |
Read a => Read1 (K a :: Type -> Type) | Since: sop-core-0.2.4.0 |
Defined in Data.SOP.BasicFunctors | |
Show a => Show1 (K a :: TYPE LiftedRep -> Type) | Since: sop-core-0.2.4.0 |
Traversable (K a :: TYPE LiftedRep -> Type) | |
Monoid a => Applicative (K a :: Type -> Type) | |
Functor (K a :: TYPE LiftedRep -> Type) | |
Show x => Show (Rep (K x :: Type -> Type) a) | |
NFData a => NFData1 (K a :: TYPE LiftedRep -> Type) | Since: sop-core-0.2.5.0 |
Defined in Data.SOP.BasicFunctors | |
Eq x => Eq (Rep (K x :: Type -> Type) a) | |
Monoid a => Monoid (K a b) | Since: sop-core-0.4.0.0 |
Semigroup a => Semigroup (K a b) | Since: sop-core-0.4.0.0 |
Generic (K a b) | |
Read a => Read (K a b) | |
Show a => Show (K a b) | |
NFData a => NFData (K a b) | Since: sop-core-0.2.5.0 |
Defined in Data.SOP.BasicFunctors | |
Eq a => Eq (K a b) | |
Ord a => Ord (K a b) | |
type Rep (K a b) | |
Defined in Data.SOP.BasicFunctors |
class f (g x) => Compose (f :: k -> Constraint) (g :: k1 -> k) (x :: k1) infixr 9 #
Composition of constraints.
Note that the result of the composition must be a constraint,
and therefore, in
, the kind of Compose
f gf
is k ->
.
The kind of Constraint
g
, however, is l -> k
and can thus be a normal
type constructor.
A typical use case is in connection with All
on an NP
or an
NS
. For example, in order to denote that all elements on an
satisfy NP
f xsShow
, we can say
.All
(Compose
Show
f) xs
Since: sop-core-0.2
Instances
f (g x) => Compose (f :: k1 -> Constraint) (g :: k2 -> k1) (x :: k2) | |
Defined in Data.SOP.Constraint | |
(KnownFields r, Show a) => AllFields (r :: Row k) (Compose Show (K a :: k -> Type) :: k -> Constraint) Source # | |
Defined in Data.Record.Anon.Plugin.Internal.Runtime fieldDicts :: DictAllFields k0 r (Compose Show (K a)) | |
(KnownFields r, Eq a) => AllFields (r :: Row k) (Compose Eq (K a :: k -> Type) :: k -> Constraint) Source # | |
Defined in Data.Record.Anon.Plugin.Internal.Runtime fieldDicts :: DictAllFields k0 r (Compose Eq (K a)) | |
(KnownFields r, Ord a) => AllFields (r :: Row k) (Compose Ord (K a :: k -> Type) :: k -> Constraint) Source # | |
Defined in Data.Record.Anon.Plugin.Internal.Runtime fieldDicts :: DictAllFields k0 r (Compose Ord (K a)) |
data Dict (c :: k -> Constraint) (a :: k) where #
An explicit dictionary carrying evidence of a class constraint.
The constraint parameter is separated into a
second argument so that
is of the correct
kind to be used directly as a parameter to e.g. Dict
cNP
.
Since: sop-core-0.2
Dict :: forall {k} (c :: k -> Constraint) (a :: k). c a => Dict c a |
class HasField (x :: k) r a | x r -> a where #
Constraint representing the fact that the field x
can be get and set on
the record type r
and has field type a
. This constraint will be solved
automatically, but manual instances may be provided as well.
The function should satisfy the invariant:
uncurry ($) (hasField @x r) == r
Instances
HasField n (Record I r) (I a) => HasField (n :: Symbol) (Record r) a Source # | |
Defined in Data.Record.Anon.Internal.Simple | |
(KnownSymbol n, KnownHash n, RowHasField n r a) => HasField (n :: Symbol) (Record f r) (f a) Source # | |
Defined in Data.Record.Anon.Internal.Advanced |
class KnownSymbol (n :: Symbol) #
This class gives the string associated with a type-level symbol. There are instances of the class for every concrete literal: "hello", etc.
Since: base-4.7.0.0
symbolSing