git.iko.soy/rowtype-yoga/purescript-native
on 5159dfd help sign in
46 lines 812 B history raw
1module Operators1 where
3 (@@) :: forall a b. (a -> b) -> a -> b
4 (@@) = \f x -> f x
6 foo :: String -> String
7 foo = \s -> s
8
9 test8 = foo @@ "Hello World"
11 bar = \s1 s2 -> s1 ++ s2
13module Operators2 where
15 test1 = \(x, y, z) -> x * y + z(x)(y)
17 test2 = (\x -> x.foo false) { foo : \_ -> 1 }
19 test3 = (\(x, y) -> x)(1 + 2 * (1 + 2), true && (false || false))
21 k = \x -> \y -> x
23 test4 = 1 `k` 2
25 infixl 5 %%
27 (%%) = \x -> \y -> x * y + y
29 test5 = 1 %% 2 %% 3
31 test6 = ((\x -> x) `k` 2) 3
33 (<>) = \s1 -> \s2 -> s1 ++ s2
35 test7 = "Hello" <> "World!"
37 test9 = Operators1.foo Operators1.@@ "Hello World"
39 test10 = "Hello" `Operators1.bar` "World"
41 (...) :: forall a. [a] -> [a] -> [a]
42 (...) = \as -> \bs -> as
44 test11 = [1, 2, 3] ... [4, 5, 6]
46 test12 (<%>) a b = a <%> b