Docs and tests

This commit is contained in:
Samuele Reghenzi 2020-12-31 16:26:09 +01:00
parent 9869a5cd49
commit 52819c3507
2 changed files with 4 additions and 1 deletions

View file

@ -147,6 +147,9 @@ value if the list is empty.
## Monads
Wrapped values should be immutable: they are _protected_ from accidental direct writing with *Final* type and the pythonic naming convention.
### Maybe[T]
Represents optional data. A `Maybe` instance of a certain type `T` will

View file

@ -59,7 +59,7 @@ def test_mconcat(constructor: Constructor) -> None:
def test_immutability(constructor: Constructor) -> None:
a: Monoid = construct(constructor, 1)
assert a.value == 1
assert a.value != None
with pytest.raises(AttributeError) as excinfo:
# this is ignore on porpouse othewise the mypy test fail. Uncomment to check the Final check with mypy
a.value = 2 # type: ignore