git.iko.soy
/
rowtype-yoga/purescript-native
readme
files
commits
refs
on
golang
help
sign in
Deriving tests
05e5c18
Phil Freeman
11 years ago
examples/passing/Deriving.purs
new file
+19
compare with golang
unified
split
@@ -0,0 +1,19 @@
1
+
module Main where
2
+
3
+
import Prelude
4
+
import Test.Assert
5
+
6
+
data X = X Int | Y String
7
+
8
+
derive instance eqX :: Eq X
9
+
10
+
derive instance ordX :: Ord X
11
+
12
+
main = do
13
+
assert $ X 0 == X 0
14
+
assert $ X 0 /= X 1
15
+
assert $ Y "Foo" == Y "Foo"
16
+
assert $ Y "Foo" /= Y "Bar"
17
+
assert $ X 0 < X 1
18
+
assert $ X 0 < Y "Foo"
19
+
assert $ Y "Bar" < Y "Baz"
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