DiazCarrete,
@DiazCarrete@hachyderm.io avatar

friendship ended with ScopedTypeVariables, TypeAbstractions is my new best friend
https://serokell.io/blog/ghc-dependent-types-in-haskell-3

kosmikus,
@kosmikus@functional.cafe avatar

@DiazCarrete I think both are nice to have.

BoydStephenSmithJr,
@BoydStephenSmithJr@hachyderm.io avatar

@DiazCarrete Ooh, haven't read the article, but despite my distain for TypeApplications, I'm already excited by the name of the new extension.

BoydStephenSmithJr, (edited )
@BoydStephenSmithJr@hachyderm.io avatar

@DiazCarrete If there's ever a new report NoListTuplePuns needs to be included. Also, more developers should unpun their newtypes and records.

I still prefer Proxy-ed APIs for compatibility, but it will be nice to be able to use TypeAbstractions for my higher rank lamdas / local bindings. Definitely an improvement over scoped type variables, and I don't think it even stole that much pattern syntax; as-patterns were almost always written with no whitespace.

DiazCarrete,
@DiazCarrete@hachyderm.io avatar

@BoydStephenSmithJr How do you un-pun your newtypes? Do you use some kind of "Mk-" prefix?

BoydStephenSmithJr,
@BoydStephenSmithJr@hachyderm.io avatar

@DiazCarrete That's what I do, yes. newtype Semantic2 = MkSemantic2 { unSemantic2 :: Semantic1 }

Though sometimes I do something different, like newtype Subset = AssertSubset { asSuperset :: Superset } for things where the rep. sharing is more practical, even if the syntax isn't actually the same, like Email/Text or PhoneNumber/Int64 since construction will generally be through something like isEmail :: Text -> Either ParseFailure Email or inputPhone :: Natural -> Maybe PhoneNumber

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