mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-16 14:18:29 +01:00
Avoid invalid pattern match #108
This commit is contained in:
parent
7f62b5b8f6
commit
b1942934bb
@ -594,12 +594,14 @@ latestHelper pname clause = fmap (fmap toLatest) $ E.select $ E.from $ \(s,ln,p,
|
|||||||
|
|
||||||
getDeps :: GetStackageDatabase m => Text -> m [(Text, Text)]
|
getDeps :: GetStackageDatabase m => Text -> m [(Text, Text)]
|
||||||
getDeps pname = run $ do
|
getDeps pname = run $ do
|
||||||
Just (Entity pid _) <- getBy $ UniquePackage pname
|
mp <- getBy $ UniquePackage pname
|
||||||
fmap (map toPair) $ E.select $ E.from $ \d -> do
|
case mp of
|
||||||
E.where_ $
|
Nothing -> return []
|
||||||
(d E.^. DepUser E.==. E.val pid)
|
Just (Entity pid _) -> fmap (map toPair) $ E.select $ E.from $ \d -> do
|
||||||
E.orderBy [E.asc $ d E.^. DepUses]
|
E.where_ $
|
||||||
return (d E.^. DepUses, d E.^. DepRange)
|
(d E.^. DepUser E.==. E.val pid)
|
||||||
|
E.orderBy [E.asc $ d E.^. DepUses]
|
||||||
|
return (d E.^. DepUses, d E.^. DepRange)
|
||||||
where
|
where
|
||||||
toPair (E.Value x, E.Value y) = (x, y)
|
toPair (E.Value x, E.Value y) = (x, y)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user