Skip to content

Can DeltaPos of the first pattern not depend on the position of "case"? #97

Description

@zliu41

When refactoring

f = \x -> case scrut of
  pat -> body

initially the annEntryDelta of pat is relative to the starting position of "case", in this case DP (1, -8).

Once it is refactored to

f x = case scrut of
  pat -> body

the annEntryDelta of pat must be updated based on the new position of "case". The problem is that there doesn't seem to be an easy and non-hacky way to obtain the new position of "case".

On the other hand this is fine:

f = \x -> foo
  bar

in this case the annEntryDelta of bar does not depend on the position of foo, and is always DP (1, 2).

Is it possible to make the annEntryDelta of the first pattern not depend on where the "case" is?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions