[Haskell-cafe] Why the exception?

Thomas M. DuBuisson thomas.dubuisson at gmail.com
Tue Jun 24 21:52:48 EDT 2008


Cafe
I'm a bit lost on this exception and curious about what's going on.  Is
there a valid reason for this exception that I am missing?  Note the
hard-coded [0..100] could be any Word8 list you want (generated via
arbitrary, [], or other) and it gives the same result.

Load the module and perform:
      :break prop_LPS
      quickCheck prop_LPS
      :step
      :force ps
     *** Exception: Prelude.head: empty list

> import qualified Data.ByteString as L
> import Test.QuickCheck
>
> instance Arbitrary L.ByteString where
>     arbitrary = do
>         return $ L.pack [0..100]
>
> prop_LPS :: L.ByteString -> Bool
> prop_LPS ps = ps `seq` True

P.S. Same result with GHCi 6.8.2 and 6.8.3.



More information about the Haskell-Cafe mailing list