Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Improve the surface language #143

Open
florentc opened this issue Aug 16, 2022 · 0 comments
Open

Improve the surface language #143

florentc opened this issue Aug 16, 2022 · 0 comments

Comments

@florentc
Copy link
Member

florentc commented Aug 16, 2022

There is room for several features that would greatly improve the surface language of Pirouette.

  • Nested line-folding: support for nested line-folded sections is not trivial but would make it possible to get rid of the { ; ; ; } syntax in case statements and introduce let and where local function declarations. For now, line folding support is one-level only and relies on Reader (Maybe Pos) where Pos is the column number where a line folded section began.

  • Implicitly quantified type variables: isJust : Maybe a -> Bool would be equivalent to isJust : forall a . Maybe a -> Bool

  • Implicit naming of type variables in function body: for isJust : forall a . Maybe a -> Bool, the body declaration isJust mx = would be equivalent to isJust @a mx (name clashes and name shadowing should be kept in mind when implementing this). This requires to refactor and enhance funTerm in Language.Pirouette.QuasiQuoter.Syntax.

  • Pattern matching directly in multiple function bodies (consider this after fixing Translate case expressions to SystemF #142): the Param type should rely on Pattern lang instead of String. The main question remains how to represent this when there are several pattern-matched function parameters: either as desugared nested case expressions ExprCase or in an adapted FunDecl type. The parser is ready for such a change and multi-bodies function declarations thanks to line folding, Pattern lang, and Param. This requires to refactor and enhance funTerm in Language.Pirouette.QuasiQuoter.Syntax so that it deals with pattern parameters.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant