[Haskell-beginners] How to show a predicate

martin martin.drautzburg at web.de
Sat Dec 26 17:44:40 UTC 2015


Am 12/25/2015 um 03:11 PM schrieb Lyndon Maydwell:
> Depending on how you construct your predicates, you may be able to capture their composition... And then serialise that.
> 
> For example:
> 
> If you were doing some sort of range intersection predicate construction ~
> 
>     R1 n R2 n R3
> 
> Could be represented as a list of those ranges [(l1,r1),(l2,r2),(l3,r3)]. Basically, instead of constructing a predicate
> function directly, you would assemble a data-structure representing the essence of the predicate, then convert that to
> both a function for evaluation, as well as a string for serialisation. This would also allow you to perform some
> "optimisation" before serialisation which could be fun.

Thanks, I understand I need a representation and a Set would be just one of the possiblilities.


More information about the Beginners mailing list