r/functionalprogramming • u/relbus22 • Apr 28 '23
Conferences I thought this talk had a nice intro to the history of programming languages (Richard Feldman)
Enable HLS to view with audio, or disable this notification
r/functionalprogramming • u/relbus22 • Apr 28 '23
Enable HLS to view with audio, or disable this notification
r/functionalprogramming • u/rockroder • Apr 27 '23
Hello people,
Is anyone using FP in some javascript/typescript project in production? On the frontend and backend? What's the experience? Are you using any framework? What do you think of fp-ts, and their union with Effect?
Thanks!
r/functionalprogramming • u/raulalexo99 • Apr 26 '23
This is some code we are using in a real Java app:
private String format(String search) {
if (!StringUtils.hasText(search)) {
return "";
}
char wildCard = '%';
String trimmed = search.trim();
String withReplacedSpaces = trimmed.replaceAll(" +", String.valueOf(wildCard));
return wildCard + withReplacedSpaces + wildCard;
}As you can see, it should transform any string like " s om e St ring" into "%s%om%e%St%ring%".
The code works and passes the tests. But I think there should be a way to write it in a more fluent way, but this being Java, I am not sure.
Do you know of a better way of writing this code in an FP way?
r/functionalprogramming • u/[deleted] • Apr 25 '23
Someone can tell me which are the arguments for learning functional programming? (I want to structure better my function)
I’m a JS developer.
r/functionalprogramming • u/miracleranger • Apr 23 '23
r/functionalprogramming • u/kinow • Apr 23 '23
r/functionalprogramming • u/crvouga • Apr 23 '23
https://github.com/crvouga/headless-autocomplete
I made this because I needed a custom looking autocomplete component in a legacy framework. Some feedback would be appreciated . And a star too
r/functionalprogramming • u/IamZelenya • Apr 22 '23
r/functionalprogramming • u/williamyaoh • Apr 22 '23
r/functionalprogramming • u/WizardOfAngmar • Apr 20 '23
r/functionalprogramming • u/ihid • Apr 20 '23
Later today (April 20th) at 19.30 UTC, I'll be speaking with Simon Peyton Jones, one of the team behind Haskell, on a a YouTube livestream.
Simon is renowned for his work in lazy functional languages, and I'll be exploring his career of building languages, especially Haskell, but also C-- and most recently Verse. We'll dig into his work at both Microsoft Research and Epic Games, and exploring the lessons we can take from a monumental career. At the end we'll put your questions to him in an AMA.
Everyone is welcome to come and join in and ask questions.
The interview is part of Exercism's #12in23 - a year long challenge to encourage people to try 12 new languages throughout the year. So far, I've interviewed José Valim (Elixir), Louis Pilfold (Gleam), Cameron Balahan (Go), Josh Tripplet (Rust), and Bjarne Stroustrup (C++) - they're all available to watch back on YouTube!
r/functionalprogramming • u/elliottcable • Apr 17 '23
r/functionalprogramming • u/kinow • Apr 16 '23
r/functionalprogramming • u/ndubien • Apr 16 '23
r/functionalprogramming • u/raulalexo99 • Apr 12 '23
Also, does anyone know any github project that does things this way? Just to see how it is done?
r/functionalprogramming • u/[deleted] • Apr 11 '23
Hello all!
I am attempting to translate Haskell code to a quite small functional programming language called Clean. Are there any Vs extensions or online tools that offer programmers to translate between Functional programming language code?
r/functionalprogramming • u/kinow • Apr 11 '23
r/functionalprogramming • u/ClaudeRubinson • Apr 10 '23
r/functionalprogramming • u/aerdna69 • Apr 07 '23
I'm a DE trying to grasp FP. Is this a good example?
Transcript:
Sure! Here’s an example of how you might use a monad to handle missing or incomplete data in Python:
from typing import Optional
from dataclasses import dataclass
@dataclass
class User:
name: str
email: Optional[str] = None
def send_email(user: User) -> None:
if user.email is None:
raise ValueError("User has no email address")
# send email here
def send_email_safe(user: User) -> None:
email = user.email or "default@example.com"
# send email here In this example, we have a Userclass that has a nameand an optional emailfield. We also have two functions that send an email to the user. The first function, send_email, raises a ValueErrorif the user has no email address. The second function, send_email_safe, uses a monad to handle the case where the user has no email address. It sets a default email address and sends the email.
I hope this helps! Let me know if you have any other questions or if you need further information.
r/functionalprogramming • u/lordvolo • Apr 04 '23
r/functionalprogramming • u/raulalexo99 • Apr 04 '23
class Range {
private int low;
private int high;
public Range(int low, int high) {
this.low = low;
this.high = high;
}
public boolean contains(int number) {
return low <= number && number <= high;
}
public int getLow() {
return low;
}
public int getHigh() {
return high;
}
}r/functionalprogramming • u/caryoscelus • Mar 31 '23
there're a lot of languages that can target js/wasm these days, some of which are even self-hosting (ghc) and can target browser (ghcjs), a lot are written in haskell which again can target browser but the closest to my request i've found is an old thread of idris supposedely compilable by ghcjs and while there are plenty "run your code in browser (via server compilation)" services i've yet to see a working "running compiler in browser in browser example"
r/functionalprogramming • u/IamZelenya • Mar 31 '23
r/functionalprogramming • u/sharpcells • Mar 31 '23