git.iko.soy
/
rowtype-yoga/purescript-native
readme
files
commits
refs
on
golang
help
sign in
More superclasses tests
de77134
Phil Freeman
13 years ago
examples/failing/Superclasses1.purs
new file
+11
compare with golang
unified
split
@@ -0,0 +1,11 @@
1
+
module Main where
2
+
3
+
class Su a where
4
+
su :: a -> a
5
+
6
+
class (Su a) <= Cl a where
7
+
cl :: a -> a -> a
8
+
9
+
instance clNumber :: Cl Number where
10
+
cl n m = n + m
11
+
examples/passing/Superclasses.purs → examples/passing/Superclasses1.purs
renamed
The content is the same.
examples/passing/Superclasses2.purs
new file
+20
@@ -0,0 +1,20 @@
1
+
module Main where
2
+
3
+
class Su a where
4
+
su :: a -> a
5
+
6
+
class (Su [a]) <= Cl a where
7
+
cl :: a -> a -> a
8
+
9
+
instance suNumber :: Su Number where
10
+
su n = n + 1
11
+
12
+
instance suArray :: (Su a) => Su [a] where
13
+
su (x : _) = [su x]
14
+
15
+
instance clNumber :: Cl Number where
16
+
cl n m = n + m
17
+
18
+
test :: forall a. (Cl a) => a -> [a]
19
+
test x = su [cl x x]
20
+
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