JamesGallicchio / LeanColls

WIP collections library for Lean 4
https://jamesgallicchio.github.io/LeanColls/docs/
Apache License 2.0
30 stars 7 forks source link

Add `UInt*` byte seq instances #36

Open JamesGallicchio opened 6 months ago

JamesGallicchio commented 6 months ago

See https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Marshalling.20lean.20UInt*.20into.20byte.20arrays

I think the most sensible design is to add UInt*.BytesBE and UInt*.BytesLE wrapper structures, with UInt*.toBytes[BL]E functions. Then we can add Indexed instances on the wrapper structures, using Fin 2/4/8 as the index.