Sha256: 1660a9b8ee00947ba065935c35af43a2893504b59f5a0f3ed2bd2482c62ce99c

Contents?: true

Size: 566 Bytes

Versions: 103

Compression:

Stored size: 566 Bytes

Contents

module Bob

open System

let response (input: string) = 
    let isEmpty = String.IsNullOrWhiteSpace input
    let isYell = Seq.exists Char.IsLetter input && input = input.ToUpperInvariant()
    let isQuestion = input.Trim().EndsWith "?"

    match input with 
        | _ when isEmpty -> 
            "Fine. Be that way!"
        | _ when isYell && isQuestion -> 
            "Calm down, I know what I'm doing!"
        | _ when isYell -> 
            "Whoa, chill out!"
        | _ when isQuestion -> 
            "Sure."
        | _ -> 
            "Whatever."

Version data entries

103 entries across 103 versions & 1 rubygems

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