Want to get updates? You can add the feed link to your favourite feed reader. For email updates, you could subscribe via feedrabbit.

#metaprogramming

Haskell in C++: The IO Monad

June 23, 2021

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...

Haskell in C++: Implementing pure functional constructs in c++ using templates

May 21, 2021

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...

A calculator in C++ - at compile time!

March 07, 2021

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!

Read more...
Blogs Home | Full Blogs List | All Tags