Update Trac ticket URLs to point to GitLab
[ghc.git] / testsuite / tests / parser / unicode / brackets.hs
1 {-# LANGUAGE Arrows #-}
2 {-# LANGUAGE TemplateHaskell #-}
3 {-# LANGUAGE UnicodeSyntax #-}
4
5 -- See #10162 and #11743 for details
6
7 module ShouldCompile where
8
9 import Control.Arrow
10 import Language.Haskell.TH
11
12 handle :: ArrowPlus a => a (b,s) c -> a (b,(String,s)) c -> a (b,s) c
13 handle f h = proc (b,s) -> (f -< (b,s)) <+> (h -< (b,("FAIL",s)))
14
15 f :: ArrowPlus a => a (Int,Int) String
16 f = proc (x,y) ->
17 ⦇handle
18 (returnA -< show y)
19 (\s -> returnA -< s ++ show x)
20
21
22 g :: ArrowPlus a => a (Int,Int) String
23 g = proc (x,y) ->
24 ⦇handle
25 (\msg -> returnA -< msg ++ show y)
26 (\s msg -> returnA -< s ++ show x)
27("hello " ++ show x)
28
29 h :: ArrowPlus a => a (Int,Int) Int
30 h = proc (x,y) ->
31 (
32 (\z -> returnA -< x + z)
33 <+>
34 (\z -> returnA -< y + z)
35 ) (x*y)
36
37
38 matches :: PatQ -> ExpQ
39 matches pat =\x ->
40 case x of
41 $pat -> True
42 _ -> False
43