[Haskell-cafe] Fwd: C9 video in the Monadic Design Patterns for the Web series

2011-07-27 Thread Greg Meredith
Dear Haskellians, A new C9 video in the series! So, you folks already know most of this... except for maybe the generalization of the Conway construction! Best wishes, --greg -- Forwarded message -- From: Charles Torre <...> Date: Tue, Jul 26, 2011 at 1:12 PM Subject: C9 video

Re: [Haskell-cafe] Fwd: C9 video in the Monadic Design Patterns for the Web series

2011-07-27 Thread Christopher Done
On 27 July 2011 10:31, Greg Meredith wrote: > Dear Haskellians, > A new C9 video in the series! > So, you folks already know most of this... except for maybe the > generalization of the Conway construction! > Best wishes, > --greg Thanks for the heads up! I love these videos. ___

Re: [Haskell-cafe] Fwd: C9 video in the Monadic Design Patterns for the Web series

2011-07-27 Thread James Cook
I'm always glad to see videos like this. I wish more people could have that much fun playing with math ;). It wouldn't really be suitable for your application but another interesting generalization is to insert the 'Either' at the top level: > data ConwayT m a > = Pure a > | ConwayT >

Re: [Haskell-cafe] Fwd: C9 video in the Monadic Design Patterns for the Web series

2011-07-27 Thread James Cook
For any who are interested, here's a quick and dirty Haskell version of the generalized Conway game monad transformer described in the video. It uses two newtypes, "L" and "R", to select from two possible implementations of the Monad class. (all the LANGUAGE pragmas are just to support a deriv

Re: [Haskell-cafe] Fwd: C9 video in the Monadic Design Patterns for the Web series

2011-07-27 Thread James Cook
Dang, I should have played with both versions before sending this. The 'R' instance has a very obvious error: >return x = R (ConwayT (return (Left x)) mzero) should be changed to >return x = R (ConwayT mzero (return (Left x))) Sorry! -- James On Jul 27, 2011, at 9:28 AM, James Cook

Re: [Haskell-cafe] Fwd: C9 video in the Monadic Design Patterns for the Web series

2011-07-27 Thread Greg Meredith
Dear James, This is so cool! It's so natural to express this as a monad transformer. It's great insight and it's just the sort of insight that Haskell and this way of thinking about computation makes possible. Bravo! Best wishes, --greg On Wed, Jul 27, 2011 at 6:33 AM, James Cook wrote: > Dan