Skip to content

Instantly share code, notes, and snippets.

@MBCook
MBCook / LineIntersections.hs
Last active August 29, 2015 14:01
DailyProgrammer #163 in Haskell
-- A program to take line segments in and find intersections fast
-- Challenge from: http://thirdpartyninjas.com/blog/2008/10/07/line-segment-intersection/
-- Intersection algorithm from: http://stackoverflow.com/a/565282/786339
import Data.Maybe -- To make Maybe handling easier
import Data.List -- So we can sort
import System.IO -- For file loading
------------------ Some types we'll use ------------------