<div dir="ltr">Thanks for the suggestion guys, I think the sized vector is just what I needed! <div><br></div><div>I know about tuples but I can't use the usual list functions like map, splitAt etc, also there is no need to have more than one data type. </div></div><div class="gmail_extra"><br><div class="gmail_quote">On 17 March 2015 at 18:35, Konstantine Rybnikov <span dir="ltr"><<a href="mailto:k-bx@k-bx.com" target="_blank">k-bx@k-bx.com</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><div>Hi Kelong!<br><br></div>Check out <a href="https://hackage.haskell.org/package/sized-vector-0.0.2.0/docs/Data-Vector-Sized.html" target="_blank">https://hackage.haskell.org/package/sized-vector-0.0.2.0/docs/Data-Vector-Sized.html</a> for a vector which has its size stored in type itself.<br><br></div><div>Cheers.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Mar 17, 2015 at 7:26 PM, Kelong Cong <span dir="ltr"><<a href="mailto:kelongcong@gmail.com" target="_blank">kelongcong@gmail.com</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hello,<div><br></div><div>I have a function that takes a list as its parameter. The list must always have the same length, for example 16. Instead of producing a "Nothing" or bottom out when an invalid list is supplied, are there ways to verify this at compile time? If not, are there alternative data types that has this kind of functionality?<br></div><div><br></div><div>Thanks,</div><div>Kelong</div><div><br></div></div>
<br></div></div><span class="">_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
<br></span></blockquote></div><br></div>
<br>_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div>