Skip to content

Commit

Permalink
database: remove fully qualified named types in signature
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Hivert <hivert.is.coming@gmail.com>
  • Loading branch information
ghivert committed May 13, 2024
1 parent 62cb280 commit 79f58a6
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions apps/backend/src/backend/gleam/generate/sources.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,15 @@ fn type_to_string(type_: Type) {
|> result.map(string.from_utf_codepoints)
|> result.unwrap("a")
}
package_interface.Named(name, package, module, parameters) -> {
let params =
parameters
|> list.map(type_to_string)
|> string.join(", ")
|> fn(s) {
use <- bool.guard(when: string.is_empty(s), return: s)
"(" <> s <> ")"
}
case package {
"" -> name <> params
_ -> module <> "." <> name <> params
package_interface.Named(name, _package, _module, parameters) -> {
parameters
|> list.map(type_to_string)
|> string.join(", ")
|> fn(s) {
use <- bool.guard(when: string.is_empty(s), return: s)
"(" <> s <> ")"
}
|> string.append(name, _)
}
}
}
Expand Down

0 comments on commit 79f58a6

Please sign in to comment.