curry-frontend issueshttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues2019-10-07T16:14:18Zhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/44Avoid use of absolute path names for style file copying2019-10-07T16:14:18ZMichael HanusAvoid use of absolute path names for style file copyingWhen somebody installs PAKCS with the pre-compiled frontend binary,
HTML generation does not work:
> bin/pakcs-frontend --html -i lib Prelude.curry
[1 of 1] Compiling Prelude ( lib/Prelude.curry, Prelude_curry.html )
...When somebody installs PAKCS with the pre-compiled frontend binary,
HTML generation does not work:
> bin/pakcs-frontend --html -i lib Prelude.curry
[1 of 1] Compiling Prelude ( lib/Prelude.curry, Prelude_curry.html )
Error:
Could not copy CSS style file:
File `/net/medoc/home/pakcs/debian-09-amd64/pakcs/frontend/pkg/share/x86_64-linux-ghc-8.4.3/curry-frontend-1.0.4/currysource.css' does not exist
It seems that the absolute path is part of the binary.https://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/42[RankNTypes] Compilation error2019-07-30T23:03:19ZFinn Teegen[RankNTypes] Compilation errorUsing the most recent version including arbitrary rank types, compilation of the PAKCS' toolsuite results in an error. The last lines of the log file are given below.
```
[40 of 62] Compiling Analysis.RightLinearity ( /home/fte/Project...Using the most recent version including arbitrary rank types, compilation of the PAKCS' toolsuite results in an error. The last lines of the log file are given below.
```
[40 of 62] Compiling Analysis.RightLinearity ( /home/fte/Projects/University/higher-rank-polymorphism/currytools/optimize/.cpm/packages/cass-analysis/src/Analysis/RightLinearity.curry, /home/fte/Projects/University/higher-rank-polymorphism/currytools/optimize/.cpm/packages/cass-analysis/src/.curry/Analysis/RightLinearity.fcy )
/home/fte/Projects/University/higher-rank-polymorphism/currytools/optimize/.cpm/packages/cass-analysis/src/Analysis/RightLinearity.curry, line 59.1: Error:
Ambiguous type variable _39
in type Prelude.Eq _39 => FlatCurry.Types.Expr ->
Prelude.Maybe [Prelude.Int]
inferred for equation
linearVariables (Comb _ f es)
| (f == ("Prelude", "?")) && (length es == 2) =
linearVariables (Or (head es) (head (tail es)))
| otherwise =
mapMMaybe linearVariables es >>-
(\esvars ->
let vars = concat esvars
in if nub vars == vars then Just vars else Nothing)
/home/fte/Projects/University/higher-rank-polymorphism/currytools/optimize/.cpm/packages/cass-analysis/src/Analysis/RightLinearity.curry, line 70.1: Error:
Ambiguous type variable _85
in type Prelude.Eq _85 => FlatCurry.Types.Expr ->
Prelude.Maybe [Prelude.Int]
inferred for equation
linearVariables (Let bs e) =
mapMMaybe linearVariables (map snd bs) >>-
(\bsvars ->
linearVariables e >>-
(\evars ->
let vars = concat (evars : bsvars)
in if nub vars == vars
then Just (vars \\ (map fst bs))
else Nothing))
ERROR occurred during parsing!
Makefile:29: recipe for target 'BindingOpt' failed
make[3]: *** [BindingOpt] Error 1
make[3]: Leaving directory '/home/fte/Projects/University/higher-rank-polymorphism/currytools/optimize'
Makefile:163: recipe for target 'kernel' failed
make[2]: *** [kernel] Error 2
make[2]: Leaving directory '/home/fte/Projects/University/higher-rank-polymorphism'
Makefile:155: recipe for target 'build' failed
make[1]: *** [build] Error 2
make[1]: Leaving directory '/home/fte/Projects/University/higher-rank-polymorphism'
Make process logged in file make.log
```Jan-Hendrik MatthesJan-Hendrik Mattheshttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/41Error when compiling a class definition with `NoImplicitPrelude`2019-10-07T16:20:36ZJan-Hendrik MatthesError when compiling a class definition with `NoImplicitPrelude`Compiling the following Curry program with the frontend
```haskell
{-# LANGUAGE NoImplicitPrelude #-}
class A a where
funA :: a -> a
```
produces the following error message.
```
curry-frontend: Internal error: Dictionary.funType Q...Compiling the following Curry program with the frontend
```haskell
{-# LANGUAGE NoImplicitPrelude #-}
class A a where
funA :: a -> a
```
produces the following error message.
```
curry-frontend: Internal error: Dictionary.funType QualIdent {qidSpanInfo = SpanInfo {srcSpan = Span {file = "", start = NoPos, end = NoPos}, srcInfoPoints = []}, qidModule = Just (ModuleIdent {midSpanInfo = NoSpanInfo, midQualifiers = ["Prelude"]}), qidIdent = Ident {idSpanInfo = NoSpanInfo, idName = "error", idUnique = 0}}
```
The problem is a result of the default implementation of the class method `funA`, which uses the `error` function from the `Prelude`. But the `Prelude` is not available due to the language extension `NoImplicitPrelude`.https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/40[RankNTypes] Prelude.!!: index too large2019-07-25T09:39:05ZKai Prott[RankNTypes] Prelude.!!: index too largeThe following (simplified) program compiles correctly:
```haskell
{-# LANGUAGE RankNTypes #-}
newtype ParcurryT m a = ParcurryT {
runP :: forall r . (() -> r) -> m a
}
```
as soon as we try to use `runP`, the frontend fails with `Prel...The following (simplified) program compiles correctly:
```haskell
{-# LANGUAGE RankNTypes #-}
newtype ParcurryT m a = ParcurryT {
runP :: forall r . (() -> r) -> m a
}
```
as soon as we try to use `runP`, the frontend fails with `Prelude.!! index too large`.
Just add:
```
test = runP
```
Note:
* If we desugar the `RecordConstructor` to a "normal" one and add an explicit function for runP, the problem still exists.
* Using `data` instead of `newtype` makes no difference.Jan-Hendrik MatthesJan-Hendrik Mattheshttps://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/38Missing span when re-exporting module2019-03-29T11:10:24ZKai ProttMissing span when re-exporting moduleExportModule declarations should have one entry in srcInfoPoints (the location of the "module" keyword),
but currently the list is empty. This should be an easy fix.
Example
`module Test (module Prelude) where`
has
`SpanInfo (Span (...ExportModule declarations should have one entry in srcInfoPoints (the location of the "module" keyword),
but currently the list is empty. This should be an easy fix.
Example
`module Test (module Prelude) where`
has
`SpanInfo (Span (Pos 1 14) (Pos 1 27)) []`
as SpanInfo for the module-export,
whereas it should be
`SpanInfo (Span (Pos 1 14) (Pos 1 27)) [Span (Pos 1 14) (Pos 1 19)]`Kai ProttKai Protthttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/37Add support for MonadFail in desugaring of do-notation2019-11-08T17:14:36ZKai ProttAdd support for MonadFail in desugaring of do-notation[MonadFail Proposal](https://wiki.haskell.org/MonadFail_Proposal)
In ghc-8.6 and later `do (a,b) <- action; return b` has type `Monad m => m a` (Pattern match cannot fail)
and `do (1,b) <- action; return b` has ...[MonadFail Proposal](https://wiki.haskell.org/MonadFail_Proposal)
In ghc-8.6 and later `do (a,b) <- action; return b` has type `Monad m => m a` (Pattern match cannot fail)
and `do (1,b) <- action; return b` has type `MonadFail m => m a` (Pattern match can fail)
but `action >>= \(1,b) -> return b` has type `Monad m => m a`
Issues:
- Without MonadFail the second and third example could be considered equivalent, with MonadFail they are not.
But even now, the second example would have been equal to `fail` if the pattern match failed, whereas the second would have been a
"non-exhaustive pattern match".
https://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/35Error or fail for missing class methods?2019-10-28T10:21:55ZKai ProttError or fail for missing class methods?Currently `error` is used when a missing class method is used, but i would have assumed that this should just be a failure.Currently `error` is used when a missing class method is used, but i would have assumed that this should just be a failure.https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/34Problems with modular Prelude2019-10-07T16:20:37ZKai ProttProblems with modular PreludeIt is not sufficient to just prevent the removal of unused imports for specific modules (critical modules will probably not be imported directly in the first place).
Thus, the current solution is not sufficient.
An alternative would be t...It is not sufficient to just prevent the removal of unused imports for specific modules (critical modules will probably not be imported directly in the first place).
Thus, the current solution is not sufficient.
An alternative would be to import every base module implicitly (like the Prelude).
*NoImplicitPrelude* would then be changed to prevent implicit import for every non-critical module.
| Module | Needed for (desugaring of) ... | Critical ? |
| ------ | ------ | ------ |
| Base.Eq | deriving of Eq | No |
| Base.Ord | deriving of Ord | No |
| Base.Enum | deriving of Enum | No |
| Base.Read | deriving of Read | No |
| Base.Show | deriving of Show | No |
| Base.Num | defaulting of Numerical types | No? |
| Base.Fractional | defaulting of Numerical types | No? |
| Base.Monad | desugaring of do-Notation | No? |
| Base.Types | Built-in datatypes | Yes |
| Base.Internal | desugaring of *FunctionalPatterns*, *Let* in PACKS | Yes |
| Base.Failed | desugaring of non-exhaustive Patterns | Yes |
| Base.Error | missing class methods | Yes |
| Base.Function | id is needed for desugaring of Newtypes, flip in acy | Yes |
| Base.Bool | ifThenElse is needed for desugaring of if in acy | No (with acy changes) |
| Base.List | (++) is needed for desugaring of ListCompr and to derive Read | No? |https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/33Refactor addition of built-in types to compiler environments2018-12-20T13:19:38ZKai ProttRefactor addition of built-in types to compiler environmentsSome of the compiler environments contain values for all built-in types.
It is unclear, whether or not this is needed everywhere.
Do they have to be qualified with the corresponding original name?
Additionally the types and constructors...Some of the compiler environments contain values for all built-in types.
It is unclear, whether or not this is needed everywhere.
Do they have to be qualified with the corresponding original name?
Additionally the types and constructors are inserted into the generated FlatCurry for the Prelude.
This is not the case for iCurry and AbstractCurry.https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/32Show an error when desugaring of language constructs fails2019-11-08T17:14:00ZKai ProttShow an error when desugaring of language constructs failsThe frontend throws an internal error when de-sugaring something to a function that is not in scope.
This can happen if the Prelude is not imported entirely (or not at all via NoImplicitPrelude).The frontend throws an internal error when de-sugaring something to a function that is not in scope.
This can happen if the Prelude is not imported entirely (or not at all via NoImplicitPrelude).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/30Refactor implicit Prelude-Import2018-12-17T10:54:05ZKai ProttRefactor implicit Prelude-ImportWhen a module does not explicitly import the Prelude, the frontend currently inserts an explicit import into the AST.
This leads to a "wrong" output for the AST-Target.
Instead of adding the Prelude as an Import in the AST, it is suffic...When a module does not explicitly import the Prelude, the frontend currently inserts an explicit import into the AST.
This leads to a "wrong" output for the AST-Target.
Instead of adding the Prelude as an Import in the AST, it is sufficient to add it as an Import in FlatCurry (and AbstractCurry?),
as well as directly enriching all environments with the entities from the Prelude .https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/29Remove the `ExistentialQuantification` extension2019-05-19T14:57:15ZKai ProttRemove the `ExistentialQuantification` extensionThis includes:
- Simplifying the type schemes
- Removing the `ExistentialQuantification` extension
- Removing support in the parser
- Removing existential quantified type variables and type contexts from the internal data type re...This includes:
- Simplifying the type schemes
- Removing the `ExistentialQuantification` extension
- Removing support in the parser
- Removing existential quantified type variables and type contexts from the internal data type representations
This will be closed with curry/curry-base!11 and !13.Jan-Hendrik MatthesJan-Hendrik Mattheshttps://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/26Fix desugaring of record patterns2018-10-09T16:15:37ZFinn TeegenFix desugaring of record patternsConsider the following program.
```
data Car = Car {company :: String, model :: String, year :: Int}
main =
let
rec = Car {company="Ford", model="Mustang", year=1967}
rec2 = Car {company="Toyota", model="Camry", year=1997}
...Consider the following program.
```
data Car = Car {company :: String, model :: String, year :: Int}
main =
let
rec = Car {company="Ford", model="Mustang", year=1967}
rec2 = Car {company="Toyota", model="Camry", year=1997}
Car { company = companyVar } = rec
Car { company = companyVar2 } = rec2
in
rec
```
Compiling the program above leads to an internal error.
```
[2 of 2] Compiling test ( test.curry, .curry/test.fcy )
pakcs-frontend: Internal error: qualBindTopEnv QualIdent {qidModule =
Nothing, qidIdent = Ident {idPosition = NoPos, idName = "_", idUnique
= 0}}
CallStack (from HasCallStack):
error, called at src/Base/Messages.hs:78:21 in main:Base.Messages
ERROR occurred during parsing!
```Finn TeegenFinn Teegenhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues/25Duplicate error message for top-level patterns2018-07-11T23:23:09ZKai ProttDuplicate error message for top-level patterns```haskell
Same 0 = 9
data Same a = Same a
```
leads to two duplicate
> Pattern declaration not allowed at top-level
errors```haskell
Same 0 = 9
data Same a = Same a
```
leads to two duplicate
> Pattern declaration not allowed at top-level
errorsKai ProttKai Prott