Glue
🩹 Generate functions from your Gleam code!
Install / Use
/learn @lpil/GlueREADME
glue
A package for generating functions from your Gleam code!
Generators
compare
Given a module containing this type:
pub type LogLevel {
Debug
Info
Warn
Error
}
This generator will generate the following function:
pub fn compare_log_level(a: LogLevel, b: LogLevel) -> Order {
let to_int = fn(x) {
case x {
Debug -> 0
Info -> 1
Warn -> 2
Error -> 3
}
}
int.compare(to_int(a), to_int(b))
}
list_variants
Given a module containing this type:
pub type Direction {
North
East
South
West
}
This generator will generate the following function:
pub fn direction_list() -> List(Direction) {
[North, East, South, West]
}
Installation
Add the package to your Gleam project
gleam add glue
API documentation can be found at https://hexdocs.pm/glue.
Related Skills
node-connect
354.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
