match :: NonEmpty GlobItem -> Text -> Bool
match l v = case parse (mkParser l) "" v of
  Left _ -> False
  Right _ -> True
  where
    mkParser :: NonEmpty GlobItem -> Parsec Text u ()
    mkParser = foldr (<*) eof . fmap toParser
    toParser :: GlobItem -> Parsec Text u ()
    toParser (LiteralString s) = () <$ string (toS s)
    toParser AnyChar = () <$ anyToken
    toParser AnyCharMultiple = () <$ many anyToken
match :: NonEmpty GlobItem -> Text -> Bool
match l v = case parse (mkParser l) "" v of
  Left _ -> False
  Right _ -> True
  where
    mkParser :: NonEmpty GlobItem -> Parsec Text u ()
    mkParser = foldr (<*) eof . fmap toParser
    toParser :: GlobItem -> Parsec Text u ()
    toParser (LiteralString s) = () <$ string (toS s)
    toParser AnyChar = () <$ anyToken
    toParser AnyCharMultiple = () <$ many anyToken
match l v = case parse (mkParser l) "" v of
  Left _ -> False
  Right _ -> True
  where
    mkParser :: NonEmpty GlobItem -> Parsec Text u ()
    mkParser = foldr (<*) eof . fmap toParser
    toParser :: GlobItem -> Parsec Text u ()
    toParser (LiteralString s) = () <$ string (toS s)
    toParser AnyChar = () <$ anyToken
    toParser AnyCharMultiple = () <$ many anyToken