I have a query type data Query a
Given that Query
has no constructors, how can I define an eval
function of type:
eval :: Query ~> H.ComponentDSL State Query Void m
Would I have to add a constructor to Query
?
I have a query type data Query a
Given that Query
has no constructors, how can I define an eval
function of type:
eval :: Query ~> H.ComponentDSL State Query Void m
Would I have to add a constructor to Query
?
Use type Query = Const Void
and eval = absurd << un Const
type Query
= Const Void = data Query a
, They all have type Kind -> Kind
, and have no constructor.
For eval = absurd <<< un Const
match type Query ~> H.ComponentDSL State Query Void m
. absurd :: forall a. Void -> a
make sure return type match. un Const :: forall a b -> Const a b -> a
make sure input type match (forall a. Query a -> Void
)