
On 8/16/19 4:17 AM, Carter Schonwald wrote:
Hard -1, , i'm not seeing a useful high impact payoff
plus its more verbose and adhoc than pure and more confusing than (:[])
I actually initially thought this thread was about Type Singletons and or Proxy style apis using List as the term level form, it actually took me a few minutes of reading everyone's replies to disambiguate
If a value-level 'singleton' is confusing to anybody, I have really[1] quite[2] terrible[3], in[4] fact[5] downright[6] awful[7] news[8]. :) +1 to Data.List.singleton and Data.List.NonEmpty.singleton from me in the peanut gallery. I agree with the sentiment that 'pure @ []' means "side effect-free nondeterministic value", which is quite different than meaning "a list with one element", and is therefore possibly more ad hoc than using the well-established 'singleton'. But I also joyfully assent to the decision of the CLC! Besides the possibility for breakage (can we use head.hackage to get hard data here?), I have not seen a single "technical", data-based argument from either side. Even asking the proponents to provide technical arguments, after all, is a subjective criterion. With respectful acknowledgement of all positions taken, -Bryan [1]: https://hackage.haskell.org/package/bytestring/docs/Data-ByteString.html#v:s... [2]: https://hackage.haskell.org/package/containers/docs/Data-IntMap-Internal.htm... [3]: https://hackage.haskell.org/package/text/docs/Data-Text.html#v:singleton [4]: https://hackage.haskell.org/package/vector/docs/Data-Vector.html#v:singleton [5]: https://hackage.haskell.org/package/unordered-containers/docs/Data-HashSet.h... [6]: https://hackage.haskell.org/package/lens/docs/Control-Lens-Internal-Deque.ht... [7]: https://hackage.haskell.org/package/Cabal/docs/Distribution-Compat-DList.htm... [8]: https://hackage.haskell.org/package/memory/docs/Data-ByteArray.html#v:single... p.s. I've intentionally chosen eight different packages, some of which include a number of different 'singleton's!