ghci> :i : type List :: * -> * data List a = ... | a : [a] -- Defined in `GHC.Types' infixr 5 : ghci> :i $ ($) :: (a -> b) -> a -> b -- Defined in `GHC.Base' infixr 0 $ ghci> :t max max :: Ord a => a -> a -> a ghci> :i ord :1:1: error: Not in scope: `ord' ghci> :i Ord type Ord :: * -> Constraint class Eq a => Ord a where compare :: a -> a -> Ordering (<) :: a -> a -> Bool (<=) :: a -> a -> Bool (>) :: a -> a -> Bool (>=) :: a -> a -> Bool max :: a -> a -> a min :: a -> a -> a ghci> :t maxList maxList :: Ord a => [a] -> a ghci> maxList [5,3,7,2,8] 8 ghci> (max (+) (-) ) 1 2 :17:1: error: [GHC-39999] * No instance for `Ord (Integer -> Integer -> Integer)' arising from a use of `it' (maybe you haven't applied a function to enough arguments?) * In the first argument of `print', namely `it' In a stmt of an interactive GHCi command: print it ghci> ghci> (1,2,3) (1,2,3) ghci> thr3 (1,2,3) 3 ghci> map (+1) [1..5] [2,3,4,5,6] ghci> map (/2) [1..5] [0.5,1.0,1.5,2.0,2.5] ghci> map (2/) [1..5] [2.0,1.0,0.6666666666666666,0.5,0.4] ghci> pairs [(1,2),(2,2),(1,4),(2,4),(4,4),(1,6),(2,6),(3,6),(6,6),(1,8),(2,8),(4,8),(8,8),(1,10),(2,10),(5,10),(10,10),(1,12),(2,12),(3,12),(4,12),(6,12),(12,12),(1,14),(2,14),(7,14),(14,14),(1,16),(2,16),(4,16),(8,16),(16,16),(1,18),(2,18),(3,18),(6,18),(9,18),(18,18),(1,20),(2,20),(4,20),(5,20),(10,20),(20,20)] ghci> findX 2 lists [[1,2,3,4],[2,4,6,8]] ghci> findX2 2 lists [[1,2,3,4],[2,4,6,8]] ghci> findXC2 2 lists [[1,2,3,4],[2,4,6,8]] ghci> take 10 ones [1,1,1,1,1,1,1,1,1,1] ghci> take 3 $ map (2/) [1,2,3,5,0,7,0,10] [2.0,1.0,0.6666666666666666] ghci> take 10 powOf2 [1,2,4,8,16,32,64,128,256,512] ghci> take 10 primes [2,3,5,7,11,13,17,19,23,29] ghci> expand "abc" ["aabc","babc","cabc"] ghci> take 20 $ bfs [""] expand pal ["","a","b","c","aa","bb","cc","aaa","aba","aca","bab","bbb","bcb","cac","cbc","ccc","aaaa","abba","acca","baab"] ghci> take 20 $ palindromes symbols ["","a","b","c","aa","bb","cc","aaa","aba","aca","bab","bbb","bcb","cac","cbc","ccc","aaaa","abba","acca","baab"]