Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
A collection of type-level operators.
Synopsis
- type (^>) = (->)
- type (<^) a b = (^>) b a
- type ($) f a = f a
- type (&) a f = f a
- type ($$) f a = f a
- type family (a :: k1) <+> (b :: k2) :: Constraint
- type family (c :: k -> Constraint) <=> (as :: [k]) where ...
Documentation
type (^>) = (->) infixr 5 Source #
A tightly binding version of ->
that lets you strip parentheses from
function types in certain spots. Example:
f :: Maybe Int ^> String = f :: Maybe (Int -> String)
type ($) f a = f a infixr 2 Source #
Infix application.
f :: Either String $ Maybe Int = f :: Either String (Maybe Int)
type ($$) f a = f a infixr 3 Source #
Infix application that can take two arguments in combination with $
.
f :: Either $$ Int ^> Int $ Int ^> Int = f :: Either (Int -> Int) (Int -> Int)
type family (a :: k1) <+> (b :: k2) :: Constraint infixl 9 Source #
Map any constraints over any type variables.
a :: [Show, Read] <+> a => a -> a = a :: (Show a, Read a) => a -> a a :: Show <+> [a, b, c] => a -> b -> c -> String = a :: (Show a, Show b, Show c) => a -> b -> c -> String
Instances
type (_ :: k1) <+> [] Source # | |
Defined in Control.Type.Operator type (_ :: k1) <+> [] = () | |
type (c ': cs :: [Type -> Constraint]) <+> (a :: Type) Source # | |
Defined in Control.Type.Operator | |
type [] <+> (_ :: k2) Source # | |
Defined in Control.Type.Operator type [] <+> (_ :: k2) = () | |
type (c :: k -> Constraint) <+> (a ': as :: [k]) Source # | |
Defined in Control.Type.Operator |
type family (c :: k -> Constraint) <=> (as :: [k]) where ... infixl 9 Source #
Deprecated: Since (+) is now kind-polymorphic and accepts the arguments on either side (=) will be removed in a future version.
Map a constraint over several variables.
a :: Show <=> [a, b] => a -> b -> String = a :: (Show a, Show b) => a -> b -> String
c <=> '[] = (() :: Constraint) | |
c <=> (h ': t) = (c h, (<=>) c t) |