-- @lookupBy f b xs@ finds the element @x@ which satisfies @f x = b@
propLookupBy :: Int -> Int -> [Int] -> Bool
propLookupBy fn b xs = let
        l = lookupBy f b xs
        f = (* fn)
    in case l of
        Just l' -> f l' == b
        Nothing -> b `notElem` map f xs

-- | @takeWhile p == takeWhileList (p . head)@
propLookupBy :: Int -> Int -> [Int] -> Bool
propLookupBy fn b xs = let
        l = lookupBy f b xs
        f = (* fn)
    in case l of
        Just l' -> f l' == b
        Nothing -> b `notElem` map f xs

-- | @takeWhile p == takeWhileList (p . head)@
propLookupBy fn b xs = let
        l = lookupBy f b xs
        f = (* fn)
    in case l of
        Just l' -> f l' == b
        Nothing -> b `notElem` map f xs

-- | @takeWhile p == takeWhileList (p . head)@