refactoring: PapillonCore.hs about derivs etc