As Paco said can't really be pure if you use Either there. since logging is an effect, but if you don;t care about logging as an effect then it's fine like that. You could with other data types that can do effect suspension like IO or with the MonadDefer type class instead of Either.