Glob is a Haskell library with operations for globbing: matching patterns against file paths. It’s licensed under the 3-clause BSD license.
I decided to make it because nothing like the globDir function, my main use case at the time, already existed. There were/are some libraries that provide globbing functionality, but nothing with as complete a feature set.
The pattern syntax is based on a subset of Zsh’s.
It tries to optimize the given pattern and should be noticeably faster than a naïve character-by-character matcher—something I was using before I decided to do this properly. I haven’t benchmarked it (yet, at least), though.
A bunch of tests are included with the package: as usual, feel free to contribute and/or complain.
Obtaining
Assuming you have the cabal-install tool installed and working, the easiest way to obtain Glob is with the cabal install glob command.
Otherwise, you can download the source from Hackage, where you can also browse the documentation.
As a last resort, the source package for the latest version, 0.7, is also available here:
A changelog is also available for your reading pleasure:
Dependencies
The full list of dependencies, as listed in the .cabal file, is as follows:
base >= 3 && < 5containers == 0.*directory == 1.*dlist == 0.*filepath == 1.*transformers == 0.2.*Win32 == 2.*, for Windows operating systems
These should all be found in any reasonably up-to-date Haskell distribution.