Repository navigation
Expand file tree
/
Copy pathLanguage-Copilot-Core.html
More file actions
72 lines (72 loc) · 55.7 KB
/
Copy pathLanguage-Copilot-Core.html
File metadata and controls
72 lines (72 loc) · 55.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Language.Copilot.Core</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Language-Copilot-Core.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="http://github.com/leepike/Copilot/Language.Copilot.Core.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">copilot-1.0.2: A stream DSL for writing embedded C monitors.</p></div><div id="content"><div id="module-header"><p class="caption">Language.Copilot.Core</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Provides basic types and functions for other parts of <em>Copilot</em>.
</p><p>If you wish to add a new type, you need to make it an instance of <code><code><a href="Language-Copilot-Core.html#t:Streamable">Streamable</a></code></code>,
to add it to <code><code><a href="Language-Copilot-Core.html#v:foldStreamableMaps">foldStreamableMaps</a></code></code>, <code><code><a href="Language-Copilot-Core.html#v:mapStreamableMaps">mapStreamableMaps</a></code></code>, and optionnaly
to add an ext[Type], a [type] and a var[Type]
functions in Language.hs to make it easier to use.
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">type</span> <a href="#t:Period">Period</a> = <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:Var">Var</a> = <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:Name">Name</a> = <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Port">Port</a> = <a href="#v:Port">Port</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Ext">Ext</a> <ul class="subs"><li>= <a href="#v:ExtV">ExtV</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> </li><li>| <a href="#v:Fun">Fun</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> <a href="Language-Copilot-Core.html#t:Args">Args</a> </li></ul></li><li class="src short"><span class="keyword">type</span> <a href="#t:Exs">Exs</a> = (Type, <a href="Language-Copilot-Core.html#t:Ext">Ext</a>, <a href="Language-Copilot-Core.html#t:ExtRet">ExtRet</a>)</li><li class="src short"><span class="keyword">data</span> <a href="#t:ExtRet">ExtRet</a> <ul class="subs"><li>= <a href="#v:ExtRetV">ExtRetV</a> </li><li>| <a href="#v:ExtRetA">ExtRetA</a> <a href="Language-Copilot-Core.html#t:ArgConstVar">ArgConstVar</a> </li></ul></li><li class="src short"><span class="keyword">type</span> <a href="#t:Args">Args</a> = [<a href="Language-Copilot-Core.html#t:ArgConstVar">ArgConstVar</a>]</li><li class="src short"><span class="keyword">data</span> <a href="#t:ArgConstVar">ArgConstVar</a> <ul class="subs"><li>= <a href="#v:V">V</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> </li><li>| <a href="#v:C">C</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> </li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:Spec">Spec</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:Var">Var</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="Language-Copilot-Core.html#t:Var">Var</a> -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a </li><li><a href="#v:Const">Const</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => a -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a </li><li><a href="#v:PVar">PVar</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => Type -> <a href="Language-Copilot-Core.html#t:Ext">Ext</a> -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a </li><li><a href="#v:PArr">PArr</a> :: (<a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a, <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> b, IntegralE b) => Type -> (<a href="Language-Copilot-Core.html#t:Ext">Ext</a>, <a href="Language-Copilot-Core.html#t:Spec">Spec</a> b) -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a </li><li><a href="#v:F">F</a> :: (<a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a, <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> b) => (b -> a) -> (E b -> E a) -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> b -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a </li><li><a href="#v:F2">F2</a> :: (<a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a, <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> b, <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> c) => (b -> c -> a) -> (E b -> E c -> E a) -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> b -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> c -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a </li><li><a href="#v:F3">F3</a> :: (<a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a, <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> b, <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> c, <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> d) => (b -> c -> d -> a) -> (E b -> E c -> E d -> E a) -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> b -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> c -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> d -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a </li><li><a href="#v:Append">Append</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => [a] -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a </li><li><a href="#v:Drop">Drop</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a </li></ul></li><li class="src short"><span class="keyword">type</span> <a href="#t:Streams">Streams</a> = <a href="/usr/local/share/doc/mtl-2.0.1.0/html/Control-Monad-Writer-Lazy.html#t:Writer">Writer</a> <a href="Language-Copilot-Core.html#t:LangElems">LangElems</a> <a href="/usr/local/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:Stream">Stream</a> a = <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => (<a href="Language-Copilot-Core.html#t:Var">Var</a>, <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a)</li><li class="src short"><span class="keyword">data</span> <a href="#t:Trigger">Trigger</a> = <a href="#v:Trigger">Trigger</a> {<ul class="subs"><li><a href="#v:trigVar">trigVar</a> :: <a href="Language-Copilot-Core.html#t:Spec">Spec</a> <a href="Language-Copilot-Language.html#t:Bool">Bool</a></li><li><a href="#v:trigName">trigName</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li><a href="#v:trigArgs">trigArgs</a> :: <a href="Language-Copilot-Core.html#t:Args">Args</a></li></ul>}</li><li class="src short"><span class="keyword">type</span> <a href="#t:Triggers">Triggers</a> = <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> <a href="Language-Copilot-Core.html#t:Trigger">Trigger</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:LangElems">LangElems</a> = <a href="#v:LangElems">LangElems</a> {<ul class="subs"><li><a href="#v:strms">strms</a> :: <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> <a href="Language-Copilot-Core.html#t:Spec">Spec</a></li><li><a href="#v:trigs">trigs</a> :: <a href="Language-Copilot-Core.html#t:Triggers">Triggers</a></li></ul>}</li><li class="src short"><span class="keyword">class</span> (Expr a, Assign a, <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> a) => <a href="#t:Streamable">Streamable</a> a <span class="keyword">where</span><ul class="subs"><li><a href="#v:getSubMap">getSubMap</a> :: <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> b -> <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (b a)</li><li><a href="#v:updateSubMap">updateSubMap</a> :: (<a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (b a) -> <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (b a)) -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> b -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> b</li><li><a href="#v:unit">unit</a> :: a</li><li><a href="#v:atomConstructor">atomConstructor</a> :: <a href="Language-Copilot-Core.html#t:Var">Var</a> -> a -> Atom (V a)</li><li><a href="#v:externalAtomConstructor">externalAtomConstructor</a> :: <a href="Language-Copilot-Core.html#t:Var">Var</a> -> V a</li><li><a href="#v:typeId">typeId</a> :: a -> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li><a href="#v:typeIdPrec">typeIdPrec</a> :: a -> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li><a href="#v:atomType">atomType</a> :: a -> Type</li><li><a href="#v:showAsC">showAsC</a> :: a -> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:StreamableMaps">StreamableMaps</a> a = <a href="#v:SM">SM</a> {<ul class="subs"><li><a href="#v:bMap">bMap</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="Language-Copilot-Language.html#t:Bool">Bool</a>)</li><li><a href="#v:i8Map">i8Map</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int8">Int8</a>)</li><li><a href="#v:i16Map">i16Map</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int16">Int16</a>)</li><li><a href="#v:i32Map">i32Map</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int32">Int32</a>)</li><li><a href="#v:i64Map">i64Map</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int64">Int64</a>)</li><li><a href="#v:w8Map">w8Map</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Word.html#t:Word8">Word8</a>)</li><li><a href="#v:w16Map">w16Map</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Word.html#t:Word16">Word16</a>)</li><li><a href="#v:w32Map">w32Map</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Word.html#t:Word32">Word32</a>)</li><li><a href="#v:w64Map">w64Map</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Word.html#t:Word64">Word64</a>)</li><li><a href="#v:fMap">fMap</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Float">Float</a>)</li><li><a href="#v:dMap">dMap</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Double">Double</a>)</li></ul>}</li><li class="src short"><a href="#v:emptySM">emptySM</a> :: <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> a</li><li class="src short"><a href="#v:isEmptySM">isEmptySM</a> :: <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> a -> <a href="Language-Copilot-Language.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:getMaybeElem">getMaybeElem</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="Language-Copilot-Core.html#t:Var">Var</a> -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> b -> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (b a)</li><li class="src short"><a href="#v:getElem">getElem</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="Language-Copilot-Core.html#t:Var">Var</a> -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> b -> b a</li><li class="src short"><a href="#v:foldStreamableMaps">foldStreamableMaps</a> :: <span class="keyword">forall</span> b c. (<a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="Language-Copilot-Core.html#t:Var">Var</a> -> c a -> b -> b) -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> c -> b -> b</li><li class="src short"><a href="#v:mapStreamableMaps">mapStreamableMaps</a> :: <span class="keyword">forall</span> s s'. (<span class="keyword">forall</span> a. <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="Language-Copilot-Core.html#t:Var">Var</a> -> s a -> s' a) -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> s -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> s'</li><li class="src short"><a href="#v:mapStreamableMapsM">mapStreamableMapsM</a> :: <span class="keyword">forall</span> s s' m. <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Control-Monad.html#t:Monad">Monad</a> m => (<a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="Language-Copilot-Core.html#t:Var">Var</a> -> s a -> m (s' a)) -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> s -> m (<a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> s')</li><li class="src short"><a href="#v:filterStreamableMaps">filterStreamableMaps</a> :: <span class="keyword">forall</span> c b. <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> c -> [(Type, <a href="Language-Copilot-Core.html#t:Var">Var</a>, b)] -> (<a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> c, <a href="Language-Copilot-Language.html#t:Bool">Bool</a>)</li><li class="src short"><a href="#v:normalizeVar">normalizeVar</a> :: <a href="Language-Copilot-Core.html#t:Var">Var</a> -> <a href="Language-Copilot-Core.html#t:Var">Var</a></li><li class="src short"><a href="#v:getVars">getVars</a> :: <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> s -> [<a href="Language-Copilot-Core.html#t:Var">Var</a>]</li><li class="src short"><span class="keyword">type</span> <a href="#t:Vars">Vars</a> = <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> []</li><li class="src short"><a href="#v:getAtomType">getAtomType</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a -> Type</li><li class="src short"><a href="#v:getSpecs">getSpecs</a> :: <a href="Language-Copilot-Core.html#t:Streams">Streams</a> -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> <a href="Language-Copilot-Core.html#t:Spec">Spec</a></li><li class="src short"><a href="#v:getTriggers">getTriggers</a> :: <a href="Language-Copilot-Core.html#t:Streams">Streams</a> -> <a href="Language-Copilot-Core.html#t:Triggers">Triggers</a></li><li class="src short"><a href="#v:vPre">vPre</a> :: <a href="Language-Copilot-Core.html#t:Name">Name</a> -> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li class="src short"><a href="#v:funcShow">funcShow</a> :: <a href="Language-Copilot-Core.html#t:Name">Name</a> -> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> -> <a href="Language-Copilot-Core.html#t:Args">Args</a> -> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></li><li class="src short"><a href="#v:notConstVarErr">notConstVarErr</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a -> (<a href="Language-Copilot-Core.html#t:ArgConstVar">ArgConstVar</a> -> b) -> b</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Period" class="def">Period</a> = <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></p><div class="doc"><p>Atom period -- used as an option to control the duration of a Copilot <a href="tick.html">tick</a>.
</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Var" class="def">Var</a> = <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></p><div class="doc"><p>Names of the streams or external variables
</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Name" class="def">Name</a> = <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></p><div class="doc"><p>C file name
</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Port" class="def">Port</a> </p><div class="doc"><p>Port over which to broadcast information
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Port" class="def">Port</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a></td><td class="doc empty"> </td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Ext" class="def">Ext</a> </p><div class="doc"><p>Holds external variables or external functions to call.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ExtV" class="def">ExtV</a> <a href="Language-Copilot-Core.html#t:Var">Var</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:Fun" class="def">Fun</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> <a href="Language-Copilot-Core.html#t:Args">Args</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:Ext" class="caption collapser" onclick="toggleSection('i:Ext')">Instances</p><div id="section.i:Ext" class="show"><table><tr><td class="src"><a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Language-Copilot-Core.html#t:Ext">Ext</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> <a href="Language-Copilot-Core.html#t:Ext">Ext</a></td><td class="doc empty"> </td></tr><tr><td class="src">ExtCl <a href="Language-Copilot-Core.html#t:Ext">Ext</a></td><td class="doc"><p>For functions.
</p></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Exs" class="def">Exs</a> = (Type, <a href="Language-Copilot-Core.html#t:Ext">Ext</a>, <a href="Language-Copilot-Core.html#t:ExtRet">ExtRet</a>)</p></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:ExtRet" class="def">ExtRet</a> </p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ExtRetV" class="def">ExtRetV</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:ExtRetA" class="def">ExtRetA</a> <a href="Language-Copilot-Core.html#t:ArgConstVar">ArgConstVar</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:ExtRet" class="caption collapser" onclick="toggleSection('i:ExtRet')">Instances</p><div id="section.i:ExtRet" class="show"><table><tr><td class="src"><a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Language-Copilot-Core.html#t:ExtRet">ExtRet</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Args" class="def">Args</a> = [<a href="Language-Copilot-Core.html#t:ArgConstVar">ArgConstVar</a>]</p></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:ArgConstVar" class="def">ArgConstVar</a> </p><div class="doc"><p>Arguments to be passed to a C function. Either a Copilot variable or a
constant. A little hacky that I store constants as strings so we don't have
to pass around types. However, these data are just used to make external C
calls, for which we have no type info anyway, so it's a bit of a moot point.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:V" class="def">V</a> <a href="Language-Copilot-Core.html#t:Var">Var</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:C" class="def">C</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:ArgConstVar" class="caption collapser" onclick="toggleSection('i:ArgConstVar')">Instances</p><div id="section.i:ArgConstVar" class="show"><table><tr><td class="src"><a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Language-Copilot-Core.html#t:ArgConstVar">ArgConstVar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> <a href="Language-Copilot-Core.html#t:ArgConstVar">ArgConstVar</a></td><td class="doc empty"> </td></tr><tr><td class="src">ArgCl <a href="Language-Copilot-Core.html#t:Args">Args</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Spec" class="def">Spec</a> a <span class="keyword">where</span></p><div class="doc"><p>Specification of a stream, parameterized by the type of the values of the stream.
The only requirement on <code>a</code> is that it should be <code><a href="Language-Copilot-Core.html#t:Streamable">Streamable</a></code>.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Var" class="def">Var</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="Language-Copilot-Core.html#t:Var">Var</a> -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a</td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:Const" class="def">Const</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => a -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a</td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:PVar" class="def">PVar</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => Type -> <a href="Language-Copilot-Core.html#t:Ext">Ext</a> -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a</td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:PArr" class="def">PArr</a> :: (<a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a, <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> b, IntegralE b) => Type -> (<a href="Language-Copilot-Core.html#t:Ext">Ext</a>, <a href="Language-Copilot-Core.html#t:Spec">Spec</a> b) -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a</td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:F" class="def">F</a> :: (<a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a, <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> b) => (b -> a) -> (E b -> E a) -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> b -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a</td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:F2" class="def">F2</a> :: (<a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a, <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> b, <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> c) => (b -> c -> a) -> (E b -> E c -> E a) -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> b -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> c -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a</td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:F3" class="def">F3</a> :: (<a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a, <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> b, <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> c, <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> d) => (b -> c -> d -> a) -> (E b -> E c -> E d -> E a) -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> b -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> c -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> d -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a</td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:Append" class="def">Append</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => [a] -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a</td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:Drop" class="def">Drop</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a -> <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a</td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:Spec" class="caption collapser" onclick="toggleSection('i:Spec')">Instances</p><div id="section.i:Spec" class="show"><table><tr><td class="src"><a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Eq.html#t:Eq">Eq</a> a => <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Eq.html#t:Eq">Eq</a> (<a href="Language-Copilot-Core.html#t:Spec">Spec</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a, NumE a, <a href="Language-Copilot-Language.html#t:Fractional">Fractional</a> a) => <a href="Language-Copilot-Language.html#t:Fractional">Fractional</a> (<a href="Language-Copilot-Core.html#t:Spec">Spec</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a, NumE a) => <a href="Language-Copilot-Language.html#t:Num">Num</a> (<a href="Language-Copilot-Core.html#t:Spec">Spec</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> a => <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (<a href="Language-Copilot-Core.html#t:Spec">Spec</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Monoid.html#t:Monoid">Monoid</a> (<a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> <a href="Language-Copilot-Core.html#t:Spec">Spec</a>)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> b => ArgCl (<a href="Language-Copilot-Core.html#t:Spec">Spec</a> b)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Streams" class="def">Streams</a> = <a href="/usr/local/share/doc/mtl-2.0.1.0/html/Control-Monad-Writer-Lazy.html#t:Writer">Writer</a> <a href="Language-Copilot-Core.html#t:LangElems">LangElems</a> <a href="/usr/local/share/doc/ghc/html/libraries/ghc-prim-0.2.0.0/GHC-Unit.html#t:-40--41-">()</a></p><div class="doc"><p>Container for mutually recursive streams, whose specifications may be
parameterized by different types
</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Stream" class="def">Stream</a> a = <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => (<a href="Language-Copilot-Core.html#t:Var">Var</a>, <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a)</p><div class="doc"><p>A named stream
</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Trigger" class="def">Trigger</a> </p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Trigger" class="def">Trigger</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:trigVar" class="def">trigVar</a> :: <a href="Language-Copilot-Core.html#t:Spec">Spec</a> <a href="Language-Copilot-Language.html#t:Bool">Bool</a></dt><dd class="doc empty"> </dd><dt class="src"><a name="v:trigName" class="def">trigName</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></dt><dd class="doc empty"> </dd><dt class="src"><a name="v:trigArgs" class="def">trigArgs</a> :: <a href="Language-Copilot-Core.html#t:Args">Args</a></dt><dd class="doc empty"> </dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:Trigger" class="caption collapser" onclick="toggleSection('i:Trigger')">Instances</p><div id="section.i:Trigger" class="show"><table><tr><td class="src"><a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> <a href="Language-Copilot-Core.html#t:Trigger">Trigger</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Triggers" class="def">Triggers</a> = <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> <a href="Language-Copilot-Core.html#t:Trigger">Trigger</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:LangElems" class="def">LangElems</a> </p><div class="doc"><p>Holds all the different kinds of language elements that are pushed into the
Writer monad. This currently includes the actual specs and trigger
directives. (Use the functions in Language.hs to make sends and triggers.)
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:LangElems" class="def">LangElems</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:strms" class="def">strms</a> :: <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> <a href="Language-Copilot-Core.html#t:Spec">Spec</a></dt><dd class="doc empty"> </dd><dt class="src"><a name="v:trigs" class="def">trigs</a> :: <a href="Language-Copilot-Core.html#t:Triggers">Triggers</a></dt><dd class="doc empty"> </dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:LangElems" class="caption collapser" onclick="toggleSection('i:LangElems')">Instances</p><div id="section.i:LangElems" class="show"><table><tr><td class="src"><a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> <a href="Language-Copilot-Core.html#t:Streams">Streams</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Monoid.html#t:Monoid">Monoid</a> <a href="Language-Copilot-Core.html#t:LangElems">LangElems</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (Expr a, Assign a, <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> a) => <a name="t:Streamable" class="def">Streamable</a> a <span class="keyword">where</span></p><div class="doc"><p>Holds the complete specification of a distributed monitor
type DistributedStreams = (Streams, Sends)
</p><p>A type is streamable iff a stream may emit values of that type
</p><p>There are very strong links between <code><code><a href="Language-Copilot-Core.html#t:Streamable">Streamable</a></code></code> and <code><code><a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a></code></code> :
the types aggregated in <code><code><a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a></code></code> are exactly the <code><code><a href="Language-Copilot-Core.html#t:Streamable">Streamable</a></code></code>
types and that invariant should be kept (see methods)
</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:getSubMap" class="def">getSubMap</a> :: <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> b -> <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (b a)</p><div class="doc"><p>Provides access to the Map in a StreamableMaps which store values
of the good type
</p></div><p class="src"><a name="v:updateSubMap" class="def">updateSubMap</a> :: (<a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (b a) -> <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (b a)) -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> b -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> b</p><div class="doc"><p>Provides a way to modify (mostly used for insertions) the Map in a
StreamableMaps which store values of the good type
</p></div><p class="src"><a name="v:unit" class="def">unit</a> :: a</p><div class="doc"><p>A default value for the type <code>a</code>. Its value is not important.
</p></div><p class="src"><a name="v:atomConstructor" class="def">atomConstructor</a> :: <a href="Language-Copilot-Core.html#t:Var">Var</a> -> a -> Atom (V a)</p><div class="doc"><p>A constructor to produce an <code>Atom</code> value
</p></div><p class="src"><a name="v:externalAtomConstructor" class="def">externalAtomConstructor</a> :: <a href="Language-Copilot-Core.html#t:Var">Var</a> -> V a</p><div class="doc"><p>A constructor to get an <code>Atom</code> value from an external variable
</p></div><p class="src"><a name="v:typeId" class="def">typeId</a> :: a -> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></p><div class="doc"><p>The argument only coerces the type, it is discarded. Returns the
format for outputting a value of this type with printf in C
</p><p>For example <a href="%f.html">%f</a> for a float
</p></div><p class="src"><a name="v:typeIdPrec" class="def">typeIdPrec</a> :: a -> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></p><div class="doc"><p>The same, only adds the wanted precision for floating points.
</p></div><p class="src"><a name="v:atomType" class="def">atomType</a> :: a -> Type</p><div class="doc"><p>The argument only coerces the type, it is discarded.
Returns the corresponding <em>Atom</em> type.
</p></div><p class="src"><a name="v:showAsC" class="def">showAsC</a> :: a -> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></p><div class="doc"><p>Like Show, except that the formatting is exactly the same as the one of
C for example the booleans are first converted to 0 or 1, and floats and
doubles have the good precision.
</p></div></div><div class="subs instances"><p id="control.i:Streamable" class="caption collapser" onclick="toggleSection('i:Streamable')">Instances</p><div id="section.i:Streamable" class="show"><table><tr><td class="src"><a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> <a href="Language-Copilot-Language.html#t:Bool">Bool</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Double">Double</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Float">Float</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int8">Int8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int16">Int16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int32">Int32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int64">Int64</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Word.html#t:Word8">Word8</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Word.html#t:Word16">Word16</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Word.html#t:Word32">Word32</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Word.html#t:Word64">Word64</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:StreamableMaps" class="def">StreamableMaps</a> a </p><div class="doc"><p>This is a generalization of <code><code><a href="Language-Copilot-Core.html#t:Streams">Streams</a></code></code>
which is used for storing Maps over values parameterized by different types.
</p><p>It is extensively used in the internals of Copilot, in conjunction with
<code><code><a href="Language-Copilot-Core.html#v:foldStreamableMaps">foldStreamableMaps</a></code></code> and <code><code><a href="Language-Copilot-Core.html#v:mapStreamableMaps">mapStreamableMaps</a></code></code>
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:SM" class="def">SM</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:bMap" class="def">bMap</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="Language-Copilot-Language.html#t:Bool">Bool</a>)</dt><dd class="doc empty"> </dd><dt class="src"><a name="v:i8Map" class="def">i8Map</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int8">Int8</a>)</dt><dd class="doc empty"> </dd><dt class="src"><a name="v:i16Map" class="def">i16Map</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int16">Int16</a>)</dt><dd class="doc empty"> </dd><dt class="src"><a name="v:i32Map" class="def">i32Map</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int32">Int32</a>)</dt><dd class="doc empty"> </dd><dt class="src"><a name="v:i64Map" class="def">i64Map</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int64">Int64</a>)</dt><dd class="doc empty"> </dd><dt class="src"><a name="v:w8Map" class="def">w8Map</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Word.html#t:Word8">Word8</a>)</dt><dd class="doc empty"> </dd><dt class="src"><a name="v:w16Map" class="def">w16Map</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Word.html#t:Word16">Word16</a>)</dt><dd class="doc empty"> </dd><dt class="src"><a name="v:w32Map" class="def">w32Map</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Word.html#t:Word32">Word32</a>)</dt><dd class="doc empty"> </dd><dt class="src"><a name="v:w64Map" class="def">w64Map</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Word.html#t:Word64">Word64</a>)</dt><dd class="doc empty"> </dd><dt class="src"><a name="v:fMap" class="def">fMap</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Float">Float</a>)</dt><dd class="doc empty"> </dd><dt class="src"><a name="v:dMap" class="def">dMap</a> :: <a href="/usr/local/share/doc/ghc/html/libraries/containers-0.4.0.0/Data-Map.html#t:Map">Map</a> <a href="Language-Copilot-Core.html#t:Var">Var</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Double">Double</a>)</dt><dd class="doc empty"> </dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:StreamableMaps" class="caption collapser" onclick="toggleSection('i:StreamableMaps')">Instances</p><div id="section.i:StreamableMaps" class="show"><table><tr><td class="src">(<a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (a <a href="Language-Copilot-Language.html#t:Bool">Bool</a>), <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int8">Int8</a>), <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int16">Int16</a>), <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int32">Int32</a>), <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Int.html#t:Int64">Int64</a>), <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Word.html#t:Word8">Word8</a>), <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Word.html#t:Word16">Word16</a>), <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Word.html#t:Word32">Word32</a>), <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Word.html#t:Word64">Word64</a>), <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Float">Float</a>), <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (a <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Prelude.html#t:Double">Double</a>)) => <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Text-Show.html#t:Show">Show</a> (<a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> a)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Monoid.html#t:Monoid">Monoid</a> (<a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> <a href="Language-Copilot-Core.html#t:Spec">Spec</a>)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:emptySM" class="def">emptySM</a> :: <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> a</p><div class="doc"><p>An empty streamableMaps.
</p></div></div><div class="top"><p class="src"><a name="v:isEmptySM" class="def">isEmptySM</a> :: <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> a -> <a href="Language-Copilot-Language.html#t:Bool">Bool</a></p><div class="doc"><p>Verifies if its argument is equal to emptySM
</p></div></div><div class="top"><p class="src"><a name="v:getMaybeElem" class="def">getMaybeElem</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="Language-Copilot-Core.html#t:Var">Var</a> -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> b -> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (b a)</p><div class="doc"><p>Lookup into the map of the right type in <code><code><a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a></code></code>
</p></div></div><div class="top"><p class="src"><a name="v:getElem" class="def">getElem</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="Language-Copilot-Core.html#t:Var">Var</a> -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> b -> b a</p><div class="doc"><p>Lookup into the map of the right type in <code><code><a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a></code></code>
Launch an exception if the index is not in it
</p></div></div><div class="top"><p class="src"><a name="v:foldStreamableMaps" class="def">foldStreamableMaps</a> :: <span class="keyword">forall</span> b c. (<a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="Language-Copilot-Core.html#t:Var">Var</a> -> c a -> b -> b) -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> c -> b -> b</p><div class="doc"><p>This function is used to iterate on all the values in all the maps stored
by a <code><code><a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a></code></code>, accumulating a value over time
</p></div></div><div class="top"><p class="src"><a name="v:mapStreamableMaps" class="def">mapStreamableMaps</a> :: <span class="keyword">forall</span> s s'. (<span class="keyword">forall</span> a. <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="Language-Copilot-Core.html#t:Var">Var</a> -> s a -> s' a) -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> s -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> s'</p></div><div class="top"><p class="src"><a name="v:mapStreamableMapsM" class="def">mapStreamableMapsM</a> :: <span class="keyword">forall</span> s s' m. <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Control-Monad.html#t:Monad">Monad</a> m => (<a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="Language-Copilot-Core.html#t:Var">Var</a> -> s a -> m (s' a)) -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> s -> m (<a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> s')</p></div><div class="top"><p class="src"><a name="v:filterStreamableMaps" class="def">filterStreamableMaps</a> :: <span class="keyword">forall</span> c b. <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> c -> [(Type, <a href="Language-Copilot-Core.html#t:Var">Var</a>, b)] -> (<a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> c, <a href="Language-Copilot-Language.html#t:Bool">Bool</a>)</p><div class="doc"><p>Only keeps in <code>sm</code> the values whose key+type are in <code>l</code>. Also returns a
bool saying whether all the elements in sm were in l. Works even if some
elements in <code>l</code> are not in <code>sm</code>. Not optimised at all.
</p></div></div><div class="top"><p class="src"><a name="v:normalizeVar" class="def">normalizeVar</a> :: <a href="Language-Copilot-Core.html#t:Var">Var</a> -> <a href="Language-Copilot-Core.html#t:Var">Var</a></p><div class="doc"><p>Replace all accepted special characters by sequences of underscores.
</p></div></div><div class="top"><p class="src"><a name="v:getVars" class="def">getVars</a> :: <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> s -> [<a href="Language-Copilot-Core.html#t:Var">Var</a>]</p><div class="doc"><p>Get the Copilot variables.
</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Vars" class="def">Vars</a> = <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> []</p><div class="doc"><p>For each typed variable, this type holds all its successive values in an infinite list
Beware : each element of one of those lists corresponds to a full <code>Atom</code> period,
not to a single clock tick.
</p></div></div><div class="top"><p class="src"><a name="v:getAtomType" class="def">getAtomType</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a -> Type</p></div><div class="top"><p class="src"><a name="v:getSpecs" class="def">getSpecs</a> :: <a href="Language-Copilot-Core.html#t:Streams">Streams</a> -> <a href="Language-Copilot-Core.html#t:StreamableMaps">StreamableMaps</a> <a href="Language-Copilot-Core.html#t:Spec">Spec</a></p></div><div class="top"><p class="src"><a name="v:getTriggers" class="def">getTriggers</a> :: <a href="Language-Copilot-Core.html#t:Streams">Streams</a> -> <a href="Language-Copilot-Core.html#t:Triggers">Triggers</a></p></div><div class="top"><p class="src"><a name="v:vPre" class="def">vPre</a> :: <a href="Language-Copilot-Core.html#t:Name">Name</a> -> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></p><div class="doc"><p>Copilot variable reference, taking the name of the generated C file.
</p></div></div><div class="top"><p class="src"><a name="v:funcShow" class="def">funcShow</a> :: <a href="Language-Copilot-Core.html#t:Name">Name</a> -> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a> -> <a href="Language-Copilot-Core.html#t:Args">Args</a> -> <a href="/usr/local/share/doc/ghc/html/libraries/base-4.3.1.0/Data-Char.html#t:String">String</a></p><div class="doc"><p>For calling a function with Atom variables.
</p></div></div><div class="top"><p class="src"><a name="v:notConstVarErr" class="def">notConstVarErr</a> :: <a href="Language-Copilot-Core.html#t:Streamable">Streamable</a> a => <a href="Language-Copilot-Core.html#t:Spec">Spec</a> a -> (<a href="Language-Copilot-Core.html#t:ArgConstVar">ArgConstVar</a> -> b) -> b</p><div class="doc"><p>If the <code><a href="Language-Copilot-Core.html#t:Spec">Spec</a></code> isn't a <code><a href="Language-Copilot-Core.html#t:Var">Var</a></code> or <code><a href="Language-Copilot-Core.html#v:Const">Const</a></code>, then throw an error; otherwise,
apply the function.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.9.2</p></div></body></html>