ADT through the looking glass – lenses, prisms and other optics in Scala
1–10 of 17 posts
Re: ADT through the looking glass – lenses, prisms and other optics in Scala
#2Re: ADT through the looking glass – lenses, prisms and other optics in Scala
#3Re: ADT through the looking glass – lenses, prisms and other optics in Scala
#4Re: ADT through the looking glass – lenses, prisms and other optics in Scala
#5Re: ADT through the looking glass – lenses, prisms and other optics in Scala
#6I mainly program in low-level imperative languages (mostly C/C++), and occasionally dabbled in some functional languages (like Ocaml and Elm). But I don’t really understand why you would need such a convoluted system to get/mutate some values in a data structure in Scala. Doesn’t Scala allow mutability throughout its language already (unlike Haskell)?
Re: ADT through the looking glass – lenses, prisms and other optics in Scala
#7I mainly program in low-level imperative languages (mostly C/C++), and occasionally dabbled in some functional languages (like Ocaml and Elm). But I don’t really understand why you would need such a convoluted system to get/mutate some values in a data structure in Scala. Doesn’t Scala allow mutability throughout its language already (unlike Haskell)?
Re: ADT through the looking glass – lenses, prisms and other optics in Scala
#8I like working in Scala quite a bit, but always wince at the "instead of using threading primitives consider this 10x more exotic immutable approach" lead-in. Does anyone here really work that way?
Re: ADT through the looking glass – lenses, prisms and other optics in Scala
#9I like working in Scala quite a bit, but always wince at the "instead of using threading primitives consider this 10x more exotic immutable approach" lead-in. Does anyone here really work that way?
The main reason is that your code is less buggy and easier to read and understand as your code base gets larger. You never have to worry if that variable is being modified somewhere else in your codebase because it simply isn’t.
Re: ADT through the looking glass – lenses, prisms and other optics in Scala
#10I like working in Scala quite a bit, but always wince at the "instead of using threading primitives consider this 10x more exotic immutable approach" lead-in. Does anyone here really work that way?
Not sure what threading primitives you're talking of, but it depends. In general Scala has very sane abstractions for dealing with concurrency.