On Tuesday, 18 August 2015 at 14:25:34 UTC, Roland Hadinger wrote:
Hi!
Suppose I wanna do this (which already works, which is why D is
pretty cool):
import std.traits;
import std.typecons : Nullable;
// Retrofit Nullable to allow for monadic chaining
//
auto apply( alias
Hi!
Suppose I wanna do this (which already works, which is why D is
pretty cool):
import std.traits;
import std.typecons : Nullable;
// Retrofit Nullable to allow for monadic chaining
//
auto apply( alias fun, T )( Nullable!T nullable )
if( isSomeFunction!fun )
On Tuesday, 18 August 2015 at 15:11:34 UTC, John Colvin wrote:
for simple lambdas like that (i.e. function templates with one
template arguments that corresponds to the type of the first
and only argument), just add this template overload:
auto apply( alias fun, T )( Nullable!T nullable )