Created
September 24, 2017 11:40
-
-
Save RPallas92/2e6fa475a82f4d5dac66b918ee56b565 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//The fmap function is only applied on Success values. | |
let success: Validation<String, Int> = Validation.Success(1) | |
success.fmap{ $0 + 1 } | |
// ==> Validation.Success(2) | |
let failure: Validation<String, Int> = Validation.Failure("error") | |
failure.fmap{$0 + 1} | |
// ==> Validation.Failure("error") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment