PIH ex.7.9
Monday, January 14th, 2008
import EX_7_8 hiding (channel, transmit)
channel :: [Bit] -> [Bit]
channel = tail
-- need to redefine transmit to force it use this new verion of channel
transmit :: String -> String
transmit = decode . channel . encode
main = do
putStrLn $ transmit "Haskell is fun!"
{-
$> ghci
GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help
Loading package base ... linking ... done.
Prelude> :l ex.7.9 ex.7.8
[1 of 2] Compiling EX_7_8 ( ex.7.8.hs, interpreted )
[2 of 2] Compiling Main ( ex.7.9.hs, interpreted )
Ok, modules loaded: EX_7_8, Main.
*Main> main
*** Exception: Parity checking fail.
*Main>
-}