summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts/T8357.hs
blob: 322ec11e1909a84ea7336e4d25e5f6abb550c363 (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
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeOperators #-}
module T8357 where

import Data.Kind (Type)
import GHC.TypeLits 

data (:::) (sy :: Symbol) ty 
data Key (sy :: Symbol) 
data Rec (rs :: [Type])

(*=) :: Key sy -> ty -> Rec '[sy ::: ty]
(*=) = undefined

(.*.) :: (Union xs ys ~ rs) => Rec xs -> Rec ys -> Rec rs
(.*.) = undefined

type family Union (xs :: [Type]) (ys :: [Type]) :: [Type]  where
    Union ((sy ::: t) ': xs) ys = (sy ::: t) ': Union xs ys
    Union '[] ys = ys


fFoo :: Key "foo"
fFoo = undefined

fBar :: Key "bar"
fBar = undefined

foo = fFoo *= "foo"
bar = fBar *= "bar"
both = foo .*. bar