functional-python:Python 中的 monadic 表示

时间:2021-06-17 03:21:27
【文件属性】:
文件名称:functional-python:Python 中的 monadic 表示
文件大小:10KB
文件格式:ZIP
更新时间:2021-06-17 03:21:27
Python 函数式python 函数式编程启发了我,我试图找到尽可能多的函数式模式,即使在命令式编程中也可以使用。 起初我想看看如何在 Python 中实现 Monads 的使用,我认为它可能会演变成更多的东西,所以我把它放在了通用的位置。 类型类 函子: fmap 应用函子: apply (Haskell 中的<*> ) pure 单子: ret (在 Haskell 中return ) bind (Haskell 中的>>= ) 数据类型 身份 也许 任何一个
【文件预览】:
functional-python-master
----unit_tests()
--------monad_laws.py(3KB)
--------functor_laws.py(1KB)
--------applicative_laws.py(1KB)
----typeclasses()
--------applicative.py(506B)
--------functor.py(338B)
--------__init__.py(24B)
--------monad.py(496B)
----instance_exceptions()
--------method_exceptions.py(390B)
--------__init__.py(24B)
----test_maybe.py(817B)
----adt()
--------identity.py(861B)
--------either.py(3KB)
--------state.py(776B)
--------__init__.py(22B)
--------maybe.py(4KB)
----README.md(531B)
----methods.py(194B)
----.gitignore(12B)

网友评论