Created
December 2, 2018 12:45
-
-
Save jinjor/4c18236f89c555a64041a81af3355cd8 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
type alias OriginalFoo = | |
{ barText : Maybe String | |
, mustNum : Int | |
} | |
type alias Foo = | |
{ barText : String | |
, mustNum : Int | |
} | |
type alias Xxx = | |
{ barText : String | |
} | |
getFoo : Task x Foo | |
getFoo = | |
getOriginalFoo | |
|> Task.andThen | |
(\{ barText, mustNum } -> | |
case barText of | |
Just t -> | |
Task.succeed (Foo t mustNum) | |
Nothing -> | |
getXxx | |
|> Task.map | |
(\x -> | |
Foo x.barText mustNum | |
) | |
) | |
getOriginalFoo : Task x OriginalFoo | |
getOriginalFoo = | |
Debug.todo "" | |
getXxx : Task x Xxx | |
getXxx = | |
Debug.todo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment