1
1
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:
Patrick Thomson 2019-01-15 13:57:52 -05:00
parent 98da549fc5
commit 9c44ad374c

View File

@ -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)