Skip to content

Commit

Permalink
Removes Maybe monad
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Feb 4, 2019
1 parent edb8ae2 commit 2e6decb
Show file tree
Hide file tree
Showing 15 changed files with 5 additions and 519 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ We follow Semantic Versions since the `0.1.0` release.
- Renames `ebind` to `rescue`
- Renames `efmap` to `fix`
- Renames `Monad` to `Container`
- Removes `Maybe` monad, since typing does not have `NonNullable` type


## Version 0.3.1
Expand Down
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Contents
:caption: Userguide

pages/container.rst
pages/maybe.rst
pages/result.rst
pages/functions.rst

Expand Down
8 changes: 3 additions & 5 deletions docs/pages/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@ is_successful
:func:`is_succesful <returns.functions.is_successful>` is used to
tell whether or not your result is a success.
We treat only treat types that does not throw as a successful ones,
basically: :class:`Success <returns.result.Success>`
and :class:`Some <returns.maybe.Some>`.
basically: :class:`Success <returns.result.Success>`.

.. code:: python
from returns.result import Success, Failure
from returns.functions import is_successful
from returns.maybe import Some, Nothing
is_successful(Some(1)) and is_successful(Success(1))
is_successful(Success(1))
# => True
is_successful(Nothing) or is_successful(Failure('text'))
is_successful(Failure('text'))
# => False
.. _pipeline:
Expand Down
62 changes: 0 additions & 62 deletions docs/pages/maybe.rst

This file was deleted.

128 changes: 0 additions & 128 deletions returns/maybe.py

This file was deleted.

130 changes: 0 additions & 130 deletions returns/maybe.pyi

This file was deleted.

2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ per-file-ignores =
**/*.pyi: D100, D401, X100
**/*.py: D100, D401, X100
# Disable some `.pyi` specific warings:
**/*.pyi: D101, D102, D103, D107, Z214, Z444, Z452
**/*.pyi: D101, D102, D103, D107, Z444, Z452
# TODO: fix check and remove it from ignores
**/*.py: Z454
**/*.pyi: Z454
Expand Down
3 changes: 0 additions & 3 deletions tests/test_functions/test_is_successful.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
import pytest

from returns.functions import is_successful
from returns.maybe import Nothing, Some
from returns.result import Failure, Success


@pytest.mark.parametrize('container, correct_result', [
(Some, True),
(Success, True),
(Nothing, False),
(Failure, False),
])
def test_is_successful(container, correct_result):
Expand Down

0 comments on commit 2e6decb

Please sign in to comment.