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...
- Higher Order Functions
- Lambda
- Currying
| (map inc [1 2 3 4 5 6]) ;;; Result will be (2 3 4 5 6 7) |
| (filter #(> % 5) (map inc [1 2 3 4 5 6])) ;;; Result will be (6 7) |
| (defstruct person :name :age :salary) ;;; #'user/person | |
| (def p (struct person "Diego Pacheco" 27 100)) ;;; #'user/p | |
| (prn (:name p)) ;;; "Diego Pacheco" nil | |
| ; | |
| ; Monads | |
| ; ====== | |
| ; | |
| ; * Without monads "pure" functional programming could be very impractical, Hack! | |
| ; * You can build environments that support exactly the features that you want | |
| ; * Functional able todo IO | |
| ; * Function Composition: LINQ, Unix Pipes | |
| ; * Good for control tracking of things | |
| ; * Encapsulating two things: |
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...
This gist and a Functional Society Gist to talk about Calculator 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 calculator in Scala and Haskell:
Calculator, basic operations: +, -, /, * (Remember State and Side Effects are not desired)
This gist and a Functional Society Gist to talk about Fizz buzz 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...
It's time!!! Let's do another kick ass event at Porto Alegre.
671, Jari st - Passo da Areia - Porto Alegre | Google Maps Adress => http://g.co/maps/frjub
Ask for "Functional Society" or "Alexandre Poletto"
| def payment(f:() => Int):Int = 100 - f() | |
| payment( () => 20 + 10 ) // Result will be 70 |
| def double( f:() => Int ):() => Int = { | |
| val func = () => f() * 2 | |
| return func | |
| } | |
| double( () => 100 )() |