multivariant-0.1.0.1: Multivariant assignments generation language

Copyright(c) Anton Marchenko Mansur Ziatdinov 2016-2017
LicenseBSD-3
Maintainergltronred@gmail.com
Stabilityprovisional
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Test.Multivariant.Classes

Contents

Description

This module provides typeclasses for final tagless encoding of multivariant assignment language.

Synopsis

Program

class Program prog where Source #

Program provides the most common operations

Minimal complete definition

step, (~>), (<***>), (<+++>)

Methods

step :: (a <-> b) -> prog a b Source #

One step of transformation

(~>) :: prog a b -> prog b c -> prog a c Source #

(<***>) :: prog a1 b1 -> prog a2 b2 -> prog (a1, a2) (b1, b2) Source #

(<+++>) :: prog a b -> prog a b -> prog a b Source #

Instances

Program Cases Source # 

Methods

step :: (a <-> b) -> Cases a b Source #

(~>) :: Cases a b -> Cases b c -> Cases a c Source #

(<***>) :: Cases a1 b1 -> Cases a2 b2 -> Cases (a1, a2) (b1, b2) Source #

(<+++>) :: Cases a b -> Cases a b -> Cases a b Source #

Program Description Source # 

Methods

step :: (a <-> b) -> Description a b Source #

(~>) :: Description a b -> Description b c -> Description a c Source #

(<***>) :: Description a1 b1 -> Description a2 b2 -> Description (a1, a2) (b1, b2) Source #

(<+++>) :: Description a b -> Description a b -> Description a b Source #

Program Solution Source # 

Methods

step :: (a <-> b) -> Solution a b Source #

(~>) :: Solution a b -> Solution b c -> Solution a c Source #

(<***>) :: Solution a1 b1 -> Solution a2 b2 -> Solution (a1, a2) (b1, b2) Source #

(<+++>) :: Solution a b -> Solution a b -> Solution a b Source #

oneof :: Program prog => [prog a b] -> prog a b Source #

Simple wrapper around '(+++)'

Corner cases

class Program prog => WithCornerCases prog where Source #

Program that has corner cases

Minimal complete definition

withCornerCases

Methods

withCornerCases :: prog a b -> ([a], [b]) -> prog a b Source #

Supply corner cases for some step

Instances

Description

class Program prog => WithDescription prog where Source #

Program that has description

Minimal complete definition

withDescription

Methods

withDescription :: prog a b -> Text -> prog a b Source #

Supply description for some step

Inverse

class Program prog => WithInvert prog where Source #

Program that can be inverted

Minimal complete definition

invert

Methods

invert :: prog a b -> prog b a Source #

Inversion

Instances

Properties

class Program prog => WithConditions prog where Source #

Program that has properties (*not implemented yet*)

Minimal complete definition

withConditions

Methods

withConditions :: prog a b -> (a -> Bool, b -> Bool) -> prog a b Source #

Supply precondition and postcondition

ProgramArrow

newtype ProgramArrow p a b Source #

Embed program into arrow

Constructors

ProgramArrow 

Fields

Instances

Program prog => Arrow (ProgramArrow prog) Source # 

Methods

arr :: (b -> c) -> ProgramArrow prog b c #

first :: ProgramArrow prog b c -> ProgramArrow prog (b, d) (c, d) #

second :: ProgramArrow prog b c -> ProgramArrow prog (d, b) (d, c) #

(***) :: ProgramArrow prog b c -> ProgramArrow prog b' c' -> ProgramArrow prog (b, b') (c, c') #

(&&&) :: ProgramArrow prog b c -> ProgramArrow prog b c' -> ProgramArrow prog b (c, c') #

Program prog => Category * (ProgramArrow prog) Source # 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

Program prog => Semigroupoid * (ProgramArrow prog) Source # 

Methods

o :: c j k1 -> c i j -> c i k1 #