The solution for the list version is very straightforward in elm:
https://ellie-app.com/g4DpfMDxPa1/0

On Sun, Nov 5, 2017 at 10:39 PM, Ray Toal <ray.t...@gmail.com> wrote:

> There's an interesting problem on the Programming Puzzles and Stack
> Exchange on arbitrary length currying here: https://codegolf.
> stackexchange.com/questions/117017/arbitrary-length-currying. It asks for
> a function f behaving as follows:
>
>     f () = 0
>     f (3)(9)(2)() = 14
>
> This is trivial in dynamically typed languages that don't care about the
> number of arguments, and is easy to do in statically typed languages which
> allow overloading. But what about the ML-like languages?
>
> The only ML-like language with a solution is Haskell. Its author says "Forcing
> Haskell's strict type system to allow this requires some magic, namely,
> enabling the GHC extension for flexible typeclass instances."
>
> Is this problem impossible in Elm?
>
> If impossibie, can a solution be found to a related problem, say where the
> arguments are lists?, e.g.
>
>     f [] = 0
>     f [3] [9] [2] [] = 14
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to