Welcome! Got a question? Do you have -Ypartial-unification turned on? Other FAQs: http://typelevel.org/cats/faq.html
RWS e l s a
for a couple of hours :D
Eq
instance for RWST, which is kinda alright I guess
MonadTrans
in haskell is unthinkable
Layer
type classes from cats-mtl
users, probably said this before, but people have been asking me, and when I start explaining mtl and that they don't need to know about them, they usually realize mtl is fairly simple as a concept
lifting
package
instances
hierarchy
implicits
syntax
and lifting
def transformObjectKeys(obj: JsonObject, f: String => String): JsonObject =
JsonObject.fromIterable(
obj.toList.map {
case (k, v) => f(k) -> v
}
)
def transformKeys(json: Json, f: String => String): Trampoline[Json] =
json.arrayOrObject(
Trampoline.done(json),
_.traverse((j: Json) => Trampoline.defer(transformKeys(j, f))).map(Json.fromValues(_)),
transformObjectKeys(_, f).traverse(obj => Trampoline.defer(transformKeys(obj, f))).map(Json.fromJsonObject)
)
This is the code I'm attempting to use
Trampoline[Json]
SelectItem
s and many Relation
s and eventually many Expression
, but a Expression
can also contain a query itself.
object Fix2 {
type Fix2_1[F1[_, _], F2[_, _]]
type Fix2_2[F1[_, _], F2[_, _]]
final class Subst[F1[_, _], F2[_, _]] {
type Apply[H[_[_, _], _[_, _]]] = H[F1, F2]
type ApplyF[H[_, _]] = H[Apply[Fix2_1], Apply[Fix2_2]]
def _1[H[_]](f: H[Apply[Fix2_1]]): H[ApplyF[F1]] = f.asInstanceOf[H[ApplyF[F1]]]
def _2[H[_]](f: H[Apply[Fix2_2]]): H[ApplyF[F2]] = f.asInstanceOf[H[ApplyF[F2]]]
}
private[this] val _subst = new Subst[Any, Any]
def subst[F1[_, _], F2[_, _]]: Subst[F1, F2] = _subst.asInstanceOf[Subst[F1, F2]]
}