freddi(Yuki Aki)
October 25, 2020
610

Recap Pointfree Vol. 1~3

https://gist.github.com/freddi-kit/112b3d13c6660339ddc85bd05ffc3c2b に Vol 3 で話す予定だったものあり

October 25, 2020

Transcript

1. 2020/10/25
Recap Pointfree Vol. 1~3
iOSΞϓϦ։ൃͷͨΊͷFunctional Architecture৘ใڞ༗ձ

2. ࠓճͷRecapͷ΍Γํ
• Pointfree Episode Vol 1 ~ 3 ͷ಺༰Λ΍͍͖ͬͯ·͢

• ͨͩ͠ɺ͢΂ͯ΍Δͷ͸͕࣌ؒڐ͢ݶΓ

• ొஃऀͷPlaygroundͰRecapͨ͠Γ༡ΜͰ͍͖·͢

• ղઆ͠ͳ͕Β΍ΔͷͰʮ͜͏͍͏ͷͰ͖Δʁʯ
ͱ͔৭ʑ஡ʑΛೖΕΔͷ͓͢͢ΊͰ͢

3. Pointfree ͱ͸
• ϓϩάϥϛϯάݴޠSwiftʹؔ͢ΔಈըͷγϦʔζ

• ؔ਺ܕϓϩάϥϛϯάͱSwiftʹ͍ͭͯղઆ

• Ұ෦Τϐιʔυ͸ߪಡ͕ඞਢ

• https://www.pointfree.co/

4. “pointfree” ͱ͸
• pointfree ͱ͍͏୯ޠࣗମʹ͍ͭͯ΋ҙຯ͕͋Δ

5. pointfree-style

• … So a 'points-free' deﬁnition of a function is one
which does not explicitly mention the points (values)
of the space on which the function acts.

• … ͳͷͰɺʮpointfreeʯ ʹΑΔఆٛͱ͸ؔ਺͕࡞༻
͢ΔۭؒͰɺ஋ʹ͸໌ࣔతʹ͸ݴٴ͠ͳ͍ఆٛΛ͞
͍ͯ͠·͢ɻ

6. pointfree-style
f x = x + 1
Sun

7. pointfree-style
• ஋(point) ʹݴٴ͠ͳ͍ॻ͖ํͩͱ͜͏ॻ͚Δ

• ͜Ε͕ઌఔͷ f ͷpointfree style
f = (+ 1)
Sun

8. “pointfree” ͱ͸
• ༨ஊͰ͋ΓDeep Dive͢Δͱ࿩͕௕͘ͳΔͷͰׂѪ

9. ࠓ೔࿩͢Pointfree ͷ Episode ʹ͍ͭͯ
• Vol 1. Functions

• Vol 2. Side Eﬀects

• Vol 3. UIKit Styling with Functions

10. Vol 1. Functions
• ͪΐͬͱมΘͬͨελΠϧͷؔ਺ʹؔ͢Δॻ͖ํ

• ͜Ε͔Βͷ Episode ΛݟΔ্Ͱඞਢͷ಺༰

• ৽͍͠ԋࢉࢠͷ঺հ

• |> ʹΑΔؔ਺ద༻, >>> ʹΑΔؔ਺ͷ߹੒

11. Vol 1. Functions
• ݸਓతͳײಈ఺

• ֤ԋࢉࢠʹΑΔ, left-to-right ͳίʔυͷ࡞੒

• ؔ਺Λ “Composition” ͢Δͱ͍͏ߟ͑ํ

12. Vol 2. Side Effects
• ʮ෭࡞༻Λ੍ޚ͢ΔʯʹϑΥʔΧεͨ͠ Episode

• print ͷྫ

• NumberFormatter ͷྫ

• ԋࢉࢠ >=> ʹΑΔEﬀectΛ࣋ͬͨؔ਺ͷ߹੒

• ԋࢉࢠ <> ʹΑΔؔ਺ͷ߹੒ɺ<> ͷ ΦʔόʔϥΠυ

13. Vol 3. UIKit Styling with Functions
• ࠓ·Ͱशͬͨ͜ͱΛͲͷΑ͏ʹ׆͔ͤΔ͔ʁ

• ࣮ࡍʹίʔυ͕Massive ʹͳΓͦ͏ͳUIViewͷྫ

14. ࢀߟࢿྉ
• https://www.pointfree.co/