8000 Net module — `Http` → `Net.Http`, File-style interface · Issue #81 · kexhq/kex · GitHub
[go: up one dir, main page]

Skip to content

Net module — Http → Net.Http, File-style interface #81

Closed

Description

@akoskovacs

Summary

Rework networking under a Net namespace the way filesystem IO lives under FS.File, with Http as one member — and give the HTTP surface an FS.File-style typed interface.

Shape

Net.HTTP.get("https://example.com")
Net.HTTP.post(url, body: ..., headers: ...)
  • Move/rename the current Http surface to Net.HTTP
  • Rework the interface along the same lines as FS.File: typed errors (Result, not exceptions), consistent request/response records, no bare strings where a typed value exists
  • Room for the rest of the family later (Net.TCP, Net.UDP, Net.DNS) — the namespace is the point

Notes

Undecided whether this lands in 0.4.0 or later. The rename is cheap; the interface rework is the real cost.

Naming

Spelled Net.HTTP, not Net.Http: docs/language-spec.md now records that an
initialism in an uppercase name is written in full caps (IO, FS, ENV,
JSON, AST), each dot-separated module segment included. The future family
is likewise Net.TCP, Net.UDP, Net.DNS.

This makes the move the moment Http — currently the stdlib's only violation
of that rule — gets its correct spelling, so no separate rename issue is
needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0