Skip to content

Type operator does not work in ANN pragma

The following program is rejected:

{-# LANGUAGE TypeOperators #-}

module Bug where

type (+++) = Either

{-# ANN type (+++) "Hello" #-}

Error:

Bug.hs:7:14: error: parse error on input ‘(’
  |
7 | {-# ANN type (+++) "Hello" #-}
  |      

It seems ANN type can't deal with type operators.

This was discovered during some abuse of GHC; I do not have a use-case.

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