From leledumbo_cool at yahoo.co.id Wed May 14 07:30:37 2008 From: leledumbo_cool at yahoo.co.id (leledumbo) Date: Wed May 14 07:24:22 2008 Subject: [Hugs] Hugs doesn't know List Difference operator (\\) Message-ID: <17228971.post@talk.nabble.com> I'm reading some Haskell Tutorial when I arrive at List Difference operator, which is \\. But when I try on Hugs, it responded: ERROR - Undefined variable "\\" -- View this message in context: http://www.nabble.com/Hugs-doesn%27t-know-List-Difference-operator-%28%5C%5C%29-tp17228971p17228971.html Sent from the Haskell - Hugs-Bugs mailing list archive at Nabble.com. From haskell at pkturner.org Wed May 14 07:44:16 2008 From: haskell at pkturner.org (Scott Turner) Date: Wed May 14 07:37:59 2008 Subject: [Hugs] Hugs doesn't know List Difference operator (\\) In-Reply-To: <17228971.post@talk.nabble.com> References: <17228971.post@talk.nabble.com> Message-ID: <200805140744.16375.haskell@pkturner.org> On 2008 May 14 Wednesday, leledumbo wrote: > I'm reading some Haskell Tutorial when I arrive at List Difference > operator, which is \\. But when I try on Hugs, it responded: ERROR - > Undefined variable "\\" Add 'import List' to your program. Or if you're running the Hugs interpreter with no program, do Hugs> :l List From leledumbo_cool at yahoo.co.id Fri May 16 03:24:17 2008 From: leledumbo_cool at yahoo.co.id (leledumbo) Date: Fri May 16 03:17:56 2008 Subject: [Hugs] elem of infinite set of tuple Message-ID: <17268995.post@talk.nabble.com> I don't know how Haskell should behave on this. Consider this function: elemOf (x,y) = (x,y) `elem` [ (a,b) | a <- [0..], b <- [0..] ] If I try to query elemOf (1,1), the interpreter keeps searching and searching but it never makes it. But if I query elemOf (0,1) (or anything as long as the first element is 0), it can find it easily. I wonder how Hugs handles this. >From my point of view, instead of starting from (1,0), Hugs starts from (0,0), which will never finish since the limit of the second element is infinite. -- View this message in context: http://www.nabble.com/elem-of-infinite-set-of-tuple-tp17268995p17268995.html Sent from the Haskell - Hugs-Bugs mailing list archive at Nabble.com. From ndmitchell at gmail.com Fri May 16 05:46:26 2008 From: ndmitchell at gmail.com (Neil Mitchell) Date: Fri May 16 05:40:04 2008 Subject: [Hugs] elem of infinite set of tuple In-Reply-To: <17268995.post@talk.nabble.com> References: <17268995.post@talk.nabble.com> Message-ID: <404396ef0805160246ld41ef8i66d9f78111e4e753@mail.gmail.com> Hi This is not the right emailing list for this - its not a bug in Hugs, just the way Haskell works. I recommend you resend this email to haskell-cafe -AT- haskell.org - that is a more general list and people will be happy to help, plus you'll reach a much bigger audience. Alternatively, hop on to IRC: http://www.haskell.org/haskellwiki/IRC_channel There people will be happy to answer your questions in real time :) Thanks Neil > I don't know how Haskell should behave on this. Consider this function: > elemOf (x,y) = (x,y) `elem` [ (a,b) | a <- [0..], b <- [0..] ] > > If I try to query elemOf (1,1), the interpreter keeps searching and > searching but it never makes it. But if I query elemOf (0,1) (or anything as > long as the first element is 0), it can find it easily. I wonder how Hugs > handles this. > > >From my point of view, instead of starting from (1,0), Hugs starts from > (0,0), which will never finish since the limit of the second element is > infinite. > > -- > View this message in context: http://www.nabble.com/elem-of-infinite-set-of-tuple-tp17268995p17268995.html > Sent from the Haskell - Hugs-Bugs mailing list archive at Nabble.com. > > _______________________________________________ > Hugs-Bugs mailing list > Hugs-Bugs@haskell.org > http://www.haskell.org/mailman/listinfo/hugs-bugs >