packages feed

bookkeeper 0.2.1.0 → 0.2.1.1

raw patch · 3 files changed

+74/−1 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

+ CHANGELOG.md view
@@ -0,0 +1,15 @@+# 0.2.1.0++* Add 'Gettable', 'Settable', 'Modifiable' type synonyms.++# 0.2.0.0++* Added Eq instance+* Added Show instance+* Changed the implementation of 'set' and 'modify'. It no longer needs+  'ChooseFirst' to be in scope, and the class constraints changed.+* Removed 'ChooseFirst'.++# 0.1.0.0++* Initial release
+ README.md view
@@ -0,0 +1,54 @@+# Bookkeeper++Bookkeeper is a new Haskell library that uses the new OverlodaedLabels feature+of GHC 8 to provide a new take on datatypes and records:++~~~ {.haskell}+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE TypeOperators #-}+{-# LANGUAGE OverloadedLabels #-}+import Bookkeeper+++jane :: Book '[ "name" :=> String, "age" :=> Int ]+jane = emptyBook+     & #name =: "Jane"+     & #age =: 30++-- >>> jane+-- Book {age = 30, name = "Jane"}+-- >>> jane ?: #name+-- "Jane"+~~~++It bears some similarities to Nikita Volkov's [record](https://nikita-volkov.github.io/record/)+library, but requires no Template Haskell.++Accesing a field that does not exist is a type error, made nicer with GHCs new+custom type errors:++~~~ {.haskell}+ -- >>> jane ?: #address+--   • The provided Book does not contain the field "address"+--     Book type:+--     '["age" ':-> Int, "name" ':-> String]+~~~+++The order in which fields are inserted or appear in types does not matter. That+is, in:++~~~ {.haskell}+-- type A = Book '[ "field1" :=> Int, "field2" :=> Bool]+-- type B = Book '[ "field2" :=> Bool "field1" :=> Int ]+~~~++Types `A` and `B` are the same.++You can set, modify, or get fields. See the haddocks for more information.+++~~~ {.haskell}+main :: IO ()+main = return ()+~~~
bookkeeper.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack  name:           bookkeeper-version:        0.2.1.0+version:        0.2.1.1 synopsis:       Anonymous records and overloaded labels description:    Please see README.md category:       Data Structures, Records@@ -17,6 +17,10 @@ tested-with:    GHC == 8.0.1 build-type:     Simple cabal-version:  >= 1.10++extra-source-files:+    CHANGELOG.md+    README.md  source-repository head   type: git