type-operators-0.1.0.4: Various type-level operators

Safe HaskellSafe
LanguageHaskell2010

Control.Type.Operator

Description

A collection of type-level operators.

Synopsis

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 (<^) a b = (^>) b a infixr 5 Source #

A flipped ^>.

f :: Maybe String <^ Int
=
f :: Maybe (Int -> String)

Note: this is not partially applied like ^> and ->.

type ($) f a = f a infixr 2 Source #

Infix application.

f :: Either String $ Maybe Int
=
f :: Either String (Maybe Int)

type (&) a f = f a infixl 1 Source #

A flipped $.

f :: Maybe Int & Maybe
=
f :: Maybe (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 (c :: [k -> Constraint]) <+> (a :: k) where ... infixl 9 Source #

Map several constraints over a single variable.

a :: [Show, Read] <+> a => a -> a
=
a :: (Show a, Read a) => a -> a

Equations

'[] <+> a = (() :: Constraint) 
(ch ': ct) <+> a = (ch a, (<+>) ct a) 

type family (c :: k -> Constraint) <=> (as :: [k]) where ... infixl 9 Source #

Map a constraint over several variables.

a :: Show <=> [a, b] => a -> b -> String
=
a :: (Show a, Show b) => a -> b -> String

Equations

c <=> '[] = (() :: Constraint) 
c <=> (h ': t) = (c h, (<=>) c t)