These are chat archives for sethtrain/marvin

25th
May 2016
Doug Hurst
@robotsnowfall
May 25 2016 00:10
guys
you guys
i kind of want to marry type-checked RPG mechanics:
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_05).
Type in expressions for evaluation. Or try :help.

scala> import cats.syntax.all._
import cats.syntax.all._

scala> import rpg.data._
import rpg.data._

scala> import Metal.instances._
import Metal.instances._

scala> val sword = Metal.dull(3)
sword: rpg.data.Sword[rpg.data.Metal,rpg.data.Edge] = Sword(Iron,Dull,3)

scala> val ingot = Metal.lead(4)
ingot: rpg.data.Ingot[rpg.data.Metal] = Ingot(Lead,4)

scala> Transmutation.goldenTouch.transmute(ingot)
res0: rpg.data.Ingot[rpg.data.Metal] = Ingot(Gold,4)

scala> Transmutation.goldenTouch.transmute[Sword[?, Edge]](sword)
res1: rpg.data.Sword[rpg.data.Metal,rpg.data.Edge] = Sword(Gold,Dull,3)

scala> Bladesmithing.sharpen.smith[Sword[Metal, ?]](sword)
res2: rpg.data.Sword[rpg.data.Metal,rpg.data.Edge] = Sword(Iron,Sharp,3)

scala> Bladesmithing.sharpen.smith[Sword[Metal, ?]](res1)
res3: rpg.data.Sword[rpg.data.Metal,rpg.data.Edge] = Sword(Gold,Sharp,3)
i'll put up a repo in a sec
Seth Buntin
@sethtrain
May 25 2016 00:57
Nice!