Align and Zip type-classes from the common Semialign ancestor.
|Version on this page:||188.8.131.52@rev:3|
|LTS Haskell 20.16:||184.108.40.206@rev:3|
|Stackage Nightly 2023-03-27:||220.127.116.11@rev:3|
|Latest on Hackage:||1.3|
Maintained by Oleg Grenrus
This version can be pinned in stack with:
Module documentation for 18.104.22.168
Depends on 11 packages(full list with versions):
Used by 10 packages in nightly-2023-03-27(full list with versions):
The major use of
These of this is provided by the
align member of
Semialign class, representing a generalized notion of "zipping with padding"
that combines structures without truncating to the size of the smaller input.
It turns out that
zip operation fits well the
forming lattice-like structure.
- GHC-9.2 support
ZipWithIndexto this package, using
- Poly-kinded instances (notably
- Rename old
- i.e. current main hierarchy is
instance Functor f => Semialign f where alignWith :: (These a b -> c) -> f a -> f b -> f c instance Semialign f => Align f where nil :: f a instance Semialign f => Zip f where zipWith :: (a -> b -> c) -> f a -> f b -> f c instance Zip f => Repeat f where repeat :: a -> f a
This biased choice, that
Semialign is a super-class of
Zip is motivated by the fact that
- There’s no
Semialign-like class anywhere else, yet
Applicativewith slightly more laws. I If you need only
Repeatclass, and your type isn’t
Alingable, maybe using
Split out of