question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

StaticFile.fromFile has too many overloads

See original GitHub issue

We abused overloading on StaticFile.fromFile. Look at reducing overloads, either through default parameters or different names for the functions. Deprecation is good if we’re changing public API in a source incompatible way, but if we start now, we can get it cleaned up for 1.0.

Overlaps a bit with #2071, so communicate if you happen to be picking this up at a hack night.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
rossabakercommented, Oct 7, 2018

I thought that was something that could be handled by converting to an algebra:

trait Static[F] {
  def calcEtag(file: File): F[String]
  def fromFile(f: File, ..., etagCalculator = calcEtag _): OptionT[F, Response[F]]
}
1reaction
rossabakercommented, Oct 3, 2018

Yeah, it’s already an effect, so we can get the length and flatMap it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Static class methods overloads use cause a compiler error
When the compiler resolves the overload that is to be called, it analyzes the parameter types and their relations. E.g. you could have...
Read more >
http4s/http4s - Gitter
Aug 17 2018 16:02 UTC. We have a maze of overloads in StaticFile.fromFile that are worth reconsidering. Christopher Davenport. @ChristopherDavenport.
Read more >
Http4s vs Finch vs Akka-http vs - Reddit
Hi! I'm starting a new project, and I torn between all the http libraries. I've used Play for 3 years, and it's time...
Read more >
Static Files - http4s
Usually, if you fetch a file via HTTP, it ships with an ETag. ... Http4s provides a few helpers to handle ETags for...
Read more >
FAQ - Apple Open Source
Since August, 2005, many of the existing CVS resources have been centralized on ... It is used in too many different ways in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found