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.
Instances
Bounded Three Source # | |
Enum Three Source # | |
Defined in Agda.Utils.Three succ :: Three -> Three Source # pred :: Three -> Three Source # toEnum :: Int -> Three Source # fromEnum :: Three -> Int Source # enumFrom :: Three -> [Three] Source # enumFromThen :: Three -> Three -> [Three] Source # enumFromTo :: Three -> Three -> [Three] Source # enumFromThenTo :: Three -> Three -> Three -> [Three] Source # | |
Show Three Source # | |
Eq Three Source # | |
Ord Three Source # | |
Defined in Agda.Utils.Three |
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 Source # (<) :: Either3 a b c -> Either3 a b c -> Bool Source # (<=) :: Either3 a b c -> Either3 a b c -> Bool Source # (>) :: Either3 a b c -> Either3 a b c -> Bool Source # (>=) :: Either3 a b c -> Either3 a b c -> Bool Source # max :: Either3 a b c -> Either3 a b c -> Either3 a b c Source # min :: Either3 a b c -> Either3 a b c -> Either3 a b c Source # |
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 #