switch to Haskell2010
authorJoey Hess <joeyh@joeyh.name>
Mon, 19 Oct 2020 15:14:01 +0000 (11:14 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 19 Oct 2020 15:26:16 +0000 (11:26 -0400)
When I put in Haskell98 this spring, I was under the mistaken
apprehension that ghc defaulted to that. But it actually its default
is a third mode, which is closer to Haskell2010 but with some differences.
The manual says "By default, GHC mainly aims to behave (mostly) like a
Haskell 2010 compiler"

Fixed two cases where the Haskell98 do indentation flexability let
wrongly indented code build. That is one of the places where
ghc does not behave like Haskell2010 by default.

The other place that I think I was concerned about, is GHC manual
section 19.1.1.3. Expressions and patterns. But that only seems to
affect code using bottoms, so would only affect pure functions throwing
an error, which I don't think git-annex does in many places as it's
pretty horrid style. And it would only affect rare cases like shown in
that section. If it did happen, it would mean that the error was not
thrown before specifying Haskell98, and then was. Haskell2010 behaves
the same as Haskell98.

This commit was sponsored by Denis Dzyubenko on Patreon.

Command/Upgrade.hs
Remote/GitLFS.hs
git-annex.cabal

index 98aa1effda3905ee22167ed2aee31da511b2a242..77f569a15bfe942653b3c82632cf88e442929d1e 100644 (file)
@@ -38,12 +38,13 @@ seek :: UpgradeOptions -> CommandSeek
 seek o = commandAction (start o)
 
 start :: UpgradeOptions -> CommandStart
-start (UpgradeOptions { autoOnly = True }) = do
+start (UpgradeOptions { autoOnly = True }) =
        starting "upgrade" (ActionItemOther Nothing) (SeekInput []) $ do
-       getVersion >>= maybe noop checkUpgrade
-       next $ return True
-start _ = starting "upgrade" (ActionItemOther Nothing) (SeekInput []) $ do
-       whenM (isNothing <$> getVersion) $ do
-               initialize Nothing Nothing
-       r <- upgrade False latestVersion
-       next $ return r
+               getVersion >>= maybe noop checkUpgrade
+               next $ return True
+start _ =
+       starting "upgrade" (ActionItemOther Nothing) (SeekInput []) $ do
+               whenM (isNothing <$> getVersion) $ do
+                       initialize Nothing Nothing
+               r <- upgrade False latestVersion
+               next $ return r
index 95b56fe0f5ef8c16ddc1d234a2048e2e3abdd5f6..1b613f4139bdfe6758c61a984ecb4bf219d19e45 100644 (file)
@@ -295,11 +295,11 @@ discoverLFSEndpoint tro h
                                                let endpoint' = addbasicauth (Git.credentialBasicAuth cred) endpoint
                                                let testreq' = LFS.startTransferRequest endpoint' transfernothing
                                                flip catchNonAsync (const (returnendpoint endpoint')) $ do
-                                               resp' <- makeSmallAPIRequest testreq'
-                                               inRepo $ if needauth (responseStatus resp')
-                                                       then Git.rejectUrlCredential cred
-                                                       else Git.approveUrlCredential cred
-                                               returnendpoint endpoint'
+                                                       resp' <- makeSmallAPIRequest testreq'
+                                                       inRepo $ if needauth (responseStatus resp')
+                                                               then Git.rejectUrlCredential cred
+                                                               else Git.approveUrlCredential cred
+                                                       returnendpoint endpoint'
                                        else returnendpoint endpoint
          where
                transfernothing = LFS.TransferRequest
index 77c449aa4d6b9eb79ecdf90c69e1cfde909e9b42..5a59b2d3efa083194208c73d656258cfb7a09571 100644 (file)
@@ -377,7 +377,7 @@ Executable git-annex
    DAV (>= 1.0)
   CC-Options: -Wall
   GHC-Options: -Wall -fno-warn-tabs  -Wincomplete-uni-patterns
-  Default-Language: Haskell98
+  Default-Language: Haskell2010
   Default-Extensions: PackageImports, LambdaCase
   Other-Extensions: TemplateHaskell
   -- Some things don't work with the non-threaded RTS.