[GHC] #13262: Allow type synonym family application in instance head if it has no free variables
GHC
ghc-devs at haskell.org
Sun Nov 25 19:55:11 UTC 2018
#13262: Allow type synonym family application in instance head if it has no free
variables
-------------------------------------+-------------------------------------
Reporter: ezyang | Owner: (none)
Type: feature request | Status: new
Priority: low | Milestone:
Component: Compiler (Type | Version: 8.0.1
checker) |
Resolution: | Keywords: backpack
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking: 12680
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Artyom.Kazak):
> Oh all right. We can wait till someone else pipes in and requests this
:)
That would be me!
My usecase is generating anonymous records and then defining SafeCopy
migrations for them (see
http://hackage.haskell.org/package/safecopy-0.9.4.1/docs/Data-
SafeCopy.html#t:Migrate). Essentially this:
{{{
type Foo_v1 = ...
type Foo_v2 = AddField "name" Text Foo_v1
type Foo_v3 = RemoveField "age" Foo_v2
}}}
All of that is implemented via type families. The problem is that now I
can't have instances for these types (e.g. `instance Migrate Foo_v3`).
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13262#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list