I have a line of code where I'm trying to assign a variable (I know haskell doesn't really have variables, but I'm not sure what else to call it) with the minimum element found by using the minimumBy builtin, but I get the following error:
Illegal type signature: `(x', y', z')'
Type signatures are only allowed in patterns with ScopedTypeVariables
|
| ed1 :: (x', y', z') = minimumBy (comparing (\(_, _, z) -> z)) e
Here is the code.
alg' pr pq nE (G c d) = alg' (ve1 : pr) (ed1 : pq) (nE - 1) (G c d)
where
e = -- helper function that compiles, but with a wrong value so I omitted it.
ed1 :: (x', y', z') = minimumBy (comparing (\(_, _, z) -> z)) e
Thank you very much.