cabal-fmt-0.1.9: Format .cabal files
Safe HaskellSafe-Inferred
LanguageHaskell2010

CabalFmt.Glob

Synopsis

Documentation

data Glob #

Constructors

Glob FilePath [GlobPiece] 

Instances

Instances details
Show Glob # 
Instance details

Defined in CabalFmt.Glob

Methods

showsPrec :: Int -> Glob -> ShowS

show :: Glob -> String

showList :: [Glob] -> ShowS

data GlobPiece #

Constructors

GlobStarStar 
GlobPiece (NonEmpty GlobChar) 

Instances

Instances details
Show GlobPiece # 
Instance details

Defined in CabalFmt.Glob

Methods

showsPrec :: Int -> GlobPiece -> ShowS

show :: GlobPiece -> String

showList :: [GlobPiece] -> ShowS

data GlobChar #

Constructors

GlobStar 
GlobChar Char 

Instances

Instances details
Show GlobChar # 
Instance details

Defined in CabalFmt.Glob

Methods

showsPrec :: Int -> GlobChar -> ShowS

show :: GlobChar -> String

showList :: [GlobChar] -> ShowS

match :: Glob -> FilePath -> Bool #

Match glob

>>> let Right g = parseGlob "cbits/**/*.c"
>>> map (match g) ["foo", "cbits/header.h", "cbits/source.c", "cbits/dir/source.c"]
[False,False,True,True]

parseGlob :: String -> Either String Glob #