content: ;;; -*- mode: finkel -*-
  ;;;
  ;;; 5.3 Import Declarations
  
  (module Main)
  
  (import Data.Char)
  (import System.IO ())
  (import Control.Monad as M)
  (import Data.Array (! array))
  (import Data.Complex ((Complex ..) realPart imagPart mkPolar))
  (import Data.Monoid ((All All) (Any) (Alt getAlt)))
  (import Data.Ratio hiding (Ratio Rational numerator %))
  
  (import qualified Data.List)
  (import qualified Data.Functor.Identity as Id)
  (import qualified Data.Map as Map)
  (import qualified Data.Maybe as Mb)
  (import qualified Data.Bits as Bt (shiftL shiftR))
  (import qualified System.Environment as Env hiding (getArgs getEnv))
  
  (:: f1 (Map.Map String Int))
  (= f1
    (Map.fromList [(, "k1" 1) (, "k2" 2)]))
  
  (:: f2 (-> (Id.Identity a) (IO ())))
  (= f2 i
    (case i
      (Id.Identity {}) (putStrLn "Id.Identity pattern match with {}")))
  
  (:: main (IO ()))
  (= main
    (do (putStrLn (map toUpper "import declarations"))
        (print (Data.List.nub [1 2 3 2 1 2 3 2 1]))
        (print (Mb.fromMaybe 123 Nothing))
        (print (Mb.Just 42))
        (print (:: (return 42) (Id.Identity Int)))
        (case (return 42) (Id.Identity n) (print n))
        (print (case EQ
                 Prelude.EQ True))
        (print (case (Id.Identity 42)
                 (Id.Identity n) n))
        (let ((= i1 (Id.Identity 100))
              (= i2 (Id.Identity {(= Id.runIdentity 101)}))
              (= i3 (i2 {(= Id.runIdentity 102)}))))
        (mapM_ print [i1 i2 i3])
        (f2 i1)
        (M.when (< 3 5)
                (putStrLn "Control Monad imported as `M'"))
        (let ((= arr (array (, 0 15) (zip [0 .. 15] [#'a ..])))))
        (print (! arr 3))
        (let ((= c (mkPolar 1.2 3.4))))
        (print (realPart c))
        (print (imagPart c))
        (print (Bt.shiftL (:: 8 Int) 8))
        (>>= Env.getProgName putStrLn)
        (print f1)))
  