Copyright | (c) 2012-2015 diagrams-core team (see LICENSE) |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | diagrams-discuss@googlegroups.com |
Safe Haskell | Safe |
Language | Haskell2010 |
A type for representing values with an additional bit saying
whether the value is "just a recommendation" (to be used only if
nothing better comes along) or a "commitment" (to certainly be
used, overriding merely recommended values), along with
corresponding Semigroup
and Monoid
instances.
Synopsis
- data Recommend a
- getRecommend :: Recommend a -> a
Documentation
A value of type Recommend a
consists of a value of type a
wrapped up in one of two constructors. The Recommend
constructor indicates a "non-committal recommendation"---that
is, the given value should be used if no other/better values are
available. The Commit
constructor indicates a
"commitment"---a value which should definitely be used,
overriding any Recommend
ed values.
Instances
Functor Recommend Source # | |
Foldable Recommend Source # | |
Defined in Data.Monoid.Recommend fold :: Monoid m => Recommend m -> m # foldMap :: Monoid m => (a -> m) -> Recommend a -> m # foldr :: (a -> b -> b) -> b -> Recommend a -> b # foldr' :: (a -> b -> b) -> b -> Recommend a -> b # foldl :: (b -> a -> b) -> b -> Recommend a -> b # foldl' :: (b -> a -> b) -> b -> Recommend a -> b # foldr1 :: (a -> a -> a) -> Recommend a -> a # foldl1 :: (a -> a -> a) -> Recommend a -> a # toList :: Recommend a -> [a] # length :: Recommend a -> Int # elem :: Eq a => a -> Recommend a -> Bool # maximum :: Ord a => Recommend a -> a # minimum :: Ord a => Recommend a -> a # | |
Traversable Recommend Source # | |
Eq a => Eq (Recommend a) Source # | |
Data a => Data (Recommend a) Source # | |
Defined in Data.Monoid.Recommend gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Recommend a -> c (Recommend a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Recommend a) # toConstr :: Recommend a -> Constr # dataTypeOf :: Recommend a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Recommend a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Recommend a)) # gmapT :: (forall b. Data b => b -> b) -> Recommend a -> Recommend a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Recommend a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Recommend a -> r # gmapQ :: (forall d. Data d => d -> u) -> Recommend a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Recommend a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Recommend a -> m (Recommend a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Recommend a -> m (Recommend a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Recommend a -> m (Recommend a) # | |
Ord a => Ord (Recommend a) Source # | |
Defined in Data.Monoid.Recommend | |
Read a => Read (Recommend a) Source # | |
Show a => Show (Recommend a) Source # | |
Semigroup a => Semigroup (Recommend a) Source # |
|
(Semigroup a, Monoid a) => Monoid (Recommend a) Source # | |
getRecommend :: Recommend a -> a Source #
Extract the value of type a
wrapped in Recommend a
.