Haskell for Imperative Programmers #18 - QuickCheck

แชร์
ฝัง

ความคิดเห็น • 10

  • @smjonas8616
    @smjonas8616 3 ปีที่แล้ว +8

    If your ghci installation has trouble finding QuickCheck even after "cabal install QuickCheck", try "cabal repl --build-depends QuickCheck". This worked for me :)

  • @officemax3977
    @officemax3977 3 ปีที่แล้ว +5

    Fantastic work! This series is

  • @aakk6818
    @aakk6818 11 หลายเดือนก่อน +1

    It might be worth pointing out that the "list of empty tuples" test cases are basically useless even for checking the reverse function as even `dumbReverse x = x` will pass them.

    • @hdbrot
      @hdbrot 9 หลายเดือนก่อน

      This doesn’t make the lists of empty tuples useless. The reverse function simply has these as fixpoints. The equally dumb function `dumbReverse x = [ ]` doesn‘t pass them, so I don‘t see the point.

  • @micknamens8659
    @micknamens8659 2 ปีที่แล้ว +3

    Why would quicktest use the empty list 10 times?
    This makes only sense if the function under test isn't pure, i.e. would use IO, like random numbers or reading a file.
    Is there a way to call quicktest on a pure function in a way that duplicate test data is avoided?

    • @OlliWilkman
      @OlliWilkman ปีที่แล้ว +2

      Maybe it tries lists of ten different types and each set of those also includes the empty case.

  • @Daniel-ws9qu
    @Daniel-ws9qu 4 ปีที่แล้ว +6

    2:34, is the QuickCeck operator this one: ==> ?

    • @philipphagenlocher
      @philipphagenlocher  4 ปีที่แล้ว +8

      Indeed. (==>) is the operator for "conditional properties".