Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

File System Todo

file_system_todo_app.livemd

File System Todo

Mix.install([
  {:kino, github: "livebook-dev/kino", override: true},
  {:kino_lab, "~> 0.1.0-dev", github: "jonatanklosko/kino_lab"},
  {:vega_lite, "~> 0.1.4"},
  {:kino_vega_lite, "~> 0.1.1"},
  {:benchee, "~> 0.1"},
  {:ecto, "~> 3.7"},
  {:math, "~> 0.7.0"},
  {:faker, "~> 0.17.0"},
  {:utils, path: "#{__DIR__}/../utils"},
  {:tested_cell, git: "https://github.com/BrooklinJazz/tested_cell"}
])

Navigation

Return Home Report An Issue

Overview

You’re going to create a TodoList application with persistence using a file system.

The TodoList module should be able to:

add/1 an item to our todo list.

TodoList.add("go get groceries")
{:ok, ["go get groceries"]}

list/1 the items in our todo list.

TodoList.list()
["go get groceries"]

complete/1 an item in our todo list. This should delete the item and return the remaining elements in the todo list.

TodoList.complete("go get groceries")
{:ok, []}

If an item does not exist, it should return an error tuple.

TodoList.complete("non existing item")
{:error, :not_found}

Enter your solution in the Elixir cell below.

defmodule TodoList do
  def add(item) do
  end

  def complete(item) do
  end

  def list do
  end
end

Commit Your Progress

Run the following in your command line from the project folder to track and save your progress in a Git commit.

$ git add .
$ git commit -m "finish file system todo app exercise"