Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
improve scheme kind show
Browse files Browse the repository at this point in the history
  • Loading branch information
aripiprazole committed Mar 11, 2022
1 parent d2392e9 commit 6d2a825
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Scheme.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down

0 comments on commit 6d2a825

Please sign in to comment.