code-conjure-0.5.6: synthesize Haskell functions out of partial definitions
Copyright(c) 2021 Rudy Matela
License3-Clause BSD (see the file LICENSE)
MaintainerRudy Matela <rudy@matela.com.br>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Conjure.Prim

Description

This module is part of Conjure.

The Prim type and utilities involving it.

You are probably better off importing Conjure.

Synopsis

Documentation

type Prim = (Expr, Reification) Source #

A primtive expression (paired with instance reification).

prim :: Conjurable a => String -> a -> Prim Source #

Provides a primitive value to Conjure. To be used on values that are not Show instances such as functions. (cf. pr)

pr :: (Conjurable a, Show a) => a -> Prim Source #

Provides a primitive value to Conjure. To be used on Show instances. (cf. prim)

prif :: Conjurable a => a -> Prim Source #

Provides an if condition bound to the given return type.

primOrdCaseFor :: Conjurable a => a -> Prim Source #

Provides a case condition bound to the given return type.

cjHoles :: [Prim] -> [Expr] Source #

Computes a list of holes encoded as Exprs from a list of Prims.

This function mirrors functionality from conjureHoles.

cjTiersFor :: [Prim] -> Expr -> [[Expr]] Source #

Given a list of Prims, returns a function that given an Expr will return tiers of test Expr values.

This is used in cjAreEqual.

cjAreEqual :: [Prim] -> Int -> Expr -> Expr -> Bool Source #

Given a list of Prims, computes a function that checks whether two Exprs are equal up to a given number of tests.

cjMkEquation :: [Prim] -> Expr -> Expr -> Expr Source #

Computes a function that equates two Exprs from a list of Prims.

This function mirrors functionality from conjureMkEquation.