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

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

ubuntu - Bash Script to Check That Files Are Being Created -