git.iko.soy
/
rowtype-yoga/purescript-native
readme
files
commits
refs
on
golang
help
sign in
Add tests
db7e0fe
Gary Burgess
12 years ago
examples/passing/HoistError.purs
new file
+17
compare with golang
unified
split
@@ -0,0 +1,17 @@
1
+
module Main where
2
+
3
+
import Control.Monad.Eff
4
+
import Debug.Trace
5
+
6
+
foreign import f
7
+
"function f(x) {\
8
+
\ return function () {\
9
+
\ if (x !== 0) throw new Error('x is not 0');\
10
+
\ }\
11
+
\}" :: forall e. Number -> Eff e Number
12
+
13
+
main = do
14
+
let x = 0
15
+
f x
16
+
let x = 1 + 1
17
+
trace "Done"
examples/passing/ShadowedTCO.purs
new file
+16
@@ -0,0 +1,16 @@
1
+
module Main where
2
+
3
+
runNat f = f 0 (\n -> n + 1)
4
+
5
+
zero z _ = z
6
+
7
+
succ f zero succ = succ (f zero succ)
8
+
9
+
add f g zero succ = g (f zero succ) succ
10
+
11
+
one = succ zero
12
+
two = succ one
13
+
four = add two two
14
+
fourNumber = runNat four
15
+
16
+
main = Debug.Trace.trace $ show fourNumber
keys
esc to close
j k
move down, up
enter
open
esc
back, or up a level
1 2 3 4
readme, files, commits, refs
/
filter
y
copy the clone command
c
compare the chosen commit with another (or shift-click both)
?
show or hide this list