That feature, for pattern matching, Elm already has.

> Am 24.09.2016 um 20:38 schrieb Dave Thomas <[email protected]>:
> 
> 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]> wrote:
>>> Shorthand property names like in javascript
>>> 
>>> 
>>> 
>>> 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 Never
>>> main =
>>>     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].
>>> 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.

-- 
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.

Reply via email to