I've got this error and I'm not sure how to make an empty list of a particular type? Been trying a few different things but I'm at a bit of a loss.
── TYPE MISMATCH ──────────────────────────────────────────────────── day4.roc ─
Something is off with the body of the emptyBingoBoard definition:
31│ emptyBingoBoard : ParsedInput
32│ emptyBingoBoard = {bingoNumbers : [], bingoBoards : [] }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The body is a record of type:
{ bingoBoards : List *, bingoNumbers : List * }
But the type annotation on emptyBingoBoard says it should be:
{ bingoNumbers : List U64, boards : List BingoBoard }
Tip: Seems like a record field typo. Maybe bingoBoards should be
boards?
Tip: Can more type annotations be added? Type annotations always help
me give more specific messages, and I think they could help a lot in
this case
This is the best I've come up with so far..
» [1u64] |> List.drop 1
[] : List U64
That is really strange. I wonder if it is some sort of regression. I have definitely created lists of various types just with []
Can you share more context of your program?
Oh wait, the types have different names of the record variables
boards vs bingoBoards
That is probably the root issue
The other info is probably fluff in the error message.
Thank you
I should learn to read these messages closer
Luke Boswell has marked this topic as resolved.
Those tips should probably be displayed in the reverse order, or the second tip should be dropped entirely! The first tip correctly identified what was going on.
Yeah both tips are currently given "equal visual weight", which is not ideal.
Last updated: Jul 06 2025 at 12:14 UTC