links icon indicating copy to clipboard operation
links copied to clipboard

Confusing Names

Open dhil opened this issue 5 years ago • 1 comments

links> sig ++ : (Int, Int) -> Int op x ++ y { x + y };
links> (++);
fun : (Int, Int) -> Int
links> [] ++ [];
[] : [_]
links> (++)(2, 2);
4 : Int
links> 2 ++ 2;
<stdin>:1: Type error: The infix operator
    `++'
has type
    `([a], [a]) -b-> [a]'
while the arguments passed to it have types
    `Int'
and
    `Int'
and the currently allowed effects are
    `wild'
In expression: 2 ++ 2.

I hope you enjoyed this piece of poetry. I wish you a good weekend.

dhil avatar Nov 29 '19 18:11 dhil

Here is another variation

links> op x > y { "test" };
> = fun : (_, _) -> String
links> 2 > 2;
***: Internal Error in instantiate.ml (Please report as a bug): Kind mismatch in type application: (_, _) -> String applied to type arguments: Int, { |wild }

dhil avatar Oct 06 '20 22:10 dhil