Skip to content

Commit

Permalink
[ refactor ] export signal to code conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-hoeck committed Aug 18, 2024
1 parent 2482ebb commit bf1c245
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libs/base/System/Signal.idr
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Eq Signal where
SigPosix x == SigPosix y = x == y
_ == _ = False

export
signalCode : Signal -> Int
signalCode SigINT = prim__sigint
signalCode SigABRT = prim__sigabrt
Expand All @@ -117,6 +118,7 @@ signalCode (SigPosix SigTRAP ) = prim__sigtrap
signalCode (SigPosix SigUser1) = prim__sigusr1
signalCode (SigPosix SigUser2) = prim__sigusr2

export
toSignal : Int -> Maybe Signal
toSignal (-1) = Nothing
toSignal x = lookup x codes
Expand Down

0 comments on commit bf1c245

Please sign in to comment.