On Mar 11, 2008, at 14:27 , Donn Cave wrote:
    readLDAPMessage s = let [(_, msgID), (tag, body)] = berList s in
        LDAPMessage (berInt msgID) (readResponse tag body)

I go on to account for all the LDAP stuff I need in about 60 lines
of that kind of thing, 1/3 of it devoted to declarations of the
data types, and it isn't dense code, it's ... essentially declarative,
in a simple, straightforward way, almost as if I copied it directly
from the RFC.

Is it `total'?  No way!  To get there, it seems to me I'd have to
double the code, and significantly distract from its real sense.

You might want to think about the monadic use of Maybe/Either (or more generally MonadError), which abstracts away the checking and tracking into (>>=). The error handler is then at the point where values are injected into / retrieved from the monadic exception, similar to catch (...).

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon university    KF8NH


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to