Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # in and out
- average :: ({name: Str, age: Num}, [...Num]) -> Str
- average = (person, loc) ->
- sum = loc.reduce (s1, s2) -> s1 + s2
- "#{person.name} wrote on average
- #{sum / loc.length} lines of code."
- # using your own functions to enforce (just need to handle true or false)
- Even = (x) -> x % 2 is 0
- Odd = (x) -> x % 2 isnt 0
- addEvens :: (!Even) -> !Odd
- addEvens = (x) -> x + 1
Add Comment
Please, Sign In to add comment