Standard ML
Posts  1 - 1  of  1
Jimena
I have to create a function about peano numbers defined as the following datatype:

datatype 'a peano = P of ('a -> 'a) * 'a -> 'a

val zero = P(fn (f, x) => x)


The function that i have to implement finds the succesive peano number of the peano parameter P(p).
This is what I have written:

fun suc (P(p)) = case P(p) of P(fn(f,x)=>x) => P(fn(f,x)=>f(x));

The problem is that i get these errors:
stdIn:4.33-4.36 Error: syntax error: deleting FN LPAREN
stdIn:4.43 Error: syntax error found at RPAREN

I don't know what Im doing wrong please help!!
Save
Cancel
Reply
 
x
OK