takeWhileM predM l@(x:xs) = do
    val <- predM x
    case val of
        False -> return []
        _ -> do
                ys <- takeWhileM predM xs
                return (x:ys)
takeWhileM predM l@(x:xs) = do
    val <- predM x
    case val of
        False -> return []
        _ -> do
                ys <- takeWhileM predM xs
                return (x:ys)
takeWhileM predM l@(x:xs) = do
    val <- predM x
    case val of
        False -> return []
        _ -> do
                ys <- takeWhileM predM xs
                return (x:ys)