Sha256: e44a1cd714dfebe7026f9a190b767f6e8373c0bbb9bc2d72f5f995d467d684e3
Contents?: true
Size: 817 Bytes
Versions: 322
Compression:
Stored size: 817 Bytes
Contents
module Bob exposing (..) import String import Regex hey : String -> String hey remark = if isShouting remark then "Whoa, chill out!" else if isQuestion remark then "Sure." else if isSilence remark then "Fine. Be that way!" else "Whatever." isShouting : String -> Bool isShouting remark = isUppercase remark && hasCharacters remark isUppercase : String -> Bool isUppercase remark = remark == String.toUpper remark isQuestion : String -> Bool isQuestion remark = String.endsWith "?" remark hasCharacters : String -> Bool hasCharacters remark = Regex.contains characterRegex remark characterRegex : Regex.Regex characterRegex = Regex.regex "[a-zA-Z]" isSilence : String -> Bool isSilence remark = String.isEmpty (String.trim remark)
Version data entries
322 entries across 322 versions & 1 rubygems