The multivariant package

[maintain]

Please see README.md


[Skip to ReadMe]

Properties

Versions0.1.0.1, 0.1.0.1
Dependenciesbase (>=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.*), QuickCheck (>=2.8.2 && <2.9), semigroupoids (==5.1.*), 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]
LicenseBSD3
CopyrightCopyright (c) 2016-2017 Anton Marchenko, Mansur Ziatdinov
AuthorAnton Marchenko, Mansur Ziatdinov
Maintainergltronred@gmail.com
CategoryTest
Home pagehttps://bitbucket.org/gltronred/multivariant#readme
Executablesexample
UploadedTue Jan 31 13:12:25 UTC 2017 by MZiatdinov

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for multivariant-0.1.0.1

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.