Metadata-Version: 2.1
Name: qwlist
Version: 0.0.2
Summary: A small package introducing a new way to use higher order functions with lists
Project-URL: Homepage, https://github.com/WitoldFracek/qlist
Author: Witold Frącek
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# Qwery List
QList is a small library introducing a new way to use higher order functions
with lists, with **lazy evaluation**. It also aims to address ugly 
python list methods such as map, filter and reduce. Whoever invented this:
```python
xs = ['1', '2', '3', '4']
s = reduce(lambda acc, x: acc + x, filter(lambda x: x < 3, map(int, xs)), 0)
```
must reevaluate their life choices (yes, I am being cocky and most likely dumdum) but listen
to me first and look what the world of lazy evaluation has to offer!
```python
xs = QList([1, 2, 3, 4])
s = xs.map(int).filter(lambda x: x < 3).fold(lambda acc, x: acc + x, 0)
```

As a bonus you get `len()` **method**, so no longer will you be forced to wrapp your
lists in this type of code `len(xs)` and simply call `xs.len()` (I understand it is negligibly 
slower but look how much nicer it looks!)


## Quick tutorial
Let's say we want to read numbers from a file and choose only the even ones. No problem at all!
```python
with open('path/to/file.txt', 'r') as file:
    qlist = QList(file.readlines())
even = qlist.map(int).filter(lambda x: x % 2 == 0).collect()
```
Why is there this `collect` at the end? Because all operations on the QList are lazy evaluated, 
so in order to finally apply all the operations you need to express that. (Eager evaluated module
coming soon...)

---

### Side note
I hereby announce that UwU, Qwery Listwu

