{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/774","labels_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/774/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/774/comments","events_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/774/events","html_url":"https://github.com/Microsoft/visualfsharp/issues/774","id":120992931,"number":774,"title":"Type annotation adjacency warning doesn't consider operator names","user":{"login":"frankshearar","id":263056,"avatar_url":"https://avatars.githubusercontent.com/u/263056?v=3","gravatar_id":"","url":"https://api.github.com/users/frankshearar","html_url":"https://github.com/frankshearar","followers_url":"https://api.github.com/users/frankshearar/followers","following_url":"https://api.github.com/users/frankshearar/following{/other_user}","gists_url":"https://api.github.com/users/frankshearar/gists{/gist_id}","starred_url":"https://api.github.com/users/frankshearar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankshearar/subscriptions","organizations_url":"https://api.github.com/users/frankshearar/orgs","repos_url":"https://api.github.com/users/frankshearar/repos","events_url":"https://api.github.com/users/frankshearar/events{/privacy}","received_events_url":"https://api.github.com/users/frankshearar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-08T12:02:04Z","updated_at":"2015-12-08T16:22:07Z","closed_at":null,"body":"In this snippet,\r\n\r\n````fsharp\r\ntype Digit<'a> = 'a list\r\ntype FingerTree<'a> =\r\n    | Empty\r\n    | Single of 'a\r\n    | Deep of Digit<'a> * FingerTree<Node<'a>> * Digit<'a>\r\n\r\nlet rec (<<)<'a> (a: 'a) (tree: FingerTree<'a>): FingerTree<'a> =\r\n    match tree with\r\n    | Empty -> Single a\r\n    | Single b -> Deep ([a], Empty, [b])\r\n    | Deep ([b; c; d; e], m, suffix) -> Deep ([a; b], (Node3 (c, d, e)) << m, suffix)\r\n    | Deep (prefix, m, suffix) -> Deep (List.append [a] prefix, m, suffix)\r\n````\r\n\r\nthe compiler warns that \"Type parameters must be placed directly adjacent to the type name\". Presumably that's because the method name is surrounded by ()s.\r\n\r\n(I need the `<'a>` because the function takes a FingerTree<'a> but the recursion takes a FingerTree<Node<'a>>.)\r\n\r\nIf I make the operator a function, instead --\r\n\r\n````fsharp\r\n    let rec addToFront<'a> (a: 'a) (tree: FingerTree<'a>): FingerTree<'a> =\r\n    match tree with\r\n    | Empty -> Single a\r\n    | Single b -> Deep ([a], Empty, [b])\r\n    | Deep ([b; c; d; e], m, suffix) -> Deep ([a; b], addToFront (Node3 (c, d, e)) m, suffix)\r\n    | Deep (prefix, m, suffix) -> Deep (List.append [a] prefix, m, suffix)\r\n````\r\n\r\n-- then everything works."},"comment":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/comments/162934430","html_url":"https://github.com/Microsoft/visualfsharp/issues/774#issuecomment-162934430","issue_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/774","id":162934430,"user":{"login":"frankshearar","id":263056,"avatar_url":"https://avatars.githubusercontent.com/u/263056?v=3","gravatar_id":"","url":"https://api.github.com/users/frankshearar","html_url":"https://github.com/frankshearar","followers_url":"https://api.github.com/users/frankshearar/followers","following_url":"https://api.github.com/users/frankshearar/following{/other_user}","gists_url":"https://api.github.com/users/frankshearar/gists{/gist_id}","starred_url":"https://api.github.com/users/frankshearar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankshearar/subscriptions","organizations_url":"https://api.github.com/users/frankshearar/orgs","repos_url":"https://api.github.com/users/frankshearar/repos","events_url":"https://api.github.com/users/frankshearar/events{/privacy}","received_events_url":"https://api.github.com/users/frankshearar/received_events","type":"User","site_admin":false},"created_at":"2015-12-08T16:22:07Z","updated_at":"2015-12-08T16:22:07Z","body":"Hm, it does remove the squigglies... but then I'm defining a function, not an operator. I can't say `1 << myTree``. It's not a massive train smash: it just seems like an unnecessary wart."}}