You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
> > How does Haskell code typically use the flip code?? I am
> > not sure of its applicable use.
>
> Here's an example,
> CL-USER> (mapcar (bind (flip #'-) 2) (enum-from-to 2 12))
> (0 1 2 3 4 5 6 7 8 9 10)
>
>
> (defun enum-from-to (lo hi)
> (loop for x from lo to hi collect x))
>
> (defun bind (f &rest bound-args)
> #'(lambda (&rest args)
> (apply f (append bound-args args))))
>
> (defun flip (f)
> #'(lambda (&rest args)
> (apply f (reverse args))))