Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data Bintree a = Empty | Fork a (Bintree a) (Bintree a) deriving Show
- foldBtree :: val -> (a -> val -> val -> val) -> Bintree a -> val
- foldBtree val _ Empty = val
- foldBtree val f (Fork a left right) = f a (foldBtree val f left) (foldBtree val f right)
- or_ :: Tree Bool -> Bool
- or_ = foldTree id (||) False (||)
- preorderB :: Bintree a -> [a]
- preorderB = foldBtree [] (a : [] ++) -- here is the problem, please help for this function and i must use foldBtree to get this. THanks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement