on master help sign in
elide extraneous "AtomType" when showing atom types in the terminal
e6e0d36AgentM
src/lib/ProjectM36/AtomType.hs+2−1
@@ -259,7 +259,8 @@ prettyAtomType (ConstructedAtomType tConsName typeVarMap) = tConsName `T.append`
259 showTypeVars (tyVarName, aType) = " (" `T.append` tyVarName `T.append` "::" `T.append` prettyAtomType aType `T.append` ")"
259 showTypeVars (tyVarName, aType) = " (" `T.append` tyVarName `T.append` "::" `T.append` prettyAtomType aType `T.append` ")"
260-- it would be nice to have the original ordering, but we don't have access to the type constructor here- maybe the typevarmap should be also positional (ordered map?)
260-- it would be nice to have the original ordering, but we don't have access to the type constructor here- maybe the typevarmap should be also positional (ordered map?)
261prettyAtomType AnyAtomType = "?AnyAtomType?"
261prettyAtomType AnyAtomType = "?AnyAtomType?"
262+prettyAtomType aType = T.take (T.length fullName - T.length "AtomType") fullName
262−prettyAtomType aType = (T.pack . show) aType
263+ where fullName = (T.pack . show) aType
263
264
264prettyAttribute :: Attribute -> T.Text
265prettyAttribute :: Attribute -> T.Text
265prettyAttribute attr = A.attributeName attr `T.append` "::" `T.append` prettyAtomType (A.atomType attr)
266prettyAttribute attr = A.attributeName attr `T.append` "::" `T.append` prettyAtomType (A.atomType attr)