Could not find module in nix-shell

Viewed 791

What could be the reason for missing module?

$ nix-shell -p haskellPackages.ghc -p haskellPackages.random

give following shell

[nix-shell:~]$ ghci 
GHCi, version 8.0.2: http://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /data/works/dotfiles/ghci
Prelude> import System.Random

<no location info>: error:
    Could not find module ‘System.Random’
    It is not a module in the current program, or in any known package.

And what is the nix way to install and use Haskell packages?

I thought nixos.haskellPackages.<package> will automatically registered for ghc but it seem like it is not the case.

Reinstall the random inside the shell don't fix it.

[nix-shell:~]$ nix-env -iA nixos.haskellPackages.random
installing ‘random-1.1’

[nix-shell:~]$ ghc-pkg list | grep -i random
1 Answers
Related