haskell / rfcs

This repo is archived, consider using https://github.com/ghc-proposals/ghc-proposals instead
98 stars 17 forks source link

PatternSignatures proposal. #14

Closed barrucadu closed 3 years ago

barrucadu commented 8 years ago

https://github.com/barrucadu/rfcs/blob/patternsignatures/texts/0000-patternsignatures.rst

quchen commented 8 years ago

A monomorphic type signature may occur in any pattern

I’m surprised to read this. I thought this was not part of Haskell, but enabled via scoped type variables?

polymorphic types

I think this should be parametric. id is polymorphic (can be instantiated at different types) because its type ∀a. a -> a is parametric (takes a parameter a). A “polymorphic type” would be what we call poly-kinded, e.g. Proxy is poly-kinded (can be instantiated at different kinds) because its type ∀k. k -> * is parametric (takes a parameter k).

barrucadu commented 8 years ago

I’m surprised to read this. I thought this was not part of Haskell, but enabled via scoped type variables?

Sorry, I wrote that from the perspective of the proposal having been accepted. I'll revise that, and also change polymrophic to parametric.

evincarofautumn commented 8 years ago

I took “polymorphic type” to mean “polytype”, in the Hindley–Milner sense of “has top-level foralls”.

As for the “unresolved questions”, changing ScopedTypeVariables to allow implicit quantification seems like it could cause mistyping to lead to mis-typing.