multivariant: Multivariant assignments generation language

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Please see README.md


[Skip to Readme]

Properties

Versions 0.1.0.1, 0.1.0.1
Change log None available
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:25Z

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


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

or you can use cabal install multivariant.

Language description

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

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

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

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.