overloaded-records-0.4.1.0: Overloaded Records based on current GHC proposal.

Copyright(c) 2016, Peter Trško
LicenseBSD3
Maintainerpeter.trsko@gmail.com
Stabilityexperimental
PortabilityNoImplicitPrelude
Safe HaskellNone
LanguageHaskell2010

Data.OverloadedLabels

Contents

Description

This module defines the IsLabel class which is used by the OverloadedLabels language extension. See the wiki page for more details.

The key idea is that when GHC sees an occurrence of the new overloaded label syntax #foo, it is replaced with

fromLabel (proxy# :: Proxy# "foo") :: alpha

plus a wanted constraint IsLabel "foo" alpha.

On GHC >=8.0.1 we just reexport GHC.OverloadedLabels module.

Synopsis

Oveloaded Labels

class IsLabel l a where Source

Methods

fromLabel :: Proxy# l -> a Source

Instances

HasField l s a => IsLabel l (Getter s a) Source

Since 0.4.1.0

ModifyField l s t a b => IsLabel l (Modifier s t a b) Source

Since 0.4.0.0