Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.

Commit 8a9a93f

Browse files
Merge pull request #5 from safareli/patch-2
add show instance
2 parents 2dbd595 + eb17e83 commit 8a9a93f

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

src/ExitCodes.purs

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module ExitCodes (ExitCode(..)) where
22

3-
import Prelude (class Eq, class Ord, class Bounded, (+))
3+
import Prelude
44
import Data.Enum (class BoundedEnum, class Enum, Cardinality(..))
55
import Data.Maybe (Maybe(..))
66

@@ -45,6 +45,40 @@ data ExitCode
4545

4646
derive instance eqExitCode :: Eq ExitCode
4747
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"
4882

4983
instance boundedExitCode :: Bounded ExitCode where
5084
bottom = Success

0 commit comments

Comments
 (0)