Skip to content

Nested records#3

Merged
mdgriffith merged 5 commits into
mdgriffith:mainfrom
miniBill:nested-records
Nov 4, 2021
Merged

Nested records#3
mdgriffith merged 5 commits into
mdgriffith:mainfrom
miniBill:nested-records

Conversation

@miniBill
Copy link
Copy Markdown
Contributor

@miniBill miniBill commented Nov 3, 2021

Support nested records/list APIs

@miniBill
Copy link
Copy Markdown
Contributor Author

miniBill commented Nov 4, 2021

The main issue with this PR is that for some reason I was unable to have elm-prefab actually generate the type signatures now :(

I'll try and hack on it a bit more

@miniBill
Copy link
Copy Markdown
Contributor Author

miniBill commented Nov 4, 2021

Hacked a bit more
Nope, still missing edge cases

@miniBill
Copy link
Copy Markdown
Contributor Author

miniBill commented Nov 4, 2021

Ooook, should be done now, and with simpler code to boot!

@mdgriffith
Copy link
Copy Markdown
Owner

woohoo!

@mdgriffith mdgriffith merged commit b097297 into mdgriffith:main Nov 4, 2021
@miniBill miniBill deleted the nested-records branch November 4, 2021 13:59
dillonkearns added a commit to dillonkearns/elm-codegen that referenced this pull request Mar 31, 2026
Targets Internal.Compiler coverage gaps: inferRecordField, getField,
unifiableFields, isAppendable, and Elm.Arg.varWith.

Coverage improvements:
  TOTAL: 52.7% -> 53.5%
  Internal.Compiler: 41.7% -> 43.5%
  Internal.Arg: 53.5% -> 57.4%
  Elm.Arg: 50.0% -> 55.6%

No new bugs surfaced — all failures remain the known operator
indentation (finding mdgriffith#3) and comparable leak (finding mdgriffith#4) issues.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dillonkearns added a commit to dillonkearns/elm-codegen that referenced this pull request Mar 31, 2026
…ors.

Found 1 new bug (finding mdgriffith#6):
- Elm.Arg.aliasAs generates fresh type variable for the alias instead
  of the actual record type from the underlying pattern.

Coverage improvements:
  TOTAL: 57.4% -> 60.9%
  Elm.Declare: 33.7% -> 54.2% (+20.5%)
  Elm.Arg: 55.6% -> 77.8% (+22.2%)
  Internal.Arg: 57.4% -> 69.8% (+12.4%)
  Internal.Write: 66.1% -> 71.0%

6 bugs total found by property testing:
  mdgriffith#1 Number type variable collision (FIXED)
  mdgriffith#2 Pipe + lambda parens (FIXED)
  mdgriffith#3 Operator multi-line indentation
  mdgriffith#4 Comparable type variable leak
  mdgriffith#5 functionReduced wrong type annotations
  mdgriffith#6 aliasAs wrong type for alias variable

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dillonkearns added a commit to dillonkearns/elm-codegen that referenced this pull request Mar 31, 2026
Found 2 more bugs:
- Finding mdgriffith#5 update: Elm.unwrapper also generates wrong type
  annotations (val -> unwrapped instead of Wrapper -> Int)
- Finding mdgriffith#7: Elm.Op.pipeLeft with lambda absorbs <| into
  lambda body (\x -> x <| "hello" instead of (\x -> x) <| "hello")

Coverage: 60.9% -> 62.5%
  Elm: 60.5% -> 64.6%
  Elm.Declare: 54.2% -> 63.9% (+9.7%)
  Elm.Op: 75.6% -> 80.5%

Total bugs found: 7
  mdgriffith#1 Number type variable collision (FIXED)
  mdgriffith#2 Pipe + lambda parens (FIXED)
  mdgriffith#3 Operator multi-line indentation
  mdgriffith#4 Comparable type variable leak
  mdgriffith#5 functionReduced/unwrapper wrong type annotations
  mdgriffith#6 aliasAs wrong type for alias variable
  mdgriffith#7 pipeLeft lambda not parenthesized

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dillonkearns added a commit to dillonkearns/elm-codegen that referenced this pull request Mar 31, 2026
Found 1 new class of bugs (finding mdgriffith#8):
- 19 missing type annotations across 6 different API patterns
  (Let.unpack, Let.fn, unwrap, Declare.value, Elm.get through alias)
- elm-codegen's type inference silently fails for these patterns,
  producing declarations without type annotations

Coverage: 62.5% -> 63.2%

Total bugs found: 8
  mdgriffith#1 Number type variable collision (FIXED)
  mdgriffith#2 Pipe + lambda parens (FIXED)
  mdgriffith#3 Operator multi-line indentation
  mdgriffith#4 Comparable type variable leak
  mdgriffith#5 functionReduced/unwrapper wrong type annotations
  mdgriffith#6 aliasAs wrong type for alias variable
  mdgriffith#7 pipeLeft lambda not parenthesized
  mdgriffith#8 Missing type annotations for multiple APIs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants