Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

minor stylistic cleanups

  • Loading branch information...
commit 5aa0d0885ec4a427bab09bafd2785159f26227e0 1 parent 0d29a7a
@mwotton authored
Showing with 4 additions and 10 deletions.
  1. +4 −10 Haskell/Hubrify.hs
View
14 Haskell/Hubrify.hs
@@ -2,7 +2,7 @@ module Main where
import Language.Ruby.Hubris.LibraryBuilder
import System.Environment
import System.Exit
--- import Control.Monad (when)
+import Control.Monad (guard)
import System.Console.GetOpt
data Options = Options
@@ -55,15 +55,9 @@ hubrisOpts argv =
main :: IO ()
main = do
(o, srcs) <- getArgs >>= hubrisOpts
- -- HACK this may be the worst thing ever
- let ghcArgs = if optStrict o
- then ["-Wall", "-Werror", "-fno-warn-unused-imports"]
- else []
- -- putStrLn $ show $ optPackages o
+ let ghcArgs = guard (optStrict o) >> ["-Wall", "-Werror", "-fno-warn-unused-imports"]
res <- generateLib (optOutput o) srcs (optModule o) ("-fPIC":ghcArgs) (optPackages o)
- -- print res
- case res of
- Left a -> putStrLn ("Failed: " ++ a) >> exitFailure
- Right _ -> exitSuccess
+
+ either (putStrLn . ("Failed: " ++) >> const exitFailure) (const exitSuccess) res
Please sign in to comment.
Something went wrong with that request. Please try again.