module Data.Text.LeftPad where import Data.Text leftPad :: String -> Int -> String -> String leftPad s l "" = leftPad' s l ' ' leftPad s l (c:[]) = leftPad' s l c where leftPad' s 0 c = s leftPad' s n c = if length s > n then [c] ++ leftPad' s (n - 1) c else leftPad' s (n - 1) c