[commit: haddock] 2.17.3.1-spanfix, alexbiehl-patch-1, ghc-8.0, ghc-8.0-facebook, ghc-head, ghc-head1, haddock-quick, headdock-library-1.4.5, ie_avails, issue-303, issue-475, master, pr-filter-maps, pr/cabal-desc, travis, v2.16, v2.17, v2.17.3, v2.18, wip-located-module-as, wip/D2418, wip/T11080-open-data-kinds, wip/T11258, wip/T11430, wip/T12105, wip/T12105-2, wip/T12942, wip/T13163, wip/T14529, wip/T3384, wip/embelleshed-rdr, wip/new-tree-one-param, wip/rae, wip/remove-frames, wip/remove-frames1, wip/revert-ttg-2017-11-20, wip/ttg-2017-10-13, wip/ttg-2017-10-31, wip/ttg-2017-11-06, wip/ttg2-2017-11-10, wip/ttg3-2017-11-12, wip/ttg4-constraints-2017-11-13, wip/ttg6-unrevert-2017-11-22: Add basic tests for associated types in instances test case. (3827f25)

git at git.haskell.org git at git.haskell.org
Tue Nov 28 11:35:46 UTC 2017


Repository : ssh://git@git.haskell.org/haddock

On branches: 2.17.3.1-spanfix,alexbiehl-patch-1,ghc-8.0,ghc-8.0-facebook,ghc-head,ghc-head1,haddock-quick,headdock-library-1.4.5,ie_avails,issue-303,issue-475,master,pr-filter-maps,pr/cabal-desc,travis,v2.16,v2.17,v2.17.3,v2.18,wip-located-module-as,wip/D2418,wip/T11080-open-data-kinds,wip/T11258,wip/T11430,wip/T12105,wip/T12105-2,wip/T12942,wip/T13163,wip/T14529,wip/T3384,wip/embelleshed-rdr,wip/new-tree-one-param,wip/rae,wip/remove-frames,wip/remove-frames1,wip/revert-ttg-2017-11-20,wip/ttg-2017-10-13,wip/ttg-2017-10-31,wip/ttg-2017-11-06,wip/ttg2-2017-11-10,wip/ttg3-2017-11-12,wip/ttg4-constraints-2017-11-13,wip/ttg6-unrevert-2017-11-22
Link       : http://git.haskell.org/haddock.git/commitdiff/3827f2557a52c78ead03350d9e8576278b649745

>---------------------------------------------------------------

commit 3827f2557a52c78ead03350d9e8576278b649745
Author: Ɓukasz Hanuszczak <lukasz.hanuszczak at gmail.com>
Date:   Wed Jul 29 09:37:41 2015 +0200

    Add basic tests for associated types in instances test case.


>---------------------------------------------------------------

3827f2557a52c78ead03350d9e8576278b649745
 html-test/src/Instances.hs | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/html-test/src/Instances.hs b/html-test/src/Instances.hs
index 58bdc87..b7bc892 100644
--- a/html-test/src/Instances.hs
+++ b/html-test/src/Instances.hs
@@ -2,6 +2,7 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE ImpredicativeTypes #-}
+{-# LANGUAGE TypeFamilies #-}
 
 
 module Instances where
@@ -63,3 +64,30 @@ data Quux a b c = Qx a | Qux a b | Quux a b c
 instance Foo (Quux a b)
 instance Bar (Quux a c) (Quux a b c)
 instance Baz (Quux a b c)
+
+
+class Norf a b where
+
+    type Plugh a c b
+    data Thud a c
+
+    norf :: Plugh a c b -> a -> (a -> c) -> b
+
+    norf = undefined
+
+
+instance Norf Int Bool where
+
+    type Plugh Int [a] Bool = a
+    type Plugh Int (a, b) Bool = (a, [b])
+
+    data Thud Int (Quux a [a] c) = Thuud a | Thuuud Int Int
+    data Thud Int [a] = Thuuuud Bool
+
+
+instance Norf [a] [b] where
+
+    type Plugh [a] (Maybe a) [b] = a
+    type Plugh [a] [b] [b] = Quux a b (a, b)
+
+    data Thud [a] (a, a, a) = Thd a



More information about the ghc-commits mailing list