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

Like this? Share it with your network

Share

Introduction to Functional Programming in Scala

on

  • 960 views

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

Statistics

Views

Total Views
960
Views on SlideShare
801
Embed Views
159

Actions

Likes
2
Downloads
12
Comments
0

2 Embeds 159

http://jeeconf.com 158
http://blog.japila.pl 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Introduction to Functional Programming in Scala Presentation 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?