
8 Jul
2019
8 Jul
'19
9:50 a.m.
Dear Cafe, with pragma SPECIALIZE, I find it tedious to repeat the type declaration. (It's a burden for maintenance and readability.) Could we use type-application syntax instead? E.g., the example from here https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts... hammeredLookup :: Ord key => [(key, value)] -> key -> value {-# SPECIALIZE hammeredLookup :: [(Widget, value)] -> Widget -> value #-} would become hammeredLookup :: forall key value . Ord key => [(key, value)] -> key -> value {-# SPECIALIZE hammeredLookup @Widget #-} or {-# SPECIALIZE hammeredLookup @Widget @value #-} Cf. SPECIALIZE instance, where we already write the instantiation for the type variable(s). - J.W.