toHaskellDowncast :: String -> (String,String)
toHaskellDowncast className
  = (downcastName
    ,downcastName ++ " :: " ++ classTypeName' ++ " a -> " ++ classTypeName' ++ " ()\n" ++
     downcastName ++ " obj = objectCast obj\n\n"
    )
  where
    classTypeName'    = haskellTypeName className
    downcastName      = haskellDeclName ("downcast" ++ classTypeName')
toHaskellDowncast :: String -> (String,String)
toHaskellDowncast className
  = (downcastName
    ,downcastName ++ " :: " ++ classTypeName' ++ " a -> " ++ classTypeName' ++ " ()\n" ++
     downcastName ++ " obj = objectCast obj\n\n"
    )
  where
    classTypeName'    = haskellTypeName className
    downcastName      = haskellDeclName ("downcast" ++ classTypeName')
toHaskellDowncast className
  = (downcastName
    ,downcastName ++ " :: " ++ classTypeName' ++ " a -> " ++ classTypeName' ++ " ()\n" ++
     downcastName ++ " obj = objectCast obj\n\n"
    )
  where
    classTypeName'    = haskellTypeName className
    downcastName      = haskellDeclName ("downcast" ++ classTypeName')