use _NAME_ convention
This commit is contained in:
parent
bff674d7ea
commit
8b36748b94
1 changed files with 3 additions and 3 deletions
|
|
@ -3,14 +3,14 @@ with builtins; rec {
|
|||
# Fault Monad
|
||||
# Wrapper around an error (ie builtins.abort)
|
||||
Fault = error: {
|
||||
error = error;
|
||||
_error_ = error;
|
||||
};
|
||||
|
||||
# Pattern Matching
|
||||
isFault = F: attrNames F == ["error"];
|
||||
isFault = F: attrNames F == ["_error_"];
|
||||
|
||||
# Unwrap (Monadic Return Operation)
|
||||
unwrapFault = F: F.error;
|
||||
unwrapFault = F: F._error_;
|
||||
|
||||
# Map (Monadic Bind Operation)
|
||||
mapFault = f: F: Fault (f (unwrapFault F));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue