koala-13b· UC Berkeley
Arena Human Preference 55K
give me the code for an adder in Haskell, C, and Python.
- User
give me the code for an adder in Haskell, C, and Python.
- Assistant
In Haskell, you can define an adder using the
+operator:codeadd :: Int -> Int -> Int add a b = a + bHere's the equivalent code in C:
code#include <stdio.h> int add(int a, int b) { return a + b; }And here's the equivalent code in Python:
codedef add(a, b): return a + bThese are the simplest ways to implement an adder in these languages.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.