Answers for "add type to element of data structure in haskell"

0

add type to element of data structure in haskell

data FightMove = Punch Int |
  Kick Int Float |
  Block String

chooseMove :: Int -> FightMove
chooseMove i = if i == 1
  then Punch 3
  Else if i == 2
    then Kick 3 6.5
    else Block “Please Protect Me”
Posted by: Guest on January-07-2022

Browse Popular Code Answers by Language