+++ title = "Theory Around `sem_pred_expr`" date = "2022-11-16" author = "Yann Herklotz" tags = [] categories = [] backlinks = ["3c3k"] forwardlinks = [] zettelid = "3c3k1" +++ The function `sem_pred_expr` has the same type signature as a `foldMap` function, maybe also the same signature as `foldMapM`, where the monad is the `Reader` monad. The only difference seems to be with how the elements are combined. Instead of being combined using the monoid, they are combined using the evaluation of the predicates, because this is only implemented for predicated objects. In addition to that, I feel like there should be a similarity between sending the identity semantics into the predicated semantics and the general **Free Applicative**. This is because we are essentially extracting the structure of the object that is inside of the predicates.