Tagged

Haskell

A collection of 6 posts

Coding

Haskell: Find and Replace in File

module MyLib ( findReplaceAndCopyFile, findReplaceInFile, replaceMarkerWithFile, replaceMarkerWithFile2, replaceMarkerWithFile3 ) where import Data.List (intercalate) import Data.List.Split (splitOn) import System.IO (stdout, hFlush, hPutStr) import Type.Reflection (typeOf) import System.Directory replaceMarkerWithFile_ :: FilePath -> FilePath -> String -> FilePath -> IO () replaceMarkerWithFile_ inFile outFile marker injectionFile = do inFileText FilePath -> String

Coding

Haskell Hakyll: site.hs

-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} import Data.Monoid (mappend) import Hakyll import Hakyll.Web.Paginate import qualified Data.Map as M import Control.Monad (liftM) -------------------------------------------------------------------------------- main :: IO () main = hakyll $ do match "images/*" $ do route idRoute compile copyFileCompiler match "css/*" $ do route idRoute compile compressCssCompiler match (fromList ["about.rst", "contact.