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

import Prelude hiding ( init )

returnA :: b -> b
returnA = id

------------
newtype State s a = State { unState :: [a] }

------------
pIterate :: a -> [a]
pIterate =
    proc x -> do
      rec
        as <- unState -< s
        let s = State (x:as)
      returnA -< as