Size: a a a

Scala User Group

2020 February 27

Oℕ

Oleg ℕizhnik in Scala User Group
λλ
class collection[T: TraversableOnce] {}
or class collection[T[_]: Functor] {}
this advice has numerous errors, beware
источник

Oℕ

Oleg ℕizhnik in Scala User Group
Zeeshan Haider
collection has a method
def map(data: T): T = data.map(_.length)
this definition is nonsensical
источник

ZH

Zeeshan Haider in Scala User Group
Oleg ℕizhnik
this definition is nonsensical
Ok then what is your opinion?
источник

ZH

Zeeshan Haider in Scala User Group
Oleg ℕizhnik
this definition is nonsensical
O have a dynamic computation model based on which I run these transformations
источник

ZH

Zeeshan Haider in Scala User Group
I*
источник

λ

λλ in Scala User Group
Zeeshan Haider
Ok then what is your opinion?
you need just functor implementation for your Rdd
and than it is enought to have final class X[C: Functor](source: C)
источник

ZH

Zeeshan Haider in Scala User Group
λλ
you need just functor implementation for your Rdd
and than it is enought to have final class X[C: Functor](source: C)
But this is not just RDD I am talking about Iterator, Array, List here
источник

Oℕ

Oleg ℕizhnik in Scala User Group
Zeeshan Haider
O have a dynamic computation model based on which I run these transformations
Looks like "dymamic computation model" is "I write my code as if scala had no types"
We can help you with modelling, but we need simple but complete code samples about what your task is
источник

ZH

Zeeshan Haider in Scala User Group
Oleg ℕizhnik
Looks like "dymamic computation model" is "I write my code as if scala had no types"
We can help you with modelling, but we need simple but complete code samples about what your task is
Ok I can share that but this is isolated still you guys should be able to answer how to implement different collection types as generics in the same class right?
источник

Oℕ

Oleg ℕizhnik in Scala User Group
I think that you'll need to radically change your approach in order to get a typesafe solution.
источник

Oℕ

Oleg ℕizhnik in Scala User Group
For example RDD - is not a collection
источник

ZH

Zeeshan Haider in Scala User Group
Oleg ℕizhnik
I think that you'll need to radically change your approach in order to get a typesafe solution.
Ok now we are getting somewhere so my approach is wrong here right?
источник

Oℕ

Oleg ℕizhnik in Scala User Group
It simply can't be understood in terms of locally synchronous iterable container
источник

ZH

Zeeshan Haider in Scala User Group
How can I implement such methods that can implement transformations on any type?
источник

λ

λλ in Scala User Group
Oleg ℕizhnik
For example RDD - is not a collection
Are you shure ?
Here is explanation from documentation
A Resilient Distributed Dataset (RDD), the basic abstraction in Spark. Represents an immutable, partitioned collection of elements that can be operated on in parallel
источник

Oℕ

Oleg ℕizhnik in Scala User Group
So one approach is to us various specific typeclasses such as mentioned Functor, FunctorFilter, MonoidK, etc.

But this way requires pretty advanced scala knowledge.

Any other way to unify distributed collections with local one is no simplier.
источник

ZH

Zeeshan Haider in Scala User Group
Oleg ℕizhnik
So one approach is to us various specific typeclasses such as mentioned Functor, FunctorFilter, MonoidK, etc.

But this way requires pretty advanced scala knowledge.

Any other way to unify distributed collections with local one is no simplier.
I am a beginner in scala
источник

ZH

Zeeshan Haider in Scala User Group
λλ
Are you shure ?
Here is explanation from documentation
A Resilient Distributed Dataset (RDD), the basic abstraction in Spark. Represents an immutable, partitioned collection of elements that can be operated on in parallel
That was my understanding
источник

Oℕ

Oleg ℕizhnik in Scala User Group
λλ
Are you shure ?
Here is explanation from documentation
A Resilient Distributed Dataset (RDD), the basic abstraction in Spark. Represents an immutable, partitioned collection of elements that can be operated on in parallel
It could be understood as a collection semantically, but not as a collection in scala stdlib sense
источник

Oℕ

Oleg ℕizhnik in Scala User Group
What RDD really is : a recipe of a distributed computation
источник