blob: 51cc19b97c70ba9098f0480d222743a289c3e5bb (
plain)
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
|
-- no default method, backpack
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeApplications #-}
unit common where
module Class where
class Show (T x) => C x where
type T x
def :: T x
--type T x = ()
unit consumer-abs where
dependency common
signature Instance where
import Class
data I = I Int
instance C I where
--type T I = ()
module Downstream where
import Class
import Instance
asdf :: C I => String
asdf = show $ def @I
unit consumer-impl where
dependency common
module Impl where
import Class
data I = I Int
instance C I where
type T I = ()
def = ()
unit tie where
dependency consumer-impl
dependency consumer-abs[Instance=consumer-impl:Impl]
module Tie where
import Downstream
main = print asdf
|