4,485 karma · joined Jun 30, 2015 (11y ago) · 2,043 submissions
comment 9y ago · link · parent
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
comment 9y ago · link · parent
comment 9y ago · link · parent
For end users, it was a big regression from android 4, even if you personally found it "perfect".
comment 9y ago · link · parent
comment 9y ago · link · parent
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
comment 9y ago · link · parent
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
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