Functional Programming

1228 readers
14 users here now

founded 2 years ago
MODERATORS
1
 
 

I just started to learn Ocaml to learn functional programming. I will use it to build a CLI that's mostly orchestrating other programs.

My experience is mostly in JS / TS, but I've also coded a good bit in Python and Lua.

Below, I provided a list of things I learned or focused on while using OCaml. But I feel like I must be missing something. This is only moderately different from what I'm used to in JS. I expected something more radical. Moreover, I constantly hear a lot of FP jargon (like "highly kinded types", monads, etc) that I feel am still missing.

So far, here's what I studied:

  • immutability
  • avoid side affects
  • static typing
  • recursion instead of loops
  • option / maybe
  • higher order functions
  • conditionals and other constructs as expressions, when they're statements in other languages
  • pipelines and functions as input —> output
  • currying
  • scoping with let

What am I missing?

2
3
4
5
6
7
8
9
 
 

A podcast with transcript which may help explain fp to laymen.

10
11
12
13
14
 
 

Hello fellow FP-Lemmyites. I'd love to hear stories about what got you interested in FP originally, and how you learned.

15
 
 

In part one, we discussed how OCaml’s locality mode enables safe stack allocation. In this post, we will explore additional modes for representing ownership.

https://blog.janestreet.com/oxidizing-ocaml-ownership/

16
 
 

My first language was Racket and so naturally I gravitated to the lispy untyped functional programming style even when I was using languages like Python or Java, but when I tried Haskell for the first time my mind was absolutely blown and I was a convert ever since. What are your thoughts?

17
18
19
 
 

I'd love to hear more about it. I'm a new grad who's done a bunch of internships using functional programming languages but didn't find a new grad position that does

20
 
 

Howdy, I remember a podcast where they have the example of Microsoft Excel as an example for an introduction to functional programming. I believe it was an SE Radio podcast on Clojure or that build tool it uses. It doesn't really matter.

I already understood functional concepts and try to use them where I can in Java and other languages. (It is easier to reason about immutable data and pure methods.) I found the metaphor of Excel very interesting though. Because that's basically what it is. I'm sure there are ways to have it not act functionally but the vast majority of the time it is, and I think more people have the basic vocabulary of Excel than functional programming.

Has anyone ever used this or heard of it being used as an example while teaching fp?

21
 
 

Rofi-Hoogle is a tool I wrote a couple of years ago to scratch a particular itch: I was often wanting to quickly remind myself of the name or types of functions while writing, and I didn't always want to search Hoogle or spin up a repl to figure out what I needed. I was already using rofi to quickly reference other information, so I decided to build an integration to let me reference a local hoogle DB with a single keystroke directly from my desktop.

22
 
 

FP is a big umbrella with a lot of interesting work happening. Let's help one-another stay up-to-date by sharing links of some of our favorite FP and FP-adjacent talks.

23
24
 
 

Hi everyone. I thought I'd kick off the functional programming community here by sharing an article from my own blog on Haskell's fixed point function.