Skip to content

Commit

Permalink
Merge branch 'develop' into feature/warn-unused
Browse files Browse the repository at this point in the history
  • Loading branch information
KisaragiEffective authored Dec 5, 2021
2 parents 7cdeb58 + aea16ce commit bfca01e
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/cache@v2
env:
cache-name: cache-build-dependencies
cache-version: v-5
cache-version: v-3
with:
# sbt等は$HOMEではなくユーザーディレクトリを見ているようで、
# GH Actionsでの ~ は /github/home/ に展開されるにもかかわらず
Expand All @@ -47,7 +47,7 @@ jobs:
uses: actions/cache@v2
env:
cache-name: cache-build
cache-version: v-5
cache-version: v-3
with:
path: |
target
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import sbt.Keys.baseDirectory

import java.io._

ThisBuild / scalaVersion := "2.13.7"
ThisBuild / scalaVersion := "2.13.1"
// ThisBuild / version はGitHub Actionsによって自動更新される。
// 次の行は ThisBuild / version := "(\d*)" の形式でなければならない。
ThisBuild / version := "19"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.github.unchama.seichiassist.subsystems.autosave.application

trait CanNotifySaves[F[_]] {
import simulacrum.typeclass

@typeclass trait CanNotifySaves[F[_]] {

def notify(message: String): F[Unit]

}

object CanNotifySaves {
def apply[F[_]: CanNotifySaves]: CanNotifySaves[F] = implicitly
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.github.unchama.seichiassist.subsystems.autosave.application

trait CanSaveWorlds[F[_]] extends AnyRef {
import simulacrum.typeclass

@typeclass trait CanSaveWorlds[F[_]] extends AnyRef {

val saveAllWorlds: F[Unit]

}

object CanSaveWorlds {
def apply[F[_]: CanSaveWorlds]: CanSaveWorlds[F] = implicitly
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.github.unchama.seichiassist.subsystems.dragonnighttime.application

trait Notifiable[F[_]] {
import simulacrum.typeclass

@typeclass trait Notifiable[F[_]] {
def notify(message: String): F[Unit]
}

object Notifiable {
def apply[F[_]: Notifiable]: Notifiable[F] = implicitly
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.github.unchama.seichiassist.subsystems.managedfly.application

import com.github.unchama.seichiassist.subsystems.managedfly.domain.{IdleStatus, PlayerFlyStatus, RemainingFlyDuration}
import simulacrum.typeclass

/**
* プレーヤーの飛行状態に`F`の文脈で干渉する手段を与える型クラスインスタンスのtrait。
*
* `F` は `Kleisli[G, Player, *]` の形をしていることを想定している。
*/
trait PlayerFlyStatusManipulation[F[_]] extends AnyRef {
@typeclass trait PlayerFlyStatusManipulation[F[_]] extends AnyRef {
/**
* 飛行に必要な経験値をプレーヤーが持っていることを保証するアクション。
* このアクションは [[PlayerExpNotEnough]] を `raiseError` してよい。
Expand Down Expand Up @@ -40,7 +41,3 @@ trait PlayerFlyStatusManipulation[F[_]] extends AnyRef {
*/
val sendNotificationsOnInterruption: InternalInterruption => F[Unit]
}

object PlayerFlyStatusManipulation {
def apply[F[_]: PlayerFlyStatusManipulation]: PlayerFlyStatusManipulation[F] = implicitly
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import cats.Functor
import cats.effect.Clock
import com.github.unchama.seichiassist.subsystems.seasonalevents.christmas.Christmas
import io.chrisdavenport.cats.effect.time.JavaTime
import simulacrum.typeclass

import java.time.ZoneId

trait ChristmasEventsAPI[F[_]] extends AnyRef {
@typeclass trait ChristmasEventsAPI[F[_]] extends AnyRef {

val isInEvent: F[Boolean]

Expand All @@ -24,10 +25,9 @@ object ChristmasEventsAPI {
.map(Christmas.isInEvent)
}

def apply[F[_] : ChristmasEventsAPI]: ChristmasEventsAPI[F] = implicitly
}

trait SeasonalEventsAPI[F[_]] extends AnyRef {
@typeclass trait SeasonalEventsAPI[F[_]] extends AnyRef {

implicit val christmasEventsAPI: ChristmasEventsAPI[F]

Expand All @@ -37,6 +37,4 @@ object SeasonalEventsAPI {
def withF[F[_] : Clock : Functor]: SeasonalEventsAPI[F] = new SeasonalEventsAPI[F] {
override implicit val christmasEventsAPI: ChristmasEventsAPI[F] = ChristmasEventsAPI.withF[F]
}

def apply[F[_] : SeasonalEventsAPI]: SeasonalEventsAPI[F] = implicitly
}
5 changes: 2 additions & 3 deletions src/main/scala/com/github/unchama/util/RandomEffect.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package com.github.unchama.util

import cats.Functor
import cats.effect.Sync
import simulacrum.typeclass

import scala.util.Random

trait RandomEffect[F[_]] {
@typeclass trait RandomEffect[F[_]] {

import cats.implicits._

Expand Down Expand Up @@ -50,6 +51,4 @@ object RandomEffect {
}
}

def apply[F[_] : RandomEffect]: RandomEffect[F] = implicitly

}

0 comments on commit bfca01e

Please sign in to comment.