Skip to content

Aff Plus instance does not meet the right identy law? #83

@erykciepiela

Description

@erykciepiela

We have:

instance altAff :: Alt Aff where
  alt a1 a2 = catchError a1 (const a2)

instance plusAff :: Plus Aff where
  empty = throwError (error "Always fails")

and Plus right identity law:

x `alt` empty == x

for x = throwError (error "whatever") the above does not hold or am I missing something? Or is it intentional "up to interpretation" meeting the law?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions