so i was using haskell, and the pointfree stuff is fun, so naturally i
had to implement some of it in clojure.

this is what i have so far. library and examples within:
http://github.com/hclarke/pointfree-clojure

it has >>>, &&&, ***, +++, |||, and others
they take functions as arguments and return functions

for those that don't know:
>>> composes functions in reverse order. it basically pipes them together left 
>>> to right
&&& maps functions over a single value (haskell's takes two functions,
this takes any number)
*** maps functions over a sequence (as above, this takes any number of
functions)
+++ takes a choice ([bool, x]), and applies f1 if f2 if false ([bool,
(f x)])
||| same as above, but just returns the (f x) part. drops the bool

there's also:
fst applies function to the first element. same as (*** f id id id...)
snd applies function to the second element. same as (*** id f id id
id...)
ttt same as (+++ f id). same as haskell's left
fff same as (+++ id f). same as haskell's right
III takes [i x] and applies the ith function (starting from 0),
returning [i (f x)]
iii same as above, but drops the bool

curry makes a function keep returning a function until you pass it
enough arguments to evaluate (default is 2 args)
see curry example on github for how it works

at this point, names, and pretty much everything, are likely to
change.
thoughts, questions, suggestions, etc.?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to