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.

Is RefType a Prism in disguise?

See original GitHub issue

The main operations of RefType are unwrap and refine if we ignore the unsafe operations and the macros. unwrap has type F[T, P] => T and refine has type T => Either[String, F[T, P]]. If we set type S = F[T, P] and ignore the error message in Either, we get this pair of functions:

S => T
T => Option[S]

This looks similar to a Prism. I’d like to study lens libraries and Prism in more detail. Maybe we can borrow laws and concepts from the lens world and streamline RefType.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
julien-truffautcommented, Jan 4, 2017

You’re completely right. Forget what I said, we should be able to create a Prism for all refined type

1reaction
fthomascommented, Jan 4, 2017

Aha. But refined’s Xml predicate does not change a String to a scala.xml.Elem. It merely tags the source String without modifying it:

scala> "<div></div>": String Refined Xml
res0: eu.timepit.refined.api.Refined[String,eu.timepit.refined.string.Xml] = <div></div>

scala> res0.value
res1: String = <div></div>

scala.xml.XML.loadString is used in the Validate[String, Xml] instance only for checking that the source string is valid XML.

Read more comments on GitHub >

github_iconTop Results From Across the Web

openjfx/9-dev/rt: 904ac9ba4ddb
useRef = " + + refType); + + logInfo("prism.marlin.edges = " + + MarlinConst. ... +// The left side is just a matrix...
Read more >
Untitled
Opi nail polish costume? ... Transport aerien voiture, Oracle ref type, Northrop grumman rolling meadows ... Fate kaleid liner prisma illya animeultima!
Read more >
Untitled
Swithens saddlery, Animated series batman costume, Viron laivan pelikoneet, ... Kumkum 154 episode, Prism favia coral care, Vagotomy pyloroplasty wiki, ...
Read more >
Moore v. Hartman | Cases - Westlaw
The prism through which the plaintiff is viewing the initiation of the ... [ ] was a disguise for William Spartin's influence within...
Read more >
What is the right place for the system profile folder in windows xp ...
Prism.Order Prism.printallocs. Prism.RefType. Prism.showcull ... Malicious software can disguise itself also seems to be a legitimate process of XP or he ...
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