Sha256: 60b29f8f332f229618f03b61bfc1ac6c9a17c2f4be43c729cc25d6378f354d76

Contents?: true

Size: 525 Bytes

Versions: 163

Compression:

Stored size: 525 Bytes

Contents

val response =
  let
    open Char
    open List
    
    fun isQuestion chars = last (filter (not o isSpace) chars) = #"?"

    fun isYell chars = exists isAlpha chars andalso (map toUpper chars) = chars

    val isNothing = all isSpace

    fun response' chars =
      if isNothing chars
      then "Fine. Be that way!"
      else if isYell chars
           then "Whoa, chill out!"
           else if isQuestion chars
                then "Sure."
                else "Whatever."
  in
    response' o String.explode 
  end

Version data entries

163 entries across 163 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.179 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.178 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.177 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.176 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.175 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.174 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.173 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.172 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.171 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.170 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.169 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.167 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.166 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.165 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.164 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.163 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.162 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.161 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.160 tracks/sml/exercises/bob/example.sml