Skip to content

Commit b467d64

Browse files
doliogithub-actions[bot]
authored andcommitted
automatically run ormolu
1 parent 19541b8 commit b467d64

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

unison-runtime/src/Unison/Runtime/Foreign/Dynamic.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
module Unison.Runtime.Foreign.Dynamic where
44

5-
import Control.Monad (unless)
65
import Control.Exception
6+
import Control.Monad (unless)
77
import Data.Tagged (Tagged (..))
88
import Foreign.ForeignPtr
99
import Foreign.LibFFI.FFITypes
@@ -66,7 +66,8 @@ encodeTypes (t : ts) !p = do
6666
where
6767
sz = Store.sizeOf (undefined :: Ptr CType)
6868

69-
data PrepException = BadVoid | BadInit deriving Show
69+
data PrepException = BadVoid | BadInit deriving (Show)
70+
7071
instance Exception PrepException
7172

7273
adjustSpec :: FFSpec -> IO FFSpec

unison-runtime/src/Unison/Runtime/Foreign/Function.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,12 +1169,12 @@ foreignCallHelper = \case
11691169
FFI_getDLLSym -> mkForeignExn $ \(dll, sym, spec) ->
11701170
let name = getDLLPath dll ++ "$" ++ sym
11711171
n = length $ ffArgs spec
1172-
in catchLoad name do
1173-
df <- loadForeign dll spec sym
1174-
let dummyRef = Builtin . Data.Text.pack $ cName df
1175-
dummyCix = CIx dummyRef maxBound 0
1176-
comb = LamI (n + 1) (n + 2) (Ins DLLCall . Yield $ VArg1 0)
1177-
evaluate $ PApV dummyCix comb [encodeVal df]
1172+
in catchLoad name do
1173+
df <- loadForeign dll spec sym
1174+
let dummyRef = Builtin . Data.Text.pack $ cName df
1175+
dummyCix = CIx dummyRef maxBound 0
1176+
comb = LamI (n + 1) (n + 2) (Ins DLLCall . Yield $ VArg1 0)
1177+
evaluate $ PApV dummyCix comb [encodeVal df]
11781178
where
11791179
forceListSpine xs = foldl (\u x -> x `seq` u) xs xs
11801180
chop = reverse . dropWhile isPathSeparator . reverse
@@ -1206,8 +1206,8 @@ foreignCallHelper = \case
12061206
where
12071207
io :: IOException -> IO (Either (F.Failure Val) a)
12081208
io ex =
1209-
pure . Left
1210-
$ F.Failure Ty.ioFailureRef (pack $ show ex) unitValue
1209+
pure . Left $
1210+
F.Failure Ty.ioFailureRef (pack $ show ex) unitValue
12111211

12121212
prep :: PrepException -> IO (Either (F.Failure Val) a)
12131213
prep BadVoid =

0 commit comments

Comments
 (0)