mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 05:25:28 +03:00
feat: use ascii type variables in prettify (#1195)
This commit is contained in:
parent
1f8c8765d3
commit
4ec166a6fb
@ -495,10 +495,11 @@ beautifyTy mappings = f
|
||||
bmappings = beautification mappings
|
||||
beautification :: TypeMappings -> Map.Map String String
|
||||
beautification m =
|
||||
Map.fromList $ zip (map (\(VarTy name) -> name) tys) ((: []) <$> ['a' ..])
|
||||
Map.fromList $ zip (map (\(VarTy name) -> name) tys) beautList
|
||||
where
|
||||
tys = nub $ concat $ typeVariablesInOrderOfAppearance <$> tys'
|
||||
tys' = snd <$> Map.assocs m
|
||||
beautList = [c : s | s <- "" : beautList, c <- ['a' .. 'z']]
|
||||
|
||||
typeVariablesInOrderOfAppearance :: Ty -> [Ty]
|
||||
typeVariablesInOrderOfAppearance (FuncTy argTys retTy ltTy) =
|
||||
|
Loading…
Reference in New Issue
Block a user