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

2010-02-16 Thread Günther Schmidt
Hi, 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. This is where I was

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

2010-02-16 Thread Alexander Solla
On Feb 16, 2010, at 12:14 PM, Günther Schmidt wrote: Let's say there was some clever monad ... someMonad = do h1 - add twenty h2 - add False h3 - add 16 . modify h2 True and get a (twenty,(True, 16)) back. And while *in* the monad some

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

2010-02-16 Thread 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 can build things like: Sorry, I made a typo. I meant StringAccumulator Strings are Accumulator values for any value.

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

2010-02-16 Thread Stephen Tetley
Hi Alexander Your monad looks equivalent to the Identity monad but over a much bigger syntax. What advantages do you get from it being a monad, rather than just a functor? Best wishes Stephen ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

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

2010-02-16 Thread Alexander Solla
On Feb 16, 2010, at 2:11 PM, Stephen Tetley wrote: Your monad looks equivalent to the Identity monad but over a much bigger syntax. What advantages do you get from it being a monad, rather than just a functor? I replied to Stephen, but forgot to include the list. I took the liberty of