Skip to content

Commit

Permalink
Add pfun.effect module
Browse files Browse the repository at this point in the history
  • Loading branch information
Sune Debel authored Jun 30, 2020
1 parent 0444d20 commit 9100c01
Show file tree
Hide file tree
Showing 103 changed files with 3,765 additions and 959 deletions.
16 changes: 8 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defaults: &defaults
working_directory: ~/pfun
docker:
- image: jonatkinson/python-poetry:3.7
- image: circleci/python:3.7.5

version: 2
jobs:
Expand All @@ -11,12 +11,18 @@ jobs:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "poetry.lock" }}
- run:
name: Install poetry
command: POETRY_VERSION=1.0.9 curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
- run:
name: Configure poetry
command: poetry config settings.virtualenvs.in-project true
command: poetry config virtualenvs.in-project true
- run:
name: Install dependencies
command: poetry install
- run:
name: Lint
command: poetry run pre-commit run --all
- run:
name: Test
command: poetry run tox
Expand All @@ -25,12 +31,6 @@ jobs:
paths:
- .venv
- .tox
- run:
name: Lint
command: poetry run flake8 pfun tests examples
- run:
name: Typecheck
command: poetry run mypy pfun examples
release:
<<: *defaults
steps:
Expand Down
45 changes: 45 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
repos:
- repo: local
hooks:
- id: trailing-whitespace-fixer
name: trailing-whitespace-fixer
stages: [commit]
language: system
entry: trailing-whitespace-fixer
types: [text]

- id: end-of-file-fixer
name: end-of-file-fixer
stages: [commit]
language: system
entry: end-of-file-fixer
types: [text]

- id: isort
name: isort
stages: [commit]
language: system
entry: isort
types: [python]

- id: yapf
name: yapf
stages: [commit]
language: system
entry: yapf
types: [python]

- id: flake8
name: flake8
stages: [commit]
language: system
entry: flake8
types: [python]

- id: mypy
name: mypy
stages: [commit]
language: system
entry: mypy pfun
types: [python]
pass_filenames: false
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ Requires [poetry](https://poetry.eustace.io/)

- Install dependencies with `poetry install`
- Build documentation with `poetry run sphinx-build -b html docs/source docs/build`
- Run tests with `poetry run pytest`
- Run tests with `poetry run pytest`
- Lint with `poetry run pre-commit --all`
146 changes: 81 additions & 65 deletions docs/source/api_reference.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,67 @@
API Reference
====
Maybe
-----
=============
pfun
----

.. autoclass:: pfun.Immutable
:members:



.. autoclass:: pfun.Dict
:members:
:special-members:
:exclude-members: __weakref__,clear,__setitem__,__delitem__

.. autoclass:: pfun.List
:members:
:special-members:
:exclude-members: __weakref__,clear,__setitem__,__delitem__


.. autofunction:: pfun.curry


.. autofunction:: pfun.compose


.. autofunction:: pfun.always


.. autofunction:: pfun.pipeline


.. autofunction:: pfun.identity


pfun.effect
-----------
.. automodule:: pfun.effect
:members:
:imported-members:

pfun.effect.files
-----------------
.. automodule:: pfun.effect.files
:members:

pfun.effect.console
-------------------
.. automodule:: pfun.effect.console
:members:

pfun.effect.subprocess
----------------------
.. automodule:: pfun.effect.subprocess
:members:

pfun.effect.ref
---------------
.. automodule:: pfun.effect.ref
:members:

pfun.maybe
----------
.. autofunction:: pfun.maybe.maybe

.. autoattribute:: pfun.maybe.Maybe
Expand All @@ -12,8 +72,8 @@ Maybe
.. autoclass:: pfun.maybe.Nothing
:members:

Either
------
pfun.either
-----------
.. autofunction:: pfun.either.either


Expand All @@ -25,108 +85,64 @@ Either
.. autoclass:: pfun.result.Left
:members:

Result
-----
pfun.result
-----------
.. autofunction:: pfun.result.result

.. autoclass:: pfun.result.Result
:members:

Reader
------
pfun.reader
-----------

.. automodule:: pfun.reader
:members:

Writer
------
pfun.writer
-----------

.. automodule:: pfun.writer
:members:
:special-members:
:exclude-members: __weakref__,__setattr__,__repr__


State
-----
pfun.state
----------

.. automodule:: pfun.state
:members:
:special-members:
:exclude-members: __weakref__,__setattr__,__repr__

IO
----
pfun.io
-------

.. automodule:: pfun.io
:members:
:special-members:
:exclude-members: __weakref__,__setattr__,__repr__

Trampoline
----------
pfun.trampoline
---------------

.. automodule:: pfun.trampoline
:members:
:special-members:
:exclude-members: __weakref__,__setattr__,__repr__


Cont
----
pfun.cont
---------

.. automodule:: pfun.cont
:members:
:special-members:
:exclude-members: __weakref__,__setattr__,__repr__

Free
----
pfun.free
---------
.. automodule:: pfun.free
:members:
:special-members:
:exclude-members: __weakref__,__setattr__,__repr__


Immutable
---------

.. autoclass:: pfun.Immutable
:members:


Dict
----
.. autoclass:: pfun.Dict
:members:
:special-members:
:exclude-members: __weakref__,clear,__setitem__,__delitem__
List
----
.. autoclass:: pfun.List
:members:
:special-members:
:exclude-members: __weakref__,clear,__setitem__,__delitem__

curry
-----
.. autofunction:: pfun.curry

compose
-------
.. autofunction:: pfun.compose

always
------
.. autofunction:: pfun.always

pipeline
--------
.. autofunction:: pfun.pipeline

identity
--------

.. autofunction:: pfun.identity


3 changes: 2 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
release = '0.5.1'
source_suffix = ['.rst', '.md']
master_doc = 'index'
extensions = ['recommonmark', 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
extensions = ['recommonmark', 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx_autodoc_typehints', 'sphinx_rtd_theme']
html_theme = 'sphinx_rtd_theme'
Loading

0 comments on commit 9100c01

Please sign in to comment.