ekmett / contravariant

Haskell 98 contravariant functors
http://hackage.haskell.org/package/contravariant
Other
73 stars 24 forks source link

Make everything safe #58

Closed treeowl closed 5 years ago

treeowl commented 5 years ago

Previously, we (optionally) used unsafeCoerce to avoid passing allocating functions to divide or choose, presumably because those might not inline enough to make things efficient. But we should be able to solve that problem, at least most of the time, by gathering up all the relevant conversions in one spot so they're likely to fuse with from or from1. That's the theory, anyway. I don't know if it will hold up in practice.

ekmett commented 5 years ago

Works for me. I've always hated the old hack anyways.