News for hackers. Stuff that matters.
Re:Microsoft rewrote Q# compiler in Rust by progmetaldev on Thursday June 22, 2023 @05:58PM (#36439657)
I appreciate the response. As someone that struggles with higher-level math, am I going to get a benefit out of starting with Haskell? I have built financial systems in various languages, so my issue isn't necessarily how to code math functionality. It's more of the abstract concepts that get me.
Re:Microsoft rewrote Q# compiler in Rust by Jenk on Thursday June 22, 2023 @06:37PM (#36440143)
I believe you will, yes. You may not be able to jump right in to some of the deep discussions about type categories, I certainly can't, but I still have learned a lot from Haskell and both continue to use Haskell itself and use what it has taught me in other languages to my betterment.
Re:Microsoft rewrote Q# compiler in Rust by progmetaldev on Thursday June 22, 2023 @07:10PM (#36440489)
Thank you for the explanation and suggestion. Sounds like it will be worth my effort to at least learn, just for new ways of developing, and how that affects any other language I touch.
Re:Microsoft rewrote Q# compiler in Rust by Jenk on Friday June 23, 2023 @11:32AM (#36448276)
As a quick example, a lot of what @Iceland_jack has mentioned I can make sense of, but I wouldn't have been able to contribute to that. I guess it is a bit like learning a foreign language and I am at the point of being able to understand what a native speaker is saying to me, but my responses are probably garbled nonsense. :) However I am still confident that what I have learnt has empowered me to be a better developer.
Re:Microsoft rewrote Q# compiler in Rust by Iceland_jack on Thursday June 22, 2023 @11:37PM (#36442492)
The abstract concepts give you the tools to quickly classify a datatype. They are not limited to Haskell and let you ask the right questions of datatypes in any language.

The foundational concept is functoriality, i.e. mapping over the argument of a type. Whether a datatype has an instance of

1. (covariant) Functor

2. Contravariant functor

3. Functor+Contravariant (phantom argument), or

4. neither

says a lot about its structure and tells me what further questions I can ask (what hierarchies I can expect): A datatype can only be a Monad if is covariant. It can only be Divisible and Decidable if it is contravariant. If it is both (3.) then its argument is not used (phantom) and can be mapped to any type. If it is neither (4.) it can be invariant (where the argument appears in both positive and negative position: like the Endo datatype) or a more complicated datatype like GADT, which would require a more complicated functor.