hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.1K
active users

#haskell

58 posts36 participants1 post today

#haskell question

given a list [Either String Int]

I want to return Right (sum of all the ints) or Left "no data" if there are no Rights

my solution is not too bad but I initially wanted to use some of kind foldr with a default value of type Left which is "overwritten" by Right if there are any

is this possible?

-----

sumSuccess :: [Either String Int] -> Either String Int
sumSuccess el
| length rl == 0 = Left "no data"
| otherwise = Right (sum rl)
where rl = Data.Either.rights el

#haskell advice needed

what is going on here? the question is asking what type x must be

x (&&) y

--

my thinking

if it were `x && y` then I would say both x and y have to be of type Bool because that is what is expected by &&

but (&&) must be something else. I tried

True (&&) True

in the ghci and it complains

I only know about "sections" which are partially applied operators eg (2*) and (+1)

so it (&&) is partially applied AND then it must be equivalent to && but I know I am wrong!

When I was coding professionally, I found it frustrating when people talk about how #haskell isn't used in production.

Now I found it plain baffling. Why is "used in production" perceived as some kind of indicator for quality? As if we haven't seen the most horrendous/inefficient/wrong code and languages used in production.
#programming

Here's a thrilling odyssey of a C/C++/Rust acolyte discovering that Haskell—yes, 💀 #HASKELL 💀—can do concurrency! Who knew that "self-indulgent academic baloney" could also be "fast, simple, correct"? 🙄 Get ready for groundbreaking insights that will inevitably make you reconsider every life choice you've ever made about #concurrency. 🥱
bitbashing.io/haskell-concurre #Cplusplus #Rust #ProgrammingInsights #TechOdyssey #HackerNews #ngated

Bit BashingConcurrency in Haskell: Fast, Simple, CorrectYet another programming blog. Thoughts on software and related misadventures.
Continued thread

Oriented Programming has been included in the development of the programming language from the very beginning. The language is a good compromise between, for example, two extremes like #clojure and on the other site #haskell, I think.

It seems to me to be a very practically orientated language. A compromise between security and simplicity.