when I write
setDistribution cfg = f `File.hasContent` cfg
`onChange` update
`requires` File.dirExists confDir
is update called before ensuring the confiDir Exist ? It seems to me but who knows ?
when I write
setDistribution cfg = f `File.hasContent` cfg
`onChange` update
`requires` File.dirExists confDir
is update called before ensuring the confiDir Exist ? It seems to me but who knows ?
I think that should behave intuitively, but of course if you're unsure of this kind of thing, adding parens is a good way to disambiguate the code.
Written that way, it's explicit that the parenthesized part runs together as one action.
Or, we can do a quick test in ghci:
So, yes, it's behaving as it should, first ensuring that the
requires
property is met, and then running the main property, and since it made a change, following up by running theonChange
property.