unlessExists -> whenExists
This commit is contained in:
parent
3f363b5415
commit
3c9b1da592
@ -172,12 +172,12 @@ juliusFile =
|
|||||||
|
|
||||||
widgetFile :: FilePath -> Q Exp
|
widgetFile :: FilePath -> Q Exp
|
||||||
widgetFile x = do
|
widgetFile x = do
|
||||||
let h = unlessExists (globFile "hamlet") (whamletFile . globFile "hamlet")
|
let h = whenExists (globFile "hamlet") (whamletFile . globFile "hamlet")
|
||||||
let c = unlessExists (globFile "cassius") cassiusFile
|
let c = whenExists (globFile "cassius") cassiusFile
|
||||||
let j = unlessExists (globFile "julius") juliusFile
|
let j = whenExists (globFile "julius") juliusFile
|
||||||
let l = unlessExists (globFile "lucius") luciusFile
|
let l = whenExists (globFile "lucius") luciusFile
|
||||||
[|addWidget $h >> addCassius $c >> addJulius $j >> addLucius $l|]
|
[|addWidget $h >> addCassius $c >> addJulius $j >> addLucius $l|]
|
||||||
where
|
where
|
||||||
unlessExists tofn f = do
|
whenExists tofn f = do
|
||||||
e <- qRunIO $ doesFileExist $ tofn x
|
e <- qRunIO $ doesFileExist $ tofn x
|
||||||
if e then f x else [|mempty|]
|
if e then f x else [|mempty|]
|
||||||
|
|||||||
@ -142,12 +142,12 @@ juliusFile = H.juliusFileDebug . toJuliusFile
|
|||||||
|
|
||||||
widgetFile :: FilePath -> Q Exp
|
widgetFile :: FilePath -> Q Exp
|
||||||
widgetFile x = do
|
widgetFile x = do
|
||||||
let h = unlessExists toHamletFile $ whamletFile . toHamletFile
|
let h = whenExists toHamletFile $ whamletFile . toHamletFile
|
||||||
let c = unlessExists toCassiusFile cassiusFile
|
let c = whenExists toCassiusFile cassiusFile
|
||||||
let j = unlessExists toJuliusFile juliusFile
|
let j = whenExists toJuliusFile juliusFile
|
||||||
let l = unlessExists toLuciusFile luciusFile
|
let l = whenExists toLuciusFile luciusFile
|
||||||
[|addWidget $h >> addCassius $c >> addJulius $j >> addLucius $l|]
|
[|addWidget $h >> addCassius $c >> addJulius $j >> addLucius $l|]
|
||||||
where
|
where
|
||||||
unlessExists tofn f = do
|
whenExists tofn f = do
|
||||||
e <- qRunIO $ doesFileExist $ tofn x
|
e <- qRunIO $ doesFileExist $ tofn x
|
||||||
if e then f x else [|mempty|]
|
if e then f x else [|mempty|]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user