5

Why isn't 〉 allowed as an infix operator in Haskell?

GHCi, version 8.0.2: http://www.haskell.org/ghc/  :? for help
Prelude> :{
 infixr 6 〉
 (〉) :: Int -> (Int -> (Int))
 a 〉 b = a + 2*b
:}
print (1 〉 2)

According to this Haskell Report any Unicode symbol or punctuation and this question it should work.

Lime
  • 12,724
  • 9
  • 48
  • 84
  • 1
    While I think I've actually tried making `〉` an infix myself at some point, I daresay it's just a bad idea. It would more sense to allow symbols like `❨`, `❬`, `❴`, `⟦` or `“` as custom [quasiquote](http://hackage.haskell.org/package/template-haskell-2.11.1.0/docs/Language-Haskell-TH-Quote.html#t:QuasiQuoter) characters. – leftaroundabout Jun 21 '17 at 23:48

1 Answers1

7

It's probably a bug. It doesn't seem to allow any characters marked as ClosePunctuation or OpenPunctuation by generalCategory. I suggest you open a ticket on the GHC Trac and see what they think.

https://ghc.haskell.org/trac/ghc/ticket/2687 looks related and suggests that at least at some point OpenPunctuation and ClosePunctuation were considered graphic rather than symbol.

Daniel Wagner
  • 128,625
  • 9
  • 198
  • 347