Created
July 14, 2015 14:59
-
-
Save shigemk2/011e531f312324c39a90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[0m[[0minfo[0m] [0mLoading project definition from /home/shigemk2/projects/github.com/fpinscala/fpinscala/project[0m | |
[0m[[0minfo[0m] [0mSet current project to fpinscala (in build file:/home/shigemk2/projects/github.com/fpinscala/fpinscala/)[0m | |
> [1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`a': answers/console[24G[39G[1G[K (reverse-i-search)`an': answers/console[25G[40G[1G[K (reverse-i-search)`anw': [1G[K > | |
> answers/console | |
[0m[[0minfo[0m] [0mStarting scala interpreter...[0m | |
[0m[[0minfo[0m] [0m[0m | |
Welcome to Scala version 2.11.5 (OpenJDK 64-Bit Server VM, Java 1.7.0_79). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> [1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`i': println(a(List(1)))[26G[43G[1G[K (reverse-i-search)`im': import fpinscala.parallelism._[25G[55G[1G[K (reverse-i-search)`imp': import fpinscala.parallelism._[26G[56G[1G[K (reverse-i-search)`impo': import fpinscala.parallelism._[27G[57G[1G[K (reverse-i-search)`impor': import fpinscala.parallelism._[28G[58G[1G[K scala> import fpinscala.parallelism._[8G[38G[37G[36G[35G._[K[35G[34G._[K[34G[33G._[K[33G[32G._[K[32G[31G._[K[31G[30G._[K[30G[29G._[K[29G[28G._[K[28G[27G._[K[27G[26G._[K[26G[25G._[K[25G[Kstate_.[31G[K[30G[K._ | |
import fpinscala.state._ | |
scala> import fpinscala.state._[8G[KAdd(N(1),Add(x(1,3),x(3,2),x(2,2),x(6,1),x(1,2),x(3,1),x(2,1),N(6)))[8G[K}[8G[K Var("x", a, n)[8G[Kdef x(a: Int, n: Int): Var = {[8G[K)[8G[KAdd(N(1),Add(x(1,3),x(3,2),x(2,2),x(6,1),x(1,2),x(3,1),x(2,1),N(6))[16G[K)[8G[Kprintln(a(List(1)))[8G[K}[8G[K case List(xs) => Add(N(xs))[20G[K) => N(1)[20G[Kxs) => Add(N(xs))[8G[K}[8G[Kprintln(a(List(1)))[8G[KAdd(N(1))[16G[K,Add(x(1,3),x(3,2),x(2,2),x(6,1),x(1,2),x(3,1),x(2,1),N(6))[8G[K)[8G[Kdef x(a: Int, n: Int): Var = {[8G[K Var("x", a, n)[8G[K}[8G[KAdd(N(1),Add(x(1,3),x(3,2),x(2,2),x(6,1),x(1,2),x(3,1),x(2,1),N(6)))[8G[Kimport fpinscala.state._[8G[Kimport fpinscala.state._[8G[KAdd(N(1),Add(x(1,3),x(3,2),x(2,2),x(6,1),x(1,2),x(3,1),x(2,1),N(6)))[8G[K}[8G[K Var("x", a, n)[8G[Kdef x(a: Int, n: Int): Var = {[8G[K)[8G[KAdd(N(1),Add(x(1,3),x(3,2),x(2,2),x(6,1),x(1,2),x(3,1),x(2,1),N(6))[16G[K)[8G[Kprintln(a(List(1)))[8G[K}[8G[K case List(xs) => Add(N(xs))[20G[K) => N(1)[8G[Kdef a(xs: List[Int]): Expr = xs match {[8G[Kcase class Mul(n: Expr*) extends Expr[19G[KAdd(n: Expr*) extends Expr[19G[KVar(x: String, a: Int, n: Int) extends Expr[19G[KN(n: Int) extends Expr[8G[Ksealed trait Expr[8G[K X.y("a" +: Seq("b", "c"):_*)[8G[KX.y(Seq("a", "b", "c"))[30G[K:_*)[12G[K"a", "b", "c")[8G[Kobject X { def y(s: String*) = println(s(0)) }[8G[Kfor (x <- List(1,2,3,4,5,6,7,8,9); y <- List(1,2,3,4,5,6,7,8,9); z = x * y; if z == 24) yield(x,y)[24G[K to 9); y <- List(1 to 9); z = x * y; if z == 24) yield(x+y)[24G[K,2,3,4,5,6,7,8,9); y <- List(1,2,3,4,5,6,7,8,9); z = x * y; if z == 24) yield(x+y)[18G[K1 to 9; y <- 1 to 9; z = x * y; if z == 24) yield(x+y)[69G[K,y)[68G[Kz)[45G[K+ y) yield(z)[18G[KList(1 to 9); y <- List(1 to 9); z = x + y) yield(z)[49G[K) yield(x,y)[51G[Kprintln(x + y)[60G[K)[58G[K x[58G[Kx[58G[K(x + y)[51G[Kyield (x + y)[49G[K; ) yield (x + y)[12G[K{x <- List(1 to 9); y <- List(1 to 9); if x > 3} yield (x + y)[12G[K(x <- List(1 to 9); y <- List(1 to 9); if x > 3) yield (x + y)[49G[K if x > 3) yield (x + y)[66G[K{x + y}[66G[K(x + y)[66G[Kx + y[50G[K) yield x + y[50G[Kif (x * y) == 24) yield x + y[53G[Kx * y == 24) yield x + y[12G[K{x <- List(1 to 9) y <- List(1 to 9) if x * y == 24} yield x + y[12G[K(x <- List(1 to 9) y <- List(1 to 9) if x * y == 24) yield x + y[30G[K) yield x[30G[K if x == 3) println(x)[49G[K x[42G[Kx[42G[Kyield x[30G[K, y <- List(1 to 9) if x * y == 24) yield x + y[8G[KList(1 to 9)[8G[KSeq(1 to 9)[8G[KList(List(1,2,3),List(4,5,6)).flatMap(x => List(x,x+1))[56G[K1 + x))[56G[Kx + 1))[13G[K0,1,2).flatMap(n => List(n,'A'+n))[13G[KList(1,2,3),List(4,5,6)).flatMap(x => x + "1")[52G[K(0) + "1")[58G[K1)[52G[K.toInt + 1)[56G[Ktn + 1)[46G[K(x: Int) => x + 1)[46G[Kx: Int => x + 1)[47G[K => x + 1)[46G[KList(x) => x + 1)[46G[Kx => List(x + "A"))[60G[K'A'))[60G[K1))[51G[Kx + 1)[52G[K)[52G[K + 1)[51G[KList(x + 1))[60G[K'A'))[60G[K"A"))[46G[KList(x) => x + 1)[46G[Kx => x + 1)[47G[K: Int => x + 1)[46G[K(x: Int) => x + 1)[46G[Kx => x.toItn + 1)[56G[Knt + 1)[52G[K(0) + 1)[58G[K"1")[58G[K1)[52G[K.toInt + 1)[56G[Ktn + 1)[46G[K(x: Int) => x + 1)[46G[Kx: Int => x + 1)[47G[K => x + 1)[46G[KList(x) => x + 1)[46G[Kx => List(x + "A"))[60G[K'A'))[60G[K1))[51G[Kx + 1)[52G[K)[52G[K + 1)[51G[KList(x + 1))[60G[K'A'))[60G[K"A"))[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`v': val a = List(1,2,3)[24G[43G[1G[K (reverse-i-search)`va': val a = List(1,2,3)[25G[44G[1G[K (reverse-i-search)`val': val a = List(1,2,3)[26G[45G[1G[K (reverse-i-search)`val ': val a = List(1,2,3)[27G[46G[1G[K scala> val a = List(1,2,3)[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`R': val rng = RNG.Simple(42)[34G[48G[1G[K (reverse-i-search)`RN': val rng = RNG.Simple(42)[35G[49G[1G[K (reverse-i-search)`RNG': val rng = RNG.Simple(42)[36G[50G[1G[K scala> val rng = RNG.Simple(42)[18G[8G[32G | |
rng: fpinscala.state.RNG.Simple = Simple(42) | |
scala> rng. | |
asInstanceOf copy nextInt productElement productPrefix toString | |
canEqual isInstanceOf productArity productIterator seed | |
scala> rng. | |
asInstanceOf copy nextInt productElement productPrefix toString | |
canEqual isInstanceOf productArity productIterator seed | |
scala> rng.[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`R': val rng = RNG.Simple(42)[34G[48G[1G[K (reverse-i-search)`RN': val rng = RNG.Simple(42)[35G[49G[1G[K (reverse-i-search)`RNG': val rng = RNG.Simple(42)[36G[50G[1G[K (reverse-i-search)`RNG': val rng = RNG.Simple(42)[36G[50G[1G[K (reverse-i-search)`RNG': val rand = RNG[37G[40G[1G[K scala> val rand = RNG[19G[8G[22G | |
rand: fpinscala.state.RNG.type = fpinscala.state.RNG$@7dca2b98 | |
scala> rand.m[13G[Kmap | |
map map2 | |
scala> rand.map | |
def map[A, B](s: RNG => (A, fpinscala.state.RNG))(f: A => B): RNG => (B, fpinscala.state.RNG) | |
scala> rand.map2()[18G[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`r': val rand = RNG[28G[38G[1G[K (reverse-i-search)`rn': val rng = RNG.Simple(42)[29G[49G[1G[K (reverse-i-search)`rng': val rng = RNG.Simple(42)[30G[50G[1G[K (reverse-i-search)`rng1': [1G[K (reverse-i-search)`rng1': [1G[K scala> val rand = RNG[13G[Kng = RNG.Simple(42)[8G[9G[10G[11G[12G[13G[14G[15G1 = RNG.Simple(42)[16G[33G | |
rng1: fpinscala.state.RNG.Simple = Simple(42) | |
scala> val rng1 = RNG.Simple(42)[32G[31G[32G0)[33G[8G[9G[10G[11G[12G[13G[14G[15G[16G[15G = RNG.Simple(420)[K[15G2 = RNG.Simple(420)[16G[34G | |
rng2: fpinscala.state.RNG.Simple = Simple(420) | |
scala> rand.map2()[18G[17G)[K[17G[K[16G[K[15G[K[14G[K[13G[Kmap2 | |
def map2[A, B, C](ra: RNG => (A, fpinscala.state.RNG), rb: RNG => (B, fpinscala.state.RNG))(f: (A, B) => C): RNG => (C, fpinscala.state.RNG) | |
scala> rand.map2()[18Gr)[19Gn)[20Gg)[21G1)[22G,)[23G )[24Gr)[25Gn)[26Gg)[27G2)[28G[2J[1;1H | |
scala> rand.map2(rng1, rng2))[28G[29G.[29G[K()[30G_)[31G,)[32G_)[33G[34G | |
<console>:14: error: missing parameter type for expanded function ((x$1, x$2) => rand.map2(rng1, rng2)(x$1, x$2)) | |
rand.map2(rng1, rng2)(_,_) | |
^ | |
<console>:14: error: missing parameter type for expanded function ((x$1: <error>, x$2) => rand.map2(rng1, rng2)(x$1, x$2)) | |
rand.map2(rng1, rng2)(_,_) | |
^ | |
<console>:14: error: type mismatch; | |
found : fpinscala.state.RNG.Simple | |
required: rand.Rand[?] | |
(which expands to) fpinscala.state.RNG => (?, fpinscala.state.RNG) | |
rand.map2(rng1, rng2)(_,_) | |
^ | |
<console>:14: error: type mismatch; | |
found : fpinscala.state.RNG.Simple | |
required: rand.Rand[?] | |
(which expands to) fpinscala.state.RNG => (?, fpinscala.state.RNG) | |
rand.map2(rng1, rng2)(_,_) | |
^ | |
scala> rand.map2(rng1, rng2)(_,_)[33G[32G[31G[30G[29G[28G[27G[26G[25G[24G[23G[22G[21G[20G[19G[18G[19G[20G[21G[22G[21G, rng2)(_,_)[K[21G[20G, rng2)(_,_)[K[20G[19G, rng2)(_,_)[K[19G[18G, rng2)(_,_)[K[18Gr, rng2)(_,_)[19Ga, rng2)(_,_)[20Gn, rng2)(_,_)[21Gd, rng2)(_,_)[22G[23G[24G[25G[26G[27G[28G[27G)(_,_)[K[27G[26G)(_,_)[K[26G[25G)(_,_)[K[25G[24G)(_,_)[K[24Gr)(_,_)[25Ga)(_,_)[26Gn)(_,_)[27Gd)(_,_)[28G[34G | |
<console>:12: error: missing parameter type for expanded function ((x$1, x$2) => rand.map2(rand, rand)(x$1, x$2)) | |
rand.map2(rand, rand)(_,_) | |
^ | |
<console>:12: error: missing parameter type for expanded function ((x$1: <error>, x$2) => rand.map2(rand, rand)(x$1, x$2)) | |
rand.map2(rand, rand)(_,_) | |
^ | |
<console>:12: error: type mismatch; | |
found : fpinscala.state.RNG.type | |
required: rand.Rand[?] | |
(which expands to) fpinscala.state.RNG => (?, fpinscala.state.RNG) | |
rand.map2(rand, rand)(_,_) | |
^ | |
<console>:12: error: type mismatch; | |
found : fpinscala.state.RNG.type | |
required: rand.Rand[?] | |
(which expands to) fpinscala.state.RNG => (?, fpinscala.state.RNG) | |
rand.map2(rand, rand)(_,_) | |
^ | |
scala> rand.map2 | |
def map2[A, B, C](ra: RNG => (A, fpinscala.state.RNG), rb: RNG => (B, fpinscala.state.RNG))(f: (A, B) => C): RNG => (C, fpinscala.state.RNG) | |
scala> rand.map2 | |
def map2[A, B, C](ra: RNG => (A, fpinscala.state.RNG), rb: RNG => (B, fpinscala.state.RNG))(f: (A, B) => C): RNG => (C, fpinscala.state.RNG) | |
scala> rand.map2[8G[Krand | |
res2: fpinscala.state.RNG.type = fpinscala.state.RNG$@7dca2b98 | |
scala> rand[8G[Krand.map2(rand, rand)(_,_)[19G[Kng1, rng2)(_,_)[33G[K[32G[K[31G[K[30G[K[29G[K()[30G_)[31G,)[32G\)[33G[32G)[K[32G_)[33G[34G | |
<console>:14: error: missing parameter type for expanded function ((x$1, x$2) => rand.map2(rng1, rng2)(x$1, x$2)) | |
rand.map2(rng1, rng2)(_,_) | |
^ | |
<console>:14: error: missing parameter type for expanded function ((x$1: <error>, x$2) => rand.map2(rng1, rng2)(x$1, x$2)) | |
rand.map2(rng1, rng2)(_,_) | |
^ | |
<console>:14: error: type mismatch; | |
found : fpinscala.state.RNG.Simple | |
required: rand.Rand[?] | |
(which expands to) fpinscala.state.RNG => (?, fpinscala.state.RNG) | |
rand.map2(rng1, rng2)(_,_) | |
^ | |
<console>:14: error: type mismatch; | |
found : fpinscala.state.RNG.Simple | |
required: rand.Rand[?] | |
(which expands to) fpinscala.state.RNG => (?, fpinscala.state.RNG) | |
rand.map2(rng1, rng2)(_,_) | |
^ | |
scala> [1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`d': rand.map2(rng1, rng2)(_,_)[27G[50G[1G[K (reverse-i-search)`do': rand.double(rng)[30G[41G[1G[K (reverse-i-search)`dou': rand.double(rng)[31G[42G[1G[K (reverse-i-search)`doub': rand.double(rng)[32G[43G[1G[K (reverse-i-search)`doubl': rand.double(rng)[33G[44G[1G[K (reverse-i-search)`double': rand.double(rng)[34G[45G[1G[K scala> rand.double(rng)[13G[8G[24G | |
res4: (Double, fpinscala.state.RNG) = (0.007524831686168909,Simple(1059025964525)) | |
scala> rand.double(rng)[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`i': val rng2 = RNG.Simple(420)[40G[50G[1G[K (reverse-i-search)`in': import fpinscala.state._[34G[49G[1G[K (reverse-i-search)`int': println(a(List(1)))[28G[45G[1G[K (reverse-i-search)`intD': a.intDouble(rng)[29G[43G[1G[K (reverse-i-search)`intDo': a.intDouble(rng)[30G[44G[1G[K scala> a.intDouble(rng)[10G[8G[24G | |
<console>:12: error: not found: value a | |
a.intDouble(rng) | |
^ | |
scala> a.intDouble(rng)[8G.intDouble(rng)[K[8Gr.intDouble(rng)[9Ga.intDouble(rng)[10Gn.intDouble(rng)[11Gd.intDouble(rng)[12G[27G | |
res6: ((Int, Double), fpinscala.state.RNG) = ((16159453,0.5967354848980904),Simple(197491923327988)) | |
scala> rand.intDouble(rng)[26G[25G[24G[23G[22G[21G[20G[19G[18G[17G[16G[15G[14G[13G[Krand[16G[K[15G[K[14G[K[13G[Krand | |
randDoubleInt randIntDouble | |
scala> rand.rand[16G[K[15G[K[14G[K[13G[Krand | |
randDoubleInt randIntDouble | |
scala> rand.randDoubl[21G[K[20G[K[19G[K[18G[K[17G[K[16G[K[15G[K[14G[K[13G[KrandDoubleInt | |
res7: rand.Rand[(Double, Int)] = <function1> | |
scala> rand.randDoubleInt[25G[K[24G[K[23G[K[22G[K[21G[K[20G[K[19G[K[18G[K[17G[K[16G[K[15G[K[14G[K[13G[KrandIntDouble | |
res8: rand.Rand[(Int, Double)] = <function1> | |
scala> rand.randIntDouble()[27G2)[28G.)[29G0)[30G,)[31G )[32G1)[33G[32G)[K[32G[31G)[K[31G[30G)[K[30G[29G)[K[29G[28G)[K[28G[27G)[K[27G1)[28G,)[29G )[30G2)[31G.)[32G0)[33G[34G | |
<console>:12: error: too many arguments for method apply: (v1: fpinscala.state.RNG)((Int, Double), fpinscala.state.RNG) in trait Function1 | |
rand.randIntDouble(1, 2.0) | |
^ | |
scala> rand.randIntDouble(1, 2.0)[33G[32G[31G[30G[29G[28G[27G[26G1, 2.0)[K[26G[K | |
res10: rand.Rand[(Int, Double)] = <function1> | |
scala> rand.randIntDouble[8Gvrand.randIntDouble[9Garand.randIntDouble[10Glrand.randIntDouble[11G rand.randIntDouble[12Garand.randIntDouble[13G rand.randIntDouble[14G=rand.randIntDouble[15G rand.randIntDouble[16G[34G | |
a: rand.Rand[(Int, Double)] = <function1> | |
scala> val a = rand.randIntDouble[8G[9G[8G[Ka. | |
andThen apply asInstanceOf compose isInstanceOf toString | |
scala> a. | |
andThen apply asInstanceOf compose isInstanceOf toString | |
scala> a.[9G[K()[10G2)[11G.)[12G[11G)[K[11G.)[12G0)[13G[12G)[K[12G[11G)[K[11G[10G)[K[10G1)[11G,)[12G )[13G2)[14G.)[15G0)[16G[17G | |
<console>:13: error: too many arguments for method apply: (v1: fpinscala.state.RNG)((Int, Double), fpinscala.state.RNG) in trait Function1 | |
a(1, 2.0) | |
^ | |
scala> a(1, 2.0)[8G[9G[10G[9Ga(1, 2.0)[10Gp(1, 2.0)[11Gp(1, 2.0)[12G[11G(1, 2.0)[K[11G[10G(1, 2.0)[K[10G[9G(1, 2.0)[K[9G.(1, 2.0)[10Ga(1, 2.0)[11Gp(1, 2.0)[12Gp(1, 2.0)[13Gl(1, 2.0)[14Gy(1, 2.0)[15G[23G | |
<console>:13: error: too many arguments for method apply: (v1: fpinscala.state.RNG)((Int, Double), fpinscala.state.RNG) in trait Function1 | |
a.apply(1, 2.0) | |
^ | |
scala> a.apply(1, 2.0)[8G[9G[10G[9Gapply(1, 2.0)[K[9Gpply(1, 2.0)[K[9Gply(1, 2.0)[K[9Gly(1, 2.0)[K[9Gy(1, 2.0)[K[9G(1, 2.0)[K[9G1, 2.0)[K[9G[K[8G[Ka(1, 2.0)[8G[Kval a = rand.randIntDouble[8G[Krand.randIntDouble(1, 2.0)[26G[K[17G[KDoubleInt | |
res13: rand.Rand[(Double, Int)] = <function1> | |
scala> rand.randDoubleInt[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`i': rand.intDouble(rng)[29G[43G[1G[K (reverse-i-search)`in': rand.intDouble(rng)[30G[44G[1G[K (reverse-i-search)`ind': a.find(x => x == 6)[29G[45G[1G[K (reverse-i-search)`indD': [1G[K (reverse-i-search)`ind': a.find(x => x == 6)[29G[45G[1G[K (reverse-i-search)`in': rand.intDouble(rng)[30G[44G[1G[K (reverse-i-search)`int': rand.intDouble(rng)[31G[45G[1G[K (reverse-i-search)`intD': rand.intDouble(rng)[32G[46G[1G[K (reverse-i-search)`intDo': rand.intDouble(rng)[33G[47G[1G[K (reverse-i-search)`intDou': rand.intDouble(rng)[34G[48G[1G[K (reverse-i-search)`intDoub': rand.intDouble(rng)[35G[49G[1G[K (reverse-i-search)`intDoubl': rand.intDouble(rng)[36G[50G[1G[K (reverse-i-search)`intDouble': rand.intDouble(rng)[37G[51G[1G[K scala> rand.intDouble(rng)[13G[8G[27G | |
res14: ((Int, Double), fpinscala.state.RNG) = ((16159453,0.5967354848980904),Simple(197491923327988)) | |
scala> rand.intDouble(rng)[13G[KrandDoubleInt[8G[Ka.apply(1, 2.0)[8G[Krand.randDoubleInt)[26G[K()[27Gr)[28Gn)[29Gg)[30G[31G | |
res15: ((Double, Int), fpinscala.state.RNG) = ((0.007524831686168909,-1281479697),Simple(197491923327988)) | |
scala> rand.randDoubleInt(rng)[30G[29G[28G[27G[26G[25G[24G[23G[22G[21G[20G[19G[18G[17G[16G[15G[14G[13G[14G[15G[16G[17G[KIntDouble()[27Gr)[28Gn)[29Gg)[30G[31G | |
res16: ((Int, Double), fpinscala.state.RNG) = ((16159453,0.5967354848980904),Simple(197491923327988)) | |
scala> rand.randIntDouble(rng)[17G[KDoubleInt(rng)[13G[KintDouble(rng)[13G[KrandDoubleInt[13G[KintDouble(rng)[13G[KrandDoubleInt(rng)[17G[KIntDouble(rng)[8G[Krand.randIntDouble(rng)[17G[KDoubleInt(rng)[13G[KintDouble(rng)[13G[KrandDoubleInt[8G[Ka.apply(1, 2.0)[9G[K(1, 2.0)[8G[Kval a = rand.randIntDouble[8G[Krand.randIntDouble(1, 2.0)[26G[K[17G[KDoubleInt[13G[KintDouble(rng)[8G[Ka.intDouble(rng)[8G[Krand.double(rng)[13G[Kmap2(rng1, rng2)(_,_)[12G[K.map2(rand, rand)(_,_)[19G[Kng1, rng2)(_,_)[8G[Kval rng2 = RNG.Simple(420)[15G[K1 = RNG.Simple(42)[13G[Kand = RNG[13G[Kng = RNG.Simple(42)[8G[Kimport fpinscala.state._[8G[KAdd(N(1),Add(x(1,3),x(3,2),x(2,2),x(6,1),x(1,2),x(3,1),x(2,1),N(6)))[8G[K}[8G[K Var("x", a, n)[8G[Kdef x(a: Int, n: Int): Var = {[8G[K)[8G[KAdd(N(1),Add(x(1,3),x(3,2),x(2,2),x(6,1),x(1,2),x(3,1),x(2,1),N(6))[16G[K)[8G[Kprintln(a(List(1)))[8G[K}[8G[Kprintln(a(List(1)))[8G[KAdd(N(1))[16G[K,Add(x(1,3),x(3,2),x(2,2),x(6,1),x(1,2),x(3,1),x(2,1),N(6))[8G[K)[8G[Kdef x(a: Int, n: Int): Var = {[8G[K Var("x", a, n)[8G[K}[8G[KAdd(N(1),Add(x(1,3),x(3,2),x(2,2),x(6,1),x(1,2),x(3,1),x(2,1),N(6)))[8G[Kimport fpinscala.state._[8G[Kval rng = RNG.Simple(42)[13G[Kand = RNG[13G[Kng1 = RNG.Simple(42)[15G[K2 = RNG.Simple(420)[8G[Krand.map2(rng1, rng2)(_,_)[19G[Kand, rand)(_,_)[12G[K.map2(rng1, rng2)(_,_)[13G[Kdouble(rng)[8G[Ka.intDouble(rng)[8G[Krand.intDouble(rng)[13G[KrandDoubleInt[17G[KIntDouble(1, 2.0)[26G[K[8G[Kval a = rand.randIntDouble[8G[Ka(1, 2.0)[9G[K.apply(1, 2.0)[9G[K(1, 2.0)[8G[Kval a = rand.randIntDouble[8G[Krand.randIntDouble(1, 2.0)[26G[K[17G[KDoubleInt[13G[KintDouble(rng)[8G[Ka.intDouble(rng)[8G[Krand.double(rng)[13G[Kmap2(rng1, rng2)(_,_)[12G[K.map2(rand, rand)(_,_)[19G[Kng1, rng2)(_,_)[8G[Kval rng2 = RNG.Simple(420)[15G[K1 = RNG.Simple(42)[13G[Kand = RNG[13G[Kng = RNG.Simple(42)[8G[Kimport fpinscala.state._[8G[KAdd(N(1),Add(x(1,3),x(3,2),x(2,2),x(6,1),x(1,2),x(3,1),x(2,1),N(6)))[8G[K}[8G[K Var("x", a, n)[8G[Kdef x(a: Int, n: Int): Var = {[8G[K)[8G[KAdd(N(1),Add(x(1,3),x(3,2),x(2,2),x(6,1),x(1,2),x(3,1),x(2,1),N(6))[16G[K)[8G[Kprintln(a(List(1)))[8G[K}[8G[K case List(xs) => Add(N(xs))[20G[K) => N(1)[8G[Kdef a(xs: List[Int]): Expr = xs match {[8G[Kcase class Mul(n: Expr*) extends Expr[19G[KAdd(n: Expr*) extends Expr[19G[KVar(x: String, a: Int, n: Int) extends Expr[19G[KN(n: Int) extends Expr[8G[Ksealed trait Expr[8G[K X.y("a" +: Seq("b", "c"):_*)[8G[KX.y(Seq("a", "b", "c"))[30G[K:_*)[12G[K"a", "b", "c")[8G[Kobject X { def y(s: String*) = println(s(0)) }[8G[Kfor (x <- List(1,2,3,4,5,6,7,8,9); y <- List(1,2,3,4,5,6,7,8,9); z = x * y; if z == 24) yield(x,y)[1A[24G[K[K[B[2K[A to 9); y <- List(1 to 9); z = x * y; if z == 24) yield(x+y)[1A[24G[K[K[B[2K[A,2,3,4,5,6,7,8,9); y <- List(1,2,3,4,5,6,7,8,9); z = x * y; if z == 24) yield(x+y)[1A[18G[K[K[B[2K[A1 to 9; y <- 1 to 9; z = x * y; if z == 24) yield(x+y)[69G[K,y)[68G[Kz)[45G[K+ y) yield(z)[18G[KList(1 to 9); y <- List(1 to 9); z = x + y) yield(z)[49G[K) yield(x,y)[51G[Kprintln(x + y)[60G[K)[58G[K x[58G[Kx[58G[K(x + y)[51G[Kyield (x + y)[49G[K; ) yield (x + y)[12G[K{x <- List(1 to 9); y <- List(1 to 9); if x > 3} yield (x + y)[12G[K(x <- List(1 to 9); y <- List(1 to 9); if x > 3) yield (x + y)[49G[K if x > 3) yield (x + y)[66G[K{x + y}[66G[K(x + y)[66G[Kx + y[50G[K) yield x + y[50G[Kif (x * y) == 24) yield x + y[53G[Kx * y == 24) yield x + y[12G[K{x <- List(1 to 9) y <- List(1 to 9) if x * y == 24} yield x + y[12G[K(x <- List(1 to 9) y <- List(1 to 9) if x * y == 24) yield x + y[30G[K) yield x[30G[K if x == 3) println(x)[49G[K x[42G[Kx[42G[Kyield x[30G[K, y <- List(1 to 9) if x * y == 24) yield x + y[8G[KList(1 to 9)[8G[KSeq(1 to 9)[8G[KList(List(1,2,3),List(4,5,6)).flatMap(x => List(x,x+1))[56G[K1 + x))[56G[Kx + 1))[13G[K0,1,2).flatMap(n => List(n,'A'+n))[13G[KList(1,2,3),List(4,5,6)).flatMap(x => x + "1")[52G[K(0) + "1")[58G[K1)[52G[K.toInt + 1)[56G[Ktn + 1)[46G[K(x: Int) => x + 1)[8G[KList(List(1,2,3),List(4,5,6)).flatMap(x: Int => x + 1)[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`i': List(List(1,2,3),List(4,5,6)).flatMap(x => x + 1)[25G[73G[1G[K (reverse-i-search)`in': object X { def y(s: String*) = println(s) }[48G[68G[1G[K (reverse-i-search)`int': object X { def y(s: String*) = println(s) }[59G[69G[1G[K scala> object X { def y(s: String*) = println(s) }[41G[8G[K | |
scala> [1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`i': rand.intDouble(rng)[29G[43G[1G[K (reverse-i-search)`in': rand.intDouble(rng)[30G[44G[1G[K (reverse-i-search)`int': rand.intDouble(rng)[31G[45G[1G[K scala> rand.intDouble(rng)[13G[8G[27G | |
res17: ((Int, Double), fpinscala.state.RNG) = ((16159453,0.5967354848980904),Simple(197491923327988)) | |
scala> rand.non[15G[K[14G[K[13G[KnonNegative | |
nonNegativeEven nonNegativeInt nonNegativeLessThan | |
scala> rand.nonNegativeL[24G[K[23G[K[22G[K[21G[K[20G[K[19G[K[18G[K[17G[K[16G[K[15G[K[14G[K[13G[KnonNegativeLessThan | |
def nonNegativeLessThan(n: Int): RNG => (Int, fpinscala.state.RNG) | |
scala> rand.nonNegativeLessThan()[33G[32G[33G2)[34G[35G | |
res18: rand.Rand[Int] = <function1> | |
scala> rand.nonNegativeLessThan(2)()[36Gr)[37Gn)[38Gg)[39G[40G | |
res19: (Int, fpinscala.state.RNG) = (1,Simple(1059025964525)) | |
scala> rand.nonNegativeLessThan(2)(rng) | |
res20: (Int, fpinscala.state.RNG) = (1,Simple(1059025964525)) | |
scala> rand.nonNegativeLessThan(2)(rng)[39G[38G[37G[36G[35G[34G[33G)(rng)[K[33G3)(rng)[34G[40G | |
res21: (Int, fpinscala.state.RNG) = (1,Simple(1059025964525)) | |
scala> rand.nonNegativeLessThan(3)(rng) | |
res22: (Int, fpinscala.state.RNG) = (1,Simple(1059025964525)) | |
scala> rand.nonNegativeLessThan(3)(rng)[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`s': rand.nonNegativeLessThan(2)(rng)[42G[56G[1G[K (reverse-i-search)`si': version[28G[32G[1G[K (reverse-i-search)`sim': // This definition and `formatAbs` are very similar..[1A[72G[1B[5G[1A[1G[K[K[B[2K[A (reverse-i-search)`simp': like this from simpler components, without giving up the efficiency[1A[44G |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[0m[[0minfo[0m] [0mLoading project definition from /home/shigemk2/projects/github.com/fpinscala/fpinscala/project[0m | |
[0m[[0minfo[0m] [0mSet current project to fpinscala (in build file:/home/shigemk2/projects/github.com/fpinscala/fpinscala/)[0m | |
> answers/console | |
[0m[[0minfo[0m] [0mStarting scala interpreter...[0m | |
[0m[[0minfo[0m] [0m[0m | |
Welcome to Scala version 2.11.5 (OpenJDK 64-Bit Server VM, Java 1.7.0_79). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> rand.nonNegativeLessThan(3)(rng)[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`r': rand.nonNegativeLessThan(2)(rng)[24G[56G[1G[K (reverse-i-search)`rn': rand.nonNegativeLessThan(2)(rng)[53G[57G[1G[K (reverse-i-search)`rng': rand.nonNegativeLessThan(2)(rng)[54G[58G[1G[K (reverse-i-search)`rng': rand.intDouble(rng)[41G[45G[1G[K (reverse-i-search)`rng': rand.randIntDouble(rng)[45G[49G[1G[K (reverse-i-search)`rng': rand.randDoubleInt(rng)[45G[49G[1G[K (reverse-i-search)`rng ': val rng = RNG.Simple(42)[31G[51G[1G[K scala> val rng = RNG.Simple(42)[12G[8G[32G[31G[8G[32G | |
<console>:7: error: not found: value RNG | |
val rng = RNG.Simple(42) | |
^ | |
scala> [1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`i': val rng = RNG.Simple(42)[39G[48G[1G[K (reverse-i-search)`im': val rng = RNG.Simple(42)[40G[49G[1G[K (reverse-i-search)`imp': val rng = RNG.Simple(42)[41G[50G[1G[K (reverse-i-search)`impo': import fpinscala.state._[27G[51G[1G[K (reverse-i-search)`impor': import fpinscala.state._[28G[52G[1G[K scala> import fpinscala.state._[8G[32G | |
import fpinscala.state._ | |
scala> import fpinscala.state._[8G[Kval rng = RNG.Simple(42) | |
rng: fpinscala.state.RNG.Simple = Simple(42) | |
scala> val rng = RNG.Simple(42)[8G[Kimport fpinscala.state._[8G[Kval rng = RNG.Simple(42)[8G[Krand.nonNegativeLessThan(3)(rng)[39G[38G)[K[38G[37G)[K[37G[36G)[K[36GR)[37GN)[38GG)[39G.)[40GS)[41Gi)[42Gm)[43Gp)[44Gl)[45Ge)[46G()[47G))[48G[47G4))[48G4))[49G[51G | |
<console>:11: error: not found: value rand | |
rand.nonNegativeLessThan(3)(RNG.Simple(44)) | |
^ | |
scala> rand.nonNegativeLessThan(3)(RNG.Simple(44))[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`v': val rng = RNG.Simple(42)[24G[48G[1G[K (reverse-i-search)`va': val rng = RNG.Simple(42)[25G[49G[1G[K (reverse-i-search)`val': val rng = RNG.Simple(42)[26G[50G[1G[K (reverse-i-search)`val ': val rng = RNG.Simple(42)[27G[51G[1G[K (reverse-i-search)`val r': val rng = RNG.Simple(42)[28G[52G[1G[K (reverse-i-search)`val ra': val rand = RNG[29G[43G[1G[K (reverse-i-search)`val ran': val rand = RNG[30G[44G[1G[K (reverse-i-search)`val rand': val rand = RNG[31G[45G[1G[K scala> val rand = RNG[8G[22G | |
rand: fpinscala.state.RNG.type = fpinscala.state.RNG$@71f24c5e | |
scala> val rand = RNG[8G[Krand.nonNegativeLessThan(3)(RNG.Simple(44)) | |
res1: (Int, fpinscala.state.RNG) = (2,Simple(1109455772359)) | |
scala> rand.nonNegativeLessThan(3)(RNG.Simple(44))[50G[49G[48G[47G[46G[45G[44G[43G[42G[41G[40G[39G[38G[37G[36G[35G[34G[33G[34G[35G[51G[50G[49G[48G[47G[46G[45G[44G[43G[42G[41G[40G[39G[38G[37G[36G[35G[34G[33G)(RNG.Simple(44))[K[33G4)(RNG.Simple(44))[34G4)(RNG.Simple(44))[35G[52G | |
res2: (Int, fpinscala.state.RNG) = (39,Simple(1109455772359)) | |
scala> rand.nonNegativeLessThan(44)(RNG.Simple(44)) | |
res3: (Int, fpinscala.state.RNG) = (39,Simple(1109455772359)) | |
scala> rand.nonNegativeLessThan(44)(RNG.Simple(44)) | |
res4: (Int, fpinscala.state.RNG) = (39,Simple(1109455772359)) | |
scala> rand.nonNegativeLessThan(44)(RNG.Simple(44)) | |
res5: (Int, fpinscala.state.RNG) = (39,Simple(1109455772359)) | |
scala> rand.nonNegativeLessThan(44)(RNG.Simple(44)) | |
res6: (Int, fpinscala.state.RNG) = (39,Simple(1109455772359)) | |
scala> rand.nonNegativeLessThan(44)(RNG.Simple(44))[51G[50G[49G[48G[49G[50G[49G))[K[49G[48G))[K[48G4))[49G3))[50G[52G | |
res7: (Int, fpinscala.state.RNG) = (26,Simple(1084240868442)) | |
scala> rand.nonNegativeLessThan(44)(RNG.Simple(43)) | |
res8: (Int, fpinscala.state.RNG) = (26,Simple(1084240868442)) | |
scala> val rng = new scala.util.Random | |
rng: scala.util.Random = scala.util.Random@72c5e634 | |
scala> rng.nextDouble | |
res9: Double = 0.9763503745002748 | |
scala> rng.nextDouble[21G[K[20G[K[19G[K[18G[K[17G[K[16G[KInt | |
res10: Int = -1849569144 | |
scala> rng.nextInt | |
res11: Int = 553186662 | |
scala> rng.nextInt | |
res12: Int = -744285841 | |
scala> rng.nextInt | |
res13: Int = 1873741984 | |
scala> rng.nextInt | |
res14: Int = -1094483583 | |
scala> rng.nextInt[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`r': rng.nextDouble[24G[38G[1G[K (reverse-i-search)`rn': rng.nextDouble[25G[39G[1G[K (reverse-i-search)`rng': rng.nextDouble[26G[40G[1G[K (reverse-i-search)`rng': val rng = new scala.util.Random[30G[57G[1G[K (reverse-i-search)`rng': val rng = RNG.Simple(42)[30G[50G[1G[K (reverse-i-search)`rng': val rng = RNG.Simple(42)[30G[50G[1G[K (reverse-i-search)`rng': rand.nonNegativeLessThan(3)(rng)[54G[58G[1G[K scala> rand.nonNegativeLessThan(3)(rng)[36G[8G[40G[39G[38G[37G[36G[35G[34G[33G[32G[31G[30G[29G[28G[27G[26G[25G[24G[23G[22G[21G[20G[19G[18G[17G[16G[15G[14G[13G[Kne[14G[K[13G[K | |
Rand boolean int map2 sequence | |
_double both intDouble nonNegativeEven toString | |
_ints double ints nonNegativeInt unit | |
_map double3 ints2 nonNegativeLessThan | |
_map2 doubleInt isInstanceOf randDoubleInt | |
asInstanceOf flatMap map randIntDouble | |
scala> rand.int[15G[K[14G[K[13G[Kint | |
int intDouble ints ints2 | |
scala> rand.int | |
val int: RNG => (Int, fpinscala.state.RNG) | |
scala> rand.int()[17G3)[18G,)[19G )[20GR)[21G[20G)[K[20GR)[21GN)[22GG)[23G.)[24GS)[25Gi)[26Gm)[27Gp)[28Gl)[29Ge)[30G()[31G))[32G[31G4))[32G2))[33G[8G[35G | |
<console>:12: error: too many arguments for method apply: (v1: fpinscala.state.RNG)(Int, fpinscala.state.RNG) in trait Function1 | |
rand.int(3, RNG.Simple(42)) | |
^ | |
scala> rand.int(3, RNG.Simple(42))[34G[33G[32G[31G[30G[29G[28G[27G[26G[25G[24G[23G[22G[21G[20G[19G[20G[19G[18G RNG.Simple(42))[K[18G) RNG.Simple(42))[19GRNG.Simple(42))[K[19G(RNG.Simple(42))[20G[35G | |
<console>:12: error: type mismatch; | |
found : Int(3) | |
required: fpinscala.state.RNG | |
rand.int(3)(RNG.Simple(42)) | |
^ | |
scala> rand.int(3)(RNG.Simple(42))[34G[33G[32G[31G[30G[29G[28G[27G[26G[25G[24G[23G[22G[21G[20G[19GRNG.Simple(42))[K[19G[18GRNG.Simple(42))[K[18G[17GRNG.Simple(42))[K[17G[16GRNG.Simple(42))[K[16G[31G[30G[K[29G[28G[27G[26G[25G[24G[23G[22G[21G[20G[19G[18G[17G[16G[15G[14G[13G[14G[15G[16G(RNG.Simple(42)[17G[31G) | |
res17: (Int, fpinscala.state.RNG) = (16159453,Simple(1059025964525)) | |
scala> rand.int(RNG.Simple(42)) | |
res18: (Int, fpinscala.state.RNG) = (16159453,Simple(1059025964525)) | |
scala> rand.int(RNG.Simple(42)) | |
res19: (Int, fpinscala.state.RNG) = (16159453,Simple(1059025964525)) | |
scala> rand.int(RNG.Simple(42)) | |
res20: (Int, fpinscala.state.RNG) = (16159453,Simple(1059025964525)) | |
scala> rand.int(RNG.Simple(42)) | |
res21: (Int, fpinscala.state.RNG) = (16159453,Simple(1059025964525)) | |
scala> rand.int(RNG.Simple(42))[8G[9G[10G[11G[12G[13G[Kmap[15G[K[14G[K[13G[Kmap | |
map map2 | |
scala> rand.map | |
def map[A, B](s: RNG => (A, fpinscala.state.RNG))(f: A => B): RNG => (B, fpinscala.state.RNG) | |
scala> rand.map2[16G[K[15G[K[14G[K[13G[Kmap2 | |
def map2[A, B, C](ra: RNG => (A, fpinscala.state.RNG), rb: RNG => (B, fpinscala.state.RNG))(f: (A, B) => C): RNG => (C, fpinscala.state.RNG) | |
scala> rand.map2()[18GR)[19GN)[20GG)[21G,)[22G )[23GR)[24GN)[25GG)[26G[27G | |
<console>:12: error: type mismatch; | |
found : fpinscala.state.RNG.type | |
required: rand.Rand[?] | |
(which expands to) fpinscala.state.RNG => (?, fpinscala.state.RNG) | |
rand.map2(RNG, RNG) | |
^ | |
<console>:12: error: type mismatch; | |
found : fpinscala.state.RNG.type | |
required: rand.Rand[?] | |
(which expands to) fpinscala.state.RNG => (?, fpinscala.state.RNG) | |
rand.map2(RNG, RNG) | |
^ | |
scala> rand.map2(RNG, RNG)()[28G_)[29G )[30G,)[31G )[32G_)[33G[34G | |
<console>:12: error: missing parameter type for expanded function ((x$1, x$2) => rand.map2(RNG, RNG)(x$1, x$2)) | |
rand.map2(RNG, RNG)(_ , _) | |
^ | |
<console>:12: error: missing parameter type for expanded function ((x$1: <error>, x$2) => rand.map2(RNG, RNG)(x$1, x$2)) | |
rand.map2(RNG, RNG)(_ , _) | |
^ | |
<console>:12: error: type mismatch; | |
found : fpinscala.state.RNG.type | |
required: rand.Rand[?] | |
(which expands to) fpinscala.state.RNG => (?, fpinscala.state.RNG) | |
rand.map2(RNG, RNG)(_ , _) | |
^ | |
<console>:12: error: type mismatch; | |
found : fpinscala.state.RNG.type | |
required: rand.Rand[?] | |
(which expands to) fpinscala.state.RNG => (?, fpinscala.state.RNG) | |
rand.map2(RNG, RNG)(_ , _) | |
^ | |
scala> rand.map2(RNG, RNG)(_ , _)[33G[32G[31G[30G[29G[28G[27G[26G[25G[24G[23G[22G[21G[20G[19G[18G[19G[20G[21G., RNG)(_ , _)[22GS, RNG)(_ , _)[23Gi, RNG)(_ , _)[24Gm, RNG)(_ , _)[25Gp, RNG)(_ , _)[26Gl, RNG)(_ , _)[27Ge, RNG)(_ , _)[28G(, RNG)(_ , _)[29G), RNG)(_ , _)[30G[29G4), RNG)(_ , _)[30G2), RNG)(_ , _)[31G[45G[44G[43G[42G[41G[40G[39G[38G[37G[36G[35G[34G[35G[36G[37G.)(_ , _)[38GS)(_ , _)[39GI)(_ , _)[40Gm)(_ , _)[41Gp)(_ , _)[42G[41G)(_ , _)[K[41G[40G)(_ , _)[K[40G[39G)(_ , _)[K[39Gi)(_ , _)[40Gm)(_ , _)[41Gp)(_ , _)[42Gl)(_ , _)[43Ge)(_ , _)[44G()(_ , _)[45G))(_ , _)[46G[45G4))(_ , _)[46G3))(_ , _)[47G[56G | |
<console>:12: error: missing parameter type for expanded function ((x$1, x$2) => rand.map2(RNG.Simple(42), RNG.Simple(43))(x$1, x$2)) | |
rand.map2(RNG.Simple(42), RNG.Simple(43))(_ , _) | |
^ | |
<console>:12: error: missing parameter type for expanded function ((x$1: <error>, x$2) => rand.map2(RNG.Simple(42), RNG.Simple(43))(x$1, x$2)) | |
rand.map2(RNG.Simple(42), RNG.Simple(43))(_ , _) | |
^ | |
<console>:12: error: type mismatch; | |
found : fpinscala.state.RNG.Simple | |
required: rand.Rand[?] | |
(which expands to) fpinscala.state.RNG => (?, fpinscala.state.RNG) | |
rand.map2(RNG.Simple(42), RNG.Simple(43))(_ , _) | |
^ | |
<console>:12: error: type mismatch; | |
found : fpinscala.state.RNG.Simple | |
required: rand.Rand[?] | |
(which expands to) fpinscala.state.RNG => (?, fpinscala.state.RNG) | |
rand.map2(RNG.Simple(42), RNG.Simple(43))(_ , _) | |
^ | |
scala> [1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`r': rand.map2(RNG.Simple(42), RNG.Simple(43))(_ , _)[24G[72G[1G[K (reverse-i-search)`ra': rand.map2(RNG.Simple(42), RNG.Simple(43))(_ , _)[25G[73G[1G[K (reverse-i-search)`ran': rand.map2(RNG.Simple(42), RNG.Simple(43))(_ , _)[26G[74G[1G[K (reverse-i-search)`rand': rand.map2(RNG.Simple(42), RNG.Simple(43))(_ , _)[27G[75G[1G[K (reverse-i-search)`rand': rand.map2(RNG, RNG)(_ , _)[27G[53G[1G[K (reverse-i-search)`rand': rand.map2(RNG, RNG)[27G[46G[1G[K (reverse-i-search)`rand': rand.int(RNG.Simple(42))[27G[51G[1G[K scala> rand.int(RNG.Simple(42))[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`v': val rng = new scala.util.Random[24G[55G[1G[K (reverse-i-search)`va': val rng = new scala.util.Random[25G[56G[1G[K (reverse-i-search)`val': val rng = new scala.util.Random[26G[57G[1G[K (reverse-i-search)`val ': val rng = new scala.util.Random[27G[58G[1G[K (reverse-i-search)`val r': val rng = new scala.util.Random[28G[59G[1G[K (reverse-i-search)`val ra': val rand = RNG[29G[43G[1G[K (reverse-i-search)`val ran': val rand = RNG[30G[44G[1G[K (reverse-i-search)`val rand': val rand = RNG[31G[45G[1G[K scala> val rand = RNG[8G[22G[Int] | |
<console>:10: error: object RNG does not take type parameters. | |
val rand = RNG[Int] | |
^ | |
scala> val rand = RNG[Int][26G[K[25G[K[24G[K[23G[K[22G[K[21G[20G[19G[18G[17G[16G[15G[14G[13G[12G[13G[14G[15G[16G] = RNG[17G = RNG[18G[17G = RNG[K[17G[16G = RNG[K[16G: = RNG[17G = RNG[18GR = RNG[19Ga = RNG[20Gn = RNG[21Gd = RNG[22G[28G | |
<console>:10: error: not found: type Rand | |
val rand: Rand = RNG | |
^ | |
scala> [[8G[Kval rand: Rand = RNG[8G[Kval rand: Rand = RNG[16G[K = RNG[Int][16G[K: Rand = RNG[27G[26G[25G[24G[23G[22G[28G | |
<console>:10: error: not found: type Rand | |
val rand: Rand = RNG | |
^ | |
scala> val rand: Rand = RNG[8G[9G[10G[11G[12G[13G[14G[15G[16G[17G[18G[19G[20G[21G[22G[ = RNG[23GI = RNG[24Gn = RNG[25Gt = RNG[26G] = RNG[27G[33G | |
<console>:10: error: not found: type Rand | |
val rand: Rand[Int] = RNG | |
^ | |
scala> val rand: Rand[Int] = RNG[8G[9G[10G[11G[12G[13G[14G[15G[16G[17G[18G[19G[20G[21G[22G[23G[24G[25G[26G[27G[28G[8G[Kval rand: Rand = RNG[16G[K = RNG[Int][8G[Krand.map2(RNG.Simple(42), RNG.Simple(43))(_ , _) | |
<console>:12: error: missing parameter type for expanded function ((x$1, x$2) => rand.map2(RNG.Simple(42), RNG.Simple(43))(x$1, x$2)) | |
rand.map2(RNG.Simple(42), RNG.Simple(43))(_ , _) | |
^ | |
<console>:12: error: missing parameter type for expanded function ((x$1: <error>, x$2) => rand.map2(RNG.Simple(42), RNG.Simple(43))(x$1, x$2)) | |
rand.map2(RNG.Simple(42), RNG.Simple(43))(_ , _) | |
^ | |
<console>:12: error: type mismatch; | |
found : fpinscala.state.RNG.Simple | |
required: rand.Rand[?] | |
(which expands to) fpinscala.state.RNG => (?, fpinscala.state.RNG) | |
rand.map2(RNG.Simple(42), RNG.Simple(43))(_ , _) | |
^ | |
<console>:12: error: type mismatch; | |
found : fpinscala.state.RNG.Simple | |
required: rand.Rand[?] | |
(which expands to) fpinscala.state.RNG => (?, fpinscala.state.RNG) | |
rand.map2(RNG.Simple(42), RNG.Simple(43))(_ , _) | |
^ | |
scala> rand.map2(RNG.Simple(42), RNG.Simple(43))(_ , _)[55G[54G[53G[52G[51G[50G[49G[48G[47G[46G[45G[44G[43G[42G[41G[40G[39G[38G[37G[36G[35G[34G[33G[32G[31G[30G[29G[28G[27G[26G[25G[24G[23G[22G[21G[20G[19G[18GNG.Simple(42), RNG.Simple(43))(_ , _)[K[18GG.Simple(42), RNG.Simple(43))(_ , _)[K[18G.Simple(42), RNG.Simple(43))(_ , _)[K[18GSimple(42), RNG.Simple(43))(_ , _)[K[18Gimple(42), RNG.Simple(43))(_ , _)[K[18Gmple(42), RNG.Simple(43))(_ , _)[K[18Gple(42), RNG.Simple(43))(_ , _)[K[18Gle(42), RNG.Simple(43))(_ , _)[K[18Ge(42), RNG.Simple(43))(_ , _)[K[18G(42), RNG.Simple(43))(_ , _)[K[18G42), RNG.Simple(43))(_ , _)[K[18G2), RNG.Simple(43))(_ , _)[K[18G), RNG.Simple(43))(_ , _)[K[18G, RNG.Simple(43))(_ , _)[K[18Gr, RNG.Simple(43))(_ , _)[19Ga, RNG.Simple(43))(_ , _)[20Gn, RNG.Simple(43))(_ , _)[21Gd, RNG.Simple(43))(_ , _)[22G., RNG.Simple(43))(_ , _)[23G , RNG.Simple(43))(_ , _)[24G[23GR , RNG.Simple(43))(_ , _)[24G[23G , RNG.Simple(43))(_ , _)[K[23G[KRand)[27G[K()[28G4)[29G2)[30G[31G, rand.Rand()43[45G[K[44G[K[43G[K43)).[47G[K()[48G_)[49G,)[50G_)[51G[52G | |
<console>:12: error: missing parameter type for expanded function ((x$1, x$2) => rand.map2(rand.<Rand: error>(42), rand.<Rand: error>(43))(x$1, x$2)) | |
rand.map2(rand.Rand(42), rand.Rand(43))(_,_) | |
^ | |
<console>:12: error: missing parameter type for expanded function ((x$1: <error>, x$2) => rand.map2(rand.<Rand: error>(42), rand.<Rand: error>(43))(x$1, x$2)) | |
rand.map2(rand.Rand(42), rand.Rand(43))(_,_) | |
^ | |
scala> rand.map2(rand.Rand(42), rand.Rand(43))(_,_)[51G[50G[49G[48G[47G[46G[45G[44G[43G[42G[41G[40G[39G[38G[37G[36G[35G[34G[33G[32G[31G[30G[29G[28G[27G42), rand.Rand(43))(_,_)[K[27G[26G42), rand.Rand(43))(_,_)[K[26G[25G42), rand.Rand(43))(_,_)[K[25G[24G42), rand.Rand(43))(_,_)[K[24G[23G42), rand.Rand(43))(_,_)[K[23G(42), rand.Rand(43))(_,_)[24G[25G[26G[27G[28G[29G[30G[31G[32G[33G[34G[35G[36G[37G[38G[39G[38G43))(_,_)[K[38G[37G43))(_,_)[K[37G[36G43))(_,_)[K[36G[35G43))(_,_)[K[35G[34G43))(_,_)[K[34G[33G43))(_,_)[K[33G(43))(_,_)[34G[33G[32G[31G[30G[29G[28G[27G[26G[25G[24G[23G[22G(42), rand(43))(_,_)[K[22G[42G | |
<console>:12: error: missing parameter type for expanded function ((x$1, x$2) => rand.map2(rand(42), rand(43))(x$1, x$2)) | |
rand.map2(rand(42), rand(43))(_,_) | |
^ | |
<console>:12: error: missing parameter type for expanded function ((x$1: <error>, x$2) => rand.map2(rand(42), rand(43))(x$1, x$2)) | |
rand.map2(rand(42), rand(43))(_,_) | |
^ | |
<console>:12: error: fpinscala.state.RNG.type does not take parameters | |
rand.map2(rand(42), rand(43))(_,_) | |
^ | |
<console>:12: error: fpinscala.state.RNG.type does not take parameters | |
rand.map2(rand(42), rand(43))(_,_) | |
^ | |
scala> [1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`v': val rand: Rand[Int] = RNG[24G[49G[1G[K (reverse-i-search)`va': val rand: Rand[Int] = RNG[25G[50G[1G[K (reverse-i-search)`val': val rand: Rand[Int] = RNG[26G[51G[1G[K (reverse-i-search)`val ': val rand: Rand[Int] = RNG[27G[52G[1G[K (reverse-i-search)`val r': val rand: Rand[Int] = RNG[28G[53G[1G[K (reverse-i-search)`val ra': val rand: Rand[Int] = RNG[29G[54G[1G[K (reverse-i-search)`val ran': val rand: Rand[Int] = RNG[30G[55G[1G[K (reverse-i-search)`val rand': val rand: Rand[Int] = RNG[31G[56G[1G[K scala> val rand: Rand[Int] = RNG[8G[33G[32G[31G[30G[29G[28G[27G[26G[25G[24G[23G[22G[21G[20G[19G[18G[17G[16G[15G[14G[13G[12G[13G[14G[15G[16G[K[8Gal rand[K[8Gl rand[K[8G rand[K[8Grand[K[8G[12G()[13G4)[14G2)[15G[16G | |
<console>:12: error: fpinscala.state.RNG.type does not take parameters | |
rand(42) | |
^ | |
scala> rand. | |
Rand boolean int map2 sequence | |
_double both intDouble nonNegativeEven toString | |
_ints double ints nonNegativeInt unit | |
_map double3 ints2 nonNegativeLessThan | |
_map2 doubleInt isInstanceOf randDoubleInt | |
asInstanceOf flatMap map randIntDouble | |
scala> rand.int[15G[K[14G[K[13G[Kint | |
int intDouble ints ints2 | |
scala> rand.int | |
res29: rand.Rand[Int] = <function1> | |
scala> rand.int()[17G4)[18G2)[19G[8G[20G | |
<console>:12: error: type mismatch; | |
found : Int(42) | |
required: fpinscala.state.RNG | |
rand.int(42) | |
^ | |
scala> rand.int(42)[19G[K[18G[K[17G[K[16G[K[15G[K[14G[K[13G[Kmap[15G[K[14G[K[13G[Kmap | |
map map2 | |
scala> rand.map2[16G[K[15G[K[14G[K[13G[Kmap2()[18Gr)[19Ga)[20Gn)[21Gd)[22G.)[23Gi)[24Gn)[25Gt)[26G,)[27G )[28Gr)[29Ga)[30Gn)[31Gd)[32G.)[33Gi)[34Gn)[35Gt)[36G[37G()[38G_)[39G,)[40G )[41G_)[42G[41G[40G[39G[43G | |
<console>:12: error: missing parameter type for expanded function ((x$1, x$2) => rand.map2(rand.int, rand.int)(x$1, x$2)) | |
rand.map2(rand.int, rand.int)(_, _) | |
^ | |
<console>:12: error: missing parameter type for expanded function ((x$1: <error>, x$2) => rand.map2(rand.int, rand.int)(x$1, x$2)) | |
rand.map2(rand.int, rand.int)(_, _) | |
^ | |
scala> rand.map2(rand.int, rand.int)(_, _)[42G[41G[40G[39G[40G[41G[42G )[43G=)[44G>)[45G )[46GS)[47Gm)[48Gp)[49G[48G)[K[48G[47G)[K[47Gi)[48Gm)[49Gp)[50G[49G)[K[49G[48G)[K[48G[47G)[K[47G[46G)[K[46G[45G)[K[45G[44G)[K[44G[43G)[K[43G[42G)[K[42G[43G()[44GS)[45Gi)[46Gm)[47Gp)[48Gl)[49Ge)[50G()[51G))[52G[51G4))[52G2))[53G[52G[51G[50G[49G[48G[47G[46G[45G[44GRSimple(42))[45GNSimple(42))[46GDSimple(42))[47G.Simple(42))[48G[8G[59G | |
<console>:12: error: missing parameter type for expanded function ((x$1, x$2) => rand.map2(rand.int, rand.int)(x$1, x$2)(RND.Simple(42))) | |
rand.map2(rand.int, rand.int)(_, _)(RND.Simple(42)) | |
^ | |
<console>:12: error: missing parameter type for expanded function ((x$1: <error>, x$2) => rand.map2(rand.int, rand.int)(x$1, x$2)(RND.Simple(42))) | |
rand.map2(rand.int, rand.int)(_, _)(RND.Simple(42)) | |
^ | |
scala> rand.map2(rand.int, rand.int)(_, _)(RND.Simple(42))[8G[Krand.map2(rand.int, rand.int)(_, _)(RND.Simple(42))[58G[57G[56G[55G[54G[53G[52G[51G[50G[49G[48G[47G[46G[45G[44G[43G[42G[41G[40G[39G _)(RND.Simple(42))[K[39G _)(RND.Simple(42))[40G+ _)(RND.Simple(42))[41G[8G[60G | |
<console>:12: error: not found: value RND | |
rand.map2(rand.int, rand.int)(_ + _)(RND.Simple(42)) | |
^ | |
scala> rand.map2(rand.int, rand.int)(_ + _)(RND.Simple(42))[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`S': rand.map2(rand.int, rand.int)(_, _)(RND.Simple(42))[64G[75G[1G[K (reverse-i-search)`Si': rand.map2(rand.int, rand.int)(_, _)(RND.Simple(42))[65G[76G[1G[K (reverse-i-search)`Sim': rand.map2(rand.int, rand.int)(_, _)(RND.Simple(42)) [1A[66G[1B[1G[1A[1G[K[K[B[2K[A (reverse-i-search)`Simp': rand.map2(rand.int, rand.int)(_, _)(RND.Simple(42))[1A[67G[1B[2G[1A[1G[K[K[B[2K[A (reverse-i-search)`Simpl': rand.map2(rand.int, rand.int)(_, _)(RND.Simple(42))[1A[68G[1B[3G[1A[1G[K[K[B[2K[A (reverse-i-search)`Simple': rand.map2(rand.int, rand.int)(_, _)(RND.Simple(42))[1A[69G[1B[4G[1A[1G[K[K[B[2K[A scala> rand.map2(rand.int, rand.int)(_, _)(RND.Simple(42))[48G[8G[Krand.map2(rand.int, rand.int)(_, _)[13G[Kint(42)[13G[Kmap2(rand.int, rand.int)(_, _)(RND.Simple(42))[39G[K + _)(RND.Simple(42))[59G[58G[57G[56G[55G[54G[53G[52G[51G[50G[49G[48G[47G.Simple(42))[K[47GG.Simple(42))[48G[60G | |
res34: (Int, fpinscala.state.RNG) = (-1265320244,Simple(197491923327988)) | |
scala> rand.map2(rand.int, rand.int)(_ + _)(RNG.Simple(42))[8G[9G[10G[11G[12G[13G[14G[15G[16G[17G[18G[19G[20G[21G[22G[23G[24G[25G[26G[27G[28G[29G[30G[31G[32G[33G[34G[35G[36G[35G)(_ + _)(RNG.Simple(42))[K[35G[34G)(_ + _)(RNG.Simple(42))[K[34G[33G)(_ + _)(RNG.Simple(42))[K[33Gd)(_ + _)(RNG.Simple(42))[34Go)(_ + _)(RNG.Simple(42))[35Gu)(_ + _)(RNG.Simple(42))[36Gb)(_ + _)(RNG.Simple(42))[37Gl)(_ + _)(RNG.Simple(42))[38Ge)(_ + _)(RNG.Simple(42))[39G[63G | |
res35: (Double, fpinscala.state.RNG) = (1.6159453596735485E7,Simple(197491923327988)) | |
scala> rand.map2(rand.int, rand.double)(_ + _)(RNG.Simple(42))[62G[61G[60G[59G[58G[57G[56G[55G[54G[53G[52G[51G[50G[49G[48G[47G[46G[45G[44G[43G[42G[41G[40G[39G[38G[37G[36G[35G[34G[33G[34G[35G[36G[37G[38G[39G[40G[41G[42G[43G[44G[43G _)(RNG.Simple(42))[K[43G- _)(RNG.Simple(42))[44G[63G | |
res36: (Double, fpinscala.state.RNG) = (1.6159452403264515E7,Simple(197491923327988)) | |
scala> rand.map2(rand.int, rand.double)(_ - _)(RNG.Simple(42)) | |
res37: (Double, fpinscala.state.RNG) = (1.6159452403264515E7,Simple(197491923327988)) | |
scala> rand.map2(rand.int, rand.double)(_ - _)(RNG.Simple(42))[62G[61G[60G[59G[58G[57G[56G[55G[54G[53G[52G[51G[50G[49G[48G[47G[46G[45G[44G[43G _)(RNG.Simple(42))[K[43G+ _)(RNG.Simple(42))[44G[43G[42G[41G[40G[39G[38G[37G[36G[35G[34G[33G[34G[35G[36G[37G[38G[39G[40G[41G[42G[43G[44G[43G _)(RNG.Simple(42))[K[43G[42G _)(RNG.Simple(42))[K[42G, _)(RNG.Simple(42))[43G[42G[41G(_, _)(RNG.Simple(42))[42G[43G[44G[45G[44G_)(RNG.Simple(42))[K[44G[45G))(RNG.Simple(42))[46G[8G[63G | |
res38: ((Int, Double), fpinscala.state.RNG) = ((16159453,0.5967354848980904),Simple(197491923327988)) | |
scala> rand.map2(rand.int, rand.double)((_,_))(RNG.Simple(42)) | |
res39: ((Int, Double), fpinscala.state.RNG) = ((16159453,0.5967354848980904),Simple(197491923327988)) | |
scala> rand.map2(rand.int, rand.double)((_,_))(RNG.Simple(42)) | |
res40: ((Int, Double), fpinscala.state.RNG) = ((16159453,0.5967354848980904),Simple(197491923327988)) | |
scala> rand.map2(rand.int, rand.double)((_,_))(RNG.Simple(42))[8G[Krand.int()[17Gr)[18Gn)[19Gg)[20G[21G | |
<console>:13: error: type mismatch; | |
found : scala.util.Random | |
required: fpinscala.state.RNG | |
rand.int(rng) | |
^ | |
scala> [1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`a': rand.int(rng)[25G[37G[1G[K (reverse-i-search)`al': val rand: Rand[Int] = RNG[26G[50G[1G[K (reverse-i-search)`a': rand.int(rng)[25G[37G[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`v': val rand: Rand[Int] = RNG[24G[49G[1G[K (reverse-i-search)`va': val rand: Rand[Int] = RNG[25G[50G[1G[K (reverse-i-search)`val': val rand: Rand[Int] = RNG[26G[51G[1G[K scala> val rand: Rand[Int] = RNG[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`v': val rand: Rand = RNG[24G[44G[1G[K (reverse-i-search)`va': val rand: Rand = RNG[25G[45G[1G[K (reverse-i-search)`val': val rand: Rand = RNG[26G[46G[1G[K (reverse-i-search)`val ': val rand: Rand = RNG[27G[47G[1G[K (reverse-i-search)`val r': val rand: Rand = RNG[28G[48G[1G[K (reverse-i-search)`val rn': val rng = new scala.util.Random[29G[60G[1G[K (reverse-i-search)`val rng': val rng = new scala.util.Random[30G[61G[1G[K scala> val rng = new scala.util.Random[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`v': rand.nonNegativeLessThan(44)(RNG.Simple(43))[38G[68G[1G[K (reverse-i-search)`va': val rand = RNG[25G[39G[1G[K (reverse-i-search)`val': val rand = RNG[26G[40G[1G[K (reverse-i-search)`val ': val rand = RNG[27G[41G[1G[K (reverse-i-search)`val r': val rand = RNG[28G[42G[1G[K (reverse-i-search)`val rn': val rng = RNG.Simple(42)[29G[53G[1G[K (reverse-i-search)`val rng': val rng = RNG.Simple(42)[30G[54G[1G[K (reverse-i-search)`val rng ': val rng = RNG.Simple(42)[31G[55G[1G[K scala> val rng = RNG.Simple(42)[8G[32G | |
rng: fpinscala.state.RNG.Simple = Simple(42) | |
scala> val rng = RNG.Simple(42)[8G[Krand.int(rng) | |
res42: (Int, fpinscala.state.RNG) = (16159453,Simple(1059025964525)) | |
scala> List()[13G1)[14G[15G.fi[17G[K[16G[K[15G[K[8GvList(1)[9GaList(1)[10GlList(1)[11G List(1)[12GaList(1)[13G List(1)[14G=List(1)[15G List(1)[16G[23G | |
a: List[Int] = List(1) | |
scala> a.fi[11G[K[10G[Kfi | |
filter filterNot find | |
scala> a.fi[11G[K[10G[Kfi | |
filter filterNot find | |
scala> a.fill()[15Gx)[16G[15G)[K[15G3)[16G[17G()[18G[8G[KList. | |
ReusableCBF canBuildFrom fill newBuilder toString | |
apply concat isInstanceOf range unapplySeq | |
asInstanceOf empty iterate tabulate | |
scala> List.fill()[18G3)[19G[20G()[21G2)[22G[23G | |
res43: List[Int] = List(2, 2, 2) | |
scala> List.fill(3)(2)[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`r': rand.int(rng)[24G[37G[1G[K (reverse-i-search)`ra': rand.int(rng)[25G[38G[1G[K (reverse-i-search)`ran': rand.int(rng)[26G[39G[1G[K (reverse-i-search)`rand': rand.int(rng)[27G[40G[1G[K (reverse-i-search)`rand.': rand.int(rng)[28G[41G[1G[K (reverse-i-search)`rand.': rand.int(rng)[28G[41G[1G[K (reverse-i-search)`rand.': rand.map2(rand.int, rand.double)((_,_))(RNG.Simple(42))[1A[28G[1B[7G[1A[1G[K[K[B[2K[A scala> rand.map2(rand.int, rand.double)((_,_))(RNG.Simple(42))[8G[9G[10G[11G[12G[13G[Kma[14G[K[13G[Kseq[15G[K[14G[K[13G[Ksequence()[22G[K[21G[K | |
def sequence[A](fs: List[fpinscala.state.RNG.Rand[A]]): RNG => (List[A], fpinscala.state.RNG) | |
scala> rand.sequence()[22GL)[23Gi)[24Gs)[25Gt)[26G()[27G))[28G[27Gr))[28Gn))[29Gg))[30G.))[31Gi))[32Gn))[33Gt))[34G,))[35G ))[36Gr))[37Gn))[38Gg))[39G,))[40G[39G))[K[39G.))[40Gi))[41Gn))[42Gt))[43G[8G[45G | |
<console>:13: error: value int is not a member of fpinscala.state.RNG.Simple | |
rand.sequence(List(rng.int, rng.int)) | |
^ | |
<console>:13: error: value int is not a member of fpinscala.state.RNG.Simple | |
rand.sequence(List(rng.int, rng.int)) | |
^ | |
scala> rand.sequence(List(rng.int, rng.int))[8G[K[1G[K (reverse-i-search)`': [1G[K (reverse-i-search)`m': val rng = RNG.Simple(42)[40G[48G[1G[K (reverse-i-search)`ma': rand.map2(rand.int, rand.double)((_,_))(RNG.Simple(42))[1A[30G[1B[4G[1A[1G[K[K[B[2K[A (reverse-i-search)`map': rand.map2(rand.int, rand.double)((_,_))(RNG.Simple(42))[1A[31G[1B[5G[1A[1G[K[K[B[2K[A (reverse-i-search)`map2': rand.map2(rand.int, rand.double)((_,_))(RNG.Simple(42))[1A[32G[1B[6G[1A[1G[K[K[B[2K[A scala> rand.map2(rand.int, rand.double)((_,_))(RNG.Simple(42))[13G[8G[Krand.map2(rand.int, rand.double)(_ - _)(RNG.Simple(42))[43G[K+ _)(RNG.Simple(42))[33G[Kint)(_ + _)(RNG.Simple(42))[47G[KD.Simple(42)) | |
<console>:12: error: not found: value RND | |
rand.map2(rand.int, rand.int)(_ + _)(RND.Simple(42)) | |
^ | |
scala> rand.map2(rand.int, rand.int)(_ + _)(RND.Simple(42))[13G[Ksequence(List(rng.int, rng.int))[44G[43G[42G[41G[40G[39G[38G[37G[36G[35G[34G[33G[32G[31G[30G[29G.int, rng.int))[K[29G[28G.int, rng.int))[K[28Ga.int, rng.int))[29Gn.int, rng.int))[30Gd.int, rng.int))[31G[32G[33G[34G[35G[36G[37G[38G[39G[40G[39G.int))[K[39G[38G.int))[K[38Ga.int))[39Gn.int))[40Gd.int))[41G[8G[47G | |
res46: rand.Rand[List[Int]] = <function1> | |
scala> rand.sequence(List(rand.int, rand.int))()[48Gr)[49Gn)[50Gg)[51G[52G | |
res47: (List[Int], fpinscala.state.RNG) = (List(16159453, -1281479697),Simple(197491923327988)) | |
scala> rand.int()[17Gr)[18Gn)[19Gg)[20G[21G | |
res48: (Int, fpinscala.state.RNG) = (16159453,Simple(1059025964525)) | |
scala> rand.int(rng)[20G[K[19G[K[18G[K[17G[K[16G[K[15G[K[14G[K[13G[Kin[14G[K[13G[K_[13G[K_ | |
_double _ints _map _map2 | |
scala> rand._n[14G[Kints[17G[K[16G[K[15G[K[14G[K[13G[K_ints | |
def _ints(count: Int): RNG => (List[Int], fpinscala.state.RNG) | |
scala> rand._ints()[19G5)[20G[21G | |
res49: rand.Rand[List[Int]] = <function1> | |
scala> rand._ints(5)()[22G5)[23G[22G)[K[22Gr)[23Gn)[24Gg)[25G[26G | |
res50: (List[Int], fpinscala.state.RNG) = (List(16159453, -1281479697, -340305902, -2015756020, 1770001318),Simple(115998806404289)) | |
scala> | |
[0m[[32msuccess[0m] [0mTotal time: 14005 s, completed 2015/07/14 23:58:48[0m | |
> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment