[Haskell-cafe] built-in lists vs inductively defined list

Stefan O'Rear stefanor at cox.net
Wed May 9 09:52:01 EDT 2007


On Wed, May 09, 2007 at 02:45:34PM +0100, Jos? Miguel Vila?a wrote:
> Can someone tell me if would be any difference (beside syntax) between the
> built-in Haskell list with [] and : and lists given by a inductive datatype
> definition like
>
> data List a = Nil | Cons a (List a)
> 
> This is, is any of the compilers doing some special optimizations for the
> built-in lists?

To the best of my knowledge, there are no optimizations specific to []
in the compiler proper.

However, the standard library has a *lot* of speed hacks you will need
to duplicate!

Stefan


More information about the Haskell-Cafe mailing list