
Hi all, I have been searching for examples of Haskell "real scenarios" that employ mutually recursive datatype definitions. Does anyone know some interesting libraries or structures that I could play with? Thanks, hugo -- www.di.uminho.pt/~hpacheco

Hugo Pacheco wrote:
Hi all, I have been searching for examples of Haskell "real scenarios" that employ mutually recursive datatype definitions. Does anyone know some interesting libraries or structures that I could play with?
Tim Sheard presents a realistic use case in [1]. We're using it in a logic language compiler, though your definitions of realism may vary. There's an expanded version of the two-level types idea in [2]. [1] http://web.cecs.pdx.edu/~sheard/papers/generic.ps [2] http://web.cecs.pdx.edu/~sheard/papers/JfpPearl.ps -- Live well, ~wren

On Sun, 26 Oct 2008, Hugo Pacheco wrote:
Hi all, I have been searching for examples of Haskell "real scenarios" that employ mutually recursive datatype definitions. Does anyone know some interesting libraries or structures that I could play with?
http://darcs.haskell.org/wraxml/src/Data/Tree/BranchLeafTag.hs Here Elem uses Tree.T and Tree.T uses Elem. Is this what you are looking for?

Think of any "real" programming language out there. For example, in many languages statements may contain expressions, and expressions in turn may contain statements (in Java through anonymous inner classes, for example). Boa noite, Martijn. Hugo Pacheco wrote:
Hi all,
I have been searching for examples of Haskell "real scenarios" that employ mutually recursive datatype definitions. Does anyone know some interesting libraries or structures that I could play with?
Thanks, hugo
-- www.di.uminho.pt/~hpacheco http://www.di.uminho.pt/~hpacheco
------------------------------------------------------------------------
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Think of any "real" programming language out there. For example, in many languages statements may contain expressions, and expressions in turn may contain statements (in Java through anonymous inner classes, for example).
... and as an example of this you could have a look at the haskell-src(-exts) package that encodes the Haskell syntax as an AST. For example there are expressions containing statements (e.g. the do-expression) and statements containing expressions (obviously). Cheers, /Niklas

Probably I overdid the real part.I was thinking of examples such as ASTs
(such as the Haskell one), trees and imagining more fancy things, maybe
L-systems and fractal processing.
I will have a look at the Haskell sources and the previous papers from Tim
Sheard.
Cheers,
hugo
On Sun, Oct 26, 2008 at 6:07 PM, Niklas Broberg
Think of any "real" programming language out there. For example, in many languages statements may contain expressions, and expressions in turn may contain statements (in Java through anonymous inner classes, for example).
... and as an example of this you could have a look at the haskell-src(-exts) package that encodes the Haskell syntax as an AST. For example there are expressions containing statements (e.g. the do-expression) and statements containing expressions (obviously).
Cheers,
/Niklas
-- www.di.uminho.pt/~hpacheco

Probably I overdid the real part. I was thinking of examples such as ASTs (such as the Haskell one), trees and imagining more fancy things, maybe L-systems and fractal processing. I will have a look at the Haskell sources and the previous papers from Tim Sheard. One example is a language grammar. Each non-terminal in the grammar can reference any other non-terminal in the grammar. Thus, if
On 10/26/08 17:06, Hugo Pacheco wrote: the non-terminals are considered types, then each non-terminal in a grammar is mutually recursive with respect to other non-terminals in that grammar.
participants (6)
-
Henning Thielemann
-
Hugo Pacheco
-
Larry Evans
-
Martijn van Steenbergen
-
Niklas Broberg
-
wren ng thornton