[Haskell-cafe] Closed classes

David Feuer david.feuer at gmail.com
Thu Feb 18 15:05:03 UTC 2016


That is more consistent, but it leaves no room to intersperse auxiliary
definitions, which strikes me as unfortunate for practical reasons.
On Feb 18, 2016 5:43 AM, "Tobias Florek" <haskell at ibotty.net> wrote:

> Hi.
>
> For consistency reasons, I'd love to write the following, possibly even
> omiting the closed keyword.
>
> > {-# LANGUAGE ClosedClasses #-}
> > closed class Closed a b where
> >   fun :: a -> b -> Int
> >   instance Closed Int y where fun x _ = x
> >   instance Closed x Int where fun _ y = y
> >   instance Closed x y where fun _ _ = 0
>
> I guess, that's already bikeshedding.
>
> Cheers,
>  Tobias Florek
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160218/4f9506c3/attachment.html>


More information about the Haskell-Cafe mailing list