-----------------------------------------------------------------------------
-- |
-- Module      :  Typeof.hs
-- Copyright   :  (c) Don Stewart 2007
-- License     :  BSD3-style (see LICENSE)
-- 
-- Maintainer  :  dons@cse.unsw.edu.au
-- Stability   :  stable
-- Portability :  not portable (needs System.Process concurrency)
--
-----------------------------------------------------------------------------

import System.Environment
import Data.Char
import System.IO
import Process

main = do
    args <- getArgs
    decl   <- getContents
    let ident = fst (break isSpace decl)
    ty     <- run "ghci" ("-v0" : "-cpp" : "-w" : args) (":t " ++ ident)
    putStr ty
