recursion - Return an infinite tree consisting of only nodes in Haskell -



recursion - Return an infinite tree consisting of only nodes in Haskell -

given next simple tree

info tree = leaf | node tree tree deriving (eq, show)

is there way homecoming infinite amount of nodes (a tree nodes, no leaves) using recursion?

so far know how homecoming info types such boolean , integer. how start returning tree ?

infinitetree :: tree infinitetree = node infinitetree infinitetree

haskell recursion tree infinite algebraic-data-types

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -