curry-frontend issueshttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues2023-07-26T16:17:34Zhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/138Default all type variables2023-07-26T16:17:34ZKai ProttDefault all type variablesCurrently not all type variables occurring in a flat curry expression are bound in the type of the surrounding function declaration.
Consider the following example:
```haskell
test = length []
```
Here, both `length` and `[]` will be ty...Currently not all type variables occurring in a flat curry expression are bound in the type of the surrounding function declaration.
Consider the following example:
```haskell
test = length []
```
Here, both `length` and `[]` will be typed with a free type variable.
While the resulting FlatCurry Code is certainly correct, all typed back ends need to default these type variables.
If I remember correctly, KiCS2 does not even do this in all required cases, e.g. when the type variable has a kind different than `Type`/`*`.
We'd like these type variables to be defaulted in the frontend directly.
Currently our idea is to create a new transformation phase on the IL where the AST is traversed and a new data type is created for each unique kind that occurrs in a type variable that needs to be defaulted.
Additionally, each type variable is replaced with the respective type constructor that has been generated.
Note that the generated data types need no constructors. Although it is not possible for a user to write a data type with arbitrary kind but without constructors (all type variables will be phantom and defaulted to `*`), we can generate these data types internally.
I am not sure if and when the frontend adds a dummy constructor to external data types or a data type without constructors, but this should be kept in mind.
Also, all environments should be updated with the new data types and they should not be exported to keep the transformation and compilation local and without name clashes.
@fte @mh @fwcd: Anyone got a better Idea?
@fwcd Do you have time to implement this? Should not be too complicated.
Note that in GHC with `-XPolyKinds`, Just two data types are sufficient for all possible kinds.
```haskell
data Zero
data One (a :: k)
```
In Curry we need:
```haskell
data Zero
data One (a :: *)
data Two (a :: *) (b :: *)
data OneTwo (a :: * -> *) (b :: *)
...
```https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/136Idea: Support shebangs in Curry source files2022-06-17T18:41:44ZFredrik WieczerkowskiIdea: Support shebangs in Curry source filesGHC allows a shebang line (starting with `#!`) to appear at the beginning of a Haskell source file, making it convenient to write directly executable scripts in Haskell. For example, writing the following is allowed:
```haskell
#!/usr/b...GHC allows a shebang line (starting with `#!`) to appear at the beginning of a Haskell source file, making it convenient to write directly executable scripts in Haskell. For example, writing the following is allowed:
```haskell
#!/usr/bin/env runhaskell
main = putStrLn "Hello world!"
```
For a hypothetical `runcurry` (or `runpakcs`/`runkics2`) tool it would be nice if the Curry frontend could similarly allow the user to write a single line starting with `#!` at the beginning of a source file (and just ignore it).https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/126Add hint to overloading errors2021-04-21T09:24:49ZMichael HanusAdd hint to overloading errorsThe definition
main = snd (x, True) where x free
produces the following error message:
Ambiguous type variable _3
in type Prelude.Data _3 => Prelude.Bool
Since this is difficult to understand for newbies, maybe the front...The definition
main = snd (x, True) where x free
produces the following error message:
Ambiguous type variable _3
in type Prelude.Data _3 => Prelude.Bool
Since this is difficult to understand for newbies, maybe the front end
can add a hint for such cases, i.e., when a type variable is ambiguous
but does not occur in the top-level type expression. E.g.:
Hint: add type annotation to local variable or declarationhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/65Fully implement the C preprocessor2019-11-15T12:45:57ZKai ProttFully implement the C preprocessorCurrently only `#define` `#ifdef`, ... are supported, but not `#include`Currently only `#define` `#ifdef`, ... are supported, but not `#include`https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/62Extend WarnCheck2022-03-01T18:22:21ZKai ProttExtend WarnCheckshadowing, etc.shadowing, etc.https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/61Support polymorphic let declarations2019-11-08T17:33:32ZKai ProttSupport polymorphic let declarationshttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/36Simplify generated FlatCurry when the specific type of a class function is known2019-03-25T12:16:16ZKai ProttSimplify generated FlatCurry when the specific type of a class function is knownCurrently a lot of apply-calls are inserted wherever a class function is used. This is not necessary whenever the arity of that function is known.
This is always the case when the specific type and thus the specific instance is known at...Currently a lot of apply-calls are inserted wherever a class function is used. This is not necessary whenever the arity of that function is known.
This is always the case when the specific type and thus the specific instance is known at compile-time.https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/31Properly represent a missing module header in the AST2018-12-17T10:53:25ZKai ProttProperly represent a missing module header in the ASTCurrently there is no "proper" way to detect, whether or not a module header was present (based solely on the structure of the generated AST).Currently there is no "proper" way to detect, whether or not a module header was present (based solely on the structure of the generated AST).https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/28Add ifThenElse-Construct to AbstractCurry2018-12-17T10:39:47ZKai ProttAdd ifThenElse-Construct to AbstractCurrycurrently AbstractCurry desugars ``ifThenElse`` to a function call to 'ifThenElse'.currently AbstractCurry desugars ``ifThenElse`` to a function call to 'ifThenElse'.https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/27Extend support for disabling optimizations2018-12-17T10:36:33ZKai ProttExtend support for disabling optimizationsAdd options to disable inlining, etc.Add options to disable inlining, etc.https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/21Add Bang patterns2018-12-06T14:29:57ZFinn TeegenAdd Bang patternsReason about and eventually add support for bang patterns to enforce strict evaluation of locally defined values.Reason about and eventually add support for bang patterns to enforce strict evaluation of locally defined values.https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/20Generate warnings for unused imports2022-03-02T14:35:57ZFinn TeegenGenerate warnings for unused importsThe frontend should detect unused imports and give a warning if there are imported modules or explicitly imported functions that are neither used nor reexported.The frontend should detect unused imports and give a warning if there are imported modules or explicitly imported functions that are neither used nor reexported.https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/18Add pragma for warnings and deprecations2018-12-06T14:29:57ZFinn TeegenAdd pragma for warnings and deprecationsSee https://www.haskell.org/ghc/docs/7.2.2/html/users_guide/pragmas.html#warning-deprecated-pragmaSee https://www.haskell.org/ghc/docs/7.2.2/html/users_guide/pragmas.html#warning-deprecated-pragmahttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/17Improve type error messages2018-12-06T14:29:57ZFinn TeegenImprove type error messagesExtend error messages of the type checker (and maybe others, too) with the origin of the inferred types in case of a type conflict.Extend error messages of the type checker (and maybe others, too) with the origin of the inferred types in case of a type conflict.https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/14Implement further simplifications2018-12-06T14:29:57ZFinn TeegenImplement further simplifications- Case-of-case
- Case-of-constructor
- Case-of-literal
- Inlining of ```let```-bindings
- ```let```-floating?- Case-of-case
- Case-of-constructor
- Case-of-literal
- Inlining of ```let```-bindings
- ```let```-floating?https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/13Erweiterung der Cabal-Testsuite2018-12-06T14:29:57ZFinn TeegenErweiterung der Cabal-TestsuiteDie bisherigen Testfälle sollten noch sinnvoll erweitert werden.
Hierbei könnte man sich beispielsweise an den Tests für den ExportCheck orientieren und entsprechende Testfälle für die anderen Überprüfungen des Frontends entwickeln.Die bisherigen Testfälle sollten noch sinnvoll erweitert werden.
Hierbei könnte man sich beispielsweise an den Tests für den ExportCheck orientieren und entsprechende Testfälle für die anderen Überprüfungen des Frontends entwickeln.https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/10Modify AST implementation to include span information instead of positions2019-05-27T11:24:11ZFinn TeegenModify AST implementation to include span information instead of positionsThe lexer (currybase/src/Curry.Syntax.Lexer) collects span information (i.e. a start and an end position) for all tokens during lexing.
Currently this information is only used to produce a token stream with spans.
Afterwards the span in...The lexer (currybase/src/Curry.Syntax.Lexer) collects span information (i.e. a start and an end position) for all tokens during lexing.
Currently this information is only used to produce a token stream with spans.
Afterwards the span information is discarded: The function span2Pos (Curry.Base.Span) is applied to convert spans into ordinary (starting) positions.
The AST implementation with positions should be modified to include span information in the long term.
For this purpose the checks and transformations of the frontend implementation need to be adapted correspondingly.