type-level definitions naming

Gábor Lehel illissius at gmail.com
Wed Oct 23 18:21:08 UTC 2013


On Wed, Oct 23, 2013 at 4:38 AM, Richard Eisenberg <eir at cis.upenn.edu>wrote:

>
> If it's going to reverse its arguments, should it be
>
> > castBy :: a -> (a :~: b) -> b
> > gcastBy :: ((a ~ b) => r) -> (a :~: b) -> r
>
> ?
> Do we even need castBy?
>
> In any case, the "by" name facilitates better infix usage.
>

FWIW I think (with this ordering) castWith and castBy both read well infix
and both not so well prefix :-)

Anyway, this is the ordering I prefer. A name like `cast` or `coerce` would
be nicest (and would make the prefix/infix dilemma go away), but those are
taken by Typeable and Coercible. Is going back to `subst` (and then
`gsubst`) out of the question? What was the problem with that one? I think
it's alright.

I happen to use the above orderings in my version (and also have (|>) =
castBy), but I'm more strongly attached to it for gcastBy, whatever it ends
up named.

The color of these bikesheds isn't the most important thing in the world
though, so if you make an arbitrary choice I'm not going to object, it
shouldn't hold anything up.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20131023/dfbf295d/attachment.html>


More information about the Libraries mailing list