normalize type names

This commit is contained in:
Mark Canlas 2022-10-04 14:41:05 -04:00
parent c34e945fe9
commit 80bdbddc24

View File

@ -1,23 +1,23 @@
package com.htmlism.scratchpad package com.htmlism.scratchpad
package object syntax: package object syntax:
implicit class WriteRegisterOps[A](reg: WriteAddress[A]): implicit class WriteRegisterOps[Addr](reg: WriteAddress[Addr]):
def write[B: Loadable](x: B): syntax.PartiallyAppliedWrite[B, A] = def write[A: Loadable](x: A): syntax.PartiallyAppliedWrite[A, Addr] =
new syntax.PartiallyAppliedWrite(reg, x) new syntax.PartiallyAppliedWrite(reg, x)
class PartiallyAppliedWrite[A: Loadable, B](reg: WriteAddress[B], x: A): class PartiallyAppliedWrite[Addr: Loadable, A](reg: WriteAddress[A], x: Addr):
def apply[C: Load: Store: Register]: String = def apply[R: Load: Store: Register]: String =
val literal = val literal =
summon[Loadable[A]].show(x) summon[Loadable[Addr]].show(x)
val register = val register =
summon[Register[C]].self summon[Register[R]].self
val loadInstruction = val loadInstruction =
Load[C].instruction // TODO load action needs to interact with encoder Load[R].instruction // TODO load action needs to interact with encoder
val storeInstruction = val storeInstruction =
Store[C].to // TODO store action needs to interact with encoder Store[R].to // TODO store action needs to interact with encoder
val first = val first =
s"$loadInstruction $literal" s"$loadInstruction $literal"