I have the following helper method
distance :: Segment -> Length
distance ((ax, ay), (bx, by)) = sqrt ((bx-ax)^2 + (by-ay)^2)
And I get the warning
polycake.hs:115:46: Warning:
Defaulting the following constraint(s) to type ‘Integer’
(Integral b0) arising from a use of ‘^’ at polycake.hs:115:46
(Num b0) arising from the literal ‘2’ at polycake.hs:115:47
In the first argument of ‘(+)’, namely ‘(bx - ax) ^ 2’
In the first argument of ‘sqrt’, namely
‘((bx - ax) ^ 2 + (by - ay) ^ 2)’
In the expression: sqrt ((bx - ax) ^ 2 + (by - ay) ^ 2)
I can't suppress the warning either, looking for a way to explicitly cast it to a type.
Annotate each 2
, as in
(bx-ax)^(2 :: Integer)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With