@hackage multivariant0.1.0.1

Multivariant assignments generation language

Multivariant assignments generation language

This library allows you to write short description of multivariant assignments in embedded DSL and interpret them as solution, text of assignment and tests.

This library is available at hackage.

Installation

  • install stack
  • run stack exec multivariant

or you can use cabal install multivariant.

Language description

There are several typeclasses for tagless-final encoding of language:

  • Program
  • WithDescription
  • WithCornerCases
  • WithInvert

Each typeclass defines some operations that every interpreter has to implement.

There are currently three ``interpreters'' (types that implement corresponding typeclasses):

  • Cases
  • Description
  • Solution

Program

WithDescription

WithInvert

TBA

Examples

task = Inv.map ((+1) :<->: (-1)) `withDescription` "Add one to each list element" `withCornerCases` ([0],[0])
    ~>   (   (sum :<->: (\s -> [s,0])) `withDescription` "Compute sum of elements" `withCornerCases` ([[]],[0])
	   <+++> (product :<->: (\p -> [1,p])) `withDescription` "Compute product of elements" `withCornerCases` ([[]],[1])
	     )

TBA

More examples are available in the examples directory.

  • Installation

  • Dependencies (0)

  • Dependents (0)