PatternSynonyms
For the 24 days of Haskell Extensions blog this is plagiarised from see here . Pattern Synonyms are essentially a way of aliasing pattern matches. For example, continuing my silly example habit: {-# LANGUAGE PatternSynonyms #-} module Example where main :: IO ( ) main = getChar >>= \ c -> print ( toChar . mirrorLetter . toLetter $ c ) data Letter = A | B | C | D | W | X | Y | Z toChar :: Letter -> Char toChar A = 'a' toChar B = 'b' toChar C = 'c' toChar D = 'd' toChar W = 'w' toChar X = 'x' toChar Y = 'y' toChar Z = 'z' toLetter :: Char -> Letter toLetter 'a' = A toLetter 'b' = B toLetter 'c' = C toLetter 'd' = D mirrorLetter :: Letter -> Letter mirrorLetter A = Z mirrorLetter B = Y mirrorLetter C = X mirrorLetter D = W The key thing to n