5 comments

[ 3.7 ms ] story [ 19.7 ms ] thread
I wasn't completely sure if I wanted to post this or not, I'm also not a Haskell Guru, just dabble as a hobby. But today to honor Paul Hudak, I decided to dabble some more. :)

Haskell was my gateway functional programming language and for that I sincerely thank the creators.

Awesome! What a great memorial :)

Maybe consider making the api more strongly typed?

Instead of:

    response <- findTopic "tide-pods" [("gender", "male")] config
You could have:

    response <- findTopic "tide-pods" [(Gender, Male)] config
Maybe make the common operations available in a strongly typed api, but allow users to use strings like this as a fallback. Then you can better guarantee "correct if it compiles".
Actually using type classes and sum types, the Gender is superfluous if you define:

    data Gender = Male | Female
Would type more, but on a tablet ATM.

Not sure if this is a good idea or not, but interesting to think about.

Thanks for the input! I was considering using stronger types for the search parameters but wasn't familiar enough with Haskell's type system to make much progress. :)

I'll keep exploring options!

Maybe I can submit a pull request later :)