<div dir="ltr"><div>I want to replace lines with the content of a file if the line is a filename</div><div><br></div><div>> {-# LANGUAGE LambdaCase #-}</div><div>> test = do</div><div>>   putStrLn $ concatMap (\l -> l ++ "\n")</div><div>>            $ map (\case l</div><div>>                           | (isPrefixOf "./" l) -> readFile l</div><div>>                           | otherwise           -> l)</div><div><br></div><div>But since l is a String and readFile gives an IO String this doesn't work.</div><div>How should I get around this?</div><div><br></div><div>Kind regards,</div><div>Jona</div></div>