I also ran into a problem on Windows.
c:\>cabal install safe
Resolving dependencies...
Configuring safe-0.3.4...
Building safe-0.3.4...
Preprocessing library safe-0.3.4...
[1 of 2] Compiling Safe.Foldable ( Safe\Foldable.hs, dist\build\Safe\Foldable.o )
Can't open perl script "C:\ghc-7.8\lib\ghc-split": No such file or directory
Failed to install safe-0.3.4
cabal: Error: some packages failed to install:
safe-0.3.4 failed during the building phase. The exception was:
ExitFailure 2
Copying "ghc-split" from the Haskell Platform into c:\ghc-7.8\lib seems to work around the problem.
c:\>cabal install safe
Resolving dependencies...
Configuring safe-0.3.4...
Building safe-0.3.4...
Preprocessing library safe-0.3.4...
[1 of 2] Compiling Safe.Foldable ( Safe\Foldable.hs, dist\build\Safe\Foldable.o )
[2 of 2] Compiling Safe ( Safe.hs, dist\build\Safe.o )
In-place registering safe-0.3.4...
Installing library in
C:\Users\Mike\AppData\Roaming\cabal\safe-0.3.4\ghc-7.8.20140130
Registering safe-0.3.4...
Installed safe-0.3.4
c:\>ghci
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> import Safe
Prelude Safe> readMay "1" :: Maybe Int
Loading package safe-0.3.4 ... linking ... done.
Just 1
Prelude Safe> :quit
Leaving GHCi.