-----------------------------------------------------------------------------
-- |
-- Module      :  Debug.SimpleReflect.Vars
-- Copyright   :  (c) 2008-2014 Twan van Laarhoven
-- License     :  BSD-style
-- 
-- Maintainer  :  twanvl@gmail.com
-- Stability   :  experimental
-- Portability :  portable
--
-- Single letter variable names.
--
-- All names have type @Expr@, except for @f@, @g@ and @h@, which are generic functions.
-- This means that @show (f x :: Expr) == \"f x\"@, but that @show (a x :: Expr)@ gives a type error.
-- On the other hand, the type of @g@ in @show (f g)@ is ambiguous.
--
-----------------------------------------------------------------------------
module Debug.SimpleReflect.Vars
    ( -- * Variables
      a,b,c,d,e,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
      -- * Functions
    , f,f',f'',g,h
      -- * Operators
    , (⊗), (⊕), (@@)
    ) where

import Debug.SimpleReflect.Expr

------------------------------------------------------------------------------
-- Variables!
------------------------------------------------------------------------------

a,b,c,d,e,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z :: Expr
[Expr
a,Expr
b,Expr
c,Expr
d,Expr
e,Expr
i,Expr
j,Expr
k,Expr
l,Expr
m,Expr
n,Expr
o,Expr
p,Expr
q,Expr
r,Expr
s,Expr
t,Expr
u,Expr
v,Expr
w,Expr
x,Expr
y,Expr
z]
   = [String -> Expr
var [Char
letter] | Char
letter <- [Char
'a'..Char
'e']String -> String -> String
forall a. [a] -> [a] -> [a]
++[Char
'i'..Char
'z']]

f,f',f'',g,h :: FromExpr a => a
f :: forall a. FromExpr a => a
f   = String -> a
forall a. FromExpr a => String -> a
fun String
"f"
f' :: forall a. FromExpr a => a
f'  = String -> a
forall a. FromExpr a => String -> a
fun String
"f'"
f'' :: forall a. FromExpr a => a
f'' = String -> a
forall a. FromExpr a => String -> a
fun String
"f''"
g :: forall a. FromExpr a => a
g   = String -> a
forall a. FromExpr a => String -> a
fun String
"g"
h :: forall a. FromExpr a => a
h   = String -> a
forall a. FromExpr a => String -> a
fun String
"h"

------------------------------------------------------------------------------
-- Operators
------------------------------------------------------------------------------

-- | A non-associative infix 9 operator
(@@) :: Expr -> Expr -> Expr
@@ :: Expr -> Expr -> Expr
(@@) = Associativity -> Int -> String -> Expr -> Expr -> Expr
op Associativity
Infix Int
9 String
" @@ "

infix 9 @@

-- | A non-associative infix 7 operator
(⊗) :: Expr -> Expr -> Expr
⊗ :: Expr -> Expr -> Expr
(⊗) = Associativity -> Int -> String -> Expr -> Expr -> Expr
op Associativity
Infix Int
7 String
" ⊗ "

infix 7 

-- | A non-associative infix 6 operator
(⊕) :: Expr -> Expr -> Expr
⊕ :: Expr -> Expr -> Expr
(⊕) = Associativity -> Int -> String -> Expr -> Expr -> Expr
op Associativity
Infix Int
6 String
" ⊕ "

infix 6