summaryrefslogtreecommitdiff
path: root/testsuite/tests/ado/ado002.hs
blob: f4d4d9336116404060d7c955c438501cd380ef56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{-# LANGUAGE ApplicativeDo,ScopedTypeVariables #-}
module Test where

-- Test that type errors aren't affected by ApplicativeDo
f :: IO Int
f = do
  x <- getChar
  y <- getChar 'a' -- type error
  print (x,y)

g :: IO (Int,Int)
g = do
  x <- getChar
  y <- getChar
  return (y,x)

h :: IO (Int,Int)
h = do
  x1 <- getChar
  x2 <- getChar
  x3 <- const (return ()) x1
  x4 <- getChar
  x5 <- getChar x4
  return (x2,x4)