arrowdo1.hs 332 Bytes
Newer Older
1
{-# LANGUAGE Arrows #-}
ross's avatar
ross committed
2
3
4
5
6

module ShouldCompile where

import Control.Arrow

ross's avatar
ross committed
7
8
f :: Arrow a => a (Int,Int,Int) Int
f = proc (x,y,z) -> returnA -< x+y
ross's avatar
ross committed
9

ross's avatar
ross committed
10
11
g :: Arrow a => Int -> a Int Int
g x = proc y -> returnA -< x*y
ross's avatar
ross committed
12
13
14

h :: Arrow a => Int -> a (Int,Int) Int
h x = proc (y,z) -> do
ross's avatar
ross committed
15
16
	a <- f -< (x,y,3)
	b <- g (2+x) -< y+a
ross's avatar
ross committed
17
	returnA -< a*b+z