[Haskell-cafe] Code generated by pointfree does not compile

Boris Lykah lykahb at gmail.com
Thu Nov 5 06:46:57 EST 2009

Hi all! 

I was playing with pointfree tool from hackage and found that it produces
wrong code for some functions which use list comprehension. 

Here are several examples: 

:main f x = concat [x:f x| x<-[0..x-1]] 
f = fix ((join .) . flip flip [] . ((:) .) . ap (:) . (`ap` (enumFromTo 0 .
subtract 1)) . ((<-) .) . ((|) =<<)) 
This does not compile because (<-) and (|) are used as functions whereas
they are not. 

:main map (+1) [x| x<-[0..x]] 
[x | x <- [0..x] + 1] 
This does not compile either because the result code tries to add one to

Why does this happen? This looks like a bug. 

Boris Lykah
View this message in context: http://old.nabble.com/Code-generated-by-pointfree-does-not-compile-tp26211701p26211701.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

More information about the Haskell-Cafe mailing list