on master help sign in
Tweak to silence intero about non-exhaustive patterns.

- At this point, the list is always non-empty.

commitbf9a3a480d4eb3285e49bf1ec88413e3cbf73573 authorSteven Shaw <steven@steshaw.org> dateThu 15 Sep 2016, 16:37 (10 years ago) parent0d3d2d6
2 files changed+10−9
idris.cabal+1 main/Main.hs+9−9
idris.cabal+1
@@ -343,6 +343,7 @@ Executable idris
343343 , filepath
344344 , directory
345345 , haskeline >= 0.7
346+ , safe
346347 , transformers
347348
348349 ghc-prof-options: -auto-all -caf-all
main/Main.hs+9−9
@@ -1,12 +1,12 @@
11module Main where
22
33import Control.Monad ( when )
4+import Safe (headNote)
45import System.Exit ( exitSuccess )
56
67import Idris.AbsSyntax
78import Idris.Error
89import Idris.CmdOptions
9−import Idris.Info
1010import Idris.Info.Show
1111import Idris.Package
1212import Idris.Main
@@ -30,14 +30,14 @@ check opts extractOpts action = do
3030 runIO exitSuccess
3131
3232processClientOptions :: [Opt] -> Idris ()
33−processClientOptions opts = check opts getClient $ \fs -> case fs of
34− (c:_) -> do
35− setVerbose False
36− setQuiet True
37− case getPort opts of
38− Just DontListen -> ifail "\"--client\" and \"--port none\" are incompatible"
39− Just (ListenPort port) -> runIO $ runClient (Just port) c
40− Nothing -> runIO $ runClient Nothing c
33+processClientOptions opts = check opts getClient $ \fs -> do
34+ let c = headNote "No --client argument. This indicates a bug. Please report." fs
35+ setVerbose False
36+ setQuiet True
37+ case getPort opts of
38+ Just DontListen -> ifail "\"--client\" and \"--port none\" are incompatible"
39+ Just (ListenPort port) -> runIO $ runClient (Just port) c
40+ Nothing -> runIO $ runClient Nothing c
4141
4242processPackageOptions :: [Opt] -> Idris ()
4343processPackageOptions opts = do