Want to get updates? You can add the feed link to your favourite feed reader. For email updates, you could subscribe via feedrabbit.
In a previous post, I described how to implement Functors in C++. Now I will try to represent the IO monad, with a few toy examples.
Read more...When I first learnt Haskell a while back, I found it difficult to adjust my thinking to the pure-functional style. Especially because I have been coding in imperative languages for more than 7 years before that. It took me a while to fully grasp and appreciate the elegance of these constructs in Haskell, like functors and monads. At some point, I attempted to implement the same constructs in C++, to help my understanding, and get a feel of the expressive power Haskell has.
Read more...Calculator programs are usually one of the first practice programs people implement. And writing a basic one in c++ is pretty straightforward. But today, I’ll demonstrate how to use your compiler (say gcc
or clang
) as a calculator!