From a2565ad514d3452fd0f3e9827eed30a4f5989b4b Mon Sep 17 00:00:00 2001 From: "kirelagin@6d93475882c55a329fedae6be1971868a775ec7e" Date: Wed, 2 Jan 2019 14:34:46 +0000 Subject: [PATCH] --- doc/bugs/No_MonadFail_instance.mdwn | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 doc/bugs/No_MonadFail_instance.mdwn diff --git a/doc/bugs/No_MonadFail_instance.mdwn b/doc/bugs/No_MonadFail_instance.mdwn new file mode 100644 index 0000000000..fb3917f1cb --- /dev/null +++ b/doc/bugs/No_MonadFail_instance.mdwn @@ -0,0 +1,47 @@ +### Please describe the problem. + + +### What steps will reproduce the problem? + +Build git-annex with GHC 8.6. + +### What version of git-annex are you using? On what operating system? + +7.20181211, master + +### Please provide any additional information below. + +Following the implementation plan for the [MonadFail Proposal](https://wiki.haskell.org/MonadFail_Proposal), GHC 8.6 has enabled `-XMonadFailDesugaring` by default. + +Some of the code in git-annex uses failable patterns in `do`-blocks, so it fails to compile starting from GHC 8.6, as there is no `MonadFail` instance for `Annex`. Here is an example of such an error: + + Remote/Glacier.hs:165:17: error: + • No instance for (Control.Monad.Fail.MonadFail Annex) + arising from a do statement + with the failable pattern ‘(_, Just h, _, pid)’ + • In a stmt of a 'do' block: + (_, Just h, _, pid) <- liftIO $ createProcess cmd + In the expression: + do let cmd = ... + (_, Just h, _, pid) <- liftIO $ createProcess cmd + ok <- ifM + (liftIO $ hIsEOF h) + (return False, sink =<< liftIO (L.hGetContents h)) + liftIO $ hClose h + .... + In an equation for ‘go’: + go (Just e) + = do let cmd = ... + (_, Just h, _, pid) <- liftIO $ createProcess cmd + ok <- ifM + (liftIO $ hIsEOF h) + (return False, sink =<< liftIO (L.hGetContents h)) + .... + | + 165 | (_, Just h, _, pid) <- liftIO $ createProcess cmd + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + +### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders) + +Just trying to start using it. I have built it with `-XNoMonadFailDesugaring` for now.