CurryInfo: contract-prover-4.0.0 / ContractProver.showDictOf

definition: Info
 
showDictOf :: TypeExpr -> Maybe TAExpr
showDictOf te = case te of
  TCons qtc tes ->  do
    sd  <- typeCons2ShowDict qtc
    sds <- mapM showDictOf tes
    return $ AComb (showDictTypeOf te) (FuncPartCall 1)
                   (sd, foldr (~>) (showDictTypeOf te) (map showDictTypeOf tes))
                   sds
  _             -> Nothing
 where
  typeCons2ShowDict (mn,tc)
    | mn == "Prelude"
    = maybe Nothing (Just . pre) (preludeType2ShowDict tc)
    -- here we assume that a Show instance exists for the user-defined type
    -- safer solution: check the program for the existence of this instance
    | otherwise
    = Just (mn, "_inst#Prelude.Show#" ++ mn ++ "." ++ tc ++ "#")

  preludeType2ShowDict tc
    | tc `elem` ["Int", "Float", "Char", "Bool", "Maybe", "Either",
                 "IOError", "Ordering"]
    = Just $ "_inst#Prelude.Show#Prelude." ++ tc ++ "#"
    | tc `elem` ["[]","()"] || "(," `isPrefixOf` tc
    = Just $ "_inst#Prelude.Show#" ++ tc ++ "#"
    | otherwise
    = Nothing
demand: Info
 argument 1
deterministic: Info
 deterministic operation
documentation: Info
 
---------------------------------------------------------------------------
Generate Show dictionary argument for a given type, if possible
(e.g., if the type is not polymorphic or functional).
failfree: Info
 _
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {({TCons}) |-> _ || ({TVar}) |-> _ || ({FuncType}) |-> _ || ({ForallType}) |-> _}
name: Info
 showDictOf
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 FlatCurry.Types.TypeExpr
-> Prelude.Maybe (FlatCurry.Annotated.Types.AExpr FlatCurry.Types.TypeExpr)
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term