[Haskell-beginners] mayBe stuck

Colin Paul Adams colin at colina.demon.co.uk
Fri Aug 6 09:38:27 EDT 2010


>>>>> "Daniel" == Daniel Fischer <daniel.is.fischer at web.de> writes:

    Daniel> On Friday 06 August 2010 14:52:06, aditya siram wrote:
    >> Doesn't the -Wall flag pick that up?  -deech

    Daniel> Not if there's an explicit error call for the undefined
    Daniel> cases, e.g.

    Daniel> head :: [a] -> a head (x:_) = x head _ = error
    Daniel> "Prelude.head: empty list"

    Daniel> compiles without warning.

Ah. So it's safer not to use defensive programming then.

Good. As an Eiffel programmer, that's what I'm used to. 
-- 
Colin Adams
Preston Lancashire
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


More information about the Beginners mailing list