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

(feat) also output full parameters functions aliases (/2 /3 ...) #349

Open
sdancer opened this issue Aug 4, 2020 · 1 comment
Open

(feat) also output full parameters functions aliases (/2 /3 ...) #349

sdancer opened this issue Aug 4, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request feature

Comments

@sdancer
Copy link
Contributor

sdancer commented Aug 4, 2020

currently the compiler generates this functions, (useful for composition on hamler):

'and'/1 =
fun(_0) ->
fun(_1) ->
let <_2, _3> = <_0, _1>
in case <_2, _3> of
<'true', 'true'> when 'true' ->
'true'
<_100, _101> when 'true' ->
'false'
end

can have it generate the /2 alias too, something like (useful for calling hamler from other langs), hamler itself wouldn't use or call these, although it could as a compiler optimization

'and'/2 =
let <_2, _3> = <_0, _1>
in case <_2, _3> of
<'true', 'true'> when 'true' ->
'true'
<_100, _101> when 'true' ->
'false'
end

@emqplus
Copy link
Contributor

emqplus commented Aug 5, 2020

@Lissana Yes. It's inconvenient to call the functions generated by Hamler in Erlang/Elixir now, for the functions in Hamler are curried when compiled to CoreErlang.

@EMQ-YangM could we generate uncurried functions in CoreErlang?

@emqplus emqplus added this to the 0.3 - OTP Libs milestone Aug 5, 2020
@emqplus emqplus self-assigned this Aug 5, 2020
@emqplus emqplus added enhancement New feature or request feature labels Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature
Projects
None yet
Development

No branches or pull requests

2 participants