Skip to content

OptionT implements MonadCombine, but doesn't meet the laws #693

Description

@mikejcurry

Whilst looking at OptionT today and adding some tests in #692, I noticed that the OptionT has a MonadCombine instance, plus implementations for empty and combine.

The tests exercise MonadCombineTests.monad instead of MonadCombineTests.monadCombine, which means that the implementations of empty and combine are not tested against the laws (or anything).

I briefly looked at increasing the test to monadCombine, but the current implementation of OptionT does not pass the laws, at least not for OptionT[List, Int].

I noticed that #687 proposes to remove, at least temporarily, the MonadCombine for XorT - if a similar approach is warranted here I can take a look. By similiar in this instance, I mean that it might make sense to reduce the implementation to Monad until the laws pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions