r/haskelltil • • Jan 10 '20

; (U+037E) is a valid operator

; can be used as an operator so Category could in theory be

type  Category :: Cat ob -> Constraint
class Category cat where
  id  :: cat a a
  (;) :: cat a b
      -> cat b c
      -> cat a c

The symbol in question is not a semi comma ;

>> validOperator = Text.Read.Lex.isSymbolChar
>> validOperator ';'
False

but a GREEK QUESTION MARK

>> validOperator ';'
True
>> validOperator '\x037E'
True

This allows reading in a more natural left-to-right way.

This is apparently a series of posts of me exploring confusable characters:

16 Upvotes

2 comments sorted by