Change class parameter in Result.fromMaybe

This commit is contained in:
Correl Roush 2018-12-06 13:15:26 -05:00
parent 69f8aa86b9
commit c85f5537ec

View file

@ -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]: