Skip to main content

Note for LI Functional Programming - Week 1

Problem Sheet

Inspecting Some Types in Ghci

  1.  *Main> :type not (not (not False))
    not (not (not False)) :: Bool
  2.  *Main> :type (True,False)
    (True,False) :: (Bool, Bool)
  3.  *Main> :type ['a', 'b', 'x']
    ['a', 'b', 'x'] :: [Char]
  4.  *Main> :type [(3,4),(4,6)]
    [(3,4),(4,6)] :: (Num a, Num b) => [(a, b)]
  5.  *Main> :type (++)
    (++) :: [a] -> [a] -> [a]

Ill-typed Expressions