{"body":"Im trying to obtain the min element in a tree using the following definition:\ndata Tree a \n    = Tip\n    | Bin (Tree a) a (Tree a)\n    deriving (Show, Eq)\n\n\nfoldTree :: (b -> a -> b -> b) -> b -> Tree a -> b\nfoldTree f z Tip         = z\nfoldTree f z (Bin l x r) = f (foldTree f z l) x (foldTree f z r)\n\nminTree :: (Ord a) => Tree a -> Maybe a\nminTree = foldTree f z\n    where\n    f l x r = minimum [l, Just x, r]\n    z = Nothing\nHowever not quite sure how to obtain something other than Nothing as an output? Anyone have suggestions? \n","name":"Haskell_message_1","extension":"txt","url":"https://www.irccloud.com/pastebin/nqt2N6lQ/Haskell_message_1","modified":1636139467,"id":"nqt2N6lQ","size":535,"lines":17,"own_paste":false,"theme":"","date":1636139467}