Dear all,<div><br></div><div>    I wanted to voice support for a partial type annotations. Here&#39;s my usage scenario: I have a monad for an imperative EDSL, which has an associated expression data type,</div><div><br></div>

<div>class (Monad m, Expression (ExprTyp m)) =&gt; MyDSLMonad m where</div><div>    data ExprTyp m :: * -&gt; *</div><div><br></div><div>    and you write imperative EDSL code like so,</div><div><br></div><div>my_code_block = do</div>

<div>    x &lt;- instruction1</div><div>    y &lt;- instruction2 (x + x)</div><div>    ...</div><div><br></div><div>    I want the user to be able to annotate &quot;x is an Integer&quot;. However, to do that now, one has to now add a type signature for my_code_block like so, so that the $m$ variable is in scope,</div>

<div><br></div><div>my_code_block :: forall m. MyDSLMonad m =&gt; m ()</div><div>my_code_block = do</div><div>    x :: ExprTyp m Integer &lt;- instruction1</div><div>    ...</div><div><br></div><div>    If such a feature were available, one could write a nice type synonym &quot;Expr&quot; and use it like so,</div>

<div><br></div><div>type Expr a = ExprTyp _ a</div><div><br></div><div>my_code_block = do</div><div>    x :: Expr Integer &lt;- instruction1</div><div><br></div><div>    Suggestions for workarounds are appreciated. I created an `asExprTypeOf`, similar to Prelude&#39;s `asExprTyp`, but I don&#39;t like the syntax as much.</div>

<div><br></div><div>    Some previous discussion</div><div>* <a href="http://www.haskell.org/pipermail/haskell/2002-April/009409.html">http://www.haskell.org/pipermail/haskell/2002-April/009409.html</a></div><div>* (a reply) <a href="http://www.haskell.org/pipermail/haskell/2002-April/009413.html">http://www.haskell.org/pipermail/haskell/2002-April/009413.html</a></div>

<div>* <a href="http://hackage.haskell.org/trac/haskell-prime/wiki/PartialTypeAnnotations">http://hackage.haskell.org/trac/haskell-prime/wiki/PartialTypeAnnotations</a></div><div><br></div><div>cheers,<br clear="all">Nicholas — <a href="https://ntung.com" target="_blank">https://ntung.com</a> — 4432-nstung<br>


</div>