Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions unison-cli/src/Unison/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ import ArgParse
)
import Compat (defaultInterruptHandler, withInterruptHandler)
import Control.Concurrent (newEmptyMVar, runInUnboundThread, takeMVar)
import Control.Exception (displayException, evaluate, fromException)
import Control.Exception (displayException, fromException)
import Data.Bitraversable (bitraverse)
import Data.ByteString qualified as BS
import Data.ByteString.Lazy qualified as BL
import Data.Either.Validation (Validation (..))
import Data.List.NonEmpty (NonEmpty)
import Data.Text qualified as Text
Expand Down Expand Up @@ -230,8 +229,8 @@ main version = do
noOpCheckForChanges
CommandLine.ShouldNotWatchFiles
Run (RunCompiled file) args ->
BL.readFile file >>= \bs ->
try (evaluate $ RTI.decodeStandalone bs) >>= \case
BS.readFile file >>= \bs ->
try (RTI.decodeStandalone bs) >>= \case
Left re -> do
exnMessage <- RTI.prettyRuntimeExn fetchIssueFromGitHub re
exitError . P.lines $
Expand Down
19 changes: 19 additions & 0 deletions unison-runtime/cbits/i2d.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <stdint.h>

double unisonWord64ToDouble(uint64_t lin) {
union {
double d;
uint64_t l;
} u;
u.l = lin;
return u.d;
}

float unisonWord32ToFloat(uint32_t lin) {
union {
float f;
uint32_t l;
} u;
u.l = lin;
return u.f;
}
6 changes: 3 additions & 3 deletions unison-runtime/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ library:
- condition: false
other-modules: Paths_unison_runtime

c-sources:
- cbits/i2d.c

dependencies:
- asn1-encoding
- asn1-types
Expand All @@ -58,7 +61,6 @@ library:
- binary
- bytes
- bytestring
- cereal
- clock
- containers >= 0.6.3
- cryptonite
Expand Down Expand Up @@ -119,9 +121,7 @@ tests:
other-modules: Paths_unison_parser_typechecker
dependencies:
- base
- bytes
- bytestring
- cereal
- code-page
- containers
- cryptonite
Expand Down
Loading