[Haskell-cafe] Any interested authors?
Dave Thomas (from The Pragmatic Programmers, not from Wendy's :)) has announced an Erlang book (http://www.pragmaticprogrammer.com/titles/jaerlang/) in the Ruby mailing list. A few responses showed an interest in a similar book for Haskell. You can see the thread here: http://tinyurl.com/2ecpsn. Dave answered such requests by saying: "I'd love to do one. It's a question of finding the right author.". If you think this would be up your alley, perhaps you could contact Dave in regards to this matter. Just a heads up, from a potential reader. :) Regards, Antonio -- http://antoniocangiano.com Zen and the Art of Ruby Programming ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Hi can u explain me how drop works in Haskell
On 2/26/07, Thomas Hartman <[EMAIL PROTECTED]> wrote: Here's my, probably very obvious, contribution. What I'd like feedback on is 1) code seem ok? (hope so!) Hi Thomas, tail [] raises an error, therefore your code will fail when n > length xs ( e.g. mydrop 3 [1,2] will raise an exception, where [] is the expected result). Your function is also limited to list of Int only (mydrop :: Int -> [Int] -> [Int]). 2) What do you think of the tests I did to verify that this behaves the way I want? Is there a better / more idiomatic way to do this? You may be interested in the following projects: QuickCheck: http://www.cs.chalmers.se/~rjmh/QuickCheck/ HUnit: http://sourceforge.net/projects/hunit Regards, Antonio -- http://antoniocangiano.com Zen and the Art of Ruby Programming ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Hi can u explain me how drop works in Haskell
On 2/25/07, iliali16 <[EMAIL PROTECTED]> wrote: Hi I am trying to implement the function drop in haskell the thing is that I I have been trying for some time and I came up with this code where I am trying to do recursion: drop :: Integer -> [Integer] -> [Integer] drop 0 (x:xs) = (x:xs) drop n (x:xs) |n < lList (x:xs) = dropN (n-1) xs : |otherwise = [] drop :: Integer -> [a] -> [a] drop n xs | n < 1 = xs drop _ [] = [] drop n (_:xs) = drop (n-1) xs Line 1: It specifies that drop will accept an Integer and a list, and return a list; Line 2: If n < 1, the function will return the list as it is (this pattern is matched if you're dropping 0 or -2 elements, for example); Line 3: No matter what Integer has been passed to the function, if the list passed is empty, an empty list will be returned as well; Line 4: Dropping n elements from a list is equivalent to dropping n-1 elements from the tail (xs) of that same list. HTH Antonio -- http://antoniocangiano.com Zen and the Art of Ruby Programming ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Compiling To C And Why Not Compiling To Java Or C#?
On 8/5/06, Piotr Kalinowski <[EMAIL PROTECTED]> wrote:> Yes, yes. I'm simply not sure if making changes only to reach more and> more people is good.These changes are good as long as they possibly add something valuable beside popularity and they don't introduce significant downsides. My point was that the act of striving to increase the popularity of one's favourite language, it is neither a negative nor an unnatural pursuit. I agree though that it should be done intelligently and with a broader aim in mind. > I'm afraid I don't understand what you mean. Would you care to elaborate on it?Sure. I meant that among small communities some individuals feel "special" for being part of these elite groups. It's a way to feel different, better, or something along these lines. Therefore they are afraid of any attempt to considerably increase the popularity of their group, because in their minds they would loose their special status (they can't brag they're Haskell hackers if the rest of the world programs in Haskell as well). Regards,Antonio-- My Ruby blog: http://antoniocangiano.comMy Italian community: http://www.visualcsharp.it ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Compiling To C And Why Not Compiling To Java Or C#?
On 8/5/06, Piotr Kalinowski wrote: On 05/08/06, Kaveh Shahbazian <[EMAIL PROTECTED]> wrote:> But there must be a way to populize Haskell!What for?Because we are humans and as such, we generally love to share our passions with other people. From a less sociological standpoint, a larger user base implies faster development of interesting projects, more libraries, books, user groups, conferences, etc...On the other hand, individuals that need to belong to an elite, and the RTFM crowd, will experience a further frustration to feed their insecure personality. Regards,Antonio Cangiano-- My Ruby blog: http://antoniocangiano.comMy Italian community: http://www.visualcsharp.it ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe