dimanche 8 juillet 2018

How to use IO Double as regular Double in Haskell

I have to following code

isInCircle::Double->Double->Bool
isInCircle p1 p2 = sqrt((p1*p1)+(p2*p2)) <= 1

and when I make a call like isInCircle (random :: Double) (random :: Double) I get this error * Couldn't match expected type Double' with actual typeg0 -> (a0, g0)' If I change the argument of isInCircle function to IO Double I get errors with sqrt and addition... Can you help me?




Aucun commentaire:

Enregistrer un commentaire