Follow

my favorite nonidiomatic haskell thing i’d do was to define g (&.) f = \x -> f (g x) (you need to do some fucking around with the operator to make this work right but i forget the details) so you could write long function compositions in execution order like a shell pipeline

@aescling my initial reaction to this is that it makes it look like haskell was made by someone who went "let's make programming look more like math" instead of "let's make math look more like programming"

@manifold haskell was a language defined by consensus by computer scientists who wanted to package several ideas that were in vogue at the time into a single language

@manifold tbh haskell has made a lot of sacrifices in the service of pragmatism (yes, really); if you really wanna see programming that looks like math, try looking up algol sometime lmao

@aescling yeah, defining it as flip (.) seems more idiomatic :3c

@alyssa oh i just meant that (&.) (or whatever you would call it) is very much not idiomatic

though yeah that is a preferable definition to me

@aescling GHC does it! (i only know that because of a hoogle search i have not read any part of the GHC source code)

@aescling dunno. looks like it might be used in the parser? hoogle.haskell.org/?hoogle=(a%

annoyingly hoogle’s links do not actually work for the docs for internal GHC code

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.