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

GHC 10.0.0.20260917 · lts/ghc-10.0.x · c62e4de · 2026-10-19

Modulehnix-0.17.0Haskell2010

Nix.Expr.Types.Annotated

The source location annotated nix expression type and supporting types.

  • 7 types
  • 13 values
  • Packagehnix-0.17.0
  • Exports58
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceAnnotated.hs
patternpattern Ann :: ann -> f (Ann ann f) -> Ann ann f
#

Pattern: Fix (Compose (AnnUnit _ _)). Fix composes units of (annotations & the annotated) into one object. Giving annotated expression.

patternpattern AnnF :: ann -> f a -> Compose (AnnUnit ann) f a
#

Pattern: (Compose (AnnUnit _ _)).

datadata AnnUnit ann expr
#

A type constructor applied to a type along with an annotation

Intended to be used with Fix: type MyType = Fix (Compose (AnnUnit Annotation) F)

Constructors

Instances38Eq2, Ord2, Read2, Show2, FromJSON2, ToJSON2, …
typetype NExprLoc = Fix NExprLocF
#

Annotated Nix expression (each subexpression direct to its source location).

datadata SrcSpan
#

Demarcation of a chunk in a source file.

Instances22Eq, Data, Ord, Show, Generic, Semigroup, …
newtypenewtype Compose (f :: k -> Type) (g :: k1 -> k) (a :: k1)
#

Right-to-left composition of functors. The composition of applicative functors is always applicative, but the composition of monads is not always a monad.

Examples
Example1 expression
fmap (subtract 1) (Compose (Just [1, 2, 3]))Compose (Just [0,1,2])
Example1 expression
Compose (Just [1, 2, 3]) <> Compose NothingCompose (Just [1,2,3])
Example1 expression
Compose (Just [(++ "World"), (++ "Haskell")]) <*> Compose (Just ["Hello, "])Compose (Just ["Hello, World","Hello, Haskell"])

Constructors

Instances107Scoped, Generic1, TestEquality, Binary, Serialise, Composition, …