Function From Requirements
A typed, documented function built to spec — with three unit tests covering the edge and error cases.
Customize
Fill these in and the prompt below updates as you type. Anything you leave blank stays as a placeholder.
The programming language of the code
The behavior you want instead
The shape of the input, with types
The shape the result must take
Inputs likely to break it
The speed or resource limit this must meet
The conventions to write in
Your prompt
Write a {{language}} function that {{what_it_should_do}}. Requirements: - Input: {{input_spec}} - Output: {{output_spec}} - Edge cases to handle: {{edge_cases}} - Performance constraint: {{performance_constraint}} Include: type annotations/hints, a docstring with parameters and return type, and 3 unit test cases covering normal input, edge case, and error case. Follow {{style_guide}} conventions.