Project Inquiry

Implement Prelude.and

Challenge
{-# LANGUAGE NoImplicitPrelude #-}

module Main where

import           Prelude hiding (and)

main :: IO ()
main = putStrLn $ if test then "SUCCESS" else "FAILURE"

test :: Bool
test = and [] == True &&
       and [True] == True &&
       and [False] == False &&
       and [False, True] == False &&
       and [True, False, True] == False

-- TODO
and :: [Bool] -> Bool
and = undefined
Solution
{-# LANGUAGE NoImplicitPrelude #-}

module Main where

import           Prelude hiding (and)

main :: IO ()
main = putStrLn $ if test then "SUCCESS" else "FAILURE"

test :: Bool
test = and [] == True &&
       and [True] == True &&
       and [False] == False &&
       and [False, True] == False &&
       and [True, False, True] == False

-- DONE
and :: [Bool] -> Bool
and []     = True
and (x:xs) = x && and xs