Haskell

someodd,
@someodd@fosstodon.org avatar

Please share with me your wisdom on packaging and distributing software made with .

simonmic,
@simonmic@fosstodon.org avatar

@someodd, here's a few thoughts on #haskell packaging/distribution:

  • Support the widest range of GHC versions, deps, and all related tools you can reasonably manage, reducing unnecessary friction.

  • Get your packages and their dependencies into Stackage nightly and keep them there. From there they will trickle into Stackage LTS, which is a starting point for many packaging systems.

1/

simonmic,
@simonmic@fosstodon.org avatar
  • When you need to provide assets other than the executable, embed them eg with file-embed. The file lookup mechanism provided by Cabal is too fragile.

  • When you want to be cross platform: check your deps, avoid unix-only packages, avoid packages that require external C libs if possible.

2/
#haskell

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

When building Servant applications with persistence, a common (?) pattern is to request a database connection from a pool in the callback we pass to "hoistServer" https://hackage.haskell.org/package/servant-server-0.20/docs/Servant-Server.html#v:hoistServer and then pass the connection down to the handler using ReaderT https://github.com/danidiaz/comments-project/blob/3bb720124b31f0a8e351751bdcc6651ed75d9e27/comments/lib/Comments/Runner.hs#L57
It works, but I'm kinda unhappy about it because it forces you to use ReaderT in those intermediate components that lie between the top-level handler and the repository component which actually uses the connection. 😕

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

You might say "Well, that's not a problem, just make those intermediate components that don't care about the connection polymorphic over MonadUnliftIO! Later, when composing the application, they will be injected a repository that does know about the ReaderT and the connection. Problem solved."

That's true, but what if I wanted those intermediate components to be as dumb as possible? Just plain records of functions in IO, no monad transformers, and no polymorphism over the monad, either?

DiazCarrete, (edited )
@DiazCarrete@hachyderm.io avatar

"I got rid of ReaderT and now my application is hanging by a thread"
https://discourse.haskell.org/t/i-got-rid-of-readert-and-now-my-application-is-hanging-by-a-thread/9330

leanpub,
@leanpub@mastodon.social avatar

Finding Success (and Failure) in Haskell by Type Classes is on sale on Leanpub! Its suggested price is $35.00; get it for $12.50 with this coupon: https://leanpub.com/sh/4sG8LBPo

kosmikus,
@kosmikus@functional.cafe avatar

At Well-Typed, we are currently looking for a new #Haskell developer (possibly more) to join our team: https://well-typed.com/blog/2024/04/haskell-development-job-with-well-typed/

nmeum,
@nmeum@chaos.social avatar

Here is a preprint of fun paper that I've been working on which investigates the utilization of formal descriptions of instruction semantics to perform symbolic binary-level program analysis: https://doi.org/10.48550/arXiv.2404.04132

It includes a prototype implementation in Haskell which performs symbolic execution of RISC-V binary code without requiring the transformation to an intermediate representation (like LLVM IR).

#Haskell #RISCV

nmeum,
@nmeum@chaos.social avatar

This paper also includes an empirical comparison with prior work which I attempted to design in a reproducible way by using for the evaluation artifacts: https://doi.org/10.5281/zenodo.10925791

nmeum,
@nmeum@chaos.social avatar

The latest and greatest GHC version (9.8.2) is now available in the Alpine Linux Edge repositories and will be included in the upcoming 3.20 stable release.

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

Rel8 is a library that teeters between "looking at the instances provides much useful information" and "looking at the instances causes psychic damage".
https://hackage.haskell.org/package/rel8-1.5.0.0/docs/Rel8.html#t:Table

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

Relatedly, it would be a nice feature for Haddock if the instances local to a module could be sorted and grouped for the purposes of documentation and telling a story.

Like "These are the instances for tuples of various sizes" or "this is the base case and these are some instances that recurse".

DiazCarrete,
@DiazCarrete@hachyderm.io avatar
someodd,
@someodd@fosstodon.org avatar

Is there any future in languages like where AI makes code a factor of small frequently and easily replaced glue and scraps, where whatever is most trained on and most hackable, most easily replaced/iterable is king?

Are big pieces of software that benefit from the architectural assurances Haskell brings a dead paradigm?

AI is here to stay and I feel if something was not already in or out of orbit, it may never reach escape velocity

haskell_foundation,
@haskell_foundation@mastodon.social avatar

effectfully describes as a beautiful and amazing language. In episode 46 of , Wouter Swierstra and Joachim Breitner asked effectfully about how he found a new passion for programming. Listen to the episode here: https://haskell.foundation/podcast/46/

DiazCarrete,
@DiazCarrete@hachyderm.io avatar
DiazCarrete,
@DiazCarrete@hachyderm.io avatar

I have wondered about this myself:

(24:30) https://youtu.be/fFCcvsbCrH8?t=1468

