homepage: https://github.com/sheaf/generic-labels
changelog-type: markdown
hash: 9ad1b34b414c0e0513f9f6bfccee465812170b7e7bcb2d4f23b6f17a9c386c8c
test-bench-deps:
  Cabal: '>=3.0 && <3.5'
  base: '>=4.14 && <4.17'
  inspection-testing: '>=0.4 && <0.5'
  generic-labels: -any
maintainer: Sam Derbyshire
synopsis: Generically extract and replace collections of record fields
changelog: "# Changelog for package `generic-labels`\r\n\r\n## 0.1.0.1 ( February
  09, 2020 )\r\n\r\n* Initial release\r\n"
basic-deps:
  base: '>=4.14 && <4.17'
  generic-lens-core: '>=2.0 && <2.2'
all-versions:
- 0.1.0.1
author: Sam Derbyshire
latest: 0.1.0.1
description-type: haddock
description: |-
  Handle various conversion operations between record types,
  such as projecting out a collection of fields from a record,
  or plugging in values for a subset of the fields of a larger record.

  Works both with built-in Haskell records, as well as explicitly labelled types
  @ ( #label := value ) :: ( "label" := Type ) @.

  Project out a smaller record using @project@:

  @
    data IBXD x = IBXD { i :: Int, b :: Bool, x :: x, d :: Double }
      deriving stock Generic
    data XI x = XI { x :: c, i :: Int }
      deriving stock Generic
  @

  Plug in a subset of fields using @inject@:

  @
    xi_into_ibxd :: XI x -> IBXD x -> IBXD x
    xi_into_ibxd = inject
  @

  Create a record out of two collections of arguments using @adapt@:

  @
    xi_plus_bd_makes_ibxd :: XI x -> ( "b" := Bool, "d" := Double ) -> IBXD x
    xi_plus_bd_makes_ibxd = adapt
  @

  See also the library's [readme](https://github.com/sheaf/generic-labels/blob/master/readme.md).
license-name: BSD-3-Clause

Update from Hackage at 2021-02-09T10:47:21Z
Update from Hackage at 2021-02-09T10:47:21Z
