Re: [Haskell-cafe] Solution to Thompson's Exercise 4.4

2005-03-12 Thread Sean Perry
Andy Georges wrote: Hi Kaoru, I have been working through the exercises in Thompson's The Craft of Functional Programming 2nd Ed book. I am looking for a solution web site for Thompson's book. Or maybe the people here can help. In exercise 4.4, I am asked to define a function howManyOfFourEqual

Re: [Haskell-cafe] Solution to Thompson's Exercise 4.4

2005-03-12 Thread Gour
Kaoru Hosokawa ([EMAIL PROTECTED]) wrote: I hope to find a better solution. I googled but couldn't find the answer. Here is what I have. I do not have working Haskell interpreter at the moment (being on amd64), but this is what I have in my archive: weakAscendingOrder :: Int - Int - Int -

Re: [Haskell-cafe] Solution to Thompson's Exercise 4.4

2005-03-12 Thread Mark Carroll
I had a go with things along this theme and came up with a couple of options, with different type signatures. I use some functions from the Data.List library. If we know that, as with Ints, we are dealing with list members that are instances of Ord, we can do: howManyEqual :: (Eq a, Ord a) = [a]

Re: [Haskell-cafe] Solution to Thompson's Exercise 4.4

2005-03-12 Thread Andy Georges
Hi all, when this example occurs in the text the new Haskell coder has not been introduced to most of what you suggest. I didn't realise that. All apologies. mvg, Andy ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Solution to Thompson's Exercise 4.4

2005-03-11 Thread Kaoru Hosokawa
I have been working through the exercises in Thompson's The Craft of Functional Programming 2nd Ed book. I am looking for a solution web site for Thompson's book. Or maybe the people here can help. In exercise 4.4, I am asked to define a function howManyOfFourEqual :: Int - Int - Int -

Re: [Haskell-cafe] Solution to Thompson's Exercise 4.4

2005-03-11 Thread Andy Georges
Hi Kaoru, I have been working through the exercises in Thompson's The Craft of Functional Programming 2nd Ed book. I am looking for a solution web site for Thompson's book. Or maybe the people here can help. In exercise 4.4, I am asked to define a function howManyOfFourEqual :: Int - Int