Monday 15 June 2015

SML Compund Function -


I am trying to write a function, compound, which will return the function f which moves with variable n x times . It's strange to understand, here's an example

funny = n + 1x = 2n = 2f (f (n + 1)) will return

this is my Code is:

  Musical compound NFX = 0's xx => F n | X = & gt; F (mixed nf (x -1));  

Although I get a type of test error,

I get a type of error int -> ('a -> a) -> int -> Int type int -> (a '-> a') -> 'a -> a

I am very new to SML and I do not know what I am doing.


No comments:

Post a Comment