HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Moduleoptics-core-0.4.2Haskell2010

Optics.Internal.Optic.TypeLevel

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

  • 4 types
  • 3 classes
  • Packageoptics-core-0.4.2
  • Exports24
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceTypeLevel.hs
typetype IxList = [Type]
#

A list of index types, used for indexed optics.

typetype NoIx = '[]
#

An alias for an empty index-list

typetype WithIx i = '[i]
#

Singleton index list

familytype family Reverse (xs :: [k]) (acc :: [k]) :: [k] where
#

Reverse a type-level list.

Equations

familytype family Curry (xs :: IxList) y where
#

Curry a type-level list.

In pseudo (dependent-)Haskell:

Curry xs y = foldr (->) y xs

Equations

familytype family Append (xs :: [k]) (ys :: [k]) :: [k] where
#

Append two type-level lists together.

Equations

classclass CurryCompose (xs :: IxList) where
#

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

    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.

Instances2CurryCompose
  • CurryCompose '[]Defined in optics-core-0.4.2 · Optics.Internal.Optic.TypeLevel
  • CurryCompose xs => CurryCompose (x ': xs)Defined in optics-core-0.4.2 · Optics.Internal.Optic.TypeLevel
datadata IxEq (i :: k) (is :: k1) (js :: k1) where
#

Tagged version of 'Data.Type.Equality.(:~:)' for carrying evidence that two index lists in a curried form are equal.

Constructors

classclass AppendIndices (xs :: IxList) (ys :: IxList) (ks :: IxList) | xs ys -> ks where
#

In pseudo (dependent-)Haskell, provide a witness

foldr f (foldr f init xs) ys = foldr f init (ys ++ xs)
   where f = (->)

Methods

Instances3AppendIndices
  • xs ~ zs => AppendIndices xs '[] zsDefined in optics-core-0.4.2 · Optics.Internal.Optic.TypeLevel

    If the second list is empty, we can pick the first list even if nothing is known about it.

  • ys ~ zs => AppendIndices '[] ys zsDefined in optics-core-0.4.2 · Optics.Internal.Optic.TypeLevel
  • AppendIndices xs ys ks => AppendIndices (x ': xs) ys (x ': ks)Defined in optics-core-0.4.2 · Optics.Internal.Optic.TypeLevel
classclass HasShapeOf (a :: k) (b :: k)
#

Derive the shape of a from the shape of b.

Instances2HasShapeOf
  • a ~ b => HasShapeOf a bDefined in optics-core-0.4.2 · Optics.Internal.Optic.TypeLevel
  • (fa ~ f a, HasShapeOf f g) => HasShapeOf fa (g b)Defined in optics-core-0.4.2 · Optics.Internal.Optic.TypeLevel