Re: [Haskell-cafe] CBN, CBV, Lazy in the same final tagless framework

2009-10-15 Thread Jacques Carette
Just a short note to show how the 3 evaluation orders can be written in a very symmetric manner: o...@okmij.org wrote these as: In call-by-name, we have lam f = S . return $ (unS . f . S) In call-by-value, we have lam f = S . return $ (\x - x = unS . f . S . return) In

Re: [Haskell-cafe] CBN, CBV, Lazy in the same final tagless framework

2009-10-09 Thread Felipe Lessa
On Thu, Oct 08, 2009 at 12:54:14AM -0700, o...@okmij.org wrote: Actually it is possible to implement all three evaluation orders within the same final tagless framework, using the same interpretation of types and reusing most of the code save the semantics of lam. That is where the three

Re: [Haskell-cafe] CBN, CBV, Lazy in the same final tagless framework

2009-10-09 Thread David Menendez
On Fri, Oct 9, 2009 at 11:12 AM, Felipe Lessa felipe.le...@gmail.com wrote: On Thu, Oct 08, 2009 at 12:54:14AM -0700, o...@okmij.org wrote: Actually it is possible to implement all three evaluation orders within the same final tagless framework, using the same interpretation of types and

Re: [Haskell-cafe] CBN, CBV, Lazy in the same final tagless framework

2009-10-09 Thread Felipe Lessa
On Fri, Oct 09, 2009 at 01:27:57PM -0400, David Menendez wrote: On Fri, Oct 9, 2009 at 11:12 AM, Felipe Lessa felipe.le...@gmail.com wrote: That's really nice, Oleg, thanks!  I just wanted to comment that I'd prefer to write share :: IO a - IO (IO a) share m = mdo r - newIORef (do x - m

Re: [Haskell-cafe] CBN, CBV, Lazy in the same final tagless framework

2009-10-09 Thread David Menendez
On Fri, Oct 9, 2009 at 1:39 PM, Felipe Lessa felipe.le...@gmail.com wrote: On Fri, Oct 09, 2009 at 01:27:57PM -0400, David Menendez wrote: On Fri, Oct 9, 2009 at 11:12 AM, Felipe Lessa felipe.le...@gmail.com wrote: That's really nice, Oleg, thanks!  I just wanted to comment that I'd prefer

Re: [Haskell-cafe] CBN, CBV, Lazy in the same final tagless framework

2009-10-09 Thread Martijn van Steenbergen
Felipe Lessa wrote: which unfortunately needs {-# LANGUAGE RecursiveDo #-} or some ugliness from mfix But mdo/mfix is awesome! :-( Martijn. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] CBN, CBV, Lazy in the same final tagless framework

2009-10-08 Thread oleg
Actually it is possible to implement all three evaluation orders within the same final tagless framework, using the same interpretation of types and reusing most of the code save the semantics of lam. That is where the three orders differ, by their own definition. In call-by-name, we have