derive-lifted-instances: Derive class instances though various kinds of lifting

[ apache, data, development, generics, library ] [ Propose Tags ]

Helper functions to use Template Haskell for generating class instances.


[Skip to Readme]
Versions [faq] 0, 0.1, 0.1.1, 0.2, 0.2.1, 0.2.2
Change log CHANGELOG.md
Dependencies base (>=4.13 && <4.16), bifunctors (>=5.5.7 && <6), reflection (>=2.1 && <3), template-haskell (>=2.15 && <2.18) [details]
License Apache-2.0
Author Sjoerd Visscher
Maintainer sjoerd@w3future.com
Category Data, Generics, Development
Home page https://github.com/sjoerdvisscher/derive-lifted-instances
Bug tracker https://github.com/sjoerdvisscher/derive-lifted-instances/issues
Source repo head: git clone git://github.com/sjoerdvisscher/derive-lifted-instances.git
Uploaded by SjoerdVisscher at 2020-10-03T15:18:56Z
Distributions NixOS:0.2.2
Downloads 473 total (27 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
All reported builds failed as of 2020-10-03 [all 3 reports]

Modules

  • Data
    • Data.DeriveLiftedInstances
      • Data.DeriveLiftedInstances.Internal

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for derive-lifted-instances-0.2.2

[back to package description]

derive-lifted-instances

Hackage Build Status

derive-lifted-instances generates type class instances using Template Haskell.

Below is an overview of what this library can do. If you could rewrite a class as one of the cases, and the listed constraints are satisfiable, then an instance can be derived. Note that when another instance of the class is required, this could also be a derived instance (i.e. deriving is composable), in case you don't want that instance to actually exist.

| | class C x where alg :: f x -> x |--------------|--- | x iso y | (Functor f, C y) | x=m | (Foldable f, Monoid m) | x=t a | (Traversable f, Applicative t, C a) | x=t a b | (Traversable f, Biapplicative t, C a, C b) | x a record | (Traversable f, All C flds)

| | class C x where coalg :: x -> f x |--------------|--- | x iso y | (Functor f, C y) | x=m | (Pointed f) | x=t a | (Applicative f, Traversable t, C a) | x=t a b | (Applicative f, Bitraversable t, C a, C b) | x a record | (Applicative f, All C flds)

| | class C x where dialg :: f x -> g x |--------------|--- | x iso y | (Functor f, Functor g, C y) | x=m | (Foldable f, Porinted g, Monoid m) | x=t a | (Traversable f, Applicative g, Applicative t, Traversable t, C a) | x=t a b | (Traversable f, Applicative g, Biapplicative t, Bitraversable t, C a, C b) | x a record | (Traversable f, Applicative g, All C flds)