[aklug] Re: Isn't it funny... writing modules

From: Christopher Howard <christopher.howard@frigidcode.com>
Date: Mon Jun 20 2011 - 17:47:27 AKDT

On 06/20/2011 07:30 AM, Tim Johnson wrote:
> * Christopher Howard <christopher.howard@frigidcode.com> [110619 21:30]:
>> Isn't it funny... when you code an extension to a module, only to go
>> back back to the documentation and find out the extension has already
>> been written? :D I'm working with Haskell's HDBC.MySQL module, and I
>> wrote all these functions to check if the SqlVals are the value expected
>> and return contingency-safe Either values. So then I'm thinking, "this
>> is useful... maybe I should make it into a class or something." But I'm
>> not sure how to do it, so I go back to the original module source for
>> clues, and guess what I find... class instances with type signatures
>> that match my functions almost exactly.
> Does haskell have anything like pydocs?
> If so, then you could browse their documentation.
>

Sorry, instead of "original module source" I should have written
"original module documentation" for better clarity. For Haskell, the
documentation for all the publicly available modules is available at
hackage.haskell.org, and each module, type, class, function, et cetera
has a link by it to the source code.

I think what happened is that the first time I went through the module
documentation, I didn't notice the relevant class instances because they
didn't seem relevant at the time. Ironically, I couldn't understand what
they were for until I had actually written my own versions.

-- 
frigidcode.com
theologia.indicium.us
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Mon Jun 20 17:47:09 2011

This archive was generated by hypermail 2.1.8 : Mon Jun 20 2011 - 17:47:09 AKDT