git.iko.soy/rowtype-yoga/psfp
on master help sign in
Add playground
commit97117af5280d928b8e3ce02d919094518880a9b2 authorMark Eibes <mark.eibes@gmail.com> dateSun 9 Aug 2020, 19:09 (6 years ago) parentf8046d6
3 files changed+12−9
playground/run.js+9−1 playground/src/Grimoire.purs+1−6 playground/src/Main.purs+2−2
playground/run.js+9−1
@@ -1 +1,9 @@
1−require ("./output/Main").incantation()
1+const main = require ("./output/Main")
2+if(main.main == undefined) {
3+ console.error("You are missing a 'main' function")
4+} else if (main.main instanceof Function) {
5+ main.main()
6+}
7+else {
8+ console.error("Make sure that you're main function is of type `Effect Unit`")
9+}
playground/src/Grimoire.purs+1−6
@@ -89,6 +89,7 @@ module Grimoire
8989 , module Type.Proxy
9090 , module Unsafe.Coerce
9191 , module Simple.JSON
92+ , module Effect.Console
9293 ) where
9394
9495import Effect.Console (log, logShow)
@@ -1072,9 +1073,3 @@ import Type.Proxy
10721073import Unsafe.Coerce
10731074 ( unsafeCoerce
10741075 )
1075−
1076−cast :: String -> Effect Unit
1077−cast = log
1078−
1079−summon :: forall a. Show a => a -> Effect Unit
1080−summon = logShow
playground/src/Main.purs+2−2
@@ -2,5 +2,5 @@ module Main where
22
33import Grimoire
44
5−incantation :: Effect Unit
6−incantation = cast "Abracadabra"
5+main :: Effect Unit
6+main = log "Abracadabra"