1

I code haskell of poor quality in december each year. This year my environment is broken for some reason.

When I try to run my old scripts with

runhaskell .\myCode.hs

I get

Could not find module `Data.List.Split'
Use -v to see a list of the files searched for.

This question has a comment in one of the answers:

Maybe he doesn't even use a .cabal or .yaml file and only wants to write a stand-alone Haskell script for runhaskell.

That is exactly what I'm after, but the comment thread does not provide an answer. It worked 2016-2018 and I do not remember this issue, and I've never had the setup that is written about here or here("hidden modules").

Anyone have an idea how to fix this?

Edit: I tried the guide here which says to download the package, extract it and run:

runhaskell Setup configure
runhaskell Setup build
runhaskell Setup install

But I just get an error which says:

$ runhaskell Setup configure
Configuring split-0.2.3.3...
Setup: Encountered missing dependencies:
base <4.12

And I do have a Haskell\8.6.3\lib\base-4.12.0.0 in the installation.

1
  • base <4.12 says that it's looking for a version of base that is older than 4.12. You have 4.12, which is too new: the version of split you have has apparently not been tested against that version of base, or has been tested and found to be incompatible. The current version of split wants base <4.14, which it looks like you have. So I'd say you're trying to install a too-old version of split. Commented Dec 4, 2019 at 20:19

2 Answers 2

1

Data.List.Split is not part of "base", the core libraries that are distributed with Haskell. It is part of an external package named "split". If you want to use it, you must get that package somehow. This is typically done with cabal or stack. Perhaps there is a way to do this that runhaskell understands; I don't know anything about runhaskell.

Sign up to request clarification or add additional context in comments.

3 Comments

Not at home right now, but I think 'Using libraries' section of the following article might be what I need, I have hope: wiki.haskell.org/Learn_Haskell_in_10_minutes
Those instructions look more error-prone than just installing stack and using an ordinary stack project. Have you considered upgrading to a more-than-one-file setup?
Maybe that'd be best, I'm just haunted by the 'this worked perfectly fine before'-ghost. Maybe it's an illusion that fixing it is the easiest way forward.
0

Ok so after following the instructions to do things manually, I double checked that I had the latest split package. The web page says the package requires base (<4.14) but it still complains Setup: Encountered missing dependencies: base <4.12 when I try to run runhaskell Setup configure

But then after I've tried and failed to install an older 'base', seemed like a long shot anyway, I simply followed the 'Installing packages using cabal' part of the guide.

cabal update
cabal install split

I ran those two commands and ignored the warnings that it was part of the legacy v1 cabal usage. It worked and it installed split so the runhaskell command could access it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.