Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate MultiPropertyLens and @settable #118

Merged
merged 2 commits into from
Jan 7, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/experimental.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ export MultiPropertyLens
const NNamedTupleLens{N,s} = NamedTuple{s, T} where {T <: NTuple{N, Lens}}
struct MultiPropertyLens{L <: NNamedTupleLens} <: Lens
lenses::L
function MultiPropertyLens(lenses::L) where {L <: NNamedTupleLens}
@warn """
jw3126 marked this conversation as resolved.
Show resolved Hide resolved
`MultiPropertyLens` is planned to be removed. Please see [`Kaleido.jl`](https://github.com/tkf/Kaleido.jl) for a couple of similar useful lenses.
"""
new{L}(lenses)
end
end

_keys(::Type{MultiPropertyLens{NamedTuple{s,T}}}) where {s,T} = s
Expand Down
7 changes: 7 additions & 0 deletions src/settable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ using MacroTools: splitdef, combinedef
using MacroTools: splitstructdef, isstructdef, combinestructdef

macro settable(ex)
@warn """
`Setfield.@settable` is planned to be removed. We believe that it is no longer needed.
Please try to remove it from your code. This might involve fixing some constructor calls,
but should be easy. If it turns out hard and you believe you have a use case, where `@settable`
is really crucial, please open an issue in the `Setfield` github repo:
https://github.com/jw3126/Setfield.jl/issues
"""
esc(settable(__module__, ex))
end

Expand Down