<!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 >TypeFamilies</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_TypeFamilies.html");}; //]]> </script ></head ><body ><div id="package-header" ><ul class="links" id="page-menu" ><li ><a href="" >Contents</a ></li ><li ><a href="" >Index</a ></li ></ul ><p class="caption empty" > </p ></div ><div id="content" ><div id="module-header" ><table class="info" ><tr ><th >Safe Haskell</th ><td >Safe</td ></tr ></table ><p class="caption" >TypeFamilies</p ></div ><div id="description" ><p class="caption" >Description</p ><div class="doc" ><p >Doc for: module TypeFamilies</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" >data</span > <a href="" >X</a ><ul class="subs" ><li >= <a href="" >X</a ></li ><li >| <a href="" >XX</a ></li ><li >| <a href="" >XXX</a ></li ></ul ></li ><li class="src short" ><span class="keyword" >data</span > <a href="" >Y</a ></li ><li class="src short" ><span class="keyword" >data</span > <a href="" >Z</a ><ul class="subs" ><li >= <a href="" >ZA</a ></li ><li >| <a href="" >ZB</a ></li ></ul ></li ><li class="src short" ><span class="keyword" >class</span > <a href="" >Test</a > a</li ><li class="src short" ><span class="keyword" >type family</span > <a href="" >Foo</a > a :: k</li ><li class="src short" ><span class="keyword" >data family</span > <a href="" >Bat</a > a :: *</li ><li class="src short" ><span class="keyword" >class</span > <a href="" >Assoc</a > a <span class="keyword" >where</span ><ul class="subs" ><li ><span class="keyword" >data</span > <a href="" >AssocD</a > a :: *</li ><li ><span class="keyword" >type</span > <a href="" >AssocT</a > a :: *</li ></ul ></li ><li class="src short" ><span class="keyword" >type family</span > <a href="" >Bar</a > b</li ><li class="src short" ><span class="keyword" >type family</span > a <a href="" ><></a > b :: k</li ><li class="src short" ><span class="keyword" >class</span > a <a href="" >><</a > b</li ></ul ></div ><div id="interface" ><h1 >Documentation</h1 ><div class="top" ><p class="src" ><span class="keyword" >data</span > <a href="" id="t:X" class="def" >X</a ></p ><div class="doc" ><p >Doc for: data X</p ></div ><div class="subs constructors" ><p class="caption" >Constructors</p ><table ><tr ><td class="src" ><a href="" id="v:X" class="def" >X</a ></td ><td class="doc" ><p >Doc for: X</p ></td ></tr ><tr ><td class="src" ><a href="" id="v:XX" class="def" >XX</a ></td ><td class="doc" ><p >Doc for: XX</p ></td ></tr ><tr ><td class="src" ><a href="" id="v:XXX" class="def" >XXX</a ></td ><td class="doc" ><p >Doc for: XXX</p ></td ></tr ></table ></div ><div class="subs instances" ><p id="control.i:X" class="caption collapser" onclick="toggleSection('i:X')" >Instances</p ><div id="section.i:X" class="show" ><table ><tr ><td class="src clearfix" ><span class="inst-left" ><span id="control.i:id:X:Assoc:1" class="instance expander" onclick="toggleSection('i:id:X:Assoc:1')" ></span > <a href="" >Assoc</a > * <a href="" >X</a ></span ></td ><td class="doc" ><p >Doc for: instance Assoc X</p ></td ></tr ><tr ><td colspan="2" ><div id="section.i:id:X:Assoc:1" class="inst-details hide" ><div class="subs associated-types" ><p class="caption" >Associated Types</p ><p class="src" ><span class="keyword" >data</span > <a href="" >AssocD</a > (<a href="" >X</a > :: k)</p ><p class="src" ><span class="keyword" >type</span > <a href="" >AssocT</a > (<a href="" >X</a > :: k) :: *</p ></div ></div ></td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span id="control.i:id:X:Test:2" class="instance expander" onclick="toggleSection('i:id:X:Test:2')" ></span > <a href="" >Test</a > * <a href="" >X</a ></span ></td ><td class="doc" ><p >Doc for: instance Test X</p ></td ></tr ><tr ><td colspan="2" ><div id="section.i:id:X:Test:2" class="inst-details hide" ></div ></td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span id="control.i:id:X:-62--60-:3" class="instance expander" onclick="toggleSection('i:id:X:-62--60-:3')" ></span > <a href="" >(><)</a > <a href="" >X</a > <a href="" >XX</a > <a href="" >XXX</a ></span ></td ><td class="doc empty" > </td ></tr ><tr ><td colspan="2" ><div id="section.i:id:X:-62--60-:3" class="inst-details hide" ></div ></td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >type</span > <a href="" >Foo</a > <a href="" >X</a > = <a href="" >Y</a ></span ></td ><td class="doc" ><p >External instance</p ></td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >data</span > <a href="" >AssocD</a > * <a href="" >X</a > = <a href="" id="v:AssocX" class="def" >AssocX</a ></span ></td ><td class="doc empty" > </td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >type</span > <a href="" >AssocT</a > * <a href="" >X</a > = <a href="" >Foo</a > * <a href="" >X</a ></span ></td ><td class="doc empty" > </td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >data</span > <a href="" >Bat</a > * <a href="" >X</a > <ul class="inst" ><li class="inst" >= <a href="" id="v:BatX" class="def" >BatX</a > <a href="" >X</a ></li ><li class="inst" >| <a href="" id="v:BatXX" class="def" >BatXX</a > { <ul class="subs" ><li ><a href="" id="v:aaa" class="def" >aaa</a > :: <a href="" >X</a ></li ><li ><a href="" id="v:bbb" class="def" >bbb</a > :: <a href="" >Y</a ></li ></ul > }</li ></ul ></span ></td ><td class="doc" ><p >Doc for: data instance Bat X</p ></td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >type</span > <a href="" >Foo</a > * <a href="" >X</a > = <a href="" >Y</a ></span ></td ><td class="doc" ><p >Doc for: type instance Foo X = Y</p ></td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >type</span > <a href="" >(<>)</a > * <a href="" >X</a > a = <a href="" >X</a ></span ></td ><td class="doc empty" > </td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >type</span > <a href="" >(<>)</a > <a href="" >X</a > <a href="" >XXX</a > <a href="" >XX</a > = <a href="" >X</a ></span ></td ><td class="doc empty" > </td ></tr ></table ></div ></div ></div ><div class="top" ><p class="src" ><span class="keyword" >data</span > <a href="" id="t:Y" class="def" >Y</a ></p ><div class="doc" ><p >Doc for: data Y</p ></div ><div class="subs instances" ><p id="control.i:Y" class="caption collapser" onclick="toggleSection('i:Y')" >Instances</p ><div id="section.i:Y" class="show" ><table ><tr ><td class="src clearfix" ><span class="inst-left" ><span id="control.i:id:Y:Assoc:1" class="instance expander" onclick="toggleSection('i:id:Y:Assoc:1')" ></span > <a href="" >Assoc</a > * <a href="" >Y</a ></span ></td ><td class="doc" ><p >Doc for: instance Assoc Y</p ></td ></tr ><tr ><td colspan="2" ><div id="section.i:id:Y:Assoc:1" class="inst-details hide" ><div class="subs associated-types" ><p class="caption" >Associated Types</p ><p class="src" ><span class="keyword" >data</span > <a href="" >AssocD</a > (<a href="" >Y</a > :: k)</p ><p class="src" ><span class="keyword" >type</span > <a href="" >AssocT</a > (<a href="" >Y</a > :: k) :: *</p ></div ></div ></td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span id="control.i:id:Y:Test:2" class="instance expander" onclick="toggleSection('i:id:Y:Test:2')" ></span > <a href="" >Test</a > * <a href="" >Y</a ></span ></td ><td class="doc" ><p >Doc for: instance Test Y</p ></td ></tr ><tr ><td colspan="2" ><div id="section.i:id:Y:Test:2" class="inst-details hide" ></div ></td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >data</span > <a href="" >Bar</a > <a href="" >Y</a ></span ></td ><td class="doc empty" > </td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >data</span > <a href="" >AssocD</a > * <a href="" >Y</a > = <a href="" id="v:AssocY" class="def" >AssocY</a ></span ></td ><td class="doc empty" > </td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >type</span > <a href="" >AssocT</a > * <a href="" >Y</a > = <a href="" >Bat</a > * <a href="" >Y</a ></span ></td ><td class="doc empty" > </td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >data</span > <a href="" >Bat</a > * <a href="" >Y</a > = <a href="" id="v:BatY" class="def" >BatY</a > <a href="" >Y</a ></span ></td ><td class="doc" ><p >Doc for: data instance Bat Y</p ></td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >type</span > <a href="" >Foo</a > * <a href="" >Y</a > = <a href="" >X</a ></span ></td ><td class="doc" ><p >Doc for: type instance Foo Y = X</p ></td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >type</span > <a href="" >(<>)</a > * <a href="" >Y</a > a = a</span ></td ><td class="doc empty" > </td ></tr ></table ></div ></div ></div ><div class="top" ><p class="src" ><span class="keyword" >data</span > <a href="" id="t:Z" class="def" >Z</a ></p ><div class="doc" ><p >Doc for: data Z</p ></div ><div class="subs constructors" ><p class="caption" >Constructors</p ><table ><tr ><td class="src" ><a href="" id="v:ZA" class="def" >ZA</a ></td ><td class="doc empty" > </td ></tr ><tr ><td class="src" ><a href="" id="v:ZB" class="def" >ZB</a ></td ><td class="doc empty" > </td ></tr ></table ></div ><div class="subs instances" ><p id="control.i:Z" class="caption collapser" onclick="toggleSection('i:Z')" >Instances</p ><div id="section.i:Z" class="show" ><table ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >data</span > <a href="" >Bat</a > <a href="" >Z</a > <span class="keyword" >where</span ><ul class="inst" ><li class="inst" ><a href="" id="v:BatZ1" class="def" >BatZ1</a > :: <a href="" >Z</a > -> <a href="" >Bat</a > <a href="" >Z</a > <a href="" >ZA</a ></li ><li class="inst" ><a href="" id="v:BatZ2" class="def" >BatZ2</a > :: { <ul class="subs" ><li ><a href="" id="v:batx" class="def" >batx</a > :: <a href="" >X</a ></li ><li ><a href="" id="v:baty" class="def" >baty</a > :: <a href="" >Y</a ></li ></ul > } -> <a href="" >Bat</a > <a href="" >Z</a > <a href="" >ZB</a ></li ></ul ></span ></td ><td class="doc" ><p >Doc for: data instance Bat Z</p ></td ></tr ></table ></div ></div ></div ><div class="top" ><p class="src" ><span class="keyword" >class</span > <a href="" id="t:Test" class="def" >Test</a > a</p ><div class="doc" ><p >Doc for: class Test a</p ></div ><div class="subs instances" ><p id="control.i:Test" class="caption collapser" onclick="toggleSection('i:Test')" >Instances</p ><div id="section.i:Test" class="show" ><table ><tr ><td class="src clearfix" ><span class="inst-left" ><span id="control.i:ic:Test:Test:1" class="instance expander" onclick="toggleSection('i:ic:Test:Test:1')" ></span > <a href="" >Test</a > * <a href="" >Y</a ></span ></td ><td class="doc" ><p >Doc for: instance Test Y</p ></td ></tr ><tr ><td colspan="2" ><div id="section.i:ic:Test:Test:1" class="inst-details hide" ></div ></td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span id="control.i:ic:Test:Test:2" class="instance expander" onclick="toggleSection('i:ic:Test:Test:2')" ></span > <a href="" >Test</a > * <a href="" >X</a ></span ></td ><td class="doc" ><p >Doc for: instance Test X</p ></td ></tr ><tr ><td colspan="2" ><div id="section.i:ic:Test:Test:2" class="inst-details hide" ></div ></td ></tr ></table ></div ></div ></div ><div class="top" ><p class="src" ><span class="keyword" >type family</span > <a href="" id="t:Foo" class="def" >Foo</a > a :: k</p ><div class="doc" ><p >Doc for: type family Foo a</p ></div ><div class="subs instances" ><p id="control.i:Foo" class="caption collapser" onclick="toggleSection('i:Foo')" >Instances</p ><div id="section.i:Foo" class="show" ><table ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >type</span > <a href="" >Foo</a > * <a href="" >Y</a > = <a href="" >X</a ></span ></td ><td class="doc" ><p >Doc for: type instance Foo Y = X</p ></td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >type</span > <a href="" >Foo</a > * <a href="" >X</a > = <a href="" >Y</a ></span ></td ><td class="doc" ><p >Doc for: type instance Foo X = Y</p ></td ></tr ></table ></div ></div ></div ><div class="top" ><p class="src" ><span class="keyword" >data family</span > <a href="" id="t:Bat" class="def" >Bat</a > a :: *</p ><div class="doc" ><p >Doc for: data family Bat a</p ></div ><div class="subs instances" ><p id="control.i:Bat" class="caption collapser" onclick="toggleSection('i:Bat')" >Instances</p ><div id="section.i:Bat" class="show" ><table ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >data</span > <a href="" >Bat</a > <a href="" >Z</a > <span class="keyword" >where</span ><ul class="inst" ><li class="inst" ><a href="" id="v:BatZ1" class="def" >BatZ1</a > :: <a href="" >Z</a > -> <a href="" >Bat</a > <a href="" >Z</a > <a href="" >ZA</a ></li ><li class="inst" ><a href="" id="v:BatZ2" class="def" >BatZ2</a > :: { <ul class="subs" ><li ><a href="" id="v:batx" class="def" >batx</a > :: <a href="" >X</a ></li ><li ><a href="" id="v:baty" class="def" >baty</a > :: <a href="" >Y</a ></li ></ul > } -> <a href="" >Bat</a > <a href="" >Z</a > <a href="" >ZB</a ></li ></ul ></span ></td ><td class="doc" ><p >Doc for: data instance Bat Z</p ></td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >data</span > <a href="" >Bat</a > * <a href="" >Y</a > = <a href="" id="v:BatY" class="def" >BatY</a > <a href="" >Y</a ></span ></td ><td class="doc" ><p >Doc for: data instance Bat Y</p ></td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >data</span > <a href="" >Bat</a > * <a href="" >X</a > <ul class="inst" ><li class="inst" >= <a href="" id="v:BatX" class="def" >BatX</a > <a href="" >X</a ></li ><li class="inst" >| <a href="" id="v:BatXX" class="def" >BatXX</a > { <ul class="subs" ><li ><a href="" id="v:aaa" class="def" >aaa</a > :: <a href="" >X</a ></li ><li ><a href="" id="v:bbb" class="def" >bbb</a > :: <a href="" >Y</a ></li ></ul > }</li ></ul ></span ></td ><td class="doc" ><p >Doc for: data instance Bat X</p ></td ></tr ></table ></div ></div ></div ><div class="top" ><p class="src" ><span class="keyword" >class</span > <a href="" id="t:Assoc" class="def" >Assoc</a > a</p ><div class="doc" ><p >Doc for: class Assoc a</p ></div ><div class="subs associated-types" ><p class="caption" >Associated Types</p ><p class="src" ><span class="keyword" >data</span > <a href="" id="t:AssocD" class="def" >AssocD</a > a :: *</p ><div class="doc" ><p >Doc for: data AssocD a</p ></div ><p class="src" ><span class="keyword" >type</span > <a href="" id="t:AssocT" class="def" >AssocT</a > a :: *</p ><div class="doc" ><p >Doc for: type AssocT a</p ></div ></div ><div class="subs instances" ><p id="control.i:Assoc" class="caption collapser" onclick="toggleSection('i:Assoc')" >Instances</p ><div id="section.i:Assoc" class="show" ><table ><tr ><td class="src clearfix" ><span class="inst-left" ><span id="control.i:ic:Assoc:Assoc:1" class="instance expander" onclick="toggleSection('i:ic:Assoc:Assoc:1')" ></span > <a href="" >Assoc</a > * <a href="" >Y</a ></span ></td ><td class="doc" ><p >Doc for: instance Assoc Y</p ></td ></tr ><tr ><td colspan="2" ><div id="section.i:ic:Assoc:Assoc:1" class="inst-details hide" ><div class="subs associated-types" ><p class="caption" >Associated Types</p ><p class="src" ><span class="keyword" >data</span > <a href="" >AssocD</a > (<a href="" >Y</a > :: k)</p ><p class="src" ><span class="keyword" >type</span > <a href="" >AssocT</a > (<a href="" >Y</a > :: k) :: *</p ></div ></div ></td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span id="control.i:ic:Assoc:Assoc:2" class="instance expander" onclick="toggleSection('i:ic:Assoc:Assoc:2')" ></span > <a href="" >Assoc</a > * <a href="" >X</a ></span ></td ><td class="doc" ><p >Doc for: instance Assoc X</p ></td ></tr ><tr ><td colspan="2" ><div id="section.i:ic:Assoc:Assoc:2" class="inst-details hide" ><div class="subs associated-types" ><p class="caption" >Associated Types</p ><p class="src" ><span class="keyword" >data</span > <a href="" >AssocD</a > (<a href="" >X</a > :: k)</p ><p class="src" ><span class="keyword" >type</span > <a href="" >AssocT</a > (<a href="" >X</a > :: k) :: *</p ></div ></div ></td ></tr ></table ></div ></div ></div ><div class="top" ><p class="src" ><span class="keyword" >type family</span > <a href="" id="t:Bar" class="def" >Bar</a > b</p ><div class="doc" ><p >Doc for: type family Bar b</p ></div ><div class="subs equations" ><p class="caption" >Equations</p ><table ><tr ><td class="src" ><a href="" >Bar</a > <a href="" >X</a > = <a href="" >X</a ></td ><td class="doc empty" > </td ></tr ><tr ><td class="src" ><a href="" >Bar</a > y = <a href="" >Y</a ></td ><td class="doc empty" > </td ></tr ></table ></div ></div ><div class="top" ><p class="src" ><span class="keyword" >type family</span > a <a href="" id="t:-60--62-" class="def" ><></a > b :: k</p ><div class="subs instances" ><p id="control.i:-60--62-" class="caption collapser" onclick="toggleSection('i:-60--62-')" >Instances</p ><div id="section.i:-60--62-" class="show" ><table ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >type</span > <a href="" >(<>)</a > * <a href="" >Y</a > a = a</span ></td ><td class="doc empty" > </td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >type</span > <a href="" >(<>)</a > * <a href="" >X</a > a = <a href="" >X</a ></span ></td ><td class="doc empty" > </td ></tr ><tr ><td class="src clearfix" ><span class="inst-left" ><span class="keyword" >type</span > <a href="" >(<>)</a > <a href="" >X</a > <a href="" >XXX</a > <a href="" >XX</a > = <a href="" >X</a ></span ></td ><td class="doc empty" > </td ></tr ></table ></div ></div ></div ><div class="top" ><p class="src" ><span class="keyword" >class</span > a <a href="" id="t:-62--60-" class="def" >><</a > b</p ><div class="subs instances" ><p id="control.i:-62--60-" class="caption collapser" onclick="toggleSection('i:-62--60-')" >Instances</p ><div id="section.i:-62--60-" class="show" ><table ><tr ><td class="src clearfix" ><span class="inst-left" ><span id="control.i:ic:-62--60-:-62--60-:1" class="instance expander" onclick="toggleSection('i:ic:-62--60-:-62--60-:1')" ></span > <a href="" >(><)</a > <a href="" >X</a > <a href="" >XX</a > <a href="" >XXX</a ></span ></td ><td class="doc empty" > </td ></tr ><tr ><td colspan="2" ><div id="section.i:ic:-62--60-:-62--60-:1" class="inst-details hide" ></div ></td ></tr ></table ></div ></div ></div ></div ></div ><div id="footer" ><p >Produced by <a href="" >Haddock</a > version 2.16.2</p ></div ></body ></html >