← hask-test

93d87fe6c0b7b607960f868001525adfc6c11599 · eof · Oct 18, 2014 01:25

+20 · 1 file changed

  • Main.hs +20 −0
diff --git a/Main.hs b/Main.hs
new file mode 100644
index 0000000..e787e44
--- /dev/null
+++ b/Main.hs
@@ -0,0 +1,20 @@
+data Thing = Shoe
+           | Ship
+           | SealingWax
+           | Cabbage
+           | King
+  deriving Show
+  -- Store a person's name, age, and favorite Thing
+data Person = Person String Int Thing
+  deriving Show
+  
+brent :: Person
+brent = Person "Brent" 30 SealingWax
+
+stan :: Person
+stan = Person "Stan" 94 Cabbage
+
+getAge :: Person -> Thing
+getAge (Person _ _ a) = a
+
+main = print (getAge stan)
\ No newline at end of file