{ "info": { "author": "OGURA_Daiki", "author_email": "8hachibee125@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Software Development" ], "description": "[![Build Status](https://travis-ci.org/hachibeeDI/letexpr.png?branch=master)](https://travis-ci.org/hachibeeDI/letexpr)\n\n# letexpr\n\nThat is python module imitate `let expression` like a Haskell.\n\nAnd support lazy evaluation.\n\n\n# Installation\n\n```bash\n$ pip install https://github.com/hachibeeDI/letexpr/archive/master.zip\n```\n\n\n# Example\n\n```python\nfrom letexpr import let, expr\n\n# expr(x) = lambda x: lambda: x\n\nanswer = (\n let()\n | ('x', expr(10))\n | ('y', expr(20))\n | ('size', lambda x, y: x * y)\n | ('hoge', lambda x, y: 'fooo')\n ).in_(lambda x, y, size:\n 'x = {x}, y = {y}, x * y = {size}'.format(x=x, y=y, size=size))\nprint answer\n# => 'x = 10, y = 20, x * y = 200'\n\n\n# with List Comprehensions\neven_or_odd = [\n (let()\n | ('_i', expr(str(i)))\n | ('r', expr('even' if i % 2 == 0 else 'odd'))\n ).in_(lambda _i, r:\n _i + ' is an ' + r + ' number.')\n for i in range(1, 5)]\nprint even_or_odd\n# => ['1 is odd number.', '2 is even number.', '3 is odd number.', '4 is even number.']\n\n\n# with anonymous function\nlet_ = (let()\n | ('x', expr('x'))\n | ('y', expr('y'))\n)\n@let_.in_()\ndef _(x, y):\n return x + y\nprint let_.end\n# => 'xy'\n\n```\n\n# Testing\n\n\n```bash\n$ pip install nose\n$ nosetests --with-doctest\n```", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hachibeeDI/letexpr", "keywords": "let,expression", "license": "The MIT License (MIT)\n\nCopyright (c) 2014 OGURA Daiki\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.", "maintainer": null, "maintainer_email": null, "name": "letexpr", "package_url": "https://pypi.org/project/letexpr/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/letexpr/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/hachibeeDI/letexpr" }, "release_url": "https://pypi.org/project/letexpr/0.3.5/", "requires_dist": null, "requires_python": null, "summary": "imitation of let expression like a Haskell.", "version": "0.3.5" }, "last_serial": 1156854, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "1e49ba8e11792c6327af65dc2f31d0be", "sha256": "396eb2fd828213fb40f8c28cce70943359715a6ba8bca5ba527549cc25bc70af" }, "downloads": -1, "filename": "letexpr-0.1.tar.gz", "has_sig": false, "md5_digest": "1e49ba8e11792c6327af65dc2f31d0be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2977, "upload_time": "2014-01-16T04:24:19", "url": "https://files.pythonhosted.org/packages/49/69/ab69c49ce9e108a2ab2c116e84a90e25d311e14627620ea5aa9d06b733e7/letexpr-0.1.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "b873ca726d15edecd3da9387bd3d7af7", "sha256": "e90db5ec8e6c32a5ee9241fa005aac007132083e09eb9da6af575aebdc35cb1b" }, "downloads": -1, "filename": "letexpr-0.3.1.tar.gz", "has_sig": false, "md5_digest": "b873ca726d15edecd3da9387bd3d7af7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2999, "upload_time": "2014-01-28T06:07:46", "url": "https://files.pythonhosted.org/packages/ae/84/f1f304f70d835d6d677820bfe7f30f66aa2855d72f10eed043a42e4da64b/letexpr-0.3.1.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "d22998119ed2e63cb21ff650509f419a", "sha256": "9da51fab22712210ddda998b238af8453ff08236e53f67b6a19e3a3681215237" }, "downloads": -1, "filename": "letexpr-0.3.5.tar.gz", "has_sig": false, "md5_digest": "d22998119ed2e63cb21ff650509f419a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3317, "upload_time": "2014-07-14T08:05:37", "url": "https://files.pythonhosted.org/packages/ed/17/c06ef1d590ee586d6f680d9ca6e70580353d46648d1f88c7893bea5ff55d/letexpr-0.3.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d22998119ed2e63cb21ff650509f419a", "sha256": "9da51fab22712210ddda998b238af8453ff08236e53f67b6a19e3a3681215237" }, "downloads": -1, "filename": "letexpr-0.3.5.tar.gz", "has_sig": false, "md5_digest": "d22998119ed2e63cb21ff650509f419a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3317, "upload_time": "2014-07-14T08:05:37", "url": "https://files.pythonhosted.org/packages/ed/17/c06ef1d590ee586d6f680d9ca6e70580353d46648d1f88c7893bea5ff55d/letexpr-0.3.5.tar.gz" } ] }