mirror of
https://github.com/jcpetruzza/barbies.git
synced 2024-10-03 21:28:35 +03:00
not really known
83f4d4195e
In terms of operations, they are isomorphic, but the applicative laws are more lax, so we can define more lawful instances. We also remove `ProductBC`, since `bdicts` can just be expressed in terms of `baddDict` and `bpure`. |
||
---|---|---|
src | ||
test | ||
test-legacy | ||
.gitignore | ||
.travis.yml | ||
barbies.cabal | ||
ChangeLog.md | ||
LICENSE | ||
README.md | ||
Setup.hs | ||
stack-ghc-802.yaml | ||
stack-ghc-822.yaml | ||
stack-ghc-844.yaml | ||
stack-ghc-865.yaml | ||
stack-ghc-881.yaml | ||
stack.yaml |
barbies
Types that are parametric on unary type-constructors that control their shapes are like Barbies that can wear different clothes to become a different doll. This is a common Haskell-idiom. E.g.,
data Barbie f
= Barbie
{ name :: f String
, age :: f Int
}
b1 :: Barbie Last -- Barbie with a monoid structure
b2 :: Barbie (Const a) -- container Barbie
b3 :: Barbie Identity -- Barbie's new clothes
This package provides basic classes and abstractions to work with these types and easily transform them.