Copyright | (c) Justin Le 2021 |
---|---|
License | BSD-3 |
Maintainer | justin@jle.im |
Stability | unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
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.
Synopsis
- 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.
GBounded | |
|
Instances
Functor GBounded Source # | |
Foldable GBounded Source # | |
Defined in Data.Bounded.OneLiner fold :: Monoid m => GBounded m -> m # foldMap :: Monoid m => (a -> m) -> GBounded a -> m # foldMap' :: Monoid m => (a -> m) -> GBounded a -> m # foldr :: (a -> b -> b) -> b -> GBounded a -> b # foldr' :: (a -> b -> b) -> b -> GBounded a -> b # foldl :: (b -> a -> b) -> b -> GBounded a -> b # foldl' :: (b -> a -> b) -> b -> GBounded a -> b # foldr1 :: (a -> a -> a) -> GBounded a -> a # foldl1 :: (a -> a -> a) -> GBounded a -> a # elem :: Eq a => a -> GBounded a -> Bool # maximum :: Ord a => GBounded a -> a # minimum :: Ord a => GBounded a -> a # | |
Traversable GBounded Source # | |
(ADT a, Constraints a Bounded) => Bounded (GBounded a) Source # | |
Eq a => Eq (GBounded a) Source # | |
Data a => Data (GBounded a) Source # | |
Defined in Data.Bounded.OneLiner gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GBounded a -> c (GBounded a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (GBounded a) # toConstr :: GBounded a -> Constr # dataTypeOf :: GBounded a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (GBounded a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (GBounded a)) # gmapT :: (forall b. Data b => b -> b) -> GBounded a -> GBounded a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GBounded a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GBounded a -> r # gmapQ :: (forall d. Data d => d -> u) -> GBounded a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> GBounded a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> GBounded a -> m (GBounded a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GBounded a -> m (GBounded a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GBounded a -> m (GBounded a) # | |
Ord a => Ord (GBounded a) Source # | |
Read a => Read (GBounded a) Source # | |
Show a => Show (GBounded a) Source # | |
Generic (GBounded a) Source # | |
type Rep (GBounded a) Source # | |
Defined in Data.Bounded.OneLiner |