|
1 | 1 | module ExitCodes (ExitCode(..)) where
|
2 | 2 |
|
3 |
| -import Prelude (class Eq, class Ord, class Bounded, (+)) |
| 3 | +import Prelude |
4 | 4 | import Data.Enum (class BoundedEnum, class Enum, Cardinality(..))
|
5 | 5 | import Data.Maybe (Maybe(..))
|
6 | 6 |
|
@@ -45,6 +45,40 @@ data ExitCode
|
45 | 45 |
|
46 | 46 | derive instance eqExitCode :: Eq ExitCode
|
47 | 47 | derive instance ordExitCode :: Ord ExitCode
|
| 48 | +instance showExitCode :: Show ExitCode where |
| 49 | + show = case _ of |
| 50 | + Success -> "Success" |
| 51 | + Error -> "Error" |
| 52 | + MisuseOfShellBuiltins -> "MisuseOfShellBuiltins" |
| 53 | + CLIUsageError -> "CLIUsageError" |
| 54 | + DataFormatError -> "DataFormatError" |
| 55 | + CannotOpenInput -> "CannotOpenInput" |
| 56 | + AddresseeUnknown -> "AddresseeUnknown" |
| 57 | + HostNameUnknown -> "HostNameUnknown" |
| 58 | + ServiceUnavailable -> "ServiceUnavailable" |
| 59 | + InternalSoftwareError -> "InternalSoftwareError" |
| 60 | + SystemError -> "SystemError" |
| 61 | + CriticalOSFileMissing -> "CriticalOSFileMissing" |
| 62 | + CannotCreateOutputFile -> "CannotCreateOutputFile" |
| 63 | + IOError -> "IOError" |
| 64 | + TemporaryFailure -> "TemporaryFailure" |
| 65 | + RemoteError -> "RemoteError" |
| 66 | + PermissionDenied -> "PermissionDenied" |
| 67 | + ConfigurationError -> "ConfigurationError" |
| 68 | + CannotExecute -> "CannotExecute" |
| 69 | + CommandNotFound -> "CommandNotFound" |
| 70 | + InvalidExitArgument -> "InvalidExitArgument" |
| 71 | + SIGHUP -> "SIGHUP" |
| 72 | + SIGINT -> "SIGINT" |
| 73 | + SIGQUIT -> "SIGQUIT" |
| 74 | + SIGILL -> "SIGILL" |
| 75 | + SIGABRT -> "SIGABRT" |
| 76 | + SIGFPE -> "SIGFPE" |
| 77 | + SIGKILL -> "SIGKILL" |
| 78 | + SIGSEGV -> "SIGSEGV" |
| 79 | + SIGPIPE -> "SIGPIPE" |
| 80 | + SIGALRM -> "SIGALRM" |
| 81 | + SIGTERM -> "SIGTERM" |
48 | 82 |
|
49 | 83 | instance boundedExitCode :: Bounded ExitCode where
|
50 | 84 | bottom = Success
|
|
0 commit comments