Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

DEPENDENCY INJECTION

Name: Anonymous 2014-05-24 0:11

What's your opinion on DI? is it just enterprise overengineering shit or it actually makes your code better and testable?

Name: Anonymous 2014-05-25 5:57

>>31
He's only half-right, actually. He means that if you say

data Foo = A Int | B Double
data Bar = C Int | D Double | E Text


then there is no way to express that the types Foo and Bar share a subset of values (in fact, values of Foo form a subset of values of Bar). And it's also not possible to say

data Foo = A Int | B Double
data Bar = A Int | B Double | E Text


What he's wrong about is:

1) Haskell types are actually not disjoint, as they all share the "bottom" value.
2) With parametric polymorphism, typeclasses and existential types you don't really ever need subtyping
3) Instead of subtyping, Haskell has subclassing which achieves many of the same objectives
3) Subtyping is for OBJECTIVE-ORIENTED SCALABLE CLOUD-READY ENTERPRISE faggots anyway, as it hinders type inference.

>>32
Give me some of that crack you've been smoking, mate.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List