Last active
January 6, 2020 20:48
-
-
Save davidchase/4b7e0e2f1159616979919dd1dd97c876 to your computer and use it in GitHub Desktop.
Revisions
-
davidchase revised this gist
Jan 6, 2020 . No changes.There are no files selected for viewing
-
davidchase revised this gist
Jan 6, 2020 . 1 changed file with 17 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,10 +4,24 @@ import Prelude import Control.Monad.Eff (Eff) import Data.Foldable (fold) import TryPureScript (DOM, p, render, text) data Maybe a = Just a | Nothing map :: forall a b. (a -> b) -> Maybe a -> Maybe b map f n = case n of Just n -> Just (f n) Nothing -> Nothing toString x = case x of Just x -> "Just(" <> show x <> ")" Nothing -> "Nothing" main :: Eff (dom :: DOM) Unit main = render $ fold [ p (text $ toString $ Just 1), p (text $ toString $ map(\x -> x * x) $ Just 10)] -
davidchase created this gist
Jan 6, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ module Main where import Prelude import Control.Monad.Eff (Eff) import Data.Foldable (fold) import TryPureScript (DOM, h1, h2, p, text, list, indent, link, render, code) main :: Eff (dom :: DOM) Unit main = render $ fold [ h1 (text "Try PureScript!") , p (text "Try out the examples below, or create your own!")]