Skip to content

Instantly share code, notes, and snippets.

@ravinggenius
Created May 9, 2014 15:17
Show Gist options
  • Save ravinggenius/f9f6ad2dd9a622f24993 to your computer and use it in GitHub Desktop.
Save ravinggenius/f9f6ad2dd9a622f24993 to your computer and use it in GitHub Desktop.
Curry example

When rendering tags |> join(', '), join(', ') would be evaluated first. Next the tags would be passed into whatever join(', ') returns, which is expected to be a function that excepts a single argument.

Essentially this gets transformed (logically at least) into join(', ')(tags), which is equivalent to join(', ', tags).

# define view filter
join = -> (separator, items) {
# join logic here
}
<!-- assume `tags` is a list of strings -->
<p class="tags">{{tags |> join(', ')}}</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment