Changeset 13359 for src/Pugs/Val

Show
Ignore:
Timestamp:
09/16/06 11:19:16 (2 years ago)
Author:
gaal
Message:

* fix printing of static types: :(Moo $x)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Val/Code.hs

    r13353 r13359  
    161161 
    162162prettyParam :: Param -> Bool -> Bool -> Doc 
    163 prettyParam p isReq isPos = sep [ staticTypes, varDecl, traits, unpacking, constraints, debugDump ] 
     163prettyParam p isReq isPos = sep [ staticTypes, varDecl, defaultVal, traits, unpacking, constraints, debugDump ] 
    164164    where 
    165165    varDecl = varName <> defaultHint 
     
    168168        | v_name (p_variable p) == p_label p = text $ ":" ++ (cast $ p_variable p) 
    169169        | otherwise = text ":" <> text (cast p_label p) <> (parens $ text (cast p_variable p)) 
    170     -- staticTypes = hsep $ map (text . (cast :: Types.Type -> String)) $ p_types p XXX: why is this wrong? 
    171     staticTypes = hsep $ map (text . show) $ p_types p 
     170    staticTypes = hsep $ map (text . Types.showType) $ p_types p 
    172171    defaultHint = if not isReq && not haveDefault then text "?" else empty 
    173172    haveDefault = isJust $ unDefault $ p_default p 
    174     defaultVal  = if haveDefault then equals <+> text "..." else empty 
     173    defaultVal  = if haveDefault then equals <+> text "{...}" else empty -- FIXME: pretty the exp, if we lift into Eval? 
    175174    traits      = sep [acc, ref, lazy, slots] 
    176175    unpacking   = case p_unpacking p of