curry-frontend issueshttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues2018-07-11T23:23:09Zhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/24Having a class method with the same name as a constructor results in an inter...2018-07-11T23:23:09ZKai ProttHaving a class method with the same name as a constructor results in an internal error```haskell
class Same a where
Same :: a -> a
data Same2 = Same
```
will lead to
> pakcs-frontend: Internal error: qualBindTopEnv QualIdent {qidModule = Nothing, qidIdent = Ident {idPosition = Position {file = "Test.curry", line = 2...```haskell
class Same a where
Same :: a -> a
data Same2 = Same
```
will lead to
> pakcs-frontend: Internal error: qualBindTopEnv QualIdent {qidModule = Nothing, qidIdent = Ident {idPosition = Position {file = "Test.curry", line = 2, column = 3}, idName = "Same", idUnique = 0}}
> CallStack (from HasCallStack):
> error, called at src/Base/Messages.hs:78:21 in main:Base.MessagesFinn TeegenFinn Teegenhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/23Declaration of type class with nullary class method yields internal error2018-06-27T11:58:49ZJan Rasmus Tikovsky Declaration of type class with nullary class method yields internal errorConsider the following type class declaration:
```
class Arbitrary a where
arbitrary :: IO a
```
Compiling a module including this declaration results in the following error message from the Curry frontend:
```
kics2-frontend: Inter...Consider the following type class declaration:
```
class Arbitrary a where
arbitrary :: IO a
```
Compiling a module including this declaration results in the following error message from the Curry frontend:
```
kics2-frontend: Internal error: Base.Typing.matchType: (TypeApply (TypeConstructor (QualIdent {qidModule = Just (ModuleIdent {midPosition = NoPos, midQualifiers = ["Prelude"]}), qidIdent = Ident {idPosition = Position {file = "/net/medoc/home/jrt/forschung/quickchance/2018-QuickChance/.cpm/packages/pflp-1.0.1/src/.curry/PFLP.icurry", line = 8, column = 12}, idName = "IO", idUnique = 0}})) (TypeVariable 0)) (TypeArrow (TypeConstructor (QualIdent {qidModule = Nothing, qidIdent = Ident {idPosition = NoPos, idName = "()", idUnique = 0}})) (TypeApply (TypeConstructor (QualIdent {qidModule = Just (ModuleIdent {midPosition = NoPos, midQualifiers = ["Prelude"]}), qidIdent = Ident {idPosition = Position {file = "/net/medoc/home/jrt/forschung/quickchance/2018-QuickChance/.cpm/packages/pflp-1.0.1/src/.curry/PFLP.icurry", line = 8, column = 12}, idName = "IO", idUnique = 0}})) (TypeVariable (-1))))
CallStack (from HasCallStack):
error, called at src/Base/Messages.hs:78:21 in main:Base.Messages
kics2c: *** UserException: Illegal source program
```https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/22Wrong type for free variables in TypedFlatCurry2018-04-19T13:26:20ZMichael HanusWrong type for free variables in TypedFlatCurryThe front end produces for the program
last :: [a] -> a
last xs | xs ++ [x] =:= xs = x where x,xs free
a wrong type for the free variable `xs` in the typed FlatCurry program. Here is an excerpt from the produced code:
(AF...The front end produces for the program
last :: [a] -> a
last xs | xs ++ [x] =:= xs = x where x,xs free
a wrong type for the free variable `xs` in the typed FlatCurry program. Here is an excerpt from the produced code:
(AFree (TVar 0) [(2,TVar 0),(3,TVar 0)] (ACase...
As one can see, both free variables the same type, but variable 3 should have the type
TCons ("Prelude","[]") [TVar 0]Finn TeegenFinn Teegenhttps://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/19Add support for different syntax modes2018-12-06T14:29:57ZFinn TeegenAdd support for different syntax modesThe Curry language definition allows different case modes to disambiguate variables and other identifiers. These are:
* Prolog mode: Variables start upper case, all other identifiers lower case
* Gödel mode: Prolog mode with swapped ca...The Curry language definition allows different case modes to disambiguate variables and other identifiers. These are:
* Prolog mode: Variables start upper case, all other identifiers lower case
* Gödel mode: Prolog mode with swapped cases
* Haskell mode: Like Haskell
* Free mode: no restrictions
Currently, the frontend parses all Curry modules in `free` mode.
It would be nice to add an additional case mode parameter as well as have the compiler checking if the given mode is obeyed.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/16Improve warning for unreachable/overlapping pattern to also take guards into ...2020-02-08T12:12:49ZFinn TeegenImprove warning for unreachable/overlapping pattern to also take guards into accountCurrently, the following program
<pre>
f :: a -> Bool
f x = case x of
_ | False -> False
_ -> True
</pre>
generates the warning
<pre>
warning.curry, line 3.3: Warning:
Pattern matches are unreachable
In a case al...Currently, the following program
<pre>
f :: a -> Bool
f x = case x of
_ | False -> False
_ -> True
</pre>
generates the warning
<pre>
warning.curry, line 3.3: Warning:
Pattern matches are unreachable
In a case alternative:
_ -> ...
</pre>
This is obviously wrong, and is caused by the fact that the guard is not taken into account. A reasonable approach would be to consider only the following guards to always succeed: ```True```, ```success```, ```otherwise```.
In addition, this information may be used to eliminate unreachable alternatives.Fredrik WieczerkowskiFredrik Wieczerkowskihttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/15Separate compilation of pattern matching and translation into intermediate la...2018-12-06T14:29:57ZFinn TeegenSeparate compilation of pattern matching and translation into intermediate languagehttps://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/12Fix reexport of modules imported with restrictions2019-10-19T01:46:45ZFinn TeegenFix reexport of modules imported with restrictionsConsider the following two modules:
<pre>
module Export where
data Test = Test { test :: Test }
</pre>
<pre>
module Import (module Export) where
import Export (Test(test))
</pre>
When restricting the import of a data type from another...Consider the following two modules:
<pre>
module Export where
data Test = Test { test :: Test }
</pre>
<pre>
module Import (module Export) where
import Export (Test(test))
</pre>
When restricting the import of a data type from another module to its labels only (as above), the reexport of this module leads to an internal error:
<pre>
cymake: Internal error: Exports.funDecl: QualIdent {qidModule = Just (ModuleIdent {midPosition = Position {file = ".curry/Export.icurry", line = 1, column = 11, astRef = }, midQualifiers = ["Export"]}), qidIdent = Ident {idPosition = Position {file = ".curry/Export.icurry", line = 2, column = 20, astRef = }, idName = "test", idUnique = 0}}
</pre>https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/11Remove anonymous labels for data constructors in value environment2018-12-06T14:29:58ZFinn TeegenRemove anonymous labels for data constructors in value environmentWhen a data constructor is entered into the value environment which does not belong to a record type, anonymous labels are created. This seems to be a relict from the MCC where the list of labels is used to determine the arity of a data ...When a data constructor is entered into the value environment which does not belong to a record type, anonymous labels are created. This seems to be a relict from the MCC where the list of labels is used to determine the arity of a data constructor. Since the arity is stored separately, the creation of anonymous labels should no longer be necessary, thus the list of labels can be left empty for normal data constructors.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.https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/9Improve Error Message regarding export/import of record labels2019-10-19T01:45:20ZFinn TeegenImprove Error Message regarding export/import of record labelsConsider the following Curry modules:
<pre>
module RecTest (R(C1)) where
data R = C1 { l1 :: String, l2 :: Int }
| C2 { l2 :: Int }
</pre>
<pre>
import RecTest
test :: R -> R
test r = r { l2 = 42 }
</pre>
Running curry-fronte...Consider the following Curry modules:
<pre>
module RecTest (R(C1)) where
data R = C1 { l1 :: String, l2 :: Int }
| C2 { l2 :: Int }
</pre>
<pre>
import RecTest
test :: R -> R
test r = r { l2 = 42 }
</pre>
Running curry-frontend on the module RecTest yields the error message:
<pre>
test/RecImp.curry, line 4.10: Error:
No constructor has all of these fields:
`l2'
</pre>
Since the record ```R``` includes the label ```l2``` for both constructors, the message should be improved to "No visible constructor has all of these fields".https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/8(Re)export of record labels2019-10-19T01:46:02ZFinn Teegen(Re)export of record labelsConsider the following modules:
<pre>
module RecTest where
data R = C1 { l1 :: String, l2 :: Int }
| C2 { l2 :: Int }
</pre>
<pre>
module RecImp (module RecTest) where
import RecTest (l2)
-- test :: R -> R
test r = r { l2 = 4...Consider the following modules:
<pre>
module RecTest where
data R = C1 { l1 :: String, l2 :: Int }
| C2 { l2 :: Int }
</pre>
<pre>
module RecImp (module RecTest) where
import RecTest (l2)
-- test :: R -> R
test r = r { l2 = 42 }
</pre>https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/7Remove addition of Prelude import to AST2018-12-06T14:29:58ZFinn TeegenRemove addition of Prelude import to ASTCurrently, during compilation the AST of a module is extended with a "virtual" import of the `Prelude` module unless the `Prelude` is explicitly imported or the import is deactivated by the `NoImplicitPrelude` language extension.
While ...Currently, during compilation the AST of a module is extended with a "virtual" import of the `Prelude` module unless the `Prelude` is explicitly imported or the import is deactivated by the `NoImplicitPrelude` language extension.
While the consideration of the `Prelude` is important for compilation, the addition to the AST can lead to problems since the AST no longer corresponds to the source program. Thus, this transformation should at least be deferred to the transformation phases.
Involved modules are:
* `Modules`: Contains the function `importPrelude` which should be removed
* `Interfaces`: Contains the function `loadInterfaces` which then has to load the `Prelude` in addition
* `Imports`: Contains the functions `importModules` and `importInterfaces` which then have to load the `Prelude` in additionhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/6Rephrase Synopsis and Description fields in curry-frontend.cabal2017-05-21T00:32:04ZMike Gabriel mga@informatik.uni-kiel.deRephrase Synopsis and Description fields in curry-frontend.cabalWith the curry-frontend Debian package, I currently ship this additional patch. Please consider applying upstream. Reasoning given below.
```
Description: Improve .cabal file's Synopsis: and Description fields.
Author: Mike Gabriel ...With the curry-frontend Debian package, I currently ship this additional patch. Please consider applying upstream. Reasoning given below.
```
Description: Improve .cabal file's Synopsis: and Description fields.
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Abstract:
Shorten Synopsis: limit field to something clearly below 78 chars.
.
Drop dead (404) URL from Description: field and rephrase slightly.
--- a/curry-frontend.cabal
+++ b/curry-frontend.cabal
@@ -1,16 +1,14 @@
Name: curry-frontend
Version: 0.4.2
Cabal-Version: >= 1.10
-Synopsis: Compile the functional logic language Curry to several
- intermediate formats
-Description: The Curry Frontend consists of the executable program "curry-frontend".
- It is used by various backends to compile Curry programs to
- an intermediate representation.
- The code is a stripped-down version of an early version of
- the Muenster Curry Compiler
- (<http://danae.uni-muenster.de/curry/>)
- which has been extended to produce different intermediate
- representations.
+Synopsis: Lexer, parser, type checker, etc. for the Curry language
+Description: The Curry Frontend consists of the executable program
+ "curry-frontend". It is used by various backends to
+ compile programs written in the functional logic language
+ Curry to various intermediate representations.
+ .
+ For further information, please check
+ http://currry-language.org
Category: Language
License: BSD-3-clause
License-File: LICENSE
```Michael HanusMichael Hanushttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/5cymake / curry-frontend does not have a man page2019-10-28T10:21:43ZMike Gabriel mga@informatik.uni-kiel.decymake / curry-frontend does not have a man pageIn Linux distros, it is a requirement to ship a man page with every executable. We need one for curry-frontend (formerly cymake). For the first Debian uploads, I can write a minimal man page, but we should surely provide a man page with ...In Linux distros, it is a requirement to ship a man page with every executable. We need one for curry-frontend (formerly cymake). For the first Debian uploads, I can write a minimal man page, but we should surely provide a man page with detailled information about curry-frontend usage.
Is there any man page like documentation I can turn into a man page on the wiki / homepage somewhere?Michael HanusMichael Hanus