(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 - The Fusion of Science and Community**

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

# Standard ML help datatype problem

Loading...

Similar Threads - Standard help datatype | Date |
---|---|

Linear Regression, etc : Standard vs ML Techniques | Dec 27, 2017 |

Are there standard axes/orientations for Rubik's Cube game programs? | Nov 8, 2017 |

Standard Database Model for Academic Management | Nov 2, 2016 |

Standard Data Types for Web Addresses, Phone Numbers? | Mar 3, 2016 |

Standard ML - please help | Sep 26, 2011 |

**Physics Forums - The Fusion of Science and Community**