Is there a reason (performance, memory, typesystem) why a Tuple is not a HList and Function is not a mapping form a HList to some value?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Performance and memory both. Tuples have
O(1)access for their elements; as typically constructed,HListis a list, and thus hasO(n). Also, tuples require memory for one extra object withnreferences to other objects, whileHList(as a list) requires one object each (plus anextpointer). Since the overhead of an object is about two references, this turnsn+2memory usage into4n+2. Not so awesome for a core language construct.