Well the idea is to add a *different* keyword to make a function, using similar syntax to case/of . As above, you can see F# uses the 'function' keyword, which TBH I'm not huge fan of, it's really hard to google.
Elm already has syntax of convenience like this, for example instead of having to write a function for a record field access like this: '\x -> x.foo' you can just do: '.foo' The only reason for this is clearer, more concise code. So too would be the purpose behind the pattern matching function. It's quite a useful thing in F#, and one quite often used with |> (which I hear Elm inherited from F#). On Saturday, 8 October 2016 15:23:29 UTC+1, Joey Eremondi wrote: > > Much like how we don't have where clauses, the general approach in Elm is > to only have one syntax for a particular thing. > > On Oct 8, 2016 7:18 AM, "Luke Westby" <[email protected] <javascript:>> > wrote: > >> case .. of statements are only expressions, not functions, so you'll >> need to continue wrapping those statements with \x -> case x of >> >> >> -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
