data-diverse: Extensible records and polymorphic variants.

[ bsd3, data, library, records ] [ Propose Tags ]
This version is deprecated.

Data.Diverse.Many is an extensible record for any size encoded efficiently as (Seq Any). Data.Diverse.Which is a polymorphic variant of possibilities encoded as (Int, Any). Provides getters, setters, projection, injection, folds, and catamorphisms; accessed by type, index or label. Refer to ManySpec.hs and WhichSpec.hs for example usages. Iso, Lens and Prisms are provided in data-diverse-lens


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.2.0.0, 0.2.1.0, 0.3.0.0, 0.4.0.0, 0.5.0.0, 0.6.0.0, 0.7.0.0, 0.8.0.0, 0.8.1.0, 0.9.0.0, 0.9.0.1, 0.10.0.0, 0.11.0.0, 1.0.0.0, 1.0.0.1, 1.1.0.0, 1.2.0.0, 1.2.0.1, 1.2.0.2, 1.2.0.3, 1.3.0.0, 2.0.0.0, 2.0.1.0, 3.0.0.0, 3.1.0.0, 4.0.0.0, 4.1.0.0, 4.2.0.0, 4.3.0.0, 4.4.0.0, 4.5.0.0, 4.6.0.0, 4.7.0.0, 4.7.1.0 (info)
Dependencies base (>=4.7 && <5), containers (>=0.5 && <0.6), deepseq (>=1.4 && <2), ghc-prim (>=0.5 && <1), tagged (>=0.8.5 && <1) [details]
License BSD-3-Clause
Copyright 2017 Louis Pan
Author Louis Pan
Maintainer louis@pan.me
Category Data, Records
Home page https://github.com/louispan/data-diverse#readme
Source repo head: git clone https://github.com/louispan/data-diverse
Uploaded by louispan at 2017-10-15T01:47:39Z
Distributions LTSHaskell:4.7.1.0, NixOS:4.7.1.0, Stackage:4.7.1.0
Reverse Dependencies 6 direct, 9 indirect [details]
Downloads 19262 total (110 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-10-15 [all 1 reports]

Readme for data-diverse-1.2.0.1

[back to package description]

Hackage Build Status

"Data.Diverse.Many" is an extensible record for any size encoded efficiently as (Seq Any).

"Data.Diverse.Which" polymorphic variant of possibilities encoded as (Int, Any).

Provides getters, setters, projection, injection, folds, and catamorphisms; accessed by type or index or label.

Refer to ManySpec.hs and WhichSpec.hs for example usages.

Iso, Lens and Prisms are provided in data-diverse-lens

Changelog

  • 1.2.0.1

    • 'insert'/'remove' is not available in GHC 8.2 onwards.
  • 1.2.0.0

    • Rerranged type variable for xxxL and xxxN functions so that the @x@ inferrred from label @l@ or index @n@ is after @proxy@.
      • This affects fetch[L|N], replace[L|N], replace[L|N]', pick[L|N]
    • Depends on at least containers-0.5.8.2 for Data.Sequence.insertAt
    • Added splitting operations: split[Before|After][|L|N], inset[Before|After][|L|N], insert[Before|After][|L|N], remove[Before|After][|L|N]
    • Renamed type function Without to Remove to be consistent with new remove method.
  • 1.1.0.0

  • 1.0.0.1

    • Added CaseTypeable' as an example of polymorphic Case that doesn't change the type.
  • 1.0.0.0

    • The exposed api shouldn't break, but there are a lot of internal changes.
    • Added AFunctor which can map over the types in the 'Many' https://github.com/louispan/data-diverse/issues/5.
    • Added friendlier type synomyns Collect and CollectN for collect and collectN
    • Expose type of 'Collector' and 'CollectorN'
    • Replace type parameter r from Case typeclass with CaseResult type family.
    • Replaced CasesResult type function with IsAll and CasesResults type functions.
    • All CaseXxx type variables now end with r xs.
    • All CaseXxxN type variables now end with r n xs.
  • 0.11.0.0

    • Added impossible modelled after Data.Void.absurd https://github.com/louispan/data-diverse/issues/4
    • Removed zilch so Which '[] is uninhabited like Data.Void.Void, making 'impossible' safe to use.
    • Removed Monoid and changed Show, Read and Generic instances for Which '[] to be partial just like Data.Void.Void.
    • Added instance Reduce (Which '[]) (Switcher c '[] r), which follows from 'impossible'.
  • 0.10.0.0

    • Renamed Switch to Switcher. Switch is now a type synonym for switch constraints
    • Added CasesResult type family to help infer the result of cases
    • Added Semigroup and Monoid instances for all Many xs.
    • Added Maybe versions of trial, and reinterpret
    • Renamed reinterpetN to reinterpretN'
    • Renamed impossible to zilch.
    • Allowed reintepreting and diversifying zilch to zilch
    • Removed zipped type variable from Amend constraints.
    • Removed r type variable from Reduce typeclass.
    • Rearranged type variables in fetch, replace, pick, trial, Diversify type parameters, so the type variable ordering is consistently smaller to larger, ie. 'x', 'xs', 'branch', 'tree'
    • Added diversify' for allowing rearranging the types only.
  • 0.9.0.1

    • Fixed GHC 8.2.1 test failure due to changed TypeRep show instance.
  • 0.9.0.0

    • Breaking changes: Renamed Many.sliceL/R to Many.viewf/b
    • Renamed TypeLevel.Internal.MissingImpl to IsUniqueImpl.
    • Added postifx' with SnocUnique and append' with AppendUnique.
    • Added Semigroup & Monoid instances for Many '[] and Which '[]
    • Fixed GHC 8.2 compile error with importing GHC.Prim (Any)
  • 0.8.1.0

    • Added NFData instance for Which.
    • Forgot to expose Many.sliceL and Many.sliceR.
  • 0.8.0.0

    • Changed internal representation to (Data.Seq Any) for a further 2x append speedup.
    • Added NFData instance for Many.
  • 0.7.0.0

    • Removed NOINLINE pragmas.
    • Changed internal representation to (Int, Data.IntMap Any) for a 2.5x append speedup.
  • 0.6.0.0

    • Moved lens to data-diverse-lens
  • 0.5.0.0

    • Renamed type level functions module from Type to TypeLevel
  • 0.4.0.0

    • Removed Emit typeclass, breaking renames. Added label accessors.
  • 0.1.0.0

    • Initial version represented as (Int, Data.Map Int Any)