-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor corrections on test and the function of the class was removed.
- Loading branch information
Pedro Paulo Amorim
committed
Apr 15, 2016
1 parent
6c203d9
commit e49925d
Showing
3 changed files
with
4 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
package com.jmonad.kaybe | ||
|
||
class Maybe { | ||
fun <T> maybe(value : IMaybe<T>) : IMaybe<T> = value | ||
fun <T> maybe(value : T) = if (value == null) Nothing<T>() else Just(value) | ||
} | ||
fun <T> maybe(value : IMaybe<T>) : IMaybe<T> = value | ||
fun <T> maybe(value : T) = if (value == null) Nothing<T>() else Just(value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
package com.jmonad.kaybe | ||
|
||
import org.junit.Test | ||
import org.junit.Assert.assertEquals | ||
import com.jmonad.kaybe.Maybe | ||
|
||
class MaybeTest { | ||
|
||
@Test fun testSample() { | ||
// assert maybe("sample").fromMaybe("").equals("sample"); | ||
maybe(1).bind { } | ||
} | ||
|
||
} |