Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Tools for 3-way partitioning.
Synopsis
- data Three
- partition3 :: (a -> Three) -> [a] -> ([a], [a], [a])
- data Either3 a b c
- partitionEithers3 :: [Either3 a b c] -> ([a], [b], [c])
- mapEither3M :: Applicative m => (a -> m (Either3 b c d)) -> [a] -> m ([b], [c], [d])
- forEither3M :: Applicative m => [a] -> (a -> m (Either3 b c d)) -> m ([b], [c], [d])
Documentation
Enum type with 3 elements.
partition3 :: (a -> Three) -> [a] -> ([a], [a], [a]) Source #
Partition a list into 3 groups.
Preserves the relative order or elements.
Disjoint sum of three.
Instances
(Show a, Show b, Show c) => Show (Either3 a b c) Source # | |
(Eq a, Eq b, Eq c) => Eq (Either3 a b c) Source # | |
(Ord a, Ord b, Ord c) => Ord (Either3 a b c) Source # | |
Defined in Agda.Utils.Three compare :: Either3 a b c -> Either3 a b c -> Ordering # (<) :: Either3 a b c -> Either3 a b c -> Bool # (<=) :: Either3 a b c -> Either3 a b c -> Bool # (>) :: Either3 a b c -> Either3 a b c -> Bool # (>=) :: Either3 a b c -> Either3 a b c -> Bool # |
partitionEithers3 :: [Either3 a b c] -> ([a], [b], [c]) Source #
Partition a list into 3 groups.
Preserves the relative order or elements.
mapEither3M :: Applicative m => (a -> m (Either3 b c d)) -> [a] -> m ([b], [c], [d]) Source #
forEither3M :: Applicative m => [a] -> (a -> m (Either3 b c d)) -> m ([b], [c], [d]) Source #