on master help sign in
Use `ifail` instead of `headNote`.
commitedea8daae204bd8ebef95d743ac92aafa2364e64 authorSteven Shaw <steven@steshaw.org> dateMon 19 Sep 2016, 03:02 (10 years ago) parentbf9a3a4
2 files changed+9−10
idris.cabal−1 main/Main.hs+9−9
idris.cabal−1
@@ -343,7 +343,6 @@ Executable idris
343343 , filepath
344344 , directory
345345 , haskeline >= 0.7
346− , safe
347346 , transformers
348347
349348 ghc-prof-options: -auto-all -caf-all
main/Main.hs+9−9
@@ -1,7 +1,6 @@
11module Main where
22
33import Control.Monad ( when )
4−import Safe (headNote)
54import System.Exit ( exitSuccess )
65
76import Idris.AbsSyntax
@@ -30,14 +29,15 @@ check opts extractOpts action = do
3029 runIO exitSuccess
3130
3231processClientOptions :: [Opt] -> Idris ()
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
32+processClientOptions opts = check opts getClient $ \fs -> case fs of
33+ [] -> ifail "No --client argument. This indicates a bug. Please report."
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
4141
4242processPackageOptions :: [Opt] -> Idris ()
4343processPackageOptions opts = do