Hacker News new | past | comments | ask | show | jobs | submit login

It's `validateIpAddr(String)`: the first argument is fixed. Suppose you have a list of strings, and you want to extract the ones that are IP addresses. Then you can just write

    filter (validate ipRegex) listOfStrings
instead of

    filter validateIpAddr listOfStrings
        where validateIpAddr string = validate ipRegex string



Why not just

  map { validate(ipRegex, $) } listOfStrings




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: