constructorsFromDecl :: TyClDecl Name -> Typing [(ConName, Ty)]
constructorsFromDecl decl | isDataDecl decl  = do
  let nameData = tcdName decl
      αs = hsTyVarNames $ map unLoc $ tcdTyVars decl
      τData = tyCurryApp $ (TyCon nameData):(map TyVar αs)

  forM (map unLoc $ tcdCons decl) $ \ con -> do
    let tys = map unLoc $ hsConDeclArgTys $ con_details con
    σArgs <- mapM fromHsType tys
    τArgs <- forM σArgs $ \ σ -> do
              case σ of
                PolyTy [] τ -> return τ
                PolyTy ctx τ -> raiseError $ InvalidCon σ
    let τ = tyCurryFun (τArgs ++ [τData])
    return (unLoc $ con_name con, τ)
constructorsFro
constructorsFromDecl :: TyClDecl Name -> Typing [(ConName, Ty)]
constructorsFromDecl decl | isDataDecl decl  = do
  let nameData = tcdName decl
      αs = hsTyVarNames $ map unLoc $ tcdTyVars decl
      τData = tyCurryApp $ (TyCon nameData):(map TyVar αs)

  forM (map unLoc $ tcdCons decl) $ \ con -> do
    let tys = map unLoc $ hsConDeclArgTys $ con_details con
    σArgs <- mapM fromHsType tys
    τArgs <- forM σArgs $ \ σ -> do
              case σ of
                PolyTy [] τ -> return τ
                PolyTy ctx τ -> raiseError $ InvalidCon σ
    let τ = tyCurryFun (τArgs ++ [τData])
    return (unLoc $ con_name con, τ)
constructorsFromDecl decl | isDataDecl decl  = do
  let nameData = tcdName decl
      αs = hsTyVarNames $ map unLoc $ tcdTyVars decl
      τData = tyCurryApp $ (TyCon nameData):(map TyVar αs)

  forM (map unLoc $ tcdCons decl) $ \ con -> do
    let tys = map unLoc $ hsConDeclArgTys $ con_details con
    σArgs <- mapM fromHsType tys
    τArgs <- forM σArgs $ \ σ -> do
              case σ of
                PolyTy [] τ -> return τ
                PolyTy ctx τ -> raiseError $ InvalidCon σ
    let τ = tyCurryFun (τArgs ++ [τData])
    return (unLoc $ con_name con, τ)