{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_HADDOCK hide #-}
module Data.Array.Accelerate.Pretty (
module Data.Array.Accelerate.Pretty.Print,
module Data.Array.Accelerate.Pretty.Graphviz,
) where
import Text.PrettyPrint
import Data.Array.Accelerate.AST
import Data.Array.Accelerate.Trafo.Base
import Data.Array.Accelerate.Pretty.Print
import Data.Array.Accelerate.Pretty.Graphviz
wide :: Style
wide = style { lineLength = 150 }
instance PrettyEnv aenv => Show (OpenAcc aenv a) where
show c = renderStyle wide $ prettyAcc noParens prettyEnv c
instance PrettyEnv aenv => Show (DelayedOpenAcc aenv a) where
show c = renderStyle wide $ prettyAcc noParens prettyEnv c
instance (Kit acc, PrettyEnv aenv) => Show (PreOpenAfun acc aenv f) where
show f = renderStyle wide $ prettyPreOpenAfun prettyAcc prettyEnv f
instance (Kit acc, PrettyEnv env, PrettyEnv aenv) => Show (PreOpenFun acc env aenv f) where
show f = renderStyle wide $ prettyPreOpenFun prettyAcc prettyEnv prettyEnv f
instance (Kit acc, PrettyEnv env, PrettyEnv aenv) => Show (PreOpenExp acc env aenv t) where
show e = renderStyle wide $ prettyPreOpenExp prettyAcc noParens prettyEnv prettyEnv e