Skip to content

Describe laws for NonDet #317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
13 changes: 9 additions & 4 deletions effectful-core/src/Effectful/Internal/Monad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,15 @@ instance MonadFix (Eff es) where
----------------------------------------
-- NonDet

-- | Provide the ability to use the 'Alternative' and 'MonadPlus' instance for
-- 'Eff'.
--
-- @since 2.2.0.0
{-| Provide the ability to use the 'Alternative' and 'MonadPlus' instance for
'Eff'.

'NonDet' does not backtrack. Formally, it obeys the "left-catch" law for 'MonadPlus',
rather than the "left-distribution" law. This means that it behaves more like 'Maybe'
than '[]'.

@since 2.2.0.0
-}
data NonDet :: Effect where
Empty :: NonDet m a
(:<|>:) :: m a -> m a -> NonDet m a
Expand Down
Loading