<div dir="ltr">Yeah, Data.Vector.Fixed.toList worked. I had found it previously, but it didn't work for Vec imported from Data.Fixed.Vector.Primitive (as (Double, Double) doesn't have a Prim instance).<div>Then I had to switch to Data.Fixed.Vector.Unboxed, and it works now.</div><div><br></div><div>Also, those shingles look interesting too. Thanks everybody.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 12 March 2015 at 12: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">Is `Data.Vector.Fixed.toList` is what you're looking for?<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Mar 12, 2015 at 1:16 AM, 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></div></div><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">The fixed-vector package uses a similar technique. The only trouble I'm having is with converting Vec v (Double, Double) to [(Double, Double)] for further use. I don't want to change all the code, but only the part where the user provides me with arguments.<div><br></div><div>I'll keep looking into it. Thanks for the help.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 12 March 2015 at 04:44, David Feuer <span dir="ltr"><<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">There are a lot of ways to do this sort of thing, and which one you choose will depend on exactly what you're trying to do. For example, you can write something vaguely like</p>
<p dir="ltr">data Nat = Z | S Nat<br>
data SL (n :: Nat) a where<br>
Nil :: SL Z<br>
Cons :: a -> SL n a -> SL (S n) a</p>
<p dir="ltr">plot :: forall (n::Nat) . (SL n Double -> Double) -><br>
SL n (Double, Double) -> IO ()</p>
<div class="gmail_quote"><div><div><div><div>On Mar 11, 2015 5:45 PM, "Sumit Sahrawat, Maths & Computing, IIT (BHU)" <<a href="mailto:sumit.sahrawat.apm13@iitbhu.ac.in" target="_blank">sumit.sahrawat.apm13@iitbhu.ac.in</a>> wrote:<br type="attribution"></div></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div><div><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><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>
</div></div>
<br></div></div></div></div><span><span>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">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></span></span></blockquote></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><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>
<br></div></div>_______________________________________________<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></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><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>
</div>