Re: [Haskell-cafe] functional references and HList?

2010-02-04 Thread Martijn van Steenbergen

Edward Kmett wrote:
Functional references let you both read and write 'attributes' in a 
structure. These can be chained to access members of members.


You can also use them to build bidirectional views on fields (and 
compose those again as well).


Martijn.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] functional references and HList?

2010-02-04 Thread Günther Schmidt

Hi,

from all this I'm not so sure that these two techniques do not overlap. 
I mean HList tries to provide a technique for extensible Records, or 
composable data structures.


So far it is possible in Haskell to extend / compose Data Structures but 
not at run-time and also rather clumsily.


One could of course use tuples or rather nested pairs to compose data 
structures too, which would work at run-time. But that would be very 
hard to maintain.


HList implements this composability by elaborate type-level programming.

In my opinion functional references allows for this too but not through 
type-level programming.


Am I wrong?

Günther


Am 04.02.10 13:18, schrieb Martijn van Steenbergen:

Edward Kmett wrote:
Functional references let you both read and write 'attributes' in a 
structure. These can be chained to access members of members.


You can also use them to build bidirectional views on fields (and 
compose those again as well).


Martijn.




___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] functional references and HList?

2010-02-03 Thread Edward Kmett
I see them as addressing separate issues.

They overlap in that they both address the notion of how to access
attributes in some sense, but really they are complementary techniques.

HList as used by OOHaskell provides you with a mechanism by which you can
define extensible records and structural subtyping.

Functional references let you both read and write 'attributes' in a
structure. These can be chained to access members of members.

These techniques can be used together to get extensible records that have
settable fields in the form of functional references, where these references
can be chained together.

HList/OOHaskell doesn't concern itself with the 'deep reference' problem,
and functional references do not concern themselves directly with extensible
records.

-Edward Kmett

2010/2/2 Günther Schmidt gue.schm...@web.de

 Hi all,

 I wonder if there is some a field of use overlap between HList and
 functional references aka accessors.

 Do both tackle the same problem?

 Günther


 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe