Skip to content

Refactor `Layout` and `Row` to use rose trees

Rémi requested to merge ajob410/layout-trees into dev

Motivation and Context

closes #1527 (closed)

Description

Fix problem regarding unification of layout in record/sum types. As expected, this won't typecheck anymore:

type r1 = [@layout:comb] {foo : string; bar : string}
type r2 = {bar : string; foo : string}

let main (_ : unit * r1) : operation list * r1 =
  ([], ({bar = "bar"; foo = "foo"} : r2))
type r1 = [@layout:comb] {foo : string; bar : string}
type r2 = [@layout:comb] {bar : string; foo : string}

let main (_ : unit * r1) : operation list * r2 =
  ([], {bar = "bar"; foo = "foo"})

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Performance improvement (non-breaking change that improves performance)
  • None (change with no changelog)

Changelog

Fix problem regarding unification of layout in record/sum types.

Checklist:

  • Changes follow the existing coding style (use dune @fmt to check).
  • Tests for the changes have been added (for bug fixes / feature).
  • Documentation has been updated.
  • Changelog description has been added (if appropriate).
  • Start titles under ## Changelog section with #### (if appropriate).
  • There is no image or uploaded file in changelog
  • Examples in changed behaviour have been added to the changelog (for breaking change / feature).
Edited by Rémi

Merge request reports