|
|
nemesis wrote:
> Orchid XP v7 <voi### [at] devnull> wrote:
>> Arguably partial functions are the Haskell equivilent of null pointer
>> issues - as exemplified by "head []". If your code produces this
>> exception, good luck working out what the problem is. ;-)
>
> hmm, ok. problem is, there are informations only available at runtime, not
> compile time. Perhaps what Tim is asking is for automatic generation of
> runtime tests for these common situations.
There are various manual and automated test systems for Haskell. It's
not something I've looked at. It's also possible to do crazy things
using experimental language extensions to (clumsily) encode the length
of a list into its type, thus allowing it to be checked at compile-time,
but this becomes messy rapidly [since the language isn't supposed to
support it]. Apparently there are programming languages that have this
as a design goal... and they're even rarer than Haskell. (If you can
imagine that...)
Post a reply to this message
|
|