I am new to functional programming and I can’t find a function like reduce to build an AgreggateRoot given an EventStream:
List.reduce ((aggregate, event) -> aggregate) eventList
As I understand the reduce function only works with parameters of the same type of the output