Re: [Haskell-cafe] An Haskell implementation of a sweep line algorithm for the detection of segments intersection
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 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] 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-of.html I'm new to Haskell, so any useful comments will be appreciated. - Eran ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] An Haskell implementation of a sweep line algorithm for the detection of segments intersection
2010/12/6 vince vegga megatron...@gmail.com: 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 Quite good, actually. Myself, I rarely write code that is on par with yours. ;) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe