From 7fc8a6ab2e4b1975e451c9d0800b552c06384f2d Mon Sep 17 00:00:00 2001 From: Scott Olsen Date: Tue, 5 May 2020 22:52:03 -0400 Subject: [PATCH] Simplify CheckKinds implementation using recursion --- src/Types.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Types.hs b/src/Types.hs index 3edfd943..5d16723f 100644 --- a/src/Types.hs +++ b/src/Types.hs @@ -307,10 +307,10 @@ areUnifiable a b | a == b = True checkKinds :: Ty -> Ty -> Bool -- Base < Higher checkKinds (FuncTy argTysA retTyA _) (FuncTy argTysB retTyB _) = - let argKinds = zipWith (<=) (map tyToKind argTysA) (map tyToKind argTysB) + let argKinds = zipWith checkKinds argTysA argTysB retKinds = tyToKind retTyA <= tyToKind retTyB in all (== True) (retKinds : argKinds) -checkKinds t t' = tyToKind t == tyToKind t' +checkKinds t t' = tyToKind t <= tyToKind t' -- | Put concrete types into the places where there are type variables. -- For example (Fn [a] b) => (Fn [Int] Bool)