diff options
Diffstat (limited to 'sca-cpp/trunk/kernel/monad.hpp')
-rw-r--r-- | sca-cpp/trunk/kernel/monad.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sca-cpp/trunk/kernel/monad.hpp b/sca-cpp/trunk/kernel/monad.hpp index a312827f6e..8aa4bc1662 100644 --- a/sca-cpp/trunk/kernel/monad.hpp +++ b/sca-cpp/trunk/kernel/monad.hpp @@ -241,6 +241,7 @@ private: template<typename A, typename B> friend const A content(const failable<A, B>& m); template<typename A, typename B> friend const B reason(const failable<A, B>& m); template<typename A, typename B> friend const failable<A, B> mkfailure(const B& f); + template<typename A> friend const failable<A, string> mkfailure(); bool hasv; V v; @@ -282,6 +283,10 @@ template<typename V> const failable<V> mkfailure(const char* f) { return mkfailure<V, string>(string(f)); } +template<typename V> const failable<V> mkfailure() { + return failable<V, string>(false, string()); +} + template<typename V, typename F> const lambda<failable<V, F>(const V)> failure() { return mkfailure<V, F>; } |