An Haskell implementation of a sweep line algorithm for the detection of segments intersection

Hi, Here is my Haskell implementation of the Shamos and Hoey algorithm for detecting segments intersection in the plane: http://neonstorm242.blogspot.com/2010/12/sweep-line-algorithm-for-detection-... I'm new to Haskell, so any useful comments will be appreciated. - Eran

2010/12/6 vince vegga
Here is my Haskell implementation of the Shamos and Hoey algorithm for detecting segments intersection in the plane:
http://neonstorm242.blogspot.com/2010/12/sweep-line-algorithm-for-detection-...
Quite good, actually. Myself, I rarely write code that is on par with yours. ;)

On Mon, 6 Dec 2010, vince vegga wrote:
Hi,
Here is my Haskell implementation of the Shamos and Hoey algorithm for detecting segments intersection in the plane:
http://neonstorm242.blogspot.com/2010/12/sweep-line-algorithm-for-detection -of.html
I'm new to Haskell, so any useful comments will be appreciated.
In sweepLine, things like | a = False | otherwise = x can be written as (not a && x) and if a then True else x as (a || x). In handleLeftEndpoint you can create (events,updateLine) outside the case analysis, since this is common to all cases. In general you can find hints in: http://www.haskell.org/haskellwiki/Haskell_programming_tips and in http://www.haskell.org/haskellwiki/Category:Style
participants (3)
-
Henning Thielemann
-
Serguey Zefirov
-
vince vegga