curry-frontend merge requestshttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests2022-11-22T10:25:35Zhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/51Add CI pipeline2022-11-22T10:25:35ZFredrik WieczerkowskiAdd CI pipelineThis branch adds a CI pipeline that builds the frontend using the Haskell Docker image.
Note that CI/CD would have to be enabled in the repository settings for this to work.
To do:
- [x] Build in CI
- [x] Run test suite in CIThis branch adds a CI pipeline that builds the frontend using the Haskell Docker image.
Note that CI/CD would have to be enabled in the repository settings for this to work.
To do:
- [x] Build in CI
- [x] Run test suite in CIhttps://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/52Make stack path configurable in Makefile2022-11-22T10:21:52ZFredrik WieczerkowskiMake stack path configurable in MakefileThis branch makes the path to the `stack` binary (and potential default flags) configurable, without changing any defaults. Especially for KiCS2 this could potentially be useful to use the exact same Stack configuration to build both the...This branch makes the path to the `stack` binary (and potential default flags) configurable, without changing any defaults. Especially for KiCS2 this could potentially be useful to use the exact same Stack configuration to build both the frontend and KiCS2 (reducing the number of duplicate GHC installs, packages, etc.)https://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)https://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/49Update to GHC 8.102021-12-14T15:03:43ZFredrik WieczerkowskiUpdate to GHC 8.10Aside from a minor update of the `template-haskell` dependency, this update requires no changes to the project or its dependencies.
With GHC 8.10 the Curry frontend can now be built natively on ARM64 macOS (Apple Silicon), since Stack n...Aside from a minor update of the `template-haskell` dependency, this update requires no changes to the project or its dependencies.
With GHC 8.10 the Curry frontend can now be built natively on ARM64 macOS (Apple Silicon), since Stack now [provides bindists for this platform](https://github.com/commercialhaskell/stackage-content/blob/76791eb1b94a0f6e5122100dbffc63e5bb4c9e16/stack/stack-setup-2.yaml#L1428-L1446).https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/38Add parameter for output directory2020-11-06T16:00:34ZFredrik WieczerkowskiAdd parameter for output directory### Fixes #97
This branch adds an `--outdir` parameter (aliased to `-o`) that lets the user override the default `.curry` directory for compilation artifacts. Additionally, it makes the terminology slightly more consistent (by referrin...### Fixes #97
This branch adds an `--outdir` parameter (aliased to `-o`) that lets the user override the default `.curry` directory for compilation artifacts. Additionally, it makes the terminology slightly more consistent (by referring to this directory as `outDir` rather than `currySubdir`).https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/37Improve message spans in TypeCheck2020-10-30T12:28:12ZFredrik WieczerkowskiImprove message spans in TypeCheck### Fixes #93
This branch improves the messages from the TypeCheck by always using the span from the innermost expression in which the type error occurred.
Consider the example from the issue that now emits the following error message...### Fixes #93
This branch improves the messages from the TypeCheck by always using the span from the innermost expression in which the type error occurred.
Consider the example from the issue that now emits the following error message:
```
1:8-1:24 Error:
Type error in application
not (f True True)
Term: (f True True)
Inferred type: [Prelude.Char]
Expected type: Prelude.Bool
Types Prelude.Bool and [Prelude.Char] are incompatible
|
1 | test = not (f True True)
| ^^^^^^^^^^^^^^^^^
```
Nested expressions now also yield a better span:
```haskell
test = 23 + (3 * True) / 4
```
```
1:14-1:21 Error:
Missing instance for Prelude.Num Prelude.Bool
in infix application
3 * True
Term: True
|
1 | test = 23 + (3 * True) / 4
| ^^^^^^^^
```https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/35Improve multi-line span previews2020-10-28T13:35:40ZFredrik WieczerkowskiImprove multi-line span previews### Based on !34.
Improve multi-line previews in warning/error messages. Consider the following example snippet (the highlighted part is in parentheses):
```
This [is a sample
sentence.] 12345678
```
Current:
```
This is a sample
sen...### Based on !34.
Improve multi-line previews in warning/error messages. Consider the following example snippet (the highlighted part is in parentheses):
```
This [is a sample
sentence.] 12345678
```
Current:
```
This is a sample
sentence. 12345678
^^^^
```
Proposed:
```
This is a sample
^^^^^^^^^^^...
```https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/merge_requests/34Merge curry-base2020-11-12T16:02:01ZFredrik WieczerkowskiMerge curry-base### Fixes #70 and #88
This branch...
* merges [`curry-base`](https://git.ps.informatik.uni-kiel.de/curry/curry-base)
* splits the frontend into a library and an executable target
* adds the Makefile and the Stack configuration that was...### Fixes #70 and #88
This branch...
* merges [`curry-base`](https://git.ps.informatik.uni-kiel.de/curry/curry-base)
* splits the frontend into a library and an executable target
* adds the Makefile and the Stack configuration that was previously duplicated between [`pakcs`](https://git.ps.informatik.uni-kiel.de/curry/pakcs) and [`kics2`](https://git.ps.informatik.uni-kiel.de/curry/kics2)
Having this new module structure provides several advantages:
* Combining `curry-base` and `curry-frontend` in a single repository simplifies the build process, since compiler repositories can now integrate the frontend using a single submodule
* Cleanly separating executable, library and test targets makes dependency management much easier since the test target no longer has to reenumerate all source modules
* Having a separate library target makes it easy to embed the frontend into third-party applications, e.g. language servershttps://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/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.