This project is a command-line application built in Haskell for generating music playlists. It was developed as part of group coursework for ECS713P - Functional Programming (2022/23).
- Project Overview
- Features
- Installation
- Usage
- Example Commands
- Technologies Used
- Project Structure
- Contributing
- License
The Stack CLI Haskell Playlist Generation App allows users to create, manage, and manipulate music playlists from the command line. Users can add tracks, remove tracks, generate playlists based on criteria (genre, artist, etc.), and save playlists to files. The project demonstrates practical use of functional programming concepts in Haskell.
- Add, remove, and list tracks in a playlist
- Generate playlists based on filters (e.g., genre, artist)
- Save and load playlists from files
- Command-line interface for all operations
- Error handling and user-friendly prompts
- Haskell Stack
- GHC (comes with Stack)
-
Clone the repository:
git clone https://github.com/naman-sriv/Stack_CLI_Haskell_Playlist_Generation_App.git cd Stack_CLI_Haskell_Playlist_Generation_App -
Install dependencies and build:
stack setup stack build
-
Run the application:
stack run
After building the project, you can start the CLI app and use various commands to manage playlists.
add: Add a new track to the playlistremove: Remove a track from the playlistlist: List all tracks in the current playlistgenerate: Generate a playlist based on specific criteriasave: Save the current playlist to a fileload: Load a playlist from a filehelp: Show available commands
# Add a new track
add "Bohemian Rhapsody" "Queen" "Rock" 1975
# Remove a track by title
remove "Bohemian Rhapsody"
# List all tracks
list
# Generate a playlist by genre
generate genre "Rock"
# Save playlist to a file
save my_rock_playlist.txt
# Load a playlist from a file
load my_rock_playlist.txt- Haskell
- Stack
- System.IO for file operations
- Data structures such as lists and records for playlist management
Stack_CLI_Haskell_Playlist_Generation_App/
├── app/
│ └── Main.hs
├── src/
│ ├── Playlist.hs
│ └── Track.hs
├── test/
│ └── Spec.hs
├── README.md
├── stack.yaml
└── package.yaml
Contributions are welcome! Please fork the repository and submit pull requests for any improvements or bug fixes.
- Fork the repo
- Create your feature branch (
git checkout -b feature/YourFeature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin feature/YourFeature) - Open a Pull Request
This project is licensed under the MIT License.
Coursework project for ECS713P - Functional Programming (2022/23).