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 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 starts making > sense

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 r

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.

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 http://www.haske

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 th

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 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 be an interesting in

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 up

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 up

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 prob

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 par

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

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 langua

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 Kristopher Micinski
On Fri, Sep 14, 2012 at 10:08 PM, Joel Burget 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. My objectio

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 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! Maybe I'll try to

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.Applicati

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 . ___ Haskell-Cafe

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.Appl

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

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, m

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 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 tutorials for monads that

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 co

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 G

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 w

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) > >

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

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 cycles

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 memoizatio

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 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. W

[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