unisonweb/unison

The parser can't handle prefix-patterns based on parenthesized symbolyIds.

Open

#733 opened on Aug 14, 2019

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Haskell (304 forks)batch import
help wantedparser

Repository metrics

Stars
 (6,624 stars)
PR merge metrics
 (Avg merge 12d 19h) (6 merged PRs in 30d)

Description

use .base

ability Woot where
  (+) : Int -> Int -> Int

wootHandler e = case e of
  {a} -> a
  { (Woot.+) x y -> k } -> 42

So we allow (+) as an ability constructor name, but provide no way of matching on that constructor in the handler.

Workaround for now: either alias the constructor name to something that isn't an operator, or name the ability constructors something else (and provide an operator alias if desired).

We might want more general support for infix patterns too, but I feel like that could use more thought and fixing this seems very doable.

Thanks to @tpolecat for spotting.

Contributor guide