00:00:00 --- log: started haskell/02.02.24 02:26:41 --- join: shapr (~user@p-c2fbab65.easy.inet.fi) joined #haskell 04:21:40 --- join: ChoJin (~ask@cha213245038031.chello.fr) joined #haskell 05:21:51 --- join: phraedun (~fractal@CPE-203-45-154-118.qld.bigpond.net.au) joined #haskell 05:36:41 --- quit: phraedun ("Client Exiting") 06:12:53 --- quit: Yurik ("Client Exiting") 07:34:24 --- join: kepler (~kepler@user-vcaugb0.dsl.mindspring.com) joined #haskell 10:56:10 --- join: Yurik (~yrashk@gw.telcos.net.ua) joined #haskell 11:00:23 --- join: jcore (~jcore@ca-glendora1b-202.stmnca.adelphia.net) joined #haskell 11:02:05 hi, I'm new to haskell and having trouble understanding some error messages... 11:02:16 ERROR "shape":30 - Type error in application 11:02:16 *** Expression : s / (2 * sin o) 11:02:29 *** Term : s 11:02:29 *** Type : Float 11:02:35 *** Does not match : Int 11:02:46 points c = let o = 360 / n 11:02:46 r = s / (2 * sin o) 11:03:10 that's my code...I'm not sure if there error is there or somewhere else 11:03:23 s/there/the/ 11:04:08 n is from regPolygon n s = Polygon points n 11:04:27 whose type signature is regPolygon :: Int -> Side -> Shape 11:04:45 (this is from the Haskell School of Expression book, by the way) 11:22:17 i think its due to the fact sin take a float 11:28:51 so / is for integer division? 11:29:01 will 360.0 help things? 11:29:30 nope :/ 11:29:45 so you're saying that o at that point is an Int, not a Float? 11:30:09 why does it want s to be an Int? 11:30:53 and if it wanted o to be a float, why wouldn't it have just said Term : o 11:31:06 sorry to bombard you 11:33:56 maybe it would help to see the whole thing: http://arbornet.org/~jcore/shape 11:34:26 You can't do integer division with / 11:35:20 ok, so what should I use if I want to do float division? 11:35:52 / 11:36:15 I tried using `div` but I have the same problem 11:36:29 360 / n where n is an Integer isn't legal 11:36:55 You want fromIntegral somewhere 11:36:55 what about 360.0? 11:37:11 fromIntegral? I'll have to look in the report for that 11:37:11 Prelude> :t (/) 11:37:11 (/) :: Fractional a => a -> a -> a 11:37:28 hrm... 11:37:30 i.e. the two arguments of / are of the same type and that type must have a Fractional instance 11:38:15 ok, I think I understand that 11:38:32 but why would it still be complaining if I had 360.0 / n? 11:38:39 er 11:38:44 I think I see 11:38:49 Because n is an Int 11:38:53 yeh, ok 11:39:08 is there a way to treat n as a float for just that operation? 11:39:13 fromIntegral n ought to be OK though 11:39:20 ok 11:39:47 ok, that worked, but now I get another type error ;) 11:40:43 ok, three errors cleared up by that, thanks 11:42:01 awesome, it worked (wrong results, but that's my fault), thanks! 11:42:13 :-) np 11:43:31 Shape> regPolygon 5 2 11:43:31 Polygon [(-1.11767,3.77789),(2.03998,-3.37047),(-2.82868,2.74229),(3.4321,-1.9345),(-3.81072,1.0)] 11:43:41 now I just need to find out if that's correct ;) 11:45:02 wrong,...oh well, at least I can fix that later 13:09:37 --- quit: jcore ("Real IRC clients know "to" is a preposition, not an adverb") 16:54:44 --- join: graylensman (~ray@fl-wbu2c6-167.pbc.adelphia.net) joined #haskell 17:04:24 --- nick: Yurik -> Yurik[away] 17:07:41 --- nick: Yurik[away] -> Yurik 17:13:07 --- part: graylensman left #haskell 17:20:26 --- part: Yurik left #haskell 18:16:15 --- quit: ChoJin ("bye !!!") 19:09:54 --- join: comatoast (comatoast@dsl-206-55-130-49.tstonramp.com) joined #haskell 20:19:26 --- quit: xbill (Read error: 110 (Connection timed out)) 22:12:44 --- quit: comatoast ("ircII EPIC4-1.0.1 -- Are we there yet?") 22:33:19 --- quit: shapr ("time to go to work") 23:59:59 --- log: ended haskell/02.02.24