type-operators-0.1.0.0: Various type-level operators

Safe HaskellNone
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 first-class type-functions. Example:

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

type (<^) a b = (^>) b a Source

A flipped ^>.

>>> f :: Maybe String <^ Int

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 b = f a b infixr 3 Source

Infix application that takes a two arguments rather than just one.

>>> f :: Either $$ Int ^> Int $ Int
f :: Either (Int -> Int) Int

type (%) c1 c2 a = (c1 a, c2 a) infixr 2 Source

Syntactic sugar for type constraints, allowing omission of repeat type variables.

>>> a :: (Num % Show) a => a -> String
a :: (Num a, Show a) => a -> String