envKVars :: (TaggedC c a) => BindEnv -> c a -> [KVar]
envKVars be c = squish [ kvs sr |  (_, sr) <- clhs be c]
  where
    squish    = S.toList  . S.fromList . concat
    kvs       = kvars . sr_reft

-- lhsKVars :: BindEnv -> SubC a -> [KVar]
-- lhsKVars binds c = envKVs ++ lhsKVs
  -- where
    -- envKVs       = envKVars binds         c
    -- lhsKVs       = kvars          $ lhsCs c
envKVars :: (TaggedC c a) => BindEnv -> c a -> [KVar]
envKVars be c = squish [ kvs sr |  (_, sr) <- clhs be c]
  where
    squish    = S.toList  . S.fromList . concat
    kvs       = kvars . sr_reft

-- lhsKVars :: BindEnv -> SubC a -> [KVar]
-- lhsKVars binds c = envKVs ++ lhsKVs
  -- where
    -- envKVs       = envKVars binds         c
    -- lhsKVs       = kvars          $ lhsCs c
envKVars be c = squish [ kvs sr |  (_, sr) <- clhs be c]
  where
    squish    = S.toList  . S.fromList . concat
    kvs       = kvars . sr_reft

-- lhsKVars :: BindEnv -> SubC a -> [KVar]
-- lhsKVars binds c = envKVs ++ lhsKVs
  -- where
    -- envKVs       = envKVars binds         c
    -- lhsKVs       = kvars          $ lhsCs c