[Haskell-cafe] Re: Is 78 characters still a good option? Was:
breaking too long lines
gwern0 at gmail.com
Fri Apr 24 09:34:15 EDT 2009
On Fri, Apr 24, 2009 at 9:07 AM, Achim Schneider <barsoap at web.de> wrote:
> Xiao-Yong Jin <xj2106 at columbia.edu> wrote:
>> Gwern Branwen <gwern0 at gmail.com> writes:
>> > I was cabalizing a package once, and I chucked into the
>> > build-depends 'ghc' and made it build. About 30 seconds later, it
>> > occurred to me that this was a geometry library and what the heck
>> > was it doing with the GHC API? So I go looking, and I find a module
>> > of utility functions. It's importing GHC.Base.
>> > I remove the import and scroll down to see the error.
>> > It turns out that 20 megabytes of GHC code was being linked into
>> > this program for one function.
>> > I took the quick way out and typed into the module: 'isJust Nothing
>> > = False; isJust (Just a) = True'.
>> Probably I'm missing something, but why didn't you just
>> import Data.Maybe? I believe both 'isJust' and 'isNothing'
>> is defined in the module.
> ...and that's TRWTF.
I'm fairly sure that what I did after copying in the function was
switch to an import; my ultimate fix was easy and irrelevant. This was
a long time ago, and what made it stand out in my mind was my horror
at discovering for a trivial 2-liner, all of GHC was being depended
More information about the Haskell-Cafe