{"action":"created","issue":{"url":"https://api.github.com/repos/goldfirere/singletons/issues/115","labels_url":"https://api.github.com/repos/goldfirere/singletons/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/goldfirere/singletons/issues/115/comments","events_url":"https://api.github.com/repos/goldfirere/singletons/issues/115/events","html_url":"https://github.com/goldfirere/singletons/issues/115","id":69345950,"number":115,"title":"Singletons without S prefix","user":{"login":"andrewthad","id":5332484,"avatar_url":"https://avatars.githubusercontent.com/u/5332484?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewthad","html_url":"https://github.com/andrewthad","followers_url":"https://api.github.com/users/andrewthad/followers","following_url":"https://api.github.com/users/andrewthad/following{/other_user}","gists_url":"https://api.github.com/users/andrewthad/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewthad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewthad/subscriptions","organizations_url":"https://api.github.com/users/andrewthad/orgs","repos_url":"https://api.github.com/users/andrewthad/repos","events_url":"https://api.github.com/users/andrewthad/events{/privacy}","received_events_url":"https://api.github.com/users/andrewthad/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-04-18T20:37:45Z","updated_at":"2015-07-22T03:20:50Z","closed_at":"2015-04-20T00:29:59Z","body":"When I make a type\r\n\r\n    data Color = Red | Green | Blue\r\n\r\nand then call `genSingletons`, I get nice singletons like `SGreen :: Sing Green`. It would be nice to be able have it named `Green` instead of `SGreen` though. I realize that there's still a data constructor named `Green` in scope, so there would be some ambiguity. I could always import `SGreen` into another module, rename it to `Green`, and export there, but that seems like a huge workaround to get this what I want. Is there a way to do something like this in the singletons package? Just to clarify, I don't care about the `Green` data constructor. I don't even want it. I want to have `Green` to refer (on the value level) to the singleton and (on the type level) to a type of kind `Color`. Thanks.\r\n\r\nAs an addendum, my reason are largely motivated by style. I find prefixing everything with `S` to be unsightly.  "},"comment":{"url":"https://api.github.com/repos/goldfirere/singletons/issues/comments/123551006","html_url":"https://github.com/goldfirere/singletons/issues/115#issuecomment-123551006","issue_url":"https://api.github.com/repos/goldfirere/singletons/issues/115","id":123551006,"user":{"login":"gibiansky","id":1865411,"avatar_url":"https://avatars.githubusercontent.com/u/1865411?v=3","gravatar_id":"","url":"https://api.github.com/users/gibiansky","html_url":"https://github.com/gibiansky","followers_url":"https://api.github.com/users/gibiansky/followers","following_url":"https://api.github.com/users/gibiansky/following{/other_user}","gists_url":"https://api.github.com/users/gibiansky/gists{/gist_id}","starred_url":"https://api.github.com/users/gibiansky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gibiansky/subscriptions","organizations_url":"https://api.github.com/users/gibiansky/orgs","repos_url":"https://api.github.com/users/gibiansky/repos","events_url":"https://api.github.com/users/gibiansky/events{/privacy}","received_events_url":"https://api.github.com/users/gibiansky/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T03:20:50Z","updated_at":"2015-07-22T03:20:50Z","body":"The same effect meaning allowing us to write constructors without the `S`.\r\n\r\nFor example, we roughly have the following:\r\n```\r\n-- can't change this because singletons generates it\r\ndata WithS = SField1 | SField2 | SField3\r\n```\r\nbut we can add\r\n```\r\npattern Field1 = SField1\r\npattern Field2 = SField2\r\npattern Field3 = SField3\r\n```\r\n\r\nThis poses some challenges but perhaps we can use this mechanism to provide convenient naming without the `S`. I'm not exactly sure whether it's possible, and I don't know how pattern synonyms are treated at the type level and whether there will be some sort of collisions; perhaps we can also fiddle with our original names to avoid this. We'll see if we can perhaps hide some of the `singletons`-based implementation details using a large number of hand crafted pattern synonyms.\r\n\r\n(We are using `singletons` with `vinyl` to implement dynamic widgets, which are interactive GUI elements that have a list of properties that can be modified and processed; `singletons` is used to represent the ADT containing the fields we allow in the widgets and we pass things like `SClickHandler` or `SBackgroundColor` to a function called `setField` to modify a field of a widget. It will take another week or two of work but there should be a release soon – it's been an incredibly productive GSoC.)"}}