Skip to content

Commit b6437c2

Browse files
committed
nub out repeated vars
1 parent c65dcee commit b6437c2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

frontend/granule-frontend.cabal

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 1.12
22

3-
-- This file has been generated from package.yaml by hpack version 0.37.0.
3+
-- This file has been generated from package.yaml by hpack version 0.38.1.
44
--
55
-- see: https://github.com/sol/hpack
66

@@ -128,6 +128,7 @@ test-suite frontend-spec
128128
other-modules:
129129
Data.Bifunctor.FoldableSpec
130130
Language.Granule.Checker.CheckerSpec
131+
Language.Granule.Checker.KindSpec
131132
Language.Granule.Checker.MonadSpec
132133
Language.Granule.Checker.SubstitutionsSpec
133134
Language.Granule.Checker.TypesSpec

frontend/src/Language/Granule/Checker/Kinding.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Control.Monad.State.Strict
1717
import Control.Monad.Trans.Maybe
1818
import Data.Functor.Identity (runIdentity)
1919
import Data.Maybe (fromMaybe)
20-
import Data.List (isPrefixOf, sortBy, (\\))
20+
import Data.List (isPrefixOf, sortBy, (\\), nub)
2121

2222
import Language.Granule.Context
2323

@@ -1382,7 +1382,9 @@ instance Unifiable t => Unifiable (Maybe t) where
13821382
-- the given kind
13831383
typeVarsOfKind :: (?globals :: Globals) => Type -> Kind -> Checker [Id]
13841384
typeVarsOfKind t k = do
1385-
typeFoldM algebra t where
1385+
vars <- typeFoldM algebra t
1386+
return (nub vars)
1387+
where
13861388
algebra = TypeFold
13871389
{ tfTy = \_ -> return []
13881390
, tfFunTy = \_ _ x y -> return (x ++ y)

0 commit comments

Comments
 (0)