From 78ad30f063defd0a6c57dadcc2660154e231426a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Pitu=C5=82a?= Date: Tue, 8 Oct 2024 11:27:52 +0200 Subject: [PATCH] polished content v3 --- ...-meme-vector-illustration_622487-2016.avif | Bin 0 -> 8462 bytes 2024-10-art-of-scala/slides.html | 39 +++++++++++------- 2 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 2024-10-art-of-scala/resources/cool-flork-meme-vector-illustration_622487-2016.avif diff --git a/2024-10-art-of-scala/resources/cool-flork-meme-vector-illustration_622487-2016.avif b/2024-10-art-of-scala/resources/cool-flork-meme-vector-illustration_622487-2016.avif new file mode 100644 index 0000000000000000000000000000000000000000..908f4ebbdf9ea8ed27ea7bdaaa39b6a8f09d6c4f GIT binary patch literal 8462 zcmXwz18^N&w1sbM+cujtwr$(CbCU)))=gt4ZLG$&)u^#;yK(aRzc+84IcKeJ&7L_M z000nMdjeg}yzQ(3|MZ_b*;#*avNQXSPo1nh&Hn5EiNe;>(f$7-0N`q8;rajh{~guU z&eQ3C0pj0FY3Jx-@gGTw0wDgKe}X{$KL-HF|3fM}JLmuX^nY8Ne_#dqU;l5`%$xno zf6?B~)!p@D+@1ncf`P%*0K*7Vq|1&&0S0}Uo_@Dmm1q~4b1q}d@!#i1;d13+(5%H~#$kO29 zZNHLpT!~ky>Q&%+!N$#0v>1-4gd9+R#f0Bw_?utA!>>?-uGD&=26nQ-kL+5M>t7*!X z2LR&lw^Ksz`lCFK@BCt?yEy_ospe#8 zwxSkyc`7d+lXH(d3^XSSxaQxGMpB*jHP5qcL6K7R0&X6^{#YdfkPsssd##JiO%3!f z2%xK_o%aW?r2GH^R)Rr5|MO$I9*)}Nu|P{kKl(w;RjEQ&3c>CIc}XQ1%U5Lq*LioV z@i51jN8=scc5@n1TA&BsxCbvTNjW?v#sT|hR_B7I|4nrde3;fTw(W zzHOX63#(}XZh$KB>MkbAc$xKW{{{IWdSdGQl*UE34T?fK`iCn#U0Pf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ALFeLz{_nwL?CGvw)Ey8Ex zZvb^0=`w16O#2-5Vke>B2CgAQ>TdFhyPm9qyMhIs=kO|>53TQF5|{a@%)~!N<6q=& z;PAVVW#7oqltxR6l3izkVqTSYV!Y%aBjdCcdYmWkh5In(GfIN)ouQ@G30t#=Icxbs6) z2>+;vVzh55jWZR+<7k7&A}#Aa?BU(Q%Ek!MrbEcq{5+-PSu6%KaDUz>nCxNpR% zkZm?5Z>r49U7n+mCMHH^8lu0kZU&vpW>H`cTyJK)m8E0ljPf@5ld^wT;Linp>5M94 zk^Gw&@Zocgk>qSuDs+GlP>vy8jHigher-Kinded
Data # Cool? -[TODO some funny pic] + ---- @@ -401,8 +401,6 @@

Higher-Kinded
Data

### Rule conditions -
Input[[t] =>> Expr[t => Boolean]]
- ```scala [1-4|5-8|10] object IsPositive extends Expr[Int => Boolean] { def evaluate: Int => Boolean = _ > 0 @@ -421,6 +419,8 @@

Higher-Kinded
Data

### Decision Input +Values passed during evaluation +
Input[[t] =>> t]
```scala [3|4|6] @@ -556,7 +556,9 @@

Higher-Kinded
Data

```scala def pure[A[_]](f: [t] => () => A[t]): Data[A] ``` -```scala [4-6] +
+ +```scala [|4-6] object Rule { def default[Input[_[_]]: HKD, Output[_[_]]: HKD](output: Output[OutputValue]): Rule[Input, Output] = { Rule( @@ -569,6 +571,8 @@

Higher-Kinded
Data

} ``` +
+ ++++ @@ -580,7 +584,9 @@

Higher-Kinded
Data

def mapK[B[_]](f: [t] => A[t] => B[t]): Data[B] } ``` -```scala [3,6] +
+ +```scala [|3|6] class Rule[..., Output[_[_]]: HKD](...) { def evaluateOutput(): Output[Value] = { output.mapK([t] => expr => expr.evaluate) @@ -591,6 +597,8 @@

Higher-Kinded
Data

} ``` +
+ ++++ @@ -598,7 +606,7 @@

Higher-Kinded
Data

### `HKD.map2` Merge two objects field by field -```scala +```scala [|2,3|5] def map2[A[_], B[_], C[_]]( dataA: Data[A], dataB: Data[B] @@ -606,18 +614,19 @@

Higher-Kinded
Data

f: [t] => (A[t], B[t]) => C[t], ): Data[C] ``` -```scala [3-6] +
+ +```scala [2|3-6] class Rule[..., Output[_[_]]: HKD](...) { - def evaluate(in: Input[Value]) = { - val evaluated: Input[Const[Boolean]] = - HKD.map2(matching, in)( - [t] => (expr, value) => expr.evaluate(value) - ) - ... - } + def evaluate(in: Input[Value]): Input[Const[Boolean]] = + HKD.map2(matching, in)( + [t] => (expr, value) => expr.evaluate(value) + ) } ``` +
+ ++++ @@ -754,7 +763,7 @@

Higher-Kinded
Data

```scala // Scala 3 -val foo: Context ?=> Int => [A] +val foo: Context ?=> Int => String // Scala 2 def foo(implicit ctx: Context): Int