Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes the visitor pattern is a valid encoding of algebraic datatypes. Very heavyweight (imagine if booleans were all encoded with the visitor pattern) but nonetheless valid.

https://blog.ploeh.dk/2018/06/25/visitor-as-a-sum-type/



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: