diff options
author | Niklas Haas <git@nand.wakku.to> | 2014-02-23 15:37:13 +0100 |
---|---|---|
committer | Niklas Haas <git@nand.wakku.to> | 2014-02-23 15:37:13 +0100 |
commit | 64850ca4f7dc2ca0fdb21d078d93cd636de5c87a (patch) | |
tree | 294c6f3115b29620ed7b4cd9bf3b5a5f93a5c289 /html-test | |
parent | 14531f7838c5abd0ba2aaf5217a477194d7b1897 (diff) |
Lower precedence of equality constraints
This drops them to the new precedence pREC_CTX, which makes single
eqaulity constraints show up as (a ~ b) => ty, in line with GHC's
rendering. Additional tests added to make sure other type operators
render as intended. Current behavior matches GHC
Diffstat (limited to 'html-test')
-rw-r--r-- | html-test/ref/TypeOperators.html | 110 | ||||
-rw-r--r-- | html-test/src/TypeOperators.hs | 25 |
2 files changed, 66 insertions, 69 deletions
diff --git a/html-test/ref/TypeOperators.html b/html-test/ref/TypeOperators.html index fa02b57e..eb9c3e9f 100644 --- a/html-test/ref/TypeOperators.html +++ b/html-test/ref/TypeOperators.html @@ -41,63 +41,9 @@ window.onload = function () {pageLoad();setSynopsis("mini_TypeOperators.html");} ><p class="caption" >TypeOperators</p ></div - ><div id="table-of-contents" - ><p class="caption" - >Contents</p - ><ul - ><li - ><a href="" - >stuff</a - ></li - ></ul - ></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" - >data</span - > a <a href="" - >:-:</a - > b</li - ><li class="src short" - ><span class="keyword" - >data</span - > (a <a href="" - >:+:</a - > b) c</li - ><li class="src short" - ><span class="keyword" - >data</span - > <a href="" - >Op</a - > a b</li - ><li class="src short" - ><span class="keyword" - >newtype</span - > <a href="" - >O</a - > g f a = <a href="" - >O</a - > {<ul class="subs" - ><li - ><a href="" - >unO</a - > :: g (f a)</li - ></ul - >}</li - ><li class="src short" - ><a href="" - >biO</a - > :: (g `<a href="" - >O</a - >` f) a</li - ></ul - ></div ><div id="interface" - ><h1 id="g:1" - >stuff</h1 + ><h1 + >Documentation</h1 ><div class="top" ><p class="src" ><span class="keyword" @@ -164,17 +110,61 @@ window.onload = function () {pageLoad();setSynopsis("mini_TypeOperators.html");} ></div ><div class="top" ><p class="src" + ><span class="keyword" + >class</span + > a <a name="t:-60--61--62-" class="def" + ><=></a + > b</p + ></div + ><div class="top" + ><p class="src" ><a name="v:biO" class="def" >biO</a - > :: (g `<a href="" - >O</a - >` f) a</p + > :: (g <a href="TypeOperators.html#t:O" + >`O`</a + > f) a</p + ></div + ><div class="top" + ><p class="src" + ><a name="v:f" class="def" + >f</a + > :: (a ~ b) => a -> b</p + ></div + ><div class="top" + ><p class="src" + ><a name="v:g" class="def" + >g</a + > :: (a ~ b, b ~ c) => a -> c</p + ></div + ><div class="top" + ><p class="src" + ><a name="v:x" class="def" + >x</a + > :: (a <a href="TypeOperators.html#t::-45-:" + >:-:</a + > a) <a href="TypeOperators.html#t:-60--61--62-" + ><=></a + > (a <a href="TypeOperators.html#t:Op" + >`Op`</a + > a) => a</p + ></div + ><div class="top" + ><p class="src" + ><a name="v:y" class="def" + >y</a + > :: (a <a href="TypeOperators.html#t:-60--61--62-" + ><=></a + > a, (a <a href="TypeOperators.html#t:Op" + >`Op`</a + > a) <a href="TypeOperators.html#t:-60--61--62-" + ><=></a + > a) => a</p ></div ></div ></div ><div id="footer" ><p - >Produced by <a href="" + >Produced by <a href="http://www.haskell.org/haddock/" >Haddock</a > version 2.14.0</p ></div diff --git a/html-test/src/TypeOperators.hs b/html-test/src/TypeOperators.hs index edbb9344..e69e89cb 100644 --- a/html-test/src/TypeOperators.hs +++ b/html-test/src/TypeOperators.hs @@ -1,12 +1,5 @@ -{-# LANGUAGE TypeOperators #-} -module TypeOperators ( - -- * stuff - (:-:), - (:+:), - Op, - O(..), - biO, -) where +{-# LANGUAGE TypeOperators, GADTs, MultiParamTypeClasses, FlexibleContexts #-} +module TypeOperators where data a :-: b @@ -16,5 +9,19 @@ data a `Op` b newtype (g `O` f) a = O { unO :: g (f a) } +class a <=> b + biO :: (g `O` f) a biO = undefined + +f :: (a ~ b) => a -> b +f = id + +g :: (a ~ b, b ~ c) => a -> c +g = id + +x :: ((a :-: a) <=> (a `Op` a)) => a +x = undefined + +y :: (a <=> a, (a `Op` a) <=> a) => a +y = undefined |