Skip to content

different serializations for functions from codebase vs scratch file? #5726

Open
@aryairani

Description

@aryairani

In ucm 0.5.40 and earlier, we see a different serialized output from serial-test-04.md depending on whether the mkTestCase definition is in the latest type checked unison file or not. 1

e.g.

``` unison :hide

mutual0 = cases
  0 -> "okay"
  n ->
    _ = openFile
    mutual1 (drop n 1)

mutual1 n =
  mutual0 n

mkTestCase = do
  saveTestCase "case-04" "v4" mutual1 5
```

``` ucm
scratch/main> run mkTestCase
```

produces a larger serialized output than

``` unison :hide

mutual0 = cases
  0 -> "okay"
  n ->
    _ = openFile
    mutual1 (drop n 1)

mutual1 n =
  mutual0 n

mkTestCase = do
  saveTestCase "case-04" "v4" mutual1 5
```

``` ucm
scratch/main> add
```

``` unison
x = 17
```

```ucm
scratch/main> run mkTestCase
```

Why is the serialized output bigger than it needs to be?

Footnotes

  1. This showed up while testing make add an alias of update #5705, which replaced add with update, because update clears the TUF while add didn't.

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