Skip to content

Add support for GHC 9.12#227

Open
johannes-riecken wants to merge 5 commits into
justinethier:masterfrom
johannes-riecken:ghc9.12
Open

Add support for GHC 9.12#227
johannes-riecken wants to merge 5 commits into
justinethier:masterfrom
johannes-riecken:ghc9.12

Conversation

@johannes-riecken
Copy link
Copy Markdown

@johannes-riecken johannes-riecken commented Apr 29, 2025

The functions liftIO, liftM and when have to be imported explicitly, as mtl 2.3 removed re-exports. Instead of importing liftM, I've replaced usages with fmap, as that's the more common way to express mapping.

For the FFI module, I took account of API changes in recent versions, while making sure that the code can still compile on older versions.

Tested on GHC versions 8.4.4, 9.6.7 and 9.12.2.

Command:

```
perl -i -pE 'if(/^import / && !$seen){$seen = !!1; $_ = "import Control.Monad.IO.Class (liftIO)\n$_"}if(eof){$seen=!!0}' $(grep -l '\<liftIO\>' **/*.hs)
```
Command:

```
perl -i -pE 's/\bliftM\b/fmap/g' **/*.hs
```
Command:

```
perl -i -pE 'if(/^import / && !$seen){$seen = !!1; $_ = "import Control.Monad (when)\n$_"}' hs-src/Interpreter/shell.hs
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant