## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• Jan 16 09:15
weihsiu commented #31
• Jan 16 09:15

weihsiu on master

Add Scala Through Lenses resour… Merge pull request #31 from jir… (compare)

• Jan 16 09:15
weihsiu closed #31
• Jan 16 08:49
jirijakes opened #31
• Jan 15 06:33
weihsiu commented #30
• Jan 15 06:32

weihsiu on master

add purely functional redis dri… Merge pull request #30 from yar… (compare)

• Jan 15 06:32
weihsiu closed #30
• Jan 15 04:33
yaroot synchronize #30
• Jan 15 04:22
yaroot opened #30
• Dec 18 2019 03:51

weihsiu on master

add FrameworkChoice finagle vs … Merge pull request #29 from che… (compare)

• Dec 18 2019 03:51
weihsiu closed #29
• Dec 18 2019 03:51
weihsiu commented #29
• Dec 17 2019 23:55
chenghsienwen opened #29
• Nov 08 2019 01:01

weihsiu on master

Add slides of How to contribute… Add slides of Scala & Spark(1.6… Merge pull request #28 from jim… (compare)

• Nov 08 2019 01:01
weihsiu closed #28
• Nov 07 2019 09:28
jiminhsieh opened #28
• Nov 07 2019 03:48
weihsiu commented #27
• Nov 07 2019 03:48

weihsiu on master

Move 2016's slides to folder 20… Move 2017's slides to folder 20… Move 2018's slides to folder 20… and 3 more (compare)

• Nov 07 2019 03:48
weihsiu closed #27
• Nov 07 2019 02:48
jiminhsieh opened #27
Yan
@yaroot
Walter Chang
@weihsiu
@yaroot that's abserdly low number of tested cases!
Yan
@yaroot
well, that's how the government keeps the number down. very effective
Jimin Hsieh
@jiminhsieh

One of the Scala courses at Coursera just updated the content. It added a whole new week which will dedicate to implicit related topics. It even mentioned type classes. And the content looks compelling. My only complaint is why didn't they add this earlier. :p

The official updated information: https://www.scala-lang.org/2020/03/10/functional-program-re-design.html

The above picture is the detail syllabus.
Walter Chang
@weihsiu
Nice!
Jimin Hsieh
@jiminhsieh
But I didn’t see any new video yet. Probably, we need to wait for their update.
Eddie Cho
@EddieChoCho
Interesting! Thanks for sharing!
Walter Chang
@weihsiu
scalamatsuri 2020 has been postponed till october this year https://blog-en.scalamatsuri.org/entry/2020/03/12/postponement
Wilber Chao
@cecol
I just aware that there are more and more ZIO topics in weekly Scala Times
pandaforme
@pandaforme
IMO, it is much easier to introduce ZIO in a company than cats
use it like perfect version of Future
jirijakes
@jirijakes

Reading an interesting paper about FP from 1982. It sounds like today:

The software development is in crisis and it's because imperative languages and their assignments and sequencing.

In mathematical equation $x^2-2x+1=0$, each occurence of $x$ is the same, does not suddenly change its value.

The last few years have seen a growing interest in functional languages.

Pretty cool :-)

https://www.jirijakes.eu/turner82.pdf

Walter Chang
@weihsiu
I still remember the confusion I had when I first learned programming: what the hell is "x = x + 1"?
I had my doubt since the very beginning ;)
jirijakes
@jirijakes
People have been having doubts for half a century. Not much changed, though, FP is still quite marginal :-D
Walter Chang
@weihsiu
i went through the entire sicp video series and it only introduced the "set!" operator towards the end of the series. the videos were shot in 1986.
Yan
@yaroot
yeah but you still havelet*/let/letrec
jirijakes
@jirijakes

I just read an announcement about a new version of interesting Haskell package called acme-dont.

It exponses only one function:

-- | Do not execute the argument.
don't :: Applicative f => f a -> f ()
don't _ = pure ()

The function makes sure that action is not executed:

