The problem appears to be in the Workbook module, line 16, which defines sheets as nonempty_list. This makes sense once the sheet is created, but not during creation.
The workaround might be to avoid append_sheet for creation and use %Workbook{sheets: [sheet]} instead.
This code, as given in the doc example, works but generates a dialyzer warning about breaking the contract:
This does not:
But of course that gives us two sheets.
The problem appears to be in the Workbook module, line 16, which defines
sheets
asnonempty_list
. This makes sense once the sheet is created, but not during creation.The workaround might be to avoid
append_sheet
for creation and use%Workbook{sheets: [sheet]}
instead.Suggestion: add a
Workbook.new(sheet)
function.