singpolyma / unexceptionalio

IO without any PseudoExceptions
http://hackage.haskell.org/package/unexceptionalio
ISC License
28 stars 5 forks source link

Fix compatibility with GHC 8.8 #17

Closed felixonmars closed 4 years ago

singpolyma commented 4 years ago

Thanks! Could this get wrapped in CPP so it will still work on older versions with no MonadFail?

felixonmars commented 4 years ago

Updated to use CPP. Sorry for the delay.

bbarker commented 4 years ago

Think I just ran into this as well - would be good to see it merged and released (have been looking at UIO with interest the past week and finally got around to trying it out). cc @singpolyma

singpolyma commented 4 years ago

I'll try to get to this soon. I wonder if it should actually just not define this instance at all since it's a monad that cannot fail?

bbarker commented 4 years ago

Maybe, I haven't used MonadFail, but I do recall seeing a call with fail in the error (which I didn't save, but can try to reproduce if it is helpful).

bbarker commented 4 years ago

@singpolyma OK, i see what you mean now, as the relevant usage is just indicating that it cannot fail:

2020-05-12 21:18:48.037250: [debug] Run process within /run/user/1001/stack-2b39cb8af8028b69/unliftio-core-0.1.2.0/: /home/brandon/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_3.0.1.0_ghc-8.8.3 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-3.0.1.0 configure --user --package-db=clear --package-db=global --package-db=/home/brandon/.stack/snapshots/x86_64-linux-nix/5de837158eda3fadb1e4ac219f7accfd0f9e030aefde6a9146d2949c21260404/8.8.3/pkgdb --libdir=/home/brandon/.stack/snapshots/x86_64-linux-nix/5de837158eda3fadb1e4ac219f7accfd0f9e030aefde6a9146d2949c21260404/8.8.3/lib --bindir=/home/brandon/.stack/snapshots/x86_64-linux-nix/5de837158eda3fadb1e4ac219f7accfd0f9e030aefde6a9146d2949c21260404/8.8.3/bin --datadir=/home/brandon/.stack/snapshots/x86_64-linux-nix/5de837158eda3fadb1e4ac219f7accfd0f9e030aefde6a9146d2949c21260404/8.8.3/share --libexecdir=/home/brandon/.stack/snapshots/x86_64-linux-nix/5de837158eda3fadb1e4ac219f7accfd0f9e030aefde6a9146d2949c21260404/8.8.3/libexec --sysconfdir=/home/brandon/.stack/snapshots/x86_64-linux-nix/5de837158eda3fadb1e4ac219f7accfd0f9e030aefde6a9146d2949c21260404/8.8.3/etc --docdir=/home/brandon/.stack/snapshots/x86_64-linux-nix/5de837158eda3fadb1e4ac219f7accfd0f9e030aefde6a9146d2949c21260404/8.8.3/doc/unliftio-core-0.1.2.0 --htmldir=/home/brandon/.stack/snapshots/x86_64-linux-nix/5de837158eda3fadb1e4ac219f7accfd0f9e030aefde6a9146d2949c21260404/8.8.3/doc/unliftio-core-0.1.2.0 --haddockdir=/home/brandon/.stack/snapshots/x86_64-linux-nix/5de837158eda3fadb1e4ac219f7accfd0f9e030aefde6a9146d2949c21260404/8.8.3/doc/unliftio-core-0.1.2.0 --dependency=base=base-4.13.0.0 --dependency=transformers=transformers-0.5.6.2 --extra-include-dirs=/nix/store/kp31sf9jy2rsw73a4rq13s5l23m5zxy0-pcre-8.43-dev/include --extra-include-dirs=/nix/store/siw6pchq8yjhm6c43ssgm4pc8zd8p55b-ghc-8.8.3/include --extra-include-dirs=/nix/store/6kclkxjwbw4zcx1spwb9wk0hvw6ijcf1-git-2.25.4/include --extra-include-dirs=/nix/store/1v0410l20p343l6cvpijz8bi4if2ysh6-gcc-wrapper-9.2.0/include --extra-include-dirs=/nix/store/qfmbizy1jv469c1cjfv2vx5h9mdmqapc-gmp-6.2.0-dev/include --extra-lib-dirs=/nix/store/i5k2ibiprmks1bddmjm12fgi30maldzf-pcre-8.43/lib --extra-lib-dirs=/nix/store/siw6pchq8yjhm6c43ssgm4pc8zd8p55b-ghc-8.8.3/lib --extra-lib-dirs=/nix/store/6kclkxjwbw4zcx1spwb9wk0hvw6ijcf1-git-2.25.4/lib --extra-lib-dirs=/nix/store/1v0410l20p343l6cvpijz8bi4if2ysh6-gcc-wrapper-9.2.0/lib --extra-lib-dirs=/nix/store/d38akrx7lljl6pl5gqdxcsmf57k9w08v-gmp-6.2.0/lib --exact-configuration --ghc-option=-fhide-source-paths
2020-05-12 21:18:48.097884: [info] unexceptionalio      > Preprocessing library for unexceptionalio-0.5.0..
2020-05-12 21:18:48.103035: [info] unexceptionalio      > Building library for unexceptionalio-0.5.0..
2020-05-12 21:18:48.286146: [info] unexceptionalio      > [1 of 1] Compiling UnexceptionalIO
2020-05-12 21:18:48.452441: [warn] unexceptionalio      >
2020-05-12 21:18:48.454007: [warn] unexceptionalio      > /run/user/1001/stack-2b39cb8af8028b69/unexceptionalio-0.5.0/UnexceptionalIO.hs:208:9: error:
2020-05-12 21:18:48.455338: [warn] unexceptionalio      >     ‘fail’ is not a (visible) method of class ‘Monad’
2020-05-12 21:18:48.456150: [warn] unexceptionalio      >     |
2020-05-12 21:18:48.456744: [warn] unexceptionalio      > 208 |         fail s = error $ "UnexceptionalIO cannot fail (" ++ s ++ ")"
2020-05-12 21:18:48.457574: [warn] unexceptionalio      >     |         ^^^^
2020-05-12 21:18:49.280769: [info] unliftio-core        > Configuring unliftio-core-0.1.2.0...
singpolyma commented 4 years ago

Fixed in 64208a657a0e5e10300f7227aa3fc492680e2c83