Skip to content

Commit e974f0e

Browse files
authored
readme: add content (#4)
1 parent 7824c94 commit e974f0e

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,31 @@
66
[![Coverage](https://codecov.io/gh/JuliaFunctional/FixFunctionArgument.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/JuliaFunctional/FixFunctionArgument.jl)
77
[![PkgEval](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/F/FixFunctionArgument.svg)](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/F/FixFunctionArgument.html)
88
[![Aqua](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)
9+
10+
A Julia package for fixing a given positional argument to a given callable. Intended as a straight improvement upon and stand-in replacement for `Base.Fix` (including `Base.Fix1` and `Base.Fix2`).
11+
12+
## Provided functionality
13+
14+
The package exports the following bindings:
15+
16+
* `Fix`
17+
18+
* `Fix1`
19+
20+
* `Fix2`
21+
22+
The usage is the same as with the `Base` counterparts.
23+
24+
## Motivation
25+
26+
`Base.Fix` fails to be a zero-cost abstraction when the provided callable or the provided argument to fix are types. `Fix` handles that case as expected:
27+
28+
```julia-repl
29+
julia> sizeof(Base.Fix1(convert, Float32))
30+
8
31+
32+
julia> using FixFunctionArgument
33+
34+
julia> sizeof(Fix1(convert, Float32))
35+
0
36+
```

0 commit comments

Comments
 (0)