We present FCOMP, a system for automatic generation of harmony and accompanying melody. Building on previous work on functional modelling of musical harmony, FCOMP first creates a foundational harmony by generating random (but user-guided) values of a datatype that encodes the rules of tonal harmony. Then, a melody that fits to the harmony is generated in a compositional sequence: generate all "possible" melodies, filter them to remove obvious bad choices, pick one candidate note per chord, and then embellish the resulting melodic line.At this very early stage, we aim to define a solid system as a foundation that can be used to further improve upon. We care especially about modularity, so that each individual part of the pipeline can be easily improved, and ease of adaptation, so that users can quickly adapt the generated music to their liking. The resulting system generates simple but harmonious music, and serves as a good case study on how functional programming enables quick and clean prototyping of new ideas, even in the realm of automatic music composition.