git.iko.soy/rowtype-yoga/psfp
on master help sign in
Add playground
97117afMark Eibes
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
89 , module Type.Proxy
89 , module Type.Proxy
90 , module Unsafe.Coerce
90 , module Unsafe.Coerce
91 , module Simple.JSON
91 , module Simple.JSON
92+ , module Effect.Console
92 ) where
93 ) where
93
94
94import Effect.Console (log, logShow)
95import Effect.Console (log, logShow)
@@ -1072,9 +1073,3 @@ import Type.Proxy
1072import Unsafe.Coerce
1073import Unsafe.Coerce
1073 ( unsafeCoerce
1074 ( unsafeCoerce
1074 )
1075 )
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
2
2
3import Grimoire
3import Grimoire
4
4
5−incantation :: Effect Unit
5+main :: Effect Unit
6−incantation = cast "Abracadabra"
6+main = log "Abracadabra"