jaspervdj / websockets

A Haskell library for creating WebSocket-capable servers
http://jaspervdj.be/websockets
BSD 3-Clause "New" or "Revised" License
405 stars 112 forks source link

Feedback suggestion on "datas" APIs for 1.0 perhaps #247

Open ulidtko opened 5 months ago

ulidtko commented 5 months ago

I didn't research who'd chosen these names, and it doesn't really matter that much (compared to anyone's favorite atrocity) — but it just pains me to see this in a high-quality open-source Haskell library:

image

"Data" is plural already — singular is datum.

... I well understand, fixing this would entail a breaking change, deprecations and major version bump.

Perhaps something to consider for version 1.0.0.0 ?

ysangkok commented 4 months ago

I think for many people the current naming might be more intelligible. Data is used all over the place in Haskell, for any amount, even if it is zero bits. Consider data Void. We don't require records with one field to be annotated as datum instead. One could argue for the name sendBinaryDataList but I think it's fairly common to expect the s suffix for the list variant of a function. Would be interesting to search for function signatures that differ only in the list-ness of one argument.