[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71NAWMW26DVACVJ6B2GF7W2":3,"skill-same:01M71NAWMW26DVACVJ6B2GF7W2":118},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":28,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":68,"commitSha":69,"skillDirectory":70,"forksCount":14,"repositoryHtmlUrl":71,"repositoryHomepageUrl":72,"ownerHtmlUrl":73,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":74,"install":75,"resources":87},"01M71NAWMW26DVACVJ6B2GF7W2","golang-samber-mo",null,"Monadic types for Golang using samber\u002Fmo — Option, Result, Either, Future, IO, Task, and State types for type-safe nullable values, error handling, and functional composition with pipeline sub-packages. Apply when using or adopting samber\u002Fmo, when the codebase imports `github.com\u002Fsamber\u002Fmo`, or when considering functional programming patterns as a safety design for Golang.","pattanation\u002FNorvik","pattanation","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F235419268?v=4","01M71M5THHYYB15ME8R2E4FCZG","Patta","01M71M5TJM1NDM992M8PDKYR2K",0,"MIT","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fgolang-samber-mo\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"golang","golang samber mo","option","when","types","error","io","lsp","query","nullable","either","design","projects","gopls","Bash","Composition","pipeline","code","ai coding agents","MCP","2026-11-10 10:56:23",false,"---\nname: golang-samber-mo\ndescription: \"Monadic types for Golang using samber\u002Fmo — Option, Result, Either, Future, IO, Task, and State types for type-safe nullable values, error handling, and functional composition with pipeline sub-packages. Apply when using or adopting samber\u002Fmo, when the codebase imports `github.com\u002Fsamber\u002Fmo`, or when considering functional programming patterns as a safety design for Golang.\"\nuser-invocable: true\nlicense: MIT\ncompatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang.\nmetadata:\n  author: samber\n  version: \"1.0.7\"\n  openclaw:\n    emoji: \"🎭\"\n    homepage: https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang\n    requires:\n      bins:\n        - go\n    install: []\n    skill-library-version: \"1.16.0\"\nallowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch mcp__context7__resolve-library-id mcp__context7__query-docs AskUserQuestion Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__*\n---\n\n**Persona:** You are a Go engineer bringing functional programming safety to Go. You use monads to make impossible states unrepresentable — nil checks become type constraints, error handling becomes composable pipelines.\n\n**Thinking mode:** Use `ultrathink` when designing multi-step Option\u002FResult\u002FEither pipelines. Wrong type choice creates unnecessary wrapping\u002Funwrapping that defeats the purpose of monads.\n\n# samber\u002Fmo — Monads and Functional Abstractions for Go\n\nGo 1.18+ library providing type-safe monadic types with zero dependencies. Inspired by Scala, Rust, and fp-ts.\n\n**Official Resources:**\n\n- [pkg.go.dev\u002Fgithub.com\u002Fsamber\u002Fmo](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fsamber\u002Fmo)\n- [github.com\u002Fsamber\u002Fmo](https:\u002F\u002Fgithub.com\u002Fsamber\u002Fmo)\n\nThis skill is not exhaustive. Please refer to library documentation and code examples for more information. For Go package docs, symbols, versions, importers, and known vulnerabilities, → See `samber\u002Fcc-skills-golang@golang-pkg-go-dev` skill (`godig`) — prefer it over Context7 for Go package facts. To navigate this library's usage in your own code (definitions, call sites, diagnostics), → See `samber\u002Fcc-skills-golang@golang-gopls` skill (`gopls`). Context7 remains a fallback for docs not indexed on pkg.go.dev.\n\n```bash\ngo get github.com\u002Fsamber\u002Fmo\n```\n\nFor an introduction to functional programming concepts and why monads are valuable in Go, see [Monads Guide](.\u002Freferences\u002Fmonads-guide.md).\n\n## Core Types at a Glance\n\n| Type | Purpose | Think of it as... |\n| --- | --- | --- |\n| `Option[T]` | Value that may be absent | Rust's `Option`, Java's `Optional` |\n| `Result[T]` | Operation that may fail | Rust's `Result\u003CT, E>`, replaces `(T, error)` |\n| `Either[L, R]` | Value of one of two types | Scala's `Either`, TypeScript discriminated union |\n| `EitherX[L, R]` | Value of one of X types | Scala's `Either`, TypeScript discriminated union |\n| `Future[T]` | Async value not yet available | JavaScript `Promise` |\n| `IO[T]` | Lazy synchronous side effect | Haskell's `IO` |\n| `Task[T]` | Lazy async computation | fp-ts `Task` |\n| `State[S, A]` | Stateful computation | Haskell's `State` monad |\n\n## Option[T] — Nullable Values Without nil\n\nRepresents a value that is either present (`Some`) or absent (`None`). Eliminates nil pointer risks at the type level.\n\n```go\nimport \"github.com\u002Fsamber\u002Fmo\"\n\nname := mo.Some(\"Alice\")          \u002F\u002F Option[string] with value\nempty := mo.None[string]()        \u002F\u002F Option[string] without value\nfromPtr := mo.PointerToOption(ptr) \u002F\u002F nil pointer -> None\n\n\u002F\u002F Safe extraction\nname.OrElse(\"Anonymous\")  \u002F\u002F \"Alice\"\nempty.OrElse(\"Anonymous\")  \u002F\u002F \"Anonymous\"\n\n\u002F\u002F Transform if present, skip if absent\nupper := name.Map(func(s string) (string, bool) {\n    return strings.ToUpper(s), true\n})\n```\n\n**Key methods:** `Some`, `None`, `Get`, `MustGet`, `OrElse`, `OrEmpty`, `Map`, `FlatMap`, `Match`, `ForEach`, `ToPointer`, `IsPresent`, `IsAbsent`.\n\nOption implements `json.Marshaler\u002FUnmarshaler`, `sql.Scanner`, `driver.Valuer` — use it directly in JSON structs and database models.\n\nFor full API reference, see [Option Reference](.\u002Freferences\u002Foption.md).\n\n## Result[T] — Error Handling as Values\n\nRepresents success (`Ok`) or failure (`Err`). Equivalent to `Either[error, T]` but specialized for Go's error pattern.\n\n```go\n\u002F\u002F Wrap Go's (value, error) pattern\nresult := mo.TupleToResult(os.ReadFile(\"config.yaml\"))\n\n\u002F\u002F Same-type transform — errors short-circuit automatically\nupper := mo.Ok(\"hello\").Map(func(s string) (string, error) {\n    return strings.ToUpper(s), nil\n})\n\u002F\u002F Ok(\"HELLO\")\n\n\u002F\u002F Extract with fallback\nval := upper.OrElse(\"default\")\n```\n\n**Go limitation:** Direct methods (`.Map`, `.FlatMap`) cannot change the type parameter — `Result[T].Map` returns `Result[T]`, not `Result[U]`. Go methods cannot introduce new type parameters. For type-changing transforms (e.g. `Result[[]byte]` to `Result[Config]`), use sub-package functions or `mo.Do`:\n\n```go\nimport \"github.com\u002Fsamber\u002Fmo\u002Fresult\"\n\n\u002F\u002F Type-changing pipeline: []byte -> Config -> ValidConfig\nparsed := result.Pipe2(\n    mo.TupleToResult(os.ReadFile(\"config.yaml\")),\n    result.Map(func(data []byte) Config { return parseConfig(data) }),\n    result.FlatMap(func(cfg Config) mo.Result[ValidConfig] { return validate(cfg) }),\n)\n```\n\n**Key methods:** `Ok`, `Err`, `Errf`, `TupleToResult`, `Try`, `Get`, `MustGet`, `OrElse`, `Map`, `FlatMap`, `MapErr`, `Match`, `ForEach`, `ToEither`, `IsOk`, `IsError`.\n\nFor full API reference, see [Result Reference](.\u002Freferences\u002Fresult.md).\n\n## Either[L, R] — Discriminated Union of Two Types\n\nRepresents a value that is one of two possible types. Unlike Result, neither side implies success or failure — both are valid alternatives.\n\n```go\n\u002F\u002F API that returns either cached data or fresh data\nfunc fetchUser(id string) mo.Either[CachedUser, FreshUser] {\n    if cached, ok := cache.Get(id); ok {\n        return mo.Left[CachedUser, FreshUser](cached)\n    }\n    return mo.Right[CachedUser, FreshUser](db.Fetch(id))\n}\n\n\u002F\u002F Pattern match\nresult := fetchUser(\"user-123\")\nresult.Match(\n    func(cached CachedUser) mo.Either[CachedUser, FreshUser] { \u002F* use cached *\u002F },\n    func(fresh FreshUser) mo.Either[CachedUser, FreshUser] { \u002F* use fresh *\u002F },\n)\n```\n\n**When to use Either vs Result:** Use `Result[T]` when one path is an error. Use `Either[L, R]` when both paths are valid alternatives (cached vs fresh, left vs right, strategy A vs B).\n\n`Either3[T1, T2, T3]`, `Either4`, and `Either5` extend this to 3-5 type variants.\n\nFor full API reference, see [Either Reference](.\u002Freferences\u002Feither.md).\n\n## Do Notation — Imperative Style with Monadic Safety\n\n`mo.Do` wraps imperative code in a `Result`, catching panics from `MustGet()` calls:\n\n```go\nresult := mo.Do(func() int {\n    \u002F\u002F MustGet panics on None\u002FErr — Do catches it as Result error\n    a := mo.Some(21).MustGet()\n    b := mo.Ok(2).MustGet()\n    return a * b  \u002F\u002F 42\n})\n\u002F\u002F result is Ok(42)\n\nresult := mo.Do(func() int {\n    val := mo.None[int]().MustGet()  \u002F\u002F panics\n    return val\n})\n\u002F\u002F result is Err(\"no such element\")\n```\n\nDo notation bridges imperative Go style with monadic safety — write straight-line code, get automatic error propagation.\n\n## Pipeline Sub-Packages vs Direct Chaining\n\nsamber\u002Fmo provides two ways to compose operations:\n\n**Direct methods** (`.Map`, `.FlatMap`) — work when the output type equals the input type:\n\n```go\nopt := mo.Some(42)\ndoubled := opt.Map(func(v int) (int, bool) {\n    return v * 2, true\n})  \u002F\u002F Option[int]\n```\n\n**Sub-package functions** (`option.Map`, `result.Map`) — required when the output type differs from input:\n\n```go\nimport \"github.com\u002Fsamber\u002Fmo\u002Foption\"\n\n\u002F\u002F int -> string type change: use sub-package Map\nstrOpt := option.Map(func(v int) string {\n    return fmt.Sprintf(\"value: %d\", v)\n})(mo.Some(42))  \u002F\u002F Option[string]\n```\n\n**Pipe functions** (`option.Pipe3`, `result.Pipe3`) — chain multiple type-changing transformations readably:\n\n```go\nimport \"github.com\u002Fsamber\u002Fmo\u002Foption\"\n\nresult := option.Pipe3(\n    mo.Some(42),\n    option.Map(func(v int) string { return strconv.Itoa(v) }),\n    option.Map(func(s string) []byte { return []byte(s) }),\n    option.FlatMap(func(b []byte) mo.Option[string] {\n        if len(b) > 0 { return mo.Some(string(b)) }\n        return mo.None[string]()\n    }),\n)\n```\n\n**Rule of thumb:** Use direct methods for same-type transforms. Use sub-package functions + pipes when types change across steps.\n\nFor detailed pipeline API reference, see [Pipelines Reference](.\u002Freferences\u002Fpipelines.md).\n\n## Common Patterns\n\n### JSON API responses with Option\n\n```go\ntype UserResponse struct {\n    Name     string            `json:\"name\"`\n    Nickname mo.Option[string] `json:\"nickname\"`  \u002F\u002F omits null gracefully\n    Bio      mo.Option[string] `json:\"bio\"`\n}\n```\n\n### Database nullable columns\n\n```go\ntype User struct {\n    ID       int\n    Email    string\n    Phone    mo.Option[string]  \u002F\u002F implements sql.Scanner + driver.Valuer\n}\n\nerr := row.Scan(&u.ID, &u.Email, &u.Phone)\n```\n\n### Wrapping existing Go APIs\n\n```go\n\u002F\u002F Convert map lookup to Option\nfunc MapGet[K comparable, V any](m map[K]V, key K) mo.Option[V] {\n    return mo.TupleToOption(m[key])  \u002F\u002F m[key] returns (V, bool)\n}\n```\n\n### Uniform extraction with Fold\n\n`mo.Fold` works uniformly across Option, Result, and Either via the `Foldable` interface:\n\n```go\nstr := mo.Fold[error, int, string](\n    mo.Ok(42),  \u002F\u002F works with Option, Result, or Either\n    func(v int) string { return fmt.Sprintf(\"got %d\", v) },\n    func(err error) string { return \"failed\" },\n)\n\u002F\u002F \"got 42\"\n```\n\n## Best Practices\n\n1. **Prefer `OrElse` over `MustGet`** — `MustGet` panics on absent\u002Ferror values; use it only inside `mo.Do` blocks where panics are caught, or when you are certain the value exists\n2. **Use `TupleToResult` at API boundaries** — convert Go's `(T, error)` to `Result[T]` at the boundary, then chain with `Map`\u002F`FlatMap` inside your domain logic\n3. **Use `Result[T]` for errors, `Either[L, R]` for alternatives** — Result is specialized for success\u002Ffailure; Either is for two valid types\n4. **Option for nullable fields, not zero values** — `Option[string]` distinguishes \"absent\" from \"empty string\"; use plain `string` when empty string is a valid value\n5. **Chain, don't nest** — `result.Map(...).FlatMap(...).OrElse(default)` reads left-to-right; avoid nested if\u002Felse patterns when monadic chaining is cleaner\n6. **Use sub-package pipes for multi-step type transformations** — when 3+ steps each change the type, `option.Pipe3(...)` is more readable than nested function calls\n\nFor advanced types (Future, IO, Task, State), see [Advanced Types Reference](.\u002Freferences\u002Fadvanced-types.md).\n\nIf you encounter a bug or unexpected behavior in samber\u002Fmo, open an issue at \u003Chttps:\u002F\u002Fgithub.com\u002Fsamber\u002Fmo\u002Fissues>.\n\n## Cross-References\n\n- -> See `samber\u002Fcc-skills-golang@golang-samber-lo` skill for functional collection transforms (Map, Filter, Reduce on slices) that compose with mo types\n- -> See `samber\u002Fcc-skills-golang@golang-error-handling` skill for idiomatic Go error handling patterns\n- -> See `samber\u002Fcc-skills-golang@golang-safety` skill for nil-safety and defensive Go coding\n- -> See `samber\u002Fcc-skills-golang@golang-database` skill for database access patterns\n- -> See `samber\u002Fcc-skills-golang@golang-design-patterns` skill for functional options and other Go patterns\n","**Persona:** You are a Go engineer bringing functional programming safety to Go. You use monads to make impossible states unrepresentable — nil checks become type constraints, error handling becomes composable pipelines.\n\n**Thinking mode:** Use `ultrathink` when designing multi-step Option\u002FResult\u002FEither pipelines. Wrong type choice creates unnecessary wrapping\u002Funwrapping that defeats the purpose of monads.\n\n# samber\u002Fmo — Monads and Functional Abstractions for Go\n\nGo 1.18+ library providing type-safe monadic types with zero dependencies. Inspired by Scala, Rust, and fp-ts.\n\n**Official Resources:**\n\n- [pkg.go.dev\u002Fgithub.com\u002Fsamber\u002Fmo](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fsamber\u002Fmo)\n- [github.com\u002Fsamber\u002Fmo](https:\u002F\u002Fgithub.com\u002Fsamber\u002Fmo)\n\nThis skill is not exhaustive. Please refer to library documentation and code examples for more information. For Go package docs, symbols, versions, importers, and known vulnerabilities, → See `samber\u002Fcc-skills-golang@golang-pkg-go-dev` skill (`godig`) — prefer it over Context7 for Go package facts. To navigate this library's usage in your own code (definitions, call sites, diagnostics), → See `samber\u002Fcc-skills-golang@golang-gopls` skill (`gopls`). Context7 remains a fallback for docs not indexed on pkg.go.dev.\n\n```bash\ngo get github.com\u002Fsamber\u002Fmo\n```\n\nFor an introduction to functional programming concepts and why monads are valuable in Go, see [Monads Guide](.\u002Freferences\u002Fmonads-guide.md).\n\n## Core Types at a Glance\n\n| Type | Purpose | Think of it as... |\n| --- | --- | --- |\n| `Option[T]` | Value that may be absent | Rust's `Option`, Java's `Optional` |\n| `Result[T]` | Operation that may fail | Rust's `Result\u003CT, E>`, replaces `(T, error)` |\n| `Either[L, R]` | Value of one of two types | Scala's `Either`, TypeScript discriminated union |\n| `EitherX[L, R]` | Value of one of X types | Scala's `Either`, TypeScript discriminated union |\n| `Future[T]` | Async value not yet available | JavaScript `Promise` |\n| `IO[T]` | Lazy synchronous side effect | Haskell's `IO` |\n| `Task[T]` | Lazy async computation | fp-ts `Task` |\n| `State[S, A]` | Stateful computation | Haskell's `State` monad |\n\n## Option[T] — Nullable Values Without nil\n\nRepresents a value that is either present (`Some`) or absent (`None`). Eliminates nil pointer risks at the type level.\n\n```go\nimport \"github.com\u002Fsamber\u002Fmo\"\n\nname := mo.Some(\"Alice\")          \u002F\u002F Option[string] with value\nempty := mo.None[string]()        \u002F\u002F Option[string] without value\nfromPtr := mo.PointerToOption(ptr) \u002F\u002F nil pointer -> None\n\n\u002F\u002F Safe extraction\nname.OrElse(\"Anonymous\")  \u002F\u002F \"Alice\"\nempty.OrElse(\"Anonymous\")  \u002F\u002F \"Anonymous\"\n\n\u002F\u002F Transform if present, skip if absent\nupper := name.Map(func(s string) (string, bool) {\n    return strings.ToUpper(s), true\n})\n```\n\n**Key methods:** `Some`, `None`, `Get`, `MustGet`, `OrElse`, `OrEmpty`, `Map`, `FlatMap`, `Match`, `ForEach`, `ToPointer`, `IsPresent`, `IsAbsent`.\n\nOption implements `json.Marshaler\u002FUnmarshaler`, `sql.Scanner`, `driver.Valuer` — use it directly in JSON structs and database models.\n\nFor full API reference, see [Option Reference](.\u002Freferences\u002Foption.md).\n\n## Result[T] — Error Handling as Values\n\nRepresents success (`Ok`) or failure (`Err`). Equivalent to `Either[error, T]` but specialized for Go's error pattern.\n\n```go\n\u002F\u002F Wrap Go's (value, error) pattern\nresult := mo.TupleToResult(os.ReadFile(\"config.yaml\"))\n\n\u002F\u002F Same-type transform — errors short-circuit automatically\nupper := mo.Ok(\"hello\").Map(func(s string) (string, error) {\n    return strings.ToUpper(s), nil\n})\n\u002F\u002F Ok(\"HELLO\")\n\n\u002F\u002F Extract with fallback\nval := upper.OrElse(\"default\")\n```\n\n**Go limitation:** Direct methods (`.Map`, `.FlatMap`) cannot change the type parameter — `Result[T].Map` returns `Result[T]`, not `Result[U]`. Go methods cannot introduce new type parameters. For type-changing transforms (e.g. `Result[[]byte]` to `Result[Config]`), use sub-package functions or `mo.Do`:\n\n```go\nimport \"github.com\u002Fsamber\u002Fmo\u002Fresult\"\n\n\u002F\u002F Type-changing pipeline: []byte -> Config -> ValidConfig\nparsed := result.Pipe2(\n    mo.TupleToResult(os.ReadFile(\"config.yaml\")),\n    result.Map(func(data []byte) Config { return parseConfig(data) }),\n    result.FlatMap(func(cfg Config) mo.Result[ValidConfig] { return validate(cfg) }),\n)\n```\n\n**Key methods:** `Ok`, `Err`, `Errf`, `TupleToResult`, `Try`, `Get`, `MustGet`, `OrElse`, `Map`, `FlatMap`, `MapErr`, `Match`, `ForEach`, `ToEither`, `IsOk`, `IsError`.\n\nFor full API reference, see [Result Reference](.\u002Freferences\u002Fresult.md).\n\n## Either[L, R] — Discriminated Union of Two Types\n\nRepresents a value that is one of two possible types. Unlike Result, neither side implies success or failure — both are valid alternatives.\n\n```go\n\u002F\u002F API that returns either cached data or fresh data\nfunc fetchUser(id string) mo.Either[CachedUser, FreshUser] {\n    if cached, ok := cache.Get(id); ok {\n        return mo.Left[CachedUser, FreshUser](cached)\n    }\n    return mo.Right[CachedUser, FreshUser](db.Fetch(id))\n}\n\n\u002F\u002F Pattern match\nresult := fetchUser(\"user-123\")\nresult.Match(\n    func(cached CachedUser) mo.Either[CachedUser, FreshUser] { \u002F* use cached *\u002F },\n    func(fresh FreshUser) mo.Either[CachedUser, FreshUser] { \u002F* use fresh *\u002F },\n)\n```\n\n**When to use Either vs Result:** Use `Result[T]` when one path is an error. Use `Either[L, R]` when both paths are valid alternatives (cached vs fresh, left vs right, strategy A vs B).\n\n`Either3[T1, T2, T3]`, `Either4`, and `Either5` extend this to 3-5 type variants.\n\nFor full API reference, see [Either Reference](.\u002Freferences\u002Feither.md).\n\n## Do Notation — Imperative Style with Monadic Safety\n\n`mo.Do` wraps imperative code in a `Result`, catching panics from `MustGet()` calls:\n\n```go\nresult := mo.Do(func() int {\n    \u002F\u002F MustGet panics on None\u002FErr — Do catches it as Result error\n    a := mo.Some(21).MustGet()\n    b := mo.Ok(2).MustGet()\n    return a * b  \u002F\u002F 42\n})\n\u002F\u002F result is Ok(42)\n\nresult := mo.Do(func() int {\n    val := mo.None[int]().MustGet()  \u002F\u002F panics\n    return val\n})\n\u002F\u002F result is Err(\"no such element\")\n```\n\nDo notation bridges imperative Go style with monadic safety — write straight-line code, get automatic error propagation.\n\n## Pipeline Sub-Packages vs Direct Chaining\n\nsamber\u002Fmo provides two ways to compose operations:\n\n**Direct methods** (`.Map`, `.FlatMap`) — work when the output type equals the input type:\n\n```go\nopt := mo.Some(42)\ndoubled := opt.Map(func(v int) (int, bool) {\n    return v * 2, true\n})  \u002F\u002F Option[int]\n```\n\n**Sub-package functions** (`option.Map`, `result.Map`) — required when the output type differs from input:\n\n```go\nimport \"github.com\u002Fsamber\u002Fmo\u002Foption\"\n\n\u002F\u002F int -> string type change: use sub-package Map\nstrOpt := option.Map(func(v int) string {\n    return fmt.Sprintf(\"value: %d\", v)\n})(mo.Some(42))  \u002F\u002F Option[string]\n```\n\n**Pipe functions** (`option.Pipe3`, `result.Pipe3`) — chain multiple type-changing transformations readably:\n\n```go\nimport \"github.com\u002Fsamber\u002Fmo\u002Foption\"\n\nresult := option.Pipe3(\n    mo.Some(42),\n    option.Map(func(v int) string { return strconv.Itoa(v) }),\n    option.Map(func(s string) []byte { return []byte(s) }),\n    option.FlatMap(func(b []byte) mo.Option[string] {\n        if len(b) > 0 { return mo.Some(string(b)) }\n        return mo.None[string]()\n    }),\n)\n```\n\n**Rule of thumb:** Use direct methods for same-type transforms. Use sub-package functions + pipes when types change across steps.\n\nFor detailed pipeline API reference, see [Pipelines Reference](.\u002Freferences\u002Fpipelines.md).\n\n## Common Patterns\n\n### JSON API responses with Option\n\n```go\ntype UserResponse struct {\n    Name     string            `json:\"name\"`\n    Nickname mo.Option[string] `json:\"nickname\"`  \u002F\u002F omits null gracefully\n    Bio      mo.Option[string] `json:\"bio\"`\n}\n```\n\n### Database nullable columns\n\n```go\ntype User struct {\n    ID       int\n    Email    string\n    Phone    mo.Option[string]  \u002F\u002F implements sql.Scanner + driver.Valuer\n}\n\nerr := row.Scan(&u.ID, &u.Email, &u.Phone)\n```\n\n### Wrapping existing Go APIs\n\n```go\n\u002F\u002F Convert map lookup to Option\nfunc MapGet[K comparable, V any](m map[K]V, key K) mo.Option[V] {\n    return mo.TupleToOption(m[key])  \u002F\u002F m[key] returns (V, bool)\n}\n```\n\n### Uniform extraction with Fold\n\n`mo.Fold` works uniformly across Option, Result, and Either via the `Foldable` interface:\n\n```go\nstr := mo.Fold[error, int, string](\n    mo.Ok(42),  \u002F\u002F works with Option, Result, or Either\n    func(v int) string { return fmt.Sprintf(\"got %d\", v) },\n    func(err error) string { return \"failed\" },\n)\n\u002F\u002F \"got 42\"\n```\n\n## Best Practices\n\n1. **Prefer `OrElse` over `MustGet`** — `MustGet` panics on absent\u002Ferror values; use it only inside `mo.Do` blocks where panics are caught, or when you are certain the value exists\n2. **Use `TupleToResult` at API boundaries** — convert Go's `(T, error)` to `Result[T]` at the boundary, then chain with `Map`\u002F`FlatMap` inside your domain logic\n3. **Use `Result[T]` for errors, `Either[L, R]` for alternatives** — Result is specialized for success\u002Ffailure; Either is for two valid types\n4. **Option for nullable fields, not zero values** — `Option[string]` distinguishes \"absent\" from \"empty string\"; use plain `string` when empty string is a valid value\n5. **Chain, don't nest** — `result.Map(...).FlatMap(...).OrElse(default)` reads left-to-right; avoid nested if\u002Felse patterns when monadic chaining is cleaner\n6. **Use sub-package pipes for multi-step type transformations** — when 3+ steps each change the type, `option.Pipe3(...)` is more readable than nested function calls\n\nFor advanced types (Future, IO, Task, State), see [Advanced Types Reference](.\u002Freferences\u002Fadvanced-types.md).\n\nIf you encounter a bug or unexpected behavior in samber\u002Fmo, open an issue at \u003Chttps:\u002F\u002Fgithub.com\u002Fsamber\u002Fmo\u002Fissues>.\n\n## Cross-References\n\n- -> See `samber\u002Fcc-skills-golang@golang-samber-lo` skill for functional collection transforms (Map, Filter, Reduce on slices) that compose with mo types\n- -> See `samber\u002Fcc-skills-golang@golang-error-handling` skill for idiomatic Go error handling patterns\n- -> See `samber\u002Fcc-skills-golang@golang-safety` skill for nil-safety and defensive Go coding\n- -> See `samber\u002Fcc-skills-golang@golang-database` skill for database access patterns\n- -> See `samber\u002Fcc-skills-golang@golang-design-patterns` skill for functional options and other Go patterns\n",{"name":5,"license":15,"metadata":54,"description":7,"allowed-tools":65,"compatibility":66,"user-invocable":67},{"author":55,"version":56,"openclaw":57},"samber","1.0.7",{"emoji":58,"install":59,"homepage":60,"requires":61,"skill-library-version":64},"🎭",[],"https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang",{"bins":62},[63],"go","1.16.0","Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch mcp__context7__resolve-library-id mcp__context7__query-docs AskUserQuestion Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__*","Designed for Claude Code or similar AI coding agents, and for projects using Golang.",true,"claude\u002Finstall-gsd-build-foQdV","d86cd127f527124b5fd0fd0bc679a4d79b7d01d7",".agents\u002Fskills\u002Fgolang-samber-mo","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik","https:\u002F\u002Fnorvik-orpin.vercel.app","https:\u002F\u002Fgithub.com\u002Fpattanation","2026-07-17 11:17:04",{"source":8,"skillName":5,"commands":76,"prompt":86,"zipAvailable":67},[77,80,83],{"tool":78,"command":79},"npx","npx skills add pattanation\u002FNorvik --skill golang-samber-mo",{"tool":81,"command":82},"bunx","bunx skills add pattanation\u002FNorvik --skill golang-samber-mo",{"tool":84,"command":85},"pnpm","pnpm dlx skills add pattanation\u002FNorvik --skill golang-samber-mo","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fgolang-samber-mo\u002FSKILL.md",[88,94,98,102,106,110,114],{"path":89,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":93},"evals\u002Fevals.json","REFERENCE","参考文档",23740,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fgolang-samber-mo\u002Fevals\u002Fevals.json",{"path":95,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Fadvanced-types.md",7520,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fgolang-samber-mo\u002Freferences\u002Fadvanced-types.md",{"path":99,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":100,"sourceHtmlUrl":101},"references\u002Feither.md",4887,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fgolang-samber-mo\u002Freferences\u002Feither.md",{"path":103,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":104,"sourceHtmlUrl":105},"references\u002Fmonads-guide.md",6897,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fgolang-samber-mo\u002Freferences\u002Fmonads-guide.md",{"path":107,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":108,"sourceHtmlUrl":109},"references\u002Foption.md",4490,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fgolang-samber-mo\u002Freferences\u002Foption.md",{"path":111,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":112,"sourceHtmlUrl":113},"references\u002Fpipelines.md",5317,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fgolang-samber-mo\u002Freferences\u002Fpipelines.md",{"path":115,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":116,"sourceHtmlUrl":117},"references\u002Fresult.md",3664,"https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fgolang-samber-mo\u002Freferences\u002Fresult.md",[119,128,135,142,174,200],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":127},"01M73Z1NPMJ667E0DSPBS9FH0B","jetson-set-target","Switch the active Jetson target-platform pointer to an existing profile YAML. Use before customize\u002Fbuild\u002Fflash to change target; not for authoring profiles — use jetson-init-target instead.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fjetson-set-target\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":127},"01M73YC29YWGCW521P7B0NM3HQ","earth2studio-data-fetch","Fetch weather\u002Fclimate data via Earth2Studio data sources for specific variables and times. Do NOT use for inference pipelines, model discovery, or installation.","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fearth2studio-data-fetch\u002FSKILL.md",[],[],{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":127},"01M73YBNHMHFDFP83MAVGQQ92N","earth2studio-create-datasource","Create and validate Earth2Studio data source wrappers (DataSource, ForecastSource, DataFrameSource, ForecastFrameSource) from remote stores. Do NOT use for fetching data with existing sources, model inference, or installation tasks.","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fearth2studio-create-datasource\u002FSKILL.md",[],[],{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":146,"sourceHtmlUrl":147,"categories":148,"keywords":155,"publishedAt":173},"01M71QDV4DM8T19HEHWATEF1K4","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[149,152],{"categoryNo":150,"categoryName":151,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":153,"categoryName":154,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",[156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172],"webapp","testing","webapp testing","local","screenshots","for","applications","browser","ui","behavior","web","playwright","with","frontend","debugging","toolkit","logs","2026-11-10 13:02:02",{"skillNo":175,"name":176,"nameZh":6,"description":177,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":178,"sourceHtmlUrl":179,"categories":180,"keywords":182,"publishedAt":173},"01M71QDH2GGMXGA9105C9W1N7B","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fweb-artifacts-builder\u002FSKILL.md",[181],{"categoryNo":153,"categoryName":154,"taxonomyType":21,"taxonomyTypeDesc":22},[183,166,184,185,186,187,188,189,190,191,192,193,161,194,195,169,196,197,198,199],"web artifacts builder","artifacts","artifacts builder","builder","multi","state","routing","state management","react","single-file","css","Tailwind","ui components","single","use","file","components",{"skillNo":201,"name":202,"nameZh":6,"description":203,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":204,"sourceHtmlUrl":205,"categories":206,"keywords":208,"publishedAt":173},"01M71QD9T2XC3EWMQNN9ACNWQ1","vueuse-functions","Apply VueUse composables where appropriate to build concise, maintainable Vue.js \u002F Nuxt features.","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fvueuse-functions\u002FLICENSE.md","https:\u002F\u002Fgithub.com\u002Fpattanation\u002FNorvik\u002Fblob\u002Fclaude\u002Finstall-gsd-build-foQdV\u002F.agents\u002Fskills\u002Fvueuse-functions\u002FSKILL.md",[207],{"categoryNo":153,"categoryName":154,"taxonomyType":21,"taxonomyTypeDesc":22},[209,210,211,212,213,214,215,216,217,218,219,220,221,222],"vueuse","vueuse functions","functions","composables","project","nuxt","apply","github","concise","build","https","features","vue","js"]