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

Delphi change the assembly code of a running process -

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

C++ 11 "class" keyword -