marigold-dev / ligolang

MIT License
1 stars 1 forks source link

Add support for unit type literals `()` #1

Open anchpop opened 2 years ago

pkhry commented 2 years ago

why Unit type is represented as empty record?

anchpop commented 2 years ago

@Zett98 It doesn't need to be, it could be its own type, but unit is isomorphic to an empty record, no?

pkhry commented 2 years ago

@Zett98 It doesn't need to be, it could be its own type, but unit is isomorphic to an empty record, no?

i haven't thought about it this way. I thought that with explicit Unit variant we would have an unboxed int representing this type, but with empty record we will have block with an int param, but that probably shouldn't matter