haskell-distributed / distributed-process

Cloud Haskell core libraries
http://haskell-distributed.github.io
711 stars 96 forks source link

Could not deduce (MonadFail Process) arising from a use of ‘fail’ #345

Closed demonstrators closed 2 months ago

demonstrators commented 4 years ago

Hi,

the following compile error occuring for me with dependency on distributed-process with LTS-15.0/ghc-8.8.2

• Could not deduce (MonadFail Process) arising from a use of ‘fail’
distributed-process  >       from the context: Typeable a
distributed-process  >         bound by the type signature for:
distributed-process  >                    unStatic :: forall a. Typeable a => Static a -> Process a
distributed-process  >         at src/Control/Distributed/Process/Internal/Primitives.hs:1269:1-47
distributed-process  >     • In the expression:
distributed-process  >         fail $ "Could not resolve static value: " ++ err
distributed-process  >       In a case alternative:
distributed-process  >           Left err -> fail $ "Could not resolve static value: " ++ err
distributed-process  >       In a stmt of a 'do' block:
distributed-process  >         case Static.unstatic rtable static of
distributed-process  >           Left err -> fail $ "Could not resolve static value: " ++ err
distributed-process  >           Right x -> return x
distributed-process  >      |    
distributed-process  > 1273 |     Left err -> fail $ "Could not resolve static value: " ++ err

I solved this build issue locally by adding following after Process definition in src/Distributed/Process/Internal/Types.hs:

instance MonadFail Process where
  fail = error

However, I had to hack stack.yml also as follows to build quickly, so this is perhaps a diagnosis that someone in the project would need to apply, with backwards compatibility etc.


resolver: lts-15.0 # 12.18  Use GHC 8.4.4

# TODO: we can enable nightly-2018-11-11 once PR #319 is merged

packages:
  - '.'
  - distributed-process-tests/

extra-deps:
- distributed-static-0.3.9@sha256:0eb308ee416db4541cb5b4d2dff387e7c9394e6deaf76b7e829ce46add4448bc,2237
- hashable-1.2.7.0@sha256:03b6836ca9cd3ad0e5a2f3cce989b001dd0e05f306a873db3196037adb30e0a4,5215
- network-2.8.0.1@sha256:0f165dffa752d8cde30c2bde86f80609c4f1dc5eeb3182d593041f97839c5b3b,3011
- rematch-0.2.0.0@sha256:86019f4d6a4347e1291a0a9f85ba6324e1447e2b93d75958e59c24212e9d8178,1245

# previous pins
# - rank1dynamic-0.4.0
# - distributed-static-0.3.8
# - network-transport-0.5.2
# - network-transport-inmemory-0.5.2
# - rematch-0.2.0.0

- git: https://github.com/haskell-distributed/network-transport-tcp.git
  commit: d87d6f55697a94a1fbf211ff9c1bb769a1e129cd

flags:
  distributed-process-tests:
    tcp: true

allow-newer: true    # needed because of cabal config
system-ghc: true    # life's too short

thanks for the great work. Stephen.

ProofOfKeags commented 4 years ago

This is still a problem. Would maintainers support merging a PR that fixes this?

LaurentRDC commented 2 months ago

Since this issue was raised, the minimum officially-supported version of GHC moved up to 8.10. As such, this issue is no longer relevant.

I am happy to review pull requests to extend the support to GHC 8.8