mirror of
https://github.com/github/semantic.git
synced 2024-12-20 13:21:59 +03:00
Merge pull request #2333 from github/cleanup-indexer
Cleanup and harden indexer’s main loop.
This commit is contained in:
commit
bcc026c12b
@ -2,6 +2,7 @@
|
||||
module Prologue
|
||||
( module X
|
||||
, eitherA
|
||||
, eitherM
|
||||
, foldMapA
|
||||
, maybeM
|
||||
, maybeLast
|
||||
@ -79,6 +80,9 @@ fromMaybeLast b = fromMaybe b . getLast . foldMap (Last . Just)
|
||||
maybeM :: Applicative f => f a -> Maybe a -> f a
|
||||
maybeM f = maybe f pure
|
||||
|
||||
eitherM :: Applicative f => (a -> f b) -> Either a b -> f b
|
||||
eitherM f = either f pure
|
||||
|
||||
-- Promote a function to either-applicatives.
|
||||
eitherA :: Applicative f => (b -> f (Either a c)) -> Either a b -> f (Either a c)
|
||||
eitherA = either (pure . Left)
|
||||
|
Loading…
Reference in New Issue
Block a user