|
motedek posted:is there an ide to write all the scala boilerplate? i'm curious about it but gently caress if i'm going to write stuff like this: as much as I hate scala and implicits, a lot of that boilerplate is stuff written in libraries so you don't have to write boilerplate to use them.
|
# ? Feb 11, 2014 18:26 |
|
|
# ? May 26, 2024 17:53 |
|
motedek posted:is there an ide to write all the scala boilerplate? i'm curious about it but gently caress if i'm going to write stuff like this: Scala doesn't really have a lot of boilerplate; that complex signature actually usually ends up getting expressed as: code:
For example in a project I'm working on I have this: code:
It looks intimidating due to some of the generic types but ultimately it's just a function that takes two parameters: A Request and a function (whose signature is output:Future[SimpleResult] = f(AuthenticatedRequest)). So it's actually just looking for a function that can ingest an AuthenticatedRequest and return a future, such as: code:
Secured(parse.json) { request => ... } into the actual invocation of the function invokeBlock above, but that's beyond the scope of this post. Damiya fucked around with this message at 20:23 on Feb 11, 2014 |
# ? Feb 11, 2014 20:07 |
|
motedek posted:is there an ide to write all the scala boilerplate? i'm curious about it but gently caress if i'm going to write stuff like this: You don't usually have to write defs like that for map. That one is the way it is so map can be defined generically in some real low level traits (like GenTraversableOnce) and still build and return the exact collection type the function was called from without reflection. On a regular collection that wasn't part of the standard libs, I would write something like this for map: code:
|
# ? Feb 11, 2014 20:34 |
|
scala: http://www.scala-graph.org/guides/core-initializing.html WkLkDiHyperEdge ~%#+#> key-weighted key-labeled directed hyperedge welp
|
# ? Feb 11, 2014 20:43 |
|
Malcolm XML posted:scala: http://www.scala-graph.org/guides/core-initializing.html i'm sure it's not as frightening if you actually know scala, but this was a bit of a shock
|
# ? Feb 11, 2014 20:45 |
|
takeaway: scala is all of the problems of c++ with none of the bennies
|
# ? Feb 11, 2014 21:16 |
|
now you're complaining about the same thing you defended in Haskell. these operators are even 'composed' like the Lens ones, like "%" seems to mean "weighted"; "#" is "key-<character before it>", "+" is "labeled". what's the difference?
|
# ? Feb 11, 2014 21:16 |
|
Deus Rex posted:now you're complaining about the same thing you defended in Haskell. these operators are even 'composed' like the Lens ones, like "%" seems to mean "weighted"; "#" is "key-<character before it>", "+" is "labeled". what's the difference? i'm not complaining it's just that scala has been touted as the common mans functional language and well if %%~ was bad ...
|
# ? Feb 11, 2014 21:21 |
|
Deus Rex posted:now you're complaining about the same thing you defended in Haskell. these operators are even 'composed' like the Lens ones, like "%" seems to mean "weighted"; "#" is "key-<character before it>", "+" is "labeled". what's the difference? oh i thought these were types like yeah let me iterate out all these fookin types mate real compositional in this bitch
|
# ? Feb 11, 2014 21:25 |
|
motedek posted:is there an ide to write all the scala boilerplate? i'm curious about it but gently caress if i'm going to write stuff like this: yeah i wasnt posting that to imply you need to usually write stuff like that in scala, im just making fun of its type system for being strictly worse than haskell's. for reference, the type signature of map in haskell is: code:
|
# ? Feb 12, 2014 02:45 |
|
MeramJert posted:yeah i wasnt posting that to imply you need to usually write stuff like that in scala, im just making fun of its type system for being strictly worse than haskell's. for reference, the type signature of map in haskell is: only bitches uses map code:
|
# ? Feb 12, 2014 03:18 |
|
you struck me as more of a <$> guy
|
# ? Feb 12, 2014 03:28 |
|
-spec map(fun((A) -> B), [A]) -> [B].
|
# ? Feb 12, 2014 03:33 |
|
MeramJert posted:you struck me as more of a <$> guy FamDav fucked around with this message at 06:44 on Feb 12, 2014 |
# ? Feb 12, 2014 03:42 |
|
now do fmap
|
# ? Feb 12, 2014 03:42 |
|
MeramJert posted:yeah i wasnt posting that to imply you need to usually write stuff like that in scala, im just making fun of its type system for being strictly worse than haskell's. for reference, the type signature of map in haskell is: cool thanks all. the scala examples tend to look awful but then so does most unfamiliar code.
|
# ? Feb 12, 2014 06:38 |
|
That wasn't even a particularly egregious Scala example. step up your game.
|
# ? Feb 12, 2014 06:50 |
|
sorry i dont know enough scala, would you please provide worse examples of common functions?
|
# ? Feb 12, 2014 06:54 |
|
most code look pretty terrible with 1 letter variables or if there's more than 4 variables in a single line.
|
# ? Feb 12, 2014 09:14 |
|
yo
|
# ? Feb 12, 2014 11:36 |
|
get this as an av with "XML is like violence: if it doesn't solve your problem, you're not using enough of it."
|
# ? Feb 12, 2014 14:37 |
|
http://www.java8.org/code:
code:
|
# ? Feb 13, 2014 02:08 |
|
What's the yospinion on steve yegge these days?
|
# ? Feb 15, 2014 03:38 |
|
programming languages are a lot like political beliefs, let me explain
|
# ? Feb 15, 2014 03:49 |
VanillaKid posted:programming languages are a lot like political beliefs they're all bad
|
|
# ? Feb 15, 2014 03:50 |
|
npm just deleted itself and took out most of my ~/prefix/lib/node_modules #4691 So now I've got to re-install npm without access to npm itself somehow. npm also took out nave in the fallout, so this will be super annoying.
|
# ? Feb 15, 2014 04:25 |
|
tef posted:npm just deleted itself and took out most of my ~/prefix/lib/node_modules #4691 what u get for using javascript
|
# ? Feb 15, 2014 04:38 |
|
fuckin a hibernate validator is a piece of poo poo. like i know we should have migrated to tomcat 7 by now but we haven't ok? was it really necessary to depend on el 2.2 for interpolating loving error messages? talk about overkill. too loving bad it's literally the only implementation of bean validation 1.1 which oh yeah jersey 2 has a dependency on so i couldn't use 1.0 if i wanted to. gently caress me
|
# ? Feb 15, 2014 04:42 |
|
Vanadium posted:What's the yospinion on steve yegge these days? he posts in coc and not yospos
|
# ? Feb 15, 2014 05:10 |
|
where it saysJava code:
|
# ? Feb 15, 2014 05:12 |
|
good enough
|
# ? Feb 15, 2014 05:17 |
|
Kevin Mitnick P.E. posted:what u get for using javascript it's a copy paste from here https://github.com/npm/npm/issues/4691
|
# ? Feb 15, 2014 06:40 |
|
AlsoD posted:http://www.java8.org/ nothing undecidable about that, no sir
|
# ? Feb 15, 2014 10:15 |
|
effectively final is the best thing ever because it's one less reason to write an actual final anywhere
|
# ? Feb 15, 2014 11:08 |
|
sure, immutability is goodish but monotonically increasing immutability is better there should be some real support for that rather than trying to make immutability work better
|
# ? Feb 15, 2014 11:15 |
|
Max Facetime posted:where it says doesn't it use (just guessing) the new dynamic dispatch opcode for both? what's the difference
|
# ? Feb 15, 2014 20:35 |
|
first one passes a method as a lambda directly, second one creates a lambda that calls the method i'm guessing
|
# ? Feb 16, 2014 01:26 |
|
Mr Dog posted:first one passes a method as a lambda directly, second one creates a lambda that calls the method that's a start, but there's more to it i'll give a hint and say that coming up with this was quite amusing: Java code:
|
# ? Feb 16, 2014 02:12 |
|
Max Facetime posted:that's a start, but there's more to it i assume action1 fails randomly because it binds to the current value of System.out and action2 works because it gets the value when it is run?
|
# ? Feb 16, 2014 03:26 |
|
|
# ? May 26, 2024 17:53 |
|
SavageMessiah posted:i assume action1 fails randomly because it binds to the current value of System.out and action2 works because it gets the value when it is run? I'd expect it to do the opposite: action1 relies on the 'out' currently in scope, and action2 builds a closure where 'out' is the potentially-failing one. Otherwise they implemented lambdas incorrectly. QuantumNinja fucked around with this message at 07:03 on Feb 16, 2014 |
# ? Feb 16, 2014 03:59 |