From ferronrsmith at gmail.com Mon Oct 8 11:30:29 2007 From: ferronrsmith at gmail.com (ferronrsmith) Date: Mon Oct 8 11:29:05 2007 Subject: [Hugs-users] Graphics Library for Hugs Message-ID: <13098425.post@talk.nabble.com> I want to create some GUI in hugs (I know GHC works) for class, but I just can't seem to find any for hugs help??? is there any available ??? -- View this message in context: http://www.nabble.com/Graphics-Library-for-Hugs-tf4588765.html#a13098425 Sent from the Haskell - Hugs-Users mailing list archive at Nabble.com. From urmastaag at hotmail.com Wed Oct 24 16:37:42 2007 From: urmastaag at hotmail.com (Urmastaag) Date: Wed Oct 24 16:35:27 2007 Subject: [Hugs-users] School assignment help Message-ID: <13388655.post@talk.nabble.com> Hello! Can anybody point me to a right way here? I have those exercises in haskell that i cannot do, because haskell is so much different from other languages that i use. I have read so much from different manuals but i do not understand haskell enough yet. First exercise: I must find a shorter list. Here's how i did that, but my teacher said that it is unefficient way to do it. getShorter :: [a] -> [a] -> [a] getShorter xs ys | length xs <= length ys = xs | otherwise = ys How do i do it effective, so that i only check as many elements from lists as many are in the shortest list? Second exercise: Second exercise also need an effective answer: I have to remove any occurances of certain number from list and give the number of how many times that number was removed. Unefficient version: remCount :: Int -> [Int] -> (Int,[Int]) remCount n xs = (length xs - length ys, ys) where ys = [ x | x <- xs, x /= n] Exercise three: moneyBack :: Int -> [(Int,Int)] I must print out all pairs of bank notes and (bank notes, how many) which salesman would give me back when he/she has to give me like 456 back. moneyBack 0 ==> [] moneyBack 10 ==> [(10,1)] moneyBack 123 ==> [(100,1),(10,2),(2,1),(1,1)] moneyBack 5326 ==> [(500,10),(100,3),(25,1),(1,1)] If anybody could point me in a right direction that would be great. Haskell seems very cool because the code is usually really short, but i just need a start. I need more examples than i can find from google (maybe i'm not using the right keywords). Thanks. -- View this message in context: http://www.nabble.com/School-assignment-help-tf4685176.html#a13388655 Sent from the Haskell - Hugs-Users mailing list archive at Nabble.com. From ndmitchell at gmail.com Wed Oct 24 16:47:25 2007 From: ndmitchell at gmail.com (Neil Mitchell) Date: Wed Oct 24 16:45:12 2007 Subject: [Hugs-users] School assignment help In-Reply-To: <13388655.post@talk.nabble.com> References: <13388655.post@talk.nabble.com> Message-ID: <404396ef0710241347w247e8d48y69af1758a2302030@mail.gmail.com> Hi This is the place for questions specifically about the Hugs system - for general Haskell help you will get a much larger audience on haskell-cafe -AT- haskell.org - I suggest reposting this email to there. There is a page about how to ask for homework help on the Haskell wiki: http://haskell.org/haskellwiki/Homework_help Thanks Neil On 10/24/07, Urmastaag wrote: > > Hello! > > Can anybody point me to a right way here? > I have those exercises in haskell that i cannot do, because haskell is so > much different from other languages that i use. I have read so much from > different manuals but i do not understand haskell enough yet. > > First exercise: > > I must find a shorter list. > Here's how i did that, but my teacher said that it is unefficient way to do > it. > > getShorter :: [a] -> [a] -> [a] > getShorter xs ys | length xs <= length ys = xs > | otherwise = ys > > How do i do it effective, so that i only check as many elements from lists > as many are in the shortest list? > > Second exercise: > > Second exercise also need an effective answer: > > I have to remove any occurances of certain number from list and give the > number of how many times that number was removed. > > Unefficient version: > remCount :: Int -> [Int] -> (Int,[Int]) > remCount n xs = (length xs - length ys, ys) > where ys = [ x | x <- xs, x /= n] > > > > Exercise three: > > moneyBack :: Int -> [(Int,Int)] > > I must print out all pairs of bank notes and (bank notes, how many) which > salesman would give me back when he/she has to give me like 456 back. > > moneyBack 0 ==> [] > moneyBack 10 ==> [(10,1)] > moneyBack 123 ==> [(100,1),(10,2),(2,1),(1,1)] > moneyBack 5326 ==> [(500,10),(100,3),(25,1),(1,1)] > > If anybody could point me in a right direction that would be great. > Haskell seems very cool because the code is usually really short, but i just > need a start. I need more examples than i can find from google (maybe i'm > not using the right keywords). > > Thanks. > > -- > View this message in context: http://www.nabble.com/School-assignment-help-tf4685176.html#a13388655 > Sent from the Haskell - Hugs-Users mailing list archive at Nabble.com. > > _______________________________________________ > Hugs-Users mailing list > Hugs-Users@haskell.org > http://www.haskell.org/mailman/listinfo/hugs-users > From naur at post11.tele.dk Fri Oct 26 16:43:36 2007 From: naur at post11.tele.dk (Thorkil Naur) Date: Fri Oct 26 16:44:06 2007 Subject: [Hugs-users] A few comments on WinHugs-sep2006.exe Message-ID: <200710262243.40540.naur@post11.tele.dk> Hello, As an enthusiastic Hugs user, I recently installed Hugs using WinHugs-Sep2006.exe and noted the following: 1. When running hugs.exe from an ordinary DOS prompt, activating the editor (Notepad) using :e returns control immediately to the Hugs prompt, in addition to starting the Notepad. So, although I am able to edit the desired (Haskell) source file, I need to do a :r after saving, to make Hugs aware of the changes. This is certainly different from what I have experienced with earlier Hugs'es where :e did not return until edits were completed, enabling Hugs to respond to the most recent edits immediately. 2. Running hugs.exe from a DOS prompt reports the version as 20051031 whereas activating WinHugs reports Version Sep 2006. 3. In the WinHugs menu, the menu item Help has it's "l" underscored. Nevertheless, Alt-h is what is required to activate the help menu. I will gladly enter Hugs trac issues for these items if convenient. Thanks and best regards Thorkil