Skip to content

Form violates Applicative law #3

Description

@debug-ito

Applicative "identity" law states pure id <*> v == v, but Form violates it.

This is because its (<*>) instance adds incFormId between the two actions. As a result, pure id <*> v executes v with the incremented FormId.

I think (<*>) doesn't have to do incFormId. Instead, functions like Generalized.input should call incFormId just before they get input for themselves, because it is they who need to generate new FormIds. So, incFormId, getFormInput and getFormId might as well be atomic.

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