Study of fp in scala