Haskell API for memory useage