Chris Reade escreveu:
> John
>
> In the "EFP" book a small circle is used for composition with an
> explanation that this is written as a lower case o in ML (not a dot).
> Also the definition in the book is not as you have written it. It
> should be:
>
> fun f1 (x,y,z) = (x,y,1)
> fun f2 (x,y,z) = (x,y,z * x)
> fun f3 (x, y,z) = (x + 1, y, z)
> val body = f3 o f2
>
> Chris Reade
>
Hi --
Upon evaluating this, an error crops up. I have no idea as to what it
means.
- fun f1 (x,y,z) = (x,y,1);
val f1 = fn : 'a * 'b * 'c -> 'a * 'b * int
- fun f2 (x,y,z) = (x,y,z*x);
val f2 = fn : int * 'a * int -> int * 'a * int
- fun f3 (x,y,z) = (x + 1, y, z);
val f3 = fn : int * 'a * 'b -> int * 'a * 'b
- val body = f3 o f2;
stdIn:5.5-5.19 Warning: type vars not generalized because of
value restriction are instantiated to dummy types (X1,X2,...)
val body = fn : int * ?.X1 * int -> int * ?.X1 * int
This must have something to do with the newer SML 97 standard.
Any help is appreciated.
JT.


|