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
Post a Comment