Re: [elixir-core:9357] [Proposal] Add Function.const/2

2020-02-04 Thread Amos King
Ben, That is how const is used in Haskell. Although without currying I don’t see how it is useful. I’m waiting to see an example that drives it home. I agree with Bruce about naming concepts but I don’t see the concept as useful in Elixir. Bruce, do you have a code sample using the idea? Amos

Re: [elixir-core:9357] [Proposal] Add Function.const/2

2020-02-04 Thread Ben Wilson
Addendum: I re-read the proposal because the const/1 vs const/2 thing confused me, and I'm seeing both in play there. The spec is arity 2, the example right after though is arity 1, and the Enum example is arity 2 but without a constant value. The Enum example perhaps makes the most sense,