Skip to content

Commit d278284

Browse files
committed
formatting and hlint
1 parent a5206ba commit d278284

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

booster/library/Booster/Builtin.hs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE MultiWayIf #-}
21
{- |
32
Copyright : (c) Runtime Verification, 2023
43
License : BSD-3-Clause
@@ -246,8 +245,8 @@ mapUpdateAllHook :: BuiltinFunction
246245
mapUpdateAllHook [KMap def1 _ _, KMap def2 _ _]
247246
| def1 /= def2 =
248247
throwE $
249-
"MAP.updateAll: incompatible maps " <>
250-
Text.pack (show (def1.mapSortName, def2.mapSortName))
248+
"MAP.updateAll: incompatible maps "
249+
<> Text.pack (show (def1.mapSortName, def2.mapSortName))
251250
mapUpdateAllHook [original, KMap _ [] Nothing] =
252251
-- updates map is empty, result is original map
253252
pure $ Just original
@@ -260,15 +259,19 @@ mapUpdateAllHook [KMap _ _ (Just _), _updates] =
260259
mapUpdateAllHook [KMap def pairs1 Nothing, KMap _ pairs2 mbRest2]
261260
-- performing the update requires all keys to be fully evaluated
262261
-- (constructor-like) or syntactically equal.
263-
| Set.null origKeys = -- all keys in the original map were updated (syntactically)
262+
| Set.null origKeys -- all keys in the original map were updated (syntactically)
263+
=
264264
pure $ Just $ KMap def updated mbRest2
265265
| Set.null updateKeys
266-
, Nothing <- mbRest2 = -- all update keys were (syntactically) present
266+
, Nothing <- mbRest2 -- all update keys were (syntactically) present
267+
=
267268
pure $ Just $ KMap def updated Nothing
268269
| all isConstructorLike_ (updateKeys <> origKeys)
269-
, Nothing <- mbRest2 = -- all untouched or added keys are fully evaluated
270+
, Nothing <- mbRest2 -- all untouched or added keys are fully evaluated
271+
=
270272
pure $ Just $ KMap def updated Nothing
271-
| otherwise = -- uncertain whether all keys updated, leave unevaluated
273+
| otherwise -- uncertain whether all keys updated, leave unevaluated
274+
=
272275
pure Nothing
273276
where
274277
orig = Map.fromList pairs1
@@ -277,9 +280,9 @@ mapUpdateAllHook [KMap def pairs1 Nothing, KMap _ pairs2 mbRest2]
277280
origKeys = Set.difference (Map.keysSet orig) (Map.keysSet update)
278281
updateKeys = Set.difference (Map.keysSet update) (Map.keysSet orig)
279282
mapUpdateAllHook [_, _] =
280-
pure Nothing -- at least one argument not an internalised map, leave unevaluated
283+
pure Nothing -- at least one argument not an internalised map, leave unevaluated
281284
mapUpdateAllHook args =
282-
throwE . renderText $ "MAP.update: wrong arity " <> pretty (length args)
285+
throwE . renderText $ "MAP.update: wrong arity " <> pretty (length args)
283286

284287
mapRemoveHook :: BuiltinFunction
285288
mapRemoveHook args

kore/src/Kore/Builtin/Map.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ builtinFunctions key
490490
| key == Map.elementKey = Just $ Builtin.functionEvaluator evalElement
491491
| key == Map.unitKey = Just $ Builtin.functionEvaluator evalUnit
492492
| key == Map.updateKey = Just $ Builtin.functionEvaluator evalUpdate
493-
| key == Map.updateAllKey = Just $ Builtin.notImplemented
493+
| key == Map.updateAllKey = Just Builtin.notImplemented
494494
| key == Map.in_keysKey = Just $ Builtin.functionEvaluator evalInKeys
495495
| key == Map.keysKey = Just $ Builtin.functionEvaluator evalKeys
496496
| key == Map.keys_listKey = Just $ Builtin.functionEvaluator evalKeysList

0 commit comments

Comments
 (0)