Re: [Haskell-cafe] Programming an Evaluation Context

2007-02-15 Thread Claus Reinke
in structural operational semantics, an evaluation context is often used to decompose an expression into a redex and its context. In a formal semantics on paper, an expression can just be pattern matched over the grammar of an evaluation context. If one wants to implement such a semantics in

Re: [Haskell-cafe] Programming an Evaluation Context

2007-02-15 Thread Claus Reinke
-- evaluation contexts, parameterized by rule to apply ctxt rule e = rule e `mplus` left (ctxt rule) e `mplus` right (ctxt rule) e left act e = do { (Plus l r) - return e; lv - act l; return (Plus lv r) } right act e = do { (Plus lv@(Val _) r) - return e; rv - act r; return (Plus lv

[Haskell-cafe] Programming an Evaluation Context

2007-02-14 Thread Klaus Ostermann
Hi there, in structural operational semantics, an evaluation context is often used to decompose an expression into a redex and its context. In a formal semantics on paper, an expression can just be pattern matched over the grammar of an evaluation context. If one wants to implement such a

Re: [Haskell-cafe] Programming an Evaluation Context

2007-02-14 Thread Jim Apple
On 2/14/07, Klaus Ostermann [EMAIL PROTECTED] wrote: in structural operational semantics, an evaluation context is often used to decompose an expression into a redex and its context. Have you seen http://citeseer.ist.psu.edu/mcbride01derivative.html The Derivative of a Regular Type is its