Skip to content

Commit 503e19d

Browse files
author
github-actions
committed
Format with fourmolu
1 parent 0aabe16 commit 503e19d

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

booster/library/Booster/Builtin.hs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE MultiWayIf #-}
2+
23
{- |
34
Copyright : (c) Runtime Verification, 2023
45
License : BSD-3-Clause
@@ -246,8 +247,8 @@ mapUpdateAllHook :: BuiltinFunction
246247
mapUpdateAllHook [KMap def1 _ _, KMap def2 _ _]
247248
| def1 /= def2 =
248249
throwE $
249-
"MAP.updateAll: incompatible maps " <>
250-
Text.pack (show (def1.mapSortName, def2.mapSortName))
250+
"MAP.updateAll: incompatible maps "
251+
<> Text.pack (show (def1.mapSortName, def2.mapSortName))
251252
mapUpdateAllHook [original, KMap _ [] Nothing] =
252253
-- updates map is empty, result is original map
253254
pure $ Just original
@@ -260,15 +261,19 @@ mapUpdateAllHook [KMap _ _ (Just _), _updates] =
260261
mapUpdateAllHook [KMap def pairs1 Nothing, KMap _ pairs2 mbRest2]
261262
-- performing the update requires all keys to be fully evaluated
262263
-- (constructor-like) or syntactically equal.
263-
| Set.null origKeys = -- all keys in the original map were updated (syntactically)
264+
| Set.null origKeys -- all keys in the original map were updated (syntactically)
265+
=
264266
pure $ Just $ KMap def updated mbRest2
265267
| Set.null updateKeys
266-
, Nothing <- mbRest2 = -- all update keys were (syntactically) present
268+
, Nothing <- mbRest2 -- all update keys were (syntactically) present
269+
=
267270
pure $ Just $ KMap def updated Nothing
268271
| all isConstructorLike_ (updateKeys <> origKeys)
269-
, Nothing <- mbRest2 = -- all untouched or added keys are fully evaluated
272+
, Nothing <- mbRest2 -- all untouched or added keys are fully evaluated
273+
=
270274
pure $ Just $ KMap def updated Nothing
271-
| otherwise = -- uncertain whether all keys updated, leave unevaluated
275+
| otherwise -- uncertain whether all keys updated, leave unevaluated
276+
=
272277
pure Nothing
273278
where
274279
orig = Map.fromList pairs1
@@ -277,9 +282,9 @@ mapUpdateAllHook [KMap def pairs1 Nothing, KMap _ pairs2 mbRest2]
277282
origKeys = Set.difference (Map.keysSet orig) (Map.keysSet update)
278283
updateKeys = Set.difference (Map.keysSet update) (Map.keysSet orig)
279284
mapUpdateAllHook [_, _] =
280-
pure Nothing -- at least one argument not an internalised map, leave unevaluated
285+
pure Nothing -- at least one argument not an internalised map, leave unevaluated
281286
mapUpdateAllHook args =
282-
throwE . renderText $ "MAP.update: wrong arity " <> pretty (length args)
287+
throwE . renderText $ "MAP.update: wrong arity " <> pretty (length args)
283288

284289
mapRemoveHook :: BuiltinFunction
285290
mapRemoveHook args

0 commit comments

Comments
 (0)