Re: [Haskell-cafe] Re: Heterogeneous Data Structures - Nested Pairs and functional references

2010-02-25 Thread Alexander Solla
On Feb 24, 2010, at 10:15 AM, Heinrich Apfelmus wrote: Namely, let's assume we are already given a magic type constructor |- (so magic that it's not even legal Haskell syntax) with the property that A |- B somehow denotes an expression of type B with free variables of type A .

[Haskell-cafe] Re: Heterogeneous Data Structures - Nested Pairs and functional references

2010-02-24 Thread Heinrich Apfelmus
Günther Schmidt wrote: I've been thinking a lot lately about heterogeneous and extensible data structures for which HList certainly offers a solution. While HList is implemented through type-level programming I wonder if I can achieve similar results through value-level programming alone.

[Haskell-cafe] Re: Heterogeneous Data Structures - Nested Pairs and functional references

2010-02-20 Thread Heinrich Apfelmus
Alexander Solla wrote: So, the type (View view) -- ignoring class instances -- is basically isomorphic to this (slightly simpler) type: data View = EmptyView | TextView String | ConcatView View View | NestViews View View View | ... instance Monoid View where ... Now, consider the

Re: [Haskell-cafe] Re: Heterogeneous Data Structures - Nested Pairs and functional references

2010-02-20 Thread Alexander Solla
On Feb 20, 2010, at 10:25 AM, Heinrich Apfelmus wrote: But isn't the line renderXHtml (ConcatView l r) = fold $ renderXHtml (ConcatViews l r) a type error? I'm assuming Data.Foldable.fold :: (Foldable m, Monoid t) = m t - t being applied to the result type of renderXHtml which is

[Haskell-cafe] Re: Heterogeneous Data Structures - Nested Pairs and functional references

2010-02-18 Thread Günther Schmidt
Hi Alexander, sry for being a bit thick, but how would this code be used? I'm unable to figure out the application yet. Could you give some examples how you use it? Günther ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: Heterogeneous Data Structures - Nested Pairs and functional references

2010-02-18 Thread Alexander Solla
sry for being a bit thick, but how would this code be used? I'm unable to figure out the application yet. Could you give some examples how you use it? Günther So, the type (View view) -- ignoring class instances -- is basically isomorphic to this (slightly simpler) type: data View

[Haskell-cafe] Re: Heterogeneous Data Structures - Nested Pairs and functional references

2010-02-17 Thread Günther Schmidt
Hi Alex, this looks very very interesting, gimme some time to figure it. I hope you'll take questions later ... Günther Am 16.02.10 22:34, schrieb Alexander Solla: On Feb 16, 2010, at 12:48 PM, Alexander Solla wrote: (Accumulator String)s are (Accumulator value)s for any value. So you