on master help sign in
Make unary "-" use the Neg typeclass
commita557fc8e8f9c1acc369f3ff950d2977c3a3b7843 authorMarkus Pfeiffer <markus.pfeiffer@morphism.de> dateMon 22 Sep 2014, 11:24 (12 years ago) parent9562e0c
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],