[core libraries] tyConHash -- quick fix?

Edward Kmett ekmett at gmail.com
Wed Mar 11 09:44:49 UTC 2015


I like your idea of using tyConHash for the Int version and
tyConFingerprint to refer to the Fingerprint.

The former fits more closely with the usage elsewhere e.g. hashUnique,
hashStableName.

-Edward

On Wed, Mar 11, 2015 at 5:39 AM, Simon Peyton Jones <simonpj at microsoft.com>
wrote:

>  data TyCon = TyCon {
>
>    tyConHash    :: {-# UNPACK #-} !Fingerprint, -- ^ @since 4.8.0.0
>
>    tyConPackage :: String, -- ^ @since 4.5.0.0
>
>    tyConModule  :: String, -- ^ @since 4.5.0.0
>
>    tyConName    :: String  -- ^ @since 4.5.0.0
>
> }
>
>
>
> Friends,
>
> Is tyConHash a good name here?  Wouldn’t tyConFingerprint be better?
>
> ·         Hash functions usually yield a Int.
>
> ·         tyConFingerprint :: TyCon -> Fingerprint makes the name match
> the type.
>
> ·         If we had fingerprintHash:: Fingerprint -> Int, then we might
> want
> tyConHash :: TyCon -> Int
> tyConHash = fingerprintHash . tyConFingerpring
>
>
>
> This is new in 7.10, so we could fix it now with no trouble.
>
> Simon
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "haskell-core-libraries" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to haskell-core-libraries+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20150311/de929f5e/attachment.html>


More information about the ghc-devs mailing list