From 4b725bea7db80050913ca44f490aefa5204d415d Mon Sep 17 00:00:00 2001 From: Nathan BeDell Date: Wed, 13 Aug 2014 15:21:08 -0400 Subject: [PATCH] added my ideas --- sintrastes/ideas.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sintrastes/ideas.md diff --git a/sintrastes/ideas.md b/sintrastes/ideas.md new file mode 100644 index 0000000..ca9ec3d --- /dev/null +++ b/sintrastes/ideas.md @@ -0,0 +1,14 @@ +Algebraic Data Types +==================== + +While oftentimes Python's classes in built in data types get by, I think that Python would be enriched with the addition of a nice syntax for algebraic data types. + +This new syntax might look somewhat like this: + + deftype Maybe a = Just a | Nothing + + deftype Tree a = Empty | Node a | Node a (Tree a) (Tree a) + +Inspired by the syntax of ML or Haskell. This sort of thing can be emulated with classes in Python, but the syntax isn't nearly as consice as the above. + +Python (especially Python 3) already has a lot of functional features in it, and algebraic data types would make it a lot easier to program in a functional style.