Haskell data type with reviews

I implement the Ukkonen algorithm, which requires that all leaves of the tree contain a reference to the same integer, and I do this in Haskell to learn more about this language. However, it is difficult for me to write a data type that does this.

-- Node has children, indexes of info on the edge -- to it, and an optional suffix link. -- Leaf has a beginning index of the info, but the -- end index is always an incrementing variable index. data STree = Node [STree] (Int, Int) (Maybe STree) | Leaf (Int, ??? ) 

How can I put a link in a leaf type declaration?

+7
reference haskell mutable state-monad suffix-tree
source share

No one has answered this question yet.

See similar questions:

3
How to find all substrings of a string with start and end indices
one
Communication in tree structures

or similar:

3076
What are the differences between a pointer variable and a reference variable in C ++?
2427
How to pass a variable by reference?
1032
Ukkonen suffix tree algorithm in plain English
757
Getting started with Haskell
111
How do you present the graph in Haskell?
5
Haskell tree identification data structure list
5
Creating polymorphic recursive types in Haskell
2
Access values ​​in a haskell user data type
one
Communication in tree structures
0
Haskell max int binary tree?

All Articles