[Haskell-cafe] Type synonyms considered harmful?

Niklas Haas haskell at nand.wakku.to
Mon Jan 19 01:05:56 UTC 2015


On Mon, 19 Jan 2015 01:12:58 +0100, Christopher Done <chrisdone at gmail.com> wrote:
> >
> > foo : (x : Int) -> (y : Int) -> (red : Double) -> (blue : Double) ->
> > (green : Double) -> IO ()
> >
> > And that will solve everything! What could possibly go wrong!
> >
> 
> How about a type-level the? =p
> 
> type The label t = t
> 
> foo :: The red Double -> The green Double -> The blue Double -> IO ()
> 
> Or with polykinds:
> 
> foo :: The "Red" Double -> The "Green" Double -> The "Blue" Double -> IO ()

Clearly needs more TypeOperators.

type (l ∷ t) = t

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


More information about the Haskell-Cafe mailing list