Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Control/Monad/Select.hs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ class (Monad m) => MonadSelect r m | m -> r where
instance MonadSelect r (SelectT r Identity) where
select = Select.select

instance MonadSelect r (SelectT r ((->) r')) where
select f = Select.SelectT $ \k r' -> f $ \a -> k a r'

-- | \'Extends\' the possibilities considered by @m@ to include 'Nothing'; this
-- means that 'Nothing' gains a \'rank\' (namely, a value of @r@), and the
-- potential result could also be 'Nothing'.
Expand Down