-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add various streaming transducers #282
Conversation
5ecab7c
to
dbbcb90
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure what it does without docs, but left some small Scala-specific comments and will stay tuned for updates 😄
for { | ||
acc <- loop(left, acc) | ||
acc <- loop(right, acc) | ||
} yield acc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for { | |
acc <- loop(left, acc) | |
acc <- loop(right, acc) | |
} yield acc | |
loop(left, acc).flatMap(loop(right, _)) |
I find the for-comprehension with re-use of acc
unnecessarily hard to read and it has the tail map
problem on Scala 3 IIRC.
m.lift(from) | ||
} | ||
|
||
implicit object MapTable extends Table[Map] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Map <: MapOps <: PartialFunction
, so we might run into ambiguous implicit here. Maybe move the partial function instance into a low priority trait to be safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure what it does without docs, but left some small Scala-specific comments and will stay tuned for updates smile
Documentation will come. This is a first basic building block for higher-level features. More transducers to come soon, I hope, especially SSTs, which will allow for parsing. This STT can be the base for streaming query languages on tree structures.
f9ae1b9
to
2c01c74
Compare
10bd29a
to
76d0de3
Compare
I decided to merge this PR without support for SST because:
|
76d0de3
to
691db8a
Compare
9447024
to
092cde8
Compare
7a03e85
to
2950896
Compare
The copyless natures is ensured by using a controlled environment update language, without losing expressiveness. This execution model emits as soon as possible, and requires transducers to be total, otherwise the stream fails. This also ensures that everything is emitted up to the first error. The STT model can be used to implement query languages on tree structures and some transformations.
By abstracting the transition table type with a dedicated typeclass, one can create symbolic transducers, which can come in handy to handle infinite input alphabets.
The streaming FST are simulated and try to emit as early as possible when there is no ambiguity.
This index can be used to implement efficient lookup table in later use.
2950896
to
c091b90
Compare
Streaming String Transducers which can be used for matching inputs and emitting some output as soon as possible