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.

remove `DeliveryScheme`

See original GitHub issue

I’m raising this issue now, since we’re talking about moving the parser package into its own library, and DeliveryScheme is part of that package. But the presence of this class throughout the Sangria code has been an annoyance.

Apparently Oleg got the idea from the Parboiled2 project. It was one of his earliest commits, and I suspect that it was a premature design choice. The original idea in Parboiled2 seems to be of dubious value itself.

So my suggestion is that, in the name of simplifying the code, that we return a Try where needed. This can easily be turned into an Either or a thrown exception.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
performantdatacommented, Nov 4, 2021

Code like this isn’t especially clear in the purpose of scheme:

def parse(input: String, config: ParserConfig = ParserConfig.default)(implicit
    scheme: DeliveryScheme[ast.Document]): scheme.Result =
  parse(ParserInput(input), config)(scheme)

when all it really means is

def parse(input: String, config: ParserConfig = ParserConfig.default): Try[ast.Document] =
  parse(ParserInput(input), config)(scheme)

It also makes code like this more opaque than need be:

case Success(res) if res.values.nonEmpty => scheme.success(res.values.head)
case Success(res) =>
  scheme.failure(
    new IllegalArgumentException("Input document does not contain any value definitions."))
case Failure(e: ParseError) => scheme.failure(SyntaxError(parser, input, e))
case Failure(e) => scheme.failure(e)
0reactions
performantdatacommented, Nov 13, 2021

OK let’s go for it.

I think you have everything you need already. I’m going to base the next PRs, for #466, on these.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Avoid package delivery schemes
The scheme usually asks you to clink a link to verify your personal information or supply payment information through a text or email....
Read more >
Delete a scheme - Product Documentation - NetApp
You can delete a scheme that you created from OnCommand Workflow Automation (WFA) if you no longer require it.
Read more >
Delhi govt drops name of ration delivery scheme, Centre ...
The Delhi Cabinet headed by chief minister Arvind Kejriwal on Wednesday approved the removal of the name 'Mukhyamantri Ghar Ghar Ration Yojana' ...
Read more >
Manage machine catalogs | Citrix Virtual Apps and ...
In other words, the delivery group does not contain machines from the catalog. To delete a catalog: Select Machine Catalogs in the Studio ......
Read more >
Remove all duplicates from a list in scheme
Write a SCHEME function remove-duplicates that removes all duplicates from a list. (Hint: you might start by defining a function which ...
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