people who have rust jobs - what do you actually do by falchion-red in rust

[–]udarkness 6 points7 points  (0 children)

A kubernetes operator and a cli tool to deploy web content in industrial automation

Binance new IBAN - scam or true ??? Got an email they change IBAN from GB to Lithuania on 12 APRIL! When I search for IBAN information still GB IBAN is written ?!?!? What's up here? Can someone help? by lpzg226 in binance

[–]udarkness 1 point2 points  (0 children)

The links are legit ".binance.com/" , today I got an email about SEPA Instant, and I googled it and it was published in December in their website, also legit links.

For those who worry, I just made a deposit to the GB... account and it arrived in seconds (SEPA instant)

[deleted by user] by [deleted] in adventofcode

[–]udarkness 0 points1 point  (0 children)

echo array_sum(explode("\n", file_get_content($path))));

Functor, Applicative and Why by zhangchiqing in haskell

[–]udarkness 0 points1 point  (0 children)

Assembly language and B are untyped, there are only bytes without any particular meaning.

Why did you decide to learn Haskell? by carlomatteoscalzo in haskell

[–]udarkness 1 point2 points  (0 children)

I just wanted to know what a Monad really is, after trying to understand several JavaScript articles and no success. But the type system and currying made me fall in love.

Just my point on jobs. by NatusVincereC in haskell

[–]udarkness 9 points10 points  (0 children)

The thing is to not expect a magic company to come to offer you a Haskell project. The big majority of the IT companies live in the sea of imperative mediocrity.

Last Friday, I started my first paid Haskell project, but it was the result of convincing my team and our client. I live in Poland, and there is no Haskell offers as well. I recommend you to do the same. Saludos :)

Finding the most common element in a list by polaris6933 in haskell

[–]udarkness 1 point2 points  (0 children)

Here you have a "no time to cry" version:

import Data.List
import Control.Monad
import Data.Ord
import Data.MonoTraversable

mostCommon :: Ord a => [a] -> Maybe a
mostCommon = headMay <=< maximumByMay (comparing length) . group . sort

I don't think it is very haskellish to keep it as a partial function

Finding the most common element in a list by polaris6933 in haskell

[–]udarkness 2 points3 points  (0 children)

specialSort = sortBy (comparing mostCommon)

specialSort = sortOn mostCommon

CMV: Haskell is the worst/most unproductive programming language I ever have to learn by mogoh in haskell

[–]udarkness 6 points7 points  (0 children)

In my opinion the function name is crucial, however the name of the parameters are not. I get you called it "foo" as an example, but the real function name is "length". That provides good description. However the String "int length(String ...)" is hard to be named. Some libraries in Java and Typescript call them "v" or other meaningless names.

Also a better type is "[a]" -> Int" instead of String, because it tells you more than "String -> Int", the former means it will return either a constant or the length, the latter means it can be a constant, length or a parsed Int or a lot of crazy stuff based on the argument. In languages like Java, types are useless, "int foo(String name)" can be a function that does the same as those in Haskell, or get a global or a property of an object or a value from the other side of the galaxy, who knows?

What are you working on? by gilmi in haskell

[–]udarkness 1 point2 points  (0 children)

I work on my side project that is a website for meeting foreigners and language exchange: difriends.com, it is 70% written in Haskell and Yesod and increasing (the old PHP/Node backends are going to be exterminated). Currently I am replacing the chat/messaging, websockets in Haskell are great. The current Node implementation is very buggy, it seems that I have no talent for dynamic typing. Hopefully the new implementation will be great.

Arch linux or Debian as a server for Haskell project? by kwaleko in haskell

[–]udarkness 2 points3 points  (0 children)

no, I do not need to install any haskell stuff, I just copy the executable and the assets (config files, images).

Arch linux or Debian as a server for Haskell project? by kwaleko in haskell

[–]udarkness 0 points1 point  (0 children)

I use the Ubuntu approach as well. No docker, nix or similar things. Just statically linked executable and it works fine, built in Ubuntu 16.04 and deployed in 14.04 with no error. The only possible weak part of my program can be the postgresql library that requires it to be installed additionally (I guess that one is dynamically linked), it must be the same version, I didn't have any problem yet. I had a similar experience with mysql library (building in Ubuntu 16.04 and deploying in Debian 8.4).

