f :: Integer -> String -> Integer
f n ('n':'^':s) =
  let m = read s :: Integer
  in
    n ^ m
f :: Integer -> String -> Integer
f n ('n':'^':s) =
  let m = read s :: Integer
  in
    n ^ m
f n ('n':'^':s) =
  let m = read s :: Integer
  in
    n ^ m