- An optimization using the foldr fusion lawBecause I find this exercise ([1]) very instructive, I want to show you how the foldr fusion law can be used to derive an efficient program from a very inefficient one. This note will let you see some important points:... Continue Reading →Constantin Liculescu
- Re: the mean example explained in detailIn this post I’ll discuss in detail an example found in “Real World Haskell” ([1]) and “Thinking Functionally with Haskell” ([2]). The point of this post is to explain in detail some important functional transformations from an inefficient program to... Continue Reading →Constantin Liculescu
- How do you find a function that…In this post we’ll deal only with finite lists. Questions regarding partial and infinite lists are left as an exercise for the reader. Sometimes we have to answer questions like: I have something that looks like a functional equation, but... Continue Reading →Constantin Liculescu
- Some simple derivations of recursive functionsThe following are some personal notes on how a study of classical mathematical notations can help us to derive algorithms. The functions obtained in this way are simple enough to understand and clarify the technique used. As an aside, I... Continue Reading →Constantin Liculescu
- Heuristic guidance from equational reasoningWorking through the exercises of Richard Bird (Thinking Functionally with Haskell), I found a particular one that can be used to illustrate how equations can give us heuristic guidance in solving particular functional problems. The same pattern of thought will be... Continue Reading →Constantin Liculescu
- Monoids and their efficiency in practiceAs we observed in the post about equational reasoning (An exercie in equational reasoning), constructing algorithms based on laws can help us gain a lot in efficiency. Let’s introduce a little theory first. A monoid is a pair (M,o) where... Continue Reading →Constantin Liculescu
- Cartesian product of listsOne of the patterns of problem solving in programming is the Exhaustive Search. This is simply saying that to find a solution to a specific problem, you have to search all the possible solutions and validate them based on some... Continue Reading →Constantin Liculescu
- The living mathematicsWe all know how mathematics is viewed by the non-mathematician nowadays: a body of knowledge full of formulas and incomprehensible symbols. It’s a point of view that most high-school teachers promote and, in this way, they make mathematics a sterile... Continue Reading →Constantin Liculescu
- An exercise in equational reasoningThis is an exercise found in the very good book of Richard Bird, Thinking Functionally with Haskell. It is a good example of how a certain method of thinking can help us to reason about programs in functional programming. The method... Continue Reading →Constantin Liculescu
- CodeEval Challenge – Correct Algorithm for Self Describing NumbersIn this post I’ll show you how you can practically apply formal methods to obtain a correct algorithm to solve a problem. The chosen problem is a challenge posted on CodeEval: Self Describing Numbers Simply put, a self describing number... Continue Reading →Constantin Liculescu

© 2018 — Powered by WordPress

Theme by Anders Noren — Up ↑

## Recent Comments