summaryrefslogtreecommitdiff
path: root/compiler/hsSyn/HsExpr.hs-boot
blob: 500d601477733de394e61a8efe6c979303367648 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{-# LANGUAGE CPP, KindSignatures #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-} -- Note [Pass sensitive types]
                                      -- in module PlaceHolder
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE RoleAnnotations #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleInstances #-}

module HsExpr where

import SrcLoc     ( Located )
import Outputable ( SDoc, Outputable )
import {-# SOURCE #-} HsPat  ( LPat )
import BasicTypes ( SpliceExplicitFlag(..))
import HsExtension ( OutputableBndrId, DataIdLR, SourceTextX, GhcPass )
import Data.Data hiding ( Fixity )

type role HsExpr nominal
type role HsCmd nominal
type role MatchGroup nominal representational
type role GRHSs nominal representational
type role HsSplice nominal
type role SyntaxExpr nominal
data HsExpr (i :: *)
data HsCmd  (i :: *)
data HsSplice (i :: *)
data MatchGroup (a :: *) (body :: *)
data GRHSs (a :: *) (body :: *)
data SyntaxExpr (i :: *)

instance (DataIdLR p p) => Data (HsSplice p)
instance (DataIdLR p p) => Data (HsExpr p)
instance (DataIdLR p p) => Data (HsCmd p)
instance (Data body,DataIdLR p p) => Data (MatchGroup p body)
instance (Data body,DataIdLR p p) => Data (GRHSs p body)
instance (DataIdLR p p) => Data (SyntaxExpr p)

instance (SourceTextX (GhcPass p), OutputableBndrId (GhcPass p))
       => Outputable (HsExpr (GhcPass p))
instance (SourceTextX (GhcPass p), OutputableBndrId (GhcPass p))
       => Outputable (HsCmd (GhcPass p))

type LHsExpr a = Located (HsExpr a)

pprLExpr :: (SourceTextX (GhcPass p), OutputableBndrId (GhcPass p))
         => LHsExpr (GhcPass p) -> SDoc

pprExpr :: (SourceTextX (GhcPass p), OutputableBndrId (GhcPass p))
        => HsExpr (GhcPass p) -> SDoc

pprSplice :: (SourceTextX (GhcPass p), OutputableBndrId (GhcPass p))
          => HsSplice (GhcPass p) -> SDoc

pprSpliceDecl ::  (SourceTextX (GhcPass p), OutputableBndrId (GhcPass p))
          => HsSplice (GhcPass p) -> SpliceExplicitFlag -> SDoc

pprPatBind :: forall bndr p body. (SourceTextX (GhcPass p),
                                   SourceTextX (GhcPass bndr),
                                   OutputableBndrId (GhcPass bndr),
                                   OutputableBndrId (GhcPass p),
                                   Outputable body)
           => LPat (GhcPass bndr) -> GRHSs (GhcPass p) body -> SDoc

pprFunBind :: (SourceTextX (GhcPass idR), OutputableBndrId (GhcPass idR),
               Outputable body)
           => MatchGroup (GhcPass idR) body -> SDoc