git.iko.soy/rowtype-yoga/purescript-native
on ecbfa08 help sign in
rowtype-yoga/purescript-native/examples/passing/ExtendedInfixOperators.purs
20 lines 469 B history raw
1module Main where
3zipWith :: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
4zipWith _ [] _ = []
5zipWith _ _ [] = []
6zipWith f (x:xs) (y:ys) = f x y : zipWith f xs ys
8test1 = [1, 2, 3] `zipWith (+)` [4, 5, 6]
10comparing :: forall a b. (Ord b) => (a -> b) -> a -> a -> Ordering
11comparing f = compare `Data.Function.on` f
13sum [] = 0
14sum (x:xs) = x + sum xs
16test2 = [1, 2, 3] `comparing sum` [4, 5, 6]
18main = do
19 Debug.Trace.print test1
20 Debug.Trace.print test2