-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Sum and Product types and such -- -- This library provides first-class multi-arity product- and sum-types -- and neat type-level utilities for their composition. The solution is -- quite simple and doesn’t require the advanced proficiency in the -- language to be applied in practice. -- -- For a comprehensive introduction please see this blog post. @package compound-types @version 0.1.3 -- | Implementations of the lazy data-structures. module CompoundTypes.Lazy data Sum2 _1 _2 Sum2_1 :: _1 -> Sum2 _1 _2 Sum2_2 :: _2 -> Sum2 _1 _2 data Sum3 _1 _2 _3 Sum3_1 :: _1 -> Sum3 _1 _2 _3 Sum3_2 :: _2 -> Sum3 _1 _2 _3 Sum3_3 :: _3 -> Sum3 _1 _2 _3 data Sum4 _1 _2 _3 _4 Sum4_1 :: _1 -> Sum4 _1 _2 _3 _4 Sum4_2 :: _2 -> Sum4 _1 _2 _3 _4 Sum4_3 :: _3 -> Sum4 _1 _2 _3 _4 Sum4_4 :: _4 -> Sum4 _1 _2 _3 _4 data Sum5 _1 _2 _3 _4 _5 Sum5_1 :: _1 -> Sum5 _1 _2 _3 _4 _5 Sum5_2 :: _2 -> Sum5 _1 _2 _3 _4 _5 Sum5_3 :: _3 -> Sum5 _1 _2 _3 _4 _5 Sum5_4 :: _4 -> Sum5 _1 _2 _3 _4 _5 Sum5_5 :: _5 -> Sum5 _1 _2 _3 _4 _5 data Sum6 _1 _2 _3 _4 _5 _6 Sum6_1 :: _1 -> Sum6 _1 _2 _3 _4 _5 _6 Sum6_2 :: _2 -> Sum6 _1 _2 _3 _4 _5 _6 Sum6_3 :: _3 -> Sum6 _1 _2 _3 _4 _5 _6 Sum6_4 :: _4 -> Sum6 _1 _2 _3 _4 _5 _6 Sum6_5 :: _5 -> Sum6 _1 _2 _3 _4 _5 _6 Sum6_6 :: _6 -> Sum6 _1 _2 _3 _4 _5 _6 data Sum7 _1 _2 _3 _4 _5 _6 _7 Sum7_1 :: _1 -> Sum7 _1 _2 _3 _4 _5 _6 _7 Sum7_2 :: _2 -> Sum7 _1 _2 _3 _4 _5 _6 _7 Sum7_3 :: _3 -> Sum7 _1 _2 _3 _4 _5 _6 _7 Sum7_4 :: _4 -> Sum7 _1 _2 _3 _4 _5 _6 _7 Sum7_5 :: _5 -> Sum7 _1 _2 _3 _4 _5 _6 _7 Sum7_6 :: _6 -> Sum7 _1 _2 _3 _4 _5 _6 _7 Sum7_7 :: _7 -> Sum7 _1 _2 _3 _4 _5 _6 _7 -- | Automatically derives the sum-type of the according arity from -- expressions such as: -- --
--   Int + Char + Bool
--   
-- -- In that case it will resolve to: -- --
--   Sum3 Int Char Bool
--   
-- | An operator for removing elements from the sum-types. E.g., -- --
--   Int + Char + Bool - Char
--   
-- -- is the same type as -- --
--   Int + Bool
--   
-- | What you get, when the subtraction cannot yet be performed. -- -- Happens when the minuend doesn't contain the subtrahend. E.g., -- --
--   Char - Bool
--   
-- -- produces -- --
--   Unsubtracted Char Bool
--   
-- -- However it's possible to get back to the normal type, when you perform -- the required addition afterwards. E.g., -- --
--   Char - Bool + Bool
--   
-- -- produces -- --
--   Char
--   
-- -- This construct actually exists primarily for that purpose. data Unsubtracted minuend subtrahend data Product2 _1 _2 Product2 :: _1 -> _2 -> Product2 _1 _2 data Product3 _1 _2 _3 Product3 :: _1 -> _2 -> _3 -> Product3 _1 _2 _3 data Product4 _1 _2 _3 _4 Product4 :: _1 -> _2 -> _3 -> _4 -> Product4 _1 _2 _3 _4 data Product5 _1 _2 _3 _4 _5 Product5 :: _1 -> _2 -> _3 -> _4 -> _5 -> Product5 _1 _2 _3 _4 _5 data Product6 _1 _2 _3 _4 _5 _6 Product6 :: _1 -> _2 -> _3 -> _4 -> _5 -> _6 -> Product6 _1 _2 _3 _4 _5 _6 data Product7 _1 _2 _3 _4 _5 _6 _7 Product7 :: _1 -> _2 -> _3 -> _4 -> _5 -> _6 -> _7 -> Product7 _1 _2 _3 _4 _5 _6 _7 -- | Automatically derives the product-type of the according arity from -- expressions such as: -- --
--   Int * Char * Bool
--   
-- -- In that case it will resolve to: -- --
--   Product3 Int Char Bool
--   
-- | An operator for removing elements from the product-types. E.g., -- --
--   Int * Char * Bool / Char
--   
-- -- is the same type as -- --
--   Int * Bool
--   
-- | What you get, when the division cannot yet be performed. -- -- Happens when the dividend doesn't contain the divisor. E.g., -- --
--   Char / Bool
--   
-- -- produces -- --
--   Undivided Char Bool
--   
-- -- However it's possible to get back to the normal type, when you perform -- the required multiplication afterwards. E.g., -- --
--   Char / Bool * Bool
--   
-- -- produces -- --
--   Char
--   
-- -- This construct actually exists primarily for that purpose. data Undivided dividend divisor -- | Implementations of the strict data-structures. module CompoundTypes.Strict data Sum2 _1 _2 Sum2_1 :: !_1 -> Sum2 _1 _2 Sum2_2 :: !_2 -> Sum2 _1 _2 data Sum3 _1 _2 _3 Sum3_1 :: !_1 -> Sum3 _1 _2 _3 Sum3_2 :: !_2 -> Sum3 _1 _2 _3 Sum3_3 :: !_3 -> Sum3 _1 _2 _3 data Sum4 _1 _2 _3 _4 Sum4_1 :: !_1 -> Sum4 _1 _2 _3 _4 Sum4_2 :: !_2 -> Sum4 _1 _2 _3 _4 Sum4_3 :: !_3 -> Sum4 _1 _2 _3 _4 Sum4_4 :: !_4 -> Sum4 _1 _2 _3 _4 data Sum5 _1 _2 _3 _4 _5 Sum5_1 :: !_1 -> Sum5 _1 _2 _3 _4 _5 Sum5_2 :: !_2 -> Sum5 _1 _2 _3 _4 _5 Sum5_3 :: !_3 -> Sum5 _1 _2 _3 _4 _5 Sum5_4 :: !_4 -> Sum5 _1 _2 _3 _4 _5 Sum5_5 :: !_5 -> Sum5 _1 _2 _3 _4 _5 data Sum6 _1 _2 _3 _4 _5 _6 Sum6_1 :: !_1 -> Sum6 _1 _2 _3 _4 _5 _6 Sum6_2 :: !_2 -> Sum6 _1 _2 _3 _4 _5 _6 Sum6_3 :: !_3 -> Sum6 _1 _2 _3 _4 _5 _6 Sum6_4 :: !_4 -> Sum6 _1 _2 _3 _4 _5 _6 Sum6_5 :: !_5 -> Sum6 _1 _2 _3 _4 _5 _6 Sum6_6 :: !_6 -> Sum6 _1 _2 _3 _4 _5 _6 data Sum7 _1 _2 _3 _4 _5 _6 _7 Sum7_1 :: !_1 -> Sum7 _1 _2 _3 _4 _5 _6 _7 Sum7_2 :: !_2 -> Sum7 _1 _2 _3 _4 _5 _6 _7 Sum7_3 :: !_3 -> Sum7 _1 _2 _3 _4 _5 _6 _7 Sum7_4 :: !_4 -> Sum7 _1 _2 _3 _4 _5 _6 _7 Sum7_5 :: !_5 -> Sum7 _1 _2 _3 _4 _5 _6 _7 Sum7_6 :: !_6 -> Sum7 _1 _2 _3 _4 _5 _6 _7 Sum7_7 :: !_7 -> Sum7 _1 _2 _3 _4 _5 _6 _7 -- | Automatically derives the sum-type of the according arity from -- expressions such as: -- --
--   Int + Char + Bool
--   
-- -- In that case it will resolve to: -- --
--   Sum3 Int Char Bool
--   
-- | An operator for removing elements from the sum-types. E.g., -- --
--   Int + Char + Bool - Char
--   
-- -- is the same type as -- --
--   Int + Bool
--   
-- | What you get, when the subtraction cannot yet be performed. -- -- Happens when the minuend doesn't contain the subtrahend. E.g., -- --
--   Char - Bool
--   
-- -- produces -- --
--   Unsubtracted Char Bool
--   
-- -- However it's possible to get back to the normal type, when you perform -- the required addition afterwards. E.g., -- --
--   Char - Bool + Bool
--   
-- -- produces -- --
--   Char
--   
-- -- This construct actually exists primarily for that purpose. data Unsubtracted minuend subtrahend data Product2 _1 _2 Product2 :: !_1 -> !_2 -> Product2 _1 _2 data Product3 _1 _2 _3 Product3 :: !_1 -> !_2 -> !_3 -> Product3 _1 _2 _3 data Product4 _1 _2 _3 _4 Product4 :: !_1 -> !_2 -> !_3 -> !_4 -> Product4 _1 _2 _3 _4 data Product5 _1 _2 _3 _4 _5 Product5 :: !_1 -> !_2 -> !_3 -> !_4 -> !_5 -> Product5 _1 _2 _3 _4 _5 data Product6 _1 _2 _3 _4 _5 _6 Product6 :: !_1 -> !_2 -> !_3 -> !_4 -> !_5 -> !_6 -> Product6 _1 _2 _3 _4 _5 _6 data Product7 _1 _2 _3 _4 _5 _6 _7 Product7 :: !_1 -> !_2 -> !_3 -> !_4 -> !_5 -> !_6 -> !_7 -> Product7 _1 _2 _3 _4 _5 _6 _7 -- | Automatically derives the product-type of the according arity from -- expressions such as: -- --
--   Int * Char * Bool
--   
-- -- In that case it will resolve to: -- --
--   Product3 Int Char Bool
--   
-- | An operator for removing elements from the product-types. E.g., -- --
--   Int * Char * Bool / Char
--   
-- -- is the same type as -- --
--   Int * Bool
--   
-- | What you get, when the division cannot yet be performed. -- -- Happens when the dividend doesn't contain the divisor. E.g., -- --
--   Char / Bool
--   
-- -- produces -- --
--   Undivided Char Bool
--   
-- -- However it's possible to get back to the normal type, when you perform -- the required multiplication afterwards. E.g., -- --
--   Char / Bool * Bool
--   
-- -- produces -- --
--   Char
--   
-- -- This construct actually exists primarily for that purpose. data Undivided dividend divisor