snowleopard / build

Build Systems à la Carte
MIT License
242 stars 18 forks source link

Add topological build transformer #2

Closed snowleopard closed 6 years ago

snowleopard commented 6 years ago

@ndmitchell @simonpj This, on the other hand, is cool :-)

Here we turn an incorrect monadic build system dumb into a correct applicative topoDumb by applying the topologicalT build transformer.

Note that topoDumb is still not minimal, since it stores no build information and can't track changes.

ndmitchell commented 6 years ago

👍 - wondering if all build systems could be transformers... that would make #1 more compelling

snowleopard commented 6 years ago

@simonpj and I have just figured out that task transformers are also interesting: it seems that we can rewrite all our process functions into this form: process :: k -> Task c k v -> Task (c + Update i) k v. In other words, we take a singleton Task and transform it by wrapping the fetch with additional functionality to update the build information i. Now build algorithms topological etc just need to plumb the Update i bit somehow.

Let's brainstorm further :)