Comments on: Some interesting features of Haskell’s type system https://jeltsch.wordpress.com/2013/02/09/some-interesting-features-of-haskells-type-system/ Mathematics, computer science, and computers Thu, 17 Nov 2016 15:05:58 +0000 hourly 1 http://wordpress.com/ By: AdelNick https://jeltsch.wordpress.com/2013/02/09/some-interesting-features-of-haskells-type-system/#comment-549 Fri, 04 Mar 2016 09:19:05 +0000 http://jeltsch.wordpress.com/?p=545#comment-549 Ah, indeed. Pretty simple. Thank you for the explanation!

]]>
By: Wolfgang Jeltsch https://jeltsch.wordpress.com/2013/02/09/some-interesting-features-of-haskells-type-system/#comment-548 Thu, 03 Mar 2016 22:01:39 +0000 http://jeltsch.wordpress.com/?p=545#comment-548 According to the type declarations, every tree contains a forest, but a forest contains something of type func (Tree func label). There may be values of this type that do not contain trees. For example in the case of RoseTree, func is [], so func (Tree func label) is [RoseTree label]. As a result, you have a base in the form of the empty list. For instance, the expression Tree 'X' (Forest []) denotes a rose tree with just a single node with label 'X'.

Note that even without such a base, the Tree and Forest types are not useless, since you can have infinite data structures.

]]>
By: AdelNick https://jeltsch.wordpress.com/2013/02/09/some-interesting-features-of-haskells-type-system/#comment-547 Thu, 03 Mar 2016 00:10:50 +0000 http://jeltsch.wordpress.com/?p=545#comment-547 Thank you for the interesting post. One question I couldn’t answer for myself: How do I create instances of types Tree and Forest?
For example, later when you define type List, there is a non-recursive constructor Nil, that allows to stop recursion. In case of Tree and Forest, the recursion seems to be infinite.

]]>
By: Some interesting features of Haskell’s type system | Theory Lunch https://jeltsch.wordpress.com/2013/02/09/some-interesting-features-of-haskells-type-system/#comment-247 Sat, 09 Feb 2013 22:01:08 +0000 http://jeltsch.wordpress.com/?p=545#comment-247 […] I talked about some of Haskell’s type system features. You can find a write-up of my talk on my personal blog. […]

]]>