Ticket #54 (new feature request)
Allow declaration of free variables (for functional logic programming)
| Reported by: | holgersiegel74@… | Owned by: | nibro |
|---|---|---|---|
| Priority: | minor | Milestone: | Blue Sky |
| Component: | syntax | Version: | 1.9.x |
| Keywords: | Cc: |
Description
The functional logic language Curry (http://curry-language.org/) has a syntax that is very similar to Haskell's. The major difference is that Curry allows one to declare free variables, like in
foo = let x, y free in [x, y, n+z]
where n = 3
z free
Supporting this syntax requires only small changes in haskell-src-exts: mainly a new language extension FreeVariables and a new constructor FreeDecl:
data Extension
= ...
| FreeVariables
...
data Decl
= ...
| FreeDecl SrcLoc [Name]
...
This would make it very easy to manipulate Curry source code in Haskell. (At the moment I'm thinking about patching haskell-source-exts for myself, but to have this modification in the official version would be a much cleaner solution)
The drawback is that this extension is not part of the language Haskell, so that the declarations in Language.Haskell.Exts.Extension will differ from those in Cabal's Language.Haskell.Extension module. (A simple workaround might be to abuse (UnknownExtension "FreeVariables") for this.)
