trying to implement gp(x)
gp(x) in haskell, it runs but it wrongs