propensive / gossamer Goto Github PK
View Code? Open in Web Editor NEWLightweight and typesafe strings in Scala
Home Page: https://propensive.com/gossamer/
License: Apache License 2.0
Lightweight and typesafe strings in Scala
Home Page: https://propensive.com/gossamer/
License: Apache License 2.0
import nettlesome.*
import gossamer.*
import contingency.*
import errorHandlers.throwUnsafely
println("hello")
println(t"[email protected]")
//println(EmailAddress.parse(t"[email protected]"))
Scala version being used is 3.5.0-RC1
On scastie, it doesn't produce any output
https://scastie.scala-lang.org/bRgE1hMhTsysAgTxj8A0vA
On local sbt project, it produces this error:
[error] -- Error: /Users/propensive/work/gossamer/src/core/t.scala:29:57 ---------------
[error] undefined: gossamer.Interpolation.T.expand # -1: TermRef(TermRef(TermRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),object gossamer),Interpolation),object T),expand) at typer
This would allow Contextual to use the Text
type in its API, and all its dependent projects.
Currently, Text
values must be converted to String
s and matched against String
patterns. Instead, it should be possible to match on them directly against patterns of the form, t"foo"
.
There's a bug in Scala's test coverage code which tries to cast an array to an immutable.Seq
. Hopefully there's a way to avoid it.
This should be an opaque wrapper around StringBuilder
, with typesafe methods.
Use a Cuttable
typeclass parameterized on the type being cut, and the type used to do the cutting.
Gossamer has comprehensive text manipulation methods that work on Text
instances, but not on other textlike types, such as in Escapade.
The current implementation is simplistic, and reuses Java's DecimalFormat
(which it probably doesn't need to).
Currently, sorting is done using the default Ordering[String]
instance. But it should be locale-dependent, and the locale should be made explicit.
For example, for French, we currently need to write something like:
val collator = Collator.getInstance(Locale.FRANCE)
given Ordering[String] = collator.compare(_, _)
The fluffy white clouds aren't distinctive enough.
The "fallback" of using toString
seems to be applied when it ought to generically derive the appropriate typeclass instance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.