Skip to content

Commit

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

||| Converts a `Signal` to its integer representation to be used
||| in FFI calls.
export
signalCode : Signal -> Int
signalCode SigINT = prim__sigint
Expand All @@ -118,6 +120,7 @@ signalCode (SigPosix SigTRAP ) = prim__sigtrap
signalCode (SigPosix SigUser1) = prim__sigusr1
signalCode (SigPosix SigUser2) = prim__sigusr2

||| Tries to convert an integer to the corresponding `Signal`.
export
toSignal : Int -> Maybe Signal
toSignal (-1) = Nothing
Expand Down

0 comments on commit dc042ab

Please sign in to comment.