You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Almost all PrimMonad instances are monad transformers of other PrimMonad instances. We can give PrimState a default definition and use DefaultSignatures to give primitive one as well. We can use TypeError to produce good error messages when the defaults don't come close to making sense.
The only error messages that aren't so great are when users write primitive implementations but forget the PrimState ones. I don't know how to fix that without ending up with a bunch of duplicate errors in some cases (which seems like a GHC issue).
The text was updated successfully, but these errors were encountered:
I'm +1 on this, though can it instead be a top-level function, like defaultPrimitive/primitiveDefault, or something? Default signatures look so ugly on haddocks. Though a default signature does save users from an extra line of typing. The top-level thing is just something to consider, wondering what others' thoughts are.
Almost all
PrimMonad
instances are monad transformers of otherPrimMonad
instances. We can givePrimState
a default definition and useDefaultSignatures
to giveprimitive
one as well. We can useTypeError
to produce good error messages when the defaults don't come close to making sense.The only error messages that aren't so great are when users write
primitive
implementations but forget thePrimState
ones. I don't know how to fix that without ending up with a bunch of duplicate errors in some cases (which seems like a GHC issue).The text was updated successfully, but these errors were encountered: