Created
November 19, 2013 02:04
-
-
Save Javran/7539031 to your computer and use it in GitHub Desktop.
Haskell from Scratch #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad | |
import System.FilePath | |
import System.Directory | |
import Data.Maybe | |
redoPath :: FilePath -> IO (Maybe FilePath) | |
redoPath target = listToMaybe `liftM` filterM doesFileExist candidates | |
where candidates = map (++ ".do") $ target : fallbacks | |
fallbacks = map (`replaceBaseName` "default") $ filter hasExtension [target] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment