get[Int] IndexedStateT[Id, Int, Int, Int]. Stack[Int] IndexedStateT[Inner, Int, Int, Int], Inner EitherT[Id, String, A]. , .
Inner StateT Option.
type Stack[A] = StateT[Option, Int, A]
get[Int] - .
val x:Stack[Int] = get[Int]
, lift Option:
val x:Stack[Int] = get[Int].lift[Option]
, lift State Inner, . , Inner :
type Inner[+A] = EitherT[Id, String, A]
type Stack[A] = StateT[Inner, Int, A]
val x:Stack[Int] = get[Int].lift[Inner]
, . :
type Inner[+A] = EitherT[Id, String, A]
type Outer[F[+_], A] = StateT[F, Int, A]
type Stack[A] = Outer[Inner, A]
implicit def liftToStack[A](x:Outer[Id, A]):Stack[A] = x.lift[Inner]
def foo: Stack[Int] = for {
n <- get[Int]
} yield {
2 * n
}