Skip to content

Instantly share code, notes, and snippets.

@erikkaplun
Created October 16, 2014 14:11
Show Gist options
  • Save erikkaplun/15911794af75dec5258d to your computer and use it in GitHub Desktop.
Save erikkaplun/15911794af75dec5258d to your computer and use it in GitHub Desktop.
// have
val params = (
(postalCode |> notNone("postal code missing")) |@|
(countryCode |> notNone("country code missing")).flatMap(validIso2CountryCode("country code invalid"))
)
// would like
val params = (
(postalCode |> notNone("postal code missing")) |@|
(countryCode |> (notNone("country code missing") ==> validIso2CountryCode("country code invalid")))
)
// ...where ==> is currently flatMap but that's beyond the idea here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment