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 #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.
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 introducelet
andwhere
local function declarations. For now, line folding support is one-level only and relies onReader (Maybe Pos)
wherePos
is the column number where a line folded section began.Implicitly quantified type variables:
isJust : Maybe a -> Bool
would be equivalent toisJust : forall a . Maybe a -> Bool
Implicit naming of type variables in function body: for
isJust : forall a . Maybe a -> Bool
, the body declarationisJust mx =
would be equivalent toisJust @a mx
(name clashes and name shadowing should be kept in mind when implementing this). This requires to refactor and enhancefunTerm
inLanguage.Pirouette.QuasiQuoter.Syntax
.Pattern matching directly in multiple function bodies (consider this after fixing #142): the
Param
type should rely onPattern lang
instead ofString
. The main question remains how to represent this when there are several pattern-matched function parameters: either as desugared nested case expressionsExprCase
or in an adaptedFunDecl
type. The parser is ready for such a change and multi-bodies function declarations thanks to line folding,Pattern lang
, andParam
. This requires to refactor and enhancefunTerm
inLanguage.Pirouette.QuasiQuoter.Syntax
so that it deals with pattern parameters.