2009-05-18から1日間の記事一覧

TMP で Maybe モナド

namespace monad { namespace maybe { struct nothing { }; template<class A> struct just { }; template<class A> struct ret { typedef just<A> type; }; template<class M, template<class> class F> struct bind; template<class A, template<class> class F> struct bind<just<A>, F> { typedef typename F<A>::type …</a></just<a></class></class></a></class></class>