named-sop
Version 0.3.0.0 revision 0 uploaded by sjsch.
Package meta
- Synopsis
- Dependently-typed sums and products, tagged by field name
- Description
Sums and Maps (products) indexed by a typelevel map of their field (or constructor) names and types. They can be combined and split again; their typelevel map is sorted to ensure that the end result is independent of the order you combine it in.
Data.NamedSOP.Generic contains functions for automatically converting between types with a Generic instance and named sums of products:
>>> data A = C { a :: Int, b :: Bool } >>> | D Int Bool deriving (Generic) >>> :t genSum (C 3 True) NSum '[ "_C" ':-> NMap '[ "a" ':-> Int, "b" ':-> Bool], "_D" ':-> NMap '[ "_1" ':-> Int, "_2" ':-> Bool]]
- Author
- Sam Schweigel
- Bug reports
- n/a
- Category
- Data
- Copyright
- n/a
- Homepage
- https://github.com/sjsch/named-sop
- Maintainer
- Sam Schweigel <s.schweigel@gmail.com>
- Package URL
- n/a
- Stability
- n/a