X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FMain.hs;h=ab37ca558f009bd30d5ac610e117f9282836442f;hb=0b3152a88d2fa4a7c75f29a2859c31ef23d27bf3;hp=89ac4463d096b9138dad365a52e8a33b39028896;hpb=63b121a0397d4d2d8898a2a9f266859b047ba491;p=spline3.git diff --git a/src/Main.hs b/src/Main.hs index 89ac446..ab37ca5 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -1,6 +1,6 @@ {-# LANGUAGE RecordWildCards, DoAndIfThenElse #-} -module Main +module Main (main) where import Control.Monad ( when ) @@ -8,10 +8,13 @@ import qualified Data.Array.Repa as R import Data.Maybe ( fromJust ) import GHC.Conc ( getNumProcessors, setNumCapabilities ) import System.IO ( hPutStrLn, stderr ) -import System.Exit ( exitSuccess, exitWith, ExitCode(..) ) +import System.Exit ( + ExitCode( ExitFailure ), + exitSuccess, + exitWith ) import CommandLine ( Args(..), apply_args ) -import ExitCodes +import ExitCodes ( exit_arg_not_positive, exit_arg_out_of_bounds ) import Grid ( zoom ) import Volumetric ( bracket_array, @@ -93,7 +96,7 @@ main3d Args{..} shape = do main2d :: Args -> R.DIM3 -> IO () main2d Args{..} shape = do - let zoom_factor = (1, scale, scale) + let zoom_factor = (1 :: Int, scale, scale) arr <- read_word16s input shape arrSlice <- R.computeUnboxedP $ z_slice (fromJust slice) @@ -109,8 +112,8 @@ main2d Args{..} shape = do arrSlice0 <- R.computeUnboxedP $ z_slice 0 raw_output -- Make doubles from the thresholds which are given as Ints. - let lt = fromIntegral lower_threshold - let ut = fromIntegral upper_threshold + let lt = fromIntegral lower_threshold :: Double + let ut = fromIntegral upper_threshold :: Double let arr_bracketed = bracket_array lt ut arrSlice0 values <- R.computeUnboxedP $ R.map fromIntegral arr_bracketed