aksharvarma, to programming
@aksharvarma@mathstodon.xyz avatar

Evolution of how I think of while :

  1. When I first learned "loops":

while (condition is true) {do these things, adjust things so a slightly new condition is checked}

// That's where I first saw infinite loop and how there are intentional infinite loops.

  1. A small step to move condition update out of the loop body:

for (i=0; i< N; i++) {do these things}

// After the couple of days it took to get used to them, I found them neater and closer to how I think of things.

  1. Most of the time, the i from before is indexing into something, so let's directly deal with the item being indexed:

for item in collection:
do stuff

After the few days to rewire syntax muscle memory, going back would decidedly feel like a step back.

I don't want to give up automatic (and transparent) out-of-bound checks.

  1. There are actually only about 3/4 things one does inside a loop:

map/fold/scan/filter function-to-call collection-to-traverse-through

;; Getting rid of explicit indexing was just step one.
-- After a few days/months/years, I now realize that it is more important and less buggy if I think only of the function to call (and whether I want to end up with a new (maybe pruned) collection, a single thing, or "both" (that's how I think of scans))


Alternatively, my evolution as I learned new languages idioms:
-->
or -->
-->
or --> ???

BoydStephenSmithJr,
@BoydStephenSmithJr@hachyderm.io avatar

@aksharvarma Loop bodies are F-algebras and the "collection" over which you loop is a fixpoint of F. The recursion-schemes library handles that when F is an endofunctor on the term/expression category in your language.

You can still apply algebra semantics for "higher" functors F (when F is "really"/also a [type-indexed] functor family) with the appropriate Kan extensions.

mangoiv, to haskell
@mangoiv@functional.cafe avatar

Shoutout to @hecate for https://flora.pm/.

It’s just so awesome to have a fast, modern UI for hackage that really suits all your needs!

koz, to haskell
@koz@chaos.social avatar

Fedi: do int2Word# and similar operations have a runtime cost? I assume 'no', but I'd like to be sure.

mangoiv, to haskell
@mangoiv@functional.cafe avatar
simonmic, to haskell
@simonmic@fosstodon.org avatar

I'm pleased to announce hledger 1.33.1, with several fixes,
installability improvements, and doc updates.

is free, fast, reliable, multicurrency, double-entry,
software for unix, mac, windows, and the web,
written in for reliability and longevity.
For help, join our chat or mail list: https://hledger.org/support

Jose_A_Alonso, to haskell
@Jose_A_Alonso@mathstodon.xyz avatar

The Haskell Unfolder Episode 24: generic (un)folds. ~ Edsko de Vries (@EdskoDeVries), Andres Löh (@kosmikus). https://www.youtube.com/live/QTgRKWGDVr0

kosmikus, to haskell
@kosmikus@functional.cafe avatar

The one-year anniversary episode of the is starting in about 15 minutes!

https://www.youtube.com/watch?v=QTgRKWGDVr0&list=PLD8gywOEY4HaG5VSrKVnHxCptlJv2GAn7&index=24

kosmikus, to haskell
@kosmikus@functional.cafe avatar

The is now 1 year old! In the anniversary episode, Edsko and I will return to the very first topic and consider (un)folds, but now in a more generic setting. Live on YouTube 2024-05-01 at 1830 UTC.

https://www.youtube.com/watch?v=QTgRKWGDVr0&list=PLD8gywOEY4HaG5VSrKVnHxCptlJv2GAn7&index=24

hackuador, to haskell
@hackuador@functional.cafe avatar

Brisbane Functional Programming Group May meetup, Tue 14th: v1 (Rob Ellen) + Do your taxes with (Fraser Tweedale). All curious minds are welcome!

https://www.meetup.com/brisbane-functional-programming-group/events/298454561/

mangoiv, to haskell
@mangoiv@functional.cafe avatar

I wanted to declare something of type Code m a -> m Exp so I can pass the type variable of the typed code to a function used within the untyped code (which I have to do because TTH will not allow me a polymorphic function where I don’t name all type variables in the AST within the Code) but of course this doesn’t work because „untyped code cannot appear in type splice“ ARGH

mybarkingdogs, to haskell
@mybarkingdogs@freeradical.zone avatar

, , National Weather Service: WARNING in this area until 11:15 PM CDT. Take shelter now in a basement or an interior room on the lowest floor of a sturdy building. If you are outdoors, in a mobile home, or in a vehicle, move to the closest substantial shelter and protect yourself from flying debris. Check media. Source: NWS San Angelo TX

haskell, to haskell
@haskell@fosstodon.org avatar

The GHC developers are very pleased to announce the availability of the release candidate for GHC 9.10.1.

https://discourse.haskell.org/t/ghc-9-10-1-release-candidate-1-is-now-available/9424

brokenix, to haskell
@brokenix@emacs.ch avatar

quoting @prophet
mli files are mostly used to constrain the visibility of definitions whereas hs-boot files are about allowing mutual recursion between modules (which OCaml doesn't support, even with mli files!)
But the mechanism by which they achieve their goals is nearly identical even though the perception of it is so vastly different.

I guess the conclusion to draw from this is that both sides are wrong: IMO, mli files are not nearly as good as OCamlers think they are, but hs-boot files aren't as ugly as Haskellers think either.
-- prettySrcLoc and prettyCallStack are defined here to avoid hs-boot
-- files. See Note [Definition of CallStack]

Backpack's design is primarily driven by compatibility considerations (“how do we build upon GHC's existing foundation?”), rather than elegance. In particular, Backpack doesn't eliminate those ugly .hs-boot files, it just automates and hides their generation and processing.

For all their faults, Standard ML and OCaml have pretty good support for modular programming. And, as the Modular Type Classes paper you linked shows, type classes can be built elegantly on top of a good modular foundation.

https://cohost.org/prophet/post/3251638-it-s-really-interest
https://haskell.fi.muni.cz/doc/base/src/GHC-Exception.html
https://twitter.com/lexi_lambda/status/1172629363730333697
https://news.ycombinator.com/item?id=11371130

someodd, to haskell
@someodd@fosstodon.org avatar

Do you as a language, lends itself to fast prototyping and iteration?

cloudyluna, to Furry
@cloudyluna@woof.tech avatar

Hewwo, I'm Luna! :nkoLove: and am new to Fediverse. I'm a housecat-fox hybrid :blobcat_nwn: :collar: :blobcatpats:. You can just call me Luna or Floof.

I'm a :heart_transgender: and my pronouns are she/they/it.

I also find smol animals like cats, domesticated rats, pigeons and guinea pigs to be super adorable :ablobcathappypaws:.

My hobbies are , and casually :blobfoxcomputer: and playing Stardew Valley, Skyrim, CDDA and Widelands. Occasionally I read epic fantasy, romantic or horror novels whenever I feel cozy :blabcat:. My knowledge in these aren't deep though :blobcatgiggle:.

I'm also a 🐧 user and fond of .

I mostly will be using Fediverse to share about my own journey on programming, sharing (boosting?) furry or cute arts and my own random (cat? meow?) thoughts in general.

On that note, I refrain from sharing suggestive content on my page and whenever I do, they will be tagged & marked with NSFW content warnings.

Ty for reading! : :blabcat: :blabfox:

DiazCarrete, to haskell
@DiazCarrete@hachyderm.io avatar

I've published "dani-servant-lucid2" on Hackage. It's a tiny package that provides a HTML content type for Servant, backed by the "lucid2" HTML library.
https://hackage.haskell.org/package/dani-servant-lucid2
https://github.com/danidiaz/dani-servant-lucid2

There was already an integration for an earlier version of lucid https://hackage.haskell.org/package/servant-lucid but not for lucid2. https://github.com/haskell-servant/servant-lucid/issues/26

Also, "dani-servant-lucid2" has a public sublibrary with extra definitions, but it seems as if Hackage doesn't display info for public sublibraries yet.

DiazCarrete, to haskell
@DiazCarrete@hachyderm.io avatar

In Servant, the ServerError type has an Exception instance
https://hackage.haskell.org/package/servant-server-0.20/docs/Servant-Server.html#t:ServerError
You might speculate that when throwing a ServerError using liftIO . throwIO in a Handler, the ServerError is automatically caught and served as a response, but it ain't so: it's treated as just another exception, and the response code is 500.

Instead, you should throw ServerErrors using "throwError", re-exported from the "Servant" module.
https://hackage.haskell.org/package/servant-server-0.20/docs/Servant.html#v:throwError

image/png

abucci, to ProgrammingLanguages
@abucci@buc.ci avatar

A weird thing about being 50 is that there are programming languages that I've used regularly for longer than some of the software developers I work with have been alive. I first wrote BASIC code in the 1980s. The first time I wrote an expression evaluator--a fairly standard programming puzzle or homework--was in 1990. I wrote it in Pascal for an undergraduate homework assignment. I first wrote perl in the early 1990s, when it was still perl 4.036 (5.38.2 now). I first wrote java in 1995-ish, when it was still java 1.0 (1.21 now). I first wrote scala, which I still use for most things today, in 2013-ish, when it was still scala 2.8 (3.4.0 now). At various times I've been "fluent" in 8086 assembly, BASIC, C, Pascal, perl, python, java, scala; and passable in LISP/Scheme, Prolog, old school Mathematica, (early days) Objective C, matlab/octave, and R. I've written a few lines of Fortran and more than a few lines of COBOL that I ran in a production system once. I could probably write a bit of Haskell if pressed but for some reason I really dislike its syntax so I've never been enthusiastic about learning it well. I've experimented with Clean, Flix, Curry, Unison, Factor, and Joy and learned bits and pieces of each of those. I'm trying to decide whether I should try learning Idris, Agda, and/or Lean. I'm pretty sure I'm forgetting a few languages. Bit of 6502 assembly long ago. Bit of Unix/Linux shell scripting languages (old enough to have lived and breathed tcsh before switching to bash; I use fish now mostly).

When I say passable: in graduate school I wrote a Prolog interpreter in java (including parsing source code or REPL input), within which I could run the classic examples like append or (very simple) symbolic differentiation/integration. As an undergraduate I wrote a Mathematica program to solve the word recognition problem for context-free formal languages. But I'd need some study time to be able to write these languages again.

I don't know what the hell prompted me to reminisce about programming languages. I hope it doesn't come off as a humblebrag but rather like old guy spinning yarns. I think I've been through so many because I'm never quite happy with any one of them and because I've had a varied career that started when I was pretty young.

I guess I'm also half hoping to find people on here who have similar interests so I'm going to riddle this post with hashtags:

#Coding #SoftwareDevelopment #ProgrammingLanguages #8086Assembly #BASIC #C #Pascal #perl #java #scala #LISP #Scheme #Prolog #Mathematica #ObjectiveC #matlab #octave #R #Python #Fortran #COBOL #Haskell #Clean #Flix #Curry #Factor #Unison #Joy #Idris #Agda #Lean #6502Assembly

BoydStephenSmithJr,
@BoydStephenSmithJr@hachyderm.io avatar

@abucci I didn't write an interpreter until college, but I also started with BASIC in the 80s.

Currently writing for work and (and Haskell) when I'm not on the clock. Previously did everything from PHP or PowerBuilder to C and C++ to Java and Scala or C#.

Really want a practical language based on Graded Modal Dependent Type Theory so putting some of my spare cycles into playing with that. Interested in having safe+easy lexical capture AND GC-free execution regions.

vascorsd, to haskell
@vascorsd@mastodon.social avatar
DiazCarrete, to haskell
@DiazCarrete@hachyderm.io avatar

friendship ended with ScopedTypeVariables, TypeAbstractions is my new best friend
https://serokell.io/blog/ghc-dependent-types-in-haskell-3

furmans, to FunctionalProgramming
@furmans@chaos.social avatar

We are super glad to inform you that LAMBDA WORLD CADIZ is BACK...

🗓️2-4 October 2024
📌Palacio de Congresos de Cadiz
🎟️Early Camarón at €150
🪩lambda.world

Should the best Rock-Funky-Hard SolYNaranjaS band make a noise there...? Should not ?

BoydStephenSmithJr, to haskell
@BoydStephenSmithJr@hachyderm.io avatar

Anyone want to volunteer a guide for when to use instead of in or ?

I'm wanting to provide an HFunctor (https://pursuit.purescript.org/packages/purescript-fix-functor/0.1.0/docs/FixFunctor#t:HFunctor) instance but the naive way to do that requires me to "invent" a Functor instance for the source type constructor -- thinking of adding a yoneda/coyoneda wrapper and I think either would work, but I'm not sure.

BoydStephenSmithJr, to haskell
@BoydStephenSmithJr@hachyderm.io avatar

> none of the modifying functors are the same as the type being defined, that is, we do not consider non-linear non-uniform recursion

Oh, fiddlesticks. I've been trying to use this paper for non-linear recursion. I think I might have to invent/discover instead of just mimic. I'm not as good at that! :P

Please send me your best references for non-linear non-uniform recursion since Blampied2000. Bonus points for code, but categorical abstract nonsense is fine, too.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • tester
  • kavyap
  • PowerRangers
  • hgfsjryuu7
  • magazineikmin
  • thenastyranch
  • rosin
  • mdbf
  • Youngstown
  • slotface
  • InstantRegret
  • khanakhh
  • GTA5RPClips
  • DreamBathrooms
  • anitta
  • vwfavf
  • normalnudes
  • ngwrru68w68
  • everett
  • ethstaker
  • osvaldo12
  • cisconetworking
  • Durango
  • Leos
  • tacticalgear
  • cubers
  • modclub
  • provamag3
  • All magazines