Suppose i have some type like:
newtype Foo a b = Foo { getFoo :: SomeStructure b }
I.e. a
is a phantom type used only for compile-time checks.
However, I don't want to use the phantom type everywhere. It's not universally useful in my code. So I would like to do something like:
type FooUnrestricted b = Foo Anything b
What should I use in place of Anything
? Do I need some language extensions?
Edit: I realized I could simply use ()
and it would answer my question. But the actual point is that I have functions that place constraints on a
and I would like them to be always satisfied.
coerce
? – Rufflewind