Scala.js support
See original GitHub issueHi,
First of all, thanks a lot for all the work youāve put into this library! I really like it so far š¤©
I decided to feature it in my upcoming book, you can see the corresponding Pull Request.
The Trading application where itās being used cross-compiles its domain
module to JS/JVM, so I was wondering if Scala.js support was planned at some point? For now, I got away by having two different implementations of the Symbol
datatype, one for each platform.
A few other things that would be awesome to add would be Catsā typeclass instances support. I added the ones I needed in my PR, but I guess itās so common, this could land in the Cats module (happy to contribute the initial ones!).
import cats.*
import io.github.iltotore.iron.*
object IronCatsInstances:
inline given [A, B](using inline ev: Eq[A]): Eq[A :| B] = ev.asInstanceOf[Eq[A :| B]]
inline given [A, B](using inline ev: Order[A]): Order[A :| B] = ev.asInstanceOf[Order[A :| B]]
inline given [A, B](using inline ev: Show[A]): Show[A :| B] = ev.asInstanceOf[Show[A :| B]]
- Rename modulesā package
- Add Catsā typeclass instances
- Add ScalaJS and ScalaNative support
Issue Analytics
- State:
- Created 10 months ago
- Comments:12 (10 by maintainers)
Top Results From Across the Web
Scala.js
Excellent editor support. With Scala.js, typos and type-errors are immediately caught and shown to you in your editor, without even needing to compile...
Read more >Implementing Scala.js Support for Scala 3
Supporting Scala.js in Scala 3. Scala 3 has an entirely new compiler codebase, reimplemented from scratch. While many internal concepts such asĀ ...
Read more >Hands-on Scala.js - Haoyi's Programming Blog
That lets you write Scala code that you can run in a web browser, or other environments (Chrome plugins, Node.js, etc.) where Javascript...
Read more >Scala.JS - GitHub
Scala.js, the Scala to JavaScript compiler. Contribute to scala-js/scala-js development by creating an account on GitHub.
Read more >How to use ScalaJS with Scala3 ? : r/scala - Reddit
r/scala icon Go to scala ... Any playground for Scala.js with Scala 2, then set scalaVersion to 3.x. ... Advice on Web Scraper...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I should be available this weekend. And even if Iām not, nothing prevents you to submit the PR and Iāll check it as fast as possible.
I would just prefer to have two separated PRs since itās about two different changes: package renaming and typeclass instances.
Update about the package naming discussion: since it doesnāt seem to disturb the asked users, and since similar projects like Refined use this scheme (aka importing
eu.timepit.refined._
+eu.timepit.refined.cats
) without complaint from their users, removing the āSupportā suffix from compatibility packages (i.ecatsSupport
->cats
) seems to be the best solution (right now).Actually, to quote Refined again, the project uses the
_root_
import in its ācatsā module.