Skip to content

Commit

Permalink
try to fix doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
archermarx committed Jul 4, 2023
1 parent d1797e8 commit 6ca2e0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/PartialFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ julia> (+) <| (2, 3)...
5
julia> map \$ Int <| [1.0, 2.0, 3.0]
3-element Array{Int64,1}:
3-element Vector{Int64}:
1
2
3
Expand Down
6 changes: 3 additions & 3 deletions src/reversedfunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ struct ReversedFunction{F<:Function} <: Function
func::F
ReversedFunction(rf::ReversedFunction) = rf.func
ReversedFunction(f::F) where F<:Function = new{F}(f)
end
end

(r::ReversedFunction)(args...) = r.func(reverse(args)...)

"""
flip(f::Function)
Creates a function which takes arguments in backwards order from f, that is last argument first, and so on. Returns a
Creates a function which takes arguments in backwards order from f, that is last argument first, and so on. Returns a
[`PartialFunctions.ReversedFunction{typeof(f)}`](@ref). Flipping a ReversedFunction returns the original function.
## Examples
## Examples
```jldoctest
julia> firstsecond(first, second) = (first = first, second = second)
Expand Down

0 comments on commit 6ca2e0c

Please sign in to comment.