optics-core-0.1: Optics as an abstract interface: core definitions

Safe HaskellSafe
LanguageHaskell2010

Optics.Internal.Optic.TypeLevel

Description

This module is intended for internal use only, and may change without warning in subsequent releases.

Synopsis

Documentation

type family QuoteType (x :: *) :: ErrorMessage where ... Source #

Show a type surrounded by quote marks.

Equations

QuoteType x = (Text "\8216" :<>: ShowType x) :<>: Text "\8217" 

type family Curry (xs :: [*]) (y :: *) :: * where ... Source #

Curry a type-level list.

In pseudo (dependent-)Haskell:

Curry xs y = foldr (->) y xs

Equations

Curry '[] y = y 
Curry (x ': xs) y = x -> Curry xs y 

type family Append (xs :: [*]) (ys :: [*]) :: [*] where ... Source #

Append two type-level lists together.

Equations

Append '[] ys = ys 
Append xs '[] = xs 
Append (x ': xs) ys = x ': Append xs ys 

class CurryCompose xs where Source #

Class that is inhabited by all type-level lists xs, providing the ability to compose a function under Curry xs.

Methods

composeN :: (i -> j) -> Curry xs i -> Curry xs j Source #

Compose a function under Curry xs. This generalises (.) (aka fmap for (->)) to work for curried functions with one argument for each type in the list.

Instances
CurryCompose ([] :: [Type]) Source # 
Instance details

Defined in Optics.Internal.Optic.TypeLevel

Methods

composeN :: (i -> j) -> Curry [] i -> Curry [] j Source #

CurryCompose xs => CurryCompose (x ': xs) Source # 
Instance details

Defined in Optics.Internal.Optic.TypeLevel

Methods

composeN :: (i -> j) -> Curry (x ': xs) i -> Curry (x ': xs) j Source #