Skip to content

A Scala implementation of a calculator to illustrate Functional Programming concepts like ADTs, Implicits and Typeclasses

Notifications You must be signed in to change notification settings

ajatix/calculate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

calculate

Download

A Scala implementation of a calculator to illustrate Functional Programming concepts like ADTs, Implicits and Typeclasses

Using the library in a new project

Add the following to your build.sbt

resolvers += Resolver.bintrayRepo("ajatix", "scala")

libraryDependencies += "io.github.ajatix" %% "calculate" % "0.3"

In your main application, your can run the following

import io.github.ajatix.calculate.ExpressionDSL._

object Calculate extends App {

  val e = 3 into 4 plus 3 by 3 minus 4

  println(e)
  println(e.reorder())
  println(e.reorder().optimize())
  println(e.reorder().optimize().evaluate())

}

About

A Scala implementation of a calculator to illustrate Functional Programming concepts like ADTs, Implicits and Typeclasses

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages