JoelSjogren icon

Untitled

JoelSjogren | PRO | 02/11/21 08:01:44 PM UTC | 0 ⭐ | 570 👁️ | Never ⏰ | []
text |

1.96 KB

|

None

|

0 👍

/

0 👎

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

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