{-# LANGUAGE DeriveGeneric #-} module Exercise_7 where {- Library -- nicht verändern -} data Tree a = Empty | Node a (Tree a) (Tree a) deriving (Eq, Show) data Html = Text String | Block String [Html] swissLetters :: [(Int, String)] swissLetters = [(196, "Auml"), (214, "Ouml"), (220, "Uuml"), (228, "auml"), (246, "ouml"), (252, "uuml")] grueezi = Block "html" [Block "head" [Block "author" [Text "der MC"], Block "date" [Text "27.11.2012"], Block "topsecret" []], Block "body" [Block "h1" [Text "Gr\252ezi!"], Block "p" [Text "\196b\228, genau. Sal\252. Bis sp\246ter!"]]] data DirTree a = File a | Dir a [DirTree a] deriving (Eq, Show) exDir :: DirTree String exDir = Dir "" [Dir "usr" [Dir "lib" [File "vim"], Dir "include" [File "string.h"]], Dir "bin" $ [File "ls", File "cat"]] {- G1 -} data WildChar = Missing data WildPat = WildPat [WildChar] stringFromWildChar :: WildChar -> String stringFromWildChar = undefined stringFromWildPat :: WildPat -> String stringFromWildPat = undefined {- Show? -} wildPatFromString :: String -> WildPat wildPatFromString = undefined matchWildPat :: WildPat -> String -> Bool matchWildPat = undefined match = matchWildPat . wildPatFromString {- G2 -} treeSort :: Ord a => [a] -> [a] treeSort = undefined {- G3 -} plainHtml :: Html -> String plainHtml = undefined {- H1 -} prettyHtml :: Int -> Html -> String prettyHtml = undefined {- H2 -} plainDirTree :: Show a => DirTree a -> String plainDirTree = undefined prettyDirTree :: Show a => DirTree a -> String prettyDirTree = undefined {- H3 -} {-WETT-} unscrambleWords :: [String] -> [String] -> [String] unscrambleWords = undefined {-TTEW-}