Allow underscore as a valid name for binder operator

This commit is contained in:
André Videla 2024-01-07 10:42:33 +00:00
parent 91f66bc7b5
commit 1d3668d9a6
4 changed files with 25 additions and 1 deletions

View File

@ -343,7 +343,8 @@ mutual
opBinder : OriginDesc -> IndentInfo -> Rule (OperatorLHSInfo PTerm)
opBinder fname indents
= do boundName <- bounds (UN . Basic <$> decoratedSimpleBinderName fname)
= do boundName <- bounds (UN <$> (Basic <$> decoratedSimpleBinderName fname
<|> symbol "_" $> Underscore))
opBinderTypes fname indents boundName
autobindOp : ParseOpts -> OriginDesc -> IndentInfo -> Rule PTerm

View File

@ -0,0 +1,19 @@
import Data.String
typebind infixr 0 :-
autobind infixr 0 `for`
record Container where
constructor (:-)
a1 : Type
a2 : a1 -> Type
const : Type -> Type -> Container
const a b = (_ : a) :- b
test : Maybe (List Double)
test = (_ := ["1", "two", "3"]) `for` Just 3
test2 : Maybe (List Double)
test2 = (_ : String := ["1", "two", "3"]) `for` Just 3

View File

@ -0,0 +1 @@
1/1: Building Test (Test.idr)

View File

@ -0,0 +1,3 @@
. ../../../testutils.sh
check Test.idr