From de0447a69f58bbb55fd73cdc1e799c8e4705f128 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 5 Sep 2022 16:22:10 +1000 Subject: fixing logic in hoogledocs lookup --- app/Server.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/Server.hs b/app/Server.hs index 369221a..557459f 100644 --- a/app/Server.hs +++ b/app/Server.hs @@ -1532,11 +1532,11 @@ getHoogleDocs packageId (HCE.HaskellModuleName moduleName) itemSort name A.Array vector -> let items = mapMaybe valueToHoogleResultItem $ V.toList vector findItem :: Bool -> [HoogleResultItem] -> Maybe HoogleResultItem - findItem exactModuleMatch = + findItem laxModuleMatch = L.find (\HoogleResultItem {sort = s, moduleName = m} -> - s == itemSort && (exactModuleMatch || m == moduleName)) - in case findItem True items <|> findItem False items of + s == itemSort && (laxModuleMatch || m == moduleName)) + in case findItem False items <|> findItem True items of Just item -> return $ htmlDocs item _ -> error404 "" _ -> -- cgit v1.2.3