Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- module SizedGrid.Ordinal
- module SizedGrid.Grid.Grid
- module SizedGrid.Grid.Focused
- module SizedGrid.Grid.Class
- module SizedGrid.Coord.Periodic
- module SizedGrid.Coord.HardWrap
- module SizedGrid.Coord.Class
- module SizedGrid.Coord
- class (AllF f xs, SListI xs) => All (f :: k -> Constraint) (xs :: [k])
- class SListI (xs :: [k])
- class f (g x) => Compose (f :: k -> Constraint) (g :: k1 -> k) (x :: k1)
- newtype I a = I a
Documentation
module SizedGrid.Ordinal
module SizedGrid.Grid.Grid
module SizedGrid.Grid.Focused
module SizedGrid.Grid.Class
module SizedGrid.Coord.Periodic
module SizedGrid.Coord.HardWrap
module SizedGrid.Coord.Class
module SizedGrid.Coord
Rexported for generics-sop
class (AllF f xs, SListI xs) => All (f :: k -> Constraint) (xs :: [k]) #
Require a constraint for every element of a list.
If you have a datatype that is indexed over a type-level
list, then you can use All
to indicate that all elements
of that type-level list must satisfy a given constraint.
Example: The constraint
All Eq '[ Int, Bool, Char ]
is equivalent to the constraint
(Eq Int, Eq Bool, Eq Char)
Example: A type signature such as
f :: All Eq xs => NP I xs -> ...
means that f
can assume that all elements of the n-ary
product satisfy Eq
.
Instances
(AllF f xs, SListI xs) => All (f :: k -> Constraint) (xs :: [k]) | |
Defined in Generics.SOP.Constraint |
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 f
, the kind of :.
gf
is k ->
.
The kind of Constraint
g
, however, is l -> k
and can thus be an 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
(Show
:. f) xs
Since: generics-sop-0.2
Instances
f (g x) => Compose (f :: k2 -> Constraint) (g :: k1 -> k2) (x :: k1) | |
Defined in Generics.SOP.Constraint |
The identity type functor.
Like Identity
, but with a shorter name.
I a |
Instances
Monad I | |
Functor I | |
Applicative I | |
Foldable I | |
Defined in Generics.SOP.BasicFunctors fold :: Monoid m => I m -> 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 # | |
Traversable I | |
Eq1 I | Since: generics-sop-0.2.4.0 |
Ord1 I | Since: generics-sop-0.2.4.0 |
Defined in Generics.SOP.BasicFunctors | |
Read1 I | Since: generics-sop-0.2.4.0 |
Show1 I | Since: generics-sop-0.2.4.0 |
NFData1 I | Since: generics-sop-0.2.5.0 |
Defined in Generics.SOP.BasicFunctors | |
Eq a => Eq (I a) | |
Ord a => Ord (I a) | |
Read a => Read (I a) | |
Show a => Show (I a) | |
Generic (I a) | |
NFData a => NFData (I a) | Since: generics-sop-0.2.5.0 |
Defined in Generics.SOP.BasicFunctors | |
type Rep (I a) | |
Defined in Generics.SOP.BasicFunctors | |
type Code (I a) | |
Defined in Generics.SOP.Instances | |
type DatatypeInfoOf (I a) | |
Defined in Generics.SOP.Instances |