Skip to content
This repository has been archived by the owner on Jul 29, 2021. It is now read-only.

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-adam committed Nov 22, 2019
1 parent 3ec9eb5 commit 7fb8916
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract class DisjunctionAPIState(data: UrlsWithThrowableList)(implicit d: Doma
val partitioned = set.partition(_.isRight)

val newWrappedUrls: WrappedUrlSet = partitioned._1
.flatMap(DisjunctionAPIState.htmlDToWrappedUrlSet)
.flatMap(DisjunctionAPIState.sourcePageDisjunctionToWrappedUrlSet)

val newThrowableList: ThrowableList = partitioned._2.toList
.flatMap(_.swap.toOption.toList)
Expand All @@ -26,6 +26,6 @@ abstract class DisjunctionAPIState(data: UrlsWithThrowableList)(implicit d: Doma
}

object DisjunctionAPIState {
val htmlDToWrappedUrlSet: SourcePageDisjunction => WrappedUrlSet =
val sourcePageDisjunctionToWrappedUrlSet: SourcePageDisjunction => WrappedUrlSet =
_.map(_.getWrappedUrlSet).toOption.toSet.flatten
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract class EitherAPIState(data: UrlsWithThrowableList)(implicit d: Domain) e
val partitioned = set.partition(_.isRight)

val newWrappedUrls: WrappedUrlSet = partitioned._1
.flatMap(EitherAPIState.htmlEitherToWrappedUrlSet)
.flatMap(EitherAPIState.sourcePageEitherToWrappedUrlSet)

val newThrowableList: ThrowableList = partitioned._2.toList
.flatMap(_.left.toOption.toList)
Expand All @@ -25,6 +25,6 @@ abstract class EitherAPIState(data: UrlsWithThrowableList)(implicit d: Domain) e
}

object EitherAPIState {
val htmlEitherToWrappedUrlSet: SourcePageEither => WrappedUrlSet =
val sourcePageEitherToWrappedUrlSet: SourcePageEither => WrappedUrlSet =
_.right.map(_.getWrappedUrlSet).right.toOption.toSet.flatten
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TryState(data: UrlsWithThrowableList)(implicit d: Domain) extends Abstract
val partitioned = set.partition(_.isSuccess)

val newWrappedUrls: WrappedUrlSet = partitioned._1
.flatMap(TryState.htmlTryToWrappedUrlSet)
.flatMap(TryState.sourcePageTryToWrappedUrlSet)

val newThrowableList: ThrowableList = partitioned._2.toList
.flatMap(_.failed.toOption.toList)
Expand All @@ -34,7 +34,7 @@ class TryState(data: UrlsWithThrowableList)(implicit d: Domain) extends Abstract

object TryState extends AbstractNextStateObject {

val htmlTryToWrappedUrlSet: SourcePageTry => WrappedUrlSet = _.map(_.getWrappedUrlSet).toOption.toSet.flatten
val sourcePageTryToWrappedUrlSet: SourcePageTry => WrappedUrlSet = _.map(_.getWrappedUrlSet).toOption.toSet.flatten

override def fromDomain(implicit d: Domain): AbstractNextState = new TryState(UrlsWithThrowableList.fromDomain)
}

0 comments on commit 7fb8916

Please sign in to comment.