homepage: ''
changelog-type: markdown
hash: 588556958ff484aa4bb5c9fb2f52e6306952b5598c02bb19242148a3182a4461
test-bench-deps: {}
maintainer: dan.firth@homotopic.tech
synopsis: Loeb's theorem for extensible records.
changelog: |
  # Changelog for vinyl-loeb

  ## v0.0.1.0

  * Add `rloeb`.
basic-deps:
  base: '>=4.7 && <5'
  vinyl: -any
all-versions:
- 0.0.1.0
author: Daniel Firth
latest: 0.0.1.0
description-type: markdown
description: |
  # vinyl-loeb

  This package defines a version of loeb's theorem for
  [vinyl](https://hackage.haskell.org/package/vinyl).

  ```{.haskell}
  rloeb :: RMap xs => Rec ((->) (Rec f xs) :. f) xs  -> Rec f xs
  rloeb x = go where go = rmap (($ go) . getCompose) x
  ```

  This can be used to fill up an extensible record lazily using
  data from the result of the record itself.

  ```{.haskell}
  type F = [Text, Text]

  k :: Rec Thunk F -> Text
  k (Thunk f :& _) = f <> "bar"

  f :: Rec ((->) (Rec Thunk F) :. Thunk) F
  f = (Compose $ const $ Thunk $ "foo") :& Compose (Thunk . k) :& RNil

  -- > rloeb f
  -- {"foo", "foobar"}
  ```
license-name: MIT

Update from Hackage at 2020-12-07T02:28:24Z
Update from Hackage at 2020-12-07T02:28:24Z
