constKinds :: [(Name, Exp)] -> [(Name, Kind)]
constKinds rules =
  let res = concat $ map (\ (_, t) -> helper t) rules
  in nub $ res
  where  helper (Arrow t1 t2) = getKinds t1 ++ getKinds t2
         helper (a@(Forall x t)) = helper $ viewFBody a
         helper (Imply t1 t2) = helper t1 ++ helper t2
         helper a = getKinds a
constKinds :: [(Name, Exp)] -> [(Name, Kind)]
constKinds rules =
  let res = concat $ map (\ (_, t) -> helper t) rules
  in nub $ res
  where  helper (Arrow t1 t2) = getKinds t1 ++ getKinds t2
         helper (a@(Forall x t)) = helper $ viewFBody a
         helper (Imply t1 t2) = helper t1 ++ helper t2
         helper a = getKinds a
constKinds rules =
  let res = concat $ map (\ (_, t) -> helper t) rules
  in nub $ res
  where  helper (Arrow t1 t2) = getKinds t1 ++ getKinds t2
         helper (a@(Forall x t)) = helper $ viewFBody a
         helper (Imply t1 t2) = helper t1 ++ helper t2
         helper a = getKinds a