Loading PBM, PGM, PPM image files in pure Haskell