<commit_before>
# letexpr

That is python module imitate 'let expression' like a Haskell.


# Installation

```bash
$ pip install https://github.com/hachibeeDI/letexpr/archive/master.zip
```

# Usage

```python
from letexpr import let

answer = (
    let()
        | ('x', lambda : 10)
        | ('y', lambda : 20)
        | ('size', lambda x, y: x * y)
        | ('hoge', lambda x, y: 'fooo')
    ).in_(lambda x, y, size:
        'x = {x}, y = {y}, x * y = {size}'.format(x=x, y=y, size=size))
print answer
#  => 'x = 10, y = 20, x * y = 200'

even_or_odd = [
    (let()
        | ('_i', lambda : str(i))
        | ('r', lambda : 'even' if i % 2 == 0 else 'odd')
    ).in_(lambda _i, r:
        _i + ' is an ' + r  + ' number.')
            for i in range(1, 5)]
print even_or_odd
#  => ['1 is odd number.', '2 is even number.', '3 is odd number.', '4 is even number.']
```

# Testing

<commit_msg>tweak readme description<commit_after>
# letexpr

That is python module imitate `let expression` like a Haskell.


# Installation

```bash
$ pip install https://github.com/hachibeeDI/letexpr/archive/master.zip
```


# Example

```python
from letexpr import let

answer = (
    let()
        | ('x', lambda : 10)
        | ('y', lambda : 20)
        | ('size', lambda x, y: x * y)
        | ('hoge', lambda x, y: 'fooo')
    ).in_(lambda x, y, size:
        'x = {x}, y = {y}, x * y = {size}'.format(x=x, y=y, size=size))
print answer
#  => 'x = 10, y = 20, x * y = 200'


# with List Comprehensions
even_or_odd = [
    (let()
        | ('_i', lambda : str(i))
        | ('r', lambda : 'even' if i % 2 == 0 else 'odd')
    ).in_(lambda _i, r:
        _i + ' is an ' + r  + ' number.')
            for i in range(1, 5)]
print even_or_odd
#  => ['1 is odd number.', '2 is even number.', '3 is odd number.', '4 is even number.']
```

# Testing


{'fraction_non_alphanumeric': 0.1907608695652174, 'fraction_numerical': 0.020652173913043477, 'mean_word_length': 2.3052064631956912, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7331325', 'n_tokens_mistral': 742, 'n_tokens_neox': 690, 'n_words': 225}