Permalink
Browse files

Added backtick notation: e.g. x xs

  • Loading branch information...
1 parent a12ecc2 commit 022e230b673dc3c2ac751285fe0c1481f5d1a31e Edwin Brady committed Feb 23, 2012
Showing with 11 additions and 5 deletions.
  1. +2 −0 CHANGELOG
  2. +9 −5 src/Idris/Parser.hs
View
@@ -3,12 +3,14 @@ New in 0.9.2:
User visible changes:
+* backtick notation added: x `foo` y ==> foo x y
* case expressions allowed in type signatures
* Library extensions in prelude.vect and prelude.algebra
Internal changes:
* Some type class resolution fixes
+* Several minor bug fixes
New in 0.9.1:
-------------
View
@@ -941,7 +941,8 @@ table fixes
= [[prefix "-" (\fc x -> PApp fc (PRef fc (UN "-"))
[pexp (PApp fc (PRef fc (UN "fromInteger")) [pexp (PConstant (I 0))]), pexp x])]]
++ toTable (reverse fixes) ++
- [[binary "=" (\fc x y -> PEq fc x y) AssocLeft],
+ [[backtick],
+ [binary "=" (\fc x y -> PEq fc x y) AssocLeft],
[binary "->" (\fc x y -> PPi expl (MN 42 "__pi_arg") x y) AssocRight]]
toTable fs = map (map toBin)
@@ -954,10 +955,13 @@ toTable fs = map (map toBin)
assoc (Infixr _) = AssocRight
assoc (InfixN _) = AssocNone
-binary name f assoc = Infix (do { reservedOp name; fc <- pfc;
- return (f fc) }) assoc
-prefix name f = Prefix (do { reservedOp name; fc <- pfc;
- return (f fc) })
+binary name f assoc = Infix (do reservedOp name; fc <- pfc;
+ return (f fc)) assoc
+prefix name f = Prefix (do reservedOp name; fc <- pfc;
+ return (f fc))
+backtick = Infix (do lchar '`'; n <- pfName; lchar '`'
+ fc <- pfc
+ return (\x y -> PApp fc (PRef fc n) [pexp x, pexp y])) AssocNone
--------- Data declarations ---------

0 comments on commit 022e230

Please sign in to comment.