Advertisement
JoelSjogren

Untitled

Feb 11th, 2021
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. minimal.hs:12:16-71: error: …
  2. • Occurs check: cannot construct the infinite type: a ~ Set a
  3. Expected type: Set a
  4. Actual type: Set (Set a)
  5. • In the expression:
  6. iterate' f null (empty, (close cp empty) :: Set (Set a))
  7. In an equation for ‘enumerate’:
  8. enumerate cp
  9. = iterate' f null (empty, (close cp empty) :: Set (Set a))
  10. where
  11. f (old, new)
  12. = (union old new, fromList fresh)
  13. where
  14. fresh = ...
  15. • Relevant bindings include
  16. f :: (Set (Set a), Set (Set a)) -> (Set (Set a), Set (Set a))
  17. (bound at /home/joel/Desktop/counting/minimal.hs:14:5)
  18. cp :: CombinatorialProblem a
  19. (bound at /home/joel/Desktop/counting/minimal.hs:12:11)
  20. enumerate :: CombinatorialProblem a -> Set a
  21. (bound at /home/joel/Desktop/counting/minimal.hs:12:1)
  22. |
  23. minimal.hs:12:41-54: error: …
  24. • Couldn't match type ‘a’ with ‘Set a1’
  25. ‘a’ is a rigid type variable bound by
  26. the type signature for:
  27. enumerate :: forall a. CombinatorialProblem a -> Set a
  28. at /home/joel/Desktop/counting/minimal.hs:11:1-44
  29. Expected type: Set (Set a1)
  30. Actual type: Set a
  31. • In the expression: (close cp empty) :: Set (Set a)
  32. In the third argument of ‘iterate'’, namely
  33. ‘(empty, (close cp empty) :: Set (Set a))’
  34. In the expression:
  35. iterate' f null (empty, (close cp empty) :: Set (Set a))
  36. • Relevant bindings include
  37. f :: (Set (Set a), Set (Set a)) -> (Set (Set a), Set (Set a))
  38. (bound at /home/joel/Desktop/counting/minimal.hs:14:5)
  39. cp :: CombinatorialProblem a
  40. (bound at /home/joel/Desktop/counting/minimal.hs:12:11)
  41. enumerate :: CombinatorialProblem a -> Set a
  42. (bound at /home/joel/Desktop/counting/minimal.hs:12:1)
  43. |
  44. Compilation failed.
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement