dep-software-0.1.0.0
Maintainerhapytexeu+gh@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Dep.Data.Product

Description

This module provides utility functions to compress/decompress products, and render these Product's to a unicode string.

Synopsis

Type synonyms to represent synthesis

newtype Product Source #

A data type that can be used to specify a product. By using a newtype, we can add special instance to the Product.

Constructors

Product Product' 

Instances

Instances details
Eq Product Source # 
Instance details

Defined in Dep.Data.Product

Methods

(==) :: Product -> Product -> Bool #

(/=) :: Product -> Product -> Bool #

Data Product Source # 
Instance details

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 # 
Instance details

Defined in Dep.Data.Product

Read Product Source # 
Instance details

Defined in Dep.Data.Product

Show Product Source # 
Instance details

Defined in Dep.Data.Product

Generic Product Source # 
Instance details

Defined in Dep.Data.Product

Associated Types

type Rep Product :: Type -> Type #

Methods

from :: Product -> Rep Product x #

to :: Rep Product x -> Product #

Arbitrary Product Source # 
Instance details

Defined in Dep.Data.Product

Binary Product Source # 
Instance details

Defined in Dep.Data.Product

Methods

put :: Product -> Put #

get :: Get Product #

putList :: [Product] -> Put #

NFData Product Source # 
Instance details

Defined in Dep.Data.Product

Methods

rnf :: Product -> () #

Hashable Product Source # 
Instance details

Defined in Dep.Data.Product

Methods

hashWithSalt :: Int -> Product -> Int #

hash :: Product -> Int #

EvaluateItem Product Source # 
Instance details

Defined in Dep.Data.Product

ToCompact Product CompactProduct Source # 
Instance details

Defined in Dep.Data.Product

type Rep Product Source # 
Instance details

Defined in Dep.Data.Product

type Rep Product = D1 ('MetaData "Product" "Dep.Data.Product" "dep-software-0.1.0.0-ImGw9o7wQ122cC0Rs2n7ZK" 'True) (C1 ('MetaCons "Product" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Product')))

type Product' = ThreePath Source #

A type alias for a product that is a ThreePath.

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.

Instances

Instances details
Eq CompactProduct Source # 
Instance details

Defined in Dep.Data.Product

Data CompactProduct Source # 
Instance details

Defined in Dep.Data.Product

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CompactProduct -> c CompactProduct #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CompactProduct #

toConstr :: CompactProduct -> Constr #

dataTypeOf :: CompactProduct -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CompactProduct) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CompactProduct) #

gmapT :: (forall b. Data b => b -> b) -> CompactProduct -> CompactProduct #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CompactProduct -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CompactProduct -> r #

gmapQ :: (forall d. Data d => d -> u) -> CompactProduct -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CompactProduct -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CompactProduct -> m CompactProduct #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CompactProduct -> m CompactProduct #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CompactProduct -> m CompactProduct #

Ord CompactProduct Source # 
Instance details

Defined in Dep.Data.Product

Read CompactProduct Source # 
Instance details

Defined in Dep.Data.Product

Show CompactProduct Source # 
Instance details

Defined in Dep.Data.Product

Generic CompactProduct Source # 
Instance details

Defined in Dep.Data.Product

Associated Types

type Rep CompactProduct :: Type -> Type #

Arbitrary CompactProduct Source # 
Instance details

Defined in Dep.Data.Product

Binary CompactProduct Source # 
Instance details

Defined in Dep.Data.Product

NFData CompactProduct Source # 
Instance details

Defined in Dep.Data.Product

Methods

rnf :: CompactProduct -> () #

Hashable CompactProduct Source # 
Instance details

Defined in Dep.Data.Product

EvaluateItem CompactProduct Source # 
Instance details

Defined in Dep.Data.Product

ToCompact Product CompactProduct Source # 
Instance details

Defined in Dep.Data.Product

type Rep CompactProduct Source # 
Instance details

Defined in Dep.Data.Product

type Rep CompactProduct = D1 ('MetaData "CompactProduct" "Dep.Data.Product" "dep-software-0.1.0.0-ImGw9o7wQ122cC0Rs2n7ZK" 'True) (C1 ('MetaCons "CompactProduct" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CompactProduct')))

type CompactProduct' = [Int] Source #

A more compact representation of a product where the indexes that have Zero or One are listed by the positive or negative index respectively.

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

Instances details
Eq SumOfProducts Source # 
Instance details

Defined in Dep.Data.Product

Data SumOfProducts Source # 
Instance details

Defined in Dep.Data.Product

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SumOfProducts -> c SumOfProducts #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SumOfProducts #

toConstr :: SumOfProducts -> Constr #

dataTypeOf :: SumOfProducts -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SumOfProducts) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SumOfProducts) #

gmapT :: (forall b. Data b => b -> b) -> SumOfProducts -> SumOfProducts #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SumOfProducts -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SumOfProducts -> r #

gmapQ :: (forall d. Data d => d -> u) -> SumOfProducts -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SumOfProducts -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SumOfProducts -> m SumOfProducts #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SumOfProducts -> m SumOfProducts #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SumOfProducts -> m SumOfProducts #

Ord SumOfProducts Source # 
Instance details

Defined in Dep.Data.Product

Read SumOfProducts Source # 
Instance details

Defined in Dep.Data.Product

Show SumOfProducts Source # 
Instance details

Defined in Dep.Data.Product

Generic SumOfProducts Source # 
Instance details

Defined in Dep.Data.Product

Associated Types

type Rep SumOfProducts :: Type -> Type #

Semigroup SumOfProducts Source # 
Instance details

Defined in Dep.Data.Product

Monoid SumOfProducts Source # 
Instance details

Defined in Dep.Data.Product

Arbitrary SumOfProducts Source # 
Instance details

Defined in Dep.Data.Product

Binary SumOfProducts Source # 
Instance details

Defined in Dep.Data.Product

NFData SumOfProducts Source # 
Instance details

Defined in Dep.Data.Product

Methods

rnf :: SumOfProducts -> () #

Hashable SumOfProducts Source # 
Instance details

Defined in Dep.Data.Product

EvaluateItem SumOfProducts Source # 
Instance details

Defined in Dep.Data.Product

type Rep SumOfProducts Source # 
Instance details

Defined in Dep.Data.Product

type Rep SumOfProducts = D1 ('MetaData "SumOfProducts" "Dep.Data.Product" "dep-software-0.1.0.0-ImGw9o7wQ122cC0Rs2n7ZK" 'True) (C1 ('MetaCons "SumOfProducts" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Product])))

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

showSumOfProducts Source #

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.

-> Text

The corresponding Text object that presents the given SumOfProducts'.

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₂"

showProduct Source #

Arguments

:: Char

The name of the root variable that will be used with subscripts.

-> Product'

The given product to convert to a Text.

-> Text

The corresponding Text object that presents the given Product'.

Print a given product as a sequence of variables that can be negated. for example:

>>> showProduct 'x' [One, DontCare, Zero, One]
"x₀x₂'x₃"

showProduct' Source #

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.

-> Text

The corresponding Text object that presents the given Product'.

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₃"

subscriptVariable Source #

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.