mirror of
https://github.com/github/semantic.git
synced 2024-12-20 13:21:59 +03:00
attempt to clean up the indexer
This commit is contained in:
parent
98da549fc5
commit
9c44ad374c
@ -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