multivariant: Multivariant assignments generation language

[ bsd3, library, program, test ] [ Propose Tags ]
Versions [RSS] 0.1.0.1
Dependencies base (>=4.7 && <5), containers (>=0.5.7.1 && <0.6), free (>=4.12.4 && <4.13), HUnit (>=1.3.1.2 && <1.4), invertible (>=0.1.2 && <0.2), MonadRandom (>=0.4.2.3 && <0.5), multivariant (>=0.1.0.1 && <0.2), profunctors (>=5.2 && <5.3), QuickCheck (>=2.8.2 && <2.9), semigroupoids (>=5.1 && <5.2), tasty (>=0.11.0.4 && <0.12), tasty-hunit (>=0.9.2 && <0.10), tasty-quickcheck (>=0.8.4 && <0.9), text (>=1.2.2.1 && <1.3), transformers (>=0.5.2.0 && <0.6) [details]
License BSD-3-Clause
Copyright Copyright (c) 2016-2017 Anton Marchenko, Mansur Ziatdinov
Author Anton Marchenko, Mansur Ziatdinov
Maintainer gltronred@gmail.com
Category Test
Home page https://bitbucket.org/gltronred/multivariant#readme
Uploaded by MZiatdinov at 2017-01-31T13:12:46Z
Distributions
Executables example
Downloads 846 total (1 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-01-31 [all 1 reports]

Readme for multivariant-0.1.0.1

[back to package description]

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.