Skip to content

Instantly share code, notes, and snippets.

View cognivore's full-sized avatar
💭
https://doma.dev

cognivore

💭
https://doma.dev
View GitHub Profile
@amrali
amrali / hkt.cpp
Created September 17, 2018 00:14 — forked from jhaberstro/hkt.cpp
Functor, Maybe, and Higher-Kinded Types in C++
// Example program
#include <iostream>
#include <string>
#include <vector>
#include <type_traits>
//---------------------
// Maybe and MyVector, two totally unrelated classes whose only commanilty is that they are both type constructors of the same arity (e.g. 1) and order (e.g. 1).
//---------------------
template< typename T >