daml/compiler/daml-lf-ast
Martin Huschenbett 075cab697b
damlc: Rotate type checking of case expressions by 90 degrees (#7873)
Currently, the Haskell implementation of the DAML-LF type checker
first branches on the pattern and then on the type of the scrutinee.
This PR changes it to first branch on the type of the scrutinee and
then on the pattern. This allows for destructing the type of the
scrutinee only once intead of repeating it for each pattern. This
should be good for performance, which is a nice side effect of this
change.

The main reason why I'm changing this is because we want to implement
an exhaustiveness check. This seems rather complicated to achieve with
the current implementation and will be significantly easier after this
change.

This PR is purely a refactoring and does not change the semantics of
amnything. In particular, it does not touch the decision that default
patterns match on anything, even no other pattern would match on the
value.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-04 13:06:00 +01:00
..
src/DA/Daml/LF damlc: Rotate type checking of case expressions by 90 degrees (#7873) 2020-11-04 13:06:00 +01:00
test/DA/Daml/LF/Ast Inline typeclass projections. (#5759) 2020-05-11 16:48:27 +00:00
BUILD.bazel replace DAML Authors with DA in copyright headers (#5228) 2020-03-27 01:26:10 +01:00
daml-lf-ast.cabal DEL-8132 extract DAML LF haskell libraries (scripted) (#7246) 2020-09-01 12:09:26 +10:00