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
1 change: 1 addition & 0 deletions .hlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# custom rules:
- hint: { lhs: (() <$), rhs: void }
- hint: { lhs: return, rhs: pure }
- hint: { lhs: maybe mempty, rhs: foldMap }

# We want the latter function because it handles signals properly.
- error: { name: Use shutdown, lhs: runSettings, rhs: runSettingsWithShutdown }
Expand Down
2 changes: 1 addition & 1 deletion libs/wire-api/src/Wire/API/Call/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ instance BC.ToByteString TurnURI where
<> BC.builder h
<> byteString ":"
<> BC.builder p
<> maybe mempty ((byteString "?transport=" <>) . BC.builder) tp
<> foldMap ((byteString "?transport=" <>) . BC.builder) tp

instance BC.FromByteString TurnURI where
parser = BC.parser >>= either fail pure . parseTurnURI
Expand Down
2 changes: 1 addition & 1 deletion libs/wire-api/src/Wire/API/User/Profile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ instance Show Locale where
show = Text.unpack . locToText

locToText :: Locale -> Text
locToText (Locale l c) = lan2Text l <> maybe mempty (("-" <>) . con2Text) c
locToText (Locale l c) = lan2Text l <> foldMap (("-" <>) . con2Text) c

parseLocale :: Text -> Maybe Locale
parseLocale = hush . parseOnly localeParser
Expand Down
2 changes: 1 addition & 1 deletion libs/zauth/src/Data/ZAuth/Token.hs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ writeHeader t =
<> dot
<> field "t" (t ^. typ)
<> dot
<> field "l" (maybe mempty builder (t ^. tag))
<> field "l" (foldMap builder (t ^. tag))

instance ToByteString Access where
builder t =
Expand Down
2 changes: 1 addition & 1 deletion services/galley/src/Galley/API/Update.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ unqualifyEndpoint loc f ignoreMissing reportMissing message = do
qualifiedNewOtrNativePush = newOtrNativePush message,
qualifiedNewOtrTransient = newOtrTransient message,
qualifiedNewOtrNativePriority = newOtrNativePriority message,
qualifiedNewOtrData = maybe mempty fromBase64TextLenient (newOtrData message),
qualifiedNewOtrData = foldMap fromBase64TextLenient (newOtrData message),
qualifiedNewOtrClientMismatchStrategy = clientMismatchStrategy
}
unqualify (tDomain loc) <$> f qualifiedMessage
Expand Down
2 changes: 1 addition & 1 deletion services/galley/src/Galley/Intra/Spar.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ lookupScimUserInfos uids = do
method POST
. paths ["i", "scim", "userinfos"]
. json (UserSet $ Set.fromList uids)
pure $ maybe mempty scimUserInfos $ responseJsonMaybe response
pure $ foldMap scimUserInfos $ responseJsonMaybe response
4 changes: 2 additions & 2 deletions services/gundeck/test/unit/Native.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ instance FromJSON SnsNotification where
where
parseApns t n =
let apn = decodeStrict' (T.encodeUtf8 n)
in maybe mempty (pure . SnsNotification t . SnsApnsData) apn
in foldMap (pure . SnsNotification t . SnsApnsData) apn
parseGcm n =
let gcm = decodeStrict' (T.encodeUtf8 n)
in maybe mempty (pure . SnsNotification GCM . SnsGcmData) gcm
in foldMap (pure . SnsNotification GCM . SnsGcmData) gcm

data SnsData
= SnsGcmData !GcmData
Expand Down
2 changes: 1 addition & 1 deletion services/spar/test-integration/Test/MetricsSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec = describe "metrics" . it "works" $ do
_ <- call $ get (spar . path p1)
_ <- call $ get (spar . path (p2 "316f1c18-2980-11e9-ab0b-ef604d1791b2"))
_ <- call $ get (spar . path (p2 "60a7dda8-2980-11e9-b359-fb5b41565453"))
resp :: String <- call $ maybe mempty cs . responseBody <$> get (spar . path "i/metrics")
resp :: String <- call $ foldMap cs . responseBody <$> get (spar . path "i/metrics")
-- FUTUREWORK: here we could parse the prometheus 'RegistrySample' and inspect it more
-- thoroughly, but i'm not sure there is a parser.
liftIO $ do
Expand Down