Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-10-14 Thread Bartosz Milewski
I'm afraid this kind of 5-minute talk makes sense only if you already know a lot about monads or are a computer scientist; not if you're a programmer who wants to learn a new language. For instance, this statement starts making sense only if you've seen a lot of examples of monads (maybe even

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-10-14 Thread Kristopher Micinski
On Sun, Oct 14, 2012 at 1:37 PM, Bartosz Milewski bart...@fpcomplete.com wrote: I'm afraid this kind of 5-minute talk makes sense only if you already know a lot about monads or are a computer scientist; not if you're a programmer who wants to learn a new language. For instance, this statement

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-10-13 Thread Benjamin L. Russell
I found some useful reference code on the Haskell Wiki and constructed my own memoized Fibonacci function using the MemoTrie library, which, fortunately, is builtin with Haskell Platform and therefore does not require the tutorial reader to install additional code. The new version of the

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-10-13 Thread KC
The latest Haskell Platform is 2012.2.0.0 You are apparently running a much older version. #!c:/Program Files/Haskell Platform/2010.2.0.0/bin/ runhaskell -- -- Regards, KC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-10-13 Thread Rustom Mody
On Sun, Sep 16, 2012 at 8:18 PM, Tillmann Rendel ren...@informatik.uni-marburg.de wrote: Hi, Kristopher Micinski wrote: Everyone in the Haskell cafe probably has a secret dream to give the best five minute monad talk. (1) Most programming languages support side effects. There are

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-16 Thread Tillmann Rendel
Hi, Kristopher Micinski wrote: Everyone in the Haskell cafe probably has a secret dream to give the best five minute monad talk. (1) Most programming languages support side effects. There are different kinds of side effects such as accessing mutable variables, reading files, running in

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-16 Thread Conal Elliott
Hi Tillmann. Wow. Lovely and spot on! And I almost never hear monad explanations without wincing. Thanks for sharing. -- Conal On Sun, Sep 16, 2012 at 7:48 AM, Tillmann Rendel ren...@informatik.uni-marburg.de wrote: Hi, Kristopher Micinski wrote: Everyone in the Haskell cafe probably has

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-16 Thread Kristopher Micinski
Agreed. Great. I still contend that it would be cool to get this to be a real thing at something like the Haskell workshop, I think hearing the different perspectives would be an interesting insight into the many different ways to explain monads. But I suppose the way to start would be to put

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-16 Thread Kristopher Micinski
Agreed. Great. I still contend that it would be cool to get this to be a real thing at something like the Haskell workshop, I think hearing the different perspectives would be an interesting insight into the many different ways to explain monads. But I suppose the way to start would be to put

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-16 Thread MigMit
Mind if I join you in praising this? On Sep 17, 2012, at 12:06 AM, Kristopher Micinski krismicin...@gmail.com wrote: Agreed. Great. I still contend that it would be cool to get this to be a real thing at something like the Haskell workshop, I think hearing the different perspectives would

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-15 Thread Taylor Hedberg
Joel Burget, Fri 2012-09-14 @ 19:08:29-0700: I find the Monad instance for Maybe and Either very useful. You can do things like the following (which technically only uses the Applicative instance): Prelude Control.Applicative (*3) $ (+2) $ Just 1 Just 9 Prelude Control.Applicative (*3) $

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-15 Thread Kristopher Micinski
On Fri, Sep 14, 2012 at 10:13 PM, Andrew Pennebaker andrew.penneba...@gmail.com wrote: Challenge: get someone to have a competition at one of the conferences where students all give their best five minute monad talk and try to find the most comprehensible one! Challenge accepted. Great!

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-15 Thread Kristopher Micinski
On Fri, Sep 14, 2012 at 10:08 PM, Joel Burget joelbur...@gmail.com wrote: [snip] Also, Maybe and Either are not implemented as monads. They are defined using `data` like you suggest: data Maybe a = Nothing | Just a data Either a b = Left a | Right b That's not my point, or my objection.

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-15 Thread Joel Burget
Kris, Sorry for the confusion, I wasn't directly addressing your post. I was trying to correct what I perceived as a misconception in the last paragraph of Andrew's message, beginning with Given that…. - Joel On Saturday, September 15, 2012 at 10:24 AM, Kristopher Micinski wrote: On Fri,

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-15 Thread Conal Elliott
On Fri, Sep 14, 2012 at 2:18 PM, Andrew Pennebaker wrote: A summary of the changes I've included so far: [...] Another comment: As a declarative language, Haskell manipulates expressions, eventually reducing expressions to values. Huh? In what sense do declarative languages manipulate

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-15 Thread Alexander Solla
On Fri, Sep 14, 2012 at 7:13 PM, Andrew Pennebaker andrew.penneba...@gmail.com wrote: Challenge: get someone to have a competition at one of the conferences where students all give their best five minute monad talk and try to find the most comprehensible one! Challenge accepted

[Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Andrew Pennebaker
I've gotten mixed feedback from Reddit for my tutorial. It provides an overview of how functional and declarative programming in Haskell empower baddies, increasing the accuracy and efficiency of their atomic superweapons. What do you guys think of my tutorial, Haskell for the Evil Genius

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Alex Stangl
On Fri, Sep 14, 2012 at 12:13:15PM -0400, Andrew Pennebaker wrote: I've gotten mixed feedback from Reddit for my tutorial. It provides an overview of how functional and declarative programming in Haskell empower baddies, increasing the accuracy and efficiency of their atomic superweapons. What

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Conal Elliott
Hi Andrew, To save others the search, here's the/a reddit URL: http://www.reddit.com/r/programming/related/nhnyd/nfa_in_a_single_line_of_haskell/. The terribly misleading/mistaken remarks on fib memoization are still in your post. As hammar commented on reddit commenter, you're not memoizing in

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Andrew Pennebaker
A summary of the changes I've included so far: Under Declarative, you aren't creating a named expression, 2 + 2, really. You are redefining (+). Noted and reflected in the new version. Under Lazy, your example of binding fib 30 is not a good example of memoization. With memoization you

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Albert Y. C. Lai
On 12-09-14 05:18 PM, Andrew Pennebaker wrote: One thing I want to double check is that Haskell does, in fact, automatically memoize all pure function calls. Is this true? A simple back-of-envelope calculation that immediately raises doubts: 2 seconds on a 2 GHz computer is 4x10^9 clock

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Alex Stangl
On Fri, Sep 14, 2012 at 05:18:24PM -0400, Andrew Pennebaker wrote: A summary of the changes I've included so far: Under Declarative, you aren't creating a named expression, 2 + 2, really. You are redefining (+). Noted and reflected in the new version. It may not be obvious to readers when

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Andrew Pennebaker
Experiment #4: fib :: Int - Int fib n = mem !! n mem :: [Int] mem = map aux [0..] -- remark: even [Int] is not a very efficient data structure for this aux 0 = 0 aux 1 = 1 aux n = mem!!(n-1) + mem!!(n-2) main :: IO () main = mapM_ (print . fib) (replicate 10 30) Question: How

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Corentin Dupont
Well, to make it short, I liked it! As suggestions, little things like first class functions and partial application can be easily introduced. For example the line: map (+1) [1..10] contains these concepts and it very short and expressive. On the story side, why not introducing a character? This

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Alexander Solla
On Fri, Sep 14, 2012 at 2:18 PM, Andrew Pennebaker andrew.penneba...@gmail.com wrote: A summary of the changes I've included so far: Noted and reflected... I'm trying to convey to an audience largely composed of Java and C++ fanatics how Haskell records are much better than OOP, how GADTs

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Andrew Pennebaker
But, Haskell records aren't better than OOP. I am not trying to be controversial here -- Haskell records would naturally implement prototype-based OOP, like JavaScript uses, if they (Haskell records) weren't so useless. This is basically why lenses were designed (i.e., to make consistent

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Kristopher Micinski
On Fri, Sep 14, 2012 at 8:23 PM, Andrew Pennebaker andrew.penneba...@gmail.com wrote: [snip..] Does anyone know of a brief introductory Haskell tutorial that engages monads? LYAH covers monads, but it does so after a few chapters of simpler, pure function Haskell coding. I know of some brief

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Andrew Pennebaker
Everyone in the Haskell cafe probably has a secret dream to give the best five minute monad talk. Challenge: get someone to have a competition at one of the conferences where students all give their best five minute monad talk and try to find the most comprehensible one! Haha, maybe

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Brandon Allbery
On Fri, Sep 14, 2012 at 9:08 PM, Andrew Pennebaker andrew.penneba...@gmail.com wrote: Given that Maybe and Either don't modify state, nor do they communicate with outside interfaces, nor do they specify computation ordering, I don't understand why they're implemented as monads. Why not a

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Joel Burget
I find the Monad instance for Maybe and Either very useful. You can do things like the following (which technically only uses the Applicative instance): Prelude Control.Applicative (*3) $ (+2) $ Just 1 Just 9 Prelude Control.Applicative (*3) $ (+2) $ Nothing Nothing Prelude Control.Applicative

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Andrew Pennebaker
Challenge: get someone to have a competition at one of the conferences where students all give their best five minute monad talk and try to find the most comprehensible one! Challenge accepted http://www.yellosoft.us/5min/. ___ Haskell-Cafe mailing