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