import Data.Bifunctor (bimap)






shoelace :: [(Double, Double)] -> Double
shoelace =
  let calcSums ((x, y), (a, b)) = bimap (x * b +) (a * y +)
   in (/ 2)
        . abs
        . uncurry (-)
        . foldr calcSums (0, 0)
        . (<*>) zip (tail . cycle)


main :: IO ()
main =
  print $
    shoelace [(3, 4), (5, 11), (12, 8), (9, 5), (5, 6)]