fsprojects / fsprojects/FsHttp

Implement Request/Response.ToString() and use print functions

Open
#71 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
F#
Stars
498
Forks
41
PR merge metrics
No merged PRs in 30d

Description

print functions for the FsHttp representation of Request and Response records are currently implemented in Print.fs, which export Request.print () and Response.print (). Those functions are only used when FsHttp is used in FSI (see FsiInit.fs).

It would be nice (e.g. for debugging purpose or in non-FSI environments) having a ToString() overload per-default in Response and Request that output similar information as when using print(). Since the print function implementation is long, it should not "pollute" the definition of Request and Response (which are defined in Domain.fs) and stay separated from definitions in Domain.fs.

What could be a good way of bringing together

  • Print functions reside in a separate module
  • ToString implementation for Response and Request generalls using the ones in Print module
  • Slightly different ToString / print implementations for non-FSI and FSI, which is: In non-FSI environments, any ToString() implementation should not cause side effects (e.g. like reading from Request/Response streams).

?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read Print.fs and the Request/Response definitions in Domain.fs, then inspect FsiInit.fs to understand how Request.print() and Response.print() are used. Define the desired separation between FSI printing and side-effect-free ToString() behavior; done means both records have default ToString() output while non-FSI formatting does not read request or response streams.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.