[Haskell-cafe] Type synonyms considered harmful?

Niklas Haas haskell at nand.wakku.to
Wed Jan 21 15:32:04 UTC 2015


> Now we're definitely getting somewhere! I'm not to thrilled about the use
> of string literals though. How about this?
> 
> {-# LANGUAGE TypeOperators, DataKinds, RankNTypes #-}
> type (l ∷ t) = t
> 
> foo :: forall red green blue. (red ∷ Double) -> (green ∷ Double) -> (blue ∷
> Double) -> IO ()
> 
> We just need to patch hlint to make this the suggested style.
> 
> - jeremy

In fact, why even bother with the explicit forall? Default behavior is
to universally quantify unused variable names, after all.

{-# LANGUAGE TypeOperators #-}

type (l ∷ t) = t

foo :: (red ∷ Double) -> (green ∷ Double) -> (blue ∷ Double) -> IO ()

At this point, I think this is a syntax form we can surely all agree upon.


More information about the Haskell-Cafe mailing list