I've been investigating functional programming, and it occurred to me that there could be a functional language which has (immutable) objects with methods, and which therefore supports method chaining (where chainable methods would return new instances rather than mutating the instance the method is called on and returning it).
This would have readability advantages as...
o.f().g().h()
... is arguably more readable than:
h(g(f(o)))
It would also allow you to associate particular functions with particular types of object, by making them methods of those types (which I understand to be one advantage of object-oriented langauges).
Are there any languages which behave like this? Are there any reasons to believe that this would be a bad idea?
(I know that you can program like this in e.g Javascript, but Javascript doesn't enforce immutability.)