[Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-21 Thread Chad Scherrer
On Wed, Feb 20, 2008 at 7:57 PM, Henning Thielemann [EMAIL PROTECTED] wrote: I think there can also be problems simply because the element type is no longer fixed to Word8 but also not entirely free, but restricted to Storable. E.g. you cannot simply replace SV.fromList . List.map f

[Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread John Goerzen
On 2008-02-20, Ross Paterson [EMAIL PROTECTED] wrote: conventions won't be usable in my ByteString code, for instance. [...] http://software.complete.org/listlike/static/doc/ListLike/Data-ListLike.html As Henning pointed out, multiple parameter type classes are problematic for core

[Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread John Goerzen
On 2008-02-20, John Goerzen [EMAIL PROTECTED] wrote: I notice that Data.Foldable does some similar things but does not use multi-parameter type classes. I seem to recall that I attempted to do this in the same manner, but got tripped up somewhere. I can't remember now exactly what the

Re: [Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread Neil Mitchell
Hi full - Maybe (item, full) Hrm, what exactly is the return data here? Is is the head and the tail if the list has = 1 item, or Nothing otherwise? Or...? Yes, its the projection onto another type: [] = Nothing (x:xs) = Just (x, xs) What is the problem with MPTC in base?

Re: [Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread Jules Bean
John Goerzen wrote: On 2008-02-20, John Goerzen [EMAIL PROTECTED] wrote: I notice that Data.Foldable does some similar things but does not use multi-parameter type classes. I seem to recall that I attempted to do this in the same manner, but got tripped up somewhere. I can't remember now

[Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread Chad Scherrer
Henning Thielemann lemming at henning-thielemann.de writes: 4) We are missing one final useful type: a Word32-based ByteString. When working in the Unicode character set, a 32-bit character can indeed be useful, and I could see situations in which the performance benefit of a

Re: [Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread Antoine Latter
On Feb 20, 2008 12:48 PM, Chad Scherrer [EMAIL PROTECTED] wrote: StorableVector should fill this gap. http://code.haskell.org/~sjanssen/storablevector/ Yes, it could, but (1) it's way behind ByteString in terms of optimizations (== fusion) (2) there's (as far as I know) not a

Re: [Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread Chad Scherrer
On Feb 20, 2008 10:57 AM, Antoine Latter [EMAIL PROTECTED] wrote: For anyone looking into it - the StorableVector fusion would have to be quite different from the current ByteString fusion framework. Maybe it would be enough to lay down a Stream fusion framework for StorableVectors. I must be

[Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread John Goerzen
On 2008-02-20, Jules Bean [EMAIL PROTECTED] wrote: Not directly, no. The point about Foldable, Functor, and Monad, is that they enforce the connection between container and contents. If the contents is of type a, the container is of type f a for a fixed type constructor 'f'. This works

Re: [Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread Antoine Latter
On Feb 20, 2008 12:59 PM, Chad Scherrer [EMAIL PROTECTED] wrote: On Feb 20, 2008 10:57 AM, Antoine Latter [EMAIL PROTECTED] wrote: For anyone looking into it - the StorableVector fusion would have to be quite different from the current ByteString fusion framework. Maybe it would be enough

Re: [Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread Chad Scherrer
Antoine Latter [EMAIL PROTECTED] wrote: From what I saw of Data.ByteString.Fusion, it relies on the assumption that the elements of the output array are of the same size and alignment as the elements of all of the arrays in the fused intermediate steps. That way, all of the intermediate

[Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread Ben Franksen
John Goerzen wrote: On 2008-02-20, Jules Bean [EMAIL PROTECTED] wrote: Not directly, no. The point about Foldable, Functor, and Monad, is that they enforce the connection between container and contents. If the contents is of type a, the container is of type f a for a fixed type constructor

Re: [Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread David Roundy
On Wed, Feb 20, 2008 at 11:18:51PM +0100, Ben Franksen wrote: John Goerzen wrote: On 2008-02-20, Jules Bean [EMAIL PROTECTED] wrote: Not directly, no. The point about Foldable, Functor, and Monad, is that they enforce the connection between container and contents. If the contents is

[Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread John Goerzen
On 2008-02-20, John Goerzen [EMAIL PROTECTED] wrote: On the other hand, if you mean using a dictionary to wrap just the ByteString types (or other similar ones), I am currently thinking of something along those lines. I'll post here if I come up with something clever (or not). Can't come up

Re: [Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread ajb
G'day all. Quoting Neil Mitchell [EMAIL PROTECTED]: Yes, its the projection onto another type: [] = Nothing (x:xs) = Just (x, xs) Also known as msplit: http://www.haskell.org/haskellwiki/New_monads/MonadSplit Cheers, Andrew Bromage ___

[Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread Henning Thielemann
On Wed, 20 Feb 2008, Chad Scherrer wrote: On Feb 20, 2008 10:57 AM, Antoine Latter [EMAIL PROTECTED] wrote: For anyone looking into it - the StorableVector fusion would have to be quite different from the current ByteString fusion framework. Maybe it would be enough to lay down a Stream

Re: [Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread David Menendez
On Wed, Feb 20, 2008 at 10:46 PM, [EMAIL PROTECTED] wrote: Quoting Neil Mitchell [EMAIL PROTECTED]: Yes, its the projection onto another type: [] = Nothing (x:xs) = Just (x, xs) Also known as msplit: http://www.haskell.org/haskellwiki/New_monads/MonadSplit Almost. The