๐Ÿ“ฆ sleepyfran / duets

๐Ÿ“„ Instrument.fs ยท 17 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17module Duets.Entities.Instrument

/// Creates an instrument given its type.
let createInstrument instrumentType =
    { Id = InstrumentId <| Identity.create ()
      Type = instrumentType }

module Type =
    /// Creates an instrument type given its type as a string. Defaults to vocals if
    /// an invalid string is given.
    let from str =
        match str with
        | "Guitar" -> Guitar
        | "Drums" -> Drums
        | "Bass" -> Bass
        | _ -> Vocals