
Russell O'Connor schrieb:
Samuel Bronson
writes: On 10/24/06, Russell O'Connor
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