Find git executable at run time
[git-darcs-import.git] / src / Darcs / Show.lhs
blob381c65a799ab28eabdb1b001d75560b38049506a
1 \begin{code}
2 {-# OPTIONS_GHC -cpp #-}
3 {-# LANGUAGE CPP #-}
5 module Darcs.Show(Show1(..), Show2(..), showOp2, app_prec) where
7 #include "gadts.h"
9 class Show1 a where
10 show1 :: a C(x) -> String
11 show1 x = showsPrec1 0 x ""
12 showsPrec1 :: Int -> a C(x) -> ShowS
13 showsPrec1 _ x s = show1 x ++ s
15 class Show2 a where
16 show2 :: a C(x y) -> String
17 show2 x = showsPrec2 0 x ""
18 showsPrec2 :: Int -> a C(x y) -> ShowS
19 showsPrec2 _ x s = show2 x ++ s
21 showOp2 :: (Show2 a, Show2 b) => Int -> String -> Int -> a C(w x) -> b C(y z) -> String -> String
22 showOp2 prec opstr d x y = showParen (d > prec) $ showsPrec2 (prec + 1) x .
23 showString opstr . showsPrec2 (prec + 1) y
25 app_prec :: Int
26 app_prec = 10
28 \end{code}