The problem is the generic derivation of the instances, not the pattern matching on a single tuple. Variadic pattern match could work if you had those instances in place already.
-
-
I'm not sure what you mean. Maybe Twitter isn't the best venue for this discussion.
2 replies 0 retweets 0 likes -
Hm yeah probably :P
1 reply 0 retweets 0 likes -
I think you can bypass this limitation if you use template Haskell. There is a library tuple-th. The idea is that you don't use huge tuples in regular programming done by humans, but you might need them in computer generated programs, in which case you use template Haskell.
1 reply 0 retweets 0 likes -
Replying to @BartoszMilewski @gignico and
I think, for me, it's more about the beauty and generality of the code - Haskell feels like a language which is useful in reality, but there's a lot of nasty ugly realness. It's not beautiful! That might just be the mathematician in me talking :P (not that C++ is any better...)
1 reply 0 retweets 0 likes -
Replying to @strega_nil @gignico and
So is there a Show instance for an arbitrary-sized tuple in Idris?
1 reply 0 retweets 0 likes -
Replying to @BartoszMilewski @gignico and
yeah - https://github.com/idris-lang/Idris-dev/blob/master/libs/prelude/Prelude/Show.idr#L178 … Tuples in Idris are syntax sugar for nested pairs.
1 reply 0 retweets 0 likes -
Replying to @strega_nil @gignico and
Doesin't it mean you're paying for it with performance?
1 reply 0 retweets 0 likes -
Replying to @BartoszMilewski @gignico and
Perhaps, but who cares about performance? What I want is mathematical beauty! :3
1 reply 0 retweets 0 likes -
Replying to @strega_nil @BartoszMilewski and
(also, what performance would this be leaving on the table? beyond extra function calls, I guess)
2 replies 0 retweets 0 likes
It probably does hurt a little bit. Although once I get beyond about a 3-tuple I generally feel like I want a record anyway.
-
-
Replying to @edwinbrady @gignico and
I agree, but I worry about machine-generated programs (or, template-generated ones, in Haskell).
1 reply 0 retweets 0 likes -
Replying to @BartoszMilewski @gignico and
Yes, that seems a reasonable thing to worry about! I can't immediately think of a nice way to do this generically without a performance hit though.
0 replies 0 retweets 0 likes
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.