Category "programming-languages"

How can I write test cases for instances in Haskell

I have an instance of Num for a type I created called Vec: instance Num Vec where (+) (Vec x) (Vec y) = Vec (zipWith (+) x y) And I am trying to write a test

What is the difference between non local variable and global variable?

I am learning the concepts of programming languages. I found the terminology "nonlocal" in python syntax. What is the meaning of nonlocal in python??

What is duck typing?

I came across the term duck typing while reading random topics on software online and did not completely understand it. What is “duck typing”?