Tag: functional programming

An introduction to typeclass metaprogramming
Post

An introduction to typeclass metaprogramming

Originally posted on lexi-lambda.github. Typeclass metaprogramming is a powerful technique available to Haskell programmers to automatically generate term-level code from static type information. It has been used to great effect in several popular Haskell libraries (such as the servant ecosystem), and it is the core mechanism used to implement generic programming via GHC generics. Despite this, remarkably little material...

Fun JavaScript: Safely dealing with undefined/null values using functional programming
Post

Fun JavaScript: Safely dealing with undefined/null values using functional programming

Originally posted on intext. Let’s pretend there is a number we want to apply an operations to, and if that number is undefined/null, we want to avoid an error or unexpected result. The operation will be add. One way to do this imperatively could be: const number = // getting number from somewhere (DB/network/etc)let newNumber; if...

Composing functions in JavaScript
Post

Composing functions in JavaScript

Originally posted on dev. Taking functional programming approach to pipeline functions in JavaScript Cross-posted from my dev.to article with a same title. Recently I read an article, here on Medium, about using Pipeline style in JavaScript. An article described how to pipe functions together so data flows through all of them. What I’ve missed in this article was...

What Makes Functional and Object-oriented Programming Equal
Post

What Makes Functional and Object-oriented Programming Equal

There is an ongoing dispute on the Internet about which kind of programming, functional or object-oriented, is better. Large areas of the scene are polluted by a raging war where bigots of all kinds are serving fabricated “proofs” to disregard the opposing programming technique. Notably, an extremely loud and aggressive minority exists, which claims that...

Functional-ish JavaScript
Post

Functional-ish JavaScript

Functional programming is a great discipline to learn and apply when writing JavaScript. Writing stateless, idempotent, side-effect free code really does solve a lot of problems: It’s easier to test It’s easier to debug It’s easier to reproduce issues But there’s a growing impression in the community that functional programming is an all-or-nothing practice. It’s...

What is better — Functional programming or Object Oriented?
Post

What is better — Functional programming or Object Oriented?

Last week, I found myself caught in the firing range of functional programmers — all because I dared put forward an alternative mode of thinking for JavaScript. This is probably also the first time I’ve ever gotten hate and love mail, public condemnation, accolades and tweets for something that had innocent intentions and origins. Somehow, I also managed to...

Knowing Monads Through The Category Theory
Post

Knowing Monads Through The Category Theory

We all know that programming is based on math, what is perhaps not so clear is that knowing more math is going to help us become better developers. And although in all types of programming, math is fundamental, it is even more so in functional programming. A very widespread concept which I’m sure you have...

Why is functional programming gaining traction? Why now?
Post

Why is functional programming gaining traction? Why now?

The biggest companies in the world are investing heavily in functional programming. From Facebook building React and Reason, to Apple pivoting to Swift, to Google developing MapReduce, functional programming is gaining traction. But why? I go over four hypotheses and evaluate them. TRANSCRIPT Eric Normand: Why are the biggest companies in the world investing in...

Friendly Functional Programming
Post

Friendly Functional Programming

Programming is about solving real world problems, each program describes the different instructions, actions and events “What to do if..?” to deal with some problems. Programming is like creating a life style following some rules which are defined by the programmer. We might be the author of the life story of someone who trusted us...