love-haskell / coercible-utils

Utility functions for Coercible types
https://hackage.haskell.org/package/coercible-utils
BSD 3-Clause "New" or "Revised" License
9 stars 3 forks source link

might be worthwhile to point users to the hashtag-coerce ghc-plugin #4

Closed chessai closed 5 years ago

chessai commented 6 years ago

https://github.com/mpickering/hashtag-coerce

hashtag-coerce is a GHC plugin which could potentially be a very good mix with this library. The reason I say this is that yes, while something like

ala :: (Coercible a b, Coercible a' b')
      => (a -> b)
      -> ((a -> b) -> c -> b')
      -> c
      -> a'

is most certainly very useful, it is perhaps not the most 'recognisable'. By 'recognisable', I mean that it might be difficult for a programmer to recognise their ability to use this function (which would usually arise by replacing code that performs manual transformations with ala). Especially with some of the larger (in type signature) coercible-utils! That is why I think it might be a good idea to use that plugin in addition to this library.

sjakobi commented 6 years ago

Oh cool, I hadn't heard of this before.

We should add a reference in the haddocks.

chessai commented 5 years ago

Actually, this isn't worthwhile for the moment. It only detects things like 'map coerce'.