I have this data on my Module Formula :
data Formula = Formula {
typeFormula :: String,
nbClauses :: Int,
nbVars :: Int,
clauses :: Clauses
}
And I want to export it but I don't know the right syntax :
module Formula (
Formula ( Formula ),
solve
) where
Someone can tell me the right syntax please ?
Some of your confusion is coming from having the same module name as the constructor you're trying to export.
module Formula (
Formula ( Formula ),
solve
) where
Should be
module Formula (
Formula (..),
solve
) where
Or
module Formula (
module Formula ( Formula (..)),
solve
) where
Your current export statement says, in the Module Formula, export the Type Formula
defined in the Module Formula and the function solve (that is in scope for the module, wherever it is defined))
The (..)
syntax means, export all constructors for the preceding type. In your case, it is equivalent to the explicit
module Formula (
Formula (typeFormula,nbClauses, nbVars,clauses),
solve
) where
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With