{"action":"created","issue":{"url":"https://api.github.com/repos/Soostone/string-conv/issues/2","repository_url":"https://api.github.com/repos/Soostone/string-conv","labels_url":"https://api.github.com/repos/Soostone/string-conv/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/Soostone/string-conv/issues/2/comments","events_url":"https://api.github.com/repos/Soostone/string-conv/issues/2/events","html_url":"https://github.com/Soostone/string-conv/issues/2","id":160856198,"number":2,"title":"Instance for `Functor` and `(->)`","user":{"login":"guibou","id":9705357,"avatar_url":"https://avatars.githubusercontent.com/u/9705357?v=3","gravatar_id":"","url":"https://api.github.com/users/guibou","html_url":"https://github.com/guibou","followers_url":"https://api.github.com/users/guibou/followers","following_url":"https://api.github.com/users/guibou/following{/other_user}","gists_url":"https://api.github.com/users/guibou/gists{/gist_id}","starred_url":"https://api.github.com/users/guibou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guibou/subscriptions","organizations_url":"https://api.github.com/users/guibou/orgs","repos_url":"https://api.github.com/users/guibou/repos","events_url":"https://api.github.com/users/guibou/events{/privacy}","received_events_url":"https://api.github.com/users/guibou/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-17T10:15:03Z","updated_at":"2016-06-21T06:11:06Z","closed_at":"2016-06-21T06:11:06Z","body":"I'm experimenting with instances of `StringConv` like:\r\n\r\n```haskell\r\ninstance (StringConv c a, StringConv b d) => StringConv (a -> b) (c -> d) where\r\n  strConv _ fa = \\x -> toS (fa (toS x))\r\n\r\ninstance (Functor f, StringConv a b) => StringConv (f a) (f b) where\r\n  strConv _ = fmap toS\r\n```\r\n\r\nThis allows to build higher level function using `toS`. For example `toS getArgs :: IO [Text]` and `toS System.FilePath.addExtension :: Text -> Text -> Text`. More generally, it can replace a painful call such as `toS <$> f (toS a) (toS b) (toS c)` to `(toS f) a b c`.\r\n\r\nI think that the `(a -> b)` and `Functor` instances are enough for most use cases. However is this an overkill feature for minor convenience ?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Soostone/string-conv/issues/comments/227349427","html_url":"https://github.com/Soostone/string-conv/issues/2#issuecomment-227349427","issue_url":"https://api.github.com/repos/Soostone/string-conv/issues/2","id":227349427,"user":{"login":"guibou","id":9705357,"avatar_url":"https://avatars.githubusercontent.com/u/9705357?v=3","gravatar_id":"","url":"https://api.github.com/users/guibou","html_url":"https://github.com/guibou","followers_url":"https://api.github.com/users/guibou/followers","following_url":"https://api.github.com/users/guibou/following{/other_user}","gists_url":"https://api.github.com/users/guibou/gists{/gist_id}","starred_url":"https://api.github.com/users/guibou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guibou/subscriptions","organizations_url":"https://api.github.com/users/guibou/orgs","repos_url":"https://api.github.com/users/guibou/repos","events_url":"https://api.github.com/users/guibou/events{/privacy}","received_events_url":"https://api.github.com/users/guibou/received_events","type":"User","site_admin":false},"created_at":"2016-06-21T06:11:06Z","updated_at":"2016-06-21T06:11:06Z","body":"You are right ;)"}}
{"actor":{"display_login":"guibou"}}