summaryrefslogtreecommitdiff
path: root/testsuite/tests/arrows/should_compile/arrowdo1.hs
blob: ef54094af9915850ca1f7eed84fb1a6c7f305755 (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