file :: [Attrib] -> Exp FilePath -> Action ()
file as x = do Value x <- x; emit . File =<< foldM f def{filePath=x} as
    where
        f c Recursive = return c{fileRecursive=True}
        f c NonFatal = return c{fileNonFatal=True}
        f c (OName x) = do Value x <- x; return c{fileOName=Just x}
        f c x = error $ "Invalid attribute to file: " ++ show x
file :: [Attrib] -> Exp FilePath -> Action ()
file as x = do Value x <- x; emit . File =<< foldM f def{filePath=x} as
    where
        f c Recursive = return c{fileRecursive=True}
        f c NonFatal = return c{fileNonFatal=True}
        f c (OName x) = do Value x <- x; return c{fileOName=Just x}
        f c x = error $ "Invalid attribute to file: " ++ show x
file as x = do Value x <- x; emit . File =<< foldM f def{filePath=x} as
    where
        f c Recursive = return c{fileRecursive=True}
        f c NonFatal = return c{fileNonFatal=True}
        f c (OName x) = do Value x <- x; return c{fileOName=Just x}
        f c x = error $ "Invalid attribute to file: " ++ show x