Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Successfully reported this slideshow.

Like this presentation? Why not share!

- Functional data structures by Ralf Laemmel 3903 views
- Datatypes for the real world by Eric Torreborre 2156 views
- Specs2 3.4 by Eric Torreborre 1225 views
- Using tests and mocks to drive the ... by Attila Magyar 1065 views
- Pratical eff by Eric Torreborre 1423 views
- The Eff monad, one monad to rule th... by Eric Torreborre 5081 views

No Downloads

Total views

3,143

On SlideShare

0

From Embeds

0

Number of Embeds

112

Shares

0

Downloads

29

Comments

2

Likes

2

No notes for slide

- 1. The Expression Problem solved, Finally! FPSyd
- 2. Disclaimer
- 3. I had this problem before Result Failure Success Pending Console Html Screenshot? Pdf?
- 4. The Expression Problem Add(Lit(1), Lit(2))
- 5. The Expression Problem
- 6. The Expression Problem
- 7. Solved in Java?!?
- 8. Not a new problem
- 9. Once and for all
- 10. Once and for all
- 11. Once and for all
- 12. Type constructors?
- 13. Type constructors?
- 14. Data types encodings
- 15. Data types encodings F[A] -> A (T1 + T2 + … + Tn) -> A (T1 -> A, T2 -> A, …, Tn -> A)
- 16. Data types encodings
- 17. Extensibility
- 18. Extensibility
- 19. Extensibility
- 20. Extensibility Data Functions Dispatchers
- 21. Main points Data types as Folds (!= F-Algebras) Encoded as type-classes Extensible and modular
- 22. “Finally tagless”
- 23. Finally tagless Embedded DSLs “Initial” “Final”
- 24. Extensibility “Initial”
- 25. Extensibility “Final”
- 26. Some other problems • The tagging problem in the interpretation of typed higher-order languages • The pattern-matching problem • Many others… “The [deserialization] problem becomes much more frustrating, exhilarating, time consuming and addictive in the general case of higher-order typed embedded languages” - Oleg Kiselyov
- 27. The tagging problem
- 28. One approach
- 29. With GADTs
- 30. The “Symantics” approach
- 31. Pushing the negation down “Initial” neg (add 1 2) => add (neg 1) (neg 2)
- 32. Pushing the negation down “Final”
- 33. Bijection between “ I n i t i a l ” and “Final”
- 34. Advantages Expressions are well-typed Easily extensible Less demanding of the type system
- 35. With OO
- 36. The Visitor solution
- 37. Object algebra
- 38. Pretty printer
- 39. Pretty printer
- 40. Extensions
- 41. Extensions
- 42. Multi-type
- 43. Combining data
- 44. Combining operations
- 45. Object algebras Fold algebras Work with OO languages having generics No visitor and “accept” method Generic combinator classes?
- 46. Conclusion Fold algebras Easier on the type system Extensibility Shallow / Deep Embeddings – ICFP14

No public clipboards found for this slide

Login to see the comments