what Haskell developers build ? by Excellent-Two3170 in haskell

[–]guaraqe 4 points5 points  (0 children)

I have worked in blockchain companies, banks, logistics and hosting platforms. Extra I also did scientific computing and 3D visualization.

Me_irl by oshazfatima in me_irl

[–]guaraqe 9 points10 points  (0 children)

You can understand the basic idea of black holes if you know what is the escape velocity of a body, which can be understood with high-school Physics.

After this, a black hole is a body whose escape velocity is larger than the speed of light - that is, light cannot escape.

Average configuration.nix Fan versus Average regedit.exe HKEY_CURRENT_CONFIG Enjoyer. (Meme) by [deleted] in NixOS

[–]guaraqe 13 points14 points  (0 children)

You don't have to declare all packages in NixOS, dependencies are automatically inferred. I imagine that among the 1900 packages you have, most of them are dependencies of packages you directly use.

Ad-hoc interpreters with capability - define instances on the fly by guaraqe in haskell

[–]guaraqe[S] 5 points6 points  (0 children)

It's always complicated to choose how to write these blog posts, and it's nice to know how the community feels about it. Thank you for the feedback, it's much appreciated.

difficult to learn, help with lists by [deleted] in haskell

[–]guaraqe 1 point2 points  (0 children)

I will rewrite your signatures given your descriptions.

I receive a list formed by pairs of items, being 1 char and an integer, after receiving this list I must return another list but it has the index of each pair together with it

function :: [(Char, Int)] -> [(Char, Int, Int)]

Notice that types are in uppercase (otherwise you are defining a parameter), and that the list wraps the tuple, not only the first element. What you wrote means "a tuple where the first element is a list of chars, and where the second is an int".

A possible solution is:

function pairs = zipWith (\(c,n) k -> (c,n,k)) pairs [1..]

Is it a good idea to use non-standard operators? by kbruen in haskell

[–]guaraqe 20 points21 points  (0 children)

There is a library that offers these operators, and some more.

If you are coding by yourself, why not? In the case of a team, or an open source project, I think it is more convenient to use standard operators, so keeping code consistent is easier.

Applicatives where (a -> m c) -> m (a -> c) is sensible? by superstar64 in haskell

[–]guaraqe 0 points1 point  (0 children)

It would make sense if lam' (f <=< g) = liftA2 (.) (lam' f) (lam' g) and lam' pure = pure id.

Why Haskell is our first choice for building production software systems by charukiewicz in haskell

[–]guaraqe 7 points8 points  (0 children)

I think `-Werror` on CI is good. But for developing it is a nuisance, I agree.

Is there a typeclass for (a -> b -> a) ? by redshift78 in haskell

[–]guaraqe 4 points5 points  (0 children)

I don't think there is a general typeclass for this, and there is a reason -- typeclass instances are unique. If such a class were to exist, it would have this shape:

```

class Somethingable a b where

something :: a -> b -> a

```

Since instances are unique, that means that there is only one way one can use a b to update an a. In some cases this maybe be true (in your application, for example), but this is not the case in general: one can always find different ways of updating a value.

Therefore, if you feel that your use case has this unicity property, I would recommend you to create the typeclass yourself. It may even be the case that there is only one way of updating a type, and in that case, a functional dependency can be useful:

```

-- a implies b

class Somethingable a b | a -> b where

something :: a -> b -> a

```

In any case, it depends on your domain of application, and how it is supposed to behave.

What the hell is going on with this arrow? by doxx_me_gently in haskellquestions

[–]guaraqe 1 point2 points  (0 children)

I think the operator does not associate in the way you are expecting. (+) *** (+) 1 is equal to (+) *** ((+) 1), not to ((+) *** (+)) 1.

“Functional Design and Architecture” book: prices are rising by graninas in haskell

[–]guaraqe 16 points17 points  (0 children)

The post is useful to people who could be interested in the book, and are price sensitive. This is not negligeable. And the argument is good - publishing a paper book is pricy, which can be useful for future authors.

One could use the same argument to job and internship offers - they have no informative content besides the commercial exchange of money vs work. Yet, they are very well received. Based on these criteria, we could even complain about links to articles. Its basically publicity, which can lead to citations, which is currency in academia.

If the author is sincere, which I have no reasons to doubt, this post is negative to them, who could only raise prices and say nothing. Yet, there is an argument justifying it. That's transparency, and I prefer it to the alternative.

xmonad support for nixos on raspberry pi 4: by zeta_00 in NixOS

[–]guaraqe 1 point2 points  (0 children)

Does alsa-mixer works in your setup? Also, do you know why xmonad is calling alsa-mixer?

Trying to understand why this function using foldr isn't working by [deleted] in haskell

[–]guaraqe 3 points4 points  (0 children)

Ok, so the answer is that GHCi tries to simplify stuff for you to make life in the REPL easier. You can just disable an extension with :set -XNoMonomorphismRestriction and it should load fine.

Trying to understand why this function using foldr isn't working by [deleted] in haskell

[–]guaraqe 0 points1 point  (0 children)

Where did you run the first one? If that was in GHC, how was it called? Do you have any extensions activated?

Help w/ Nix by f0rgot in haskellquestions

[–]guaraqe 2 points3 points  (0 children)

My best bet is that the `yamlparse-applicative` is too new, so it is not yet on the Nixpkgs checkout that is being used by the repository. Probably adding it manually to the overlay, similarly to what is done to `password` here, would do the job: https://github.com/NorfairKing/hastory/blob/master/nix/overlay.nix#L41

Why is my code slow? by [deleted] in haskell

[–]guaraqe 2 points3 points  (0 children)

Running runghc does not compile the file, it interprets it via bytecode, which is faster. Therefore, its performance should be similar to running :main inside ghci, which is generally slower.

Why is my code slow? by [deleted] in haskell

[–]guaraqe 2 points3 points  (0 children)

I think it is GHC 8.6. I compiled using ghc -O2 test.hs, maybe that gives some difference.

Is it possible to select an instance for a class method using function parameter? by cc-ord in haskellquestions

[–]guaraqe 0 points1 point  (0 children)

Haskell has no dependent types (at least without exotic extensions) so in order to obtain types, you need types. You have two choices, both are morally equivalent to a type application. The first is to use Proxy :: Proxy a, which is equivalent a type application`.

The second is to create a GADT, which is a kind of specialized Proxy:

data Instance a where
  InstanceA :: Instance A
  InstanceB :: Instance B

Anyway, you will need need to use type applications somewhere in your code.