
2 Apr
2014
2 Apr
'14
5:25 p.m.
On Apr 2, 2014 4:32 PM, "Niklas Haas"
On Wed, 2 Apr 2014 09:51:46 -0400, Edward Kmett
wrote: We're not storing the instance as a slot in the constructor, so this
isn't.
data Foo a where Foo :: Seq a => Int -> a -> Foo a
or equivalently
data Foo a = Seq a => Foo !Int !a
Why not? Say we define Seq to something like
type family Seq (a :: *) :: Constraint where Seq (a -> b) = 1 ~ 0 Seq t = ()
What would be the drawback in this scenario?
I think that would be acceptable if we posit the existence of a valid Seq a dictionary. I think that would be possible for all builtin types and anything defined via data. But what about e.g. newtype F = F (forall x. Show x => x-> String)