Search code examples
haskellutf-8cabalpurescript

System.IO.UTF8 not found (installing PureScript)


I'm trying to install PureScript on Ubuntu 14.04. I have the latest version of Haskell-Platform and have run cabal update. During cabal install purescript I get an error saying that the module System.IO.UTF8 is not found. Googling reveals that this is part of utf8-string and should be one of the exposed modules when that package is installed.

However, when I install it, no such package is available:

ely@eschaton:~$ cabal update
Downloading the latest package list from hackage.haskell.org
ely@eschaton:~$ cabal --reinstall install utf8-string
Resolving dependencies...
In order, the following will be installed:
utf8-string-1 (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Configuring utf8-string-1...
Building utf8-string-1...
Preprocessing library utf8-string-1...
[1 of 5] Compiling Codec.Binary.UTF8.String ( Codec/Binary/UTF8/String.hs, dist/build/Codec/Binary/UTF8/String.o )
[2 of 5] Compiling Codec.Binary.UTF8.Generic ( Codec/Binary/UTF8/Generic.hs, dist/build/Codec/Binary/UTF8/Generic.o )
[3 of 5] Compiling Data.String.UTF8 ( Data/String/UTF8.hs, dist/build/Data/String/UTF8.o )
[4 of 5] Compiling Data.ByteString.UTF8 ( Data/ByteString/UTF8.hs, dist/build/Data/ByteString/UTF8.o )
[5 of 5] Compiling Data.ByteString.Lazy.UTF8 ( Data/ByteString/Lazy/UTF8.hs, dist/build/Data/ByteString/Lazy/UTF8.o )
In-place registering utf8-string-1...
Installing library in /home/ely/.cabal/lib/utf8-string-1/ghc-7.6.3
Registering utf8-string-1...
Installed utf8-string-1
ely@eschaton:~$ ghci
GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> import System.IO.UTF8

<no location info>:
    Could not find module `System.IO.UTF8'
    It is not a module in the current program, or in any known package.

You can see that only 5 of the stated proposed libraries are compiled.

The PureScript source definitely makes use of System.IO.UTF8.

But System.IO.UTF8 looks like a pretty old package that has not undergone changes in a long time (2+ years), so it's unlikely that this was a significant change in a recent version. To boot, PureScript is very new, and so would surely be based on newer versions of utf8-string if they were available.

So the question is: why isn't PureScript able to install this dependency on its own ... and why does the cabal installation of utf8-string fail to expose the System.IO.UTF8 module as it suggests it should.


Solution

  • Looks like utf-string was updated today (Jan 23) to version 1 which doesn't have System.IO.UTF8 module anymore. That one is present in previous version 0.3.8 of utf-string.

    And the purescript doesn't specify the upper bound for utf-string.


    EDIT I made a PR to workaround the issue. There is more proper fix WIP too.