Skip to content

More flexible type signatures for data constructors

See http://article.gmane.org/gmane.comp.lang.haskell.cafe/29409, and the rest of the thread. The idea is to allow data constructor declarations to have things like this:

type Foo = Int -> Bool -> T

data T where
  C :: Foo

This is a silly example, but the idea is not to require the arrows to be all visible at top level, and to allow the result type to be something other than visibly T itself.

I'm recording this as a feature request, since it came up on Haskell Cafe, but I'm not sure that I like it. The type signatures in data type declarations are pretty special: notably, they allow record syntax, and support strictness annotations.

Trac metadata
Trac field Value
Version 6.6.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority low
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information