{"action":"created","issue":{"url":"https://api.github.com/repos/ndmitchell/shake/issues/249","labels_url":"https://api.github.com/repos/ndmitchell/shake/issues/249/labels{/name}","comments_url":"https://api.github.com/repos/ndmitchell/shake/issues/249/comments","events_url":"https://api.github.com/repos/ndmitchell/shake/issues/249/events","html_url":"https://github.com/ndmitchell/shake/issues/249","id":82661842,"number":249,"title":"Support POSIX glob syntax / pluggable pattern syntaxes","user":{"login":"iand675","id":69209,"avatar_url":"https://avatars.githubusercontent.com/u/69209?v=3","gravatar_id":"","url":"https://api.github.com/users/iand675","html_url":"https://github.com/iand675","followers_url":"https://api.github.com/users/iand675/followers","following_url":"https://api.github.com/users/iand675/following{/other_user}","gists_url":"https://api.github.com/users/iand675/gists{/gist_id}","starred_url":"https://api.github.com/users/iand675/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iand675/subscriptions","organizations_url":"https://api.github.com/users/iand675/orgs","repos_url":"https://api.github.com/users/iand675/repos","events_url":"https://api.github.com/users/iand675/events{/privacy}","received_events_url":"https://api.github.com/users/iand675/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-30T01:57:17Z","updated_at":"2015-05-30T16:43:48Z","closed_at":null,"body":"POSIX-style globbing is an extremely common syntax for most tools, so it would be nice to provide support for glob patterns where FilePatterns are currently used.\r\n\r\nI think it would even be possible to add without breaking backwards-compatibility:\r\n\r\nIf you used the [Glob](http://hackage.haskell.org/package/Glob-0.7.5/docs/System-FilePath-Glob.html) library, you could replace current uses of `FilePattern` with a class:\r\n\r\n``` haskell\r\nclass AsPattern p where\r\n  (?==) :: p -> FilePath -> Bool\r\n\r\ninstance AsPattern FilePattern where\r\n  (?==) = ... current definition ...\r\n\r\ninstance AsPattern Pattern where\r\n  (?==) = System.FilePath.Glob.match\r\n```\r\n\r\nIn any case, even if you didn't want to pull in the dependency on the `Glob` library, making it a class would be convenient because it would allow people to plug in their own pattern syntaxes."},"comment":{"url":"https://api.github.com/repos/ndmitchell/shake/issues/comments/107060627","html_url":"https://github.com/ndmitchell/shake/issues/249#issuecomment-107060627","issue_url":"https://api.github.com/repos/ndmitchell/shake/issues/249","id":107060627,"user":{"login":"ndmitchell","id":1651197,"avatar_url":"https://avatars.githubusercontent.com/u/1651197?v=3","gravatar_id":"","url":"https://api.github.com/users/ndmitchell","html_url":"https://github.com/ndmitchell","followers_url":"https://api.github.com/users/ndmitchell/followers","following_url":"https://api.github.com/users/ndmitchell/following{/other_user}","gists_url":"https://api.github.com/users/ndmitchell/gists{/gist_id}","starred_url":"https://api.github.com/users/ndmitchell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndmitchell/subscriptions","organizations_url":"https://api.github.com/users/ndmitchell/orgs","repos_url":"https://api.github.com/users/ndmitchell/repos","events_url":"https://api.github.com/users/ndmitchell/events{/privacy}","received_events_url":"https://api.github.com/users/ndmitchell/received_events","type":"User","site_admin":false},"created_at":"2015-05-30T16:43:48Z","updated_at":"2015-05-30T16:43:48Z","body":"For `removeFiles`, you can just use the glob stuff directly with `liftIO` - there's no real \"Action\" stuff happening there.\r\n\r\nFor `trackAllow`, it's rare to use anything more than a directory, and rare to do anything at all yet (support for tracking on Linux is coming in the next version of Shake, but at the moment, `trackAllow` is mostly pointless).\r\n\r\nFor `getDirectoryFiles` there are lots of optimisations about scanning that are quite dependent on `FilePattern`. My guess is that it would be much better if you could just l lift `globDir` into a tracked Shake rule. At the moment you can write a Shake rule (just copy the existing `getDirectoryFiles` one), but it's not super-simple. I'm currently looking at how to make writing a new rule super-simple, and then that's probably the way to go."}}