On Wed, Aug 18, 2010 at 9:56 PM, wren ng thornton w...@freegeek.org wrote:
Oleg Lobachev wrote:
#ifdef USE_REPORT_PRELUDE
and = foldr () True
or = foldr (||) False
#else
and [] = True
and (x:xs) = x and xs
or [] =
On 8/24/10 1:55 PM, Jan-Willem Maessen wrote:
On Wed, Aug 18, 2010 at 9:56 PM, wren ng thorntonw...@freegeek.org wrote:
The thing I find puzzling is that the foldr is inlined. The (regular) clever
optimizations for build/foldr seem like they should already handle this
without the need for the
Hello all,
the and function, and :: [Bool] - Bool is defined in two different ways in the
latest Prelude.
I would expect it to be
and = foldr () True
However, there is a further recursive definition, and it is the one used! See
Oleg Lobachev lobac...@mathematik.uni-marburg.de writes:
#else
and [] = True
and (x:xs) = x and xs
or [] = False
or (x:xs) = x || or xs
{-# RULES
and/build forall (g::forall b.(Bool-b-b)-b-b) .
and (build g) = g () True
On 18 August 2010 10:05, Oleg Lobachev
lobac...@mathematik.uni-marburg.de wrote:
Hello all,
the and function, and :: [Bool] - Bool is defined in two different ways in
the latest Prelude.
I would expect it to be
and = foldr () True
However, there is a further recursive definition, and it
Hello,
On Aug 18, 2010, at 13:44 , Duncan Coutts wrote:
This is just an issue of specification vs implementation. The spec
from the H98 report is
and = foldr () True
[snip]
Note that 'equal' includes all partial and total lists, so you can
rely on the above spec to reason about the
On 18 August 2010 13:29, Oleg Lobachev
lobac...@mathematik.uni-marburg.de wrote:
By the way, does some good reading on streams in Haskell exist? I am
interested primarily in a theoretical foundation, which should however be
somehow related to Haskell. My guess would be the relation of
Oleg Lobachev wrote:
#ifdef USE_REPORT_PRELUDE
and = foldr () True
or = foldr (||) False
#else
and [] = True
and (x:xs) = x and xs
or [] = False
or (x:xs) = x || or xs
{-# RULES
and/build forall (g::forall