# 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](http://hackage.haskell.org/package/multivariant). ## Installation - install [stack](https://docs.haskellstack.org/en/stable/README/) - 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 ```haskell 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](examples/) directory.