main :: IO ()
main = don't $putStrLn "Hi!" Pretty cool, hm? :-) https://git.sr.ht/~jack/acme-dont Yan @yaroot ' may be put in any position, surprise Walter Chang @weihsiu too bad you still need to stick a "$" after "don't"; it would be perfect otherwise ;)
Yan
@yaroot
did some FFI with haskell this week, it's utterly unpleasant but the result is amazing
jirijakes
@jirijakes
If you enable BlockArguments pragma, you can do this:
{-# LANGUAGE BlockArguments #-}

main :: IO ()
main = don't do putStrLn "Hi"
Which part you found unpleasant? I had quite a good success with it…
Yan
@yaroot
where you need to manipulate the values in ptr and do pointer arithmetic, no on stack allocation, etc. I end up writing some C code instead of doing everything in haskell
jirijakes
@jirijakes
Uh. When one needs to do these things in Haskell? It wasn't just bindings to some C library?
Yan
@yaroot
It's pretty idiomatic I think
jirijakes
@jirijakes
Maybe. I am quite surprised that a library would require you to do so. Would you have some examples you could show?
Yan
@yaroot
operate arrays, foo->bar->marker += 1, and relying on macros, all kinds of things
jirijakes
@jirijakes
Ah, understand. Yeah, although this foobar example should be possible to do in Haskell, not too practical.
Yan
@yaroot
it's pretty easy, but mixed with other things it's not fun
jirijakes
@jirijakes

I see now.

I have been quite lucky because I have been only writing bindings for libraries that are quite easy to use without such low-level stuff. Basically it's just foreign imports.

It was a bit more difficult with a C++ library where I had to write extern "C" code.

Yan
@yaroot
there are some automatic ffi generator, haven't use one, just hsc2hs
the overall is positive, and basically kiss memory leak goodbye
Walter Chang
@weihsiu
This is so sudden! Carl Quinn of the Java Posse podcast fame, has passed away. It was in one of their podcasts over 12 years ago when Carl mentioned a new language called Scala that got me started in this journey. May he rest in peace. https://twitter.com/javaposse/status/1245583036588019715?s=20
Yan
@yaroot
RecordDotSyntax has been accepted ghc-proposals/ghc-proposals#282
Walter Chang
@weihsiu
@yaroot and fixing one of the bigger warts in Haskell. The thing is, using stack like I am now, even with nightly, I don't know when I'll be able to use it.
jirijakes
@jirijakes

It's not even done yet. And there will be one more round of approvals… It is going to take months, perhaps a year, for it to be available in GHC.

You can tell stack to use system GHC. So when we manage to install GHC with this new feature, stack should be able to use it: stack --system-ghc.

Walter Chang
@weihsiu
But I thought the whole point of using stack is to provide packages all compiled to a fixed version of GHC or am I missing something?
jirijakes
@jirijakes

I am not sure about relationship of GHC version and Stack.

I consider Stack to be rather a build tool that can do something extra over cabal and, using Stackage, it offers a set of packages that should work together. Besides that, it can also manage GHC installations but you can opt out of that (e. g. GHC is big and you don't want to download it again if it is already installed by your package manager).

Hm. But:

If you are using the --system-ghc flag or have configured system-ghc: true […], stack will use the first GHC that it finds on your PATH, falling back on its sandboxed installations only if the found GHC doesn't comply with the various requirements (version, architecture) that your project needs.

So, not sure at all :-)

Walter Chang
@weihsiu
So it sounds like even when I set my system GHC, stack might not honor it.
Yan
@yaroot
just use cabal and this: https://www.stackage.org/lts-15.6/cabal.config (I use ghcup to install ghc and cabal)
Yan
@yaroot
(arch messed up ghc several times, I've long give up using distro packages to manage these things)
Walter Chang
@weihsiu
I'm sticking with stack; plain cabal just gives me so many problems it's not worth it.
Yan
@yaroot
could you elaborate?
Walter Chang
@weihsiu
Stack gives me a curated set of packages of which I can use in any combination without version conflicts. The only downside is the lts version of stack lags behind the current GHC version by quite a lot, even though using mitigates the problem somewhat but it's still not ideal. Each stack project has it's own GHC which is also very convenient. I messed with cabal sandbox for the longest time: an experience I wish not to repeat.
Yan
@yaroot
it's basically what ghcup and freeze file do, use the freeze file from stackage and your project can be build by both.