- 購入者は、自動販売機に、料金を投下し飲料を購入できる。
- おつりがある場合は自動販売機から払い出される。
- 飲料毎に料金が違うものとする。
- 売り切れの飲料は購入できない。
- 管理者は、自動販売機内の料金を回収できる。
- 管理者は、自動販売機内の飲料在庫を確認できる。
- 管理者は、自動販売機内の飲料在庫を追加できる。
- 管理者は、自動販売機内の飲料に対して価格を設定できる。
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
import org.scalacheck.Gen | |
trait UnicodeGenSupport { | |
// 文字コード範囲 | |
private val unicodeRange: Seq[Char] = Character.MIN_VALUE to Character.MAX_VALUE | |
// 上位サロゲート領域 | |
private val unicodeHighSurrogatePlane: Seq[Char] = Character.MIN_HIGH_SURROGATE to Character.MAX_HIGH_SURROGATE | |
// 下位サロゲート領域 |
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 Base { | |
sealed trait State extends FSMState | |
case object Stopped extends State { | |
override def identifier: String = "Stopped" | |
} | |
case object Started extends State { |
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
import java.util.UUID | |
case class Dept(id: UUID, name: String) extends Entity[UUID] | |
case class ZipCode(first: String, second: String) | |
object ZipCode { | |
def fromString(value: String): ZipCode = { | |
val values = value.split("\\-") |
ちょー稼ぐ!!!
import scala.scalajs.js
import scala.scalajs.js.JSApp
import scala.scalajs.js.annotation.JSExport
@JSExport
object Main extends JSApp {
@JSExport
override def main(): Unit = {
インタープリタをトランポリン化できていないが、だいたいやりたいことができた。
Free[Command, Unit]ですが、Unit以外を選択する場合ってどんなユースケースなんだろうか?
case class Money(amount: Long, currency: Currency) {
def +(other: Money): Money = {
require(currency == other.currency)
copy(amount = this.amount + other.amount)
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
ebBundleTargetFiles in aws <<= Def.task { | |
val base = baseDirectory.value | |
val assemblyJarFile = (outputPath in assembly).value | |
Seq( | |
(base / "Dockerfile", "Dockerfile"), | |
(base / "Dockerrun.aws.json", "Dockerrun.aws.json"), | |
(assemblyJarFile, assemblyJarFile.name) | |
) | |
} |
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
"aws" : { | |
"cfnStackName": "test1" | |
"cfnStackParams" : { | |
"S3BucketName0" : "dmmy-test-00001", | |
"S3BucketName1" : "dmmy-test-00002" | |
} | |
} |
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
$ sbt aws::cfnStackCreateOrUpdateAndWait | |
[info] upload /Users/j5ik2o/sbt-aws/sbt-aws-cfn/src/sbt-test/sbt-aws-cfn/create-or-update-and-wait/aws/cfn/templates/S3.template to cfn-template/create-or-update-and-wait/create-or-update-and-wait-0.1-SNAPSHOT-20150525_185939.templete | |
[info] create stack request : stackName = test1, templateUrl = https://cfn-template.s3-ap-northeast-1.amazonaws.com/create-or-update-and-wait/create-or-update-and-wait-0.1-SNAPSHOT-20150525_185939.templete, capabilities = List(), stackParams = Map(S3BucketName1 -> dmmy-test-00002, S3BucketName0 -> dmmy-test-00001), tags = Map() | |
{StackId: arn:aws:cloudformation:ap-northeast-1:327747897717:stack/test1/c1fdf600-02c4-11e5-a322-506cf9a1c096} | |
[info] create stack requested : test1 / arn:aws:cloudformation:ap-northeast-1:327747897717:stack/test1/c1fdf600-02c4-11e5-a322-506cf9a1c096 | |
[info] status = CREATE_IN_PROGRESS | |
[info] status = CREATE_IN_PROGRESS | |
[info] status = CREATE_IN_PROGRESS | |
[info] status = CREATE_IN_PROGRESS | |
[info] status = CREATE_IN_P |
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
$ sbt aws::ebBuildBundle | |
[info] Updating {file:/Users/j5ik2o/sbt-aws/sbt-aws-eb/src/sbt-test/sbt-aws-eb/build-bundle/}build-bundle... | |
[info] Resolving org.fusesource.jansi#jansi;1.4 ... | |
[info] Done updating. | |
[info] Compiling 1 Scala source to /Users/j5ik2o/sbt-aws/sbt-aws-eb/src/sbt-test/sbt-aws-eb/build-bundle/target/scala-2.10/classes... | |
[info] Packaging /Users/j5ik2o/sbt-aws/sbt-aws-eb/src/sbt-test/sbt-aws-eb/build-bundle/target/scala-2.10/build-bundle_2.10-0.1-SNAPSHOT.jar ... | |
[info] Done packaging. | |
[info] created application-bundle: /Users/j5ik2o/sbt-aws/sbt-aws-eb/src/sbt-test/sbt-aws-eb/build-bundle/target/build-bundle-bundle.zip |