philip_schwarz, to programming
@philip_schwarz@fosstodon.org avatar

just uploaded to https://fpilluminated.com 🚀🆕 : "A Sighting of filterA in Typelevel Rite of Passage" - based on a short extract from Rock the JVM's great video course

direct link: https://fpilluminated.com/deck/220

Jose_A_Alonso, to FunctionalProgramming
@Jose_A_Alonso@mathstodon.xyz avatar
abcdw, to haskell
@abcdw@fosstodon.org avatar
joachim, to programming
@joachim@drupal.community avatar

I've just seen a #programming pattern in #PHP where a method could return two lists of things. Instead of doing that, it takes as a parameter a callable, and passes the two lists to the callable. Instead of:

[$a, $b] = getLists($param);
// Act on both lists.

we have:

$callable = function($a, $b) {
// Act on both lists
}
actOnLists($param, $callable);

Is that a #FunctionalProgramming pattern?

das_g,
@das_g@chaos.social avatar

@joachim Imposing a higher-order function where it just complicates things without any gain would (if at all) be an anti-pattern.

But it might be that the implementation of actOnLists is lazy w.r.t. the lists, which would improve performance in an otherwise strict (= eager) language in case not the whole lists are needed.

(Assuming getLists isn't a mere lookup but would have to actually produce (build / compute) the lists and their content.)

joachim,
@joachim@drupal.community avatar

@das_g Thanks for the analysis! actOnLists() isn't lazy, but it does need to make queries. Further complexity is that it actually retrieves more than one pair of lists. I imagine the higher-order function pattern was written here to avoid returning an array of arrays, or writing a value object class for just this one purpose. I'm not sure how much of a gain I consider that though, as I find the current pattern hard to get my head round.

Jose_A_Alonso, to FunctionalProgramming
@Jose_A_Alonso@mathstodon.xyz avatar

Free foil: Generating efficient and scope-safe abstract syntax. ~ Nikolai Kudasov, Renata Shakirova, Egor Shalagin, Karina Tyulebaeva. https://arxiv.org/abs/2405.16384 #FunctionalProgramming #Haskell

sgraf,
@sgraf@mastodon.online avatar

@Jose_A_Alonso Hmm, interesting. To me, the benchmarks especially so. If it was only for normalisation, it's pretty clear that NbE is and always will be the winner. But if I understand correctly, NbE has limits; for example it would not be so simple to implement a transformation pass like GHC's Simplifier using NbE, where you apply peephole optimisations such as case-of-case, inlining etc. to the program while traversing it. I wonder if @AndrasKovacs has tried NbE for such a pass?

vascorsd, to programming
@vascorsd@mastodon.social avatar
lpil, to programming
@lpil@hachyderm.io avatar

Gleam v1.2.0 is out! And oh boy is it a good one! You're gunna like it a whole bunch

https://gleam.run/news/fault-tolerant-gleam/

#gleam #erlang #elixir #release #functionalprogramming

flypaper,
@flypaper@autonomous.zone avatar

@lpil @andrew_chou Andrew, do you use Gleam? What for? Do you prefer it?

andrew_chou,
@andrew_chou@toot.cafe avatar

@flypaper @lpil not at the moment, but I really should! been following the project for a very long time so just happy for its continued growth and success :)

would say it's a proper choice for building web-based applications end-to-end, amongst other things 👍

jbzfn, to python
@jbzfn@mastodon.social avatar
aeveltstra, (edited ) to javascript
@aeveltstra@mastodon.social avatar

Hey there, #javascript folks and #functionalprogramming people! Would you argue javascript is, or isn’t a functional programming language? And: why?

jbzfn, to FunctionalProgramming
@jbzfn@mastodon.social avatar
jbzfn, to typescript
@jbzfn@mastodon.social avatar

🦾 Functional TypeScript #1: Algebraic Data Types | Injuly

"In functional programming, algebraic types are so ubiquitous that you would be hard pressed to find a language that doesn't support them. Strangely though, nothing about them demands that a language be functional by paradigm. That imperative languages have avoided ADTs for decades seems almost an accident."

https://injuly.in/blog/ts-adt/

Jose_A_Alonso, to haskell
@Jose_A_Alonso@mathstodon.xyz avatar

The Haskell Unfolder Episode 26: Variable-arity functions. ~ Edsko de Vries (@EdskoDeVries), Andres Löh (@kosmikus). https://www.youtube.com/live/5wbgRlzJYUU

leanpub, to php
@leanpub@mastodon.social avatar

Thinking Functionally in PHP by Larry Garfield is free with a Leanpub Reader membership! Or you can buy it for $25.00! http://leanpub.com/thinking-functionally-in-php

Jose_A_Alonso, to haskell
@Jose_A_Alonso@mathstodon.xyz avatar

The Haskell Unfolder Episode 25: from Java to Haskell. ~ Edsko de Vries (@EdskoDeVries), Andres Löh (@kosmikus). https://www.youtube.com/live/YwshlQXKO80 #Haskell #FunctionalProgramming

frankel, to FunctionalProgramming
@frankel@mastodon.top avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • megavids
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • provamag3
  • tester
  • Leos
  • JUstTest
  • All magazines