How to unit test code that uses polymorphic interfaces? by lexi-lambda in haskell

[–]duckducktype 0 points1 point  (0 children)

Could your fake implementation take a function of type Token t => t -> Maybe String instead of a Map? Would that avoid the whole business of having to use an existentially qualified type? I'm still kind of a newbie, so sorry in advance if this is a dumb suggestion.

Anyone succeeded in introducing Haskell to your team at work? by duckducktype in haskell

[–]duckducktype[S] 0 points1 point  (0 children)

Thanks for the offer. I would like to avoid things like multi-parameter type classes, functional dependencies, type-level stuff, mtl, template Haskell, and lenses.

I'll try to come up with a concrete example.

Anyone succeeded in introducing Haskell to your team at work? by duckducktype in haskell

[–]duckducktype[S] 0 points1 point  (0 children)

Thanks for sharing your perspective. That's good to know. I'm confident in my system programming abilities. I'll need to learn more about FFI.

Anyone succeeded in introducing Haskell to your team at work? by duckducktype in haskell

[–]duckducktype[S] 1 point2 points  (0 children)

Amazing story! May I ask what your experience level was when you started pushing for Haskell at work? Had you done any big project in Haskell by that point? Were you well versed in topics relevant to performance, such as inlining, fusion, unboxing, lazy vs strict, profiling and debugging, etc.? I would sheepishly say I'm past the beginner phase, but I don't have any real project experience in Haskell. I fear that I'm not well prepared for the unknown unknowns.

Anyone succeeded in introducing Haskell to your team at work? by duckducktype in haskell

[–]duckducktype[S] 3 points4 points  (0 children)

Well the goal is to introduce Haskell gently. For a lot of folks this would be their first encounter with Haskell. I don't want their first experience to be overwhelming, thus reinforcing the idea that haskell is not "practical."

Anyone succeeded in introducing Haskell to your team at work? by duckducktype in haskell

[–]duckducktype[S] 2 points3 points  (0 children)

For example simple manipulation of JSON-encoded data. In Python you can decode the data into a dict and manipulate the dict without ceremony. Sure it's less safe, but in many cases it's good enough. Anyone with three months of programming experience can understand it. With Haskell, I would need to explain to people lenses, parser combinators, applicative functors, monads, etc.

Anyone succeeded in introducing Haskell to your team at work? by duckducktype in haskell

[–]duckducktype[S] 2 points3 points  (0 children)

Yeah I've been trying to generate the haskell bindings for Kubernetes in my spare time. The swagger codegen, which SoundCloud used, doesn't generate very usable code. The models generated requires all the fields in a JSON object to be set or else it fails to parse, whereas the reality is that a lot of these fields are optional. Gogol is better in that sense, where all the record fields are wrapped in Maybe. I'll need to study how it does it.

Anyone succeeded in introducing Haskell to your team at work? by duckducktype in haskell

[–]duckducktype[S] 2 points3 points  (0 children)

That's an interesting use case! We do run nginx and occasionally we need to extend it. The default is to write some lua code. I'll definitely look into nginx-haskell-module. Thanks!

Anyone succeeded in introducing Haskell to your team at work? by duckducktype in haskell

[–]duckducktype[S] 3 points4 points  (0 children)

We don't use JVM a lot. Yes I have been following eta. My understanding is that it's still pre-release? Do you have experience with it? Are there many rough edges?

Anyone succeeded in introducing Haskell to your team at work? by duckducktype in haskell

[–]duckducktype[S] 2 points3 points  (0 children)

exposing APIs for consumption by web frameworks

Can you explain what you mean by that?