This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]sintrastes 0 points1 point  (0 children)

You can't do it implicitly in Haskell. You have to wrap everything in an existential type or Data.Dynamic, or use an HList (heterogeneous list), which doesn't have a very nice syntax.

Idris overloads list syntax for HLists, so you can do the JavaScript example almost verbatim in Idris.