Created
February 26, 2019 21:50
-
-
Save leighman/a0a599f592914893687a936797b178b3 to your computer and use it in GitHub Desktop.
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
module Main where | |
import Prelude | |
import Control.Monad.Eff.Console (logShow) | |
import Data.Maybe (Maybe(..)) | |
import Data.Either (Either(..)) | |
import TryPureScript | |
main = render =<< withConsole do | |
logShow $ [1, 2, 3] <#> add1 | |
logShow $ [Just 1, Just 2, Nothing] <#> map add1 | |
logShow $ [[1, 2], [3], []] <#> map add1 | |
logShow $ [Right 1, Right 2, Left "error"] <#> map add1 | |
logShow $ explainMe | |
add1 = (+) 1 | |
times2 = (*) 2 | |
explainMe = [add1, times2] <#> map add1 <#> \f -> f 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment