This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import Column, ForeignKey, MetaData, String, Table | |
metadata = MetaData() | |
artists = Table( | |
"artists", metadata, | |
Column('uri', String(32), primary_key=True), | |
Column('name', String(100), nullable=False) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7DMveApC7UnC2NPfPvlHSU 23fqKkggKUBHNkbKtXEls4 1HBjj22wzbscIZ9sEb5dyf | |
23fqKkggKUBHNkbKtXEls4 6nxWCVXbOlEVRexSbLsTer 738wLrAtLtCtFOLvQBXOXp 69GGBxA162lTqCwzJG5jLp 7CajNmpbOovFoOoasH2HaY 2qxJFvFYMEDqd7ui6kSAcq 1HBjj22wzbscIZ9sEb5dyf 3t5xRXzsuZmMDkQzgOX35S 21mKp7DqtSNHhCAU2ugvUw 540vIaP2JwjQb9dm3aArA4 60d24wfXkVzDSfLS6hyCjZ 4sTQVOfp9vEMCemLw50sbu 4YXycRbyyAE0wozTk7QMEq 7DMveApC7UnC2NPfPvlHSU | |
45eNHdiiabvmbp4erw26rg 6fcTRFpz0yH79qSKfof7lp 2ZRQcIgzPCVaT9XKhXZIzh 64KEffDW9EtZ1y2vBYgq8T 521qvhdobR0GzhvU6TFw76 0jNDKefhfSbLR9sFvcPLHo 67qogtRNI0GjUr8PlaG6Zh | |
0L8ExT028jH3ddEcZwqJJ5 7jy3rLJdDQY21OgRLCZ9sD 2DaxqgrOhkeH0fpeiQq2f4 6olE6TJLqED3rqDCT0FyPh 3jOstUTkEu2JkjvRdBA5Gu 0EdvGhlC1FkGItLOWQzG4J 7oPftvlwr6VrsViSDV7fJY | |
2wY79sveU1sp5g7SokKOiI 6eUKZXaKkcviH0Ku9w2n3V 66CXWjxzNUsdJxJ2JdwvnR 04gDigrS5kc9YWfZHwBETP 4IWBUUAFIplrNtaOHcJPRM 4EzkuveR9pLvDVFNx6foYD 2FXC3k01G6Gw61bmprjgqS 4phGZZrJZRo4ElhRtViYdl 5y2Xq6xcjJb2jVM54GHK3t 5xKp3UyavIBUsGy3DQdXeF 1uNFoZAHBGtllmzznpCI3s 4dpARuHxo51G3z768sgnrY 2WX2uTcsvV5OnS0inACecP | |
7bXgB6jMjp9A |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Example { | |
def doStuff(partition: String, itemId: String): State[ExampleState, Seq[Item]] = | |
for { | |
_ <- getOrCreateItem(partition, itemId) | |
_ <- setPending(partition, itemId) | |
pending <- unconsPending(partition) | |
} yield pending | |
private def getOrCreateItem(partition: String, item: String): State[ExampleState, Item] = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Example { | |
def doStuff(partition: String, itemId: String): State[ExampleState, Seq[Item]] = | |
for { | |
_ <- getOrCreateItem(partition, itemId) | |
_ <- setPending(partition, itemId) | |
pending <- unconsPending(partition) | |
} yield pending | |
private def getOrCreateItem(partition: String, item: String): State[ExampleState, Item] = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit class RichLens[S, A] { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit class RichLens[S, A] { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit class RichLens[S, A] { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit class RichLens[S, A] { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Main extends App { | |
println("hello world") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package object consume { | |
implicit class RichStream[F[_], A](s: Stream[F, A]) { | |
def consumeUntil(f: A => Boolean) | |
(implicit C: Stream.Compiler[F, F], ME: MonadError[F, Throwable]): F[(Vector[A], Stream[F, A])] = { | |
consumeUntilAs(f, _.some) | |
} | |
def consumeUntilAs[B](f: A => Boolean, g: A => Option[B]) |
NewerOlder