A Pointless Library Proposal

Lennart Augustsson lennart at augustsson.net
Mon Oct 30 10:16:46 EST 2006


I like to use undefined is the stub for unimplemented functions since  
it's nice and terse.  Unfortunately, ghc doesn't give much  
information about where the undefined was called.
It would be great if the message for undefined could include file  
name and line number (like hbc did :).

	-- Lennart

On Oct 30, 2006, at 09:54 , Simon Peyton-Jones wrote:

> | I don't like this idea because the necessary stub is different for
> different
> | numbers of arguments, and there's no way to tell how many arguments
> the
> | programmer intended.
>
> Why?  What's wrong with expanding
> 	foo :: Int -> Int -> Int
> into
> 	foo :: Int -> Int -> Int
> 	foo = error "foo is not yet implemented"
>
> which is what I usually write by hand.
>
> |I do like the idea of allowing empty case expressions,
> | though, and I don't think that even a warning would be necessary.
>
> So how would you define foo?  How would it be better than the above
> (even if written by hand)?
>
> Simon
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries



More information about the Libraries mailing list