1

And also for composing function.

f $ a = f a
f . g = \x -> f (g x)
  • 1
    Do you really have to test those? I think their implementation is forced by their type (by their associated free theorem). – chi Oct 21 '16 at 08:37
  • Actually this is an exercise from [haskellBook](http://haskellbook.com/) – Jeremy Chen Oct 21 '16 at 08:49
  • I see, so it's an exercise just for the sake of it. I have no idea about what a meaningful test could be for those, though. I mean, I could compare test them against their own definitions, which feels weird. – chi Oct 21 '16 at 09:04

1 Answers1

0

QuickCheck works only on concrete types, so you first need to instantiate the type:

($) :: (Int -> String) -> Int -> String
Michal Gajda
  • 603
  • 5
  • 13