This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Here is some information about Claude and Anthropic’s products in case the person asks: | |
| This iteration of Claude is part of the Claude 4 model family. The Claude 4 family currently consists of Claude Opus 4.1, 4 and Claude Sonnet 4. Claude Sonnet 4 is a smart, efficient model for everyday use. Claude Opus 4.1 is a powerful, large model for complex challenges. Claude Opus 4.5 is the smartest model and the best model in the world for coding, agents, and computer use. | |
| If the person asks, Claude can tell them about the following products which allow them to access Claude. Claude is accessible via this web-based, mobile, or desktop chat interface. | |
| Claude is accessible via an API and developer platform. The person can access Claude by using the API with the model string “claude-opus-4-20250514” for Claude Opus 4, or “claude-sonnet-4-5” for Claude Sonnet 4.5. Claude is accessible via Claude Code, a command line tool for agentic coding. Claude Code lets developers delegate coding tasks to Claude directly from their t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Mathlib | |
| inductive Operation | add | sub | mul | div | |
| deriving DecidableEq | |
| def Operation.parse (input : String) : Option Operation := | |
| match input with | |
| | "+" => .some .add | "-" => .some .sub | |
| | "*" => .some .mul | "/" => .some .div | |
| | _ => .none |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def calc_rpn (program : List String) (stack : List Int) : List Int := | |
| match program, stack with | |
| | "+" :: rest, op1 :: op2 :: stack => calc_rpn rest ((op2 + op1) :: stack) | |
| | "-" :: rest, op1 :: op2 :: stack => calc_rpn rest ((op2 - op1) :: stack) | |
| | "*" :: rest, op1 :: op2 :: stack => calc_rpn rest ((op2 * op1) :: stack) | |
| | "/" :: rest, op1 :: op2 :: stack => calc_rpn rest ((op2 / op1) :: stack) | |
| | another :: rest, stack => calc_rpn rest (another.toNat! :: stack) | |
| | [], stack => stack | |
| def rpn (program : String) : Option Int := |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open Core | |
| (* First version: the type of diffs is a function from an enumeration | |
| of all record fields to a potential difference. It's a GADT type, | |
| which allows us to return correclty typed results. | |
| All thanks to ppx_typed_fields! *) | |
| type order = { | |
| id: int; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type order = { | |
| id: int; | |
| name: string; | |
| price: int; | |
| is_quote: bool; | |
| items: string list; | |
| } | |
| type 'a diff = Same | Different of { left: 'a; right: 'a } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open Core | |
| type ('result, 'input, 'output) gen = | |
| | Done of 'result | |
| | Input of ('input -> ('result, 'input, 'output) gen) | |
| | Output of ('output * ('result, 'input, 'output) gen) | |
| let rec gen_bind x f = | |
| match x with | |
| | Done x -> f x |