Melbourne Meeting - Functional Programming

Join us for an exploration of Functional Programming and Category Theory by Paul McGee from our WA branch.

To quote Matthew Martin on the Guru99 website

Functional programming (also called FP) is a way of thinking about software construction by creating pure functions. It avoid concepts of shared state, mutable data observed in Object Oriented Programming.

Functional langauges empazies on expressions and declarations rather than execution of statements. Therefore, unlike other procedures which depend on a local or global state, value output in FP depends only on the arguments passed to the function.

What is Category Theory? It isn’t a topic we have discussed in a Delphi context. Definitions in relation to programming are hard to come by. Most references mention Haskell.

Come along and hear Paul talk about these topics, how they relate to each other and how they can influence our Delphi code.

Our meeting is online this month, with the Zoom connection opening around 6 pm (Melbourne time) .

  • Public Soapbox where attendees can ask questions, share discoveries or talk about code
  • Functional Programming and Category Theory with Paul McGee

Zoom meeting details will be posted shortly before the meeting. Check back to this topic for details.

Zoom details … ? :slight_smile:

No link >>

Anyone received the ZOOM Link yet (I haven’t).

Robert

I have just sent @Geoff an SMS in case he is not at his PC. He will get this if he is.

2 Likes

Join Zoom Meeting

Meeting ID: 845 5932 0983

Passcode: 774847

One tap mobile

+61731853730,84559320983#,*774847# Australia

+61861193900,84559320983#,*774847# Australia

Where’s the zoom link ?

I’ve sent Geoff an email as well…

Hi,

To finish off the ADUG Melbourne evening, some functional programming humour - Haskell at least.
(I have not verified much but the reference to “Mondads are like burritos” is included https://blog.plover.com/prog/burritos.html As per usual, there seem to be some invalid links. )

https://wiki.haskell.org/Humor


Humor - HaskellWiki
Who says functional programmers never have any fun? Here’s some of the hoaxes and other funny stuff from several sources. Ranjit Jhala performs Lambda Style!
wiki.haskell.org
|

  • |

Alex Moss.

1 Like

Thanks very much for having me. Here’s some addenda that I promised to link to:

Slides: Functional programming & Delphi .pdf - Google Drive

TMaybe example: Tmaybe_example_Sep2021.zip - Google Drive

Bartosz Milewski’s Category Theory for Programmers - Scala edition https://www.reddit.com/r/scala/comments/a08mrm/category_theory_for_programmers_scala_edition_pdf/

5min video on Monoids for web services - 2019 Ben Deane 'Identifying Monoids'.mp4 - Google Drive

3min video on the formalisation of Category Theory in maths - Categories by MathProofsable.mp4 - Google Drive

Past material: on functional programming and nullable types that didn’t make the slides …

Glen Kleidon - April 2017 - on “Adopting a Functional programming approach in Delphi “.
https://www.adug.org.au/meetings/melbourne-meeting-april-2017/

Glen on Github - GitHub - glenkleidon/functionalDemo: Demo of Functional Programming approach for Delphi

Craig Stuntz on Code Central - Coderage 3
https://cc.embarcadero.com/Item/26395
https://cc.embarcadero.com/Item/26324

Nullable Types - Coderage 3 - 2009
https://cc.embarcadero.com/Item/26326
https://cc.embarcadero.com/Item/26416
https://cc.embarcadero.com/Item/26916

LINQ for Delphi Prism :slight_smile:
https://cc.embarcadero.com/Item/27328

Cool, thank you Paul.

My head hurt a bit, but I want to look into it further.

1 Like

I forgot to say that the version of Craig Stuntz’s talk I put on YouTube isn’t best quality, and has a non-linear relationship between the video part and the audio part. I had resorted to recording the screen of a WinXP VM to capture it. :confused:

However, the best SWF player I have come across so far is from the Adobe website:
https://www.adobe.com/support/flashplayer/debug_downloads.html

Another thing I had thought to say - and forgot - was an analogy for functors via database operations.

Consider taking two different paths: Updating several records in memory, then storing in a db … vs storing those records in a db, then sending the updates as remote db operations.

It is in a sense the “same” operation, and should have the same end result no matter which path you use.
(But there can be practical advantages by going one way or the other)

[Another example: multiplying a bunch of numbers and taking the (math) Log … vs calculating Log on those numbers and adding them up.]

image

… maybe this is a direct example of not being able to express “value missing” in a data type.

I keep bumping into stuff.
Map, Reduce, and Filter are functors in this article referencing Teti & Spinetti’s Delphi Cookbook 3rd ed.

Spring4D (develop branch) has the ability to do map reduce etc via the TEnumberable class

I use this a lot - sadly Delphi’s anonymous methods do make it rather verbose.

BTW, the reason for TEnumberable existing (rather than just putting it on IEnumerable) is because delphi interfaces cannot have parameterized methods.