-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | An either-or-both data type. -- -- This package provides a data type These a b which can hold a -- value of either type or values of each type. This is usually thought -- of as an "inclusive or" type (contrasting Either a b as -- "exclusive or") or as an "outer join" type (contrasting (a, -- b) as "inner join"). -- --
-- data These a b = This a | That b | These a b ---- -- Since version 1, this package was split into parts: -- --
-- >>> partitionEithersNE $ Left 'x' :| [Right 'y']
-- These ('x' :| "") ('y' :| "")
--
--
--
-- >>> partitionEithersNE $ Left 'x' :| map Left "yz"
-- This ('x' :| "yz")
--
partitionEithersNE :: NonEmpty (Either a b) -> These (NonEmpty a) (NonEmpty b)
distrThesePair :: These (a, b) c -> (These a c, These b c)
undistrThesePair :: (These a c, These b c) -> These (a, b) c
distrPairThese :: (These a b, c) -> These (a, c) (b, c)
undistrPairThese :: These (a, c) (b, c) -> (These a b, c)
instance GHC.Generics.Generic1 (Data.These.These a)
instance GHC.Generics.Generic (Data.These.These a b)
instance (Data.Data.Data a, Data.Data.Data b) => Data.Data.Data (Data.These.These a b)
instance (GHC.Show.Show a, GHC.Show.Show b) => GHC.Show.Show (Data.These.These a b)
instance (GHC.Read.Read a, GHC.Read.Read b) => GHC.Read.Read (Data.These.These a b)
instance (GHC.Classes.Ord a, GHC.Classes.Ord b) => GHC.Classes.Ord (Data.These.These a b)
instance (GHC.Classes.Eq a, GHC.Classes.Eq b) => GHC.Classes.Eq (Data.These.These a b)
instance (GHC.Base.Semigroup a, GHC.Base.Semigroup b) => GHC.Base.Semigroup (Data.These.These a b)
instance GHC.Base.Functor (Data.These.These a)
instance Data.Foldable.Foldable (Data.These.These a)
instance Data.Traversable.Traversable (Data.These.These a)
instance Data.Bifunctor.Bifunctor Data.These.These
instance Data.Bifoldable.Bifoldable Data.These.These
instance Data.Bitraversable.Bitraversable Data.These.These
instance GHC.Base.Semigroup a => GHC.Base.Applicative (Data.These.These a)
instance GHC.Base.Semigroup a => GHC.Base.Monad (Data.These.These a)
instance (Data.Hashable.Class.Hashable a, Data.Hashable.Class.Hashable b) => Data.Hashable.Class.Hashable (Data.These.These a b)
instance Data.Bifunctor.Swap.Swap Data.These.These
instance Data.Bifunctor.Assoc.Assoc Data.These.These
instance (Control.DeepSeq.NFData a, Control.DeepSeq.NFData b) => Control.DeepSeq.NFData (Data.These.These a b)
instance (Data.Binary.Class.Binary a, Data.Binary.Class.Binary b) => Data.Binary.Class.Binary (Data.These.These a b)
-- | This module provides
--
-- -- mapHere = over here --mapHere :: (a -> c) -> These a b -> These c b -- |
-- mapThere = over there --mapThere :: (b -> d) -> These a b -> These a d -- | Bitraversable bitraverse. bitraverseThese :: Applicative f => (a -> f c) -> (b -> f d) -> These a b -> f (These c d) -- | These is commutative. -- --
-- swapThese . swapThese = id --swapThese :: These a b -> These b a -- | These is associative. -- --
-- assocThese . unassocThese = id -- unassocThese . assocThese = id --assocThese :: These (These a b) c -> These a (These b c) -- | These is associative. See assocThese. unassocThese :: These a (These b c) -> These (These a b) c justThis :: These a b -> Maybe a justThat :: These a b -> Maybe b justThese :: These a b -> Maybe (a, b) -- |
-- >>> justHere (This 'x') -- Just 'x' ---- --
-- >>> justHere (That 'y') -- Nothing ---- --
-- >>> justHere (These 'x' 'y') -- Just 'x' --justHere :: These a b -> Maybe a -- |
-- >>> justThere (This 'x') -- Nothing ---- --
-- >>> justThere (That 'y') -- Just 'y' ---- --
-- >>> justThere (These 'x' 'y') -- Just 'y' --justThere :: These a b -> Maybe b -- | Select all This constructors from a list. catThis :: [These a b] -> [a] -- | Select all That constructors from a list. catThat :: [These a b] -> [b] -- | Select all These constructors from a list. catThese :: [These a b] -> [(a, b)] catHere :: [These a b] -> [a] catThere :: [These a b] -> [b] -- |
-- isThis = isJust . justThis --isThis :: These a b -> Bool -- |
-- isThat = isJust . justThat --isThat :: These a b -> Bool -- |
-- isThese = isJust . justThese --isThese :: These a b -> Bool -- |
-- hasHere = isJust . justHere --hasHere :: These a b -> Bool -- |
-- hasThere = isJust . justThere --hasThere :: These a b -> Bool mapThis :: (a -> a) -> These a b -> These a b mapThat :: (b -> b) -> These a b -> These a b mapThese :: ((a, b) -> (a, b)) -> These a b -> These a b