mirror of
https://github.com/valitydev/parse_trans.git
synced 2024-11-06 00:25:16 +00:00
16 lines
250 B
Erlang
16 lines
250 B
Erlang
-module(t_ex).
|
|
|
|
-record(r, {a,b}).
|
|
|
|
-export(['sel-r'/1]).
|
|
|
|
-spec 'sel-r'(a | b) ->
|
|
{fun((#r{}) -> any()), fun((any(), #r{}) -> #r{})}.
|
|
'sel-r'(a) ->
|
|
{fun(#r{a = A}) ->
|
|
A
|
|
end,
|
|
fun(X, #r{} = R) ->
|
|
R#r{a = X}
|
|
end}.
|