I have this data on my Module Formula :
data Formula = Formula {
typeFormula :: String,
nbClauses :: Int,
nbVars :: Int,
clauses
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 Forumla, 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