Version française
Home     About     Download     Resources     Contact us    
Browse thread
Some questions about type inference
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Max Skaller <skaller@o...>
Subject: Re: Some questions about type inference
Benedikt Rosenau wrote:
> Another piece de resistence for my understanding is the following:
>   match []::[] with a::b -> a = [] & b = []

	What does the '&' mean? Do you mean '@' ??
Assuming [] @ b, then this is a 'x list for some 'x,
and thus can be compared with [] which has type 'y list
for some 'y, and we can set 'x = 'y.

> works, while

>   match []::[] with a::b -> a = b
> gives a type error.

That one is easy: the type of a is 'x list, and that of b is 'x list
list.
You cannot compare a 'x list with a 'x list list.

-- 
John (Max) Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper http://Vyper.sourceforge.net
download Interscript http://Interscript.sourceforge.net