[Haskell-beginners] How would you write...

John M. Dlugosz ngnr63q02 at sneakemail.com
Tue Apr 22 08:37:20 UTC 2014


On 4/22/2014 3:17 AM, Norbert Melzer wrote:
> What Is the the type of your pappus function?

I've not specified a type sig, so it figures out some particular subdomain of numeric 
types.  Whatever that is, it takes two numbers and returns a tuple of three floating-point 
numbers


pappus r n = (x-0.5,y,rn)
  where
     blah= n**2*(1-r)**2+r
     x = (r*(1+r)) / (2*blah)
     y = (n*r*(1-r)) / blah
     rn = ((1-r)*r)/(2*blah)






More information about the Beginners mailing list