• Complain

Alvin Alexander - Functional Programming, Simplified: (Scala edition)

Here you can read online Alvin Alexander - Functional Programming, Simplified: (Scala edition) full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2017, publisher: Alvin Alexander, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    Functional Programming, Simplified: (Scala edition)
  • Author:
  • Publisher:
    Alvin Alexander
  • Genre:
  • Year:
    2017
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Functional Programming, Simplified: (Scala edition): summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Functional Programming, Simplified: (Scala edition)" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Alvin Alexander: author's other books


Who wrote Functional Programming, Simplified: (Scala edition)? Find out the surname, the name of the author of the book and a list of all author's works by series.

Functional Programming, Simplified: (Scala edition) — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Functional Programming, Simplified: (Scala edition)" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Functional Programming,
Simplified
(Scala edition)
Table of Contents








































































































































Copyright

Copyright 2017 Alvin J. Alexander

All rights reserved. No part of this book may be reproduced without prior written permission from the author.

Disclaimer: This book is presented solely for educational purposes, and its also a work in progress. While best efforts have been used in preparing this book, the author makes no representations or warranties of any kind and assume no liabilities of any kind with respect to the accuracy or completeness of the contents, and specifically disclaim any implied warranties of merchantability or fitness of use for a particular purpose. The author shall not be held liable or responsible to any person or entity with respect to any loss or incidental or consequential damages caused, or alleged to have been caused, directly or indirectly, by the information or programs contained herein. Any use of this information is at your own risk. The advice and strategies contained herein may not be suitable for your situation.

Version 0.1.5, published October 17, 2017

Introduction(or, Why I Wrote This Book)

The short version of Why I wrote this book is that I found that trying to learn functional programming in Scala to be really hard, and I want to try to improve that situation.

The longer answer goes like this

My programming background

My degree is in aerospace engineering, so the only programming class I took in college was a FORTRAN class I was forced to take. After college I was one of the youngest people at the aerospace company I worked at, which meant that Id have to maintain the software applications our group used. As a result, I became interested in programming, after which I quickly became interested in (a) How can I write code faster?, and then (b) How can I write maintainable code?

After that I taught myself how to program in C by reading the classic book, The C Programming Language by Kernighan and Ritchie, quickly followed by learning Object-Oriented Programming (OOP) with C++ and Java. That was followed by investigating other programming languages, including Perl, PHP, Ruby, Python, and more.

Despite having exposure to all of these languages, I didnt know anything about Functional Programming (FP) until I came across Googles Guava project, which includes FP libraries for Java collections. Then, when I learned Scala and came to understand the methods in the Scala collections classes, I saw that immutable values and pure functions had some really nice benefits, so I set out to learn more about this thing called Functional Programming.

Trying to learn FP with Scala

As I tried to learn about FP in Scala, I found that there werent any FP books or blogs that I liked certainly nothing that catered to my Ive never heard of FP until recently background. Everything I read was either (a) dry and theoretical, or (b) quickly jumped into topics I couldnt understand. It seemed like people enjoyed writing words monad and functor and then watching me break out in a cold sweat.

As I googled scala fp like a madman, I found a few useful blog posts here and there about functional programming in Scala what Ill call Scala/FP in this book but those were too disconnected. One article covered Topic A, another covered Topic Z, and they were written by different authors with different experiences, so it was hard to find my way from A to Z. Besides being disjointed, they were often incomplete, or maybe they just assumed that I had some piece of knowledge that I didnt really have.

Another stumbling block is that experienced FP developers use generic types a lot. Conversely, I only rarely used generics. They also use the word easy when describing their code, as though saying easy is some sort of Jedi mind trick. For instance, this code which Ill break down as you go through this book was introduced with the text, its very easy to access and modify state:

def updateHealth(delta: Int): Game[Int] = StateT[IO, GameState, Int] { (s: GameState) => val newHealth = s.player.health + delta IO((s.copy(player = s.player.copy(health = newHealth)), newHealth))}

I dont know about you, but the first time I saw that code, the word easy is not what came to mind. What came to my mind were things like, PHP is easy. Using setter methods to modify state is easy. Whatever that is thats not easy.

Another problem with almost all of the Scala/FP resources is that they dont discuss functional input/output (I/O), or how to work with user interfaces. In this book I dont shy away from those topics: I write what I know about both of them.

Learning Haskell to learn FP

In the end, the only way I could learn FP was to buy four Haskell books, take a few weeks off from my regular work, and teach myself Haskell. Because Haskell is a pure FP language and because most experienced Scala/FP developers spoke glowingly about Haskell I assumed that by learning Haskell I could learn FP.

That turned out to be true. In Haskell the only way you can write code is by using FP concepts, so you cant bail out and take shortcuts when things get difficult. Because everything in Haskell is immutable, I was forced to learn about topics like recursion that I had avoided for most of my programming life. In the beginning this made things more difficult, but in the end I learned about the benefits of the new approaches I was forced to learn.

Once I understood Haskell, I went back to the Scala resources that I didnt like before and suddenly they made sense(!). But again, this only happened after I took the time to learn Haskell, a language I didnt plan on using in my work.

The purpose of this book

Therefore, my reasons for writing this book are:

  • To save you the time of having to try to understand many different, unorganized, inconsistent Scala/FP blog posts

  • To save you the time of having to learn Haskell to learn FP (and then having to translate that Haskell knowledge back to Scala)

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Functional Programming, Simplified: (Scala edition)»

Look at similar books to Functional Programming, Simplified: (Scala edition). We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Functional Programming, Simplified: (Scala edition)»

Discussion, reviews of the book Functional Programming, Simplified: (Scala edition) and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.