HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Moduleone-liner-2.1.1Haskell2010

Generics.OneLiner.Internal.Unary

Synopsis
  • Packageone-liner-2.1.1
  • Exports24
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceUnary.hs
typetype J (f :: k1 -> k1 -> k) (a :: k1) = f a a

Type-level join, of kind (k -> k -> k') -> k -> k'.

classclass (c a, a ~ b) => D (c :: k -> Constraint) (a :: k) (b :: k)

Constraint-level duplicate, of kind (k -> Constraint) -> k -> k -> Constraint.

Instances1D
  • (c a, a ~ b) => D c a bDefined in one-liner-2.1.1 · Generics.OneLiner.Internal.Unary
valuectorIndex :: ADT t => t -> Int

Get the index in the lists returned by create and createA of the constructor of the given value.

For example, this is the implementation of put that generates the binary data that the above implentation of get expects:

put t = putWord8 (toEnum (ctorIndex t)) <> gfoldMap @Binary put t
classclass AnyType (a :: k)

Any type is instance of AnyType, you can use it with @AnyType if you don't actually need a class constraint.

Instances1AnyType
  • AnyType aDefined in one-liner-2.1.1 · Generics.OneLiner.Internal.Unary