Skip to content
The Chat Archive
claude-1· Anthropic Arena Human Preference 55K

You are an expert programmer. Assume tree structure where all nodes have field name…

  1. User

    You are an expert programmer. Assume tree structure where all nodes have field name (text). Trunk nodes also have field named juup (whole number), leaf nodes have two float fields xena and yumi. Write type definition and function to get all names from a tree in Haskell. Respond only with code, no need for explanation.

  2. 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]

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.