mueval icon indicating copy to clipboard operation
mueval copied to clipboard

mueval fails with "Could not find module ‘ShowFun’" error

Open kseo opened this issue 7 years ago • 4 comments

mueval (09b6a7aa5a25c4115442ea2e6ae0c2db557007f8) fails with the following error message:

<no location info>: error:
    Could not find module ‘ShowFun’
    Use -v to see a list of the files searched for.

kseo avatar Aug 30 '16 15:08 kseo

I'm also getting this error after having installed mueval with Nix. Has any progress been made?

Sophia-Gold avatar Mar 27 '17 16:03 Sophia-Gold

mueval imports some modules by default (see https://github.com/gwern/mueval/blob/master/Mueval/Context.hs#L24-L93), incurring a runtime dependency on several packages (as far as I can see, those packages are show, simple-reflect, QuickCheck, pretty, containers, mtl; these are packages that mueval itself depends on, so in many environments it will just work. Nix is not such an enviroment.)

This default behavior can be overridden using the -n (= --noimport) command line flag, for example: mueval -n -e '[1..10]'. Extra modules can be loaded with -m (= --module).

int-e avatar Jun 14 '17 15:06 int-e

workaround for this:

you need to create a GHC environment file to provide mueval the needed libraries:

  1. cabal init (just to create a .cabal file)
  2. edit it and add the needed libraries, for example:
  build-depends:       base >=4.11 && <4.12
                     , show
                     , simple-reflect
                     , QuickCheck
                     , pretty
                     , containers
                     , mtl
                     , bytestring
  1. build it cabal new-build, this will create the GHC env file
  2. provide the GHC env file to mueval upon execution: GHC_ENVIRONMENT=.ghc.environment.x86_64-linux-8.4.3 mueval -e '(+1) <$> [1..100]'

fnurglewitz avatar Sep 12 '18 11:09 fnurglewitz

For the case of building with stack, I found that stack exec -- myprogram using mueval works fine, but I cannot just copy the executable to somewhere else and execute it directly without stack exec; then I get Could not find module ‘ShowFun’.

nh2 avatar Dec 19 '18 19:12 nh2