| Copyright | Samuel Schlesinger 2021 (c) |
|---|---|
| License | MIT |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Data.Merge
Description
Documentation
Describes the merging of two values of the same type
into some other type. Represented as a Maybe valued
function, one can also think of this as a predicate
showing which pairs of values can be merged in this way.
data Example = Whatever { a :: Int, b :: Maybe Bool }
mergeExamples :: Merge Example Example
mergeExamples = Example <$> required a <*> optional bInstances
| Profunctor Merge Source # | |
Defined in Data.Merge Methods dimap :: (a -> b) -> (c -> d) -> Merge b c -> Merge a d # lmap :: (a -> b) -> Merge b c -> Merge a c # rmap :: (b -> c) -> Merge a b -> Merge a c # (#.) :: forall a b c q. Coercible c b => q b c -> Merge a b -> Merge a c # (.#) :: forall a b c q. Coercible b a => Merge b c -> q a b -> Merge a c # | |
| Monad (Merge x) Source # | |
| Functor (Merge x) Source # | |
| Applicative (Merge x) Source # | |
| Alternative (Merge x) Source # | |
| Semigroup a => Semigroup (Merge x a) Source # | |
| Semigroup a => Monoid (Merge x a) Source # | |
merge :: (x -> x -> Maybe a) -> Merge x a Source #
The most general combinator for constructing Merges.