No title

Anonymous Coward 2018-03-07 06:29:41.596406 UTC

1-- A function f has the type Ord a => a -> a -> Bool and we apply
2-- it to one numeric value. What is the type now?
3
4-- Ord a => a -> Bool
5-- Num -> Num -> Bool
6-- Ord a => a -> a -> Integer
7-- (Ord a, Num a) => a -> Bool
8
9
10Acccording to ghci :
11
12*Lib> let f:: Ord a => a -> a -> a -> Bool; f = undefined
13*Lib> :t f 2
14f 2 :: (Num a, Ord a) => a -> a -> Bool