moocfi / haskell-mooc

Haskell MOOC University of Helsinki
Other
307 stars 414 forks source link

Update the packages to modern Haskell #66

Closed RichardJECooke closed 9 months ago

RichardJECooke commented 1 year ago

Set14a.hs is really problematic. The exercise tells you to consult the documentation, which offers functions like isValidUtf8 and decodeUtf8Lenient. But if you try to use them you see the packages MOOC uses are years out of date.

So now it's not only about trying to learn Haskell, but also figuring out which versions of which functions of which package MOOC supports. Highly frustrating and unnecessarily time consuming.

Please update the exercises and tests to the latest version of Haskell. I tried to do it myself to make a pull request, but couldn't figure out how to fix the build.

opqdonut commented 1 year ago

Thanks for the feedback!

I've tried to carefully always link to the right version of the docs from the course material, but perhaps I should also add a note telling students to check the version when googling docs.

Section 4.7 also mentions the stack haddock tool which gives you the right version of the library docs. I should probably link to this section as well from lecture 14.

Currently the Haskell version used on the course is kept back by the infrastructure that runs the tests on our servers. We hope to be able to upgrade to GHC 9 soon.

ulysses4ever commented 1 year ago

Thank you for the MOOC! It would be great to prioritize this issue of upgrading GHC because people on Apple M1 chip (only supported by latest GHCs) are held back. See e.g. this Reddit thread.

Bodigrim commented 1 year ago

@opqdonut How do you feel about picking up https://github.com/Bodigrim/haskell-mooc/commit/0fc9a262c132199ef643bc8f68470e1b103c4743? This would make the course compilable with GHC 9.2 for those who are adventurous enough to bump Stackage snapshot.

opqdonut commented 1 year ago

I've fixed the code in master so that it works for both GHC 8 and GHC 9. I've additionally pushed a ghc-9 branch that updates stack.yaml and tests.cabal to use GHC 9.2.

Documented here: https://github.com/moocfi/haskell-mooc/#apple-silicon-mac-support

We hope to be able to update the course server to use GHC 9.2 soon as well.

asarkar commented 10 months ago

I'm on a Mac M1. The discussion above concerns me that the course server is running dated Ghc. I've not started the course yet, and to avoid frustration, would like confirmation that that the course server has been updated and people using Mac Silicon can take this course successfully.

opqdonut commented 10 months ago

Even though the server is running a slightly older GHC, you can still use a newer one on your machine. The exercises only use simple Haskell constructs, so your answers will work the same on GHC 8 & GHC 9.

asarkar commented 10 months ago

I confirm that I'm able to work on the exercises locally using the ghc-9 branch, and so far have successfully submitted all exercises till Lecture 3.

opqdonut commented 9 months ago

The course uses GHC 9.2.8 now!