{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
module Nix.Expr.Types.Annotated
( module Nix.Expr.Types.Annotated
, module Data.Functor.Compose
, SourcePos(..)
, unPos
, mkPos
)
where
#ifdef MIN_VERSION_serialise
import Codec.Serialise
#endif
import Control.DeepSeq
import Data.Aeson ( ToJSON(..)
, FromJSON(..)
)
import Data.Aeson.TH
import Data.Binary ( Binary(..) )
import Data.Data
import Data.Eq.Deriving
import Data.Fix ( Fix(..), unfoldFix )
import Data.Function ( on )
import Data.Functor.Compose
import Data.Hashable
import Data.Hashable.Lifted
import Data.Ord.Deriving
import Data.Text ( Text
, pack
)
import GHC.Generics
import Nix.Atoms
import Nix.Expr.Types
import Text.Megaparsec ( unPos
, mkPos
)
import Text.Megaparsec.Pos ( SourcePos(..) )
import Text.Read.Deriving
import Text.Show.Deriving
data SrcSpan = SrcSpan
{ SrcSpan -> SourcePos
spanBegin :: SourcePos
, SrcSpan -> SourcePos
spanEnd :: SourcePos
}
deriving (Eq SrcSpan
Eq SrcSpan =>
(SrcSpan -> SrcSpan -> Ordering)
-> (SrcSpan -> SrcSpan -> Bool)
-> (SrcSpan -> SrcSpan -> Bool)
-> (SrcSpan -> SrcSpan -> Bool)
-> (SrcSpan -> SrcSpan -> Bool)
-> (SrcSpan -> SrcSpan -> SrcSpan)
-> (SrcSpan -> SrcSpan -> SrcSpan)
-> Ord SrcSpan
SrcSpan -> SrcSpan -> Bool
SrcSpan -> SrcSpan -> Ordering
SrcSpan -> SrcSpan -> SrcSpan
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: SrcSpan -> SrcSpan -> SrcSpan
$cmin :: SrcSpan -> SrcSpan -> SrcSpan
max :: SrcSpan -> SrcSpan -> SrcSpan
$cmax :: SrcSpan -> SrcSpan -> SrcSpan
>= :: SrcSpan -> SrcSpan -> Bool
$c>= :: SrcSpan -> SrcSpan -> Bool
> :: SrcSpan -> SrcSpan -> Bool
$c> :: SrcSpan -> SrcSpan -> Bool
<= :: SrcSpan -> SrcSpan -> Bool
$c<= :: SrcSpan -> SrcSpan -> Bool
< :: SrcSpan -> SrcSpan -> Bool
$c< :: SrcSpan -> SrcSpan -> Bool
compare :: SrcSpan -> SrcSpan -> Ordering
$ccompare :: SrcSpan -> SrcSpan -> Ordering
$cp1Ord :: Eq SrcSpan
Ord, SrcSpan -> SrcSpan -> Bool
(SrcSpan -> SrcSpan -> Bool)
-> (SrcSpan -> SrcSpan -> Bool) -> Eq SrcSpan
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SrcSpan -> SrcSpan -> Bool
$c/= :: SrcSpan -> SrcSpan -> Bool
== :: SrcSpan -> SrcSpan -> Bool
$c== :: SrcSpan -> SrcSpan -> Bool
Eq, (forall x. SrcSpan -> Rep SrcSpan x)
-> (forall x. Rep SrcSpan x -> SrcSpan) -> Generic SrcSpan
forall x. Rep SrcSpan x -> SrcSpan
forall x. SrcSpan -> Rep SrcSpan x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SrcSpan x -> SrcSpan
$cfrom :: forall x. SrcSpan -> Rep SrcSpan x
Generic, Typeable, Typeable SrcSpan
DataType
Constr
Typeable SrcSpan =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SrcSpan -> c SrcSpan)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SrcSpan)
-> (SrcSpan -> Constr)
-> (SrcSpan -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SrcSpan))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SrcSpan))
-> ((forall b. Data b => b -> b) -> SrcSpan -> SrcSpan)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SrcSpan -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SrcSpan -> r)
-> (forall u. (forall d. Data d => d -> u) -> SrcSpan -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> SrcSpan -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan)
-> Data SrcSpan
SrcSpan -> DataType
SrcSpan -> Constr
(forall b. Data b => b -> b) -> SrcSpan -> SrcSpan
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SrcSpan -> c SrcSpan
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SrcSpan
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> SrcSpan -> u
forall u. (forall d. Data d => d -> u) -> SrcSpan -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SrcSpan -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SrcSpan -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SrcSpan
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SrcSpan -> c SrcSpan
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SrcSpan)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SrcSpan)
$cSrcSpan :: Constr
$tSrcSpan :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan
gmapMp :: (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan
gmapM :: (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan
gmapQi :: Int -> (forall d. Data d => d -> u) -> SrcSpan -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> SrcSpan -> u
gmapQ :: (forall d. Data d => d -> u) -> SrcSpan -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> SrcSpan -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SrcSpan -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SrcSpan -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SrcSpan -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SrcSpan -> r
gmapT :: (forall b. Data b => b -> b) -> SrcSpan -> SrcSpan
$cgmapT :: (forall b. Data b => b -> b) -> SrcSpan -> SrcSpan
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SrcSpan)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SrcSpan)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c SrcSpan)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SrcSpan)
dataTypeOf :: SrcSpan -> DataType
$cdataTypeOf :: SrcSpan -> DataType
toConstr :: SrcSpan -> Constr
$ctoConstr :: SrcSpan -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SrcSpan
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SrcSpan
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SrcSpan -> c SrcSpan
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SrcSpan -> c SrcSpan
$cp1Data :: Typeable SrcSpan
Data, Int -> SrcSpan -> ShowS
[SrcSpan] -> ShowS
SrcSpan -> String
(Int -> SrcSpan -> ShowS)
-> (SrcSpan -> String) -> ([SrcSpan] -> ShowS) -> Show SrcSpan
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SrcSpan] -> ShowS
$cshowList :: [SrcSpan] -> ShowS
show :: SrcSpan -> String
$cshow :: SrcSpan -> String
showsPrec :: Int -> SrcSpan -> ShowS
$cshowsPrec :: Int -> SrcSpan -> ShowS
Show, SrcSpan -> ()
(SrcSpan -> ()) -> NFData SrcSpan
forall a. (a -> ()) -> NFData a
rnf :: SrcSpan -> ()
$crnf :: SrcSpan -> ()
NFData, Int -> SrcSpan -> Int
SrcSpan -> Int
(Int -> SrcSpan -> Int) -> (SrcSpan -> Int) -> Hashable SrcSpan
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: SrcSpan -> Int
$chash :: SrcSpan -> Int
hashWithSalt :: Int -> SrcSpan -> Int
$chashWithSalt :: Int -> SrcSpan -> Int
Hashable)
#ifdef MIN_VERSION_serialise
instance Serialise SrcSpan
#endif
data Ann ann a = Ann
{ Ann ann a -> ann
annotation :: ann
, Ann ann a -> a
annotated :: a
}
deriving (Eq (Ann ann a)
Eq (Ann ann a) =>
(Ann ann a -> Ann ann a -> Ordering)
-> (Ann ann a -> Ann ann a -> Bool)
-> (Ann ann a -> Ann ann a -> Bool)
-> (Ann ann a -> Ann ann a -> Bool)
-> (Ann ann a -> Ann ann a -> Bool)
-> (Ann ann a -> Ann ann a -> Ann ann a)
-> (Ann ann a -> Ann ann a -> Ann ann a)
-> Ord (Ann ann a)
Ann ann a -> Ann ann a -> Bool
Ann ann a -> Ann ann a -> Ordering
Ann ann a -> Ann ann a -> Ann ann a
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall ann a. (Ord ann, Ord a) => Eq (Ann ann a)
forall ann a. (Ord ann, Ord a) => Ann ann a -> Ann ann a -> Bool
forall ann a.
(Ord ann, Ord a) =>
Ann ann a -> Ann ann a -> Ordering
forall ann a.
(Ord ann, Ord a) =>
Ann ann a -> Ann ann a -> Ann ann a
min :: Ann ann a -> Ann ann a -> Ann ann a
$cmin :: forall ann a.
(Ord ann, Ord a) =>
Ann ann a -> Ann ann a -> Ann ann a
max :: Ann ann a -> Ann ann a -> Ann ann a
$cmax :: forall ann a.
(Ord ann, Ord a) =>
Ann ann a -> Ann ann a -> Ann ann a
>= :: Ann ann a -> Ann ann a -> Bool
$c>= :: forall ann a. (Ord ann, Ord a) => Ann ann a -> Ann ann a -> Bool
> :: Ann ann a -> Ann ann a -> Bool
$c> :: forall ann a. (Ord ann, Ord a) => Ann ann a -> Ann ann a -> Bool
<= :: Ann ann a -> Ann ann a -> Bool
$c<= :: forall ann a. (Ord ann, Ord a) => Ann ann a -> Ann ann a -> Bool
< :: Ann ann a -> Ann ann a -> Bool
$c< :: forall ann a. (Ord ann, Ord a) => Ann ann a -> Ann ann a -> Bool
compare :: Ann ann a -> Ann ann a -> Ordering
$ccompare :: forall ann a.
(Ord ann, Ord a) =>
Ann ann a -> Ann ann a -> Ordering
$cp1Ord :: forall ann a. (Ord ann, Ord a) => Eq (Ann ann a)
Ord, Ann ann a -> Ann ann a -> Bool
(Ann ann a -> Ann ann a -> Bool)
-> (Ann ann a -> Ann ann a -> Bool) -> Eq (Ann ann a)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall ann a. (Eq ann, Eq a) => Ann ann a -> Ann ann a -> Bool
/= :: Ann ann a -> Ann ann a -> Bool
$c/= :: forall ann a. (Eq ann, Eq a) => Ann ann a -> Ann ann a -> Bool
== :: Ann ann a -> Ann ann a -> Bool
$c== :: forall ann a. (Eq ann, Eq a) => Ann ann a -> Ann ann a -> Bool
Eq, Typeable (Ann ann a)
DataType
Constr
Typeable (Ann ann a) =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Ann ann a -> c (Ann ann a))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Ann ann a))
-> (Ann ann a -> Constr)
-> (Ann ann a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Ann ann a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Ann ann a)))
-> ((forall b. Data b => b -> b) -> Ann ann a -> Ann ann a)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Ann ann a -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Ann ann a -> r)
-> (forall u. (forall d. Data d => d -> u) -> Ann ann a -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> Ann ann a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Ann ann a -> m (Ann ann a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Ann ann a -> m (Ann ann a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Ann ann a -> m (Ann ann a))
-> Data (Ann ann a)
Ann ann a -> DataType
Ann ann a -> Constr
(forall b. Data b => b -> b) -> Ann ann a -> Ann ann a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Ann ann a -> c (Ann ann a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Ann ann a)
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Ann ann a))
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Ann ann a -> u
forall u. (forall d. Data d => d -> u) -> Ann ann a -> [u]
forall ann a. (Data ann, Data a) => Typeable (Ann ann a)
forall ann a. (Data ann, Data a) => Ann ann a -> DataType
forall ann a. (Data ann, Data a) => Ann ann a -> Constr
forall ann a.
(Data ann, Data a) =>
(forall b. Data b => b -> b) -> Ann ann a -> Ann ann a
forall ann a u.
(Data ann, Data a) =>
Int -> (forall d. Data d => d -> u) -> Ann ann a -> u
forall ann a u.
(Data ann, Data a) =>
(forall d. Data d => d -> u) -> Ann ann a -> [u]
forall ann a r r'.
(Data ann, Data a) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Ann ann a -> r
forall ann a r r'.
(Data ann, Data a) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Ann ann a -> r
forall ann a (m :: * -> *).
(Data ann, Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Ann ann a -> m (Ann ann a)
forall ann a (m :: * -> *).
(Data ann, Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Ann ann a -> m (Ann ann a)
forall ann a (c :: * -> *).
(Data ann, Data a) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Ann ann a)
forall ann a (c :: * -> *).
(Data ann, Data a) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Ann ann a -> c (Ann ann a)
forall ann a (t :: * -> *) (c :: * -> *).
(Data ann, Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Ann ann a))
forall ann a (t :: * -> * -> *) (c :: * -> *).
(Data ann, Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Ann ann a))
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Ann ann a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Ann ann a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Ann ann a -> m (Ann ann a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Ann ann a -> m (Ann ann a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Ann ann a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Ann ann a -> c (Ann ann a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Ann ann a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Ann ann a))
$cAnn :: Constr
$tAnn :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Ann ann a -> m (Ann ann a)
$cgmapMo :: forall ann a (m :: * -> *).
(Data ann, Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Ann ann a -> m (Ann ann a)
gmapMp :: (forall d. Data d => d -> m d) -> Ann ann a -> m (Ann ann a)
$cgmapMp :: forall ann a (m :: * -> *).
(Data ann, Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Ann ann a -> m (Ann ann a)
gmapM :: (forall d. Data d => d -> m d) -> Ann ann a -> m (Ann ann a)
$cgmapM :: forall ann a (m :: * -> *).
(Data ann, Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Ann ann a -> m (Ann ann a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> Ann ann a -> u
$cgmapQi :: forall ann a u.
(Data ann, Data a) =>
Int -> (forall d. Data d => d -> u) -> Ann ann a -> u
gmapQ :: (forall d. Data d => d -> u) -> Ann ann a -> [u]
$cgmapQ :: forall ann a u.
(Data ann, Data a) =>
(forall d. Data d => d -> u) -> Ann ann a -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Ann ann a -> r
$cgmapQr :: forall ann a r r'.
(Data ann, Data a) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Ann ann a -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Ann ann a -> r
$cgmapQl :: forall ann a r r'.
(Data ann, Data a) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Ann ann a -> r
gmapT :: (forall b. Data b => b -> b) -> Ann ann a -> Ann ann a
$cgmapT :: forall ann a.
(Data ann, Data a) =>
(forall b. Data b => b -> b) -> Ann ann a -> Ann ann a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Ann ann a))
$cdataCast2 :: forall ann a (t :: * -> * -> *) (c :: * -> *).
(Data ann, Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Ann ann a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Ann ann a))
$cdataCast1 :: forall ann a (t :: * -> *) (c :: * -> *).
(Data ann, Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Ann ann a))
dataTypeOf :: Ann ann a -> DataType
$cdataTypeOf :: forall ann a. (Data ann, Data a) => Ann ann a -> DataType
toConstr :: Ann ann a -> Constr
$ctoConstr :: forall ann a. (Data ann, Data a) => Ann ann a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Ann ann a)
$cgunfold :: forall ann a (c :: * -> *).
(Data ann, Data a) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Ann ann a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Ann ann a -> c (Ann ann a)
$cgfoldl :: forall ann a (c :: * -> *).
(Data ann, Data a) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Ann ann a -> c (Ann ann a)
$cp1Data :: forall ann a. (Data ann, Data a) => Typeable (Ann ann a)
Data, (forall x. Ann ann a -> Rep (Ann ann a) x)
-> (forall x. Rep (Ann ann a) x -> Ann ann a)
-> Generic (Ann ann a)
forall x. Rep (Ann ann a) x -> Ann ann a
forall x. Ann ann a -> Rep (Ann ann a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall ann a x. Rep (Ann ann a) x -> Ann ann a
forall ann a x. Ann ann a -> Rep (Ann ann a) x
$cto :: forall ann a x. Rep (Ann ann a) x -> Ann ann a
$cfrom :: forall ann a x. Ann ann a -> Rep (Ann ann a) x
Generic, (forall a. Ann ann a -> Rep1 (Ann ann) a)
-> (forall a. Rep1 (Ann ann) a -> Ann ann a) -> Generic1 (Ann ann)
forall a. Rep1 (Ann ann) a -> Ann ann a
forall a. Ann ann a -> Rep1 (Ann ann) a
forall ann a. Rep1 (Ann ann) a -> Ann ann a
forall ann a. Ann ann a -> Rep1 (Ann ann) a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall ann a. Rep1 (Ann ann) a -> Ann ann a
$cfrom1 :: forall ann a. Ann ann a -> Rep1 (Ann ann) a
Generic1, Typeable, a -> Ann ann b -> Ann ann a
(a -> b) -> Ann ann a -> Ann ann b
(forall a b. (a -> b) -> Ann ann a -> Ann ann b)
-> (forall a b. a -> Ann ann b -> Ann ann a) -> Functor (Ann ann)
forall a b. a -> Ann ann b -> Ann ann a
forall a b. (a -> b) -> Ann ann a -> Ann ann b
forall ann a b. a -> Ann ann b -> Ann ann a
forall ann a b. (a -> b) -> Ann ann a -> Ann ann b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> Ann ann b -> Ann ann a
$c<$ :: forall ann a b. a -> Ann ann b -> Ann ann a
fmap :: (a -> b) -> Ann ann a -> Ann ann b
$cfmap :: forall ann a b. (a -> b) -> Ann ann a -> Ann ann b
Functor, Ann ann a -> Bool
(a -> m) -> Ann ann a -> m
(a -> b -> b) -> b -> Ann ann a -> b
(forall m. Monoid m => Ann ann m -> m)
-> (forall m a. Monoid m => (a -> m) -> Ann ann a -> m)
-> (forall m a. Monoid m => (a -> m) -> Ann ann a -> m)
-> (forall a b. (a -> b -> b) -> b -> Ann ann a -> b)
-> (forall a b. (a -> b -> b) -> b -> Ann ann a -> b)
-> (forall b a. (b -> a -> b) -> b -> Ann ann a -> b)
-> (forall b a. (b -> a -> b) -> b -> Ann ann a -> b)
-> (forall a. (a -> a -> a) -> Ann ann a -> a)
-> (forall a. (a -> a -> a) -> Ann ann a -> a)
-> (forall a. Ann ann a -> [a])
-> (forall a. Ann ann a -> Bool)
-> (forall a. Ann ann a -> Int)
-> (forall a. Eq a => a -> Ann ann a -> Bool)
-> (forall a. Ord a => Ann ann a -> a)
-> (forall a. Ord a => Ann ann a -> a)
-> (forall a. Num a => Ann ann a -> a)
-> (forall a. Num a => Ann ann a -> a)
-> Foldable (Ann ann)
forall a. Eq a => a -> Ann ann a -> Bool
forall a. Num a => Ann ann a -> a
forall a. Ord a => Ann ann a -> a
forall m. Monoid m => Ann ann m -> m
forall a. Ann ann a -> Bool
forall a. Ann ann a -> Int
forall a. Ann ann a -> [a]
forall a. (a -> a -> a) -> Ann ann a -> a
forall ann a. Eq a => a -> Ann ann a -> Bool
forall ann a. Num a => Ann ann a -> a
forall ann a. Ord a => Ann ann a -> a
forall m a. Monoid m => (a -> m) -> Ann ann a -> m
forall ann m. Monoid m => Ann ann m -> m
forall ann a. Ann ann a -> Bool
forall ann a. Ann ann a -> Int
forall ann a. Ann ann a -> [a]
forall b a. (b -> a -> b) -> b -> Ann ann a -> b
forall a b. (a -> b -> b) -> b -> Ann ann a -> b
forall ann a. (a -> a -> a) -> Ann ann a -> a
forall ann m a. Monoid m => (a -> m) -> Ann ann a -> m
forall ann b a. (b -> a -> b) -> b -> Ann ann a -> b
forall ann a b. (a -> b -> b) -> b -> Ann ann a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: Ann ann a -> a
$cproduct :: forall ann a. Num a => Ann ann a -> a
sum :: Ann ann a -> a
$csum :: forall ann a. Num a => Ann ann a -> a
minimum :: Ann ann a -> a
$cminimum :: forall ann a. Ord a => Ann ann a -> a
maximum :: Ann ann a -> a
$cmaximum :: forall ann a. Ord a => Ann ann a -> a
elem :: a -> Ann ann a -> Bool
$celem :: forall ann a. Eq a => a -> Ann ann a -> Bool
length :: Ann ann a -> Int
$clength :: forall ann a. Ann ann a -> Int
null :: Ann ann a -> Bool
$cnull :: forall ann a. Ann ann a -> Bool
toList :: Ann ann a -> [a]
$ctoList :: forall ann a. Ann ann a -> [a]
foldl1 :: (a -> a -> a) -> Ann ann a -> a
$cfoldl1 :: forall ann a. (a -> a -> a) -> Ann ann a -> a
foldr1 :: (a -> a -> a) -> Ann ann a -> a
$cfoldr1 :: forall ann a. (a -> a -> a) -> Ann ann a -> a
foldl' :: (b -> a -> b) -> b -> Ann ann a -> b
$cfoldl' :: forall ann b a. (b -> a -> b) -> b -> Ann ann a -> b
foldl :: (b -> a -> b) -> b -> Ann ann a -> b
$cfoldl :: forall ann b a. (b -> a -> b) -> b -> Ann ann a -> b
foldr' :: (a -> b -> b) -> b -> Ann ann a -> b
$cfoldr' :: forall ann a b. (a -> b -> b) -> b -> Ann ann a -> b
foldr :: (a -> b -> b) -> b -> Ann ann a -> b
$cfoldr :: forall ann a b. (a -> b -> b) -> b -> Ann ann a -> b
foldMap' :: (a -> m) -> Ann ann a -> m
$cfoldMap' :: forall ann m a. Monoid m => (a -> m) -> Ann ann a -> m
foldMap :: (a -> m) -> Ann ann a -> m
$cfoldMap :: forall ann m a. Monoid m => (a -> m) -> Ann ann a -> m
fold :: Ann ann m -> m
$cfold :: forall ann m. Monoid m => Ann ann m -> m
Foldable,
Functor (Ann ann)
Foldable (Ann ann)
(Functor (Ann ann), Foldable (Ann ann)) =>
(forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Ann ann a -> f (Ann ann b))
-> (forall (f :: * -> *) a.
Applicative f =>
Ann ann (f a) -> f (Ann ann a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Ann ann a -> m (Ann ann b))
-> (forall (m :: * -> *) a.
Monad m =>
Ann ann (m a) -> m (Ann ann a))
-> Traversable (Ann ann)
(a -> f b) -> Ann ann a -> f (Ann ann b)
forall ann. Functor (Ann ann)
forall ann. Foldable (Ann ann)
forall ann (m :: * -> *) a.
Monad m =>
Ann ann (m a) -> m (Ann ann a)
forall ann (f :: * -> *) a.
Applicative f =>
Ann ann (f a) -> f (Ann ann a)
forall ann (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Ann ann a -> m (Ann ann b)
forall ann (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Ann ann a -> f (Ann ann b)
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => Ann ann (m a) -> m (Ann ann a)
forall (f :: * -> *) a.
Applicative f =>
Ann ann (f a) -> f (Ann ann a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Ann ann a -> m (Ann ann b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Ann ann a -> f (Ann ann b)
sequence :: Ann ann (m a) -> m (Ann ann a)
$csequence :: forall ann (m :: * -> *) a.
Monad m =>
Ann ann (m a) -> m (Ann ann a)
mapM :: (a -> m b) -> Ann ann a -> m (Ann ann b)
$cmapM :: forall ann (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Ann ann a -> m (Ann ann b)
sequenceA :: Ann ann (f a) -> f (Ann ann a)
$csequenceA :: forall ann (f :: * -> *) a.
Applicative f =>
Ann ann (f a) -> f (Ann ann a)
traverse :: (a -> f b) -> Ann ann a -> f (Ann ann b)
$ctraverse :: forall ann (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Ann ann a -> f (Ann ann b)
$cp2Traversable :: forall ann. Foldable (Ann ann)
$cp1Traversable :: forall ann. Functor (Ann ann)
Traversable, ReadPrec [Ann ann a]
ReadPrec (Ann ann a)
Int -> ReadS (Ann ann a)
ReadS [Ann ann a]
(Int -> ReadS (Ann ann a))
-> ReadS [Ann ann a]
-> ReadPrec (Ann ann a)
-> ReadPrec [Ann ann a]
-> Read (Ann ann a)
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall ann a. (Read ann, Read a) => ReadPrec [Ann ann a]
forall ann a. (Read ann, Read a) => ReadPrec (Ann ann a)
forall ann a. (Read ann, Read a) => Int -> ReadS (Ann ann a)
forall ann a. (Read ann, Read a) => ReadS [Ann ann a]
readListPrec :: ReadPrec [Ann ann a]
$creadListPrec :: forall ann a. (Read ann, Read a) => ReadPrec [Ann ann a]
readPrec :: ReadPrec (Ann ann a)
$creadPrec :: forall ann a. (Read ann, Read a) => ReadPrec (Ann ann a)
readList :: ReadS [Ann ann a]
$creadList :: forall ann a. (Read ann, Read a) => ReadS [Ann ann a]
readsPrec :: Int -> ReadS (Ann ann a)
$creadsPrec :: forall ann a. (Read ann, Read a) => Int -> ReadS (Ann ann a)
Read, Int -> Ann ann a -> ShowS
[Ann ann a] -> ShowS
Ann ann a -> String
(Int -> Ann ann a -> ShowS)
-> (Ann ann a -> String)
-> ([Ann ann a] -> ShowS)
-> Show (Ann ann a)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall ann a. (Show ann, Show a) => Int -> Ann ann a -> ShowS
forall ann a. (Show ann, Show a) => [Ann ann a] -> ShowS
forall ann a. (Show ann, Show a) => Ann ann a -> String
showList :: [Ann ann a] -> ShowS
$cshowList :: forall ann a. (Show ann, Show a) => [Ann ann a] -> ShowS
show :: Ann ann a -> String
$cshow :: forall ann a. (Show ann, Show a) => Ann ann a -> String
showsPrec :: Int -> Ann ann a -> ShowS
$cshowsPrec :: forall ann a. (Show ann, Show a) => Int -> Ann ann a -> ShowS
Show, Ann ann a -> ()
(Ann ann a -> ()) -> NFData (Ann ann a)
forall a. (a -> ()) -> NFData a
forall ann a. (NFData ann, NFData a) => Ann ann a -> ()
rnf :: Ann ann a -> ()
$crnf :: forall ann a. (NFData ann, NFData a) => Ann ann a -> ()
NFData, Int -> Ann ann a -> Int
Ann ann a -> Int
(Int -> Ann ann a -> Int)
-> (Ann ann a -> Int) -> Hashable (Ann ann a)
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
forall ann a. (Hashable ann, Hashable a) => Int -> Ann ann a -> Int
forall ann a. (Hashable ann, Hashable a) => Ann ann a -> Int
hash :: Ann ann a -> Int
$chash :: forall ann a. (Hashable ann, Hashable a) => Ann ann a -> Int
hashWithSalt :: Int -> Ann ann a -> Int
$chashWithSalt :: forall ann a. (Hashable ann, Hashable a) => Int -> Ann ann a -> Int
Hashable)
instance Hashable ann => Hashable1 (Ann ann)
#ifdef MIN_VERSION_serialise
instance (Serialise ann, Serialise a) => Serialise (Ann ann a)
#endif
instance NFData ann => NFData1 (Ann ann)
$(deriveEq1 ''Ann)
$(deriveEq2 ''Ann)
$(deriveOrd1 ''Ann)
$(deriveOrd2 ''Ann)
$(deriveRead1 ''Ann)
$(deriveRead2 ''Ann)
$(deriveShow1 ''Ann)
$(deriveShow2 ''Ann)
$(deriveJSON1 defaultOptions ''Ann)
$(deriveJSON2 defaultOptions ''Ann)
instance Semigroup SrcSpan where
s1 :: SrcSpan
s1 <> :: SrcSpan -> SrcSpan -> SrcSpan
<> s2 :: SrcSpan
s2 = SourcePos -> SourcePos -> SrcSpan
SrcSpan ((SourcePos -> SourcePos -> SourcePos
forall a. Ord a => a -> a -> a
min (SourcePos -> SourcePos -> SourcePos)
-> (SrcSpan -> SourcePos) -> SrcSpan -> SrcSpan -> SourcePos
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` SrcSpan -> SourcePos
spanBegin) SrcSpan
s1 SrcSpan
s2) ((SourcePos -> SourcePos -> SourcePos
forall a. Ord a => a -> a -> a
max (SourcePos -> SourcePos -> SourcePos)
-> (SrcSpan -> SourcePos) -> SrcSpan -> SrcSpan -> SourcePos
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` SrcSpan -> SourcePos
spanEnd) SrcSpan
s1 SrcSpan
s2)
type AnnF ann f = Compose (Ann ann) f
annToAnnF :: Ann ann (f (Fix (AnnF ann f))) -> Fix (AnnF ann f)
annToAnnF :: Ann ann (f (Fix (AnnF ann f))) -> Fix (AnnF ann f)
annToAnnF (Ann ann :: ann
ann a :: f (Fix (AnnF ann f))
a) = ann -> f (Fix (AnnF ann f)) -> Fix (AnnF ann f)
forall ann (g :: * -> *).
ann -> g (Fix (Compose (Ann ann) g)) -> Fix (Compose (Ann ann) g)
AnnE ann
ann f (Fix (AnnF ann f))
a
type NExprLocF = AnnF SrcSpan NExprF
type NExprLoc = Fix NExprLocF
#ifdef MIN_VERSION_serialise
instance Serialise NExprLoc
#endif
instance Binary SrcSpan
instance (Binary ann, Binary a) => Binary (Ann ann a)
instance Binary r => Binary (NExprLocF r)
instance Binary NExprLoc
instance ToJSON SrcSpan
instance FromJSON SrcSpan
#ifdef MIN_VERSION_serialise
instance Serialise r => Serialise (Compose (Ann SrcSpan) NExprF r) where
encode :: Compose (Ann SrcSpan) NExprF r -> Encoding
encode (Compose (Ann ann :: SrcSpan
ann a :: NExprF r
a)) = SrcSpan -> Encoding
forall a. Serialise a => a -> Encoding
encode SrcSpan
ann Encoding -> Encoding -> Encoding
forall a. Semigroup a => a -> a -> a
<> NExprF r -> Encoding
forall a. Serialise a => a -> Encoding
encode NExprF r
a
decode :: Decoder s (Compose (Ann SrcSpan) NExprF r)
decode = (Ann SrcSpan (NExprF r) -> Compose (Ann SrcSpan) NExprF r
forall k k1 (f :: k -> *) (g :: k1 -> k) (a :: k1).
f (g a) -> Compose f g a
Compose (Ann SrcSpan (NExprF r) -> Compose (Ann SrcSpan) NExprF r)
-> (NExprF r -> Ann SrcSpan (NExprF r))
-> NExprF r
-> Compose (Ann SrcSpan) NExprF r
forall b c a. (b -> c) -> (a -> b) -> a -> c
.) ((NExprF r -> Ann SrcSpan (NExprF r))
-> NExprF r -> Compose (Ann SrcSpan) NExprF r)
-> (SrcSpan -> NExprF r -> Ann SrcSpan (NExprF r))
-> SrcSpan
-> NExprF r
-> Compose (Ann SrcSpan) NExprF r
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SrcSpan -> NExprF r -> Ann SrcSpan (NExprF r)
forall ann a. ann -> a -> Ann ann a
Ann (SrcSpan -> NExprF r -> Compose (Ann SrcSpan) NExprF r)
-> Decoder s SrcSpan
-> Decoder s (NExprF r -> Compose (Ann SrcSpan) NExprF r)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Decoder s SrcSpan
forall a s. Serialise a => Decoder s a
decode Decoder s (NExprF r -> Compose (Ann SrcSpan) NExprF r)
-> Decoder s (NExprF r)
-> Decoder s (Compose (Ann SrcSpan) NExprF r)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Decoder s (NExprF r)
forall a s. Serialise a => Decoder s a
decode
#endif
pattern AnnE :: forall ann (g :: * -> *). ann
-> g (Fix (Compose (Ann ann) g)) -> Fix (Compose (Ann ann) g)
pattern $bAnnE :: ann -> g (Fix (Compose (Ann ann) g)) -> Fix (Compose (Ann ann) g)
$mAnnE :: forall r ann (g :: * -> *).
Fix (Compose (Ann ann) g)
-> (ann -> g (Fix (Compose (Ann ann) g)) -> r) -> (Void# -> r) -> r
AnnE ann a = Fix (Compose (Ann ann a))
stripAnnotation :: Functor f => Fix (AnnF ann f) -> Fix f
stripAnnotation :: Fix (AnnF ann f) -> Fix f
stripAnnotation = (Fix (AnnF ann f) -> f (Fix (AnnF ann f)))
-> Fix (AnnF ann f) -> Fix f
forall (f :: * -> *) a. Functor f => (a -> f a) -> a -> Fix f
unfoldFix (Ann ann (f (Fix (AnnF ann f))) -> f (Fix (AnnF ann f))
forall ann a. Ann ann a -> a
annotated (Ann ann (f (Fix (AnnF ann f))) -> f (Fix (AnnF ann f)))
-> (Fix (AnnF ann f) -> Ann ann (f (Fix (AnnF ann f))))
-> Fix (AnnF ann f)
-> f (Fix (AnnF ann f))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Compose (Ann ann) f (Fix (AnnF ann f))
-> Ann ann (f (Fix (AnnF ann f)))
forall k1 (f :: k1 -> *) k2 (g :: k2 -> k1) (a :: k2).
Compose f g a -> f (g a)
getCompose (Compose (Ann ann) f (Fix (AnnF ann f))
-> Ann ann (f (Fix (AnnF ann f))))
-> (Fix (AnnF ann f) -> Compose (Ann ann) f (Fix (AnnF ann f)))
-> Fix (AnnF ann f)
-> Ann ann (f (Fix (AnnF ann f)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Fix (AnnF ann f) -> Compose (Ann ann) f (Fix (AnnF ann f))
forall (f :: * -> *). Fix f -> f (Fix f)
unFix)
stripAnn :: AnnF ann f r -> f r
stripAnn :: AnnF ann f r -> f r
stripAnn = Ann ann (f r) -> f r
forall ann a. Ann ann a -> a
annotated (Ann ann (f r) -> f r)
-> (AnnF ann f r -> Ann ann (f r)) -> AnnF ann f r -> f r
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AnnF ann f r -> Ann ann (f r)
forall k1 (f :: k1 -> *) k2 (g :: k2 -> k1) (a :: k2).
Compose f g a -> f (g a)
getCompose
nUnary :: Ann SrcSpan NUnaryOp -> NExprLoc -> NExprLoc
nUnary :: Ann SrcSpan NUnaryOp -> NExprLoc -> NExprLoc
nUnary (Ann s1 :: SrcSpan
s1 u :: NUnaryOp
u) e1 :: NExprLoc
e1@(AnnE s2 :: SrcSpan
s2 _) = SrcSpan -> NExprF NExprLoc -> NExprLoc
forall ann (g :: * -> *).
ann -> g (Fix (Compose (Ann ann) g)) -> Fix (Compose (Ann ann) g)
AnnE (SrcSpan
s1 SrcSpan -> SrcSpan -> SrcSpan
forall a. Semigroup a => a -> a -> a
<> SrcSpan
s2) (NUnaryOp -> NExprLoc -> NExprF NExprLoc
forall r. NUnaryOp -> r -> NExprF r
NUnary NUnaryOp
u NExprLoc
e1)
nUnary _ _ = String -> NExprLoc
forall a. HasCallStack => String -> a
error "nUnary: unexpected"
nBinary :: Ann SrcSpan NBinaryOp -> NExprLoc -> NExprLoc -> NExprLoc
nBinary :: Ann SrcSpan NBinaryOp -> NExprLoc -> NExprLoc -> NExprLoc
nBinary (Ann s1 :: SrcSpan
s1 b :: NBinaryOp
b) e1 :: NExprLoc
e1@(AnnE s2 :: SrcSpan
s2 _) e2 :: NExprLoc
e2@(AnnE s3 :: SrcSpan
s3 _) =
SrcSpan -> NExprF NExprLoc -> NExprLoc
forall ann (g :: * -> *).
ann -> g (Fix (Compose (Ann ann) g)) -> Fix (Compose (Ann ann) g)
AnnE (SrcSpan
s1 SrcSpan -> SrcSpan -> SrcSpan
forall a. Semigroup a => a -> a -> a
<> SrcSpan
s2 SrcSpan -> SrcSpan -> SrcSpan
forall a. Semigroup a => a -> a -> a
<> SrcSpan
s3) (NBinaryOp -> NExprLoc -> NExprLoc -> NExprF NExprLoc
forall r. NBinaryOp -> r -> r -> NExprF r
NBinary NBinaryOp
b NExprLoc
e1 NExprLoc
e2)
nBinary _ _ _ = String -> NExprLoc
forall a. HasCallStack => String -> a
error "nBinary: unexpected"
nSelectLoc
:: NExprLoc -> Ann SrcSpan (NAttrPath NExprLoc) -> Maybe NExprLoc -> NExprLoc
nSelectLoc :: NExprLoc
-> Ann SrcSpan (NAttrPath NExprLoc) -> Maybe NExprLoc -> NExprLoc
nSelectLoc e1 :: NExprLoc
e1@(AnnE s1 :: SrcSpan
s1 _) (Ann s2 :: SrcSpan
s2 ats :: NAttrPath NExprLoc
ats) d :: Maybe NExprLoc
d = case Maybe NExprLoc
d of
Nothing -> SrcSpan -> NExprF NExprLoc -> NExprLoc
forall ann (g :: * -> *).
ann -> g (Fix (Compose (Ann ann) g)) -> Fix (Compose (Ann ann) g)
AnnE (SrcSpan
s1 SrcSpan -> SrcSpan -> SrcSpan
forall a. Semigroup a => a -> a -> a
<> SrcSpan
s2) (NExprLoc -> NAttrPath NExprLoc -> Maybe NExprLoc -> NExprF NExprLoc
forall r. r -> NAttrPath r -> Maybe r -> NExprF r
NSelect NExprLoc
e1 NAttrPath NExprLoc
ats Maybe NExprLoc
forall a. Maybe a
Nothing)
Just (e2 :: NExprLoc
e2@(AnnE s3 :: SrcSpan
s3 _)) -> SrcSpan -> NExprF NExprLoc -> NExprLoc
forall ann (g :: * -> *).
ann -> g (Fix (Compose (Ann ann) g)) -> Fix (Compose (Ann ann) g)
AnnE (SrcSpan
s1 SrcSpan -> SrcSpan -> SrcSpan
forall a. Semigroup a => a -> a -> a
<> SrcSpan
s2 SrcSpan -> SrcSpan -> SrcSpan
forall a. Semigroup a => a -> a -> a
<> SrcSpan
s3) (NExprLoc -> NAttrPath NExprLoc -> Maybe NExprLoc -> NExprF NExprLoc
forall r. r -> NAttrPath r -> Maybe r -> NExprF r
NSelect NExprLoc
e1 NAttrPath NExprLoc
ats (NExprLoc -> Maybe NExprLoc
forall a. a -> Maybe a
Just NExprLoc
e2))
_ -> String -> NExprLoc
forall a. HasCallStack => String -> a
error "nSelectLoc: unexpected"
nSelectLoc _ _ _ = String -> NExprLoc
forall a. HasCallStack => String -> a
error "nSelectLoc: unexpected"
nHasAttr :: NExprLoc -> Ann SrcSpan (NAttrPath NExprLoc) -> NExprLoc
nHasAttr :: NExprLoc -> Ann SrcSpan (NAttrPath NExprLoc) -> NExprLoc
nHasAttr e1 :: NExprLoc
e1@(AnnE s1 :: SrcSpan
s1 _) (Ann s2 :: SrcSpan
s2 ats :: NAttrPath NExprLoc
ats) = SrcSpan -> NExprF NExprLoc -> NExprLoc
forall ann (g :: * -> *).
ann -> g (Fix (Compose (Ann ann) g)) -> Fix (Compose (Ann ann) g)
AnnE (SrcSpan
s1 SrcSpan -> SrcSpan -> SrcSpan
forall a. Semigroup a => a -> a -> a
<> SrcSpan
s2) (NExprLoc -> NAttrPath NExprLoc -> NExprF NExprLoc
forall r. r -> NAttrPath r -> NExprF r
NHasAttr NExprLoc
e1 NAttrPath NExprLoc
ats)
nHasAttr _ _ = String -> NExprLoc
forall a. HasCallStack => String -> a
error "nHasAttr: unexpected"
nApp :: NExprLoc -> NExprLoc -> NExprLoc
nApp :: NExprLoc -> NExprLoc -> NExprLoc
nApp e1 :: NExprLoc
e1@(AnnE s1 :: SrcSpan
s1 _) e2 :: NExprLoc
e2@(AnnE s2 :: SrcSpan
s2 _) = SrcSpan -> NExprF NExprLoc -> NExprLoc
forall ann (g :: * -> *).
ann -> g (Fix (Compose (Ann ann) g)) -> Fix (Compose (Ann ann) g)
AnnE (SrcSpan
s1 SrcSpan -> SrcSpan -> SrcSpan
forall a. Semigroup a => a -> a -> a
<> SrcSpan
s2) (NBinaryOp -> NExprLoc -> NExprLoc -> NExprF NExprLoc
forall r. NBinaryOp -> r -> r -> NExprF r
NBinary NBinaryOp
NApp NExprLoc
e1 NExprLoc
e2)
nApp _ _ = String -> NExprLoc
forall a. HasCallStack => String -> a
error "nApp: unexpected"
nAbs :: Ann SrcSpan (Params NExprLoc) -> NExprLoc -> NExprLoc
nAbs :: Ann SrcSpan (Params NExprLoc) -> NExprLoc -> NExprLoc
nAbs (Ann s1 :: SrcSpan
s1 ps :: Params NExprLoc
ps) e1 :: NExprLoc
e1@(AnnE s2 :: SrcSpan
s2 _) = SrcSpan -> NExprF NExprLoc -> NExprLoc
forall ann (g :: * -> *).
ann -> g (Fix (Compose (Ann ann) g)) -> Fix (Compose (Ann ann) g)
AnnE (SrcSpan
s1 SrcSpan -> SrcSpan -> SrcSpan
forall a. Semigroup a => a -> a -> a
<> SrcSpan
s2) (Params NExprLoc -> NExprLoc -> NExprF NExprLoc
forall r. Params r -> r -> NExprF r
NAbs Params NExprLoc
ps NExprLoc
e1)
nAbs _ _ = String -> NExprLoc
forall a. HasCallStack => String -> a
error "nAbs: unexpected"
nStr :: Ann SrcSpan (NString NExprLoc) -> NExprLoc
nStr :: Ann SrcSpan (NString NExprLoc) -> NExprLoc
nStr (Ann s1 :: SrcSpan
s1 s :: NString NExprLoc
s) = SrcSpan -> NExprF NExprLoc -> NExprLoc
forall ann (g :: * -> *).
ann -> g (Fix (Compose (Ann ann) g)) -> Fix (Compose (Ann ann) g)
AnnE SrcSpan
s1 (NString NExprLoc -> NExprF NExprLoc
forall r. NString r -> NExprF r
NStr NString NExprLoc
s)
deltaInfo :: SourcePos -> (Text, Int, Int)
deltaInfo :: SourcePos -> (Text, Int, Int)
deltaInfo (SourcePos fp :: String
fp l :: Pos
l c :: Pos
c) = (String -> Text
pack String
fp, Pos -> Int
unPos Pos
l, Pos -> Int
unPos Pos
c)
nNull :: NExprLoc
nNull :: NExprLoc
nNull = Compose (Ann SrcSpan) NExprF NExprLoc -> NExprLoc
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (Ann SrcSpan (NExprF NExprLoc)
-> Compose (Ann SrcSpan) NExprF NExprLoc
forall k k1 (f :: k -> *) (g :: k1 -> k) (a :: k1).
f (g a) -> Compose f g a
Compose (SrcSpan -> NExprF NExprLoc -> Ann SrcSpan (NExprF NExprLoc)
forall ann a. ann -> a -> Ann ann a
Ann SrcSpan
nullSpan (NAtom -> NExprF NExprLoc
forall r. NAtom -> NExprF r
NConstant NAtom
NNull)))
nullSpan :: SrcSpan
nullSpan :: SrcSpan
nullSpan = SourcePos -> SourcePos -> SrcSpan
SrcSpan SourcePos
nullPos SourcePos
nullPos
pattern NSym_ :: SrcSpan -> VarName -> NExprLocF r
pattern $bNSym_ :: SrcSpan -> Text -> NExprLocF r
$mNSym_ :: forall r r.
NExprLocF r -> (SrcSpan -> Text -> r) -> (Void# -> r) -> r
NSym_ ann x = Compose (Ann ann (NSym x))
pattern NSynHole_ :: SrcSpan -> Text -> NExprLocF r
pattern $bNSynHole_ :: SrcSpan -> Text -> NExprLocF r
$mNSynHole_ :: forall r r.
NExprLocF r -> (SrcSpan -> Text -> r) -> (Void# -> r) -> r
NSynHole_ ann x = Compose (Ann ann (NSynHole x))
pattern NConstant_ :: SrcSpan -> NAtom -> NExprLocF r
pattern $bNConstant_ :: SrcSpan -> NAtom -> NExprLocF r
$mNConstant_ :: forall r r.
NExprLocF r -> (SrcSpan -> NAtom -> r) -> (Void# -> r) -> r
NConstant_ ann x = Compose (Ann ann (NConstant x))
pattern NStr_ :: SrcSpan -> NString r -> NExprLocF r
pattern $bNStr_ :: SrcSpan -> NString r -> NExprLocF r
$mNStr_ :: forall r r.
NExprLocF r -> (SrcSpan -> NString r -> r) -> (Void# -> r) -> r
NStr_ ann x = Compose (Ann ann (NStr x))
pattern NList_ :: SrcSpan -> [r] -> NExprLocF r
pattern $bNList_ :: SrcSpan -> [r] -> NExprLocF r
$mNList_ :: forall r r.
NExprLocF r -> (SrcSpan -> [r] -> r) -> (Void# -> r) -> r
NList_ ann x = Compose (Ann ann (NList x))
pattern NSet_ :: SrcSpan -> NRecordType -> [Binding r] -> NExprLocF r
pattern $bNSet_ :: SrcSpan -> NRecordType -> [Binding r] -> NExprLocF r
$mNSet_ :: forall r r.
NExprLocF r
-> (SrcSpan -> NRecordType -> [Binding r] -> r)
-> (Void# -> r)
-> r
NSet_ ann recur x = Compose (Ann ann (NSet recur x))
pattern NLiteralPath_ :: SrcSpan -> FilePath -> NExprLocF r
pattern $bNLiteralPath_ :: SrcSpan -> String -> NExprLocF r
$mNLiteralPath_ :: forall r r.
NExprLocF r -> (SrcSpan -> String -> r) -> (Void# -> r) -> r
NLiteralPath_ ann x = Compose (Ann ann (NLiteralPath x))
pattern NEnvPath_ :: SrcSpan -> FilePath -> NExprLocF r
pattern $bNEnvPath_ :: SrcSpan -> String -> NExprLocF r
$mNEnvPath_ :: forall r r.
NExprLocF r -> (SrcSpan -> String -> r) -> (Void# -> r) -> r
NEnvPath_ ann x = Compose (Ann ann (NEnvPath x))
pattern NSelect_ :: SrcSpan -> r -> NAttrPath r -> Maybe r -> NExprLocF r
pattern $bNSelect_ :: SrcSpan -> r -> NAttrPath r -> Maybe r -> NExprLocF r
$mNSelect_ :: forall r r.
NExprLocF r
-> (SrcSpan -> r -> NAttrPath r -> Maybe r -> r)
-> (Void# -> r)
-> r
NSelect_ ann x p v = Compose (Ann ann (NSelect x p v))
pattern NHasAttr_ :: SrcSpan -> r -> NAttrPath r -> NExprLocF r
pattern $bNHasAttr_ :: SrcSpan -> r -> NAttrPath r -> NExprLocF r
$mNHasAttr_ :: forall r r.
NExprLocF r
-> (SrcSpan -> r -> NAttrPath r -> r) -> (Void# -> r) -> r
NHasAttr_ ann x p = Compose (Ann ann (NHasAttr x p))
pattern NAbs_ :: SrcSpan -> Params r-> r -> NExprLocF r
pattern $bNAbs_ :: SrcSpan -> Params r -> r -> NExprLocF r
$mNAbs_ :: forall r r.
NExprLocF r -> (SrcSpan -> Params r -> r -> r) -> (Void# -> r) -> r
NAbs_ ann x b = Compose (Ann ann (NAbs x b))
pattern NLet_ :: SrcSpan -> [Binding r] -> r -> NExprLocF r
pattern $bNLet_ :: SrcSpan -> [Binding r] -> r -> NExprLocF r
$mNLet_ :: forall r r.
NExprLocF r
-> (SrcSpan -> [Binding r] -> r -> r) -> (Void# -> r) -> r
NLet_ ann x b = Compose (Ann ann (NLet x b))
pattern NIf_ :: SrcSpan -> r -> r -> r -> NExprLocF r
pattern $bNIf_ :: SrcSpan -> r -> r -> r -> NExprLocF r
$mNIf_ :: forall r r.
NExprLocF r -> (SrcSpan -> r -> r -> r -> r) -> (Void# -> r) -> r
NIf_ ann c t e = Compose (Ann ann (NIf c t e))
pattern NWith_ :: SrcSpan -> r -> r -> NExprLocF r
pattern $bNWith_ :: SrcSpan -> r -> r -> NExprLocF r
$mNWith_ :: forall r r.
NExprLocF r -> (SrcSpan -> r -> r -> r) -> (Void# -> r) -> r
NWith_ ann x y = Compose (Ann ann (NWith x y))
pattern NAssert_ :: SrcSpan -> r -> r -> NExprLocF r
pattern $bNAssert_ :: SrcSpan -> r -> r -> NExprLocF r
$mNAssert_ :: forall r r.
NExprLocF r -> (SrcSpan -> r -> r -> r) -> (Void# -> r) -> r
NAssert_ ann x y = Compose (Ann ann (NAssert x y))
pattern NUnary_ :: SrcSpan -> NUnaryOp -> r -> NExprLocF r
pattern $bNUnary_ :: SrcSpan -> NUnaryOp -> r -> NExprLocF r
$mNUnary_ :: forall r r.
NExprLocF r -> (SrcSpan -> NUnaryOp -> r -> r) -> (Void# -> r) -> r
NUnary_ ann op x = Compose (Ann ann (NUnary op x))
pattern NBinary_ :: SrcSpan -> NBinaryOp -> r -> r -> NExprLocF r
pattern $bNBinary_ :: SrcSpan -> NBinaryOp -> r -> r -> NExprLocF r
$mNBinary_ :: forall r r.
NExprLocF r
-> (SrcSpan -> NBinaryOp -> r -> r -> r) -> (Void# -> r) -> r
NBinary_ ann op x y = Compose (Ann ann (NBinary op x y))