maybe-d 0.0.1
Provides a Maybe-like data type and helpers.
To use this package, run the following command in your project's root directory:
						Manual usage
						
						Put the following dependency into your project's dependences section:
					
maybe-d
Simple syntactic sugar for a Maybe-like experience. Maybe(T) is just one small
step toward a world without null.
Example usage:
import maybe.d;
Maybe!string maybeReturnsString( bool shouldReturnString )
{
    if( shouldReturnString )
    {
        return just!string("foo");
    }
    else
    {
        return nothing!string;
    }
}
// prints "the string is foo"
writeln( "the string is " ~ maybeReturnsString(true).getOrElse("bar") );
// prints "the string is bar"
writeln( "the string is " ~ maybeReturnsString(false).getOrElse("bar") );
- 0.0.1 released 11 years ago
- dkhasel/maybe-d
- MIT
- Copyright © 2014, Damon Khasel
- Authors:
- Dependencies:
- none
- Versions:
- 
						
 Show all 2 versions0.0.1 2014-May-25 ~master 2014-May-25 
- Download Stats:
- 
						- 
								0 downloads today 
- 
								3 downloads this week 
- 
								3 downloads this month 
- 
								212 downloads total 
 
- 
								
- Score:
- 0.5
- Short URL:
- maybe-d.dub.pm