on master help sign in
Make unary "-" use the Neg typeclass
commit259f544790a801f577f0ca126ca42e52fca39538 authorMarkus Pfeiffer <markus.pfeiffer@morphism.de> dateMon 22 Sep 2014, 11:24 (12 years ago) parentd5db232
1 file changed+4−2
src/Idris/ParseOps.hs+4−2
src/Idris/ParseOps.hs+4−2
@@ -33,8 +33,10 @@ import qualified Data.ByteString.UTF8 as UTF8
3333-- using pre-build and user-defined operator/fixity declarations
3434table :: [FixDecl] -> OperatorTable IdrisParser PTerm
3535table fixes
36− = [[prefix "-" (\fc x -> PApp fc (PRef fc (sUN "-"))
37− [pexp (PApp fc (PRef fc (sUN "fromInteger")) [pexp (PConstant (BI 0))]), pexp x])]]
36+ =
37+-- [[prefix "-" (\fc x -> PApp fc (PRef fc (sUN "-"))
38+-- [pexp (PApp fc (PRef fc (sUN "fromInteger")) [pexp (PConstant (BI 0))]), pexp x])]]
39+ [[prefix "-" (\fc x -> PApp fc (PRef fc (sUN "negate")) [pexp x])]]
3840 ++ toTable (reverse fixes) ++
3941 [[backtick],
4042 [binary "$" (\fc x y -> flatten $ PApp fc x [pexp y]) AssocRight],