Created
September 24, 2017 08:52
-
-
Save CoditCompany/e37950ca946568dfc83a24a65a1745fc 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
| let customer country name street city state postal = | |
| { Country = country | |
| FullName = name | |
| Street = street | |
| State = state | |
| City = city | |
| PostalCode = postal } | |
| let optApply fOpt xOpt = | |
| match fOpt, xOpt with | |
| | Some f, Some x -> f x |> Some | |
| | _, _ -> None | |
| let optCustomer country name street city state postal = | |
| let (<!>) = Option.map | |
| let (<*>) = optApply | |
| customer <!> country <*> name <*> street <*> city <*> state <*> postal | |
| let pcustomer = pipe6 country fullname street city state postal optCustomer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment