duke
2012-07-02 14:01:20 UTC
I'm working on understanding polymorphic functions, etc
Using the examples:
myfst (x,y) = x
g (x,y) = (-y,x)
I can see why myfst :: returns (*,**)-> *
However, I'm a little shaky with why g :: returns (*,num)->(num,*)
Is num in there, instead of the polytype **, because of the - operator is forcing that type on y?
Using the examples:
myfst (x,y) = x
g (x,y) = (-y,x)
I can see why myfst :: returns (*,**)-> *
However, I'm a little shaky with why g :: returns (*,num)->(num,*)
Is num in there, instead of the polytype **, because of the - operator is forcing that type on y?