[Haskell-cafe] Eta-expansion and existentials (or: types destroy
my laziness)
Roman Leshchinskiy
rl at cse.unsw.edu.au
Sun Oct 17 11:20:10 EDT 2010
On 16/10/2010, at 12:36, Max Bolingbroke wrote:
> On 16 October 2010 12:16, Roman Leshchinskiy <rl at cse.unsw.edu.au> wrote:
>> eta :: Stream a -> Stream a
>> eta s = Stream s next
>> where
>> next (Stream s next') = case next' s of
>> Just (x,s') -> Just (x,Stream s' next')
>> Nothing -> Nothing
>>
>> Making GHC optimise stream code involving eta properly is hard :-)
>
> Good point, I don't exactly mean non-recursive for requirement 3) then
> - I mean an adjective with a fuzzier definition like "GHC-optimisable"
> :-)
I suspect the easiest way to achieve this is to expand the set of GHC-optimisable things until it includes eta :-)
Roman
More information about the Haskell-Cafe
mailing list