Changes between Version 49 and Version 50 of Prelude710/FTP


Ignore:
Timestamp:
Feb 17, 2015 4:29:09 AM (5 years ago)
Author:
dfeuer
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Prelude710/FTP

    v49 v50  
    155155
    156156`length` is left ungeneralized with regards to the numeric type primarily because `genericLength` has absolutely abysmal performance. One of the pragmatic guidelines we followed is that we can't make code slower.
     157
     158Reply by dfeuer: The abysmal performance of `genericLength` is not inherent to its type signature, but rather to its definition, which makes it good for producing certain varieties of lazy natural number while making it terrible for anything else. We could give `length` a sensible default by applying `fromIntegral` to a `Word`, or simply by using a strict left fold. The biggest potential problem, I believe, is that code that uses `length` and does not give the result an explicit signature will get an `Integer` by default, which seems rather rude.
    157159}}}
    158160