git.iko.soy
/
rowtype-yoga/purescript-native
readme
files
commits
refs
on
golang
help
sign in
Add test for Prelude's unsafeCompare FFI call
a1b6402
Gary Burgess
12 years ago
examples/passing/Comparisons.purs
new file
+23
compare with golang
unified
split
@@ -0,0 +1,23 @@
1
+
module Main where
2
+
3
+
import Control.Monad.Eff
4
+
import Debug.Trace
5
+
6
+
foreign import data Assert :: !
7
+
8
+
foreign import assert
9
+
"function assert(x) {\
10
+
\ return function () {\
11
+
\ if (!x) throw new Error('assertion failed');\
12
+
\ return {};\
13
+
\ };\
14
+
\};" :: forall e. Boolean -> Eff (assert :: Assert | e) Unit
15
+
16
+
main = do
17
+
assert (1 < 2)
18
+
assert (2 == 2)
19
+
assert (3 > 1)
20
+
assert ("a" < "b")
21
+
assert ("a" == "a")
22
+
assert ("z" > "a")
23
+
trace "Done!"
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