(functions without bodies) Re: A Pointless Library Proposal
Christian Maeder
maeder at tzi.de
Wed Oct 25 03:33:55 EDT 2006
Russell O'Connor schrieb:
> Samuel Bronson <naesten <at> gmail.com> writes:
>
>> On 10/24/06, Russell O'Connor <roconnor <at> theorem.ca> wrote:
>>> Why have a function body at all? Shouldn't the type signature be sufficent?
>> Remember that type signatures need not be adjacent to function
>> definitions. Now ponder what would happen if you forgot to define a
>> function. Have a clue why it isn't sufficient now?
>
> If you turn on -Wall in GHC, you would get a warning that your pattern coverage
> is incomplete. We should make it so that if the pattern coverage is incomplete
> and there is no function body, then that is an error.
You mean a warning for a completely missing body, don't you?
I'ld find type signatures of functions only perfect for specification
purposes. Some time ago I even submitted a feature request.
http://hackage.haskell.org/trac/ghc/ticket/393
Christian
More information about the Libraries
mailing list