计算机代考程序代写 Haskell – setting the "warn-incomplete-patterns" flag asks GHC to warn you – cscodehelp代写
— setting the “warn-incomplete-patterns” flag asks GHC to warn you
— about possible missing cases in pattern-matching definitions
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
— see https://wiki.haskell.org/Safe_Haskell
{-# LANGUAGE Safe #-}
module Assessed1 (checksum , step , bin2Bool , bool2Bin , notBin , andBin , orBin , deMorg1 , deMorg2 , deMorg3 , deMorg4 , equals , roots) where
import Types
———————————————————————————
—————- DO **NOT** MAKE ANY CHANGES ABOVE THIS LINE ——————–
———————————————————————————
{- Question 1 -}
checksum :: Integral a => [a] -> Bool
checksum = undefined
{- Question 2 -}
step :: Grid -> Grid
step = undefined
— The other Game of Life functions are in Types.hs to keep this file clean.
— But life depends on step, so it needs to be here.
life :: Grid -> IO ()
life seed = f 0 seed
where
f n g = do
terminalRender g
putStrLn (show n)
delayTenthSec 1
f (n+1) (step g)
{- Question 3 -}
bin2Bool :: Binary -> Bool
bin2Bool = undefined
bool2Bin :: Bool -> Binary
bool2Bin = undefined
notBin :: Binary -> Binary
notBin = undefined
andBin :: Binary -> Binary -> Binary
andBin = undefined
orBin :: Binary -> Binary -> Binary
orBin = undefined
deMorg1 :: Binary -> Binary -> Binary
deMorg1 = undefined
deMorg2 :: Binary -> Binary -> Binary
deMorg2 = undefined
deMorg3 :: Binary -> Binary -> Binary
deMorg3 = undefined
deMorg4 :: Binary -> Binary -> Binary
deMorg4 = undefined
{- Question 4 -}
equals :: (Finite a, Eq b) => (a -> b) -> (a -> b) -> Bool
equals = undefined
{- Question 5 -}
roots :: (Finite a , Num b, Eq b) => (a -> b) -> [a]
roots = undefined