BSD-3-Clause licensed by Chris Done
Maintained by [email protected]
This version can be pinned in stack with:labels-0.3.0@sha256:17a540e516d94740849852c4cb6e436f9da81b32727f2259d2d5b0b9141191ee,954

Module documentation for 0.3.0

labels

Declare and access tuple fields with labels

This package is experimental, exploring the design space opened up by the implemented and to-be-implemented work on extensible records in GHC.

Note: You need GHC 8.0.1 for the #foo syntax, otherwise you have to use $("foo") which works on GHC 7.10.

Basic examples

The haddock docs are here.

Enable these extensions:

  • In GHCi: :set -XOverloadedLabels -XTypeOperators -XDataKinds -XFlexibleContexts

  • In a module: {-# LANGUAGE OverloadedLabels, TypeOperators, DataKinds, FlexibleContexts #-}

Let’s use GHCi:

> import Labels
> :set -XOverloadedLabels -XTypeOperators -XDataKinds -XFlexibleContexts