{"action":"closed","issue":{"url":"https://api.github.com/repos/baronfel/fsharp-lang-suggestions-final/issues/456","repository_url":"https://api.github.com/repos/baronfel/fsharp-lang-suggestions-final","labels_url":"https://api.github.com/repos/baronfel/fsharp-lang-suggestions-final/issues/456/labels{/name}","comments_url":"https://api.github.com/repos/baronfel/fsharp-lang-suggestions-final/issues/456/comments","events_url":"https://api.github.com/repos/baronfel/fsharp-lang-suggestions-final/issues/456/events","html_url":"https://github.com/baronfel/fsharp-lang-suggestions-final/issues/456","id":184124448,"number":456,"title":"Add constraints as a language construct","user":{"login":"baronfel","id":573979,"avatar_url":"https://avatars.githubusercontent.com/u/573979?v=3","gravatar_id":"","url":"https://api.github.com/users/baronfel","html_url":"https://github.com/baronfel","followers_url":"https://api.github.com/users/baronfel/followers","following_url":"https://api.github.com/users/baronfel/following{/other_user}","gists_url":"https://api.github.com/users/baronfel/gists{/gist_id}","starred_url":"https://api.github.com/users/baronfel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baronfel/subscriptions","organizations_url":"https://api.github.com/users/baronfel/orgs","repos_url":"https://api.github.com/users/baronfel/repos","events_url":"https://api.github.com/users/baronfel/events{/privacy}","received_events_url":"https://api.github.com/users/baronfel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/baronfel/fsharp-lang-suggestions-final/labels/declined","name":"declined","color":"171819"},{"url":"https://api.github.com/repos/baronfel/fsharp-lang-suggestions-final/labels/votes:11-50","name":"votes:11-50","color":"333333"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-20T03:05:20Z","updated_at":"2016-10-20T03:52:53Z","closed_at":"2016-10-20T03:52:53Z","body":"# Add constraints as a language construct [8509687] #\n\n**Submitted by Jared Hester on 6/22/2015 12:00:00 AM**  \n**36 votes on UserVoice prior to migration**  \n\nAllow the declaration of named constraints that can have other named constraints nested within them and are resolved at runtime or compile time based on their structure , e.g.\r\nconstraint (^a:eatsDrinksSleeps) =\r\nwhen ^a : equality\r\nand ^a : comparison\r\nand ^a : (static member Hungry: bool)\r\nand ^a : (member chews: string -> bool)\r\nand ^a : (member drinks: float -> bool)\r\nand ^a : (member sleepsFor: float with get,set)\r\nlet inline go_wild (beast:^a when ^a: eatsDrinksSleeps) = ...\r\n--------------------------------------------------------------------------------\r\nThey could also be defined on flexible types that take generic parameters -\r\nconstraint (#seq<'a> : greatData) =\r\nwhen 'a: struct\r\nand 'a: comparison\r\nand 'a: equality\r\nlet calc (col:'a when 'a:greatData) = ....\n\n\n\n## Response ##\n** by fslang-admin on 2/10/2016 12:00:00 AM **\n\nThanks for the suggestion. It is entirely reasonable and it’s taken me a long time to mark it as declined. I’ve listed the reasons below – and /archive/suggestion-5762135-support-for-type-classes-or-implicits can be used as a placeholder for requests in the type-class/constraint area\r\nDon Syme\r\nF# Language Evolution\n\n\n**[Original UserVoice Submission](https://fslang.uservoice.com/forums/245727-f-language/suggestions/8509687)**\n[Archived Uservoice Comments](../tree/master/archive/suggestion-8509687-add-constraints-as-a-language-construct.md#comments)\n"}}
{"actor":{"display_login":"baronfel"}}