/usr/share/doc/libghc-comonad-doc/html/src/Control-Comonad-Traced-Class.html is in libghc-comonad-doc 4.0-1build3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<!-- Generated by HsColour, http://code.haskell.org/~malcolm/hscolour/ -->
<title>src/Control/Comonad/Traced/Class.hs</title>
<link type='text/css' rel='stylesheet' href='hscolour.css' />
</head>
<body>
<pre><a name="line-1"></a><span class='hs-comment'>{-# LANGUAGE MultiParamTypeClasses #-}</span>
<a name="line-2"></a><span class='hs-comment'>{-# LANGUAGE FunctionalDependencies #-}</span>
<a name="line-3"></a><span class='hs-comment'>{-# LANGUAGE FlexibleInstances #-}</span>
<a name="line-4"></a><span class='hs-comment'>{-# LANGUAGE UndecidableInstances #-}</span>
<a name="line-5"></a><span class='hs-comment'>{-# LANGUAGE CPP #-}</span>
<a name="line-6"></a><span class='hs-cpp'>#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702</span>
<a name="line-7"></a><span class='hs-comment'>{-# LANGUAGE Trustworthy #-}</span>
<a name="line-8"></a><span class='hs-cpp'>#endif</span>
<a name="line-9"></a><span class='hs-comment'>-----------------------------------------------------------------------------</span>
<a name="line-10"></a><span class='hs-comment'>-- |</span>
<a name="line-11"></a><span class='hs-comment'>-- Module : Control.Comonad.Traced.Class</span>
<a name="line-12"></a><span class='hs-comment'>-- Copyright : (C) 2008-2012 Edward Kmett</span>
<a name="line-13"></a><span class='hs-comment'>-- License : BSD-style (see the file LICENSE)</span>
<a name="line-14"></a><span class='hs-comment'>--</span>
<a name="line-15"></a><span class='hs-comment'>-- Maintainer : Edward Kmett <ekmett@gmail.com></span>
<a name="line-16"></a><span class='hs-comment'>-- Stability : experimental</span>
<a name="line-17"></a><span class='hs-comment'>-- Portability : non-portable (fundeps, MPTCs)</span>
<a name="line-18"></a><span class='hs-comment'>----------------------------------------------------------------------------</span>
<a name="line-19"></a><span class='hs-keyword'>module</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Comonad</span><span class='hs-varop'>.</span><span class='hs-conid'>Traced</span><span class='hs-varop'>.</span><span class='hs-conid'>Class</span>
<a name="line-20"></a> <span class='hs-layout'>(</span> <span class='hs-conid'>ComonadTraced</span><span class='hs-layout'>(</span><span class='hs-keyglyph'>..</span><span class='hs-layout'>)</span>
<a name="line-21"></a> <span class='hs-layout'>,</span> <span class='hs-varid'>traces</span>
<a name="line-22"></a> <span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-23"></a>
<a name="line-24"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Comonad</span>
<a name="line-25"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Comonad</span><span class='hs-varop'>.</span><span class='hs-conid'>Trans</span><span class='hs-varop'>.</span><span class='hs-conid'>Class</span>
<a name="line-26"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Comonad</span><span class='hs-varop'>.</span><span class='hs-conid'>Trans</span><span class='hs-varop'>.</span><span class='hs-conid'>Env</span>
<a name="line-27"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Comonad</span><span class='hs-varop'>.</span><span class='hs-conid'>Trans</span><span class='hs-varop'>.</span><span class='hs-conid'>Store</span>
<a name="line-28"></a><span class='hs-keyword'>import</span> <span class='hs-keyword'>qualified</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Comonad</span><span class='hs-varop'>.</span><span class='hs-conid'>Trans</span><span class='hs-varop'>.</span><span class='hs-conid'>Traced</span> <span class='hs-keyword'>as</span> <span class='hs-conid'>Traced</span>
<a name="line-29"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Control</span><span class='hs-varop'>.</span><span class='hs-conid'>Comonad</span><span class='hs-varop'>.</span><span class='hs-conid'>Trans</span><span class='hs-varop'>.</span><span class='hs-conid'>Identity</span>
<a name="line-30"></a><span class='hs-keyword'>import</span> <span class='hs-conid'>Data</span><span class='hs-varop'>.</span><span class='hs-conid'>Semigroup</span>
<a name="line-31"></a>
<a name="line-32"></a><a name="ComonadTraced"></a><span class='hs-keyword'>class</span> <span class='hs-conid'>Comonad</span> <span class='hs-varid'>w</span> <span class='hs-keyglyph'>=></span> <span class='hs-conid'>ComonadTraced</span> <span class='hs-varid'>m</span> <span class='hs-varid'>w</span> <span class='hs-keyglyph'>|</span> <span class='hs-varid'>w</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>m</span> <span class='hs-keyword'>where</span>
<a name="line-33"></a> <span class='hs-varid'>trace</span> <span class='hs-keyglyph'>::</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>w</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span>
<a name="line-34"></a>
<a name="line-35"></a><a name="traces"></a><span class='hs-definition'>traces</span> <span class='hs-keyglyph'>::</span> <span class='hs-conid'>ComonadTraced</span> <span class='hs-varid'>m</span> <span class='hs-varid'>w</span> <span class='hs-keyglyph'>=></span> <span class='hs-layout'>(</span><span class='hs-varid'>a</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>m</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>w</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span>
<a name="line-36"></a><span class='hs-definition'>traces</span> <span class='hs-varid'>f</span> <span class='hs-varid'>wa</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>trace</span> <span class='hs-layout'>(</span><span class='hs-varid'>f</span> <span class='hs-layout'>(</span><span class='hs-varid'>extract</span> <span class='hs-varid'>wa</span><span class='hs-layout'>)</span><span class='hs-layout'>)</span> <span class='hs-varid'>wa</span>
<a name="line-37"></a><span class='hs-comment'>{-# INLINE traces #-}</span>
<a name="line-38"></a>
<a name="line-39"></a><a name="instance%20ComonadTraced%20m%20(Traced.TracedT%20m%20w)"></a><span class='hs-keyword'>instance</span> <span class='hs-layout'>(</span><span class='hs-conid'>Comonad</span> <span class='hs-varid'>w</span><span class='hs-layout'>,</span> <span class='hs-conid'>Monoid</span> <span class='hs-varid'>m</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=></span> <span class='hs-conid'>ComonadTraced</span> <span class='hs-varid'>m</span> <span class='hs-layout'>(</span><span class='hs-conid'>Traced</span><span class='hs-varop'>.</span><span class='hs-conid'>TracedT</span> <span class='hs-varid'>m</span> <span class='hs-varid'>w</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-40"></a> <span class='hs-varid'>trace</span> <span class='hs-keyglyph'>=</span> <span class='hs-conid'>Traced</span><span class='hs-varop'>.</span><span class='hs-varid'>trace</span>
<a name="line-41"></a>
<a name="line-42"></a><a name="lowerTrace"></a><span class='hs-definition'>lowerTrace</span> <span class='hs-keyglyph'>::</span> <span class='hs-layout'>(</span><span class='hs-conid'>ComonadTrans</span> <span class='hs-varid'>t</span><span class='hs-layout'>,</span> <span class='hs-conid'>ComonadTraced</span> <span class='hs-varid'>m</span> <span class='hs-varid'>w</span><span class='hs-layout'>)</span> <span class='hs-keyglyph'>=></span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>t</span> <span class='hs-varid'>w</span> <span class='hs-varid'>a</span> <span class='hs-keyglyph'>-></span> <span class='hs-varid'>a</span>
<a name="line-43"></a><span class='hs-definition'>lowerTrace</span> <span class='hs-varid'>m</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>trace</span> <span class='hs-varid'>m</span> <span class='hs-varop'>.</span> <span class='hs-varid'>lower</span>
<a name="line-44"></a><span class='hs-comment'>{-# INLINE lowerTrace #-}</span>
<a name="line-45"></a>
<a name="line-46"></a><span class='hs-comment'>-- All of these require UndecidableInstances because they do not satisfy the coverage condition</span>
<a name="line-47"></a>
<a name="line-48"></a><a name="instance%20ComonadTraced%20m%20(IdentityT%20w)"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>ComonadTraced</span> <span class='hs-varid'>m</span> <span class='hs-varid'>w</span> <span class='hs-keyglyph'>=></span> <span class='hs-conid'>ComonadTraced</span> <span class='hs-varid'>m</span> <span class='hs-layout'>(</span><span class='hs-conid'>IdentityT</span> <span class='hs-varid'>w</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-49"></a> <span class='hs-varid'>trace</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>lowerTrace</span>
<a name="line-50"></a>
<a name="line-51"></a><a name="instance%20ComonadTraced%20m%20(EnvT%20e%20w)"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>ComonadTraced</span> <span class='hs-varid'>m</span> <span class='hs-varid'>w</span> <span class='hs-keyglyph'>=></span> <span class='hs-conid'>ComonadTraced</span> <span class='hs-varid'>m</span> <span class='hs-layout'>(</span><span class='hs-conid'>EnvT</span> <span class='hs-varid'>e</span> <span class='hs-varid'>w</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-52"></a> <span class='hs-varid'>trace</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>lowerTrace</span>
<a name="line-53"></a>
<a name="line-54"></a><a name="instance%20ComonadTraced%20m%20(StoreT%20s%20w)"></a><span class='hs-keyword'>instance</span> <span class='hs-conid'>ComonadTraced</span> <span class='hs-varid'>m</span> <span class='hs-varid'>w</span> <span class='hs-keyglyph'>=></span> <span class='hs-conid'>ComonadTraced</span> <span class='hs-varid'>m</span> <span class='hs-layout'>(</span><span class='hs-conid'>StoreT</span> <span class='hs-varid'>s</span> <span class='hs-varid'>w</span><span class='hs-layout'>)</span> <span class='hs-keyword'>where</span>
<a name="line-55"></a> <span class='hs-varid'>trace</span> <span class='hs-keyglyph'>=</span> <span class='hs-varid'>lowerTrace</span>
</pre></body>
</html>
|