(adsbygoogle = window.adsbygoogle || []).push({}); Standard ML help!! datatype problem

I have to create a function about peano numbers defined as the following datatype:

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

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!!

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Standard ML help datatype problem

**Physics Forums | Science Articles, Homework Help, Discussion**