Re: [Haskell-cafe] Re: exceptions vs. Either

Static guarantees are great, but if you have to explicitly change your style of coding to cope with those extra constraints, it can become (very) cumbersome.
I had to change coding style moving from imperative to declarative languages, but I think it was worth it... Likewise I think having the ability to make strong static guaranees is worth it - you may not, which is why it is important not to break any existing programs with language extensions (if any are necessary). My programs will have less bugs though!
"worse-is-better, even in its strawman form, has better survival
I fully subscribe to the 'worse is better' approach, but I don't see how it contradicts the principle of static guarantees - you can have both. Simplicity is about algorithmic complexity not about whether type signatures are provided by the programmer. Infact type signatures are in themselves an embodyment of the simple is better principle. A type signature expresses certain static guarantees about the function in a vary compact way. Consider the sort example... being able to declare a type signature on a sort algorith that enforces ordering of the output would prove the sort algorithm can _only_ output correctly sorted lists under _all_ circunstances. This type signature is much simpler than the actual sort - hence is useful. sort :: (HList l,HOrderedList l') => l -> l' Nice and readable, and much simpler than the actual algorithm (be it bubble sort, or a quick sort) Keean.

correctly sorted lists under _all_ circunstances. This type signature is much simpler than the actual sort - hence is useful.
sort :: (HList l,HOrderedList l') => l -> l'
Nice and readable, and much simpler than the actual algorithm (be it bubble sort, or a quick sort)
The type signature you give is no different from sort :: (C1 l, C2 l') => l -> l' and conveys no more information. You should include the definitions of the classes before saying "this is much simpler than the actual sort". --KW 8-)
participants (2)
-
Keith Wansbrough
-
MR K P SCHUPKE