F# – Combining predicates

I came across this SO question the other day, and I really liked Daniel’s answer as it illustrates the beauty and elegance of F# and functional programming in general!

image

Personally I love the combinators approach, and for anyone else who’s interested to see what else you can do with combinators, check out the beautifully crafted FParsec, a parser combinator library for F#.


Yan Cui

I’m an AWS Serverless Hero and the author of Production-Ready Serverless. I have run production workload at scale in AWS for nearly 10 years and I have been an architect or principal engineer with a variety of industries ranging from banking, e-commerce, sports streaming to mobile gaming. I currently work as an independent consultant focused on AWS and serverless.

You can contact me via Email, Twitter and LinkedIn.

Hire me.