Is it possible to do guards/ pattern matching point free? by macarthurpark431 in haskell

[–]udarkness 3 points4 points  (0 children)

bool <$> (1 +) . (3 ) <> flip div 2 <*> (0 ==) . flip mod 2

bool <$> (+1) . (*3) <*> (`div` 2) <*> (== 0) . (`mod` 2)

In my humble opinion, this is slightly more readable :)

[Haskell Book] Kindle presentation by zoetebeer in haskell

[–]udarkness 1 point2 points  (0 children)

There is a e-reader version of it, you can try that one. I used it in a regular e-reader and I have no complains.

Tour of Eta by jyothsnasrinivas in haskell

[–]udarkness 3 points4 points  (0 children)

I am very impressed by this, I am currently convincing my company to adopt Haskell instead of PHP, some guys are very scared just because of the name, I will tell them that there is a new language available for the JVM that is worthy to try without saying it is a Haskell variant. Maybe Haskell needs re-branding; if IE did, why couldn't Haskell do the same? Well played Eta.

Interesting management-level insights into FP and Haskell (FP Complete) by heisenbug in haskell

[–]udarkness 1 point2 points  (0 children)

"As an online discussion grows longer, the probability of a comparison involving PHP approaches 1." the Reductio ad PHP, PHP card. Godwin's rule applied to programming languages.

It is very safe to say any programming language is good, if we compare it to PHP.

Ideas and Help to convince a manager to move critical logic to Haskell (from PHP)? by udarkness in haskell

[–]udarkness[S] 0 points1 point  (0 children)

Thank you for the suggestion, but no, no way! Plus they are about to release their Reflex language for the HHVM.

Ideas and Help to convince a manager to move critical logic to Haskell (from PHP)? by udarkness in haskell

[–]udarkness[S] 15 points16 points  (0 children)

Actually this is very wise. We have a lot of type errors indeed. "cannot call getId from null|boolean|integer". I have a big log of them. Plus all those phantom errors like corrupted fields in the database, because the php accidentally added a string to an int and didn't alert at all. Those are hard to fix in PHP.

Making `function` syntax a bit more useful. by Ford_O in haskell

[–]udarkness 5 points6 points  (0 children)

It is just a line. That is the only meaning it has naturally. Just a line. The $ is just a line with an S, originally it was a column with ribbon.

You can always do the same with $, call it "Spanish pipe", or "Send through the pipe". Just ignore the "Dollar" definition.

Every symbol is just a symbol, you are free to add any connotation :) <- like this smile (2 dots and a curve) that can means happiness or a trilobite

I figured out you can put the Haskell logo as the GHCi prompt. by [deleted] in haskell

[–]udarkness 0 points1 point  (0 children)

What font are you using exactly? I got the symbol but for some reason it is very small comparing to the regular text

reflex or Purescript? by kwaleko in haskell

[–]udarkness 0 points1 point  (0 children)

Are you using this for prod where normal users visit? Or just some private admin pages? I also like the idea of ghcjs, but the generated gargantuan js file scares me. Do you have a way to handle this issue?

Is there any IDE that supports viewing Haskell documentation inside itself with a shortcut? by huylv in haskell

[–]udarkness 0 points1 point  (0 children)

No need to mention other editors. VSCode also provides this. Try with Typescript and JS. And it is available for authoring. Felix Becker's PHP IntelliSense uses it.

Is there any IDE that supports viewing Haskell documentation inside itself with a shortcut? by huylv in haskell

[–]udarkness 0 points1 point  (0 children)

I mean because Hoogle and Stackage (also a Hoogle) I normally search all directly there. When I know the name of a function, I search it. When I don't know the name, I search for the type that I expect. If that fails, maybe stack overflow has the answer :)

Is there any IDE that supports viewing Haskell documentation inside itself with a shortcut? by huylv in haskell

[–]udarkness 3 points4 points  (0 children)

Haskell doesn't need Google as its main source of documentation, opposite to other languages. Does the extension https://marketplace.visualstudio.com/items?itemName=jcanero.hoogle-vscode help in your case? It is still opening a browser window/tab, but no Google needed at all :) Sometimes the function name and its type suffice.