Talk:Total circles area: Difference between revisions

Line 68:
 
== Haskell analytical solution ==
I like the analytical solution in Haskell, but I think a tuples soup harms readability. So do you mind if I replace it with this code that introduces the Vec, Circle and Arc types? http://ideone.com/JjD4x [[User:Bearophile|bearophile]] 12:11, 21 September 2012 (UTC)
 
: Go ahead. I'm a complete newbie in Haskell, and have no problem with people improving it. --[[User:Ledrug|Ledrug]] 15:04, 21 September 2012 (UTC)
 
: Actually there is one thing that's not quite right: in an arc ((x,y,r), (a0,a1)) the (a0,a1) is not a vector, they are a pair of angles of the start and end points on the original circle. It doesn't hurt the computation, but as readability goes, nameing them "Vec" is misleading. --[[User:Ledrug|Ledrug]] 18:26, 21 September 2012 (UTC)
 
:: Right, I am sorry. In a (Haskell) program types contain lot of information (like telling apart two tuples that contain two doubles). For a second programmer that tries to add more of such information it's easy to miss part of the semantics and introduce wrong type information. I will try to introduce a Angs type and fix the code. And later please take a look at the code. I am an Haskell newbie myself, but we are learning. --[[User:Bearophile|bearophile]] 19:36, 21 September 2012 (UTC)