{"action":"created","issue":{"url":"https://api.github.com/repos/iconnect/regex/issues/70","repository_url":"https://api.github.com/repos/iconnect/regex","labels_url":"https://api.github.com/repos/iconnect/regex/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/iconnect/regex/issues/70/comments","events_url":"https://api.github.com/repos/iconnect/regex/issues/70/events","html_url":"https://github.com/iconnect/regex/issues/70","id":214060948,"number":70,"title":"Make `regex` compatible w/ TH-less GHCs","user":{"login":"hvr","id":285533,"avatar_url":"https://avatars0.githubusercontent.com/u/285533?v=3","gravatar_id":"","url":"https://api.github.com/users/hvr","html_url":"https://github.com/hvr","followers_url":"https://api.github.com/users/hvr/followers","following_url":"https://api.github.com/users/hvr/following{/other_user}","gists_url":"https://api.github.com/users/hvr/gists{/gist_id}","starred_url":"https://api.github.com/users/hvr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hvr/subscriptions","organizations_url":"https://api.github.com/users/hvr/orgs","repos_url":"https://api.github.com/users/hvr/repos","events_url":"https://api.github.com/users/hvr/events{/privacy}","received_events_url":"https://api.github.com/users/hvr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-14T12:47:46Z","updated_at":"2017-03-14T17:11:53Z","closed_at":null,"body":"I think `regex` can be made to avoid relying on `TemplateHaskell`+`QuasiQuotes` for recent GHC versions which provide the `TemplateHaskellQuotes` extension, which would have the benefit that GHCs which don't have interpreter support would be able to compile `regex`, and also the `TemplateHaskellQuotes` extension is considered \"safe\" under SafeHaskell, whereas `TemplateHaskell` is \"unsafe\".\r\n\r\nThere are currently 3 modules which rely on `TemplateHaskell`, \r\n \r\n - `Text/RE/Options.lhs`\r\n - `Text/RE/TDFA/RE.hs`\r\n - `Text/RE/Internal/NamedCaptures.lhs`\r\n\r\nThe first two are trivial to make THQ-compatible; the 3rd one however makes use of `heredocs`, thereby actually executes TH code:\r\n\r\n```hs\r\nimport           Text.Heredoc\r\n\r\nscan :: String -> [Token]\r\nscan = alex' match al oops\r\n  where\r\n    al :: [(Regex,Match String->Maybe Token)]\r\n    al =\r\n      [ mk [here|\\$\\{([^{}]+)\\}\\(|] $         ECap . Just . x_1\r\n      , mk [here|\\$\\(|]             $ const $ ECap Nothing\r\n      , mk [here|\\(\\?:|]            $ const   PGrp\r\n      , mk [here|\\(\\?|]             $ const   PCap\r\n      , mk [here|\\(|]               $ const   Bra\r\n      , mk [here|\\\\(.)|]            $         BS    . s2c . x_1\r\n      , mk [here|(.)|]              $         Other . s2c . x_1\r\n      ]\r\n```\r\n\r\nwould it be possible to avoid using `heredocs` and thus avoid having to execute TH code?"},"comment":{"url":"https://api.github.com/repos/iconnect/regex/issues/comments/286492389","html_url":"https://github.com/iconnect/regex/issues/70#issuecomment-286492389","issue_url":"https://api.github.com/repos/iconnect/regex/issues/70","id":286492389,"user":{"login":"cdornan","id":913610,"avatar_url":"https://avatars1.githubusercontent.com/u/913610?v=3","gravatar_id":"","url":"https://api.github.com/users/cdornan","html_url":"https://github.com/cdornan","followers_url":"https://api.github.com/users/cdornan/followers","following_url":"https://api.github.com/users/cdornan/following{/other_user}","gists_url":"https://api.github.com/users/cdornan/gists{/gist_id}","starred_url":"https://api.github.com/users/cdornan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdornan/subscriptions","organizations_url":"https://api.github.com/users/cdornan/orgs","repos_url":"https://api.github.com/users/cdornan/repos","events_url":"https://api.github.com/users/cdornan/events{/privacy}","received_events_url":"https://api.github.com/users/cdornan/received_events","type":"User","site_admin":false},"created_at":"2017-03-14T17:11:53Z","updated_at":"2017-03-14T17:11:53Z","body":"@hvr all looks quite do-able and expect it to be fixed in the next release (most likely over the weekend)."}}
{"actor":{"display_login":"cdornan"}}