Permalink
Browse files

54.1.1: Adjust signature of Tables#allTables

(Merge branch 'alissapajer-tables')
  • Loading branch information...
wemrysi committed Jul 21, 2018
2 parents 8468c0a + c7b6d3e commit 81fde90787ca2475fd950070f822ce6e9373e8fd
@@ -30,7 +30,7 @@ import scalaz.\/
trait Tables[F[_], I, Q, D] {
import TableError.{CreationError, ExistenceError, ModificationError, PrePreparationError}
- def allTables: F[Stream[F, (I, Table[Q], PreparationStatus)]]
+ def allTables: Stream[F, (I, Table[Q], PreparationStatus)]
def table(tableId: I): F[ExistenceError[I] \/ Table[Q]]
@@ -40,12 +40,12 @@ final class MockTables[F[_]: Monad: MockTables.TablesMockState]
val store = MonadState_[F, IMap[UUID, MockTable]]
- def allTables: F[Stream[F, (UUID, Table[String], PreparationStatus)]] =
- store.get.map { s =>
+ def allTables: Stream[F, (UUID, Table[String], PreparationStatus)] =
+ Stream.force(store.get.map { s =>
Stream.emits(s.toList.map {
case (uuid, MockTable(table, status)) => (uuid, table, status)
}).covary[F]
- }
+ })
def table(tableId: UUID): F[ExistenceError[UUID] \/ Table[String]] =
store.gets(_.lookup(tableId)
@@ -159,8 +159,7 @@ abstract class TablesSpec[F[_]: Monad: Sync, I: Equal: Show, Q: Equal: Show, D]
for {
errorOrId1 <- tables.createTable(table1)
errorOrId2 <- tables.createTable(table2)
- resultStream <- tables.allTables
- result <- resultStream.compile.toList
+ result <- tables.allTables.compile.toList
} yield {
(result.map(_._2) must_= List(table1, table2)) or
(result.map(_._2) must_= List(table2, table1))
View
@@ -1 +1 @@
-version in ThisBuild := "54.1.0"
+version in ThisBuild := "54.1.1"

0 comments on commit 81fde90

Please sign in to comment.