Recentlly, I am learning crocks.js ADT libaray. In the beginning, it is hard to understand when to use 'runWith', 'evalWith', 'execWith'. Until I went though the coursea thrid times... I finally have some feelings for it. State has 'get, put, modify'…
As a beginner of Crocks.js, it was a problem for we to figure out when to use .map() and when to use .chain(). Of course, using the docs help: map: State s a ~> (a -> b) -> State s b chain: State s a ~> (a -> State s b) -> State s b The…
1. Functional programming treats computation as the evaluation of mathematical and avoids state and mutable data. Scala encourages an expression-oriented programming(EOP) 1) In expression-oriented programming every statement is an expression. A state…
Lifting Now, let's review map from another perspective. map :: (T -> R) -> [T] -> [R] accepts 2 parameters, a function f :: T -> R and a list list :: [T]. [T] is a generic type paramterized by T, it's not the same as T, but definitely shares s…
Functions in Java Prior to the introduction of Lambda Expressions feature in version 8, Java had long been known as a purely object-oriented programming language. "Everything is an Object" is the philosophy deep in the language design. Objects a…
background In pursuit of a real-world application, let’s say we need an e-commerce web applicationfor a mail-order coffee bean company. They sell several types of coffee and in differentquantities, both of which affect the price. Imperative methods F…
In computer science, functional programming is a programming paradigm, a style of building the structure and elements of computer programs, that treats computation as the evaluation of mathematical functions and avoids state and mutable data. It is a…
A functional programming function is like a mathematical function, which produces an output that typically depends only on its arguments. Each time a functional programming function is called with the same arguments, the same result is achieved. Func…