work on the flatmap for dataset
merge with type simplification
Merge branch 'feature/flatmap' into develop