<div dir="ltr">If I understand you correctly you seem to want dependent types, this article uses the same example you need, promoting the length of a vector/list to the type level:Â <a href="https://www.fpcomplete.com/user/konn/prove-your-haskell-for-great-safety/dependent-types-in-haskell">https://www.fpcomplete.com/user/konn/prove-your-haskell-for-great-safety/dependent-types-in-haskell</a><div><br></div><div>You'd end up with `plot :: (Vector n Double -> Double) -> Vector n (Double, Double) -> IO ()' where `n' is the length of the vector.</div><div><br></div><div>HTH,</div><div>Adam</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 11, 2015 at 10:45 PM, Sumit Sahrawat, Maths & Computing, IIT (BHU) <span dir="ltr"><<a href="mailto:sumit.sahrawat.apm13@iitbhu.ac.in" target="_blank">sumit.sahrawat.apm13@iitbhu.ac.in</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi everybody,</div><div><br></div>I have a function of type<div><br></div><div><font face="monospace, monospace">Â Â plot :: ([Double] -> Double) Â Â -- A function to plot</font></div><div><font face="monospace, monospace">Â Â Â Â Â -> [(Double, Double)] Â Â Â -- Range for all arguments</font></div><div><font face="monospace, monospace">Â Â Â Â Â -> IO ()</font><br clear="all"><div><br></div><div>I want to enforce the fact that ranges for all arguments should be provided.</div><div>Is there a way to make the type system enforce it?</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div>Regards</div><div dir="ltr"><div><br></div><div>Sumit Sahrawat</div></div></div></div></div></div></div>
</font></span></div></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>