An open API service indexing awesome lists of open source software.

https://github.com/devwurm/gsg_infinite-lazy-lists-examples

Examples for a short talk about self referencing definitions of lazy infinite lists in functional programming
https://github.com/devwurm/gsg_infinite-lazy-lists-examples

Last synced: 4 months ago
JSON representation

Examples for a short talk about self referencing definitions of lazy infinite lists in functional programming

Awesome Lists containing this project

README

          

# Examples for the improved use of infinite lazy lists in functional programming
This repository contains examples for a short talk about the improved use of infinite lazy lists in the computer science class at GSG Löbau.

It shows 3 example lists (the sequence of natural numbers, the [fibonacci sequence](https://en.wikipedia.org/wiki/Fibonacci_number) and a function for generating arbitrary
[arithmetic sequences](https://en.wikipedia.org/wiki/Arithmetic_progression), whose implementations are provided for an obvious (intuituive) to another more unintuitive, but sometimes more improved way.

Each implementation is availiable in the language [Haskell](https://en.wikipedia.org/wiki/Haskell_%28programming_language%29), as well as in the language [Racket/Scheme](https://en.wikipedia.org/wiki/Racket_%28programming_language%29).

## About intuitive and unintuitive ways
Many of us start programming with imperiative languages, in which [lazy evaluation](https://en.wikipedia.org/wiki/Lazy_evaluation) (and thereby the use of "infinite" datastructures) isn't a big deal.
Even many introductions to functional programming and lazy evaluation don't cover all the possibilities and ways of utilization brought by this feature.

The talk and these examples show a specific but broadly applicable part of all these features: Self referencing list definitions. By those many list definitions can be improved in terms of code length and readability.

## License
All of the code is licensed under MIT License (see LICENSE for more information).

Use it! :)

## Contribute
Please contribute if you find bugs or if you can provide more cool examples. Even more different languages are desired!

To contribute you can create amn Issue or an Pull Request or send me an EMail :)

## Contact
If you have any questions, ideas, etc. feel free to contact me:

DevWurm

Email: devwurm@gmx.net

Jabber: devwurm@jabber.ccc.de

Twitter: @DevWurm