diff options
author | Richard Eisenberg <eir@cis.upenn.edu> | 2015-12-24 14:33:19 -0500 |
---|---|---|
committer | Richard Eisenberg <eir@cis.upenn.edu> | 2015-12-24 14:37:39 -0500 |
commit | 2db18b8135335da2da9918b722699df684097be9 (patch) | |
tree | 660dd90916aa6568694bbe39cdab83c7af98c5d7 /testsuite/tests/ado | |
parent | 48db13d279d592ed3044cbaf3513854bcb0d3dce (diff) | |
download | haskell-2db18b8135335da2da9918b722699df684097be9.tar.gz |
Visible type application
This re-working of the typechecker algorithm is based on
the paper "Visible type application", by Richard Eisenberg,
Stephanie Weirich, and Hamidhasan Ahmed, to be published at
ESOP'16.
This patch introduces -XTypeApplications, which allows users
to say, for example `id @Int`, which has type `Int -> Int`. See
the changes to the user manual for details.
This patch addresses tickets #10619, #5296, #10589.
Diffstat (limited to 'testsuite/tests/ado')
-rw-r--r-- | testsuite/tests/ado/ado002.stderr | 108 |
1 files changed, 67 insertions, 41 deletions
diff --git a/testsuite/tests/ado/ado002.stderr b/testsuite/tests/ado/ado002.stderr index cdfdbc4b19..9e7eba0a67 100644 --- a/testsuite/tests/ado/ado002.stderr +++ b/testsuite/tests/ado/ado002.stderr @@ -1,55 +1,81 @@ ado002.hs:8:8: error: - Couldn't match expected type ‘Char -> IO t1’ - with actual type ‘IO Char’ - The function ‘getChar’ is applied to one argument, - but its type ‘IO Char’ has none - In a stmt of a 'do' block: y <- getChar 'a' - In the expression: - do { x <- getChar; - y <- getChar 'a'; - print (x, y) } + • Couldn't match expected type ‘Char -> IO t1’ + with actual type ‘IO Char’ + • The function ‘getChar’ is applied to one argument, + but its type ‘IO Char’ has none + In a stmt of a 'do' block: y <- getChar 'a' + In the expression: + do { x <- getChar; + y <- getChar 'a'; + print (x, y) } ado002.hs:9:3: error: - Couldn't match type ‘()’ with ‘Int’ - Expected type: IO Int - Actual type: IO () - In a stmt of a 'do' block: print (x, y) - In the expression: - do { x <- getChar; - y <- getChar 'a'; - print (x, y) } + • Couldn't match type ‘()’ with ‘Int’ + Expected type: IO Int + Actual type: IO () + • In a stmt of a 'do' block: print (x, y) + In the expression: + do { x <- getChar; + y <- getChar 'a'; + print (x, y) } + In an equation for ‘f’: + f = do { x <- getChar; + y <- getChar 'a'; + print (x, y) } ado002.hs:15:11: error: - Couldn't match expected type ‘Int’ with actual type ‘Char’ - In the expression: y - In a stmt of a 'do' block: return (y, x) + • Couldn't match expected type ‘Int’ with actual type ‘Char’ + • In the expression: y + In a stmt of a 'do' block: return (y, x) + In the expression: + do { x <- getChar; + y <- getChar; + return (y, x) } ado002.hs:15:13: error: - Couldn't match expected type ‘Int’ with actual type ‘Char’ - In the expression: x - In a stmt of a 'do' block: return (y, x) + • Couldn't match expected type ‘Int’ with actual type ‘Char’ + • In the expression: x + In a stmt of a 'do' block: return (y, x) + In the expression: + do { x <- getChar; + y <- getChar; + return (y, x) } ado002.hs:23:9: error: - Couldn't match expected type ‘Char -> IO t0’ - with actual type ‘IO Char’ - The function ‘getChar’ is applied to one argument, - but its type ‘IO Char’ has none - In a stmt of a 'do' block: x5 <- getChar x4 - In the expression: - do { x1 <- getChar; - x2 <- getChar; - x3 <- const (return ()) x1; - x4 <- getChar; - x5 <- getChar x4; - return (x2, x4) } + • Couldn't match expected type ‘Char -> IO t0’ + with actual type ‘IO Char’ + • The function ‘getChar’ is applied to one argument, + but its type ‘IO Char’ has none + In a stmt of a 'do' block: x5 <- getChar x4 + In the expression: + do { x1 <- getChar; + x2 <- getChar; + x3 <- const (return ()) x1; + x4 <- getChar; + x5 <- getChar x4; + return (x2, x4) } ado002.hs:24:11: error: - Couldn't match expected type ‘Int’ with actual type ‘Char’ - In the expression: x2 - In a stmt of a 'do' block: return (x2, x4) + • Couldn't match expected type ‘Int’ with actual type ‘Char’ + • In the expression: x2 + In a stmt of a 'do' block: return (x2, x4) + In the expression: + do { x1 <- getChar; + x2 <- getChar; + x3 <- const (return ()) x1; + x4 <- getChar; + x5 <- getChar x4; + return (x2, x4) } ado002.hs:24:14: error: - Couldn't match expected type ‘Int’ with actual type ‘Char’ - In the expression: x4 - In a stmt of a 'do' block: return (x2, x4) + • Couldn't match expected type ‘Int’ with actual type ‘Char’ + • In the expression: x4 + In a stmt of a 'do' block: return (x2, x4) + In the expression: + do { x1 <- getChar; + x2 <- getChar; + x3 <- const (return ()) x1; + x4 <- getChar; + x5 <- getChar x4; + return (x2, x4) } |