purescript-httpure icon indicating copy to clipboard operation
purescript-httpure copied to clipboard

Revisit typeclass interface decision for `Body`

Open cprussin opened this issue 5 years ago • 0 comments

Continuation of discussion started here.

@paluh had raised some concerns that perhaps using a typeclass for Body is not the best decision, and we would be better served by making a Record interface something like:

type Body = Record
  { defaultHeaders: Headers
  , writeBody: HTTP.Response -> Aff Unit
  }

Where we left of is that I'm not convinced that typeclasses aren't the right decision here, but I'd like to collect some concrete code examples to discuss the pros/cons of either decision. So before changing from a typeclass, I'd like an awareness of what we'd be losing, and on the flip side, I'd like examples of why a Record interface would be a better decision.

I'd like to resolve this before we release 1.0.

cprussin avatar Sep 11 '18 19:09 cprussin