curry.icurry.analysis.monadic module

curry.icurry.analysis.monadic.set_monadic_metadata(ifun, modules)[source]

Determines whether an ICurry function is monadic.

The result is stored in the ‘all.monadic’ metadata and also in ‘all.flags’ by OR-ing with F_MONADIC. This apparent redundancy is needed because ‘all.monadic’ is actually a tristate: True or False indicates the monadic check has been performed, while its absense indicates the check needs to be performed.

To determine whether a function is monadic, its call graph is walked. If the function calls any monadic function, then it is determined to be monadic.