[project @ 2001-08-22 11:45:06 by sewardj]
[ghc-hetmet.git] / ghc / tests / programs / north_lias / Bits.lhs
1 % Bits.lhs - useful extras for testing LIAS
2
3 > module Bits (
4 >     Cont(..),
5 >     showit, showits, new_line, pad
6 >     ) where
7
8 > type Cont  =  IO () --was: Dialogue
9
10 > showit :: (Show a) => a -> Cont -> Cont
11 > showit x c  =  putStr (show x) >> c
12
13 > showits :: String -> Cont -> Cont
14 > showits x c  =  putStr x >> c
15
16 > new_line :: Cont -> Cont
17 > new_line  =  showits "\n"
18
19 > pad :: Int -> String -> String
20 > pad n cs  =  take (n - length cs) (repeat ' ') ++ cs