Ticket #54 (new feature request)

Opened 8 years ago

Last modified 7 years ago

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:


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.)

Change History

Changed 8 years ago by nibro

  • priority changed from major to minor

Changed 7 years ago by nibro

  • version changed from 1.0.1 to 1.9.x
Note: See TracTickets for help on using tickets.