├── llms.txt └── docs ├── guide.md └── api.md /llms.txt: -------------------------------------------------------------------------------- 1 | [Guide](/docs/guide.md) 2 | [API Documentation](/docs/api.md) 3 | 4 | ## Swift: Map and Filter 5 | 6 | Demonstrates Swift's map and filter on arrays for concise transformation. 7 | 8 | ```swift 9 | let nums = [1,2,3,4,5] 10 | let evensDoubled = nums.filter { $0 % 2 == 0 }.map { $0 * 2 } 11 | print(evensDoubled) 12 | ``` 13 | 14 | 15 | ## Haskell: Filter and Map 16 | 17 | A minimal Haskell example filtering odd numbers and squaring them. 18 | 19 | ```haskell 20 | main :: IO () 21 | main = print $ map (^2) $ filter odd [1..10] 22 | ``` 23 | 24 | 25 | ## Kotlin: Data Class Copy 26 | 27 | Demonstrates Kotlin data classes and the copy method. Encourages immutable-style updates. 28 | 29 | ```kotlin 30 | data class User(val id:Int, val name:String, val active:Boolean) 31 | fun main(){ 32 | val u1 = User(1, "Ada", true) 33 | val u2 = u1.copy(active = false) 34 | println(u2) 35 | } 36 | ``` 37 | 38 | -------------------------------------------------------------------------------- /docs/guide.md: -------------------------------------------------------------------------------- 1 | # Auto-generated Test Document 2 | 3 | This file is generated for E2E parsing. 4 | 5 | **Document ID:** a94g4c3oq7p-mit8u6xm 6 | 7 | This document contains a variety of concise, self-contained code examples across multiple programming languages, demonstrating common patterns, data structures, I/O, and control flow to exercise parsing in a realistic yet compact way. 8 | 9 | Each example includes a short description followed by a fenced code block. 10 | 11 | Where helpful, examples may include brief variations in syntax or structure so the parser encounters a wider range of constructs across different ecosystems. 12 | 13 | ## R: Vector Arithmetic 14 | 15 | Simple R vector example computing squares of a sequence. 16 | 17 | ```r 18 | nums <- 1:5 19 | squares <- nums^2 20 | print(squares) 21 | ``` 22 | 23 | 24 | ## Dart: Map Over List 25 | 26 | Dart example mapping over a list and printing the result. 27 | 28 | ```dart 29 | void main() { 30 | final nums = [1,2,3,4,5]; 31 | final tripled = nums.map((n) => n * 3).toList(); 32 | print(tripled); 33 | } 34 | ``` 35 | 36 | 37 | ## Scala: List Pipeline 38 | 39 | Uses Scala collections to filter and map a list with a clear pipeline. 40 | 41 | ```scala 42 | object Main { 43 | def main(args: Array[String]): Unit = { 44 | val nums = List(1,2,3,4,5) 45 | val oddsSquared = nums.filter(_ % 2 == 1).map(n => n*n) 46 | println(oddsSquared) 47 | } 48 | } 49 | ``` 50 | 51 | 52 | -------------------------------------------------------------------------------- /docs/api.md: -------------------------------------------------------------------------------- 1 | # Auto-generated Test Document 2 | 3 | This file is generated for E2E parsing. 4 | 5 | **Document ID:** anj5qrndfei-mit8u6xm 6 | 7 | This document contains a variety of concise, self-contained code examples across multiple programming languages, demonstrating common patterns, data structures, I/O, and control flow to exercise parsing in a realistic yet compact way. 8 | 9 | Each example includes a short description followed by a fenced code block. 10 | 11 | Where helpful, examples may include brief variations in syntax or structure so the parser encounters a wider range of constructs across different ecosystems. 12 | 13 | ## TypeScript: Typed User Model 14 | 15 | This example shows a strongly-typed user interface and a function that formats user info. It highlights TypeScript's type safety. 16 | 17 | ```typescript 18 | interface User { id: number; name: string; active: boolean } 19 | function formatUser(u: User): string { return `${u.id}:${u.name}:${u.active}` } 20 | console.log(formatUser({ id: 1, name: 'Ada', active: true })); 21 | ``` 22 | 23 | 24 | ## C#: LINQ Query 25 | 26 | Filters and projects a sequence using C# LINQ. Demonstrates expressive collection manipulation. 27 | 28 | ```csharp 29 | using System; 30 | using System.Linq; 31 | class Program { 32 | static void Main(){ 33 | var nums = new[]{1,2,3,4,5}; 34 | var squares = nums.Where(n=>n%2==1).Select(n=>n*n); 35 | Console.WriteLine(string.Join(",", squares)); 36 | } 37 | } 38 | ``` 39 | 40 | 41 | --------------------------------------------------------------------------------