HasChor-0.1.0.1: Functional choreographic programming in Haskell
Safe HaskellSafe-Inferred
LanguageGHC2021

Choreography.Location

Description

This module defines locations and located values.

Synopsis

Documentation

type LocTm = String Source #

Term-level locations.

type LocTy = Symbol Source #

Type-level locations.

toLocTm :: forall (l :: LocTy). KnownSymbol l => Proxy l -> LocTm Source #

Convert a type-level location to a term-level location.

data a @ (l :: LocTy) Source #

Located values.

a @ l represents a value of type a at location l.

Constructors

Wrap a

A located value a @ l from location l's perspective.

Empty

A located value a @ l from locations other than l's perspective.

wrap :: a -> a @ l Source #

Wrap a value as a located value.

unwrap :: (a @ l) -> a Source #

Unwrap a located value.

Note: Unwrapping a empty located value will throw an exception.

mkLoc :: String -> Q [Dec] Source #

Define a location at both type and term levels.