For "big" codecs, the Scala phase typer takes forever (we're talking minutes) when creating a codec directly from HList
s and applying .dropUnits
( ignore(6) ::
uint(2) ::
uint(30) ::
int(4) ::
int(8) ::
uint(10) ::
bool(1) ::
int(28) ::
int(27) ::
uint(12) ::
uint(9) ::
uint(6) ::
int(2) ::
ignore(3) ::
bool(1) ::
uint(19)
).dropUnits.as[SomeBigCaseClass]
And it seems to be way faster to create a codec with ~
, and then applying .hlist
like such:
( ignore(6) ~
uint(2) ~
...
).hlist.dropUnits.as[SomeBigCaseClass]
But this doesn't seem work.
Could not prove that this.Out can be converted to/from reports.SomeBigCaseClass.
).hlist.dropUnits.as[SomeBigCaseClass]
^
The simplest solution I've found, which is good enough for me is omitting Unit
values inline.
( (ignore(6) dropLeft
uint(2)) ::
...
).as[SomeBigCaseClass]
For codecs with many ignores, this feature would be highly welcome. What am I doing wrong? Am I totally missing the point of .hlist
?