diff --git a/typechecker/src/Initial.hs b/typechecker/src/Initial.hs index ee9acb81aa2732a1d160bf8eac1b79c8acf36ea1..3e3c9ac72f48881f4b0e82da1aa8a4f792f40dc6 100644 --- a/typechecker/src/Initial.hs +++ b/typechecker/src/Initial.hs @@ -41,8 +41,8 @@ initialTyCons = do ,(ttFoldableCt, (tyConFoldableCt, appArrowTS [typeTau, typeTau] constraintTau)) -- Foldable ,(ttArrow, (tyConArrow, appArrowTS [typeTau, typeTau] typeTau)) -- (->) ,(ttList, (tyConList, typeToTypeSigma)) -- List - ,(ttChar, (tyConChar, typeSigma)) -- Char - ,(ttInt, (tyConInt, typeSigma)) -- Int + ,(ttChar, (tyConChar, typeSigma)) -- Char + ,(ttInt, (tyConInteger, typeSigma)) -- Integer ,(ttNat, (tyConNat, typeSigma)) ,(ttBool, (tyConBool, typeSigma)) -- Bool ,(ttString, (tyConString, typeSigma)) -- String @@ -299,7 +299,7 @@ undefinedBD = do ((tauToSigma (AlphaT al)))) plusBD :: (TVar, Sigma) -plusBD = (mkTVar "plus", tauToSigma $ appArrowT [intTau, intTau] intTau) +plusBD = (mkTVar "plus", tauToSigma $ appArrowT [integerTau, integerTau] integerTau) constBD :: Tc (TVar, Sigma) constBD = do @@ -325,7 +325,7 @@ minusBD = do appPsiSigmas [Specified (al, typeSigma), FatArrow (AppT numCtQ (AlphaT al))] . tauToSigma $ appArrowT [AlphaT al, AlphaT al] (AlphaT al)) minusIntBD :: (TVar, Sigma) -minusIntBD = (mkTVar "minusInt", tauToSigma $ appArrowT [intTau, intTau] intTau) +minusIntBD = (mkTVar "minusInt", tauToSigma $ appArrowT [integerTau, integerTau] integerTau) takeBD :: Tc (TVar, Sigma) takeBD = do @@ -333,7 +333,7 @@ takeBD = do let listOfAl = AppT listTau (AlphaT al) pure (mkTVar "take", QuantifiedSg (Specified (al, tauToSigma typeTau)) . tauToSigma - $ appArrowT [intTau, listOfAl] listOfAl) + $ appArrowT [integerTau, listOfAl] listOfAl) singletonBD :: Tc (TVar, Sigma) singletonBD = do diff --git a/typechecker/src/Parser.hs b/typechecker/src/Parser.hs index a19b2d991519b9cb3c341fe5e078edec400ea56b..46766a78ede5c7674014536b62d6f24c1869b6e1 100644 --- a/typechecker/src/Parser.hs +++ b/typechecker/src/Parser.hs @@ -60,10 +60,10 @@ caseArmToMatch (pat, E.EAlts alts _) = <*> (toTerm =<< rhs) toLit :: E.Lit -> Either String Lit -toLit (E.LInt _) = Right LitInt -toLit (E.LInteger _) = Right LitInt -toLit (E.LStr _) = Right LitString -toLit (E.LChar _) = Right LitChar +toLit (E.LInt v) = Right (LitInteger (toInteger v)) +toLit (E.LInteger v) = Right (LitInteger v) +toLit (E.LStr v) = Right (LitString v) +toLit (E.LChar v) = Right (LitChar v) toLit _ = Left "Unsupported literal!" toValDecls :: [E.EBind] -> Either String ValDecls diff --git a/typechecker/src/Tc/Gen/Expr.hs b/typechecker/src/Tc/Gen/Expr.hs index d4a555d54dbb437243ffde467677587166a6fb9d..46d7b184ad0a916186746eeab52c1feada7cd69c 100644 --- a/typechecker/src/Tc/Gen/Expr.hs +++ b/typechecker/src/Tc/Gen/Expr.hs @@ -180,9 +180,9 @@ tcArg gamma expr sigma = do ********************************************************************* -} litType :: Lit -> Tau -litType LitChar = chatTau -litType LitInt = intTau -litType LitString = stringTau +litType (LitChar _) = chatTau +litType (LitInteger _) = integerTau +litType (LitString _) = stringTau tcLit :: Lit -> ExpType -> Tc () tcLit lit (Infer ires) = fillInferResult (tauToRho $ litType lit) ires diff --git a/typechecker/src/Tc/Solver.hs b/typechecker/src/Tc/Solver.hs index 5db77bb39273b773adb46f084dae6bcf4fb50bef..089ef8db7e8d2d09d1896ab83de650c517b623dd 100644 --- a/typechecker/src/Tc/Solver.hs +++ b/typechecker/src/Tc/Solver.hs @@ -226,8 +226,8 @@ tryInertEqs :: CanEqCt -> Cs () tryInertEqs _ = pure () -- TODO: Fix me -- TODO: Fix me -solveIrred :: CanIrredCt -> Cs () -solveIrred ir = throwErrorCs (IrreducibleCt $ pprCanIrredCt ir) +solveCanIrredCt :: CanIrredCt -> Cs () +solveCanIrredCt ir = throwErrorCs (IrreducibleCt $ pprCanIrredCt ir) solveEquality :: CtFlavour -> TcTau -> TcTau -> Cs () solveEquality flv lhs rhs = do @@ -239,6 +239,6 @@ solveEquality flv lhs rhs = do traceCs "solveEquality - constraints" $ vsep [pretty "Canonicals:" <+> pprList (vsep . map pprCanEqCt) canons ,pretty "Irreducibles:" <+> pprList (vsep . map pprCanIrredCt) irreds] - mapM_ solveIrred irreds + mapM_ solveCanIrredCt irreds mapM_ tryInertEqs canons mapM_ updInertEqs canons diff --git a/typechecker/src/Term.hs b/typechecker/src/Term.hs index 0e4e3fa98adf3b45a4a260670c59f2e549515552..022910957a2f9071ac08918f4185bccf1173a7bd 100644 --- a/typechecker/src/Term.hs +++ b/typechecker/src/Term.hs @@ -111,9 +111,9 @@ data Binder -- Literals data Lit - = LitChar -- Character literal - | LitInt -- Int literal - | LitString -- String literal + = LitChar Char -- Character literal + | LitInteger Integer -- Integer literal + | LitString String -- String literal deriving (Show, Eq) data TVar = MkTVar Ident -- A term varible diff --git a/typechecker/src/Type.hs b/typechecker/src/Type.hs index b89611ebb4197df9f993567ccd7858d9a759298b..3a838dc8c7819b8d67921bfd1ed5911f93fe6617 100644 --- a/typechecker/src/Type.hs +++ b/typechecker/src/Type.hs @@ -36,7 +36,7 @@ module Type( typeTau, showCtQ, foldableCtQ, - intTau, + integerTau, natTau, maybeTau, eitherTau, @@ -147,7 +147,7 @@ module Type( tyConEither, tyConEqCt, tyConFoldableCt, - tyConInt, + tyConInteger, tyConNat, tyConList, tyConMaybe, @@ -924,8 +924,8 @@ constraintTau = TyConT tyConConstraint arrowTau :: Tau arrowTau = TyConT tyConArrow -intTau :: Tau -intTau = TyConT tyConInt +integerTau :: Tau +integerTau = TyConT tyConInteger natTau :: Tau natTau = TyConT tyConNat @@ -1004,8 +1004,8 @@ tyConFoldableCt = MkTyCon (pack "Foldable") tyConNumCt :: TyCon tyConNumCt = MkTyCon (pack "Num") -tyConInt :: TyCon -tyConInt = MkTyCon (pack "Int") +tyConInteger :: TyCon +tyConInteger = MkTyCon (pack "Integer") tyConNat :: TyCon tyConNat = MkTyCon (pack "Nat") diff --git a/typechecker/test/cases/parser/leftPlusTwo-parser.output b/typechecker/test/cases/parser/leftPlusTwo-parser.output index 7e9e31b95e99cb8d6393b8ee769f50730e7f0840..57598d79ee3168d0008ca3a94c141a93d85c8fc3 100644 --- a/typechecker/test/cases/parser/leftPlusTwo-parser.output +++ b/typechecker/test/cases/parser/leftPlusTwo-parser.output @@ -1 +1 @@ -MkValDecls [] [FunBind (MkTVar leftPlusTwo) [MkMatch [VisArg (TApp (HVar (MkTVar x)) [])] (TApp (HConLike (MkConLike Left)) [VisArg (TApp (HVar (MkTVar plus)) [VisArg (TLit LitInt),VisArg (TApp (HVar (MkTVar x)) [])])])]] \ No newline at end of file +MkValDecls [] [FunBind (MkTVar leftPlusTwo) [MkMatch [VisArg (TApp (HVar (MkTVar x)) [])] (TApp (HConLike (MkConLike Left)) [VisArg (TApp (HVar (MkTVar plus)) [VisArg (TLit (LitInteger 2)),VisArg (TApp (HVar (MkTVar x)) [])])])]] \ No newline at end of file diff --git a/typechecker/test/cases/parser/plusPlus-parser.output b/typechecker/test/cases/parser/plusPlus-parser.output index ab5a13c6f00a11d618500c30af384f3bc9505f6a..e23c8b8202bed12b6f9ada3c60b5c9515099d2b0 100644 --- a/typechecker/test/cases/parser/plusPlus-parser.output +++ b/typechecker/test/cases/parser/plusPlus-parser.output @@ -1 +1 @@ -MkValDecls [] [FunBind (MkTVar plusPlus) [MkMatch [] (TApp (HVar (MkTVar plus)) [VisArg (TApp (HVar (MkTVar plus)) [VisArg (TLit LitInt),VisArg (TLit LitInt)]),VisArg (TApp (HVar (MkTVar plus)) [VisArg (TLit LitInt),VisArg (TLit LitInt)])])]] \ No newline at end of file +MkValDecls [] [FunBind (MkTVar plusPlus) [MkMatch [] (TApp (HVar (MkTVar plus)) [VisArg (TApp (HVar (MkTVar plus)) [VisArg (TLit (LitInteger 3)),VisArg (TLit (LitInteger 2))]),VisArg (TApp (HVar (MkTVar plus)) [VisArg (TLit (LitInteger 1)),VisArg (TLit (LitInteger 3))])])]] \ No newline at end of file diff --git a/typechecker/test/cases/should-fail/constFail-infer.output b/typechecker/test/cases/should-fail/constFail-infer.output index 17d9297d21a9e11e681429dd4ad80f409daf6363..2e6a5371e09cde928226685841540e8c6fb0ded9 100644 --- a/typechecker/test/cases/should-fail/constFail-infer.output +++ b/typechecker/test/cases/should-fail/constFail-infer.output @@ -2,4 +2,4 @@ Expected no more arguments: Instantiated type of application head: Bool - Left over arguments: [VisArg (TLit LitChar)] \ No newline at end of file + Left over arguments: [VisArg (TLit (LitChar 'c'))] \ No newline at end of file diff --git a/typechecker/test/cases/should-fail/notTo3-infer.output b/typechecker/test/cases/should-fail/notTo3-infer.output index 92636c306b11e35fa8360972538930433e9cb011..84b965a2d7ac8d3a3ef7486966b4f75fdaba16d1 100644 --- a/typechecker/test/cases/should-fail/notTo3-infer.output +++ b/typechecker/test/cases/should-fail/notTo3-infer.output @@ -1,3 +1,3 @@ [DifferentTyCons] -Can't unify different type constructors: Bool and Int \ No newline at end of file +Can't unify different type constructors: Bool and Integer \ No newline at end of file diff --git a/typechecker/test/cases/should-fail/plus3ToBool-infer.output b/typechecker/test/cases/should-fail/plus3ToBool-infer.output index f0c2a6e31273d86f8e64a37e6f59a6f1541083d2..d4d5bc87a7950a62401bd98eda45eaa8400f247b 100644 --- a/typechecker/test/cases/should-fail/plus3ToBool-infer.output +++ b/typechecker/test/cases/should-fail/plus3ToBool-infer.output @@ -1,3 +1,3 @@ [DifferentTyCons] -Can't unify different type constructors: Int and Bool \ No newline at end of file +Can't unify different type constructors: Integer and Bool \ No newline at end of file diff --git a/typechecker/test/cases/should-typecheck/Just-3-tuple-pb.hs b/typechecker/test/cases/should-typecheck/Just-3-tuple-pb.hs index a7e78e41890a7fe1ac661c69d1d13ad44b2a2994..c26c7edb7ae289e90ca4cce7daee9e4f6990b585 100644 --- a/typechecker/test/cases/should-typecheck/Just-3-tuple-pb.hs +++ b/typechecker/test/cases/should-typecheck/Just-3-tuple-pb.hs @@ -1,6 +1,6 @@ x :: forall a. a -> a y :: Double -z :: Bool -> Either Bool Int +z :: Bool -> Either Bool Integer Just (x, y, z) = pure (fp 1, gp 2, hp 3) where diff --git a/typechecker/test/cases/should-typecheck/Just-3-tuple-pb.output b/typechecker/test/cases/should-typecheck/Just-3-tuple-pb.output index 257a0d3bc25abc1e4725f2d2d514a6b323a23c51..68ca409cbe783657ea2a636d2f2a12a5b1ee557d 100644 --- a/typechecker/test/cases/should-typecheck/Just-3-tuple-pb.output +++ b/typechecker/test/cases/should-typecheck/Just-3-tuple-pb.output @@ -1,3 +1,3 @@ x : forall a1:Type. a1 -> a1 y : Double -z : Bool -> Either Bool Int \ No newline at end of file +z : Bool -> Either Bool Integer \ No newline at end of file diff --git a/typechecker/test/cases/should-typecheck/JustXfmap.output b/typechecker/test/cases/should-typecheck/JustXfmap.output index 0c794d2e70bc76c1ac2babc3daa3ab898d2e7b2a..7162fdc4c17c88471e379bc44c9200bf53b29f51 100644 --- a/typechecker/test/cases/should-typecheck/JustXfmap.output +++ b/typechecker/test/cases/should-typecheck/JustXfmap.output @@ -1 +1 @@ -x : Int \ No newline at end of file +x : Integer \ No newline at end of file diff --git a/typechecker/test/cases/should-typecheck/absMaybe.hs b/typechecker/test/cases/should-typecheck/absMaybe.hs index 11f1ba0fe7cae2fb4f7c013f24a32aabe2b4d81c..d6468df4b80d295dbd79626953ec2a76b8eeacc5 100644 --- a/typechecker/test/cases/should-typecheck/absMaybe.hs +++ b/typechecker/test/cases/should-typecheck/absMaybe.hs @@ -1,3 +1,3 @@ -absMaybe :: Maybe Int -> Int +absMaybe :: Maybe Integer -> Integer absMaybe (Just @a x) = x :: a absMaybe Nothing = 0 diff --git a/typechecker/test/cases/should-typecheck/absMaybe.output b/typechecker/test/cases/should-typecheck/absMaybe.output index 24fda04cf3c68576b940bdcb4022251971a7efea..4ae1fe549318e53b280046c7c9693b2b8cdac9ab 100644 --- a/typechecker/test/cases/should-typecheck/absMaybe.output +++ b/typechecker/test/cases/should-typecheck/absMaybe.output @@ -1 +1 @@ -absMaybe :: Maybe Int -> Int +absMaybe :: Maybe Integer -> Integer diff --git a/typechecker/test/cases/should-typecheck/absMaybeMaybe.hs b/typechecker/test/cases/should-typecheck/absMaybeMaybe.hs index 5e1dfe43f819122f30504c716e5d81c693daf404..5b9a180e789b5a9033aa7c6d0c636e749b70f9fd 100644 --- a/typechecker/test/cases/should-typecheck/absMaybeMaybe.hs +++ b/typechecker/test/cases/should-typecheck/absMaybeMaybe.hs @@ -1,3 +1,3 @@ -absMaybeMaybe :: Maybe (Maybe Int) -> Maybe Int +absMaybeMaybe :: Maybe (Maybe Integer) -> Maybe Integer absMaybeMaybe (Just @(p q) _) = (Just 1) :: (p q) absMaybeMaybe Nothing = Nothing diff --git a/typechecker/test/cases/should-typecheck/absMaybeMaybe.output b/typechecker/test/cases/should-typecheck/absMaybeMaybe.output index 7296d7afca1784078aa4bb9d854eacd59e02f42d..5a6368aa31cdacef4bf3619f2b86a3e7f76fa863 100644 --- a/typechecker/test/cases/should-typecheck/absMaybeMaybe.output +++ b/typechecker/test/cases/should-typecheck/absMaybeMaybe.output @@ -1 +1 @@ -absMaybeMaybe : Maybe (Maybe Int) -> Maybe Int \ No newline at end of file +absMaybeMaybe : Maybe (Maybe Integer) -> Maybe Integer \ No newline at end of file diff --git a/typechecker/test/cases/should-typecheck/apply-infer.output b/typechecker/test/cases/should-typecheck/apply-infer.output index 265b513f1ac4a6c3cae29e206600bc3c016133a3..7a0499d26428d5b2bc653a66ec8b4502053166fa 100644 --- a/typechecker/test/cases/should-typecheck/apply-infer.output +++ b/typechecker/test/cases/should-typecheck/apply-infer.output @@ -1 +1 @@ -apply : forall {a1:Type}. Int -> (a1 -> a1) -> a1 -> a1 \ No newline at end of file +apply : forall {a1:Type}. Integer -> (a1 -> a1) -> a1 -> a1 \ No newline at end of file diff --git a/typechecker/test/cases/should-typecheck/ifTrueThenPlusTwo-infer.output b/typechecker/test/cases/should-typecheck/ifTrueThenPlusTwo-infer.output index 43c8a586f038aede120a21b4d74cf73123919418..f051f1b23df62c3dc4544fcbe29eca2db44899a3 100644 --- a/typechecker/test/cases/should-typecheck/ifTrueThenPlusTwo-infer.output +++ b/typechecker/test/cases/should-typecheck/ifTrueThenPlusTwo-infer.output @@ -1 +1 @@ -ifTrueThenPlusTwo : Bool -> Int \ No newline at end of file +ifTrueThenPlusTwo : Bool -> Integer \ No newline at end of file diff --git a/typechecker/test/cases/should-typecheck/inParenSig.hs b/typechecker/test/cases/should-typecheck/inParenSig.hs index 89e738962556ff86c9c3436cea02fdc96536feb1..3964ae2a955889d4dbb5b7d517444b80bbc97c82 100644 --- a/typechecker/test/cases/should-typecheck/inParenSig.hs +++ b/typechecker/test/cases/should-typecheck/inParenSig.hs @@ -1,2 +1,2 @@ -inParenSig :: Int +inParenSig :: Integer (inParenSig) = 3 diff --git a/typechecker/test/cases/should-typecheck/inParenSig.output b/typechecker/test/cases/should-typecheck/inParenSig.output index dec86d643c85e3eb7a6c0af4f99dc4b7f65ba935..b2aa20a9a940f300c724d3b9317fbb51552f9967 100644 --- a/typechecker/test/cases/should-typecheck/inParenSig.output +++ b/typechecker/test/cases/should-typecheck/inParenSig.output @@ -1 +1 @@ -inParenSig : Int \ No newline at end of file +inParenSig : Integer \ No newline at end of file diff --git a/typechecker/test/cases/should-typecheck/int-functions-infer.output b/typechecker/test/cases/should-typecheck/int-functions-infer.output index a2fa7deda392a9751fc7c123e630ea44839def11..6385cd18ba08139925de8f410c4748f0639d1e14 100644 --- a/typechecker/test/cases/should-typecheck/int-functions-infer.output +++ b/typechecker/test/cases/should-typecheck/int-functions-infer.output @@ -1,3 +1,3 @@ -plusTwo : Int -> Int -plusItself : Int -> Int -fourPlusTwos : Int -> Int \ No newline at end of file +plusTwo : Integer -> Integer +plusItself : Integer -> Integer +fourPlusTwos : Integer -> Integer \ No newline at end of file diff --git a/typechecker/test/cases/should-typecheck/intToBool-check.hs b/typechecker/test/cases/should-typecheck/intToBool-check.hs index 1a4d2608704f984cf697aeeca28e55de4efc4a80..c6bbd2d1f1c4997a45de353b5eda63e0f786775c 100644 --- a/typechecker/test/cases/should-typecheck/intToBool-check.hs +++ b/typechecker/test/cases/should-typecheck/intToBool-check.hs @@ -1,4 +1,4 @@ -intToBool :: Int -> Bool +intToBool :: Integer -> Bool intToBool 1 = True intToBool 0 = False intToBool _ = False diff --git a/typechecker/test/cases/should-typecheck/intToBool-check.output b/typechecker/test/cases/should-typecheck/intToBool-check.output index 85c48159701879e0c4eaed137bcb86318ab9f0c6..36896d4c24dee3838839e83b4cdf0fad1134adc6 100644 --- a/typechecker/test/cases/should-typecheck/intToBool-check.output +++ b/typechecker/test/cases/should-typecheck/intToBool-check.output @@ -1 +1 @@ -intToBool : Int -> Bool \ No newline at end of file +intToBool : Integer -> Bool \ No newline at end of file diff --git a/typechecker/test/cases/should-typecheck/intToBool-infer.output b/typechecker/test/cases/should-typecheck/intToBool-infer.output index 85c48159701879e0c4eaed137bcb86318ab9f0c6..36896d4c24dee3838839e83b4cdf0fad1134adc6 100644 --- a/typechecker/test/cases/should-typecheck/intToBool-infer.output +++ b/typechecker/test/cases/should-typecheck/intToBool-infer.output @@ -1 +1 @@ -intToBool : Int -> Bool \ No newline at end of file +intToBool : Integer -> Bool \ No newline at end of file diff --git a/typechecker/test/cases/should-typecheck/myConst-required.hs b/typechecker/test/cases/should-typecheck/myConst-required.hs index 7b59f777081ad9a877f270aa3086de0611e5925e..be823eee1f35c6c65dae2bfa2933922c4d331c72 100644 --- a/typechecker/test/cases/should-typecheck/myConst-required.hs +++ b/typechecker/test/cases/should-typecheck/myConst-required.hs @@ -1,6 +1,6 @@ myConst :: forall a -> forall b -> a -> b -> a myConst p q x y = y :: q -myConstInt = myConst Int +myConstInt = myConst Integer -myConstIntBool = myConst Int Bool +myConstIntBool = myConst Integer Bool diff --git a/typechecker/test/cases/should-typecheck/myConst-required.output b/typechecker/test/cases/should-typecheck/myConst-required.output index f55788ff327dbc9df2da5435cfcfbb5ebbd1fc53..610ac70d602ed3cfc937cac1cae9ae3b0706009c 100644 --- a/typechecker/test/cases/should-typecheck/myConst-required.output +++ b/typechecker/test/cases/should-typecheck/myConst-required.output @@ -1,3 +1,3 @@ myConst : forall a1:Type -> forall b1:Type -> a1 -> b1 -> a1 -myConstInt : forall a1:Type -> Int -> a1 -> Int -myConstIntBool : Int -> Bool -> Int \ No newline at end of file +myConstInt : forall a1:Type -> Integer -> a1 -> Integer +myConstIntBool : Integer -> Bool -> Integer \ No newline at end of file diff --git a/typechecker/test/cases/should-typecheck/plusNineLambda-infer.output b/typechecker/test/cases/should-typecheck/plusNineLambda-infer.output index 9754abfb9dcffdd9d3fcc56cb7c270ddbc1421ce..08456e0021dfa093c9e3f490b983f5edd1e8bd29 100644 --- a/typechecker/test/cases/should-typecheck/plusNineLambda-infer.output +++ b/typechecker/test/cases/should-typecheck/plusNineLambda-infer.output @@ -1 +1 @@ -plusNineLambda : Int -> Int -> Int -> Int \ No newline at end of file +plusNineLambda : Integer -> Integer -> Integer -> Integer \ No newline at end of file diff --git a/typechecker/test/cases/should-typecheck/silly1.hs b/typechecker/test/cases/should-typecheck/silly1.hs index 9f811d581a834cf42bab1219d3b2bc20d85cdeb3..ecf4efe2c2da02d631f49ff02cd9e1aad0ce7f56 100644 --- a/typechecker/test/cases/should-typecheck/silly1.hs +++ b/typechecker/test/cases/should-typecheck/silly1.hs @@ -1,3 +1,3 @@ -silly1 :: forall a. Show a => a -> Int +silly1 :: forall a. Show a => a -> Integer silly1 (show -> "Matched") = 4 silly1 _ = 0 diff --git a/typechecker/test/cases/should-typecheck/silly1.output b/typechecker/test/cases/should-typecheck/silly1.output index 881f144f1768a401532fa92f5ebf4ded8b7189aa..1c7fc1099b835b728c6f9e2716691f628a1bc993 100644 --- a/typechecker/test/cases/should-typecheck/silly1.output +++ b/typechecker/test/cases/should-typecheck/silly1.output @@ -1 +1 @@ -silly1 : forall a1:Type. Show a1 => a1 -> Int \ No newline at end of file +silly1 : forall a1:Type. Show a1 => a1 -> Integer \ No newline at end of file diff --git a/typechecker/test/cases/should-typecheck/tyAbsCaseIllegal.hs b/typechecker/test/cases/should-typecheck/tyAbsCaseIllegal.hs index cb299a117b6c32d6c94655c2daf7782a0e0a0baf..6d1bb41783eabdfc11afa82dff2aeab0aa7ba490 100644 --- a/typechecker/test/cases/should-typecheck/tyAbsCaseIllegal.hs +++ b/typechecker/test/cases/should-typecheck/tyAbsCaseIllegal.hs @@ -1,4 +1,4 @@ -tyAbsCaseIllegal :: forall a. (a -> a) -> Int +tyAbsCaseIllegal :: forall a. (a -> a) -> Integer tyAbsCaseIllegal g = case g of -- g has type 'a' @b x -> let y = 0 -- There is no correcsponding invisibly-specified quantifee to bound b to! z :: b -> b -- 'b' is not in scope diff --git a/typechecker/test/cases/should-typecheck/tyAbsCaseLegal.hs b/typechecker/test/cases/should-typecheck/tyAbsCaseLegal.hs index 2137fb5e2f45dc8310d86f8f8e9f9f444d482cc8..52f31a473cb55ebc460c8529c8bc2ed8165887d4 100644 --- a/typechecker/test/cases/should-typecheck/tyAbsCaseLegal.hs +++ b/typechecker/test/cases/should-typecheck/tyAbsCaseLegal.hs @@ -1,4 +1,4 @@ -tyAbsCaseLegal :: forall a. (a -> a) -> Int +tyAbsCaseLegal :: forall a. (a -> a) -> Integer tyAbsCaseLegal @b g = case g of x -> let y = 0 z :: b -> b -- b is in scope diff --git a/typechecker/test/cases/should-typecheck/tyAbsCaseLegal.output b/typechecker/test/cases/should-typecheck/tyAbsCaseLegal.output index 86732dfbac16d72b43451342ea58fd92e6b3c5f5..77259934257221c8e3c4940bc6d83fe2d176bcdb 100644 --- a/typechecker/test/cases/should-typecheck/tyAbsCaseLegal.output +++ b/typechecker/test/cases/should-typecheck/tyAbsCaseLegal.output @@ -1 +1 @@ -tyAbsCaseLegal : forall a1:Type. (a1 -> a1) -> Int +tyAbsCaseLegal : forall a1:Type. (a1 -> a1) -> Integer diff --git a/typechecker/test/cases/should-typecheck/unwrapMaybeAndEither-infer.output b/typechecker/test/cases/should-typecheck/unwrapMaybeAndEither-infer.output index 0c9534b1bf12b17c8beafb64c2afd9d550fca211..0415756cf99242e60f464c7570e399501540fc93 100644 --- a/typechecker/test/cases/should-typecheck/unwrapMaybeAndEither-infer.output +++ b/typechecker/test/cases/should-typecheck/unwrapMaybeAndEither-infer.output @@ -1,4 +1,4 @@ unwrapMaybeBool : Maybe Bool -> Bool -unwrapEitherIntBoolCase : Either Int Bool -> Either Int Bool -unwrapEitherIntBool : Either Int Bool -> Either Int Bool +unwrapEitherIntBoolCase : Either Integer Bool -> Either Integer Bool +unwrapEitherIntBool : Either Integer Bool -> Either Integer Bool idEither : forall {a1:Type}. forall {b1:Type}. Either a1 b1 -> Either a1 b1 \ No newline at end of file diff --git a/typechecker/test/cases/should-typecheck/weirdDecl.hs b/typechecker/test/cases/should-typecheck/weirdDecl.hs index e98f903937bdb71d846399812d2c8706529edd3f..1903230d13dbcd36ef03759c9ac116ad935c920c 100644 --- a/typechecker/test/cases/should-typecheck/weirdDecl.hs +++ b/typechecker/test/cases/should-typecheck/weirdDecl.hs @@ -1,2 +1,2 @@ -weirdDecl :: forall a. a -> a ~ Int => a -- The goal is to reject this, -weirdDecl @Int x = x -- but for now, we need to accept it +weirdDecl :: forall a. a -> a ~ Integer => a -- The goal is to reject this, +weirdDecl @Integer x = x -- but for now, we need to accept it diff --git a/typechecker/test/cases/should-typecheck/weirdDecl.output b/typechecker/test/cases/should-typecheck/weirdDecl.output index e42ebb9bc1d1ee5a87874f86f7802ae281b02e7c..f9a9207388af7a70905ebff9a8fd0bfe66ded7e7 100644 --- a/typechecker/test/cases/should-typecheck/weirdDecl.output +++ b/typechecker/test/cases/should-typecheck/weirdDecl.output @@ -1 +1 @@ -weirdDecl : forall a1:Type. a1 -> a1 ~ Int => a1 \ No newline at end of file +weirdDecl : forall a1:Type. a1 -> a1 ~ Integer => a1 \ No newline at end of file diff --git a/typechecker/test/other/Rep.hs b/typechecker/test/other/Rep.hs index ef9b4efab2bb3906137fe935fa75e47a1b397037..c673a93c31712889dec0b90bfbb2203a7a22e867 100644 --- a/typechecker/test/other/Rep.hs +++ b/typechecker/test/other/Rep.hs @@ -12,4 +12,4 @@ idType = Quantified (Specified (fooVar, tyConType)) (Quantified (Arrow (Alpha fo idTypeToIdType = (Quantified (Arrow idType) idType) -intToIntArg = Quantified (Arrow (Quantified (Arrow tyConInt) tyConInt)) tyConBool +intToIntArg = Quantified (Arrow (Quantified (Arrow tyConInteger) tyConInt)) tyConBool