curry-frontend merge requestshttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests2018-11-13T15:03:59Zhttps://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/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/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/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/55Add NoDataDeriving language extension2022-07-08T08:10:51ZFredrik WieczerkowskiAdd NoDataDeriving language extensionThis branch adds the new language extension `NoDataDeriving` for disabling the implicit deriving of `Prelude.Data` instances. For example, the following program will no longer compile:
```curry
{-# LANGUAGE NoDataDeriving #-}
data X = ...This branch adds the new language extension `NoDataDeriving` for disabling the implicit deriving of `Prelude.Data` instances. For example, the following program will no longer compile:
```curry
{-# LANGUAGE NoDataDeriving #-}
data X = A | B
data Y
requireData :: Data a => a
requireData = failed
main :: IO ()
main = do
return (requireData :: X)
return (requireData :: Y)
return ()
```
```
Error:
Missing instance for Prelude.Data X
in explicitly typed expression
requireData
Error:
Missing instance for Prelude.Data Y
in explicitly typed expression
requireData
```
The idea behind making this a language extension (instead of e.g. a simple flag) is that is similar in spirit to `NoImplicitPrelude` and that it changes core language semantics. Additionally this opens up the possibility of having `NoImplicitPrelude` imply `NoDataDeriving` in the future.Finn TeegenFinn Teegenhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/54Implement warning for shadowed imported names (-Wimport-name-shadowing)2022-11-22T10:19:41ZFredrik WieczerkowskiImplement warning for shadowed imported names (-Wimport-name-shadowing)### Fixes #133
Consider the module:
```curry
import Data.List (last)
f :: a -> a
f failed = failed
g :: a -> a
g f = f
h :: a -> a
h last = last
local :: a -> a
local x = let y = x in let x = y in x
```
Currently we get:
```
src...### Fixes #133
Consider the module:
```curry
import Data.List (last)
f :: a -> a
f failed = failed
g :: a -> a
g f = f
h :: a -> a
h last = last
local :: a -> a
local x = let y = x in let x = y in x
```
Currently we get:
```
src/Shadow.curry:9:3 Warning:
Shadowing symbol `f', bound at: src/Shadow.curry, line 6.1
|
9 | g f = f
| ^
src/Shadow.curry:15:28 Warning:
Shadowing symbol `x', bound at: src/Shadow.curry, line 15.7
|
15 | local x = let y = x in let x = y in x
|
```
With `-Wimport-name-shadowing` as implemented in this branch (or `-Wall`) we now additionally get:
```
src/Shadow.curry:6:3-6:8 Warning:
Shadowing symbol `failed', bound at: /Users/fredrik/git/kics2/lib/.curry/Prelude.icurry, line 227.1
|
6 | f failed = failed
| ^^^^^^
src/Shadow.curry:12:3-12:6 Warning:
Shadowing symbol `last', bound at: /Users/fredrik/git/kics2/lib/.curry/Data/List.icurry, line 32.1
|
12 | h last = last
| ^^^^
```
To do:
- [x] Add flag
- [x] Implement warning in `WarnCheck`
- [x] Add test case
This warning is currently disabled by default, is this okay? (I'd argue that it's useful enough to be enabled in general, but would be fine either way)