Functional Programming, Simplified book provides a comprehensive guide to understanding functional programming, condensing multiple resources into one accessible source. [ more ]
Scala is a programming language created in 2003 to address challenges in developing complex software systems efficiently.
Scala is statically-typed, supports functional and object-oriented programming, and has a rich set of libraries for building scalable applications. [ more ]
Functional Programming, Simplified book provides a comprehensive guide to understanding functional programming, condensing multiple resources into one accessible source. [ more ]
Scala is a programming language created in 2003 to address challenges in developing complex software systems efficiently.
Scala is statically-typed, supports functional and object-oriented programming, and has a rich set of libraries for building scalable applications. [ more ]
Frontend and software architecture events in May 2024 feature Scala conferences covering functional programming and industry practices with renowned experts and diverse topics. [ more ]
Scalac - Software Development Company - Akka, Kafka, Spark, ZIO
Frontend and software architecture events in May 2024 feature Scala conferences covering functional programming and industry practices with renowned experts and diverse topics. [ more ]
Scalac - Software Development Company - Akka, Kafka, Spark, ZIO
How to create a compose function in TypeScript - LogRocket Blog
Composing functions in TypeScript is a core concept in functional programming that combines multiple functions into a single function that can perform any number of tasks you may require.Function composition can be implemented in many programming languages, including TypeScript.In this article, we will learn how to create typed compose and pipe functions in TypeScript and how to use these functions to perform function composition in TypeScript.
Meta met a programming language it likes better than Java
Meta, parent of Facebook, is in the midst of migrating its Android app Java code to Kotlin, a younger programming language that also relies on the Java Virtual Machine, or JVM.Created by software tool maker JetBrains, Kotlin debuted in 2011 and by 2016 had reached its 1.0 release.The following year, it was adopted by Google as a first-class (supported) language for Android development and was put under the management of its own foundation, funded by JetBrains and Google.
How to create a compose function in TypeScript - LogRocket Blog
Composing functions in TypeScript is a core concept in functional programming that combines multiple functions into a single function that can perform any number of tasks you may require.Function composition can be implemented in many programming languages, including TypeScript.In this article, we will learn how to create typed compose and pipe functions in TypeScript and how to use these functions to perform function composition in TypeScript.
Meta met a programming language it likes better than Java
Meta, parent of Facebook, is in the midst of migrating its Android app Java code to Kotlin, a younger programming language that also relies on the Java Virtual Machine, or JVM.Created by software tool maker JetBrains, Kotlin debuted in 2011 and by 2016 had reached its 1.0 release.The following year, it was adopted by Google as a first-class (supported) language for Android development and was put under the management of its own foundation, funded by JetBrains and Google.
Functional Containers Summary: Functor vs Applicative vs Monad
Functors represent mapping between categories, can be viewed as util class for mapping over values, prevalent in functional languages like Scala and Haskell.
Applicatives generalize Functors, operate not just on values but also on functions within a context, less powerful than Monads but more versatile. [ more ]
Functional Containers Summary: Functor vs Applicative vs Monad
Functors represent mapping between categories, can be viewed as util class for mapping over values, prevalent in functional languages like Scala and Haskell.
Applicatives generalize Functors, operate not just on values but also on functions within a context, less powerful than Monads but more versatile. [ more ]
Exploring The Role Of Static Methods In Python: A Functional Perspective - Pybites
Static methods in Python do not require an instance or class reference and are typically used for utility functions that belong to a class but are independent of class instances.
Python's module system allows for effective namespace management and code organization, making it a viable alternative to static methods in certain scenarios. [ more ]
NestJS Nest is a framework for building efficient, scalable Node.js server-side applications.It uses modern JavaScript, is built with TypeScript (preserves compatibility with pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).
A function is a reusable block of code that accepts arguments and returns a computed value.A pure function always returns the same value given the same arguments and produces no side effects.Let's see in more detail what are pure functions and why they are useful.Before I go on, let me recommend something to you.
How to define higher-order functions in Rust - LogRocket Blog
Higher-order functions (HOFs) are functions whose parameters and/or return values are functions themselves.In other words, if a language supports higher-order functions, then we say that these functions are first-class citizens, that is they are values.In this article, we'll investigate how Rust supports higher-order functions and how we can define them.
GitHub - xeitojs/xeito: Xeito is a framework for building interactive web applications with Typescript and Tagged Template Literals.
Harness the power of the web.Typescript framework for building web applications.Xeito is a framework for building efficient, scalable web applications using Typescript.It combines some of the best features of Angular, Vue, React and Svelte to provide you with amazing tools to build your next web application.
Let's make sharing state easy!Redux is a state management library that is used to manage the state of an application.It provides a predictable and centralized way to manage the state of an application, making it easier to debug and reason about.Redux is not a standalone library; it is often used with React and other libraries to build complex applications.
Cats Effect is an excellent and performant framework for doing asynchronous computations in a functional manner.It provides an IO monadic datatype for controlling the actions of your application.Effects wrapped in instances of the IO monad are lazily evaluated.They can be conveniently composed together with the flatMap function creating bigger programs and then evaluated in a resource-safe runtime.
NestJS Nest is a framework for building efficient, scalable Node.js server-side applications.It uses modern JavaScript, is built with TypeScript (preserves compatibility with pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).
A function is a reusable block of code that accepts arguments and returns a computed value.A pure function always returns the same value given the same arguments and produces no side effects.Let's see in more detail what are pure functions and why they are useful.Before I go on, let me recommend something to you.
How to define higher-order functions in Rust - LogRocket Blog
Higher-order functions (HOFs) are functions whose parameters and/or return values are functions themselves.In other words, if a language supports higher-order functions, then we say that these functions are first-class citizens, that is they are values.In this article, we'll investigate how Rust supports higher-order functions and how we can define them.
GitHub - xeitojs/xeito: Xeito is a framework for building interactive web applications with Typescript and Tagged Template Literals.
Harness the power of the web.Typescript framework for building web applications.Xeito is a framework for building efficient, scalable web applications using Typescript.It combines some of the best features of Angular, Vue, React and Svelte to provide you with amazing tools to build your next web application.
Let's make sharing state easy!Redux is a state management library that is used to manage the state of an application.It provides a predictable and centralized way to manage the state of an application, making it easier to debug and reason about.Redux is not a standalone library; it is often used with React and other libraries to build complex applications.
Cats Effect is an excellent and performant framework for doing asynchronous computations in a functional manner.It provides an IO monadic datatype for controlling the actions of your application.Effects wrapped in instances of the IO monad are lazily evaluated.They can be conveniently composed together with the flatMap function creating bigger programs and then evaluated in a resource-safe runtime.
Learn Functional Programming The Fast Way! (new book cover)
I decided to rename my book, Learn Functional Programming Without Fear to Learn Functional Programming The Fast Way! because (a) I think it's more reflective of today's world, and (b) it's consistent with my other book, Learn Scala 3 The Fast Way!.
What is Purity in JavaScript and Why Does It Matter?
The process of studying JavaScript usually begins in a very practical way.From declaring variables to understanding the hell of Asynchronous JavaScript, the more theoretical concepts get left out.And this gap starts to get annoying when you get into deeper topics.With this in mind, let's start by explaining some of the more theoretical (and even philosophical) concepts of Modern JavaScript, starting with purity.
My LaTeX cheatsheet for writing a computer programming book
By Alvin Alexander.Last updated: January 22, 2023
I'm currently writing my new book, Functional Programming, Simplified (Updated for Scala 3) directly in LaTeX, and this is my "LaTeX cheatsheet" that I keep open all the time so I can copy and paste the LaTeX stuff I need while I write.Note that I don't use any LaTeX formula stuff, so most of this is pretty basic LaTeX stuff, though there are a few custom commands/functions that probably won't make sense to anyone unless I share some more details.
As you might guess from looking at this collection of book covers, I LOVE writing about things like Scala and functional programming, but it pays about 1/10th of what programming does.To try to make it affordable to stay in the writing business, I've created this Patreon page.Any support is greatly appreciated!
JavaScript is a popular programming language that is widely used for front-end web development, server-side scripting, and creating mobile and desktop applications.It is a powerful language that offers many features and capabilities, including object-oriented programming, event-driven programming, and functional programming.
What is Purity in JavaScript and Why Does It Matter?
The process of studying JavaScript usually begins in a very practical way.From declaring variables to understanding the hell of Asynchronous JavaScript, the more theoretical concepts get left out.And this gap starts to get annoying when you get into deeper topics.With this in mind, let's start by explaining some of the more theoretical (and even philosophical) concepts of Modern JavaScript, starting with purity.
My LaTeX cheatsheet for writing a computer programming book
By Alvin Alexander.Last updated: January 22, 2023
I'm currently writing my new book, Functional Programming, Simplified (Updated for Scala 3) directly in LaTeX, and this is my "LaTeX cheatsheet" that I keep open all the time so I can copy and paste the LaTeX stuff I need while I write.Note that I don't use any LaTeX formula stuff, so most of this is pretty basic LaTeX stuff, though there are a few custom commands/functions that probably won't make sense to anyone unless I share some more details.
As you might guess from looking at this collection of book covers, I LOVE writing about things like Scala and functional programming, but it pays about 1/10th of what programming does.To try to make it affordable to stay in the writing business, I've created this Patreon page.Any support is greatly appreciated!
JavaScript is a popular programming language that is widely used for front-end web development, server-side scripting, and creating mobile and desktop applications.It is a powerful language that offers many features and capabilities, including object-oriented programming, event-driven programming, and functional programming.
While fooling around recently with various computer programming algorithms, I ended up writing an implementation of the Adler-32 checksum algorithm in Scala.There isn't too much to say about it, other than I hope I got it right.My results for the simple test below matched the results shown on the Adler-32 Wikipedia page, so that's encouraging.
In this series of blogs I'll try my best to walk you through the Monads basics & implementations, So stay tuned for the next part!Now, without further ado, let's understand what a Monad is! Monad is a design pattern used to describe computations as a series of steps.With monads, we can define a pipeline, a series of computational steps, that allow us to reuse more of our code, to write it in terms of highly composable parts.
FOREVER FUNCTIONAL--Working with functions... but partially!
In our previous article on currying we discussed an important functional programming technique that lets you fix parameters of a function, in a specific way.
While fooling around recently with various computer programming algorithms, I ended up writing an implementation of the Adler-32 checksum algorithm in Scala.There isn't too much to say about it, other than I hope I got it right.My results for the simple test below matched the results shown on the Adler-32 Wikipedia page, so that's encouraging.
In this series of blogs I'll try my best to walk you through the Monads basics & implementations, So stay tuned for the next part!Now, without further ado, let's understand what a Monad is! Monad is a design pattern used to describe computations as a series of steps.With monads, we can define a pipeline, a series of computational steps, that allow us to reuse more of our code, to write it in terms of highly composable parts.
FOREVER FUNCTIONAL--Working with functions... but partially!
In our previous article on currying we discussed an important functional programming technique that lets you fix parameters of a function, in a specific way.
Mastering Advanced JavaScript Functions: Closures, Currying, and Higher-Order Functions
JavaScript functions are a crucial part of the language, allowing developers to write reusable and modular code.However, there are some advanced concepts related to functions that may not be familiar to all developers.In this article, we'll explore some of the most powerful and advanced features of JavaScript functions, including closures, currying, and higher-order functions.
If you like my books and want to earn a little extra income, I just started using the Gumroad "affiliates" program.Just sign up with Gumroad, link to one or more books, then hopefully make some sales and earn a little extra money.I'm starting with a 30% commission, so if you sell a $10 book like Learn Scala 3 The Fast Way! you'll earn $3, and if you sell a $20 book like Functional Programming, Simplified: Updated for Scala 3, you'll earn $6 (USD).
Learning Recursion: A free booklet, by Alvin Alexander
As a brief note today, I just released the first version of a new, free booklet that I've titled Learning Recursion.Free download This booklet is based on the recursion lessons in my new book, Functional Programming, Simplified: Updated for Scala 3. If you've already purchased that book, there's no need to download this booklet, unless you'd like these lessons available in this separate booklet.
Scala: How to convert a String to an Int (Integer)
Scala FAQ: How do I convert a String to Int in Scala?Solution: Use 'toInt' If you need to convert a String to an Int in Scala, use the toInt method, which is available on String objects, like this:
scala>val i = "1".toInti: Int = 1 As you can see, I just cast the string "1" to an Int object using the toInt method, which is available to any String.
A Scala "fold left" function written using recursion
As a brief note, here's some Scala source code that shows how to write a fold left ( foldLeft) function using recursion:
// scala 2
object FoldLeft extends App {
val a = List(1,2,3,4)
def add(a: Int, b: Int) = a + b
println(foldLeft(0)(a)(add))
def foldLeft(lastResult: Int)(list: List[Int])(f: (Int, Int) => Int): Int = list match {
case Nil => lastResult
case x :: xs => {
val result = f(lastResult, x)
println(s"last: $lastResult, x: $x, result = $result")
foldLeft(result)(xs)(f)
}
}
} The output of this example code looks like this:
last: 0, x: 1, result = 1
last: 1, x: 2, result = 3
last: 3, x: 3, result = 6
last: 6, x: 4, result = 10
10 I'll explain this code in my new book on functional programming, but for the moment I'm just sharing the code here in case anyone wants/needs to see how to do this.
First Speakers Announced for the Data Engineering Summit on Jan 18
In just a few weeks, ODSC and Ai+ Training's Data Engineering Live Summit will arrive.This fully virtual event on January 18th is where you'll want to be to get the latest and greatest when it comes to data engineering.After reviewing our list of speakers, the team's excited about the content that you'll get to enjoy.
Functional Programming and Finite State Automata (FSA)
When I talk about functional programming in Python, folks like to look for place where functional programming isn't appropriate.They latch onto finite-state automata (FSA) because "state" of an automata doesn't seem to fit with stateless objects used in functional programming.This is a false dichotomy.
First Speakers Announced for the Data Engineering Summit on Jan 18
In just a few weeks, ODSC and Ai+ Training's Data Engineering Live Summit will arrive.This fully virtual event on January 18th is where you'll want to be to get the latest and greatest when it comes to data engineering.After reviewing our list of speakers, the team's excited about the content that you'll get to enjoy.
Functional Programming and Finite State Automata (FSA)
When I talk about functional programming in Python, folks like to look for place where functional programming isn't appropriate.They latch onto finite-state automata (FSA) because "state" of an automata doesn't seem to fit with stateless objects used in functional programming.This is a false dichotomy.
I like what John De Goes shares in this talk about how to combine the best of FP & OOP.The "best of" portion of the talk starts about 36 minutes into the talk, which is where that link starts.FWIW, I share almost all of the same information in my book, Functional Programming, Simplified, though I will admit that I probably don't articulate it quite as well as his speech.
I like what John De Goes shares in this talk about how to combine the best of FP & OOP.The "best of" portion of the talk starts about 36 minutes into the talk, which is where that link starts.FWIW, I share almost all of the same information in my book, Functional Programming, Simplified, though I will admit that I probably don't articulate it quite as well as his speech.
A Skeptic's Guide to Functional Programming with JavaScript
What if the team hates my functional code?So you learned some functional programming.And it's glorious!Your JavaScript is cleaner; more concise; elegant.It feels solid.You can't wait to share it with the team.So you throw up a PR and wait for the comments to come in; eager to hear what they think.And those comments come in all right.
What if the team assumes my functional JavaScript is slow?
Suppose you start introducing some functional flavour into your code.And, you like it.The code is more expressive.It's easier to test.It's easier to pull apart and reconfigure.On several measures, it's better code than you used to write.There's a problem, though.The team have been communicating, with not-so-subtle hints, that they don't like it.
A Skeptic's Guide to Functional Programming with JavaScript
What if the team hates my functional code?So you learned some functional programming.And it's glorious!Your JavaScript is cleaner; more concise; elegant.It feels solid.You can't wait to share it with the team.So you throw up a PR and wait for the comments to come in; eager to hear what they think.And those comments come in all right.
What if the team assumes my functional JavaScript is slow?
Suppose you start introducing some functional flavour into your code.And, you like it.The code is more expressive.It's easier to test.It's easier to pull apart and reconfigure.On several measures, it's better code than you used to write.There's a problem, though.The team have been communicating, with not-so-subtle hints, that they don't like it.
Simple FP book: No monads. No monoids. No category theory. Just FP code.
How about a simple functional programming book written with this style: No monads.No monoids.No category theory.Just some Java & Scala code.Robert Martin's tweet about writing a new simple functional programming book (in Clojure) was shared with me here, and I like his initial wording on not worrying about monads, monoids, functors, and category theory.
Lane Wagner is the founder of a startup company called Boot.dev.He teaches backend development online in Go, Python, and JavaScript.Lane joins Chuck and Steve as they talk all things Functional Programming.They also talk about its importance and share their thoughts about it.Moreover, Lane also shares his experience with creating boot.dev and the different teaching strategies he uses on his online learning platform.
For OOP developers: The smallest, simplest functional programming book
Some of the books on the right side of this image are amazing, and I would never discourage anyone from reading the great ones.But if you're an object-oriented programming (OOP) developer who wants to start understanding functional programming (FP) over a weekend, that's the goal of the new little book on the left: Learn Functional Programming Without Fear.
Best FP book for OOP, Java, and Kotlin developers?
October, 2022: I just released my new book, "(Almost) Functional Programming," and I think it's going to be a terrific book for all OOP developers, especially Java and Kotlin developers.
Conversely, here are the "three pillars of functional programming," from Functional and Reactive Domain Modeling:
...
Referential transparency 2.Substitution model 3.Equational reasoning
...
When I started learning FP (and later took two years to write Functional Programming, Simplified) I was surprised there wasn't a single accepted definition of functional programming.
For OOP developers: The smallest, simplest functional programming book
Some of the books on the right side of this image are amazing, and I would never discourage anyone from reading the great ones.But if you're an object-oriented programming (OOP) developer who wants to start understanding functional programming (FP) over a weekend, that's the goal of the new little book on the left: Learn Functional Programming Without Fear.
Best FP book for OOP, Java, and Kotlin developers?
October, 2022: I just released my new book, "(Almost) Functional Programming," and I think it's going to be a terrific book for all OOP developers, especially Java and Kotlin developers.
Conversely, here are the "three pillars of functional programming," from Functional and Reactive Domain Modeling:
...
Referential transparency 2.Substitution model 3.Equational reasoning
...
When I started learning FP (and later took two years to write Functional Programming, Simplified) I was surprised there wasn't a single accepted definition of functional programming.
Functional programming: The fastest way to learn it
Alternate titles for my book, Learn Functional Programming Without Fear, are, the fastest way to learn functional programming and learn functional programming the fast way.That's because I found out - almost by accident - that the fastest way to learn FP goes like this:
Start with an OOP foundation, like using Java, Kotlin, and other OOP languages Take a look at how you write methods in OOP languages Then look at how to solve problems using pure functions and data types Add in immutable (algebraic) variables Then add in immutable data structures Lastly, add in functional error-handling using Scala's Option, Try, and Either data types
As I show in Learn Functional Programming Without Fear, if you follow this "OOP to FP" journey correctly, you'll now be ready to use Scala/FP libraries like ZIO and Cats Effect.
50% off discount code for "Functional Programming, Simplified"
If you've been waiting for a coupon or discount to learn functional programming, today may be your lucky day.I just created a 50% off discount code for the PDF version of "Functional Programming, Simplified" (a best-selling, highly-rated book about functional programming in Scala).But hurry, because the discount is limited to the first 100 buyers.
Notes from Functional and Reactive Domain Modeling
I'm a big fan of the book, Functional and Reactive Domain Modeling, and these are some of my notes ("CliffsNotes") from the book, most of them coming from the first chapter.
Scala: A Reverse Polish Notation (RPN) calculator written with foldLeft
That code also works, but whether it's readable is subject to debate (depending on your experience with Scala, functional programming, the foldLeft method, your brain, and other factors).
Scala: A Reverse Polish Notation (RPN) calculator written with foldLeft
That code also works, but whether it's readable is subject to debate (depending on your experience with Scala, functional programming, the foldLeft method, your brain, and other factors).
A simple Scala Quicklens example (functional programming, lenses)
I may explain this more in the future, but for now, here's some source code for an example of how to use Quicklens in a Scala functional programming project.
In my first Laminar tutorial I showed how to set up a Scala sbt project to use Laminar, and then showed a "static" example - i.e., there were no moving parts.
A simple Scala Quicklens example (functional programming, lenses)
I may explain this more in the future, but for now, here's some source code for an example of how to use Quicklens in a Scala functional programming project.
In my first Laminar tutorial I showed how to set up a Scala sbt project to use Laminar, and then showed a "static" example - i.e., there were no moving parts.
Based on my two books, Learn Scala 3 The Fast Way and Functional Programming, Simplified, here's my video on Expression-Oriented Programming (EOP) in Scala:
How to compose JavaScript functions that take multiple parameters (the epic guide)
Functions with multiple parameters cannot be composed directly. Techniques like currying and partial application help handle multi-argument functions. [ more ]