File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -332,8 +332,25 @@ eltype(x) = eltype(typeof(x))
332
332
333
333
|> (x, f) = f (x)
334
334
335
+ """
336
+ ∘(f, g)
337
+ f ∘ g
338
+
339
+ Creates a composition of two functions (or functor objects), such that
340
+ `(f ∘ g)(x...) == f(g(x...))`. The `∘` symbol can be accessed at the REPL using
341
+ `\\ circ`.
342
+
343
+ By default, an anonymous function `(x...) -> f(g(x...))` is returned, but this may
344
+ be specialized to create any functionally-equivalent callable object.
345
+ """
335
346
∘ (f, g) = (x... )-> f (g (x... ))
336
347
348
+ """
349
+ !(f::Function)
350
+
351
+ Applies boolean not to the output of `f`, return a new function
352
+ `(x...) -> !f(x...)` such that `(!f)(x...) = !(f(x...))`.
353
+ """
337
354
! (f:: Function ) = (x... )-> ! f (x... )
338
355
339
356
# array shape rules
Original file line number Diff line number Diff line change @@ -55,3 +55,6 @@ let xs = [[i:i+4;] for i in 1:10]
55
55
@test max (xs[1 : n]. .. ) == [n: n+ 4 ;]
56
56
end
57
57
end
58
+
59
+ @test ((x -> x+ 1 ) ∘ (x _> 2 x))(5 ) == 11
60
+ @test (! isless)(1 ,2 ) == false
You can’t perform that action at this time.
0 commit comments