<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 12/01/2013 10:27 PM, Andras Slemmer
wrote:<br>
</div>
<blockquote
cite="mid:CAJEmqMgohwxjLR3nCt2dJ+R3OKPiuXTM0x+KZFXQZx3sbdh1uQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>Sure, you can do this easily with a GADT + DataKinds
for convenient indexing with lists. The construct you need
is called a heterogeneous list, or HList: <a
moz-do-not-send="true"
href="http://hackage.haskell.org/package/HList-0.3.0.1/docs/Data-HList-HList.html">http://hackage.haskell.org/package/HList-0.3.0.1/docs/Data-HList-HList.html</a><br>
<br>
</div>
But it's a nice exercise to implement it on your own anyway.
If you need "truly" heterogeneous lists where you can't even
get the types of the elements from the index typelist then
you'll need to existentially hide the types. This will
simply be the same as HList without the indexing list.<br>
<br>
<br>
</div>
Good luck<br>
</div>
ex<br>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On 1 December 2013 20:11, Sergey
Bushnyak <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:sergey.bushnyak@sigrlami.eu" target="_blank">sergey.bushnyak@sigrlami.eu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,
everyone. I'm looking for reliable library or idea how to
implement heterogenous vector properly. It may seem odd, but
I want elements not only be different types but also
functions, something like that, pseudocode:<br>
<br>
hvec [a b (c->d) [a] ...] -- can be any type<br>
let hvec = hvec [ "stuff" 5 getUrl [1, 4, 5]]<br>
<br>
So far I found *vector-heterogenous* package, but can't
decide is it good to build on or create something on my own.<br>
<br>
Any thoughts and ideas are appreciated. Thanks.<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a moz-do-not-send="true"
href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a moz-do-not-send="true"
href="http://www.haskell.org/mailman/listinfo/haskell-cafe"
target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote>
</div>
<br>
</div>
</blockquote>
Thank you for suggestions, I'll look into it.<br>
</body>
</html>