Skip to content

Instantly share code, notes, and snippets.

@bandrzejczak
Created February 9, 2018 21:31
Show Gist options
  • Select an option

  • Save bandrzejczak/8e5fcb461352327a2b097742dea1549d to your computer and use it in GitHub Desktop.

Select an option

Save bandrzejczak/8e5fcb461352327a2b097742dea1549d to your computer and use it in GitHub Desktop.
def getSongLength(
artist: Artist,
albumName: String,
songName: String): Option[Int] = {
for {
album <- artist.getAlbum(albumName)
song <- album.getSong(songName)
} yield song.getLength
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment