{ "info": { "author": "Philip Xu", "author_email": "pyx@xrefactor.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "===================================\nmonad - a functional python package\n===================================\n\n\nIntroduction\n============\n\n\nWhat?\n-----\n\nMonads in python, with some helpful functions.\n\n\nHow?\n----\n\n::\n\n >>> from monad.decorators import maybe\n >>> parse_int = maybe(int)\n >>> parse_int(42)\n Just(42)\n >>> parse_int('42')\n Just(42)\n >>> parse_int('42.2')\n Nothing\n\n >>> parse_float = maybe(float)\n >>> parse_float('42.2')\n Just(42.2)\n\n >>> from monad.actions import tryout\n >>> parse_number = tryout(parse_int, parse_float)\n >>> tokens = [2, '0', '4', 'eight', '10.0']\n >>> [parse_number(token) for token in tokens]\n [Just(2), Just(0), Just(4), Nothing, Just(10.0)]\n\n >>> @maybe\n ... def reciprocal(n):\n ... return 1. / n\n >>> reciprocal(2)\n Just(0.5)\n >>> reciprocal(0)\n Nothing\n\n >>> process = parse_number >> reciprocal\n >>> process('4')\n Just(0.25)\n >>> process('0')\n Nothing\n >>> [process(token) for token in tokens]\n [Just(0.5), Nothing, Just(0.25), Nothing, Just(0.1)]\n >>> [parse_number(token) >> reciprocal for token in tokens]\n [Just(0.5), Nothing, Just(0.25), Nothing, Just(0.1)]\n >>> [parse_number(token) >> reciprocal >> reciprocal for token in tokens]\n [Just(2.0), Nothing, Just(4.0), Nothing, Just(10.0)]\n\n\nWhy?\n----\n\nWhy not.\n\n\nRequirements\n============\n\n- CPython >= 2.7\n\n\nInstallation\n============\n\nInstall from PyPI::\n\n pip install monad\n\nInstall from source, download source package, decompress, then ``cd`` into source directory, run::\n\n make install\n\n\nLicense\n=======\n\nBSD New, see LICENSE for details.\n\n\nLinks\n=====\n\nDocumentation:\n http://monad.readthedocs.org/\n\nIssue Tracker:\n https://bitbucket.org/pyx/monad/issues/\n\nSource Package @ PyPI:\n https://pypi.python.org/pypi/monad/\n\nMercurial Repository @ bitbucket:\n https://bitbucket.org/pyx/monad/\n\nGit Repository @ Github:\n https://github.com/pyx/monad/", "description_content_type": null, "docs_url": null, "download_url": "https://bitbucket.org/pyx/monad/get/0.1.tar.bz2", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/pyx/monad/", "keywords": null, "license": "BSD-New", "maintainer": null, "maintainer_email": null, "name": "monad", "package_url": "https://pypi.org/project/monad/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/monad/", "project_urls": { "Download": "https://bitbucket.org/pyx/monad/get/0.1.tar.bz2", "Homepage": "https://bitbucket.org/pyx/monad/" }, "release_url": "https://pypi.org/project/monad/0.1/", "requires_dist": null, "requires_python": null, "summary": "monad - a functional library", "version": "0.1" }, "last_serial": 1163612, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "035b82b6959362264416e851c3507e4d", "sha256": "573423d97137f4b696424f53bd25838ad8c4ef38aae9b7f3667dfba11b87dfca" }, "downloads": -1, "filename": "monad-0.1.tar.gz", "has_sig": true, "md5_digest": "035b82b6959362264416e851c3507e4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24128, "upload_time": "2014-07-20T20:11:46", "url": "https://files.pythonhosted.org/packages/73/07/5a2eeb496a862e1ce74f396e50404d6f84b882a5226203c08e9c751ca824/monad-0.1.tar.gz" } ], "0.1dev": [] }, "urls": [ { "comment_text": "", "digests": { "md5": "035b82b6959362264416e851c3507e4d", "sha256": "573423d97137f4b696424f53bd25838ad8c4ef38aae9b7f3667dfba11b87dfca" }, "downloads": -1, "filename": "monad-0.1.tar.gz", "has_sig": true, "md5_digest": "035b82b6959362264416e851c3507e4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24128, "upload_time": "2014-07-20T20:11:46", "url": "https://files.pythonhosted.org/packages/73/07/5a2eeb496a862e1ce74f396e50404d6f84b882a5226203c08e9c751ca824/monad-0.1.tar.gz" } ] }