Re: [Haskell-cafe] A clarification about what happens under the hood with foldMap

2012-10-23 Thread Alfredo Di Napoli
> > Subject: [Haskell-cafe] A clarification about what happens under the > > hoodwith foldMap > > > > I'm sure I'm missing a point, but the "minimum" definition for a Foldable > > instance is given in terms of foldMap, so I get the ca

Re: [Haskell-cafe] A clarification about what happens under the hood with foldMap

2012-10-23 Thread John Lato
> From: Alfredo Di Napoli > Subject: [Haskell-cafe] A clarification about what happens under the > hoodwith foldMap > > I'm sure I'm missing a point, but the "minimum" definition for a Foldable > instance is given in terms of foldMap, so I g

Re: [Haskell-cafe] A clarification about what happens under the hood with foldMap

2012-10-23 Thread Alfredo Di Napoli
Thanks guys, I'll work my way through Oleg's paradox as well as what you just said Chaddai. I'm very busy right now, but I'll probably come back to you tomorrow morning, when I'll have an hour to think freely :) Cheers, A. ___ Haskell-Cafe mailing list H

Re: [Haskell-cafe] A clarification about what happens under the hood with foldMap

2012-10-23 Thread Chaddaï Fouché
On Tue, Oct 23, 2012 at 10:36 AM, Alfredo Di Napoli wrote: > I'm sure I'm missing a point, but the "minimum" definition for a Foldable > instance is given in terms of foldMap, so I get the cake for free, foldr > included, right? > In the example I have defined my treeSum as: > > treeSum = Data.Fol

[Haskell-cafe] A clarification about what happens under the hood with foldMap

2012-10-23 Thread oleg
> I was playing with the classic example of a Foldable structure: Trees. > So the code you can find both on Haskell Wiki and LYAH is the following: > > data Tree a = Empty | Node (Tree a) a (Tree a) deriving (Show, Eq) > > instance Foldable Tree where > foldMap f Empty = mempty > foldMap f

[Haskell-cafe] A clarification about what happens under the hood with foldMap

2012-10-23 Thread Alfredo Di Napoli
-- Forwarded message -- From: Alfredo Di Napoli Date: 23 October 2012 10:35 Subject: Re: [Haskell-cafe] A clarification about what happens under the hood with foldMap To: Chaddaï Fouché I'm sure I'm missing a point, but the "minimum" definition for a Foldab

Re: [Haskell-cafe] A clarification about what happens under the hood with foldMap

2012-10-23 Thread Chaddaï Fouché
Le 23 oct. 2012 09:54, "Alfredo Di Napoli" a écrit : > > What this code does is straighforward. I was struck from the following sentences in LYAH: > >> Notice that we didn't have to provide the function that takes a value and returns a monoid value. >> We receive that function as a parameter to fo

[Haskell-cafe] A clarification about what happens under the hood with foldMap

2012-10-23 Thread Alfredo Di Napoli
Hi Cafe, I was playing with the classic example of a Foldable structure: Trees. So the code you can find both on Haskell Wiki and LYAH is the following: data Tree a = Empty | Node (Tree a) a (Tree a) deriving (Show, Eq) instance Foldable Tree where foldMap f Empty = mempty foldMap f (Nod

Re: [Haskell-cafe] I would like a clarification about Enumerators and Iteratees, please :)

2012-10-16 Thread Gregory Collins
You have a space leak in "countCharBS". Put a bang pattern on your accumulator. On Tue, Oct 16, 2012 at 2:46 PM, Alfredo Di Napoli < alfredo.dinap...@gmail.com> wrote: > Hi guys, > > I've started playing with Iteratee and Enumerators: very cool and > addictive stuff. > > I have wrote this simple

[Haskell-cafe] I would like a clarification about Enumerators and Iteratees, please :)

2012-10-16 Thread Alfredo Di Napoli
Hi guys, I've started playing with Iteratee and Enumerators: very cool and addictive stuff. I have wrote this simple code: https://gist.github.com/3899017 In a nutshell, it gives back the number of occurences for a single char in case the argument passed from the command line is a single char,

Re: A clarification...

2001-01-26 Thread Jan-Willem Maessen
[EMAIL PROTECTED] (Marcin 'Qrczak' Kowalczyk) further clarifies my clarification: > >case ERROR of x -> expr => ERROR glb expr[?/x] > > The subject of errors vs. bottoms is discussed in > http://research.microsoft.com/~simonpj/papers/imprecise-exceptions.ps.gz Indeed. I crawled thro

Re: A clarification...

2001-01-26 Thread Marcin 'Qrczak' Kowalczyk
Fri, 26 Jan 2001 15:53:51 -0500, Jan-Willem Maessen <[EMAIL PROTECTED]> pisze: > 3) Reject an operational reading of "case" as forcing evaluation and >continuing and have it "do something special" when it encounters >error: >case ERROR of x -> expr => ERROR glb expr[?/x] The s

A clarification...

2001-01-26 Thread Jan-Willem Maessen
Marko Schuetz <[EMAIL PROTECTED]> replies to me as follows: > > He uses this, and an argument based on currying, to show that strict > > functions ought to force their arguments left to right. > > I can't see where I did. I argued that distinguishing between error > and bottom seems to not leave