[Haskell-cafe] oauth in haskell - reviewers?

Diego Souza dsouza at bitforest.org
Sun Aug 23 12:25:55 EDT 2009


Hi Alex,

> - In the Token datatype, you can automatically create the accessor
> functions (oath_token, etc.) by using named fields:
I though about that too and I was not sure about what to do. The reason
I didn't use it is because I don't export the value constructors of
Token type, that is why I created the access functions explicitly.

> - When you have multiple datatype constructors with similar arguments
> (as with Token or Request), it may be better to use a Boolean-type
> flag saying which one it is (e.g. HTTP or HTTPS) and then a single
> datatype with all of the different arguments in it. This may help you
> remove code duplication elsewhere.
Right, it makes sense.

> - I think you can use join from Control.Monad and functions from
> Control.Applicative in your "response" function to make it quite a bit
> cleaner.
To be honest I'm not familiar with Control.Applicative at all.  I'll
read about it and see if I can figure how to do this.

A quick search pointed me to this:
http://www.soi.city.ac.uk/~ross/papers/Applicative.html

Is there any other resources you would suggest me to read?

Thanks at lot,
-- 
~dsouza
yahoo!im: paravinicius
gpg key fingerprint: 71B8 CE21 3A6E F894 5B1B  9ECE F88E 067F E891 651E


More information about the Haskell-Cafe mailing list