parseElfSegmentFlags :: Word32 -> [ElfSegmentFlag]
parseElfSegmentFlags word = [ cvt bit | bit <- [ 0 .. 31 ], testBit word bit ]
  where cvt 0 = PF_X
        cvt 1 = PF_W
        cvt 2 = PF_R
        cvt n = PF_Ext n
parseElfSegmentFlags :: Word32 -> [ElfSegmentFlag]
parseElfSegmentFlags word = [ cvt bit | bit <- [ 0 .. 31 ], testBit word bit ]
  where cvt 0 = PF_X
        cvt 1 = PF_W
        cvt 2 = PF_R
        cvt n = PF_Ext n
parseElfSegmentFlags word = [ cvt bit | bit <- [ 0 .. 31 ], testBit word bit ]
  where cvt 0 = PF_X
        cvt 1 = PF_W
        cvt 2 = PF_R
        cvt n = PF_Ext n