minimal.hs:12:16-71: error: …
• Occurs check: cannot construct the infinite type: a ~ Set a
Expected type: Set a
Actual type: Set (Set a)
• In the expression:
iterate' f null (empty, (close cp empty) :: Set (Set a))
In an equation for ‘enumerate’:
enumerate cp
= iterate' f null (empty, (close cp empty) :: Set (Set a))
where
f (old, new)
= (union old new, fromList fresh)
where
fresh = ...
• Relevant bindings include
f :: (Set (Set a), Set (Set a)) -> (Set (Set a), Set (Set a))
(bound at /home/joel/Desktop/counting/minimal.hs:14:5)
cp :: CombinatorialProblem a
(bound at /home/joel/Desktop/counting/minimal.hs:12:11)
enumerate :: CombinatorialProblem a -> Set a
(bound at /home/joel/Desktop/counting/minimal.hs:12:1)
|
minimal.hs:12:41-54: error: …
• Couldn't match type ‘a’ with ‘Set a1’
‘a’ is a rigid type variable bound by
the type signature for:
enumerate :: forall a. CombinatorialProblem a -> Set a
at /home/joel/Desktop/counting/minimal.hs:11:1-44
Expected type: Set (Set a1)
Actual type: Set a
• In the expression: (close cp empty) :: Set (Set a)
In the third argument of ‘iterate'’, namely
‘(empty, (close cp empty) :: Set (Set a))’
In the expression:
iterate' f null (empty, (close cp empty) :: Set (Set a))
• Relevant bindings include
f :: (Set (Set a), Set (Set a)) -> (Set (Set a), Set (Set a))
(bound at /home/joel/Desktop/counting/minimal.hs:14:5)
cp :: CombinatorialProblem a
(bound at /home/joel/Desktop/counting/minimal.hs:12:11)
enumerate :: CombinatorialProblem a -> Set a
(bound at /home/joel/Desktop/counting/minimal.hs:12:1)
|
Compilation failed.
Comments
0 B
|👍
/👎