Project Inquiry

Implement Prelude.($)

Challenge
{-# LANGUAGE NoImplicitPrelude #-}

module Main where

import           Prelude hiding (($))

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

test :: Bool
test = and [ (show $ 1) == "1"
           , (show $ 1 + 2) == "3"
           , (not $ even 4) == False
           ]

infixr 0 $

-- TODO: This program doesn't compile. Define the missing function(s) incl. type signatures!
Solution
{-# LANGUAGE NoImplicitPrelude #-}

module Main where

import           Prelude hiding (($))

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

test :: Bool
test = and [ (show $ 1) == "1"
           , (show $ 1 + 2) == "3"
           , (not $ even 4) == False
           ]

infixr 0 $

-- DONE
($) :: (a -> b) -> a -> b
f $ x = f x