[Haskell-cafe] Basic problem in Haskell language design?
aneumann at inf.fu-berlin.de
Sun Mar 1 09:46:18 EST 2009
You could turn on -Wall to get a whole bunch of such warnings.
Am 01.03.2009 um 14:26 schrieb Nicu Ionita:
> Today I found the following problem when writing a simple function:
>> -- Whole info from a word8 list to moves
>> movesFromWord8s :: [Word8] -> [Move]
>> movesFromWord8s (f:t:ws) = (f, t) : movesFromWord8s ws
>> moverFromWord8s _ = 
> Here I made a small typo in the second equation, writing "mover..."
> of "moves..." for the name of the declared function. Of course this
> is an
> error, because I have non-exhaustive patterns in the function
> movesFromWord8s. But the compiler (here GHC 6.8.2 on WinXP) has in
> no chance to detect this mistake, I saw it only in QuickCheck (aka at
> I think this is a basic problem with the language design. In small
> it's not so bad, but in large ones this could be. What do you think
> it? Are there possible solutions or workarounds?
> Nicu Ionita
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 194 bytes
Desc: Signierter Teil der Nachricht
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20090301/7e38279e/PGP.bin
More information about the Haskell-Cafe