Copyright | (c) Galois Inc 2014-2019 |
---|---|
Maintainer | Joe Hendrix <jhendrix@galois.com> |
Safe Haskell | Safe |
Language | Haskell2010 |
Data.Parameterized.Classes
Description
This module declares classes for working with types with the kind
k -> *
for any kind k
. These are generalizations of the
Data.Functor.Classes types as they work with any kind k
, and are
not restricted to *
.
Synopsis
- class TestEquality (f :: k -> Type) where
- testEquality :: forall (a :: k) (b :: k). f a -> f b -> Maybe (a :~: b)
- data (a :: k) :~: (b :: k) where
- class EqF (f :: k -> Type) where
- eqF :: f a -> f a -> Bool
- class PolyEq u v where
- class TestEquality ktp => OrdF (ktp :: k -> Type) where
- lexCompareF :: forall j k (f :: j -> Type) (a :: j) (b :: j) (c :: k) (d :: k). OrdF f => f a -> f b -> (a ~ b => OrderingF c d) -> OrderingF c d
- data OrderingF x y where
- joinOrderingF :: forall j k (a :: j) (b :: j) (c :: k) (d :: k). OrderingF a b -> (a ~ b => OrderingF c d) -> OrderingF c d
- orderingF_refl :: OrderingF x y -> Maybe (x :~: y)
- toOrdering :: OrderingF x y -> Ordering
- fromOrdering :: Ordering -> OrderingF x x
- ordFCompose :: forall k l (f :: k -> Type) (g :: l -> k) x y. (forall w z. f w -> f z -> OrderingF w z) -> Compose f g x -> Compose f g y -> OrderingF x y
- class ShowF (f :: k -> Type) where
- withShow :: p f -> q tp -> (Show (f tp) => a) -> a
- showF :: forall tp. f tp -> String
- showsPrecF :: forall tp. Int -> f tp -> String -> String
- showsF :: ShowF f => f tp -> String -> String
- class HashableF (f :: k -> Type) where
- hashWithSaltF :: Int -> f tp -> Int
- hashF :: f tp -> Int
- class CoercibleF (rtp :: k -> Type) where
- coerceF :: rtp a -> rtp b
- newtype TypeAp (f :: k -> Type) (tp :: k) = TypeAp (f tp)
- type family IndexF (m :: Type) :: k -> Type
- type family IxValueF (m :: Type) :: k -> Type
- class IxedF k m where
- class IxedF k m => IxedF' k m where
- class IxedF k m => AtF k m where
- class KnownRepr (f :: k -> Type) (ctx :: k) where
- knownRepr :: f ctx
- class Eq a => Hashable a where
- hashWithSalt :: Int -> a -> Int
- hash :: a -> Int
- isJust :: Maybe a -> Bool
Equality exports
class TestEquality (f :: k -> Type) where #
Methods
testEquality :: forall (a :: k) (b :: k). f a -> f b -> Maybe (a :~: b) #
Instances
TestEquality NatRepr Source # | |
Defined in Data.Parameterized.NatRepr.Internal Methods testEquality :: forall (a :: k) (b :: k). NatRepr a -> NatRepr b -> Maybe (a :~: b) # | |
TestEquality PeanoRepr Source # | |
Defined in Data.Parameterized.Peano Methods testEquality :: forall (a :: k) (b :: k). PeanoRepr a -> PeanoRepr b -> Maybe (a :~: b) # | |
TestEquality BoolRepr Source # | |
Defined in Data.Parameterized.BoolRepr Methods testEquality :: forall (a :: k) (b :: k). BoolRepr a -> BoolRepr b -> Maybe (a :~: b) # | |
TestEquality SymbolRepr Source # | |
Defined in Data.Parameterized.SymbolRepr Methods testEquality :: forall (a :: k) (b :: k). SymbolRepr a -> SymbolRepr b -> Maybe (a :~: b) # | |
TestEquality (TypeRep :: k -> Type) | |
Defined in Data.Typeable.Internal Methods testEquality :: forall (a :: k0) (b :: k0). TypeRep a -> TypeRep b -> Maybe (a :~: b) # | |
TestEquality (Nonce :: k -> Type) Source # | |
Defined in Data.Parameterized.Nonce.Unsafe Methods testEquality :: forall (a :: k0) (b :: k0). Nonce a -> Nonce b -> Maybe (a :~: b) # | |
TestEquality ((:~:) a :: k -> Type) | |
Defined in Data.Type.Equality Methods testEquality :: forall (a0 :: k0) (b :: k0). (a :~: a0) -> (a :~: b) -> Maybe (a0 :~: b) # | |
TestEquality (Index ctx :: k -> Type) Source # | |
Defined in Data.Parameterized.Context.Unsafe Methods testEquality :: forall (a :: k0) (b :: k0). Index ctx a -> Index ctx b -> Maybe (a :~: b) # | |
TestEquality (Index l :: k -> Type) Source # | |
Defined in Data.Parameterized.List Methods testEquality :: forall (a :: k0) (b :: k0). Index l a -> Index l b -> Maybe (a :~: b) # | |
TestEquality (Nonce s :: k -> Type) Source # | |
Defined in Data.Parameterized.Nonce Methods testEquality :: forall (a :: k0) (b :: k0). Nonce s a -> Nonce s b -> Maybe (a :~: b) # | |
TestEquality ((:~~:) a :: k -> Type) | |
Defined in Data.Type.Equality Methods testEquality :: forall (a0 :: k0) (b :: k0). (a :~~: a0) -> (a :~~: b) -> Maybe (a0 :~: b) # | |
TestEquality f => TestEquality (Compose f g :: k2 -> Type) | |
Defined in Data.Functor.Compose Methods testEquality :: forall (a :: k) (b :: k). Compose f g a -> Compose f g b -> Maybe (a :~: b) # | |
TestEquality f => TestEquality (Assignment f :: Ctx k -> Type) Source # | |
Defined in Data.Parameterized.Context.Unsafe Methods testEquality :: forall (a :: k0) (b :: k0). Assignment f a -> Assignment f b -> Maybe (a :~: b) # | |
TestEquality f => TestEquality (List f :: [k] -> Type) Source # | |
Defined in Data.Parameterized.List Methods testEquality :: forall (a :: k0) (b :: k0). List f a -> List f b -> Maybe (a :~: b) # | |
(TestEquality f, TestEquality g) => TestEquality (PairRepr f g :: (k1, k2) -> Type) Source # | |
Defined in Data.Parameterized.DataKind Methods testEquality :: forall (a :: k) (b :: k). PairRepr f g a -> PairRepr f g b -> Maybe (a :~: b) # |
data (a :: k) :~: (b :: k) where #
Instances
Category ((:~:) :: k -> k -> Type) | |
TestEquality ((:~:) a :: k -> Type) | |
Defined in Data.Type.Equality Methods testEquality :: forall (a0 :: k0) (b :: k0). (a :~: a0) -> (a :~: b) -> Maybe (a0 :~: b) # | |
NFData2 ((:~:) :: Type -> Type -> Type) | |
Defined in Control.DeepSeq | |
NFData1 ((:~:) a) | |
Defined in Control.DeepSeq | |
(a ~ b, Data a) => Data (a :~: b) | |
Defined in Data.Data Methods gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> (a :~: b) -> c (a :~: b) gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (a :~: b) toConstr :: (a :~: b) -> Constr dataTypeOf :: (a :~: b) -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (a :~: b)) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (a :~: b)) gmapT :: (forall b0. Data b0 => b0 -> b0) -> (a :~: b) -> a :~: b gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (a :~: b) -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (a :~: b) -> r gmapQ :: (forall d. Data d => d -> u) -> (a :~: b) -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> (a :~: b) -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> (a :~: b) -> m (a :~: b) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (a :~: b) -> m (a :~: b) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (a :~: b) -> m (a :~: b) | |
a ~ b => Bounded (a :~: b) | |
Defined in Data.Type.Equality | |
a ~ b => Enum (a :~: b) | |
Defined in Data.Type.Equality | |
a ~ b => Read (a :~: b) | |
Defined in Data.Type.Equality | |
Show (a :~: b) | |
NFData (a :~: b) | |
Defined in Control.DeepSeq | |
Eq (a :~: b) | |
Ord (a :~: b) | |
Defined in Data.Type.Equality | |
HasDict (a ~ b) (a :~: b) | |
Defined in Data.Constraint |
class EqF (f :: k -> Type) where Source #
EqF
provides a method eqF
for testing whether two parameterized
types are equal.
Unlike TestEquality
, this only works when the type arguments are
the same, and does not provide a proof that the types have the same
type when they are equal. Thus this can be implemented over
parameterized types that are unable to provide evidence that their
type arguments are equal.
Instances
class PolyEq u v where Source #
A polymorphic equality operator that generalizes TestEquality
.
Minimal complete definition
Ordering generalization
class TestEquality ktp => OrdF (ktp :: k -> Type) where Source #
The OrdF
class is a total ordering over parameterized types so
that types with different parameters can be compared.
Instances of OrdF
are expected to satisfy the following laws:
- Transitivity
- if
leqF x y && leqF y z
=True
, thenleqF x = z
=True
- Reflexivity
leqF x x
=True
- Antisymmetry
- if
leqF x y && leqF y x
=True
, thentestEquality x y
=Just Refl
Note that the following operator interactions are expected to hold:
geqF x y
iffleqF y x
ltF x y
iffleqF x y && testEquality x y = Nothing
gtF x y
iffltF y x
ltF x y
iffcompareF x y == LTF
gtF x y
iffcompareF x y == GTF
isJust (testEquality x y)
iffcompareF x y == EQF
Furthermore, when x
and y
both have type (k tp)
, we expect:
toOrdering (compareF x y)
equalscompare x y
whenOrd (k tp)
has an instance.isJust (testEquality x y)
equalsx == y
whenEq (k tp)
has an instance.
Minimal complete definition: either compareF
or leqF
.
Using compareF
can be more efficient for complex types.
Methods
compareF :: ktp x -> ktp y -> OrderingF x y Source #
leqF :: ktp x -> ktp y -> Bool Source #
ltF :: ktp x -> ktp y -> Bool Source #
Instances
OrdF NatRepr Source # | |
Defined in Data.Parameterized.NatRepr.Internal Methods compareF :: forall (x :: k) (y :: k). NatRepr x -> NatRepr y -> OrderingF x y Source # leqF :: forall (x :: k) (y :: k). NatRepr x -> NatRepr y -> Bool Source # ltF :: forall (x :: k) (y :: k). NatRepr x -> NatRepr y -> Bool Source # geqF :: forall (x :: k) (y :: k). NatRepr x -> NatRepr y -> Bool Source # gtF :: forall (x :: k) (y :: k). NatRepr x -> NatRepr y -> Bool Source # | |
OrdF PeanoRepr Source # | |
Defined in Data.Parameterized.Peano Methods compareF :: forall (x :: k) (y :: k). PeanoRepr x -> PeanoRepr y -> OrderingF x y Source # leqF :: forall (x :: k) (y :: k). PeanoRepr x -> PeanoRepr y -> Bool Source # ltF :: forall (x :: k) (y :: k). PeanoRepr x -> PeanoRepr y -> Bool Source # geqF :: forall (x :: k) (y :: k). PeanoRepr x -> PeanoRepr y -> Bool Source # gtF :: forall (x :: k) (y :: k). PeanoRepr x -> PeanoRepr y -> Bool Source # | |
OrdF BoolRepr Source # | |
Defined in Data.Parameterized.BoolRepr Methods compareF :: forall (x :: k) (y :: k). BoolRepr x -> BoolRepr y -> OrderingF x y Source # leqF :: forall (x :: k) (y :: k). BoolRepr x -> BoolRepr y -> Bool Source # ltF :: forall (x :: k) (y :: k). BoolRepr x -> BoolRepr y -> Bool Source # geqF :: forall (x :: k) (y :: k). BoolRepr x -> BoolRepr y -> Bool Source # gtF :: forall (x :: k) (y :: k). BoolRepr x -> BoolRepr y -> Bool Source # | |
OrdF SymbolRepr Source # | |
Defined in Data.Parameterized.SymbolRepr Methods compareF :: forall (x :: k) (y :: k). SymbolRepr x -> SymbolRepr y -> OrderingF x y Source # leqF :: forall (x :: k) (y :: k). SymbolRepr x -> SymbolRepr y -> Bool Source # ltF :: forall (x :: k) (y :: k). SymbolRepr x -> SymbolRepr y -> Bool Source # geqF :: forall (x :: k) (y :: k). SymbolRepr x -> SymbolRepr y -> Bool Source # gtF :: forall (x :: k) (y :: k). SymbolRepr x -> SymbolRepr y -> Bool Source # | |
OrdF (Nonce :: k -> Type) Source # | |
Defined in Data.Parameterized.Nonce.Unsafe Methods compareF :: forall (x :: k0) (y :: k0). Nonce x -> Nonce y -> OrderingF x y Source # leqF :: forall (x :: k0) (y :: k0). Nonce x -> Nonce y -> Bool Source # ltF :: forall (x :: k0) (y :: k0). Nonce x -> Nonce y -> Bool Source # geqF :: forall (x :: k0) (y :: k0). Nonce x -> Nonce y -> Bool Source # gtF :: forall (x :: k0) (y :: k0). Nonce x -> Nonce y -> Bool Source # | |
OrdF (Index ctx :: k -> Type) Source # | |
Defined in Data.Parameterized.Context.Unsafe Methods compareF :: forall (x :: k0) (y :: k0). Index ctx x -> Index ctx y -> OrderingF x y Source # leqF :: forall (x :: k0) (y :: k0). Index ctx x -> Index ctx y -> Bool Source # ltF :: forall (x :: k0) (y :: k0). Index ctx x -> Index ctx y -> Bool Source # geqF :: forall (x :: k0) (y :: k0). Index ctx x -> Index ctx y -> Bool Source # gtF :: forall (x :: k0) (y :: k0). Index ctx x -> Index ctx y -> Bool Source # | |
OrdF (Index l :: k -> Type) Source # | |
Defined in Data.Parameterized.List Methods compareF :: forall (x :: k0) (y :: k0). Index l x -> Index l y -> OrderingF x y Source # leqF :: forall (x :: k0) (y :: k0). Index l x -> Index l y -> Bool Source # ltF :: forall (x :: k0) (y :: k0). Index l x -> Index l y -> Bool Source # geqF :: forall (x :: k0) (y :: k0). Index l x -> Index l y -> Bool Source # gtF :: forall (x :: k0) (y :: k0). Index l x -> Index l y -> Bool Source # | |
OrdF (Nonce s :: k -> Type) Source # | |
Defined in Data.Parameterized.Nonce Methods compareF :: forall (x :: k0) (y :: k0). Nonce s x -> Nonce s y -> OrderingF x y Source # leqF :: forall (x :: k0) (y :: k0). Nonce s x -> Nonce s y -> Bool Source # ltF :: forall (x :: k0) (y :: k0). Nonce s x -> Nonce s y -> Bool Source # geqF :: forall (x :: k0) (y :: k0). Nonce s x -> Nonce s y -> Bool Source # gtF :: forall (x :: k0) (y :: k0). Nonce s x -> Nonce s y -> Bool Source # | |
OrdF f => OrdF (Compose f g :: k2 -> Type) Source # | |
Defined in Data.Parameterized.Classes Methods compareF :: forall (x :: k) (y :: k). Compose f g x -> Compose f g y -> OrderingF x y Source # leqF :: forall (x :: k) (y :: k). Compose f g x -> Compose f g y -> Bool Source # ltF :: forall (x :: k) (y :: k). Compose f g x -> Compose f g y -> Bool Source # geqF :: forall (x :: k) (y :: k). Compose f g x -> Compose f g y -> Bool Source # gtF :: forall (x :: k) (y :: k). Compose f g x -> Compose f g y -> Bool Source # | |
OrdF f => OrdF (Assignment f :: Ctx k -> Type) Source # | |
Defined in Data.Parameterized.Context.Unsafe Methods compareF :: forall (x :: k0) (y :: k0). Assignment f x -> Assignment f y -> OrderingF x y Source # leqF :: forall (x :: k0) (y :: k0). Assignment f x -> Assignment f y -> Bool Source # ltF :: forall (x :: k0) (y :: k0). Assignment f x -> Assignment f y -> Bool Source # geqF :: forall (x :: k0) (y :: k0). Assignment f x -> Assignment f y -> Bool Source # gtF :: forall (x :: k0) (y :: k0). Assignment f x -> Assignment f y -> Bool Source # | |
OrdF f => OrdF (List f :: [k] -> Type) Source # | |
Defined in Data.Parameterized.List Methods compareF :: forall (x :: k0) (y :: k0). List f x -> List f y -> OrderingF x y Source # leqF :: forall (x :: k0) (y :: k0). List f x -> List f y -> Bool Source # ltF :: forall (x :: k0) (y :: k0). List f x -> List f y -> Bool Source # geqF :: forall (x :: k0) (y :: k0). List f x -> List f y -> Bool Source # gtF :: forall (x :: k0) (y :: k0). List f x -> List f y -> Bool Source # | |
(OrdF f, OrdF g) => OrdF (PairRepr f g :: (k1, k2) -> Type) Source # | |
Defined in Data.Parameterized.DataKind Methods compareF :: forall (x :: k) (y :: k). PairRepr f g x -> PairRepr f g y -> OrderingF x y Source # leqF :: forall (x :: k) (y :: k). PairRepr f g x -> PairRepr f g y -> Bool Source # ltF :: forall (x :: k) (y :: k). PairRepr f g x -> PairRepr f g y -> Bool Source # geqF :: forall (x :: k) (y :: k). PairRepr f g x -> PairRepr f g y -> Bool Source # gtF :: forall (x :: k) (y :: k). PairRepr f g x -> PairRepr f g y -> Bool Source # |
lexCompareF :: forall j k (f :: j -> Type) (a :: j) (b :: j) (c :: k) (d :: k). OrdF f => f a -> f b -> (a ~ b => OrderingF c d) -> OrderingF c d Source #
Compare two values, and if they are equal compare the next values, otherwise return LTF or GTF
joinOrderingF :: forall j k (a :: j) (b :: j) (c :: k) (d :: k). OrderingF a b -> (a ~ b => OrderingF c d) -> OrderingF c d Source #
orderingF_refl :: OrderingF x y -> Maybe (x :~: y) Source #
toOrdering :: OrderingF x y -> Ordering Source #
Convert OrderingF
to standard ordering.
fromOrdering :: Ordering -> OrderingF x x Source #
Convert standard ordering to OrderingF
.
ordFCompose :: forall k l (f :: k -> Type) (g :: l -> k) x y. (forall w z. f w -> f z -> OrderingF w z) -> Compose f g x -> Compose f g y -> OrderingF x y Source #
If the "outer" functor has an OrdF
instance, then one can be generated
for the "inner" functor. The type-level evidence of equality is deduced
via generativity of g
, e.g. the inference g x ~ g y
implies x ~ y
.
Typeclass generalizations
class ShowF (f :: k -> Type) where Source #
A parameterized type that can be shown on all instances.
To implement
, one should implement an instance ShowF
g
for all argument types Show
(g tp)tp
, then write an empty instance
instance
.ShowF
g
Minimal complete definition
Nothing
Methods
withShow :: p f -> q tp -> (Show (f tp) => a) -> a Source #
Provides a show instance for each type.
showF :: forall tp. f tp -> String Source #
showsPrecF :: forall tp. Int -> f tp -> String -> String Source #
Like showsPrec
, the precedence argument is one more than the
precedence of the enclosing context.
Instances
ShowF NatRepr Source # | |
ShowF PeanoRepr Source # | |
ShowF BoolRepr Source # | |
ShowF SymbolRepr Source # | |
Defined in Data.Parameterized.SymbolRepr Methods withShow :: forall p q (tp :: k) a. p SymbolRepr -> q tp -> (Show (SymbolRepr tp) => a) -> a Source # showF :: forall (tp :: k). SymbolRepr tp -> String Source # showsPrecF :: forall (tp :: k). Int -> SymbolRepr tp -> String -> String Source # | |
ShowF (Proxy :: k -> Type) Source # | |
Defined in Data.Parameterized.Classes | |
ShowF (Nonce :: k -> Type) Source # | |
Show x => ShowF (Const x :: k -> Type) Source # | |
Defined in Data.Parameterized.Classes | |
ShowF (Index ctx :: k -> Type) Source # | |
ShowF (IndexView ctx :: k -> Type) Source # | |
Defined in Data.Parameterized.Context.Unsafe | |
ShowF (Index l :: k -> Type) Source # | |
ShowF (Nonce s :: k -> Type) Source # | |
ShowF (Size :: Ctx k -> Type) Source # | |
ShowF f => ShowF (Assignment f :: Ctx k -> Type) Source # | |
Defined in Data.Parameterized.Context.Unsafe Methods withShow :: forall p q (tp :: k0) a. p (Assignment f) -> q tp -> (Show (Assignment f tp) => a) -> a Source # showF :: forall (tp :: k0). Assignment f tp -> String Source # showsPrecF :: forall (tp :: k0). Int -> Assignment f tp -> String -> String Source # | |
ShowF f => ShowF (List f :: [k] -> Type) Source # | |
(ShowF f, ShowF g) => ShowF (PairRepr f g :: (k1, k2) -> Type) Source # | |
class HashableF (f :: k -> Type) where Source #
A parameterized type that is hashable on all instances.
Minimal complete definition
Instances
class CoercibleF (rtp :: k -> Type) where Source #
An instance of CoercibleF
gives a way to coerce between
all the types of a family. We generally use this to witness
the fact that the type parameter to rtp
is a phantom type
by giving an implementation in terms of Data.Coerce.coerce.
Instances
CoercibleF (Const x :: k -> Type) Source # | |
Defined in Data.Parameterized.Classes |
Type function application constructor
newtype TypeAp (f :: k -> Type) (tp :: k) Source #
Captures the value obtained from applying a type to a function so that we can use parameterized class instance to provide unparameterized instances for specific types.
This is the same as Ap
from Control.Applicative
, but we introduce
our own new type to avoid orphan instances.
Constructors
TypeAp (f tp) |
Instances
ShowF f => Show (TypeAp f tp) Source # | |
TestEquality f => Eq (TypeAp f tp) Source # | |
OrdF f => Ord (TypeAp f tp) Source # | |
Defined in Data.Parameterized.Classes | |
(HashableF f, TestEquality f) => Hashable (TypeAp f tp) Source # | |
Defined in Data.Parameterized.Classes |
Optics generalizations
type family IndexF (m :: Type) :: k -> Type Source #
Instances
type IndexF (Assignment f ctx) Source # | |
Defined in Data.Parameterized.Context.Unsafe | |
type IndexF (List f sh) Source # | |
Defined in Data.Parameterized.List | |
type IndexF (MapF k2 v) Source # | |
Defined in Data.Parameterized.Map |
type family IxValueF (m :: Type) :: k -> Type Source #
Instances
type IxValueF (Assignment f ctx) Source # | |
Defined in Data.Parameterized.Context.Unsafe | |
type IxValueF (List f sh) Source # | |
Defined in Data.Parameterized.List | |
type IxValueF (MapF k2 v) Source # | |
Defined in Data.Parameterized.Map |
class IxedF k m where Source #
Parameterized generalization of the lens Ixed
class.
Methods
ixF :: forall (x :: k). IndexF m x -> Traversal' m (IxValueF m x) Source #
Given an index into a container, build a traversal that visits the given element in the container, if it exists.
Instances
OrdF k => IxedF a (MapF k v) Source # | Turn a map key into a traversal that visits the indicated element in the map, if it exists. |
IxedF k (Assignment f ctx) Source # | |
Defined in Data.Parameterized.Context.Unsafe Methods ixF :: forall (x :: k). IndexF (Assignment f ctx) x -> Traversal' (Assignment f ctx) (IxValueF (Assignment f ctx) x) Source # |
class IxedF k m => IxedF' k m where Source #
Parameterized generalization of the lens Ixed
class,
but with the guarantee that indexes exist in the container.
Methods
ixF' :: forall (x :: k). IndexF m x -> Lens' m (IxValueF m x) Source #
Given an index into a container, build a lens that points into the given element in the container.
Instances
IxedF' k (Assignment f ctx) Source # | |
Defined in Data.Parameterized.Context.Unsafe Methods ixF' :: forall (x :: k). IndexF (Assignment f ctx) x -> Lens' (Assignment f ctx) (IxValueF (Assignment f ctx) x) Source # |
class IxedF k m => AtF k m where Source #
Parameterized generalization of the lens At
class.
Methods
atF :: forall (x :: k). IndexF m x -> Lens' m (Maybe (IxValueF m x)) Source #
Given an index into a container, build a lens that points into
the given position in the container, whether or not it currently
exists. Setting values of atF
to a Just
value will insert
the value if it does not already exist.
KnownRepr
class KnownRepr (f :: k -> Type) (ctx :: k) where Source #
This class is parameterized by a kind k
(typically a data
kind), a type constructor f
of kind k -> *
(typically a GADT of
singleton types indexed by k
), and an index parameter ctx
of
kind k
.
Instances
Re-exports
class Eq a => Hashable a where #
Minimal complete definition
Nothing