andymac-2 / haskell-docs

MIT License
0 stars 3 forks source link

Simple Example Programs #1

Open andymac-2 opened 6 years ago

andymac-2 commented 6 years ago

Welcome to anyone new who comes across here!

I was hoping to teach my dad how to learn Haskell, who lives far away, by writing a series of tutorials. However, I lack a bit of creativity sometimes. I was hoping if anybody has some good example programs or functions that would be suitable to write about in a tutorial (they don't have to be written in Haskell)

If you're learning to program and have an example program that you learned something new from, or it was something you enjoyed writing, make a PR here! Any and all input is welcomed. I invite anyone who comes across here to contribute and get that extra PR for Hacktoberfest!

Please provide any or all of the following:

If you don't know Haskell that's fine. Just implement it in a programming language of your choice

and Preferably

Please put your program in the src directory (nothing there yet)

kahlil29 commented 6 years ago

Would the fizz-buzz program be a good candidate for this?

andymac-2 commented 6 years ago

Absolutely! Although, if you decide to use a language other than Haskell, consider trying to use recursion, or maps/folds/reduces as much as possible.

kahlil29 commented 6 years ago

Thanks for the prompt reply! It will be in Haskell 😄

kahlil29 commented 6 years ago

Fizz Buzz PR is raised. Let me know if you can think of any other simple (or not so simple) examples or programs and I'll definitely have a go at them.

andymac-2 commented 6 years ago

No problems, I was thinking about emulating some of the basic unix utilities. I would love to see more code from you!

kahlil29 commented 6 years ago

Added sort and yes They were fairly easy. yes was a bit too easy 😛

Currently working on grep in my free time. Is it okay if I search for just string or text ? As in, read the file and then separate it into lines using the lines function (I'm assuming the file has newline characters in it) and then search for the input string in each line and finally report where the input word was found.