Created
February 3, 2020 14:41
-
-
Save monadplus/6132c4437161883cb2d316b4af1a5046 to your computer and use it in GitHub Desktop.
Class Synonyms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
module ClassSynonyms where | |
-- This is bordersome to write every time.. | |
-- f :: (C1 a, C2 a, C3 a) => ... | |
-- class synonyms | |
class (C1 a, C2 a, C3 a) => C a where { } | |
instance (C1 a, C2 a, C3 a) => C a where { } | |
-- Better! | |
f :: C a => ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment