| Copyright | (c) Justin Le 2018 |
|---|---|
| License | BSD-3 |
| Maintainer | justin@jle.im |
| Stability | unstable |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Bounded.OneLiner
Description
Derived methods for Bounded, using Generics.OneLiner and
GHC.Generics.
Can be used for any types (deriving Generic) where every field is an
instance of Bounded.
Also includes a newtype wrapper that imbues any such data type with an
instant Bounded instance, which can one day be used with DerivingVia
syntax to derive instances automatically.
- newtype GBounded a = GBounded {
- getGBounded :: a
- gMinBound :: forall a. (ADT a, Constraints a Bounded) => a
- gMaxBound :: forall a. (ADT a, Constraints a Bounded) => a
Newtype wrapper
If a is a data type whose fields are all instances of Bounded,
then has a GBounded aBounded instance.
Will one day be able to be used with DerivingVia syntax, to derive instances automatically.
Constructors
| GBounded | |
Fields
| |
Instances
| Functor GBounded # | |
| Foldable GBounded # | |
| Traversable GBounded # | |
| (ADT a, Constraints a Bounded) => Bounded (GBounded a) # | |
| Eq a => Eq (GBounded a) # | |
| Data a => Data (GBounded a) # | |
| Ord a => Ord (GBounded a) # | |
| Read a => Read (GBounded a) # | |
| Show a => Show (GBounded a) # | |
| Generic (GBounded a) # | |
| type Rep (GBounded a) # | |
Generics-derived methods
gMinBound :: forall a. (ADT a, Constraints a Bounded) => a #