Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

A Haskell I can get behind

Name: Anonymous 2015-12-27 15:41

Name: Anonymous 2016-01-03 18:33

>>10
The simplest example would be modifiedCollection = fmap f collection. Here there are no indices, and collection could be anything from a linked list to array to tree to hash-table, with any type of element as long as function f has one argument of the same type as the collection's elements. The result is a new collection of same type (but possibly different type of elements - the same as f's return type) and same number of elements.
I don't even know how to do that in C without using type-unsafe (void *) function pointers. You probably would need some _generic keywords to branch on the collection type.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List