Better HN
topnewbestaskshowjobs
Log inSign up

grumpyprole

4,485 karma · joined Jun 30, 2015 (11y ago) · 2,043 submissions

Submissions

comment 9y ago · link · parent

Why would type erasure affect the front end language? I'm generally interested.

comment 9y ago · link · parent

The point is that NPEs are a solved problem, just not in Java and Clojure. I am better able to stay focused on the real problems, as I never have to root out and fix bugs like this.

comment 9y ago · link · parent

Many universities outside of the US teach functional programming and Haskell. The community is open, international and a healthy mix between industry and academia.

comment 9y ago · link · parent

Yes 40+ fulltime Haskell devs in London and Singapore at Standard Chartered, with many other users writing Haskell.

comment 9y ago · link · parent

> turn off our brain and apply type verification everywhere ... type verification more like a religion than a tool.

A statically typed language can allow us to use dynamic typing if we want. For example, using a map of variants as a query result. Programming with maps of variants is even perfectly possible and pleasant in Haskell. Dynamic typing is not unique to dynamic languages!

comment 9y ago · link · parent

No true. I have to try and reverse engineer types whenever I use JSON APIs. The documentation provides only "samples". I literally have to experiment to find out what works with no guarantee it will keep working.

comment 9y ago · link · parent

What makes you assume Haskell is somehow more niche than Clojure? I would say it depends on the domain. Haskell is certainly more mature (~30 years) and has a lot more tutorials and literature.

comment 9y ago · link · parent

Classes and ADTs are both examples of Nominal typing, but Structural typing would offer a better fit for your example. Structural types can give types to queries without requiring any declaration or naming of the result type. Correctness in terms of the assumed fields can still be verified. Most of the anti-modular and boilerplate criticisms of static types do not consider structural typing, perhaps because industry has yet to discover them.

comment 9y ago · link · parent

Are we not confusing difficulty with familiarity? For me personally, as someone very familiar with FP, Idris was very approachable and easy to at least write simple proofs in.

comment 9y ago · link · parent

Plain text is an extremely simple, open and universal format, a local optimum in the design space. It has been with us in various forms for over 100 years ever since the first telegram systems. Ascii has existed since the early 60's and still exists today as a subset of UTF8. It will no doubt outlive almost any other binary encoding currently in existence.

comment 9y ago · link · parent

https://www.consul.io/api/catalog.html

comment 9y ago · link · parent

HCL is not used in the rest API though. So we have to integrate our apps using both HCL and JSON. It's also schemaless, which means we have to guess the API using various "samples".

comment 9y ago · link · parent

I don't understand why you have been downvoted. Many of these tools are very imperative and make assumptions about the starting state before they replay their updates. For a fully declarative solution, NixOS is the best I have seen.

comment 9y ago · link · parent

There were many many bugs, but this one had a significant effect on battery life: https://issuetracker.google.com/issues/37038331

For end users, it was a big regression from android 4, even if you personally found it "perfect".

comment 9y ago · link · parent

Off the top of my head: Knox secure folder, better split screen options (app pairs), app suspension, power saving modes, file manager, better camera app, many more configuration options.

comment 9y ago · link · parent

My android experience has been tarnished more by Google bugs than Samsung ones. Android 5 was a very buggy release, so much infrastructural change with little user benefit. IMHO Samsung should have skipped it entirely. I guess they bowed down to user and media pressure to always ship the latest android (although the media criticised them anyway for poor battery life, caused by Android 5).

comment 9y ago · link · parent

TouchWiz is better than stock android now. It has lots of additional useful features, especially in the areas of split screen and power saving.

comment 9y ago · link · parent

I don't see how passing in a logger object explicitly is the same, this is what OO DI frameworks try to avoid, otherwise you'd also have to pass it down to other functions used inside. The example above works just like a Reader Monad, but we are not tied to any specific logging implementation.

I guess the side effecting version is just to use some global registry to look up the logging implemention to use. But such code does not compose.

comment 9y ago · link · parent

I guess passing parameters down manually through all the constructors gets too painful. The language is not expressive enough for a Reader monad! :)

Java's static initialiser blocks are too dangerous whenever one has threads.

comment 9y ago · link · parent

Mainstream developers forget just how much time they invest in learning the latest fad frameworks with new ad-hoc concepts and terminology. I guess "Hardcore FP developers" are fed up with this state of affairs and are looking towards mathematics to provide guidance and common patterns/names. At least any knowledge of mathematics will not become outdated!

comment 9y ago · link · parent

Just like async/await, LINQ (and even enumerators) are tied to special syntax in the C# language. HKTs allow Haskell to provide very general resuable syntax, such as do notation.

What I meant by "polymorphic programs" as an alternate to DI, is something like this:

doStuff :: HasLogger m => Input -> m Output

The effectful function "doStuff" above is polymorphic with respect to which logging implementation is used, it could even be one that uses IO. All made possible with HKTs.

comment 9y ago · link · parent

As a counterexample, C# needed expensive language extensions to accommodate both LINQ and Async/await. Both can be implemented in Haskell purely as a library, thanks to HKTs.

Both Java and C# tend to rely heavily on frameworks such as Spring to workaround issues with the expressivity of the languages. This causes problems when one needs two frameworks (they don't in general compose). In Haskell, HKTs allow one to write polymorphic programs that are parametric with respect to certain behaviours and dependencies, no dependency injection framework needed.

Please don't judge Haskell using Scala and scalaz.

comment 9y ago · link · parent

Glad to hear it!

comment 9y ago · link · parent

I'd argue that any schema is a type system of sorts.

comment 9y ago · link · parent

Yes it's true that retrofitting better type systems into existing languages may not be low-hanging fruit. But developers have shown a willingness to adopt new languages when they see clear benefits.

comment 9y ago · link · parent

In retrospect, HKTs are arguably Haskells greatest innovation, enabling extremely general abstractions and huge amounts of code reuse.

comment 9y ago · link · parent

Our industry has not yet even scratched the surface of what types can offer: Types for enforcing architectures and controlling effects, types for checking correct use/free of scarce resources, types for verifying protocol implementations etc etc. Currently, half the industry is using schema-less json and dynamic languages; so really it is far too early to generally talk about any diminishing returns.
1
505152
69