[Haskell-cafe] Type synonyms considered harmful?

Christopher Done chrisdone at gmail.com
Mon Jan 19 00:12:58 UTC 2015


>
> 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 ()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20150119/c285a1d2/attachment.html>


More information about the Haskell-Cafe mailing list