| Copyright | (C) 2024 Koji Miyazato |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Koji Miyazato <viercc@gmail.com> |
| Stability | experimental |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Data.Functor.KeepLeft
Description
Synopsis
- newtype KeepLeft c a = KeepLeft {
- getKeepLeft :: c
Documentation
Another choices of instances for Const. have KeepLeft cApply instance isomorphic to
Const (, which can also (exceptionally) have First c)Bind instance.
The most used constant functor Const lacks the instance of Bind, due to incompatibility
between Bind and Apply.
instance (Semigroup c) =>Apply(Constc)
While any Semigroup c instance yields a lawful Apply (Const c) instance, large number of
them do not have Bind (Const c) instance compatible to Apply. One of few exceptional Semigroup
instance is the one defined as below, which is isomorphic to semigroup.First c
(<>) :: c -> c -> c x <> _ = x
Constructors
| KeepLeft | |
Fields
| |