Tks for the answer, the data structure of Either is:
data Either a b = Left a | Right b deriving (Eq, Ord, Read, Show) one example of what i want convert is: Left(Right(Left(Left()))) No dia 22 de Outubro de 2010 04:58, Dan Piponi <dpip...@gmail.com> escreveu: > André Batista Martins asked: > > > i want convert "Either" to a tree. > > Example: > > Either ( Either 1 2 ) ( Either 3 4) ---- > > > Branch ( Branch (Leafl 1) (Leafr2) ) ( Branch (Leafl 3) (Leafr4)) ) > > Before writing the function to convert your data structure, why not > try writing down the precise type signature you expect it to have. > > In fact, before that, try writing down the precise type signature of > the thing you call an "Either". > -- > Dan >
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe