시리즈: haskell
haskell
44 줄
· 업데이트 2026-02-03
Main.hs
haskell/Week9/Main.hs
module Main where
import DrawTree (printTree)
import BST
import Nat
import Type
import Fruit
main :: IO ()
main = do
putStrLn "--- goodTree (draw) ---"
printTree goodTree
putStrLn "--- flattenTreeOrd goodTree ---"
print $ flattenTreeOrd goodTree
putStrLn "--- elemBSTree 13 in goodTree ---"
print $ elemBSTree 13 goodTree
putStrLn "--- treeBSMax and treeBSMin goodTree ---"
print $ (treeBSMax goodTree, treeBSMin goodTree)
putStrLn "--- insert 14 into goodTree and flatten ---"
let t' = treeInsert goodTree 14
print $ flattenTreeOrd t'
putStrLn "--- isBSTree checks ---"
print $ isBSTree goodTree
print $ isBSTree notBSTree
putStrLn "--- smallTree examples ---"
printTree smallTree
print $ elemBSTree (5 :: Integer) smallTree
putStrLn "--- Nat examples ---"
print $ (S (S Z) == S (S Z))
print $ (S Z <= S (S Z))
putStrLn "--- Type examples ---"
print $ cow True 'a' "abc"
print $ foo 'a' "abc" ["abc","def"]
putStrLn "--- Fruit ordering sample ---"
print $ (Apple <= Banana, Orange <= Apple)
관련 글
haskell
haskell
업데이트 2026-02-03
Adding.hs
Adding.hs — haskell source code from the haskell learning materials (haskell/Adding.hs).
글 읽기 →
haskell
haskell
업데이트 2026-02-03
Area.hs
Area.hs — haskell source code from the haskell learning materials (haskell/Area.hs).
글 읽기 →
haskell
haskell
업데이트 2026-02-03
Chess.hs
Chess.hs — haskell source code from the haskell learning materials (haskell/Chess.hs).
글 읽기 →
haskell
haskell
업데이트 2026-02-03
ChessGraphics.hs
ChessGraphics.hs — haskell source code from the haskell learning materials (haskell/ChessGraphics.hs).
글 읽기 →
haskell
haskell
업데이트 2026-02-03
Examples.hs
Examples.hs — haskell source code from the haskell learning materials (haskell/Examples.hs).
글 읽기 →
haskell
haskell
업데이트 2026-02-03
Fibonacci.hs
Fibonacci.hs — haskell source code from the haskell learning materials (haskell/Fibonacci.hs).
글 읽기 →