Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. def search(request: SearchRequest): IO[CSearchPage] = {
  2. val lines = csearch(request)
  3. lines.flatMap(x =>
  4. x match {
  5. case Left(value) => for {
  6. result <- Stream
  7. .emits(value)
  8. .through(SnippetsGrouper.groupLines(snippetConfig))
  9. .drop(snippetConfig.pageSize * (request.page - 1))
  10. .take(snippetConfig.pageSize)
  11. .evalMap(createSnippet)
  12. .through(groupByPackage)
  13. .compile
  14. .toList
  15. } yield CSearchPage(result.sortBy(_.pack.name), value.size, "")
  16. case Right(value) => CSearchPage(?, ?, value)
  17. }
  18. )
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement