curry-frontend issueshttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues2020-10-20T15:29:33Zhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/86Split multi-branch unreachability warnings2020-10-20T15:29:33ZFredrik WieczerkowskiSplit multi-branch unreachability warningsCurrently, if multiple branches in a case expression are unreachable, a single warning message is emitted:
```haskell
module MultiBranch where
test x = case x of
1 -> 2
_ -> 3
_ -> 4
_ -> 5
_ -> 6
```
```
..\curry-...Currently, if multiple branches in a case expression are unreachable, a single warning message is emitted:
```haskell
module MultiBranch where
test x = case x of
1 -> 2
_ -> 3
_ -> 4
_ -> 5
_ -> 6
```
```
..\curry-playground\MultiBranch.curry, line 4.5: Warning:
Pattern matches are potentially unreachable
In a case alternative:
_
_
_ -> ...
```
It would be nice, however, to split this up into multiple warning messages to provide accurate line information for each branch:
```
..\curry-playground\MultiBranch.curry, line 6.5: Warning:
Pattern match is potentially unreachable
In a case alternative:
_ -> ...
..\curry-playground\MultiBranch.curry, line 7.5: Warning:
Pattern match is potentially unreachable
In a case alternative:
_ -> ...
..\curry-playground\MultiBranch.curry, line 8.5: Warning:
Pattern match is potentially unreachable
In a case alternative:
_ -> ...
```https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/2src/Html/SyntaxColoring.hs: Please clarify copyright situation...2017-05-21T00:32:04ZMike Gabriel mga@informatik.uni-kiel.desrc/Html/SyntaxColoring.hs: Please clarify copyright situation...In the file I see...
Module : $Header$
Description : Split module into code fragments
Copyright : (c) ?? , someone else
2014 - 2016, Björn Peemöller
2016 ...In the file I see...
Module : $Header$
Description : Split module into code fragments
Copyright : (c) ?? , someone else
2014 - 2016, Björn Peemöller
2016 , Jan Tikovsky
License : OtherLicense
Maintainer : bjp@informatik.uni-kiel.de
Stability : experimental
Portability : portable
Please clarify who "someone else" is. Is it a forgotten reminder to fill out the copyright field? Or is there really an unknown co-copyright holder. Ideally simply remove that line/entry in the Copyright: field.
Please include in 0.4.2 release, if possible.
Thanks!Michael HanusMichael Hanushttps://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/83Transform type expressions into weak prenex normal form2020-01-31T12:20:38ZFinn TeegenTransform type expressions into weak prenex normal formAll type signatures in FlatCurry should be transformed into weak prenex normal form (see https://www.microsoft.com/en-us/research/publication/practical-type-inference-for-arbitrary-rank-types/ for a definition). As a side effect, all typ...All type signatures in FlatCurry should be transformed into weak prenex normal form (see https://www.microsoft.com/en-us/research/publication/practical-type-inference-for-arbitrary-rank-types/ for a definition). As a side effect, all type variables would become explicitely quantified. The latter will simplify the translation into Haskell considerably, especially when considering the generation of Curry contexts.Kai ProttKai Protthttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/80Translate user's type annotations correctly2020-01-28T13:51:26ZFinn TeegenTranslate user's type annotations correctlyAlthough currently not relevant due to the lack of support for scoped type variables, a user's type annotation should be transformed correctly during the dictionary translation. Currently, any context gets dropped.Although currently not relevant due to the lack of support for scoped type variables, a user's type annotation should be transformed correctly during the dictionary translation. Currently, any context gets dropped.https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/128Tuple Constructors in Interface Instance Declarations Cause Illegal Instance ...2021-07-01T11:25:35ZLeif-Erik KrügerTuple Constructors in Interface Instance Declarations Cause Illegal Instance Type ErrorsConsider the following module:
```haskell
module TupleConstructorInstance where
class C a where
methodC :: a Bool Bool
instance C (,) where
methodC = (True, False)
testExp :: (Bool, Bool)
testExp = methodC
```
Compiling this mod...Consider the following module:
```haskell
module TupleConstructorInstance where
class C a where
methodC :: a Bool Bool
instance C (,) where
methodC = (True, False)
testExp :: (Bool, Bool)
testExp = methodC
```
Compiling this module works without problems, but using it interactively in PAKCS causes an `Illegal instance type` error:
```
TupleConstructorInstance> testExp
Tests/.curry/pakcs-3.2.0/TupleConstructorInstance.icurry:8:12-8:14 Error:
Illegal instance type (,)
The instance type must be of the form (T u_1 ... u_n),
where T is not a type synonym and u_1, ..., u_n are
mutually distinct, non-anonymous type variables.
|
8 | instance C (,) {
| ^^^
ERROR occurred during parsing!
```
The cause of this error is the `checkTypeConstructor` function in the interface syntax check (only the first part of it is displayed here):
```haskell
checkTypeConstructor :: SpanInfo -> QualIdent -> ISC TypeExpr
checkTypeConstructor spi tc = do
tyEnv <- getTypeEnv
case qualLookupTypeKind tc tyEnv of
[] | not (isQualified tc) -> return $ VariableType spi $ unqualify tc
| otherwise -> do
report $ errUndefinedType tc
return $ ConstructorType spi tc
```
Unlike its counterpart `checkType` in the type syntax check, `checkTypeConstructor` does not have a special case for tuple constructors. You can see the `isQTupleId tc` guard of the `checkType` function here:
```haskell
checkType :: TypeExpr -> TSCM TypeExpr
checkType c@(ConstructorType spi tc) = do
m <- getModuleIdent
tEnv <- getTypeEnv
case qualLookupTypeKind tc tEnv of
[]
| isQTupleId tc -> return c
| not (isQualified tc) -> return $ VariableType spi $ unqualify tc
| otherwise -> report (errUndefinedType tc) >> return c
```
This missing guard in `checkTypeConstructor` means that the instance type `(,)` is identified as a type variable in the interface syntax check. Type variables are not allowed as instance types however, therefore an `Illegal instance type` error is reported.Leif-Erik KrügerLeif-Erik Krügerhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/127Tuple Constructors in Interface Instance Declarations Cause Illegal Instance ...2021-07-06T09:52:08ZLeif-Erik KrügerTuple Constructors in Interface Instance Declarations Cause Illegal Instance Type ErrorsConsider the following module:
```haskell
module TupleConstructorInstance where
class C a where
methodC :: a Bool Bool
instance C (,) where
methodC = (True, False)
testExp :: (Bool, Bool)
testExp = methodC
```
Compiling this mod...Consider the following module:
```haskell
module TupleConstructorInstance where
class C a where
methodC :: a Bool Bool
instance C (,) where
methodC = (True, False)
testExp :: (Bool, Bool)
testExp = methodC
```
Compiling this module works without problems, but using it interactively in PAKCS causes an `Illegal instance type` error:
```
TupleConstructorInstance> testExp
Tests/.curry/pakcs-3.2.0/TupleConstructorInstance.icurry:8:12-8:14 Error:
Illegal instance type (,)
The instance type must be of the form (T u_1 ... u_n),
where T is not a type synonym and u_1, ..., u_n are
mutually distinct, non-anonymous type variables.
|
8 | instance C (,) {
| ^^^
ERROR occurred during parsing!
```
The cause of this error is the `checkTypeConstructor` function in the interface syntax check (only the first part of it is displayed here):
```haskell
checkTypeConstructor :: SpanInfo -> QualIdent -> ISC TypeExpr
checkTypeConstructor spi tc = do
tyEnv <- getTypeEnv
case qualLookupTypeKind tc tyEnv of
[] | not (isQualified tc) -> return $ VariableType spi $ unqualify tc
| otherwise -> do
report $ errUndefinedType tc
return $ ConstructorType spi tc
```
Unlike its counterpart `checkType` in the type syntax check, `checkTypeConstructor` does not have a special case for tuple constructors. You can see the `isQTupleId tc` guard of the `checkType` function here:
```haskell
checkType :: TypeExpr -> TSCM TypeExpr
checkType c@(ConstructorType spi tc) = do
m <- getModuleIdent
tEnv <- getTypeEnv
case qualLookupTypeKind tc tEnv of
[]
| isQTupleId tc -> return c
| not (isQualified tc) -> return $ VariableType spi $ unqualify tc
| otherwise -> report (errUndefinedType tc) >> return c
```
This missing guard in `checkTypeConstructor` means that the instance type `(,)` is identified as a type variable in the interface syntax check. Type variables are not allowed as instance types however, therefore an `Illegal instance type` error is reported.Leif-Erik KrügerLeif-Erik Krügerhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/141Turn case warnings into errors2024-03-26T11:11:27ZMichael HanusTurn case warnings into errorsIn restricted case modes, like `haskell`, warnings are generated for illegal uppercase/lowercases.
These warning should be turned into errors in order to really enforce the case mode.In restricted case modes, like `haskell`, warnings are generated for illegal uppercase/lowercases.
These warning should be turned into errors in order to really enforce the case mode.Fredrik WieczerkowskiFredrik Wieczerkowskihttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/119Type class contexts are ignored for external functions2020-12-08T14:28:04ZFinn TeegenType class contexts are ignored for external functionsDue to the fact that type class context in signatures of external functions are completely ignored during type checking, one could write expressions like `id =:= id` without type error.Due to the fact that type class context in signatures of external functions are completely ignored during type checking, one could write expressions like `id =:= id` without type error.https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/118Type class contexts are missing for external functions in AbstractCurry2020-12-08T14:28:25ZFinn TeegenType class contexts are missing for external functions in AbstractCurryFinn TeegenFinn Teegenhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/43Type signatures are not correctly checked against inferred types with negativ...2020-10-21T10:10:37ZJan-Hendrik MatthesType signatures are not correctly checked against inferred types with negative type variablesThe following Curry program is accepted by the frontend, but it should be rejected due to the dependency of `h` from `g` and `g` from `x` bound on the left-hand side in `f`. Because of the dependencies the type of `h` has to be the same ...The following Curry program is accepted by the frontend, but it should be rejected due to the dependency of `h` from `g` and `g` from `x` bound on the left-hand side in `f`. Because of the dependencies the type of `h` has to be the same as the one from `f`.
```haskell
f :: Eq a => a -> Bool
f x = g x
where
g y = x == y
h :: a -> Bool
h x = g x
```Jan-Hendrik MatthesJan-Hendrik Mattheshttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/77Type variable escapes when encoding existential types2020-07-13T19:14:55ZFinn TeegenType variable escapes when encoding existential typesConsider the following program.
```haskell
{-# LANGUAGE RankNTypes #-}
data Showable = Showable (forall b. (forall a. Show a => a -> b) -> b)
showable x = Showable (\f -> f x)
f :: Showable -> String
f showable = case showable of
...Consider the following program.
```haskell
{-# LANGUAGE RankNTypes #-}
data Showable = Showable (forall b. (forall a. Show a => a -> b) -> b)
showable x = Showable (\f -> f x)
f :: Showable -> String
f showable = case showable of
Showable f -> let k x = show x in f k
```
While this program compiles in GHC, our frontend rejects it with the following error message.
```
Ambiguous type variable _17
in type Prelude.Show _17 => Showable -> [Prelude.Char]
inferred for equation
f showable =
case showable of
Showable f -> let k x = show x in f k
```Jan-Hendrik MatthesJan-Hendrik Mattheshttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/123Type-annotated FlatCurry is not generated if it is the only target2020-12-14T11:08:23ZFinn TeegenType-annotated FlatCurry is not generated if it is the only targetFinn TeegenFinn Teegenhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/39Type-Check fails with internal error for instance declarations with ambiguous...2019-04-04T15:13:23ZKai ProttType-Check fails with internal error for instance declarations with ambiguous funtion namesSuppose you have
```
module A where
import Prelude hiding (id)
class ID a where
id :: a -> a
```
```
module B where
import Prelude
import A
instance ID Int where
id x = x
```
then the Type-Check will fail with an internal erro...Suppose you have
```
module A where
import Prelude hiding (id)
class ID a where
id :: a -> a
```
```
module B where
import Prelude
import A
instance ID Int where
id x = x
```
then the Type-Check will fail with an internal error, instead of reporting the ambiguous identifier.Kai ProttKai Protthttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/106Unqualify built-in types2020-11-27T15:27:40ZFinn TeegenUnqualify built-in typesFinn TeegenFinn Teegenhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/53Update `overview.md`2019-11-08T17:14:25ZKai ProttUpdate `overview.md`https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/91Update the readme file2020-07-21T07:58:54ZFredrik WieczerkowskiUpdate the readme fileThe readme file in this repository has last been updated 15 years ago and does not accurately reflect more recent versions of the frontend. Possible improvements include:
* Converting the file to UTF-8 (the most widely used text encodin...The readme file in this repository has last been updated 15 years ago and does not accurately reflect more recent versions of the frontend. Possible improvements include:
* Converting the file to UTF-8 (the most widely used text encoding)
* Adding build instructions for Cabal
* Translating the text to English for consistency, since the rest of the repository is kept in English (comments, issues, etc)
* Updating references to `cymake` to `curry-frontend`
* Converting the file to Markdown
* Renaming it to `README(.md/.txt)`, so that GitLab displays it on the repository pagehttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/47Usage of non-unique record label yields internal error2019-10-09T06:58:47ZSandra DylusUsage of non-unique record label yields internal errorConsider the following program.
```haskell
data A = A { a_ :: Bool }
data B = B { a_ :: Bool }
```
Loading this program into PAKCS or KiCS2 yields the following (helpful) error message.
```
Test.curry, line 2.14: Error:
More than ...Consider the following program.
```haskell
data A = A { a_ :: Bool }
data B = B { a_ :: Bool }
```
Loading this program into PAKCS or KiCS2 yields the following (helpful) error message.
```
Test.curry, line 2.14: Error:
More than one definition for `a_'
```
If we, however, add the following definition to the Haskell code above and load the file in PAKCS or KiCS2, we get an internal error.
```haskell
crash :: A -> Bool
crash x = a_ x
```
Error message for KiCS2
```
kics2-frontend: Internal error: qualBindTopEnv QualIdent {qidModule = Nothing, qidIdent = Ident {idPosition = Position {file = "Test.curry", line = 2, column = 14}, idName = "a_", idUnique = 0}}
```
Error message for PAKCS
```
pakcs-frontend: Internal error: qualBindTopEnv QualIdent {qidSpanInfo = SpanInfo {srcSpan = Span {file = "Test.curry", start = Position {file = "Test.curry", line = 2, column = 14}, end = Position {file = "Test.curry", line = 2, column = 15}}, srcInfoPoints = [Span {file = "Test.curry", start = Position {file = "Test.curry", line = 2, column = 14}, end = Position {file = "Test.curry", line = 2, column = 15}}]}, qidModule = Nothing, qidIdent = Ident {idSpanInfo = SpanInfo {srcSpan = Span {file = "Test.curry", start = Position {file = "Test.curry", line = 2, column = 14}, end = Position {file = "Test.curry", line = 2, column = 15}}, srcInfoPoints = [Span {file = "Test.curry", start = Position {file = "Test.curry", line = 2, column = 14}, end = Position {file = "Test.curry", line = 2, column = 15}}]}, idName = "a_", idUnique = 0}}
CallStack (from HasCallStack):
error, called at src/Base/Messages.hs:78:21 in main:Base.Messages
```https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/67Use explicit ForallTypes in FlatCurry representation2019-11-25T08:39:32ZFinn TeegenUse explicit ForallTypes in FlatCurry representationIn the FlatCurry representation, the two functions
```id :: a -> a```
and
```id :: forall a. a -> a```
should have the same normalized representation that uses the `ForallType` constructor in both cases.
In general, type variable qu...In the FlatCurry representation, the two functions
```id :: a -> a```
and
```id :: forall a. a -> a```
should have the same normalized representation that uses the `ForallType` constructor in both cases.
In general, type variable quantification should be explicit in the FlatCurry representation and type should be in weak prenex form.Jan-Hendrik MatthesJan-Hendrik Mattheshttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/63Use MultiParamTypeClasses in `Base.Types`2019-10-28T10:31:31ZKai ProttUse MultiParamTypeClasses in `Base.Types`Or at least delete the TODOOr at least delete the TODO