Skip to content

* and & don't coincide #3145

Closed
Closed
@mtzguido

Description

@mtzguido
module ProdAssoc

let t1 = int * int * int
let t2 = int * int & int
let t3 = int & int * int
let t4 = int & int & int

--dump_module shows...

Module after type checking:
module ProdAssoc
Declarations: [
let t1 = Prims.int * Prims.int * Prims.int
let t2 = Prims.int * Prims.int * Prims.int
let t3 = Prims.int * Prims.int * Prims.int
let t4 = Prims.int * Prims.int * Prims.int
]
Exports: [
let t1 = Prims.int * Prims.int * Prims.int
let t2 = Prims.int * Prims.int * Prims.int
let t3 = Prims.int * Prims.int * Prims.int
let t4 = Prims.int * Prims.int * Prims.int
]

but! with --ugly we see

Module after type checking:
module ProdAssoc
Declarations: [
[@ ]
visible let  t1  : Type = (tuple3 int int int)
[@ ]
visible let  t2  : Type = (tuple2 (tuple2 int int) int)
[@ ]
visible let  t3  : Type = (tuple2 int (tuple2 int int))
[@ ]
visible let  t4  : Type = (tuple3 int int int)
]
Exports: [
[@ ]
visible let  t1  : Type = (tuple3 int int int)
[@ ]
visible let  t2  : Type = (tuple2 (tuple2 int int) int)
[@ ]
visible let  t3  : Type = (tuple2 int (tuple2 int int))
[@ ]
visible let  t4  : Type = (tuple3 int int int)
]

Verified module: ProdAssoc
All verification conditions discharged successfully

So

  1. The pretty printer is being very misleading with nested tuples and we should definitely fix that.
  2. Looks like & only "composes" with itself and not with * to make larger tuples. Maybe that's ok.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions