Coder Social home page Coder Social logo

evalexpr's Introduction

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: [email protected]
ย ย ย ย ย  GitHub: @eydou

evalexpr's People

Contributors

eydou avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.