From 6d2a82571e7a668be5ea79fffd21c899732d4ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabrielle=20Guimar=C3=A3es?= Date: Fri, 11 Mar 2022 17:54:30 -0300 Subject: [PATCH] improve scheme kind show --- src/Scheme.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Scheme.hs b/src/Scheme.hs index af9f2f7..82bfebf 100644 --- a/src/Scheme.hs +++ b/src/Scheme.hs @@ -3,7 +3,7 @@ module Scheme (Scheme (..), quantify, toScheme) where import Adhoc (Qual ((:=>))) import Data.Foldable (toList) import qualified Data.Sequence as S -import Types (HasKind (kind), Kind, Subst (Subst), TyVar, Typ (TGen), Types (apply, ftv), letters) +import Types (HasKind (kind), Kind (KStar), Subst (Subst), TyVar, Typ (TGen), Types (apply, ftv), letters) -- | Type schemes are used to describe qualified types. -- Each TGen that appears in qt represents a generic that the kind is given @@ -15,6 +15,7 @@ instance Show Scheme where show (Forall us q) = concat ["forall ", unwords us', ". ", show q] where showKind :: Int -> Kind -> String + showKind n KStar = "'" ++ letters !! n showKind n k = concat ["('", letters !! n, " : ", show k, ")"] us' :: [String]