Open antoyo opened 6 years ago
Thanks, there’s nothing wrong with the code, it’s just a mismatch between the book and the implementation. I’ve removed that stray print
. That error message is caused by a bug in the typechecker which has been fixed in the upcoming version.
String concatenation with +
doesn’t work because the current version is missing support for generic instances. You can use the cat
function instead, and for now (32fa225eb7fd3e94a7dc3a67575c44a73499a3bf) I’ve added this as a workaround:
instance + (List<Char>, List<Char> -> List<Char>):
cat
Ideally it should be this for any type T
, but the compiler will fail to instantiate it:
instance + <T> (List<T>, List<T> -> List<T>):
cat
This will also be fixed in the next version.
Hi. I tried the example from this page and the call to
say
does not work. Here's the result:You need to remove the
print
on the first line. (And, to be quite honest, the error message is very confusing, so it would be good to improve it as well.)Also, string concatenation with
+
does not seem to work. The following code:gives me the following error:
Is there anything wrong in this code?
Thanks.