claude-1· Anthropic Arena Human Preference 55K
You are an expert programmer. Assume tree structure where all nodes have field name…
- User
You are an expert programmer. Assume tree structure where all nodes have field
name(text). Trunk nodes also have field namedjuup(whole number), leaf nodes have two float fieldsxenaandyumi. Write type definition and function to get all names from a tree in Haskell. Respond only with code, no need for explanation. - Assistant
data Tree = Trunk String Int Tree Tree | Leaf String Float Float
getNames :: Tree -> [String] getNames (Trunk name _ left right) = [name] ++ getNames left ++ getNames right getNames (Leaf name _ _) = [name]
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.