mirror of
https://github.com/correl/typesafe-monads.git
synced 2024-11-14 11:09:36 +00:00
Change class parameter in Result.fromMaybe
This commit is contained in:
parent
69f8aa86b9
commit
c85f5537ec
1 changed files with 1 additions and 1 deletions
|
@ -51,7 +51,7 @@ class Result(Monad[T], Generic[T, E]):
|
|||
return default
|
||||
|
||||
@classmethod
|
||||
def fromMaybe(self, m: Maybe[T], error: E) -> Result[T, E]:
|
||||
def fromMaybe(cls, m: Maybe[T], error: E) -> Result[T, E]:
|
||||
return m.map(Result.pure).withDefault(Err(error))
|
||||
|
||||
def toMaybe(self) -> Maybe[T]:
|
||||
|
|
Loading…
Reference in a new issue