Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-10 Thread Tillmann Rendel
Martijn van Steenbergen wrote: Tom Schrijvers wrote: data EvalDict sem = EvalDict { val :: Int - sem Int, add :: sem Int - sem Int - sem Int } An alternative option is to capture the structure in a GADT: data Eval a where Val :: Int - Eval Int Add :: Eval Int - Eval Int - Eval Int And

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-10 Thread Tillmann Rendel
Tom Schrijvers wrote: William Cook's Onward! essay is relevant here. He characterizes the difference between objects and abstract data types nicely: the latter allow binary methods that pattern match (to exploit the combined knowledge of the internals of two different values) whereas objects

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-09 Thread Tillmann Rendel
Tom Schrijvers wrote: Yeah, subject Finally Tagless again, sorry, I'm just not done with it yet. In Olegs haskell implementation he is using classes mainly to model the syntax and instances to use for evaluators / compilers to allow multiple interpretations. I wonder if it'd be possible to do

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-09 Thread Martijn van Steenbergen
Tom Schrijvers wrote: data EvalDict sem = EvalDict { val :: Int - sem Int, add :: sem Int - sem Int - sem Int } An alternative option is to capture the structure in a GADT: data Eval a where Val :: Int - Eval Int Add :: Eval Int - Eval Int - Eval Int And then write what were instances

[Haskell-cafe] more thoughts on Finally tagless

2010-03-08 Thread Günther Schmidt
Hi all, and Oleg et al in particular. Yeah, subject Finally Tagless again, sorry, I'm just not done with it yet. In Olegs haskell implementation he is using classes mainly to model the syntax and instances to use for evaluators / compilers to allow multiple interpretations. I wonder if

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-08 Thread Tom Schrijvers
Yeah, subject Finally Tagless again, sorry, I'm just not done with it yet. In Olegs haskell implementation he is using classes mainly to model the syntax and instances to use for evaluators / compilers to allow multiple interpretations. I wonder if it'd be possible to do the same without

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-08 Thread Stephen Tetley
Hi Günther The finally tagless style is an implementation of the TypeCase pattern (Bruno C. d. S. Oliveira and Jeremy Gibbons): http://www.comlab.ox.ac.uk/jeremy.gibbons/publications/typecase.pdf TypeCase can be implemented via GADTs or type classes - typed printf in section 4.2 of the paper is

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-08 Thread Jacques Carette
Stephen Tetley wrote: The finally tagless style is an implementation of the TypeCase pattern (Bruno C. d. S. Oliveira and Jeremy Gibbons): One part of our work does that, yes. The authors of the Finally Tagless note in the long version of their paper that the GADT TypeCase had some

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-08 Thread Jacques Carette
Günther Schmidt wrote: In Olegs haskell implementation he is using classes mainly to model the syntax and instances to use for evaluators / compilers to allow multiple interpretations. When there are 3 authors on a paper (and in the implementation file), it is customary to acknowledge all 3,

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-08 Thread Günther Schmidt
Dear Jacques, you are right, I should have done so and will do my best not to repeat this error. Please accept my sincere apologies to Ken and yourself for my negligence, no offense was meant. Best regards Günther Am 09.03.10 03:37, schrieb Jacques Carette: Günther Schmidt wrote: