{"action":"created","issue":{"url":"https://api.github.com/repos/chrisdone/lucid/issues/86","repository_url":"https://api.github.com/repos/chrisdone/lucid","labels_url":"https://api.github.com/repos/chrisdone/lucid/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/chrisdone/lucid/issues/86/comments","events_url":"https://api.github.com/repos/chrisdone/lucid/issues/86/events","html_url":"https://github.com/chrisdone/lucid/issues/86","id":344260071,"node_id":"MDU6SXNzdWUzNDQyNjAwNzE=","number":86,"title":"How to prevent Text from being composed with HtmlT","user":{"login":"saurabhnanda","id":28369,"node_id":"MDQ6VXNlcjI4MzY5","avatar_url":"https://avatars0.githubusercontent.com/u/28369?v=4","gravatar_id":"","url":"https://api.github.com/users/saurabhnanda","html_url":"https://github.com/saurabhnanda","followers_url":"https://api.github.com/users/saurabhnanda/followers","following_url":"https://api.github.com/users/saurabhnanda/following{/other_user}","gists_url":"https://api.github.com/users/saurabhnanda/gists{/gist_id}","starred_url":"https://api.github.com/users/saurabhnanda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saurabhnanda/subscriptions","organizations_url":"https://api.github.com/users/saurabhnanda/orgs","repos_url":"https://api.github.com/users/saurabhnanda/repos","events_url":"https://api.github.com/users/saurabhnanda/events{/privacy}","received_events_url":"https://api.github.com/users/saurabhnanda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-07-25T01:37:30Z","updated_at":"2018-07-25T18:36:01Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Yes, you read that right. Here is the context: we are trying to internationalize our application, and instead of manually verifying that there are no hard-coded strings in the HTML, we'd like the type-system to help us.\r\n\r\nIs there any way to force HtmlT to force the programmer to use IText instead of Text, where `newtype IText = IText Text` and the the only way the create an IText is via `I18n.t someTranslationKey`"},"comment":{"url":"https://api.github.com/repos/chrisdone/lucid/issues/comments/407853539","html_url":"https://github.com/chrisdone/lucid/issues/86#issuecomment-407853539","issue_url":"https://api.github.com/repos/chrisdone/lucid/issues/86","id":407853539,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzg1MzUzOQ==","user":{"login":"phadej","id":51087,"node_id":"MDQ6VXNlcjUxMDg3","avatar_url":"https://avatars2.githubusercontent.com/u/51087?v=4","gravatar_id":"","url":"https://api.github.com/users/phadej","html_url":"https://github.com/phadej","followers_url":"https://api.github.com/users/phadej/followers","following_url":"https://api.github.com/users/phadej/following{/other_user}","gists_url":"https://api.github.com/users/phadej/gists{/gist_id}","starred_url":"https://api.github.com/users/phadej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phadej/subscriptions","organizations_url":"https://api.github.com/users/phadej/orgs","repos_url":"https://api.github.com/users/phadej/repos","events_url":"https://api.github.com/users/phadej/events{/privacy}","received_events_url":"https://api.github.com/users/phadej/received_events","type":"User","site_admin":false},"created_at":"2018-07-25T18:36:00Z","updated_at":"2018-07-25T18:36:00Z","author_association":"COLLABORATOR","body":"You can break `lucid` in your application by\r\n\r\n(TL;DR define overlapping instance which will cause ambiguity errors)\r\n\r\n```haskell\r\nλ Lucid> renderBS $ b_ \"foo\"\r\n\"<b>foo</b>\"\r\nλ Lucid> :m +Data.String \r\nλ Lucid D.String> instance IsString (HtmlT m ())\r\n\r\n<interactive>:15:10: warning: [-Wmissing-methods]\r\n    • No explicit implementation for\r\n        ‘fromString’\r\n    • In the instance declaration for ‘IsString (HtmlT m ())’\r\nλ Lucid D.String> renderBS $ b_ \"foo\"\r\n\r\n<interactive>:16:15: error:\r\n    • Overlapping instances for IsString\r\n                                  (HtmlT Data.Functor.Identity.Identity a0)\r\n        arising from the literal ‘\"foo\"’\r\n      Matching instances:\r\n        instance (Monad m, a ~ ()) => IsString (HtmlT m a)\r\n          -- Defined in ‘Lucid.Base’\r\n        instance [safe] IsString (HtmlT m ())\r\n          -- Defined at <interactive>:15:10\r\n      (The choice depends on the instantiation of ‘a0’\r\n       To pick the first instance above, use IncoherentInstances\r\n       when compiling the other instance declarations)\r\n    • In the first argument of ‘b_’, namely ‘\"foo\"’\r\n      In the second argument of ‘($)’, namely ‘b_ \"foo\"’\r\n      In the expression: renderBS $ b_ \"foo\"\r\n``"}}
{"actor":{"display_login":"phadej"}}