In this exercise you need to implement some functions to manipulate a list of programming languages.
Define the new/1
function that takes no parameters and returns an empty list.
LanguageList.new()
# => []
Define the add/2
function that takes 2 parameters (a language list and a string literal of a language). It should return the resulting list with the new language prepended to the given list.
LanguageList.new() |> LanguageList.add("Clojure")
# => ["Clojure"]
Define the remove/2
function that takes 1 parameter1 (a language list). It should return the list minus the first item.
LanguageList.new() |> LanguageList.add("Haskell") |> LanguageList.remove()
# => []
Define the first/1
function that takes 1 parameter (a language list). It should return the string literal of the language that occurs first in the list.
LanguageList.new() |> LanguageList.add("Prolog") |> LanguageList.first()
# => "Prolog"
Define the count/1
function that takes 1 parameter (a language list). It should return the number of languages in the list.
LanguageList.new() |> LanguageList.add("Elm") |> LanguageList.first()
# => 1
Define the exciting_list?/1
function which takes 1 parameter (a language list). It should return a boolean value. It should return true if "Elixir" is one of the languages in the list.
LanguageList.new() |> LanguageList.add("Elixir") |> LanguageList.first()
# => true