web developer & system programmer

coder . cl

ramblings and rants on software development...


Print Article R -a +A

understanding mapreduce

by Daniel Molina Wegener on 2012.02.04
posted in: development, haskell, programming, tips

MapReduce is a distributed computing model introduced by Google with its framework for distributed computing called MapReduce. Its conceptual basis comes from a functional programming approach based mainly on the basic mathematical concept of Monoid treatment in functional programming. Basically a Monoid lifts data using map and process that data using fold — which is called reduce in Python, returning the same bound type as its input — and can be expressed as the triple \langle A, \varepsilon, \cdot \rangle as the set A, the neutral element \varepsilon and the operation \cdot. The problem with the Monoid definition is the fact that it is bound to a type, where MapReduce is not bound to any type, and even it is not bound to a Category.

programming practice 1991-c, part 2

by Daniel Molina Wegener on 2012.01.01
posted in: development, haskell, programming, tips

As you know I am learning Haskell and doing small exercises based on the ACM ICPC problem archive. I am using those problem sets as my Haskell practice. The task presented on the problem 1991-c is related to a small DSL which handles concurrency simulations, using two simple instruction called lock and unlock to switch between running and ready states. The DSL defined for this problem seems to be simple. I have used the Parsec Haskell package to build the language parser. Where on my last post about this problem I have created the program parser, and now I build the interpreter.

jquery is not a monad

by Daniel Molina Wegener on 2011.12.19
posted in: development, haskell, programming, tips

There are some nice articles explaining that jQuery is a Monad, from the basis that jQuery chains computations with a returning type — with very simple words — but that is not enough to say that jQuery is a Monad. A Monad should meet certain conditions, from supplying support to its laws to defining the proper methods covering its monadic behaviour. So, it basically should supply support for the three Monad Laws, called associativity, right identity and left identity, where all of them are applied to the same type — or category from its Math background.

programming practice 1991-c, part 1

by Daniel Molina Wegener on 2011.12.03
posted in: development, haskell, programming, tips

As you know I am learning Haskell and doing small exercises based on the ACM ICPC problem archive. I am using those problem sets as my Haskell practice. The task presented on the problem 1999-c is related to a small DSL which handles concurrency simulations, using two simple instruction called lock and unlock to switch between running and ready states. The DSL defined for this problem seems to be simple. I have used the Parsec Haskell package to build the language parser.

impressions on hlint

by Daniel Molina Wegener on 2011.11.24
posted in: development, haskell, programming, tips

I have worked with various static analysis tools, but the first time that I have worked with hlint, the Haskell static checker, I was impressed because it has suggested me a η-reduction. What is a η-reduction?, in simple words it finds λ equivalences between expressions, reducing function call sequences to less functions. The most classic reduction is the identity combinator reduction, where a function with the form (λxyz.(x)yz)(λrs.t)mn can be reduced just to the function application t.