- Perl/Python/Ruby = Britney Spears, Lindsay Lohan (total trash, throw away languages for throw away programs, bitrot accelerated)
- Java = Spice Girls, New Kids on the Block (marketing driven drivel)
- C/C++ = Tool, Metallica (causing of much angst, though not so bad for it's purpose)
- Asm = Rap (potentially interesting, but lacking dimensions)
- Prolog = Beethoven
- SmallTalk = Mozart
- Lisp = Bach
This gist and a Functional Society Gist to talk about FP concepts, so people can share links and help each other to get the concepts right and make questions, get you question answered and so on and on...
- Recursion
- List Comprehensions
- Monads
This gist and a Functional Society Gist to talk about Bank homework, so people can share links and help each other to get the homework right and make questions, get you question answered and so on and on...
We need code a simple bank management system in Scala and Haskell:
Simple account management operations like: (Remember State and Side Effects are not desired)
- deposit
This gist and a Functional Society Gist to talk about Contact Address Homework, so people can share links and help each other to get the homework right and make questions, get you question answered and so on and on...
- We need the following features:
- Add contacts(name, email and phone)
- Remove contacts
- Search contacts
| def factorial(number:Int) : Int = if (number == 1) return 1 else number * factorial (number - 1) | |
| println(factorial(5)) |
| def factorial(accumulator: Int, number: Int) : Int = { | |
| if(number == 1) return accumulator | |
| factorial(number * accumulator, number - 1) // Last thing you do you call a function.. will be tail recursive! | |
| } | |
| println(factorial(1,5)) |
| def factorial(number: Int) : Int = { | |
| def factorialWithAccumulator(accumulator: Int, number: Int) : Int = { | |
| if (number == 1) return accumulator | |
| else factorialWithAccumulator(accumulator * number, number - 1) | |
| } | |
| factorialWithAccumulator(1, number) | |
| } | |
| println(factorial(5)) |
| factorial :: Num a => a -> a | |
| factorial 0 = 1 | |
| factorial n = n * factorial (n-1) |
| factorial2 :: (Num a, Enum a) => a -> a | |
| factorial2 n = product [1..n] |
| take 10 [ (i,j) | i <- [1,2], j <- [1..]] -- [(1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9),(1,10)] | |
| [x*2 | x <- [1..10]] -- [2,4,6,8,10,12,14,16,18,20] |