Rewriting let-binding into a where clause