Skip to content

Pattern synonym type signatures

Currently, the only way to specify a type signature for a pattern synonym is by adding type annotations to the right-hand side, like this:

{-# LANGUAGE PatternSynonyms, ScopedTypeVariables #-}

pattern Single x = ([x] :: [Int])

Bespoke syntax for adding type signatures for pattern synonyms would probably be useful.

Link to PatternSynonyms for pattern synonym signatures for specification.

Edited by Simon Peyton Jones
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information