compilePatError err =
  return $ throwExp loc (String (T.unpack ("Non-exhaustive patterns in " <> typ)))

    where
      loc = Loc (file,line)
      file = T.takeWhile (/=':') err
      line = read . T.unpack . T.takeWhile isDigit . T.drop 1 . T.dropWhile (/=':') $ err
      typ = T.drop 1 . T.dropWhile (/='|') $ err
compilePatError err =
  return $ throwExp loc (String (T.unpack ("Non-exhaustive patterns in " <> typ)))

    where
      loc = Loc (file,line)
      file = T.takeWhile (/=':') err
      line = read . T.unpack . T.takeWhile isDigit . T.drop 1 . T.dropWhile (/=':') $ err
      typ = T.drop 1 . T.dropWhile (/='|') $ err
compilePatError err =
  return $ throwExp loc (String (T.unpack ("Non-exhaustive patterns in " <> typ)))

    where
      loc = Loc (file,line)
      file = T.takeWhile (/=':') err
      line = read . T.unpack . T.takeWhile isDigit . T.drop 1 . T.dropWhile (/=':') $ err
      typ = T.drop 1 . T.dropWhile (/='|') $ err