@gmorpheme: I didn’t now about mapcat
… :simple_smile:
@gmorpheme: anyway, you’re right coord-list is much more simple with a for
loop
(def files ["a" "b" "c" "d" "e" "f" "g" "h”])
(def coord-list
(for [rank (range 8 0 -1)
file files]
(keyword (str file rank))))
today I’m going to do some refactoring
Cool!
cool! I often find that I go first for something cunning with map, filter et al but for
ends up giving a much neater simpler expression
similarly - I always worry if I end up reaching for flatten
. More often than not it means I’ve lost track of the nesting going on and the rest of the expression is complicated enough that it’s blown my mental stack. Usually a signal that I’ve gone a bit too far down the wrong track.
sorry I only had time for a superficial glance through
@gmorpheme: core.typed helps me with keeping the nested structures handeable
sveri: Haven't used it myself, but it seems like prismatic schema is nice for this as well.
Might be a bit less intrusive and can also be applied gradually.
Jessica Kerrs talk on schema and gradual typing is worth its weight in gold.
Which might not be much, I mean, how much does a youtube video actually weigh
@slipset: I was tinkering between prismatic and core.typed a few times. What I like more about core.typed that it's a "compile time" check, not interfering with the runtime (not sure about prismatic though, I never really dived into it). However, I guess both do the job fine. Especially when coming back to a code base after a few days/weeks/months and you see the param "foo-m" which means it's a map with, yea, what is foo, ah, go back to that function, oh, there is a foo-m param too, goddamnit, what was that 😄
btw. core.typed should get gradual typing too, IIRC
AFAIK, you can switch schema on and off.
asked and answered by @borkdude
OTOH core.typed reminds me of haskell, having a bit of a geek factor 😄, but thanks, nice to know that :simple_smile: