<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 4, 2015 at 12:38 PM, Richard Guay <span dir="ltr"><<a href="mailto:raguay@customct.com" target="_blank">raguay@customct.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
    fExist <- doesFileExist $ h ++ cacheDirBasic ++ getBundleID ++ 
"/" ++ fileName<br>
    if fExist<br>
    then do<br>
        contents <- readFile $ h ++ cacheDirBasic ++ getBundleID ++ 
"/" ++ fileName</div></blockquote></div><br></div><div class="gmail_extra">First of all, let's refactor that into a let binding, e.g.<br><br></div><div class="gmail_extra">    let pathName = h ++ cacheDirBasic ++ getBundleID ++ 
"/" ++ fileName</div><div class="gmail_extra">    fExist <- doesFileExist pathName<br></div><div class="gmail_extra">    if fExist then readFile pathName else return ""<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">The advantage of keeping DRY here should be obvious. Defining the same thing in 2 places can lead to both getting out of lockstep.<br><br></div><div class="gmail_extra">Now as for debugging the actual problem, have you tried the REPL? That is, launch ghci, load the appropriate libraries, and see what happens when you enter<br><br></div><div class="gmail_extra">doesFileExist "/home/me/myfile"<br><br></div><div class="gmail_signature">and similarly for readFile. That way you'd rule things out like a file permissions problem, etc.<br><br></div><div class="gmail_signature"><br>-- Kim-Ee</div><div class="gmail_extra"><div></div>
</div></div>