summaryrefslogtreecommitdiff
path: root/testsuite/tests/arrows/should_compile/arrowdo1.hs
blob: b70eedd460fb8389e935300c8081f1b183fcd3f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# LANGUAGE Arrows #-}

module ShouldCompile where

import Control.Arrow

f :: Arrow a => a (Int,Int,Int) Int
f = proc (x,y,z) -> returnA -< x+y

g :: Arrow a => Int -> a Int Int
g x = proc y -> returnA -< x*y

h :: Arrow a => Int -> a (Int,Int) Int
h x = proc (y,z) -> do
	a <- f -< (x,y,3)
	b <- g (2+x) -< y+a
	returnA -< a*b+z