aboutsummaryrefslogtreecommitdiff
path: root/html-test/src/TypeOperators.hs
blob: e69e89cb55a8d756724dd174614073f91284c9c9 (plain) (blame)
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
{-# LANGUAGE TypeOperators, GADTs, MultiParamTypeClasses, FlexibleContexts #-}
module TypeOperators where

data a :-: b

data (a :+: b) c

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