Skip to content

Commit

Permalink
[ primitive ] don't push code that doesn't compile!
Browse files Browse the repository at this point in the history
  • Loading branch information
UlfNorell committed Oct 27, 2015
1 parent f9b005f commit 69c3fad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/full/Agda/Compiler/MAlonzo/Primitives.hs
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,20 @@ primBody s = maybe unimplemented (either (hsVarUQ . HS.Ident) id <$>) $
, "primFloatTimes" |-> return "((*) :: Double -> Double -> Double)"
, "primFloatDiv" |-> return "((/) :: Double -> Double -> Double)"
, "primFloatEquality" |-> return "((\\ x y -> if isNaN x && isNaN y then True else x == y) :: Double -> Double -> Bool)"
, "primFloatLess" |-> return $ unwords
, "primFloatLess" |-> return (unwords
[ "((\\ x y ->"
, "let isNegInf z = z < 0 && isInfinite z in"
, "if isNegInf y then False else"
, "if isNegInf x then True else"
, "if isNaN x then True else"
, "x < y) :: Double -> Double -> Bool)" ]
, "x < y) :: Double -> Double -> Bool)" ])
, "primRound" |-> return "(round :: Double -> Integer)"
, "primFloor" |-> return "(floor :: Double -> Integer)"
, "primCeiling" |-> return "(ceiling :: Double -> Integer)"
, "primExp" |-> return "(exp :: Double -> Double)"
, "primLog" |-> return "(log :: Double -> Double)"
, "primSin" |-> return "(sin :: Double -> Double)"
, "primShowFloat" |-> return "((\\ x -> if isNegativeZero then \"0.0\" else show x) :: Double -> String)"
, "primShowFloat" |-> return "((\\ x -> if isNegativeZero x then \"0.0\" else show x) :: Double -> String)"

-- Character functions
, "primCharEquality" |-> rel "(==)" "Char"
Expand Down

0 comments on commit 69c3fad

Please sign in to comment.