
3 Oct
2006
3 Oct
'06
3:26 p.m.
Hello Edward, Tuesday, October 3, 2006, 9:44:27 PM, you wrote:
Couldn't match `Side' against `Int' In the first argument of `sin', namely `angle'
The source is below. Side is types as Float. My assumption was that Haskell would know how to convert the Int to a float and all would be well. I am I mistaken somewhere? The problem is with the last line.
yes, Haskell don't make automatic conversions because together with bi-directional type inferring it will make a headache.
let angle = 1.0 * (360 / totalSides) * currentSide in
as Garret said, you should make conversions explicitly, hopefully the 'fromIntegral' function is enough in most cases -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com