"registry"-like approaches do seem to make it easier to reuse previously assembled application contexts because the wiring is done through a dictionary-like data structure. You can easily overwrite any key with a different implementation, or with a mock.

Relatedly, they also seem to make it easier to draw diagrams of component dependencies:
https://hackage.haskell.org/package/registry-0.6.1.0/docs/Data-Registry-Dot.html
https://github.com/danidiaz/cauldron/blob/700dafb64ed932eee8b66356e35196c586d7e24c/lib/Cauldron.hs#L123

jaror,
jaror avatar

@DiazCarrete That slide seems to misrepresent effect systems. It is easy to replace just runInputConst:

runAllEffects (runInputDifferently program)

The runInputDifferently effect handles the Input Config effect and it leaves an unused Input Config in the list of effects. So the runInputConst config handler in runAllEffects will not be used.

someodd,
@someodd@fosstodon.org avatar

Could I get some love, please?

I feel I'm developing lots of software in for and cool things.

A showcase of some of my projects: https://www.someodd.com/showcase

My GitHub (please follow, star): https://github.com/someodd

someodd,
@someodd@fosstodon.org avatar

@jaror I edited the link in the original toot or whatever. Is it not updated for you? Thank you for your help.

jaror,
jaror avatar

@someodd Yeah, I think kbin.social doesn't federate edits yet.

DiazCarrete,
@DiazCarrete@hachyderm.io avatar
DiazCarrete,
@DiazCarrete@hachyderm.io avatar
dneaves,
@dneaves@fosstodon.org avatar

Types in a programming language are important.

Compatible types across programming languages are also important.

What if you could easily make universal types across the languages in your stack, at the same time?

That's what I'm hoping to achieve with DataTypeTool. Still a very early product, but we're getting there. Currently producing valid (albeit not-yet-serializable) and

https://codeberg.org/dneaves/datatypetool

BoydStephenSmithJr,
@BoydStephenSmithJr@hachyderm.io avatar

@dneaves Any plans for how to support dependent types? TDD with Idris contains some practical uses for such types.

haskell,
@haskell@fosstodon.org avatar
haskell,
@haskell@fosstodon.org avatar

You can always try out snippets on https://play.haskell.org! Many libraries, like aeson, containers, vector, effectful, text and text-builder-linear, are readily available!

mangoiv, (edited )
@mangoiv@functional.cafe avatar

Is it just me or is this whole thing about „don’t do X if you don’t really know what you’re doing“ really counter productive? Many people live in fear of X now and don’t start thinking if X is an actual problem or learn what the problems are that could rise from X.

I see this very often in the ecosystem where the solution to doing X properly is often learnt in a few minutes investigation.

jaror,
jaror avatar

@mangoiv I know I've said that a few times. Two examples I can think of:

  • AllowAmbiguousTypes, GHC suggests this but you should probably just use Proxy arguments instead.
  • Typeable, people coming from OOP languages often want a typeof function, but 99% of the time there is a better way to structure your programs using simple ADTs.

I still think these are not learnt in a few minutes. Even if that was the case, the most important thing you should learn is that you shouldn't use them very often.

mangoiv,
@mangoiv@functional.cafe avatar

@jaror then perhaps it’d be nicer to tell them that, I think that’d be much nicer. I think there’s nuance to it.

maralorn,
@maralorn@chaos.social avatar

POV: Everytime I am starting a new app.

"Okay, let's just write a quick minimally featured proof of concept. So that I have something to build on. I can alwaye refactor this later."

...

10h later

"Wait, I just need to read this one more blog post so that I can complete my pro and con list about the 7 effect systems in question."

nikhil,
@nikhil@mastodon.acm.org avatar

Do Not Enter, Ye Imperators! Submit to The Monad, the One Way!

BoydStephenSmithJr,
@BoydStephenSmithJr@hachyderm.io avatar

@nikhil

data SignsT m a {-# LANGUAGE EmptyDataDecls #-}

instance Monad (SignsT m) where
pure _ = error "DO NOT ENTER"
join _ = error "ONE WAY"

haskell, (edited )
@haskell@fosstodon.org avatar

Thanks to @bgamari and the rest of the GHC release engineering team, GHC 9.10.1-alpha2 is available now!

https://discourse.haskell.org/t/ghc-9-10-1-alpha2-is-now-available/9197

underlap,
@underlap@fosstodon.org avatar

Adding Haddocks to Haskell code is deeply satisfying. I like the British humour too.

maralorn,
@maralorn@chaos.social avatar

@underlap would you be so kind and explain the humour for a non British person?

underlap,
@underlap@fosstodon.org avatar

@maralorn It's just a pun - haddocks are fish, often sold in fish and chips shops.

flora_pm, (edited )
@flora_pm@functional.cafe avatar

You asked for it, and it's here!

Flora v1.0.17 now allows you to look up executable names to find their package! No more wondering which package exposes gen-hie, refactor, or pandoc (it's pandoc-cli).

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