File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
unison-runtime/src/Unison/Runtime/Foreign
unison-src/transcripts/idempotent Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1123,7 +1123,7 @@ foreignCallHelper = \case
11231123 Integer_ge -> mkForeign $ \ (l :: Integer , r :: Integer ) -> pure $ encodeVal (l >= r)
11241124 Integer_neg -> mkForeign $ \ (n :: Integer ) -> pure $ encodeVal (- n)
11251125 Integer_abs -> mkForeign $ \ (n :: Integer ) -> pure $ encodeVal (abs n)
1126- Integer_signum -> mkForeign $ \ (n :: Integer ) -> pure $ encodeVal (signum n)
1126+ Integer_signum -> mkForeign $ \ (n :: Integer ) -> pure $ encodeVal (fromIntegral ( signum n) :: Int )
11271127 Integer_toFloat -> mkForeign $ \ (n :: Integer ) -> pure $ encodeVal (fromIntegral n :: Double )
11281128 Natural_unsafeFromText -> mkForeign $ \ (txt :: Text ) -> case readMaybe (unpack txt) of
11291129 Just n -> pure $ encodeVal (n :: Natural )
Original file line number Diff line number Diff line change @@ -252,7 +252,8 @@ test> Integer.tests.arithmetic =
252252 Integer.eq (Integer.fromInt +1000) (Integer.fromInt +1000),
253253 not (Integer.eq (Integer.fromInt +1000) (Integer.fromInt +999)),
254254 eq (Integer.abs (Integer.fromInt +1000)) (Integer.fromInt +1000),
255- eq (Integer.abs (Integer.fromInt -1000)) (Integer.fromInt +1000)
255+ eq (Integer.abs (Integer.fromInt -1000)) (Integer.fromInt +1000),
256+ not (Int.eq (Integer.signum (Integer.fromInt +1)) (Integer.signum (Integer.fromInt -1)))
256257 ]
257258
258259test> Integer.tests.bitwise =
You can’t perform that action at this time.
0 commit comments