Your SlideShare is downloading. ×
Introduction to Functional Programming in Scala
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Introduction to Functional Programming in Scala

578

Published on

Presentation from my talk at JEEConf (http://jeeconf.com) in Kiev, Ukraine on 24th of May, 2013

Presentation from my talk at JEEConf (http://jeeconf.com) in Kiev, Ukraine on 24th of May, 2013

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
578
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
20
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Functional Programmingwith ScalaIntroduction by @JacekLaskowski
  • 2. Jacek Laskowski@JacekLaskowskihttp://blog.japila.pl
  • 3. HTTPS://GITHUB.COM/PCHIUSANO/FPINSCALA
  • 4. HTTP://WWW.ATOMICSCALA.COM/
  • 5. HTTPS://WWW.COURSERA.ORG/COURSE/PROGFUN
  • 6. Functional programmingIn computer science, functional programmingis a programming paradigm that treatscomputation as the evaluation ofmathematical functions and avoids state andmutable data. It emphasizes the application offunctions, in contrast to the imperative programmingstyle, which emphasizes changes in state.HTTP://EN.WIKIPEDIA.ORG/WIKI/FUNCTIONAL_PROGRAMMING
  • 7. Functional programming•Programming paradigm•Computation = function evaluation•Avoids state and mutable data•Function composition•Expressions everywhere
  • 8. Scala is a modern multi-paradigmprogramming language designed to expresscommon programming patterns in a concise, elegant,and type-safe way. It smoothly integrates featuresof object-oriented and functional languages.HTTP://WWW.SCALA-LANG.ORG/NODE/104Scala is also a functional languagein the sense that every function is avalue.
  • 9. Keyword todefine a MethodMethod’s nameMethod’s inputparameters andtheir typesMethod’sreturn type(optional)Method’s body
  • 10. Expression vs statement•A statement changes state•it’s called for side effects•An expression produces resultFROM “ATOMIC SCALA” BY BRUCE ECKEL AND DIANNE MARSH
  • 11. Everything in Scala is anexpression
  • 12. Is this an expression?YES!Is this an expression?YES!
  • 13. Type => TypeFunction type
  • 14. Function type examples•Int => String•(Int, Int) => Int•Int => Int => Int•(Int => Int) => Int
  • 15. Scala REPL
  • 16. Collections in Scala•Vector•Set•Map•Range
  • 17. Functional trio•map•filter•reduce (foldLeft + foldRight)
  • 18. Function literal
  • 19. Function composition
  • 20. Jacek Laskowski@JacekLaskowskihttp://blog.japila.plPitannja?

×