jaror avatar

jaror

@jaror@kbin.social

All the side effects were never mentioned to me
I am innocent of uncontrolled abuse

koz, to haskell
@koz@chaos.social avatar

Someone who knows and ML: is there a writeup somewhere explaining how first-class modules (a la ML) can do similar things to Haskell type classes? I'm finding it hard to figure that out.

To give a more concrete case: suppose I wanted to write something like Control.Applicative, which provides an 'interface' Applicative with some methods, as well as functions that work for any Applicative. How would I do this with ML-style first-class modules?

jaror,
jaror avatar

@koz I would like to see such a comparison post too. In the meantime I found this stackoverflow question which contains a way to do it using an ML functor: https://stackoverflow.com/questions/48989663/monads-and-sml-modules. The obvious downside is that you have to explicitly state which monad to use at some point.

Another lesser known difference is that I believe you can't instantiate an ML signature with a polymorphic type. For example you can't write an instance of that MAPPABLE signature for a type like Map k v. At least not such that it is still polymorphic over the key type k.

Haskell Interlude Podcast 49: Arseniy Seroka (haskell.foundation)

Wouter and Joachim interview Arseny Seroka, CEO of Serokell. Arseny got into Haskell because of a bet over Pizza, fell for it because it means fewer steps between his soul and his work, and founded Serokell because he could not get a Haskell job. He speaks about the business side of a Haskell company, about the need for more...

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines