vascorsd, to programming
@vascorsd@mastodon.social avatar

You may not like it, but hear me out...

For new code using the newer weird white space syntax you should try to configure the formatter to give you 3 spaces as the indent.

It just makes everything better. Go and try 🫣 :catPOWER:

I tried it the other day before turning the newer syntax off completely and it looked much better than 2 spaces.

:blobpeek:

vascorsd,
@vascorsd@mastodon.social avatar

@dwardoric seeing too deep nesting and the code running off the screen to the right kinda screams at you to try and simplify it earlier and to move things to other functions 🤔

vascorsd,
@vascorsd@mastodon.social avatar

@ragb it's easy to mix them. For understanding when and how to use them you need a deep understanding of what they are meant to be used for, which newbies won't know or understand earlier in their career.

It happened a lot having parameters that you want to align and variable declarations and other things, but then having the tab key not expanding automatically to spaces means that you will use it in the middle of code to try to align things accidentally and inherently things will end up mixed.

philip_schwarz, to programming
@philip_schwarz@fosstodon.org avatar

just uploaded to https://fpilluminated.com 🚀🆕 : "A Sighting of filterA in Typelevel Rite of Passage" - based on a short extract from Rock the JVM's great video course

direct link: https://fpilluminated.com/deck/220

vascorsd, to programming
@vascorsd@mastodon.social avatar

And am extremely confused with some of new syntax. So if I have a enum with a case X I can't simply add a method for a specific case by just doing

enum AST
case Str(v : String) {
def newMethodIWantHere...
}

Seems very weird. Probably doing something wrong again 🤔😮‍💨

davesmith00000,
@davesmith00000@mastodon.gamedev.place avatar

@vascorsd This had me stumped for a long time, too! Here is how I think you're supposed to do it:

enum AST:  
 case Str(v: String)  
 case Num(i: Int)

object AST:  
 object Str:  
 extension (s: Str)  
 def foo: String = "value: " + s.v

AST.Str("Hello").foo  
// AST.Num(0).foo // Does not compile  
vascorsd,
@vascorsd@mastodon.social avatar

@davesmith00000 yeah that works. I ended up also using some of those extensions for the enum members as well for their companion objects. Like

extension (so: Str.type) {  
 def empty = ...  
}  

Kinda works, which is nice.

It's a little frustrating that I can't do

extension (_: Str.type) or extension (Str.type).

Extensions and enums kinda pair well with each other.

vascorsd, to programming
@vascorsd@mastodon.social avatar

Holy cow, I enabled strict equality on to see if it fixed my problems and now I have to manually add a "derives CanEqual" to every enum that I want to compare. Wth :aaaa: :welp: :wyd:

vascorsd, to programming
@vascorsd@mastodon.social avatar

I was pointed out yesterday to scodec for . It has some important things there that seem very useful and will likely use it.

It's just pretty sad that such a known, useful, stable library has most of the site with incomplete docs, broken links and incomplete released version numbers.

Example:

🫣

vascorsd,
@vascorsd@mastodon.social avatar

This library is better than official scala docs where I spent some hours the other day navigating the confusion of some Collections trying to understand the different ways I could create an ordered Map and basically giving up on the idea because I was unsure of what I should use.

I mean I eventually got the information I wanted, but it was from jumping between google, stack overflow, scala main page and a bunch of api docs.

But it didn't left with with any confidence for what I was doing.

😮‍💨

vascorsd,
@vascorsd@mastodon.social avatar

In general the official API docs are very very lacking and generally suck.

Methods have barely any description on them. There are no examples in most methods to understand them. Important methods and collections lack explanation of their characteristics related to performance, runtime, O notations of each etc. Barely describe where each is more appropriate vs others, etc.

🫣

dwardoric, to programming German
@dwardoric@chaos.social avatar

Another small point release for the Smederee, your frugal Darcs software forge. 🎉 😍

Just small things and lots of dependency updates.

https://smeder.ee/~jan0sch/smederee

vascorsd, to programming
@vascorsd@mastodon.social avatar

You know what, don't try to define an implicit conversion from String to List[Char] in .

I leave this advice to the world.
Keep your sanity.
I've warned you 😮‍💨.

given Conversion[String, List[Char]] = _.toList

I was looking at the errors for a few minutes wondering why the fuck 😅

ragb,

@vascorsd you lazy bastard ;)

vascorsd,
@vascorsd@mastodon.social avatar

@ragb now it's ugly, me no likes 😞

vascorsd, to programming
@vascorsd@mastodon.social avatar

It would be cool if the links in the docs of to "Source" would actually work 😮‍💨

lpil, to programming
@lpil@hachyderm.io avatar

Does anyone have data on how #Scala 3 adoption is going? 2 vs 3 package downloads per month, for example

vascorsd, to programming
@vascorsd@mastodon.social avatar

Sophie Collard CONTRAVARIANCE: INTUITION BUILDING AND EXAMPLES Scalar Conference 2024
https://www.youtube.com/watch?v=YSpkToittJY

#scala #programming #fp

vascorsd, to programming
@vascorsd@mastodon.social avatar

Nicolas Rinaudo THE DEBATABLY FREE MONAD Scalar Conference 2024
https://www.youtube.com/watch?v=Yci07bMTcsM

#fp #scala #freemonad #programming

alexelcu, to programming
@alexelcu@social.alexn.org avatar

This is old news, but there's now an official announcement — Apache Pekko is now a top-level project:

https://news.apache.org/foundation/entry/apache-software-foundation-announces-new-top-level-project-apache-pekko

#Scala #Akka #OpenSource

raquo, to programming
@raquo@mastodon.social avatar

Laminar v17 is finally here! 🎉Lots of new features across the board, as well as some bug fixes. #Scala #ScalaJS

https://laminar.dev/blog/2024/05/14/laminar-v17.0.0

cnx,
@cnx@larkspur.one avatar

w8 @tyil, i thought about the other laminar when i saw this

tyil,

@cnx I did too when I boosted it, should've read more carefully :(

deadblackclover, to programming
@deadblackclover@functional.cafe avatar

SPSC: A Small Positive Supercompiler

https://sergei-romanenko.github.io/spsc/

#supercompiler #scala

davesmith00000, to programming
@davesmith00000@mastodon.gamedev.place avatar

The UI work continues...

#scala #screenshotsaturday

vladimir_lu,
@vladimir_lu@hachyderm.io avatar

@davesmith00000 what are you using to build this?

davesmith00000,
@davesmith00000@mastodon.gamedev.place avatar

@vladimir_lu Indigo, it's a Scala.js game engine for functional programmers:

https://github.com/PurpleKingdomGames/indigo

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines