Generate metadata of Gleam Records for runtime reflection
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

doc [skip ci]

authored by

Vladislav Botvin and committed by
GitHub
61b362da 0d79939d

+8 -3
+8 -3
README.md
··· 30 30 31 31 If this record exists in a source file: 32 32 33 + ###### src/user.gleam 34 + 33 35 ```gleam 34 36 pub type User { 37 + /// some metadata 35 38 User(id: Int, name: String, email: String) 36 39 } 37 40 ``` 38 41 39 42 the output will be: 40 43 44 + ###### src/gleam_gen.gleam 45 + 41 46 ```gleam 42 47 import glerd/types 43 48 44 49 pub const record_info = [ 45 50 #( 46 - "User", 47 - "user", 51 + "User", // record name 52 + "user", // module name 48 53 [ 49 54 #("id", types.IsInt), #("name", types.IsString), 50 55 #("email", types.IsString), 51 56 ], 52 - "", 57 + "some metadata", 53 58 ), 54 59 ] 55 60 ```