Skip to content

Determine how intervals relate to each other

License

Notifications You must be signed in to change notification settings

oschrenk/rampart.scala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rampart

Determine how intervals relate to each other.

rampart.scala is a Scala implementation of tfausak/rampart, as Haskell library, which in turn was inspired by James F. Allen's, Maintaining Knowledge About Temporal Intervals.

The original project and this implementation use the terminology from that report.

It currently has a dependency on cats, specifically it's Order typeclass.

Usage

Dependencies in your build.sbt

resolvers += Resolver.bintrayRepo("oschrenk", "maven")
libraryDependencies += "dev.oschrenk" %% "rampart-scala" % "0.2.0"

Example

  import Interval.{relate, toInterval}
  import cats.implicits._

  val a = toInterval(1, 2)
  val b = toInterval(3, 7)
  relate(a, b) match {
    case Relation.Before => println("Before")
    case _      => throw new IllegalArgumentException("What is this?")
  }

Terminology

Publish

sbt publish

About

Determine how intervals relate to each other

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages