| Maintainer | hapytexeu+gh@gmail.com |
|---|---|
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Dep.Data.Sum
Description
This module provides utility functions to compress/decompress sums, and render these Product's to
a unicode string.
Synopsis
- newtype Sum = Sum Sum'
- type Sum' = ThreePath
- newtype CompactSum = CompactSum CompactSum'
- type CompactSum' = [Int]
- newtype ProductOfSums = ProductOfSums [Sum]
- type ProductOfSums' = [Sum']
- showProductOfSums :: Char -> ProductOfSums' -> Text
- showSum :: Char -> Sum' -> Text
- showSum' :: Char -> Text -> Sum' -> Text
Type synonyms to represent synthesis
A data type that can be used to specify a sum. By using a newtype,
we can add special instance to the Sum.
Instances
| Eq Sum Source # | |
| Data Sum Source # | |
Defined in Dep.Data.Sum Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Sum -> c Sum # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Sum # dataTypeOf :: Sum -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Sum) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Sum) # gmapT :: (forall b. Data b => b -> b) -> Sum -> Sum # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Sum -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Sum -> r # gmapQ :: (forall d. Data d => d -> u) -> Sum -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Sum -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Sum -> m Sum # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Sum -> m Sum # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Sum -> m Sum # | |
| Ord Sum Source # | |
| Read Sum Source # | |
| Show Sum Source # | |
| Generic Sum Source # | |
| Arbitrary Sum Source # | |
| Binary Sum Source # | |
| NFData Sum Source # | |
Defined in Dep.Data.Sum | |
| Hashable Sum Source # | |
Defined in Dep.Data.Sum | |
| EvaluateItem Sum Source # | |
Defined in Dep.Data.Sum | |
| ToCompact Sum CompactSum Source # | |
Defined in Dep.Data.Sum | |
| type Rep Sum Source # | |
Defined in Dep.Data.Sum | |
newtype CompactSum Source #
A data type that can be used to specify a CompactSum. By using a new
type, this means that we can define other instances than these for a list of Int.
Constructors
| CompactSum CompactSum' |
Instances
type CompactSum' = [Int] Source #
newtype ProductOfSums Source #
A data type that is used to specify a product of sums. This type can be used
to specify new instance other than these of a list of lists of Ints.
Constructors
| ProductOfSums [Sum] |
Instances
type ProductOfSums' = [Sum'] Source #
A type synonym to present a product of sums where each item of the list is a Sum'.
Print sums and product of sums
Arguments
| :: Char | The name of the root variable that will be used with subscripts. |
| -> ProductOfSums' | The given sum of products to convert to a |
| -> Text | The corresponding |
Convert the given product of sums to a Text object that presents
the ProductOfSums' as a Text object with variables as subscript.
>>>showProductOfSums 'x' [[One, One], [DontCare, Zero, One]]"(x₀x₁)(x₁'x₂)"
Arguments
| :: Char | The name of the root variable that will be used with subscripts. |
| -> Sum' | The given sum to convert to a |
| -> Text | The corresponding |
Print a given sum as a sequence of variables that can be negated. for example:
>>>showSum 'x' [One, DontCare, Zero, One]"x₀ + x₂' + x₃"
Arguments
| :: Char | The name of the root variable that will be used with subscripts. |
| -> Text | The text that will be added as tail, this is useful if we combine Sums. |
| -> Sum' | The given sum to convert to a |
| -> Text |
Print a given sum as a sequence of variables that can be negated. for example:
>>>showSum' 'x' mempty [One, DontCare, Zero, One]"x₀ + x₂' + x₃"