• + 0 comments

    Look ma - mappend! Haskell snippet:

    sol = sortBy (comparing Θ `mappend` comparing r)
    
    Θ [x, y] = if a < 0 then a + 2*pi else a 
        where a = atan2 (fromIntegral y) (fromIntegral x)
    
    r [x, y] = x^2 + y^2