Is there already a list class?

Spencer Janssen sjanssen at
Tue Jan 9 21:12:54 EST 2007

On Jan 9, 2007, at 7:52 PM, Marc Weber wrote:
> Hello.
> Is here the right place to request a list class?
> eg
> class List l e where
> 	(:) :: e -> l e -> l e
> 	head :: ..

Note that this approach isn't quite flexible enough.  Your example  
forces the container type to have kind * -> *, and therefore can't  
support certain specialized containers like ByteString.

There is a class like this in the Edison library (http://, it is called Seq  
Edison-Seq.html).  However, it suffers the same kind flexibility  
issues as your List class.  Other classes in Edison take a MPTC 
+fundep approach and I'm not sure why Seq doesn't.  Can you comment  
on this, Rob?

> This might be used in Data.Set, Data.Map
> class StorableAsList l e t where
> 	fromList :: l e ->  t
> 	toList :: t -> l e

This is subsumed by other Edison functionality.

> I'd like to help implementing/ writing it.
> Do you consider this beeing a useful enhancement?

Oh yes, but let's avoid reinventing the wheel if at all possible.

Spencer Janssen

More information about the Libraries mailing list