<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<div class="moz-cite-prefix">Den 2017-11-26 kl. 20:48, skrev Quentin
Liu:<br>
</div>
<blockquote type="cite"
cite="mid:883dc5c3-2c67-4c9c-a71a-cab090337426@Spark">
<title></title>
<div name="messageBodySection" style="font-size: 14px;
font-family: -apple-system, BlinkMacSystemFont, sans-serif;">
<blockquote type="cite" style="margin: 5px 5px; padding-left:
10px; border-left: thin solid #1abc9c;">```<br>
exercises.hs:33:13:<br>
Couldn't match expected type ‘[b0]’ with actual type ‘a’<br>
‘a’ is a rigid type variable bound by<br>
the type signature for myOrderFunc :: a -> a
-> Ordering<br>
at exercises.hs:31:16<br>
Relevant bindings include<br>
y :: a (bound at exercises.hs:32:15)<br>
x :: a (bound at exercises.hs:32:13)<br>
myOrderFunc :: a -> a -> Ordering (bound at
exercises.hs:32:1)<br>
In the first argument of ‘myLen’, namely ‘x’<br>
In the first argument of ‘(<)’, namely ‘myLen x’<br>
Failed, modules loaded: none.<br>
```</blockquote>
</div>
<div name="messageSignatureSection"><br>
<div class="matchFont">Your guess is correct. The problem is,
Haskell does not consider `a` in `myOrderFunc` and `[b]` in
`myLen` equivalent. `a` means you feed the function any type,
while `[b]` means it must be a list of values of the same
type. So changing `a` to `[a]` woud eliminate the error. <br>
</div>
</div>
</blockquote>
Thanks a lot for the clarification.<br>
<br>
// Patrik<br>
</body>
</html>