0

So i have a function that i'm trying to write:

fn (x:'a) => ???
(type: 'a -> int)

I've tried doing this:

fn (x:'a) => (x:int)

But obviously that returns a match constraint error. So is there any way I could go about doing this?

=== EDIT ===

Is there any way of 'reversing' the function? By this i mean having a function of type:

int -> 'a
madcrazydrumma
  • 1,847
  • 3
  • 20
  • 38

0 Answers0