[Haskell-beginners] A "show" error
Adrien Haxaire
adrien at haxaire.org
Sun Mar 11 20:34:13 CET 2012
Oh sorry I just realized you did !
On Sun, Mar 11, 2012 at 07:10:28PM +0000, bahadýr altan wrote:
> Hi,
> I'm trying to process on a tree with this function :
>
> f (Branch x (Branch y y1 y2) (Branch z z1 z2)) = (x,y,y1,y2,z,z1,z2)
>
>
> and my tree declaration is this :
>
> data Tree = Empty | Branch Integer Tree Tree deriving (Show)
>
> And I'm getting this error :
>
> Main> f (Branch 12 (Branch 15 Empty Empty) (Branch 28 Empty Empty))
> ERROR - Cannot find "show" function for:
> *** Expression : f (Branch 12 (Branch 15 Empty Empty) (Branch 28 Empty Empty))
> *** Of type : (Integer,Integer,Tree,Tree,Integer,Tree,Tree)
>
> I'll be happy if you help me to get rid of this error..
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
--
Adrien Haxaire
www.adrienhaxaire.org | @adrienhaxaire
More information about the Beginners
mailing list