Week 2 introduction2

 0    6 フィッシュ    up804653
mp3をダウンロードする 印刷 遊びます 自分をチェック
 
質問 English 答え English
What are guards?
学び始める
Guards are Boolean expression used in function definitions to givealternative results dependent on the parameter values
Haskal contains guards and what other simmilar function?
学び始める
if... then... else...
how is a guard denoted?
学び始める
maxThree: Int -> Int -> Int -> IntmaxThree x y z| x >= y && x >= z = x| y >= z = y| otherwise = z
how are local definitions denoted?
学び始める
the keyword "where" eg where /n dxSq = (x1 - x2)ˆ2 /n dySq = (y1 - y2)ˆ2
CAn local definitions be used outside of the function they are defined in?
学び始める
Local definitions can only be used within the functions that theyare defined; they are “hidden” from the rest of the program.
Local definitions can be used as function parameters true or false?
学び始める
true

コメントを投稿するにはログインする必要があります。