glob :: L.ByteString -> Mode L.ByteString
glob s
  | "*" == s           = All Nothing
  | L.isSuffixOf "*" s = uncurry Prefix (range $ L.init s)
  | otherwise          = Precise s
    where
      range str = (str, L.init str `L.snoc` (L.last str + 1))
glob :: L.ByteString -> Mode L.ByteString
glob s
  | "*" == s           = All Nothing
  | L.isSuffixOf "*" s = uncurry Prefix (range $ L.init s)
  | otherwise          = Precise s
    where
      range str = (str, L.init str `L.snoc` (L.last str + 1))
glob s
  | "*" == s           = All Nothing
  | L.isSuffixOf "*" s = uncurry Prefix (range $ L.init s)
  | otherwise          = Precise s
    where
      range str = (str, L.init str `L.snoc` (L.last str + 1))