Skip to content
/ EvalExpr Public

Evalexpr : Epitech project of module FUN in Haskell

Notifications You must be signed in to change notification settings

Eydou/EvalExpr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo Evalexpr

Project made on october 2020

rating visitor badge

An essential calculator in haskell

๐Ÿ“– Table of Contents

Table of Contents
  1. โžค About The Project
  2. โžค Prerequisites
  3. โžค Folder Structure
  4. โžค Operators
  5. โžค Run the Program
  6. โžค UnitTest
  7. โžค Results
  8. โžค Authors

-----------------------------------------------------

๐Ÿ“ About The Project

This is a program named evalexpr.

This project shows how the evaluation of an arithmetic expression works by handling precedence, variables, and functions.

-----------------------------------------------------

๐Ÿด Prerequisites

The following open source packages are used in this project:

  • Stack vers.2.13

-----------------------------------------------------

๐ŸŒต Folder Structure

code
.
 โ”œโ”€โ”€ app
 โ”‚   โ””โ”€โ”€ Main.hs
 โ”œโ”€โ”€ funEvalExpr.cabal
 โ”œโ”€โ”€ Makefile
 โ”œโ”€โ”€ package.yaml
 โ”œโ”€โ”€ src
 โ”‚   โ”œโ”€โ”€ Calculator.hs
 โ”‚   โ”œโ”€โ”€ Check.hs
 โ”‚   โ””โ”€โ”€ Lib.hs
 โ”œโ”€โ”€ stack.yaml
 โ”œโ”€โ”€ stack.yaml.lock
 โ””โ”€โ”€ unitTest
     โ””โ”€โ”€ unit_test.bats

-----------------------------------------------------

โž• Operators

Support:

  • + (plus)
  • - (sub)
  • * (multiplication)
  • / (division)
  • ^ (exponential)

works with () - parenthesis

-----------------------------------------------------

๐Ÿ’ป How to run the program ?

Compile the makefile (make) and add some arithmetic expression like this !

 $> ./funEvalExpr "6 * 12 / 2 * (1 - 2 - (2 - 4 - 5) - 10) ^ 2 * (2 - 7 - 4) ^ 3"
 $> -419904.00

-----------------------------------------------------

๐Ÿ’ป How to run the Unit Test

 > make && test_run
 
Or Put the executable in the `unitTest` folder and run like this :

 > bats unit_test.bats
 

-----------------------------------------------------

๐Ÿงฎ Results

Evalexpr Test
error management 100%
one single unary operator 100%
parenthesis 100%
Mixed binary operators 100%
All mixed 100%
Coding style 66.7%

-----------------------------------------------------

Authors

๐Ÿ‘ฆ Edouard Touch
      Email: edouard.touch@epitech.eu
      GitHub: @eydou

About

Evalexpr : Epitech project of module FUN in Haskell

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published