`3 'div' 4`

```
data BTree a = EmptyBTree | Node a (BTree a) (BTree a)
```card :: BTree a -> Integer
card EmptyBTree = 0
card (Node x) lt rt = (height lt) + (height rt) + 1

`card (Node x lt rt`) = (height lt) + (height rt) + 1

`>`maxFour :: Int -> Int -> Int -> Int -> Int
>maxFour
>| a >= b && a >= c && a >= d = a
>| b >= c && b >= d= b
>| c >= d = c
>| otherwise = d

`>`exOr :: bool -> bool -> bool
>exOr b1 b2
>= (b1 && not b2) || (b2 && not b1)

`exOr :: Bool -> Bool -> Bool`

`>`ex = (2==3))

`>`fun x
>fun 2 = 34

`>`fun x
> fun 2 = 34

`>`fun x y 2 = 34

`>`module Junk where
>
>a = (True, [1,2,3,4]

`>`f :: Int -> [Int] -> [Int]
>f a x = (a:x

`>`fun x = 17
>type Fred = Int

`>`fun x = 17
>type Fred = Int

`>`Fun x = 17

`>`fun x = 17
>where
>type Fun = Int

`>`fun x x = 17

`>`fun x y
>| x==y = 17

`double - 4`

`>`fun x = x + abs -2

`>`fun x = x + abs (-2)

```
Are two integers in ascending order?
```>ascendingOrder :: Int -> Int -> Bool
>ascendingOrder x y = (x<=y)

`>`test :: (Bool,Bool) -> Bool
>test (b1,2b ) = b1

`>`predecessor n :: Num a => a -> a
>predecessor n
>| n>0 = n-1
>| n==0 = 0

`>`predecessor :: Num a => a -> a

`>`Any Haskell code in literate form

`>`Any Haskell code in non-literate form

`>`fred :: Int -> Int

`>`elem :: Int -> [Int] -> Bool
>elem x xs = [y | y<-xs, y==x] /= []

`>`import Prelude hiding (elem)

`>`f [] = 23
>g y = 2
>f (x:xs) = 6

`>`foo :: Int -> [Char]
>foo x = ['1'] ++ foo(x div 10)

```
empty :: [a] -> Bool
```empty as = (as == [])

```
empty :: Eq a => [a] -> Bool
```empty as = (as == [])

`>`compress :: [a] -> [a]
>compress [] = []
>compress [a] = [a]
>compress (x:y:xs)
>| (x == y) = compress (x:xs)
>| otherwise = x : compress (y:xs)

`>`compress :: Eq a => [a] -> [a]

`>`ascendingOrder :: Int -> Int -> Bool
>ascendingOrder a b
>| a<=b = a b
>| otherwise = b a

`>`ascendingOrder :: Int -> Int -> Bool
>ascendingOrder x y
>| x<=y = x y
>| otherwise = y x

`>`ex = [('2',2),('1','1' ),('a',3)]

`>`fun x = x ++ 2

`>`convert :: String -> String
>convert s = "Co" ++ (300 + tail s)

`>`fun x = [2] :[2]

`>`myCheck :: Int -> Bool
>myCheck n = ord n == 6

`>`myCheck :: Char -> Bool

`>`type Fred = (Fred ,Int)

`>`data Fred = Fred Fred Int

`>`proximity :: a -> a -> Double
>proximity x y = 0
>q :: b -> Int
>q p = 0
>where
>g :: b -> Double
>g = proximity p

`3/0`

`(1+2)/0`

`>`fun n = fun (n+1)

`>`fun n = fun (n+1)

`[1 .. 10]!!23`

`[] !! _ = error "PreludeList.!!: index too large"`

`concat [1,2,3]`

`concat :: [[a]] -> [a]`

`>`test :: [Bool] -> [Bool]
>test [] = [False]
test [True]

`>`test xs = case xs of > [] -> [False]

`totalArea :: [(Float,Float)] -> [(Float)]`totalArea [(a,b)] = map times2 [(a,b)]

`times2 :: (Float,Float) -> Float`times2 (a,b) = a * b

`reverse []`

`data Tree a = Empty | Node (Tree a) a (Tree a)`

`Empty`

`<<function>>`

`(1,2,3,4,5,6)`