Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Open Data Types and Open Functions" in Haskell

Tags:

haskell

Is there an existing implementation of the open semantics defined in the paper Open Data Types and Open Functions? As a GHC extension, as Template Haskell, as part of some other Haskell compiler, as a preprocessor, etc. The paper was published in 2006, and it claims to be simple.

I need data extensibility for a few core types in a project I'm working on. But I don't want to lift every constructor of the open datum to a type, and every open function to a class.

like image 985
sam boosalis Avatar asked Nov 11 '22 00:11

sam boosalis


1 Answers

While it is rather heavyweight compared to open, the usual approach for these sorts of things is to introduce a mechanism along the lines of the "a la carte" paper: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.101.4131

like image 184
sclv Avatar answered Nov 15 '22 06:11

sclv