git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Add failing Foldable testcase from #365
commit727f1f96443d5add10c3804346fe9ed1d9749912 authorDylan Simon <dylan@dylex.net> dateSun 26 Oct 2014, 21:58 (12 years ago) parent98edefb
1 file changed+12
examples/failing/Foldable.purs+12
examples/failing/Foldable.pursnew file+12
@@ -0,0 +1,12 @@
1+module Main where
2+
3+class Foldable f where
4+ fold :: forall a b. (a -> b -> b) -> b -> f a -> b
5+ size :: forall a. f a -> Number
6+
7+instance foldableArray :: Foldable [] where
8+ fold _ z [] = z
9+ fold f z (x:xs) = x `f` (fold f z xs)
10+ size = fold (const ((+) 1)) 0
11+
12+x = size [1,2,3]