I don't think its overly verbose as it is, ocaml has a feature called field
pruning:
When the name of a variable coincides with the name of a record field,
> OCaml provides some handy syntactic shortcuts. For example, the pattern in
> the following function binds all of the fields in question to variables of
> the same name.
let host_info_to_string { hostname; os_name; cpu_arch; timestamp; _ } =
sprintf "%s (%s / %s) <%s>" hostname os_name cpu_arch
(Time.to_string timestamp)
On Saturday, September 24, 2016 at 6:27:07 PM UTC+1, Joey Eremondi wrote:
>
> Can you give a concrete example of what this would look like in Elm? Are
> you sure this is compatible with type inference?
>
> On Sep 24, 2016 10:46 AM, "Zane Hitchcox" <[email protected]
> <javascript:>> wrote:
>
>> Shorthand property names like in javascript
>> <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer>
>>
>>
>> These are a great feature, and maybe elm can steal something from
>> javascript for a change.
>>
>>
>> Like I see no reason for this overly-verbose syntax:
>>
>>
>> main : Program Nevermain =
>> Html.App.program
>> { init = init
>> , view = view
>> , update = update
>> , subscriptions = subscriptions
>> }
>>
>> --
>> 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] <javascript:>.
>> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.