Playback using advanced type. I want to name the name and several type constructors that produce types of this kind:
{-
data Subject = New | Existing
Here, as I understand it, we called kind Subjectand type constructors
Newand Existing, which :: Subject. These type constructors do not accept arguments (I plan to use them as phantom types), this should be roughly equivalent:
{-
data New
data Existing
With the difference that now I can write:
{-
{-
{-
-- …
data MyConfig :: Subject -> * -> * where
MyConfig
{ mcOneThing :: Path t File
} :: MyConfig k t
. ,
, , -,
Subject, Subject (?).
, (
New Existing ; , New
Existing Subject).
" , , , ".
, New Existing
- , . , :
foo :: MyConfig New Dir -> …
foo :: MyConfig Int Dir -> …
.
:
module MyModule
( New
, Existing
-- …
)
where
:
"
<
GHC
7.9.3
, " " ', :
module MyModule
( 'New
, 'Existing
-- …
)
where
... .
New Existing,
, - ?