GHC.Records

base-4.11.1.0: Basic libraries

Copyright | (c) Adam Gundry 2015-2016
License | see libraries/base/LICENSE
Maintainer | cvs-ghc@haskell.org
Stability | internal
Portability | non-portable (GHC extensions)
Safe Haskell | Safe
Language | Haskell2010

GHC.Records

Description

This module defines the `HasField` class used by the `OverloadedRecordFields` extension. See the <https://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields wiki page> for more details.

Synopsis

- class HasField (x :: k) r a | x r -> a where

# Documentation

class HasField (x :: k) r a | x r -> a where #

Constraint representing the fact that the field `x` belongs to the record type `r` and has field type `a`. This will be solved automatically, but manual instances may be provided as well.

Minimal complete definition

getField

Methods

getField :: r -> a #

Selector function to extract the field from the record.