optics-core-0.2: 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 IxList = [Type] Source #

A list of index types, used for indexed optics.

Since: 0.2

type NoIx = ('[] :: IxList) Source #

An alias for an empty index-list

type WithIx i = ('[i] :: IxList) Source #

Singleton index list

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

Show a type surrounded by quote marks.

Equations

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

type family Curry (xs :: IxList) (y :: Type) :: Type 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 :: IxList) (ys :: IxList) :: IxList 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 #