curry-frontend merge requestshttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests2020-10-20T14:36:14Zhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/28Provide GHC-like line snippets in messages2020-10-20T14:36:14ZFredrik WieczerkowskiProvide GHC-like line snippets in messages### Fixes #87
This merge request builds on top of !26, depends on curry-base!17 and implements GHC-like line previews in error/warning messages.
Example:
```haskell
data Test a = Test
demo = case 4 of
_ -> 3
_ -> ...### Fixes #87
This merge request builds on top of !26, depends on curry-base!17 and implements GHC-like line previews in error/warning messages.
Example:
```haskell
data Test a = Test
demo = case 4 of
_ -> 3
_ -> 5
```
Output:
```
[2 of 2] Compiling TestThis ( src/TestThis.curry, src/.curry/TestThis.fcy )
src/TestThis.curry:1:11 Warning:
Unreferenced type variable `a'
|
1 | data Test a = Test
| ^
src/TestThis.curry:3:1-3:4 Warning:
Top-level binding with no type signature:
demo :: Prelude.Num a => a
|
3 | demo = case 7 of
| ^^^^
src/TestThis.curry:5:5-5:10 Warning:
Pattern matches are potentially unreachable
In a case alternative:
_ -> ...
|
5 | _ -> 5
| ^^^^^^
```https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/26Provide span information in messages2020-10-20T14:34:45ZFredrik WieczerkowskiProvide span information in messages### Fixes #90
This branch will implement support for spans (instead of just positions) in error and warning messages where possible.
Note that this merge request depends on curry/curry-base!16, which is required for building this b...### Fixes #90
This branch will implement support for spans (instead of just positions) in error and warning messages where possible.
Note that this merge request depends on curry/curry-base!16, which is required for building this branch. Since the `posMessage` function is still available in this version of `curry-base`, these changes (to the frontend) can be applied gradually without breaking the build.
The following checklist tracks the progress. Many changes are fairly straightforward, since identifiers (`Ident`, `QualIdent`, `ModuleIdent`, ...) provide span information and those are used in many places where errors/warnings are generated.
#### To Do
- **General**
- **CurryBuilder**
- [x] `errUnknownOptions`
- [x] `errIllegalOption`
- **Interfaces**
- [x] `errInterfaceNotFound` (span encompasses module identifier)
- [x] `errWrongInterface` (see above)
- [x] `errCyclicImport` (see above)
- **Messages**
- [x] re-export of `posMessage` (removed, being no longer needed)
- **Checks**
- **DeriveCheck**
- [x] `errNoAbstractDerive`
- [x] `errNotDerivable`
- [x] `errNoDataDerive`
- [x] `errNotEnum`
- [x] `errNotBounded`
- **ExportCheck**
- [x] `errAmbiguous`
- [x] `errModuleNotImported`
- [x] `errMultiple`
- [x] `errNotDataTypeOrTypeClass`
- [x] `errOutsideTypeExport`
- [x] `errUndefinedElement`
- [x] `errUndefinedMethod`
- [x] `errUndefined`
- **ExtensionCheck**
- [x] `errUnknownExtension` (along with using a span in `Extension` from `curry-base`)
- **ImportSyntaxCheck**
- [x] `errUndefinedElement`
- [x] `errUndefinedMethod`
- [x] `errUndefinedEntity`
- [x] `errNonDataTypeOrClass`
- [x] `errImportDataConstr`
- **ImpredCheck**
- [x] `errIllegalPolymorphicType`
- [x] `errIllegalDefaultType`
- **InstanceCheck**
- [x] `errMissingInstance`
- **InterfaceCheck**
- [x] `errNotExported` (using type/value identifiers from incorrect declarations)
- [x] `errNoPrecedence` (see above)
- [x] `errNoInstance` (see above)
- [x] `errImportConflict` (see above)
- [x] `errInstanceConflict` (see above)
- **InterfaceSyntaxCheck**
- [x] `errUndefined`
- [x] `errMultipleImplementation`
- [x] `errAmbiguousType` (using `IMethodDecl`'s identifier)
- [x] `errConstrainedClassVariable` (using `IMethodDecl`'s identifier)
- [x] `errNonLinear`
- [x] `errNoVariable`
- [x] `errUnboundVariable`
- [x] `errBadTypeSynonym`
- [x] `errNoElement` (using the invalid constructor's identifier instead of the type's)
- [x] `errIllegalSimpleConstraint`
- [x] `errIllegalInstanceType` (using the identifier the implementor)
- **KindCheck**
- [x] `errRecursiveTypes`
- [x] `errRecursiveClasses`
- [x] `errNonArrowKind` (using the `TypeExpr`s spans)
- [x] `errPartialAlias` (see above)
- [x] `errKindMismatch` (see above)
- **PrecCheck**
- [x] `errUndefinedOperator`
- [x] `errMultiplePrecedence`
- [x] `errInvalidParse`
- [x] `errAmbiguousParse`
- **SyntaxCheck**
- [x] `errUnsupportedFPTerm`
- [x] `errUnsupportedFuncPattern`
- [x] `errFuncPatNotGlobal`
- [x] `errFuncPatCyclic`
- [x] `errPrecedenceOutOfRange`
- [x] `errUndefinedVariable`
- [x] `errUndefinedData`
- [x] `errUndefinedLabel`
- [x] `errUndefinedMethod`
- [x] `errAmbiguous`
- [x] `errDuplicateDefinition`
- [x] `errDuplicateVariables`
- [x] `errMultipleDataConstructor`
- [x] `errMultipleDeclarations`
- [x] `errDuplicateTypeSig`
- [x] `errDuplicateLabel`
- [x] `errNonVariable`
- [x] `errNoBody`
- [x] `errNoCommonCons`
- [x] `errNoLabel`
- [x] `errNoTypeSig`
- [x] `errToplevelPattern`
- [x] `errDifferentArity`
- [x] `errWrongArity`
- [x] `errMissingLanguageExtension`
- [x] `errInfixWithoutParens`
- **TypeCheck**
- [x] `errPolymorphicVar`
- [x] `errTypeSigTooGeneral` (using `TypeExpr`'s span)
- [x] `errMethodTypeTooSpecific` (using `FunctionDecl`'s identifier)
- [x] `errNonFunctionType`
- [x] `errNonBinaryOp`
- [x] `errTypeMismatch`
- [x] `errSubsumption`
- [x] `errIncompatibleLabelType`
- [x] `errMissingInstance`
- [x] `errAmbiguousTypeVariable`
- **TypeSyntaxCheck**
- [x] `errMultipleDefaultDeclarations`
- [x] `errMultipleDeclarations`
- [x] `errMissingLanguageExtension`
- [x] `errUndefined`
- [x] `errAmbiguousIndent`
- [x] `errAmbiguousType`
- [x] `errConstrainedClassVariable`
- [x] `errNonLinear`
- [x] `errNoVariable`
- [x] `errUnboundVariable`
- [x] `errIllegalConstraint`
- [x] `errIllegalSimpleConstraint`
- [x] `errIllegalInstanceType`
- [x] `errIllegalDataInstance`
- **WarnCheck**
- [x] `warnMultiplyImportedModule`
- [x] `warnMultiplyImportedSymbol`
- [x] `warnMultiplyHiddenSymbol`
- [x] `warnDisjoinedFunctionRules`
- [x] `warnOrphanInstance`
- [x] `warnMissingMethodImplementation`
- [x] `warnMissingTypeSignature`
- [x] `warnModuleNameClash`
- [x] `warnAliasNameClash`
- [x] `warnMissingPattern`
- [x] `warnUnreachablePattern`
- [x] `warnNondetOverlapping`
- [x] `warnRedContext`
- [x] `warnCaseMode`
- [x] `warnUnrefTypeVar`
- [x] `warnUnrefVar`
- [x] `warnShadowing`
- [x] `warnTypeShadowing`https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/27Update the readme file2020-07-21T07:58:54ZFredrik WieczerkowskiUpdate the readme file### Fixes #91
This PR provides a rewrite of the readme file, applying the improvements mentioned in the issue.### Fixes #91
This PR provides a rewrite of the readme file, applying the improvements mentioned in the issue.https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/14Add support for higher-rank polymorphism2020-07-13T19:07:49ZJan-Hendrik MatthesAdd support for higher-rank polymorphismThis merge request adds support for higher-rank polymorphism to the frontend.
The extension of the existing type system is based on the paper [*Practical type inference for arbitrary-rank types*](https://doi.org/10.1017/S0956796806006...This merge request adds support for higher-rank polymorphism to the frontend.
The extension of the existing type system is based on the paper [*Practical type inference for arbitrary-rank types*](https://doi.org/10.1017/S0956796806006034) also implemented by Haskell. The new type system is still predicative. An instantiation of type variables with higher-rank types is not allowed. But Curry programmers use the `($)`-operator so much, to avoid writing parentheses, that the extended type inference has an ad-hoc special case for `x $ y` (just like Haskell) that allows it to do type inference for `x $ y`, even when impredicative polymorphism is needed.
Depends on curry/curry-base!9
Work that needs to be done:
* [x] Convert forall types to `AbstractCurry`
* [x] Add `RankNTypes` to the known language extensions of the frontend
* [x] Convert the `TypeScheme` data type into a forall type
* [x] Allow type constraints nested within type expressions
* [x] Implement the new typing rules
* [x] Adapt the checks and transformations
* [x] Detect impredicative polymorphism
* [x] Correct typing of higher-rank functions with predicates
* [x] Add tests for `RankNTypes` to the test suite
Bugs that need to be fixed:
* [x] Prelude.!!: index too large (#40)
* [x] Compilation error (#42)
* [x] Problems with additional constraints for functions inside InstanceDecls (#46)
* [x] Subsumption is not working correctly (#48)Jan-Hendrik MatthesJan-Hendrik Mattheshttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/13Remove support for existential quantified type variables in data type declara...2020-07-13T19:07:49ZJan-Hendrik MatthesRemove support for existential quantified type variables in data type declarationsThis merge request removes support for existential quantified type variables in data type declarations.
Existential quantified type variables are currently not working correctly. So the support will be removed in favor of a cleaner co...This merge request removes support for existential quantified type variables in data type declarations.
Existential quantified type variables are currently not working correctly. So the support will be removed in favor of a cleaner compiler implementation and the upcoming support for arbitrary-rank types.
Depends on curry/curry-base!11
Closes #29Finn TeegenFinn Teegenhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/22Emit correct locations for warnings about unreachable case branches2020-04-01T09:45:23ZFredrik WieczerkowskiEmit correct locations for warnings about unreachable case branches## Fixes #84.
This branch improves warnings for unreachable patterns by referring to the line of the first unreachable branch (rather than the first branch in the case expression). Consider the following example:
```haskell
module...## Fixes #84.
This branch improves warnings for unreachable patterns by referring to the line of the first unreachable branch (rather than the first branch in the case expression). Consider the following example:
```haskell
module Test where
f x = case x of
1 -> 2
_ -> 3
_ -> 4
_ -> 5
```
```
..\curry-playground\Test.curry, line 6.5: Warning:
Pattern matches are potentially unreachable
In a case alternative:
_
_ -> ...
```
Additionally, `fcase` warnings now refer to the first line of the entire expression, not the first branch:
```haskell
module Test where
f x = fcase x of
_ -> True
_ -> False
```
```
..\curry-playground\Test.curry, line 3.7: Warning:
An fcase expression is potentially non-deterministic due to overlapping rules
```https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/16Version32020-02-03T12:06:43ZKai ProttVersion3* Implemented the "MonadFail-Proposal" for curry
(see <https://wiki.haskell.org/MonadFail_Proposal>)
* Data class (see <https://arxiv.org/abs/1908.10607>)
* RankNTypes
* Fixed bug with partially imported Typeclasses
* Fixed bug with pa...* Implemented the "MonadFail-Proposal" for curry
(see <https://wiki.haskell.org/MonadFail_Proposal>)
* Data class (see <https://arxiv.org/abs/1908.10607>)
* RankNTypes
* Fixed bug with partially imported Typeclasses
* Fixed bug with parsing of empty blocks
* Fixed bug with re-export of record labelshttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/21Fix guarded wildcard case warnings2020-02-03T12:06:42ZFredrik WieczerkowskiFix guarded wildcard case warningsThis branch addresses the issue #16 by considering wildcard patterns to be non-exhaustive if guarded.
Thus the following code snippet will still emit a warning (second branch exhausts all possible cases):
```haskell
f x = case x of
...This branch addresses the issue #16 by considering wildcard patterns to be non-exhaustive if guarded.
Thus the following code snippet will still emit a warning (second branch exhausts all possible cases):
```haskell
f x = case x of
_ | False -> False
_ -> True
_ -> False
```
This snippet, however, will not:
```haskell
f x = case x of
_ | False -> False
_ -> True
```
The implementation applies a basic heuristic to determine whether a guard is always true: It checks whether it contains `True`, `success` or `otherwise`. Thus the following definition _will_ emit a warning:
```haskell
f x = case x of
_ | True -> False
_ -> True
```https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/20Add Kind information to explicitly bound type variables2020-01-28T10:07:28ZKai ProttAdd Kind information to explicitly bound type variablesDepends on https://git.ps.informatik.uni-kiel.de/curry/curry-base/merge_requests/15Depends on https://git.ps.informatik.uni-kiel.de/curry/curry-base/merge_requests/15Kai ProttKai Protthttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/17Add support for the `ExplicitForAll` language extension2019-11-19T14:06:36ZJan-Hendrik MatthesAdd support for the `ExplicitForAll` language extensionThis merge request adds support for the `ExplicitForAll` language extension so that type variables can be quantified explicitly with the `forall` keyword at the beginning of a type signature.
Depends on curry/curry-base!13
Closes #66This merge request adds support for the `ExplicitForAll` language extension so that type variables can be quantified explicitly with the `forall` keyword at the beginning of a type signature.
Depends on curry/curry-base!13
Closes #66https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/15Add support for dark mode in the HTML output2019-11-01T16:06:55ZJan-Hendrik MatthesAdd support for dark mode in the HTML outputThis merge request adds support for dark mode in the HTML output of the frontend.
![HTML output with dark mode enabled](/uploads/6ff041b236173d47fdc411ddf8cf0bb7/dark_mode.png)This merge request adds support for dark mode in the HTML output of the frontend.
![HTML output with dark mode enabled](/uploads/6ff041b236173d47fdc411ddf8cf0bb7/dark_mode.png)Finn TeegenFinn Teegenhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/12Add config file for stylish-haskell2019-04-25T13:48:28ZJan-Hendrik MatthesAdd config file for stylish-haskellThis merge request adds a config file for [stylish-haskell](https://github.com/jaspervdj/stylish-haskell/) to automatically format the source code.This merge request adds a config file for [stylish-haskell](https://github.com/jaspervdj/stylish-haskell/) to automatically format the source code.Finn TeegenFinn Teegenhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/11Modernize the HTML output2019-04-25T13:48:05ZJan-Hendrik MatthesModernize the HTML outputThis merge request modernizes the HTML output of the frontend.This merge request modernizes the HTML output of the frontend.Finn TeegenFinn Teegenhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/10Fix Type-Check for instance declarations with ambiguous funtion names2019-04-04T15:13:23ZKai ProttFix Type-Check for instance declarations with ambiguous funtion namesFixes https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/issues/39Fixes https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/issues/39Finn TeegenFinn Teegenhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/9Fix incorrect typecheck for typeclasses2019-01-16T13:49:42ZKai ProttFix incorrect typecheck for typeclassesWhen a typeclass was not imported from the original module, looking up the type of any class method would fail.
All tests passed.
Also removes some whitespace.When a typeclass was not imported from the original module, looking up the type of any class method would fail.
All tests passed.
Also removes some whitespace.Finn TeegenFinn Teegenhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/8Add SpanInfos to AST2018-11-13T15:03:59ZKai ProttAdd SpanInfos to ASTFinn TeegenFinn Teegenhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/6Remove duplicate warnings for top-level patterns2018-07-11T14:37:37ZKai ProttRemove duplicate warnings for top-level patternsfixes #25fixes #25Finn TeegenFinn Teegenhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/3curry-frontend.cabal: Post-release version fix in .cabal file.2017-10-18T12:55:20ZMike Gabriel mga@informatik.uni-kiel.decurry-frontend.cabal: Post-release version fix in .cabal file.Unfortunately, there were more locations in curry-frontend.cabal that needed to be bump to 0.4.2 prior to tagging this repo with v0.4.2. Before 0.4.3 release similar changes need to be applied to curry-frontend.cabal. (Basically a sed -e...Unfortunately, there were more locations in curry-frontend.cabal that needed to be bump to 0.4.2 prior to tagging this repo with v0.4.2. Before 0.4.3 release similar changes need to be applied to curry-frontend.cabal. (Basically a sed -e 's/== 0.4.2/== 0.4.3/g' -i curry-frontend.cabal).Michael HanusMichael Hanushttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/2file headers: Replace non-license name OtherLicense by the license name of wh...2017-10-18T12:55:20ZMike Gabriel mga@informatik.uni-kiel.defile headers: Replace non-license name OtherLicense by the license name of what ……is found in the LICENSE file.
Please merge this proposed changes and release 0.4.2 of curry-frontend. Similar to what we did for curry-base prior to the official Debian upload.
Greets,
Mike…is found in the LICENSE file.
Please merge this proposed changes and release 0.4.2 of curry-frontend. Similar to what we did for curry-base prior to the official Debian upload.
Greets,
MikeMichael HanusMichael Hanus