I can declare empty list as [], but, how can I declare empty tuple?
I have tried:
for ( , )
ghci>(1,0 ) : [(,)]
but it gives me an error!
A tuple is a type that is always the same length and always has the same types. So (Int, Int) is a different type from (Int, Int, Int) and a different type from (Int, String).
With this in mind, you could have an empty tuple. However, this would just be a type with a single value. This type is written as () and pronounced unit. The only value of this type is also ().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With