tfwh-0.3.7.0

Safe HaskellSafe
LanguageHaskell2010

TFwH.Chap02.ExA

Description

第2章 練習問題 A

問:2足す2の半分は2かそれとも3か 答:そのとおり

Synopsis

Documentation

problem' :: Int Source #

problem' = 2 + (2 div 2)

problem'' :: Int Source #

problem'' = (2 + 2) div 2

answer' :: Int Source #

answer' = 3

answer'' :: Int Source #

answer'' = 2

answer :: Bool Source #

answer = (problem'  == answer' || problem'  == answer'' )
      && (problem'' == answer' || problem'' == answer'' )
>>> answer
True