implemented overlay
This commit is contained in:
@@ -24,6 +24,7 @@ module Mtlstats.Format
|
||||
, left
|
||||
, right
|
||||
, centre
|
||||
, overlay
|
||||
, month
|
||||
) where
|
||||
|
||||
@@ -74,6 +75,17 @@ centre n str = let
|
||||
pad = replicate pLen ' '
|
||||
in take n $ pad ++ str ++ repeat ' '
|
||||
|
||||
-- | Overlays one string on top of another
|
||||
overlay
|
||||
:: String
|
||||
-- ^ The string on the top
|
||||
-> String
|
||||
-- ^ The string on the bottom
|
||||
-> String
|
||||
overlay (x:xs) (_:ys) = x : overlay xs ys
|
||||
overlay xs [] = xs
|
||||
overlay [] ys = ys
|
||||
|
||||
-- | Converts a number to a three character month (e.g. @"JAN"@)
|
||||
month :: Int -> String
|
||||
month 1 = "JAN"
|
||||
|
||||
Reference in New Issue
Block a user