code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
{-# LANGUAGE OverloadedStrings, DeriveDataTypeable #-} module ViewModels.LinkedTileViewModel where import Data.Text import Data.Data data LinkedTileViewModel = LinkedTileViewModel { url :: Text, text :: Text, title :: Text } deriving (Data, Typeable)
itsuart/fdc_archivist
src/ViewModels/LinkedTileViewModel.hs
mit
262
0
8
41
55
34
21
9
0
module Jenkins.Types ( Job(..) , JobList(..) , JobStatus(..) , RawBuild(..) , JobWithBuildNums(..) , JobWithBuilds(..) , Branch(..) , BuildNum(..) , Build(..) , BuildRev(..) , Action(..) ) where import Control.Applicative import qualified Data.Text as T import qualified Data.HashMap.Strict as HM import Control.Monad import Data.Aeson import Data.Aeson.Types import Data.DateTime as DT import Data.Monoid ((<>)) import Jenkins.Render ------------------------------------------------------------------------------- data JobStatus = JobSuccess | JobFailure | JobInProgress | JobAborted | JobUnknown deriving (Show, Eq) instance Render JobStatus where renderTTY s = let (glyph, mColor) = case s of JobSuccess -> ("✓", Just "0;32") JobFailure -> ("⨉", Just "0;31") JobInProgress -> ("◷", Just "1;33") JobAborted -> ("☐", Nothing) JobUnknown -> ("?", Nothing) colorize code = "\x1b[0" <> code <> "m" <> glyph <> "\x1b[00m" in maybe glyph colorize mColor render JobSuccess = "success" render JobFailure = "failure" render JobInProgress = "in progress" render JobAborted = "aborted" render JobUnknown = "unknown" decodeJobStatus :: T.Text -> JobStatus decodeJobStatus s = case s of "blue" -> JobSuccess "SUCCESS" -> JobSuccess "red" -> JobFailure "FAILURE" -> JobFailure "grey" -> JobInProgress "blue_anime" -> JobInProgress "red_anime" -> JobInProgress "aborted" -> JobAborted _ -> JobUnknown ------------------------------------------------------------------------------- data Job = Job { jobName :: T.Text , jobStatus :: JobStatus } deriving (Show, Eq) instance FromJSON Job where parseJSON (Object v) = Job <$> v .: "name" <*> liftM decodeJobStatus (v .: "color") parseJSON _ = fail "Cannot parse Job" instance Render Job where renderTTY j = T.unwords [ renderTTY $ jobStatus j , jobName j ] render j = joinTxt [jobName j, render (jobStatus j)] ------------------------------------------------------------------------------- newtype JobList = JobList { fromJobList :: [Job] } deriving (Show) instance FromJSON JobList where parseJSON (Object v) = JobList <$> v .: "jobs" parseJSON _ = fail "Cannot parse JobList" instance Render JobList where renderTTY = T.unlines . (map renderTTY) . fromJobList render = T.unlines . (map render) . fromJobList ------------------------------------------------------------------------------- data JobWithBuildNums = JobWithBuildNums Job [BuildNum] deriving (Show, Eq) instance FromJSON JobWithBuildNums where parseJSON o@(Object v) = JobWithBuildNums <$> parseJSON o <*> v .: "builds" parseJSON _ = fail "Cannot parse JobWithBuildNums" ------------------------------------------------------------------------------- data JobWithBuilds = JobWithBuilds Job [Build] deriving (Show, Eq) instance Render JobWithBuilds where renderTTY (JobWithBuilds _ builds) = T.unlines $ map renderTTY builds render (JobWithBuilds _ builds) = T.unlines $ map render builds ------------------------------------------------------------------------------- type SHA = T.Text newtype Branch = Branch T.Text deriving (Show, Eq) instance FromJSON Branch where parseJSON (Object v) = Branch <$> v .: "name" parseJSON _ = fail "Cannot parse Branch" instance Render Branch where renderTTY (Branch b) = padR 25 $ dropPrefix $ b render (Branch b) = dropPrefix $ b dropPrefix :: T.Text -> T.Text dropPrefix b = case T.breakOn "/" b of (_, "") -> b (_, b') -> T.drop 1 b' ------------------------------------------------------------------------------- data Action = LastBuiltRev SHA [Branch] | OtherAction deriving (Show, Eq) instance FromJSON Action where parseJSON (Object v) = do if lastBuiltRevPresent v then do vv <- v .: lbrKey LastBuiltRev <$> vv .: "SHA1" <*> vv .: "branch" else return OtherAction parseJSON _ = fail "Cannot parse LastBuiltRevision" lbrKey :: T.Text lbrKey = "lastBuiltRevision" lastBuiltRevPresent :: Object -> Bool lastBuiltRevPresent v = case HM.lookup lbrKey v of Just (Object _) -> True _ -> False ------------------------------------------------------------------------------- newtype BuildNum = BuildNum { fromBuildNum :: Int } deriving (Show, Eq) instance FromJSON BuildNum where parseJSON (Object v) = BuildNum <$> v .: "number" parseJSON _ = fail "Cannot parse BuildNum" instance Render BuildNum where render (BuildNum n)= "# " <> padR 3 (T.pack (show n)) ------------------------------------------------------------------------------- data RawBuild = RawBuild { rawBuildNumber :: BuildNum , rawBuildResult :: JobStatus , rawBuildTimestamp :: Integer , rawBuildDuration :: Integer , rawBuildActions :: [Action] } deriving (Show, Eq) instance FromJSON RawBuild where parseJSON (Object v) = do res <- (v .: "result") RawBuild <$> parseJSON (Object v) <*> result res <*> v .: "timestamp" <*> v .: "duration" <*> v .: "actions" parseJSON _ = fail "Cannot parse RawBuild" result :: Value -> Parser JobStatus result Null = return JobInProgress result (String s) = return $ decodeJobStatus s result _ = return JobUnknown ------------------------------------------------------------------------------- newtype BuildRev = BuildRev (SHA, Branch) deriving (Show, Eq) instance Render BuildRev where renderTTY (BuildRev (sha, branch)) = T.unwords [ T.take 10 sha , renderTTY branch ] render (BuildRev (sha, branch)) = joinTxt [sha, render branch] data Build = Build { buildNumber :: BuildNum , buildResult :: JobStatus , buildTimestamp :: Integer , buildDuration :: Integer , buildRevision :: BuildRev } deriving (Show, Eq) instance Render Build where renderTTY b = T.unwords [ renderTTY (buildResult b) , renderTTY (buildNumber b) , showDateTime . buildTimestamp $ b , showDuration . buildDuration $ b , renderTTY (buildRevision b) ] render b = joinTxt [ render (buildResult b) , render (buildNumber b) , showDateTime . buildTimestamp $ b , showDuration . buildDuration $ b , render (buildRevision b) ] showDateTime :: Integer -> T.Text showDateTime timestamp = let d = DT.fromSeconds (timestamp `div` 1000) in T.pack $ DT.formatDateTime "%m-%d-%y %H:%M" d showDuration :: Integer -> T.Text showDuration 0 = padL 7 "n/a" showDuration d = let d' = d `div` 1000 mins = d' `div` 60 secs = d' `mod` 60 in T.unwords [ (padL 2 . T.pack . show $ mins) <> "m" , (padL 2 . T.pack . show $ secs) <> "s" ]
afiore/jenkins-tty.hs
src/Jenkins/Types.hs
mit
7,626
0
18
2,272
2,032
1,087
945
180
9
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE StandaloneDeriving #-} ----------------------------------------------------------------------------- -- | -- Module : Distributed.Data.Queue -- Copyright : (c) Phil Hargett 2014 -- License : MIT (see LICENSE file) -- -- Maintainer : [email protected] -- Stability : experimental -- Portability : non-portable (requires STM) -- -- (..... module description .....) -- ----------------------------------------------------------------------------- module Distributed.Data.Queue ( Queue, QueueLog, mkQueueLog, QueueState, empty, withQueue, enqueue, dequeue, size ) where -- local imports import qualified Data.Fifo as F import Distributed.Data.Container -- external imports import Control.Applicative hiding (empty) import Control.Concurrent.STM import Control.Consensus.Raft import Data.Serialize import Network.Endpoints import Prelude hiding (log,lookup) -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- data QueueCommand v = (Serialize v) => Enqueue v | Dequeue Name deriving instance (Eq v) => Eq (QueueCommand v) deriving instance (Show v) => Show (QueueCommand v) instance (Serialize v) => Serialize (QueueCommand v) where get = do kind <- getWord8 case kind of 0 -> Enqueue <$> get _ -> Dequeue <$> get put (Enqueue value) = do putWord8 0 put value put (Dequeue name) = do putWord8 1 put name data QueueState v = (Serialize v) => QueueState { localName :: Name, localQueue :: F.Fifo v, sharedQueue :: F.Fifo v } deriving instance (Eq v) => Eq (QueueState v) deriving instance (Show v) => Show (QueueState v) instance (Serialize v) => Serialize (QueueState v) where get = do name <- get local <- get shared <- get return $ QueueState name local shared put queue = do put $ localName queue put $ localQueue queue put $ sharedQueue queue instance State (QueueState v) IO (QueueCommand v) where canApplyEntry _ _ = return True applyEntry initial (Enqueue value) = do let newQueue = initial {sharedQueue = F.enqueue (sharedQueue initial) value} return $ newQueue applyEntry initial (Dequeue name) = do let (maybeValue,newShared) = F.dequeue (sharedQueue initial) in case maybeValue of Just value -> if name == (localName initial) then return $ initial {sharedQueue = newShared, localQueue = F.enqueue (localQueue initial) value} else return $ initial {sharedQueue = newShared} Nothing -> return $ initial {sharedQueue = newShared} type QueueLog v = ListLog (QueueCommand v) (QueueState v) mkQueueLog :: (Serialize v) => IO (QueueLog v) mkQueueLog = mkListLog empty :: (Serialize v) => Name -> IO (QueueState v) empty name = return $ QueueState { localName = name, localQueue = F.empty, sharedQueue = F.empty } type Queue v = Container (QueueLog v) (QueueCommand v) (QueueState v) withQueue :: (Serialize v) => Endpoint -> RaftConfiguration -> Name -> QueueLog v -> QueueState v -> (Queue v -> IO ()) -> IO () withQueue = withContainer enqueue :: (Serialize v) => v -> Queue v -> Causal () enqueue value queue = Causal $ \_ -> do now <- perform (Cmd $ Enqueue value) queue return ((),now) dequeue :: (Serialize v) => Queue v -> Causal v dequeue queue = Causal $ \_ -> do q <- containerData queue let name = localName q later <- perform (Cmd $ Dequeue name) queue (latest,now) <- containerDataAt queue later value <- atomically $ do case F.dequeue $ localQueue latest of (Nothing,_) -> retry (Just value,newQueue) -> do modifyTVar (raftContext $ containerRaft queue) $ \oldRaft -> setRaftData (latest {localQueue = newQueue}) oldRaft return value return (value,now) size :: (Serialize v) => Queue v -> Causal Int size queue = Causal $ \index -> do (q,now) <- containerDataAt queue index return (F.size $ sharedQueue q,now)
hargettp/distributed-containers
src/Distributed/Data/Queue.hs
mit
4,395
0
23
1,090
1,321
690
631
98
2
module CaesarCipher where import Data.Char caesarCipher :: Int -> String -> String caesarCipher n s = map (\c -> chr (ord 'a' + ((ord . toLower $ c) - ord 'a' + n) `mod` 26)) s uncaesarCipher :: Int -> String -> String uncaesarCipher n s = map (\c -> chr (ord 'a' + ((ord . toLower $ c) - ord 'a' - n) `mod` 26)) s
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter13/caesarCipher/src/CaesarCipher.hs
mit
322
0
17
74
169
90
79
6
1
import Primes import Data.Array import Debug.Trace nMax = 100 arr = array ((0,0), (nMax, nMax)) $ [ ((n,d), countSplits' n d) | n <- [0..nMax], d <- [0..nMax] ] countSplits' n largest | trace ("call: " ++ show n ++ " " ++ show largest) False = undefined countSplits' n 0 | n>0 = 0 countSplits' 0 _ = 1 countSplits' n largest = sum $ map (\d -> trace ("arr ! " ++ show (n-d) ++ " " ++ show d) $ arr ! ((n-d), min d (n-d))) $ takeWhile (<=largest) primes --countSplits' n largest = sum $ map (\d -> arr ! ((n-d), min d (n-d))) $ takeWhile (<=largest) primes countSums n = (countSplits' n n) - (if isPrime n then 1 else 0) answer = head $ dropWhile (\(_,b) -> b<=5000) $ zip [1..] $ map countSums [1..]
arekfu/project_euler
p0077/p0077.hs
mit
704
0
19
145
356
188
168
11
2
{-| Module : PostgREST.DbRequestBuilder Description : PostgREST database request builder This module is in charge of building an intermediate representation(ReadRequest, MutateRequest) between the HTTP request and the final resulting SQL query. A query tree is built in case of resource embedding. By inferring the relationship between tables, join conditions are added for every embedded resource. -} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DuplicateRecordFields#-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE NamedFieldPuns #-} module PostgREST.DbRequestBuilder ( readRequest , mutateRequest , fieldNames ) where import Control.Applicative import Control.Arrow ((***)) import Control.Lens.Getter (view) import Control.Lens.Tuple (_1) import qualified Data.ByteString.Char8 as BS import Data.List (delete) import Data.Maybe (fromJust) import qualified Data.Set as S import Data.Text (isInfixOf) import Data.Tree import Data.Either.Combinators (mapLeft) import Network.Wai import Data.Foldable (foldr1) import qualified Data.HashMap.Strict as M import PostgREST.ApiRequest ( ApiRequest(..) , PreferRepresentation(..) , Action(..), Target(..) , PreferRepresentation (..) ) import PostgREST.Error (apiRequestError) import PostgREST.Parsers import PostgREST.RangeQuery (NonnegRange, restrictRange, allRange) import PostgREST.Types import Protolude hiding (from) import Text.Regex.TDFA ((=~)) import Unsafe (unsafeHead) readRequest :: Maybe Integer -> [Relation] -> Maybe ProcDescription -> ApiRequest -> Either Response ReadRequest readRequest maxRows allRels proc apiRequest = mapLeft apiRequestError $ treeRestrictRange maxRows =<< augumentRequestWithJoin schema relations =<< addFiltersOrdersRanges apiRequest <*> (buildReadRequest <$> pRequestSelect (iSelect apiRequest)) where action = iAction apiRequest (schema, rootTableName) = fromJust $ -- Make it safe let target = iTarget apiRequest in case target of (TargetIdent (QualifiedIdentifier s t) ) -> Just (s, t) (TargetProc (QualifiedIdentifier s pName) ) -> Just (s, tName) where tName = case pdReturnType <$> proc of Just (SetOf (Composite qi)) -> qiName qi Just (Single (Composite qi)) -> qiName qi _ -> pName _ -> Nothing -- Build tree with a Depth attribute so when a self join occurs we can differentiate the parent and child tables by having -- an alias like "table_depth", this is related to issue #987. buildReadRequest :: [Tree SelectItem] -> ReadRequest buildReadRequest fieldTree = let rootDepth = 0 rootNodeName = if action == ActionRead then rootTableName else sourceCTEName in foldr (treeEntry rootDepth) (Node (Select [] rootNodeName Nothing [] [] [] [] allRange, (rootNodeName, Nothing, Nothing, Nothing, rootDepth)) []) fieldTree where treeEntry :: Depth -> Tree SelectItem -> ReadRequest -> ReadRequest treeEntry depth (Node fld@((fn, _),_,alias,relationDetail) fldForest) (Node (q, i) rForest) = let nxtDepth = succ depth in case fldForest of [] -> Node (q {select=fld:select q}, i) rForest _ -> Node (q, i) $ foldr (treeEntry nxtDepth) (Node (Select [] fn Nothing [] [] [] [] allRange, (fn, Nothing, alias, relationDetail, nxtDepth)) []) fldForest:rForest relations :: [Relation] relations = case action of ActionCreate -> fakeSourceRelations ++ allRels ActionUpdate -> fakeSourceRelations ++ allRels ActionDelete -> fakeSourceRelations ++ allRels ActionInvoke _ -> fakeSourceRelations ++ allRels _ -> allRels where fakeSourceRelations = mapMaybe (toSourceRelation rootTableName) allRels -- in a relation where one of the tables matches "TableName" -- replace the name to that table with pg_source -- this "fake" relations is needed so that in a mutate query -- we can look at the "returning *" part which is wrapped with a "with" -- as just another table that has relations with other tables toSourceRelation :: TableName -> Relation -> Maybe Relation toSourceRelation mt r@(Relation t _ ft _ _ rt _ _) | mt == tableName t = Just $ r {relTable=t {tableName=sourceCTEName}} | mt == tableName ft = Just $ r {relFTable=t {tableName=sourceCTEName}} | Just mt == (tableName <$> rt) = Just $ r {relLinkTable=(\tbl -> tbl {tableName=sourceCTEName}) <$> rt} | otherwise = Nothing treeRestrictRange :: Maybe Integer -> ReadRequest -> Either ApiRequestError ReadRequest treeRestrictRange maxRows_ request = pure $ nodeRestrictRange maxRows_ `fmap` request where nodeRestrictRange :: Maybe Integer -> ReadNode -> ReadNode nodeRestrictRange m (q@Select {range_=r}, i) = (q{range_=restrictRange m r }, i) augumentRequestWithJoin :: Schema -> [Relation] -> ReadRequest -> Either ApiRequestError ReadRequest augumentRequestWithJoin schema allRels request = addRelations schema allRels Nothing request >>= addJoinConditions schema Nothing addRelations :: Schema -> [Relation] -> Maybe ReadRequest -> ReadRequest -> Either ApiRequestError ReadRequest addRelations schema allRelations parentNode (Node (query@Select{from=tbl}, (nodeName, _, alias, relationDetail, depth)) forest) = case parentNode of Just (Node (Select{from=parentNodeTable}, _) _) -> let newFrom r = if tbl == nodeName then tableName (relTable r) else tbl newReadNode = (\r -> (query{from=newFrom r}, (nodeName, Just r, alias, Nothing, depth))) <$> rel rel :: Either ApiRequestError Relation rel = note (NoRelationBetween parentNodeTable nodeName) $ findRelation schema allRelations nodeName parentNodeTable relationDetail in Node <$> newReadNode <*> (updateForest . hush $ Node <$> newReadNode <*> pure forest) _ -> let rn = (query, (nodeName, Just r, alias, Nothing, depth)) r = Relation t [] t [] Root Nothing Nothing Nothing t = Table schema nodeName Nothing True in -- !!! TODO find another way to get the table from the query Node rn <$> updateForest (Just $ Node rn forest) where updateForest :: Maybe ReadRequest -> Either ApiRequestError [ReadRequest] updateForest rq = mapM (addRelations schema allRelations rq) forest findRelation :: Schema -> [Relation] -> NodeName -> TableName -> Maybe RelationDetail -> Maybe Relation findRelation schema allRelations nodeTableName parentNodeTableName relationDetail = find (\Relation{relTable, relColumns, relFTable, relFColumns, relType, relLinkTable} -> -- Both relation ends need to be on the exposed schema schema == tableSchema relTable && schema == tableSchema relFTable && case relationDetail of Nothing -> -- (request) => projects { ..., clients{...} } -- will match -- (relation type) => parent -- (entity) => clients {id} -- (foriegn entity) => projects {client_id} ( nodeTableName == tableName relTable && -- match relation table name parentNodeTableName == tableName relFTable -- match relation foreign table name ) || -- (request) => projects { ..., client_id{...} } -- will match -- (relation type) => parent -- (entity) => clients {id} -- (foriegn entity) => projects {client_id} ( parentNodeTableName == tableName relFTable && length relFColumns == 1 && -- match common foreign key names(table_name_id, table_name_fk) to table_name (toS ("^" <> colName (unsafeHead relFColumns) <> "_?(?:|[iI][dD]|[fF][kK])$") :: BS.ByteString) =~ (toS nodeTableName :: BS.ByteString) ) -- (request) => project_id { ..., client_id{...} } -- will match -- (relation type) => parent -- (entity) => clients {id} -- (foriegn entity) => projects {client_id} -- this case works becasue before reaching this place -- addRelation will turn project_id to project so the above condition will match Just rd -> -- (request) => clients { ..., projects.client_id{...} } -- will match -- (relation type) => child -- (entity) => clients {id} -- (foriegn entity) => projects {client_id} ( relType == Child && nodeTableName == tableName relTable && -- match relation table name parentNodeTableName == tableName relFTable && -- match relation foreign table name length relColumns == 1 && rd == colName (unsafeHead relColumns) ) || -- (request) => message { ..., person_detail.sender{...} } -- will match -- (relation type) => parent -- (entity) => message {sender} -- (foriegn entity) => person_detail {id} ( relType == Parent && nodeTableName == tableName relTable && -- match relation table name parentNodeTableName == tableName relFTable && -- match relation foreign table name length relFColumns == 1 && rd == colName (unsafeHead relFColumns) ) || -- (request) => tasks { ..., users.tasks_users{...} } -- will match -- (relation type) => many -- (entity) => users -- (foriegn entity) => tasks ( relType == Many && nodeTableName == tableName relTable && -- match relation table name parentNodeTableName == tableName relFTable && -- match relation foreign table name rd == tableName (fromJust relLinkTable) ) ) allRelations -- previousAlias is only used for the case of self joins addJoinConditions :: Schema -> Maybe Alias -> ReadRequest -> Either ApiRequestError ReadRequest addJoinConditions schema previousAlias (Node node@(query@Select{from=tbl}, nodeProps@(_, relation, _, _, depth)) forest) = case relation of Just Relation{relType=Root} -> Node node <$> updatedForest -- this is the root node Just rel@Relation{relType=Parent} -> Node (augmentQuery rel, nodeProps) <$> updatedForest Just rel@Relation{relType=Child} -> Node (augmentQuery rel, nodeProps) <$> updatedForest Just rel@Relation{relType=Many, relLinkTable=(Just linkTable)} -> let rq = augmentQuery rel in Node (rq{implicitJoins=tableName linkTable:implicitJoins rq}, nodeProps) <$> updatedForest _ -> Left UnknownRelation where newAlias = case isSelfJoin <$> relation of Just True | depth /= 0 -> Just (tbl <> "_" <> show depth) -- root node doesn't get aliased | otherwise -> Nothing _ -> Nothing augmentQuery rel = foldr (\jc rq@Select{joinConditions=jcs} -> rq{joinConditions=jc:jcs}) query{fromAlias=newAlias} (getJoinConditions previousAlias newAlias rel) updatedForest = mapM (addJoinConditions schema newAlias) forest -- previousAlias and newAlias are used in the case of self joins getJoinConditions :: Maybe Alias -> Maybe Alias -> Relation -> [JoinCondition] getJoinConditions previousAlias newAlias (Relation Table{tableSchema=tSchema, tableName=tN} cols Table{tableName=ftN} fCols typ lt lc1 lc2) = if | typ == Child || typ == Parent -> zipWith (toJoinCondition tN ftN) cols fCols | typ == Many -> let ltN = maybe "" tableName lt in zipWith (toJoinCondition tN ltN) cols (fromMaybe [] lc1) ++ zipWith (toJoinCondition ftN ltN) fCols (fromMaybe [] lc2) | typ == Root -> witness where toJoinCondition :: Text -> Text -> Column -> Column -> JoinCondition toJoinCondition tb ftb c fc = let qi1 = QualifiedIdentifier tSchema tb qi2 = QualifiedIdentifier tSchema ftb in JoinCondition (maybe qi1 (QualifiedIdentifier mempty) newAlias, colName c) (maybe qi2 (QualifiedIdentifier mempty) previousAlias, colName fc) addFiltersOrdersRanges :: ApiRequest -> Either ApiRequestError (ReadRequest -> ReadRequest) addFiltersOrdersRanges apiRequest = foldr1 (liftA2 (.)) [ flip (foldr addFilter) <$> filters, flip (foldr addOrder) <$> orders, flip (foldr addRange) <$> ranges, flip (foldr addLogicTree) <$> logicForest ] {- The esence of what is going on above is that we are composing tree functions of type (ReadRequest->ReadRequest) that are in (Either ParseError a) context -} where filters :: Either ApiRequestError [(EmbedPath, Filter)] filters = mapM pRequestFilter flts logicForest :: Either ApiRequestError [(EmbedPath, LogicTree)] logicForest = mapM pRequestLogicTree logFrst action = iAction apiRequest -- there can be no filters on the root table when we are doing insert/update/delete (flts, logFrst) = case action of ActionInvoke _ -> (iFilters apiRequest, iLogic apiRequest) ActionRead -> (iFilters apiRequest, iLogic apiRequest) _ -> join (***) (filter (( "." `isInfixOf` ) . fst)) (iFilters apiRequest, iLogic apiRequest) orders :: Either ApiRequestError [(EmbedPath, [OrderTerm])] orders = mapM pRequestOrder $ iOrder apiRequest ranges :: Either ApiRequestError [(EmbedPath, NonnegRange)] ranges = mapM pRequestRange $ M.toList $ iRange apiRequest addFilterToNode :: Filter -> ReadRequest -> ReadRequest addFilterToNode flt (Node (q@Select {where_=lf}, i) f) = Node (q{where_=addFilterToLogicForest flt lf}::ReadQuery, i) f addFilter :: (EmbedPath, Filter) -> ReadRequest -> ReadRequest addFilter = addProperty addFilterToNode addOrderToNode :: [OrderTerm] -> ReadRequest -> ReadRequest addOrderToNode o (Node (q,i) f) = Node (q{order=o}, i) f addOrder :: (EmbedPath, [OrderTerm]) -> ReadRequest -> ReadRequest addOrder = addProperty addOrderToNode addRangeToNode :: NonnegRange -> ReadRequest -> ReadRequest addRangeToNode r (Node (q,i) f) = Node (q{range_=r}, i) f addRange :: (EmbedPath, NonnegRange) -> ReadRequest -> ReadRequest addRange = addProperty addRangeToNode addLogicTreeToNode :: LogicTree -> ReadRequest -> ReadRequest addLogicTreeToNode t (Node (q@Select{where_=lf},i) f) = Node (q{where_=t:lf}::ReadQuery, i) f addLogicTree :: (EmbedPath, LogicTree) -> ReadRequest -> ReadRequest addLogicTree = addProperty addLogicTreeToNode addProperty :: (a -> ReadRequest -> ReadRequest) -> (EmbedPath, a) -> ReadRequest -> ReadRequest addProperty f ([], a) rr = f a rr addProperty f (targetNodeName:remainingPath, a) (Node rn forest) = case pathNode of Nothing -> Node rn forest -- the property is silenty dropped in the Request does not contain the required path Just tn -> Node rn (addProperty f (remainingPath, a) tn:delete tn forest) where pathNode = find (\(Node (_,(nodeName,_,alias,_,_)) _) -> nodeName == targetNodeName || alias == Just targetNodeName) forest mutateRequest :: ApiRequest -> TableName -> [Text] -> [FieldName] -> Either Response MutateRequest mutateRequest apiRequest tName pkCols fldNames = mapLeft apiRequestError $ case action of ActionCreate -> Right $ Insert tName pjCols ((,) <$> iPreferResolution apiRequest <*> Just pkCols) [] returnings ActionUpdate -> Update tName pjCols <$> combinedLogic <*> pure returnings ActionSingleUpsert -> (\flts -> if null (iLogic apiRequest) && S.fromList (fst <$> iFilters apiRequest) == S.fromList pkCols && not (null (S.fromList pkCols)) && all (\case Filter _ (OpExpr False (Op "eq" _)) -> True _ -> False) flts then Insert tName pjCols (Just (MergeDuplicates, pkCols)) <$> combinedLogic <*> pure returnings else Left InvalidFilters) =<< filters ActionDelete -> Delete tName <$> combinedLogic <*> pure returnings _ -> Left UnsupportedVerb where action = iAction apiRequest pjCols = pjKeys $ fromJust $ iPayload apiRequest returnings = if iPreferRepresentation apiRequest == None then [] else fldNames filters = map snd <$> mapM pRequestFilter mutateFilters logic = map snd <$> mapM pRequestLogicTree logicFilters combinedLogic = foldr addFilterToLogicForest <$> logic <*> filters -- update/delete filters can be only on the root table (mutateFilters, logicFilters) = join (***) onlyRoot (iFilters apiRequest, iLogic apiRequest) onlyRoot = filter (not . ( "." `isInfixOf` ) . fst) fieldNames :: ReadRequest -> [FieldName] fieldNames (Node (sel, _) forest) = map (fst . view _1) (select sel) ++ map colName fks where fks = concatMap (fromMaybe [] . f) forest f (Node (_, (_, Just Relation{relFColumns=cols, relType=Parent}, _, _, _)) _) = Just cols f _ = Nothing -- Traditional filters(e.g. id=eq.1) are added as root nodes of the LogicTree -- they are later concatenated with AND in the QueryBuilder addFilterToLogicForest :: Filter -> [LogicTree] -> [LogicTree] addFilterToLogicForest flt lf = Stmnt flt : lf
begriffs/postgrest
src/PostgREST/DbRequestBuilder.hs
mit
17,542
0
25
4,343
4,533
2,412
2,121
249
11
module Main where import Prelude hiding (writeFile) import Numerical import Vec3 import Scene import Primitive import Microphone import Material import Container import System.Environment import Pipes import qualified Pipes.ByteString as P import System.IO hiding (writeFile) import Pipes.Aeson.Unchecked primitives :: [Primitive] primitives = [ Plane (C3 (Material 0.95 0.95) (Material 0.85 0.85) (Material 0.75 0.75)) (Vec3 1 0 0) 50 , Plane (C3 (Material 0.95 0.95) (Material 0.85 0.85) (Material 0.75 0.75)) (Vec3 1 0 0) (-50) , Plane (C3 (Material 0.95 0.95) (Material 0.85 0.85) (Material 0.75 0.75)) (Vec3 0 1 0) 10 , Plane (C3 (Material 0.95 0.95) (Material 0.85 0.85) (Material 0.75 0.75)) (Vec3 0 1 0) (-10) , Plane (C3 (Material 0.95 0.95) (Material 0.85 0.85) (Material 0.75 0.75)) (Vec3 0 0 1) 10 , Plane (C3 (Material 0.95 0.95) (Material 0.85 0.85) (Material 0.75 0.75)) (Vec3 0 0 1) (-10) , Sphere (C3 (Material 1 1) (Material 1 1) (Material 1 1)) True (Vec3 40 5 5) 1 ] microphone :: Microphone microphone = Mic $ Vec3 (-5) (-5) (-5) tracer :: [Primitive] -> Microphone -> Int -> Flt -> String -> IO () tracer prims mic rays threshold filename = do r <- traceMic prims mic rays threshold withFile filename WriteMode $ \hOut -> runEffect $ each r >-> for cat encode >-> P.toHandle hOut main :: IO () main = do args <- getArgs case length args of 1 -> tracer primitives microphone 10000 0.01 $ head args _ -> putStrLn "program takes one argument"
reuk/rayverb
tracer/Tracer.hs
gpl-2.0
2,046
0
12
834
681
352
329
49
2
{-| Implementation of Ganeti Lock field queries The actual computation of the field values is done by forwarding the request; so only have a minimal field definition here. -} {- Copyright (C) 2014 Google Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -} module Ganeti.Query.Locks ( fieldsMap ) where import Ganeti.Query.Common import Ganeti.Query.Language import Ganeti.Query.Types -- | List of all lock fields. lockFields :: FieldList String () lockFields = [ (FieldDefinition "name" "Name" QFTOther "Lock name", FieldSimple rsNormal, QffNormal) , (FieldDefinition "mode" "Mode" QFTOther "Mode in which the lock is\ \ currently acquired\ \ (exclusive or shared)", FieldSimple rsNormal, QffNormal) , (FieldDefinition "owner" "Owner" QFTOther "Current lock owner(s)", FieldSimple rsNormal, QffNormal) , (FieldDefinition "pending" "Pending" QFTOther "Jobs waiting for the lock", FieldSimple rsNormal, QffNormal) ] -- | The lock fields map. fieldsMap :: FieldMap String () fieldsMap = fieldListToFieldMap lockFields
badp/ganeti
src/Ganeti/Query/Locks.hs
gpl-2.0
1,786
0
7
383
167
95
72
17
1
-- | -- Module : System.Dzen.Bars -- Copyright : (c) 2009 Felipe A. Lessa -- License : GPL 3 (see the LICENSE file in the distribution) -- -- Maintainer : [email protected] -- Stability : experimental -- Portability : semi-portable (uses MPTC and type families) -- -- Drawing of progress bars (sometimes called progress gauges), -- like @dbar@ and @gdbar@ utilities work but a little more -- powerful (in fact, we can simulate both utilities, see 'dbar' -- and 'gdbar'). -- -- An example of text progress bar that can be drawn: -- -- > 96% [==================> ] module System.Dzen.Bars (-- * Simple interface -- ** Mimicking @dbar@ dbar ,cdbar -- ** Mimicking @gdbar@ ,gdbar ,cgdbar -- * Generic interface ,bar ,cbar ,BarType(..) ,BarTextType(..) ,BarText(..) -- * Styles of the simple interfaces -- You may want to use some of these as the -- base for your own style. Look at the sources! ,dbar_style ,gdbar_style ) where import Control.Arrow import Data.Monoid import System.Dzen.Base import System.Dzen.Colour import System.Dzen.Graphics import System.Dzen.Padding -- | Helper function used below. maybeLeft :: Bool -> BarText maybeLeft False = None maybeLeft True = AtLeft Percentage -- | Mimics the dbar utility. Uses the 'dbar_style'. dbar :: (Num a, Enum a, Ord a, Show a) => Bool -- ^ If @True@, write the percentage on the left. -> Width -- ^ Width of the bar interior. -> (a,a) -- ^ Minimum and maximum values. -> a -- ^ Actual value. -> DString dbar p = bar (maybeLeft p) . dbar_style '=' -- | Mimics the dbar utility while getting the input dinamically. cdbar :: (Num a, Enum a, Ord a, Show a) => Bool -> Width -> (a,a) -> Printer a cdbar p = cbar (maybeLeft p) . dbar_style '=' -- | The style produced by the dbar utility. dbar_style :: Char -> Width -> BarType dbar_style c w = Text {txtOpen = "[" ,txtFilled = str [c] ,txtMiddle = Nothing ,txtBackground = " " ,txtClose = "]" ,txtWidth = w} -- | Mimics the gdbar utility. Uses the 'gdbar_style'. gdbar :: (Num a, Enum a, Ord a, Show a) => Bool -- ^ If @True@, write the percentage on the left. -> (Width, Height) -- ^ Size of the whole bar (excluding text). -> Maybe DColour -- ^ Filled colour (see 'grpFilled'). -> Maybe DColour -- ^ Background/border colour -- (see 'grpBackground' and 'grpBorder'). -> Bool -- ^ @True@ to mimic @-o@ option (outline). -> (a,a) -- ^ Minimum and maximum values. -> a -- ^ Actual value. -> DString gdbar p = (((bar (maybeLeft p) .) . ) .) . gdbar_style -- | Mimics the gdbar utility while getting the input dinamically. cgdbar :: (Num a, Enum a, Ord a, Show a) => Bool -> (Width, Height) -> Maybe DColour -> Maybe DColour -> Bool -> (a,a) -> Printer a cgdbar p = (((cbar (maybeLeft p) .) . ) .) . gdbar_style -- | The style of gdbar (or something very close). gdbar_style :: (Width, Height) -> Maybe DColour -> Maybe DColour -> Bool -> BarType gdbar_style size_ fore back False = Filled {grpFilled = fore ,grpBackground = back ,grpSize = size_} gdbar_style size_ fore back True = Hollow {grpFilled = fore ,grpBackground = Nothing -- That's what gdbar does! ,grpBorder = back ,grpSize = size_} -- | The type of the bar to be drawn. data BarType = -- | Draws a text bar. Note, however, that the -- @DString@s below can be anything, not just -- text. For example, they may have colours ('fg'), -- shapes ('rect's and 'circ's) or 'icon's, you may -- even simulate both 'Filled' and 'Hollow' using just -- 'Text' (although performance would be suboptimal). Text { -- | Text written at the start. txtOpen :: !DString -- | Text written for each filled square. ,txtFilled :: !DString -- | Text written for the last filled square. -- If @Nothing@, the same as the filled square -- is used, but more fairly than if you used -- the same value for filled and middle chars. ,txtMiddle :: !(Maybe DString) -- | Text written for the unfilled squares. ,txtBackground :: !DString -- | Text written at the end. ,txtClose :: !DString -- | How many squares there should be -- (i.e. does not count the open and close parts). ,txtWidth :: !Width} -- | Draws a filled graphical bar, like @gdbar@ would. | Filled { -- | Colour used for filled squares, or @Nothing@ -- to use the default /foreground/ colour. grpFilled :: !(Maybe DColour) -- | Colour used for the unfilled squares, or -- @Nothing@ to use the default /background/ -- colour. ,grpBackground :: !(Maybe DColour) -- | Size of the whole bar. ,grpSize :: !(Width, Height)} -- | Draws a filled graphical bar with a surrounding -- border. | Hollow { -- | Same as @grpFilled@ above. grpFilled :: !(Maybe DColour) -- | Same as @grpBackground@ above. ,grpBackground :: !(Maybe DColour) -- | Colour of the border, or @Nothing@ to use -- the default /foreground/ colour. ,grpBorder :: !(Maybe DColour) -- | Size of the whole bar (including border). ,grpSize :: !(Width, Height)} deriving (Show) -- | The type of text to be written. data BarTextType = Percentage | Absolute deriving (Eq, Ord, Show, Enum) -- | How to draw the bar text. @AtLeft@ and @AtRight@ are used to -- specify if the text is at the left or the right of the bar, -- and @None@ means that no text will be written. data BarText = AtLeft !BarTextType | AtRight !BarTextType | None deriving (Eq, Ord, Show) -- | Draws a bar and optionally some text describing some quantity -- in relation to some range. For example, -- -- > bar (AtLeft Percentage) (Text "[" "=" (Just ">") " " "]" 20) (-10,10) i -- -- produces the bars -- -- > " 2% [ ]" where i = -9.6 -- > " 2% [> ]" where i = -9.5 -- > " 50% [=========> ]" where i = 0 -- > " 96% [==================> ]" where i = 9.4 -- > " 99% [===================>]" where i = 9.99 -- > "100% [====================]" where i = 10 -- -- Note that the text is always padded to four characters. If the -- first bar above had @AtRight Percentage@ the result would be -- -- > "[ ] 2% " -- -- so the padding always inserts the spaces on the outside. bar :: (Num a, Enum a, Ord a, Show a) => BarText -> BarType -> (a,a) -> a -> DString bar txt bar_ r v = case txt of None -> drawnBar AtLeft t -> mconcat [padL 4 (barText t r v), " ", drawnBar] AtRight t -> mconcat [drawnBar, " ", padR 4 (barText t r v)] where drawnBar = barDraw bar_ r v -- | 'bar' wrapped with 'simple' so that the value is -- taken from an input. cbar :: (Num a, Enum a, Ord a, Show a) => BarText -> BarType -> (a,a) -> Printer a cbar = ((simple .) .) . bar -- | Draws the text part of the bar. barText :: (Num a, Enum a, Ord a, Show a) => BarTextType -> (a,a) -> a -> DString barText Absolute _ val = str $ show val barText Percentage range val = str $ (show . fst . fst $ barRound 100 range val) ++ "%" {-# INLINE barText #-} -- | Draws the bar itself. barDraw :: (Num a, Enum a, Ord a, Show a) => BarType -> (a,a) -> a -> DString barDraw (Text {txtOpen = to ,txtFilled = tf ,txtMiddle = Just tm -- <<<<<<<< ,txtBackground = tb ,txtClose = tc ,txtWidth = tw}) range val = let ((f, b), more) = barRound tw range val r | f >= tw = to : replicate tw tf | f > 0 = to : replicate f' tf ++ tm : replicate b' tb | more = to : tm : replicate (tw-1) tb | True = to : replicate tw tb where (f',b') | more = (f, b-1) | otherwise = (f-1, b) in mconcat r `mappend` tc barDraw (Text {txtOpen = to ,txtFilled = tf ,txtMiddle = Nothing -- <<<<<<<< ,txtBackground = tb ,txtClose = tc ,txtWidth = tw}) range val = let (f, b) = fst $ barRound tw range val r = to : replicate f tf ++ replicate b tb in mconcat r `mappend` tc barDraw (Filled {grpFilled = gf ,grpBackground = gb ,grpSize = (gw,gh)}) range val = let (f, b) = fst $ barRound gw range val in mconcat $ [changeFg gf $ rect f gh ,transpRect gb b gh] barDraw (Hollow {grpFilled = gf ,grpBackground = gb ,grpBorder = gbd ,grpSize = (gw_orig, gh_orig)}) range val = let gw = gw_orig - 4 -- Account for the border gh = gh_orig - 4 (f, b) = fst $ barRound gw range val in mconcat $ [pos 2 ,changeFg gf $ rect f gh ,transpRect gb b gh ,pos $ negate (gw + 2) ,changeFg gbd $ ignoreBg True $ rectO gw_orig gh_orig] {-# INLINE barDraw #-} -- | Simulates transparency by not drawing at all. transpRect :: Maybe DColour -> Width -> Height -> DString transpRect Nothing w _ = pos w transpRect (Just c) w h = fg c $ rect w h -- | Function used for rounding. It always rounds towards minus -- infinity, so only the maximum value gives a full bar. -- Values outside the range are clamped. The boolean returned -- is @True@ iff the value would be one more if we rounded -- half-up. barRound :: (Num a, Enum a, Ord a, Show a) => Width -> (a,a) -> a -> ((Int, Int), Bool) barRound w r n = let (f, b) = barRound' w r n in ((f, w - f), b) barRound' :: (Num a, Enum a, Ord a, Show a) => Width -> (a,a) -> a -> (Int, Bool) barRound' w (mini,maxi) n | maxi < mini = error "System.Dzen.Bars.bar: max value is less than min." | n <= mini = (0, False) | n >= maxi = (w, False) | otherwise = let r = fromEnum (2 * fromIntegral w * (n-mini)) `div` fromEnum (maxi-mini) in second (== 1) (r `divMod` 2)
ianclement/dzen-utils
System/Dzen/Bars.hs
gpl-3.0
11,184
0
15
3,989
2,422
1,356
1,066
192
3
module Main where -- from other packages from others import Control.Monad.Identity import Control.Monad.Error import System.Exit (exitFailure, exitSuccess) -- from this package import Test.EventChain.Common import Test.EventChain.LHEParse import Test.EventChain.Match import Test.EventChain.Spec main :: IO () main = do putStrLn "test-evchain:" (return.runIdentity.runErrorT) testPure >>= either (\msg->putStrLn msg >> exitFailure) (const (return ())) runErrorT testIO >>= either (\msg->putStrLn msg >> exitFailure) (const (return ())) exitSuccess -- | testPure :: ErrorT String Identity () testPure = do guardMsg "fail spec1x_test" (return spec1x_test) guardMsg "fail spec2x_test" (return spec2x_test) -- | testIO :: ErrorT String IO () testIO = do guardMsg "fail test_parse_unzip" test_parse_unzip guardMsg "fail test_parse_zip" test_parse_zip test_match_driver
wavewave/evchain
test/test-evchain.hs
gpl-3.0
941
0
13
179
261
135
126
25
1
-- grid is a game written in Haskell -- Copyright (C) 2018 [email protected] -- -- This file is part of grid. -- -- grid is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- grid is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with grid. If not, see <http://www.gnu.org/licenses/>. -- module Game.LevelPuzzle.LevelPuzzleWorld.Content.Plain ( ContentData (..), makeContentData, destroyContentData, {- OffsetArray, offsetarrayAt, -} ) where import MyPrelude import Game import Game.Grid import Game.LevelPuzzle.LevelPuzzleWorld.Room import Game.LevelPuzzle.LevelPuzzleWorld.Wall import OpenGL import OpenGL.Helpers import Data.Array.Unboxed import Data.Array.Base data ContentData = ContentData {- ContentData { contentdataWallVAO :: !GLuint, contentdataWallVBO :: !GLuint, contentdataWallIBO :: !GLuint, contentdataWallOffsets :: !OffsetArray -- map any two connected rooms into distinct colors: -- contentdataColorMapMap :: !ColorMapMapArray -- RoomIx -> ColorMapIx } -} makeContentData :: UInt -> [Room] -> MEnv' ContentData makeContentData roomssize rooms = io $ do return ContentData {- let numWalls = foldl' (\ix room -> ix + roomWallSize room) 0 rooms :: UInt -- vao vao <- bindNewVAO glEnableVertexAttribArray attPos glEnableVertexAttribArray attTexCoord -- ibo ibo <- makeGroupIBO 6 numWalls -- vbo (vbo, offs) <- makeWallVBOOffsets rooms numWalls return ContentData { contentdataWallVAO = vao, contentdataWallVBO = vbo, contentdataWallIBO = ibo, contentdataWallOffsets = offsetarrayList (length' offs) offs } makeWallVBOOffsets :: [Room] -> UInt -> IO (GLuint, [UInt]) makeWallVBOOffsets rooms numWalls = do vbo <- bindNewBuf gl_ARRAY_BUFFER glBufferData gl_ARRAY_BUFFER (fI $ numWalls * 72) nullPtr gl_STATIC_DRAW -- wtf?? empty data not allowed in glMapBufferOES!!! offs <- if numWalls == 0 then return [0] else do writeBuf gl_ARRAY_BUFFER $ helper rooms 0 glVertexAttribPointer attPos 3 gl_SHORT gl_FALSE 12 $ mkPtrGLvoid 0 glVertexAttribPointer attTexCoord 2 gl_UNSIGNED_SHORT gl_TRUE 12 $ mkPtrGLvoid 8 return (vbo, offs) where -- write walls in content helper rooms off ptr = case rooms of [] -> return [off] (r:rs) -> do helper' (roomWall r) (roomWallSize r) 0 ptr (off:) `fmap` helper rs (off + roomWallSize r * 8) (plusPtr ptr (fI $ roomWallSize r * 72)) -- write walls in room helper' wallarray wallarraysize ix ptr = if ix == wallarraysize then return () else do helper'' (wallarrayAt wallarray ix) ptr helper' wallarray wallarraysize (ix + 1) (plusPtr ptr 72) -- write wall helper'' wall ptr = do let Node n0 n1 n2 = wallNode wall Node x0 x1 x2 = wallX wall Node y0 y1 y2 = wallY wall s0 = 0x0000 s1 = 0x8000 s2 = if wallIsDouble wall then 0x0000 else 0xffff t0 = 0x0000 t1 = 0xffff pokeByteOff ptr (0 + 0) (fI (n0 + y0) :: GLshort) pokeByteOff ptr (0 + 2) (fI (n1 + y1) :: GLshort) pokeByteOff ptr (0 + 4) (fI (n2 + y2) :: GLshort) pokeByteOff ptr (0 + 8) (s0 :: GLushort) pokeByteOff ptr (0 + 10) (t1 :: GLushort) pokeByteOff ptr (12+ 0) (fI n0 :: GLshort) pokeByteOff ptr (12+ 2) (fI n1 :: GLshort) pokeByteOff ptr (12+ 4) (fI n2 :: GLshort) pokeByteOff ptr (12+ 8) (s0 :: GLushort) pokeByteOff ptr (12+ 10) (t0 :: GLushort) pokeByteOff ptr (24+ 0) (fI (n0 + x0 + y0) :: GLshort) pokeByteOff ptr (24+ 2) (fI (n1 + x1 + y1) :: GLshort) pokeByteOff ptr (24+ 4) (fI (n2 + x2 + y2) :: GLshort) pokeByteOff ptr (24+ 8) (s1 :: GLushort) pokeByteOff ptr (24+ 10) (t1 :: GLushort) pokeByteOff ptr (36+ 0) (fI (n0 + x0) :: GLshort) pokeByteOff ptr (36+ 2) (fI (n1 + x1) :: GLshort) pokeByteOff ptr (36+ 4) (fI (n2 + x2) :: GLshort) pokeByteOff ptr (36+ 8) (s1 :: GLushort) pokeByteOff ptr (36+ 10) (t0 :: GLushort) pokeByteOff ptr (48+ 0) (fI (n0 + y0) :: GLshort) pokeByteOff ptr (48+ 2) (fI (n1 + y1) :: GLshort) pokeByteOff ptr (48+ 4) (fI (n2 + y2) :: GLshort) pokeByteOff ptr (48+ 8) (s2 :: GLushort) pokeByteOff ptr (48+ 10) (t1 :: GLushort) pokeByteOff ptr (60+ 0) (fI n0 :: GLshort) pokeByteOff ptr (60+ 2) (fI n1 :: GLshort) pokeByteOff ptr (60+ 4) (fI n2 :: GLshort) pokeByteOff ptr (60+ 8) (s2 :: GLushort) pokeByteOff ptr (60+ 10) (t0 :: GLushort) destroyContentData :: ContentData -> MEnv' () destroyContentData cntdata = io $ do delBuf $ contentdataWallVBO cntdata delBuf $ contentdataWallIBO cntdata delBuf $ contentdataWallVAO cntdata -} destroyContentData :: ContentData -> MEnv' () destroyContentData cnt = return () -------------------------------------------------------------------------------- -- OffsetArray type OffsetArray = UArray Int UInt offsetarrayList :: UInt -> [UInt] -> OffsetArray offsetarrayList size offs = listArray (0, fI size - 1) offs offsetarrayAt :: OffsetArray -> UInt -> UInt offsetarrayAt array ix = unsafeAt array (fI ix)
karamellpelle/grid
source/Game/LevelPuzzle/LevelPuzzleWorld/Content/Plain.hs
gpl-3.0
6,227
0
8
1,907
255
153
102
29
1
-- This module defines an instance for the list type for the Edit type class. module ListManipLib (edit, subst, cut, reverseFrom, splice) where { import Char; instance Edit [a] where { edit xs path = [ ("Cut", fCut), ("Copy", fCopy), ("Copy by value", fCopyByValue), ("Copy list up to", fCopyUpTo), ("Copy list from", fCopyFrom), ("Paste", fPaste), ("Delete before", fDeleteBefore), ("Delete after", fDeleteAfter), ("Splice from clipboard", fSplice), ("Reverse from", fReverseFrom), ("Evaluate", fEval), ("Report clipboard value", fReport) ] }; -- Replace the i-th element of a list (0-based indexing) with the given element subst :: Int -> a -> [a] -> [a]; subst i x xs = if i == 0 then x : tail xs else head xs : subst (i-1) x (tail xs); -- Remove the i-th element of a list cut :: Int -> [a] -> [a]; cut i xs = if i == 0 then tail xs else head xs : cut (i-1) (tail xs); -- Reverse the list from location i onwards reverseFrom :: Int -> [a] -> [a]; reverseFrom i xs = if i == 0 then reverse xs else head xs : reverseFrom (i-1) (tail xs); -- The value of splice i xs ys is the list formed by splicing in list xs in front of element i of list ys splice :: Int -> [a] -> [a] -> [a]; splice i xs ys = if i == 0 then xs ++ ys else head ys : splice (i-1) xs (tail ys); -- Functions evaluated by Menu commands ------------------------------------------------------------------- fCut xs path lhs rhs clip = let { i = length path - 1; sExp = "cut " ++ show i ++ paren rhs; sClip = paren rhs ++ " !! " ++ show i; sWarn = "Selected element cut and copied to clipboard!" } in (Just sExp, Just sClip, Just sWarn); fCopy xs path lhs rhs clip = let { i = length path - 1; sClip = lhs ++ " !! " ++ show i; sWarn = "Selected element copied to clipboard!" } in (Nothing, Just sClip, Just sWarn); fCopyByValue xs path lhs rhs clip = let { i = length path - 1; x = xs !! i; sClip = show x; sWarn = "Selected element copied to clipboard by value!" } in (Nothing, Just sClip, Just sWarn); fCopyUpTo xs path lhs rhs clip = let { n = length path; sClip = "take " ++ show n ++ lhs; sWarn = "Sublist up to selected element copied to clipboard!" } in (Nothing, Just sClip, Just sWarn); fCopyFrom xs path lhs rhs clip = let { n = length path; sClip = "drop " ++ show (n-1) ++ lhs; sWarn = "Sublist from selected element and beyond copied to clipboard!" } in (Nothing, Just sClip, Just sWarn); fPaste xs path lhs rhs clip = let { i = length path - 1; sExp = "subst " ++ show i ++ paren clip ++ paren rhs; sWarn = "Contents of clipboard pasted into selected position!" } in (Just sExp, Nothing, Just sWarn); fDeleteBefore xs path lhs rhs clip = let { n = length path; sExp = "drop " ++ show (n-1) ++ paren rhs; sWarn = "List deleted up to selected element!" } in (Just sExp, Nothing, Just sWarn); fDeleteAfter xs path lhs rhs clip = let { n = length path; sExp = "take " ++ show n ++ paren rhs; sWarn = "List deleted after selected element!" } in (Just sExp, Nothing, Just sWarn); fSplice xs path lhs rhs clip = let { i = length path - 1; sExp = "splice " ++ show i ++ paren clip ++ paren rhs; sWarn = "Clipboard contents spliced into list!" } in (Just sExp, Nothing, Just sWarn); fReverseFrom xs path lhs rhs clip = let { i = length path - 1; sExp = if i == 0 then "reverse" ++ paren rhs else "reverseFrom " ++ show i ++ paren rhs; sWarn = "Reverse!" } in (Just sExp, Nothing, Just sWarn); fEval xs path lhs rhs clip = let { sExp = show xs; sWarn = "Evaluate!" } in (Just sExp, Nothing, Just sWarn); fReport xs path lhs rhs clip = let { sWarn = "Clipboard value is: " ++ clip } in (Nothing, Nothing, Just sWarn); -- SUBSIDIARY FUNCTIONS --------------------------------------------------------------- -- Insert parentheses around a string if necessary to make -- it parse as an atomic expression paren :: String -> String; paren s = if isAtomic s then " " ++ s ++ " " else " (" ++ s ++ ") "; -- Test (conservative) for atomicity of an expression, defined as: -- SPACE* ALPHAMERIC* SPACE* isAtomic s = null s || (isSpace (head s) && isAtomic (tail s)) || isAtomic1 (tail s); isAtomic1 s = null s || (isAlphaNum (head s) && isAtomic1 (tail s)) || isAtomic2 (tail s); isAtomic2 s = null s || (isSpace (head s) && isAtomic2 (tail s)) }
ckaestne/CIDE
CIDE_Language_Haskell/test/fromviral/ListManipLib.hs
gpl-3.0
5,348
0
13
1,969
1,596
866
730
110
2
-- H<app-name>, a haskell implementation of GNU <app-name>. module Main where import System.Environment import System.Console.Terminfo.Base import Data.List main :: IO () main = do term <- setupTermFromEnv args <- getArgs let options = processArgs args default<app-name> runTermOutput term (termText (showHelp options)) runTermOutput term (termText (showVersion options)) output <- showOutput options runTermOutput term (termText (output)) runTermOutput term (termText ("Options: "++(show options)++"\n")) return () showOutput :: <app-name>Options -> IO String showOutput opts | not ((displayHelp opts) || (displayVersion opts)) = return "" -- <do-stuff-Here> | otherwise = return "" showHelp :: <app-name>Options -> String showHelp opts | (displayHelp opts) = concat (intersperse "\n" helpText) | otherwise = "" showVersion :: <app-name>Options -> String showVersion opts | (displayVersion opts) = concat (intersperse "\n" versionText) | otherwise = "" processArgs :: [String] -> <app-name>Options -> <app-name>Options processArgs [] opts = opts processArgs (x:xs) opts = case x of "--help" -> processArgs xs opts{displayHelp = True} "--version" -> processArgs xs opts{displayVersion = True} _ -> processArgs xs opts stripQuotes :: String -> String stripQuotes ('"':xs) = if last xs == '"' then init xs else ('"':xs) stripQuotes xs = xs default<app-name> :: <app-name>Options default<app-name> = <app-name>Options False False data <app-name>Options = <app-name>Options { displayHelp :: Bool , displayVersion :: Bool } deriving (Show, Eq) helpText :: [String] helpText = [ "" , "keep the newline->\n" ] versionText :: [String] versionText = [ "H<app-name> (Haskell implementation of GNU <app-name>) 1.0" , "derrived from: " , "Ported by PuZZleDucK.\n" ]
PuZZleDucK/Hls
skeleton.hs
gpl-3.0
1,907
28
15
396
665
343
322
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Resource.Dataproc.Projects.Regions.Clusters.InjectCredentials -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <[email protected]> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Inject encrypted credentials into all of the VMs in a cluster.The target -- cluster must be a personal auth cluster assigned to the user who is -- issuing the RPC. -- -- /See:/ <https://cloud.google.com/dataproc/ Cloud Dataproc API Reference> for @dataproc.projects.regions.clusters.injectCredentials@. module Network.Google.Resource.Dataproc.Projects.Regions.Clusters.InjectCredentials ( -- * REST Resource ProjectsRegionsClustersInjectCredentialsResource -- * Creating a Request , projectsRegionsClustersInjectCredentials , ProjectsRegionsClustersInjectCredentials -- * Request Lenses , prcicXgafv , prcicCluster , prcicUploadProtocol , prcicProject , prcicAccessToken , prcicUploadType , prcicPayload , prcicRegion , prcicCallback ) where import Network.Google.Dataproc.Types import Network.Google.Prelude -- | A resource alias for @dataproc.projects.regions.clusters.injectCredentials@ method which the -- 'ProjectsRegionsClustersInjectCredentials' request conforms to. type ProjectsRegionsClustersInjectCredentialsResource = "v1" :> Capture "project" Text :> Capture "region" Text :> CaptureMode "cluster" "injectCredentials" Text :> QueryParam "$.xgafv" Xgafv :> QueryParam "upload_protocol" Text :> QueryParam "access_token" Text :> QueryParam "uploadType" Text :> QueryParam "callback" Text :> QueryParam "alt" AltJSON :> ReqBody '[JSON] InjectCredentialsRequest :> Post '[JSON] Operation -- | Inject encrypted credentials into all of the VMs in a cluster.The target -- cluster must be a personal auth cluster assigned to the user who is -- issuing the RPC. -- -- /See:/ 'projectsRegionsClustersInjectCredentials' smart constructor. data ProjectsRegionsClustersInjectCredentials = ProjectsRegionsClustersInjectCredentials' { _prcicXgafv :: !(Maybe Xgafv) , _prcicCluster :: !Text , _prcicUploadProtocol :: !(Maybe Text) , _prcicProject :: !Text , _prcicAccessToken :: !(Maybe Text) , _prcicUploadType :: !(Maybe Text) , _prcicPayload :: !InjectCredentialsRequest , _prcicRegion :: !Text , _prcicCallback :: !(Maybe Text) } deriving (Eq, Show, Data, Typeable, Generic) -- | Creates a value of 'ProjectsRegionsClustersInjectCredentials' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'prcicXgafv' -- -- * 'prcicCluster' -- -- * 'prcicUploadProtocol' -- -- * 'prcicProject' -- -- * 'prcicAccessToken' -- -- * 'prcicUploadType' -- -- * 'prcicPayload' -- -- * 'prcicRegion' -- -- * 'prcicCallback' projectsRegionsClustersInjectCredentials :: Text -- ^ 'prcicCluster' -> Text -- ^ 'prcicProject' -> InjectCredentialsRequest -- ^ 'prcicPayload' -> Text -- ^ 'prcicRegion' -> ProjectsRegionsClustersInjectCredentials projectsRegionsClustersInjectCredentials pPrcicCluster_ pPrcicProject_ pPrcicPayload_ pPrcicRegion_ = ProjectsRegionsClustersInjectCredentials' { _prcicXgafv = Nothing , _prcicCluster = pPrcicCluster_ , _prcicUploadProtocol = Nothing , _prcicProject = pPrcicProject_ , _prcicAccessToken = Nothing , _prcicUploadType = Nothing , _prcicPayload = pPrcicPayload_ , _prcicRegion = pPrcicRegion_ , _prcicCallback = Nothing } -- | V1 error format. prcicXgafv :: Lens' ProjectsRegionsClustersInjectCredentials (Maybe Xgafv) prcicXgafv = lens _prcicXgafv (\ s a -> s{_prcicXgafv = a}) -- | Required. The cluster, in the form clusters\/. prcicCluster :: Lens' ProjectsRegionsClustersInjectCredentials Text prcicCluster = lens _prcicCluster (\ s a -> s{_prcicCluster = a}) -- | Upload protocol for media (e.g. \"raw\", \"multipart\"). prcicUploadProtocol :: Lens' ProjectsRegionsClustersInjectCredentials (Maybe Text) prcicUploadProtocol = lens _prcicUploadProtocol (\ s a -> s{_prcicUploadProtocol = a}) -- | Required. The ID of the Google Cloud Platform project the cluster -- belongs to, of the form projects\/. prcicProject :: Lens' ProjectsRegionsClustersInjectCredentials Text prcicProject = lens _prcicProject (\ s a -> s{_prcicProject = a}) -- | OAuth access token. prcicAccessToken :: Lens' ProjectsRegionsClustersInjectCredentials (Maybe Text) prcicAccessToken = lens _prcicAccessToken (\ s a -> s{_prcicAccessToken = a}) -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). prcicUploadType :: Lens' ProjectsRegionsClustersInjectCredentials (Maybe Text) prcicUploadType = lens _prcicUploadType (\ s a -> s{_prcicUploadType = a}) -- | Multipart request metadata. prcicPayload :: Lens' ProjectsRegionsClustersInjectCredentials InjectCredentialsRequest prcicPayload = lens _prcicPayload (\ s a -> s{_prcicPayload = a}) -- | Required. The region containing the cluster, of the form regions\/. prcicRegion :: Lens' ProjectsRegionsClustersInjectCredentials Text prcicRegion = lens _prcicRegion (\ s a -> s{_prcicRegion = a}) -- | JSONP prcicCallback :: Lens' ProjectsRegionsClustersInjectCredentials (Maybe Text) prcicCallback = lens _prcicCallback (\ s a -> s{_prcicCallback = a}) instance GoogleRequest ProjectsRegionsClustersInjectCredentials where type Rs ProjectsRegionsClustersInjectCredentials = Operation type Scopes ProjectsRegionsClustersInjectCredentials = '["https://www.googleapis.com/auth/cloud-platform"] requestClient ProjectsRegionsClustersInjectCredentials'{..} = go _prcicProject _prcicRegion _prcicCluster _prcicXgafv _prcicUploadProtocol _prcicAccessToken _prcicUploadType _prcicCallback (Just AltJSON) _prcicPayload dataprocService where go = buildClient (Proxy :: Proxy ProjectsRegionsClustersInjectCredentialsResource) mempty
brendanhay/gogol
gogol-dataproc/gen/Network/Google/Resource/Dataproc/Projects/Regions/Clusters/InjectCredentials.hs
mpl-2.0
7,024
0
18
1,539
933
545
388
142
1
{-# LANGUAGE OverloadedStrings #-} module Commands.CIA ( cia, fbi, fiveeyes ) where import Control.Applicative import Control.Monad.Random.Class import Data.Response import Data.Maybe import Data.Monoid import Network.IRC import Data.Attoparsec.ByteString.Char8 (string) import qualified Data.ByteString.Char8 as B cia :: MonadRandom m => Response m cia = fromMsgParser parser $ \_ chan _ -> do c <- getRandomR (1337 :: Int, 99999 :: Int) let ret = "This incident has been reported. Case #" <> B.pack (show c) return $ privmsg (fromMaybe "" chan) ret where parser = string ":cia" <|> string ":CIA" fbi :: MonadRandom m => Response m fbi = fromMsgParser parser $ \_ chan _ -> do c <- getRandomR (1337 :: Int, 99999 :: Int) let ret = "This incident was lost in a secret memo. Case #" <> B.pack (show c) return $ privmsg (fromMaybe "" chan) ret where parser = string ":fbi" <|> string ":FBI" fiveeyes :: MonadRandom m => Response m fiveeyes = fromMsgParser parser $ \_ chan _ -> do c <- getRandomR (1337 :: Int, 99999 :: Int) let ret = "This incident was reported to a member of and shared amongst the Five Eyes. Case #" <> B.pack (show c) return $ privmsg (fromMaybe "" chan) ret where parser = string ":fiveeyes" <|> string ":FIVEEYES"
tsahyt/lmrbot
src/Commands/CIA.hs
agpl-3.0
1,360
0
15
334
428
221
207
35
1
module AlphabeticAnagrams where import Data.List -- import Data.Bits -- type BIT = [Int] extract :: Maybe a -> a extract (Just a) = a mapChar :: [Char] -> Char -> Integer mapChar cs c = toInteger $ extract $ elemIndex c cs mapString :: [Char] -> String -> [Integer] mapString cs = map $ \x -> toInteger $ mapChar cs x -- lowbit :: Int -> Int -- lowbit n = n .&. (-n) -- bitSum :: [Int] -> Int -> Int -- bitSum bit 0 = 0 -- bitSum bit x = (bit !! x) + (bitSum bit (x - lowbit x)) -- bitAdd :: [Int] -> Int -> Int -> [Int] -- bitAdd bit l i -- |i > l = bit -- |otherwise = bitAdd (update bit l l i) (i + lowbit i) -- justDoIt :: Integer -> [Char] -> [Integer] -> Integer justDoIt n cs [ ] = 0 justDoIt n cs (h : t) = h + n * justDoIt n cs t -- lexiPos :: String -> Integer lexiPos s = justDoIt (toInteger $ length values) values str where values = sort $ nub s str = mapString values s --
ice1000/OI-codes
codewars/1-100/alphabetic-anagrams.hs
agpl-3.0
920
0
8
231
262
143
119
15
1
module ProductFusion where import Data.Char (digitToInt) import Products productFusionLeft,productFusionRight :: (c -> a) -> (c -> b) -> (d -> c) -> d -> (a, b) productFusionLeft g h f = pair g h . f productFusionRight g h f = pair (g . f) (h . f) pf = [ productFusionLeft (*2) show digitToInt '3' , pair (*2) show . digitToInt $ '3' , pair (*2) show 3 , ((*2) 3, show 3) , ( 6, "3") , productFusionRight (*2) show digitToInt '3' , pair ((*2) . digitToInt) (show . digitToInt) '3' , (((*2) . digitToInt) '3', (show . digitToInt) '3') , (((*2) 3), (show 3)) ] -- (6,"3") -- End
haroldcarr/learn-haskell-coq-ml-etc
haskell/book/2019-Program_Design_by_Calculation-Oliveira/2015-05-LambdaConf/ProductFusion.hs
unlicense
868
0
10
403
306
175
131
16
1
module Main where import Data.Function import qualified Data.Map.Strict as Map import Utils.Fasta gcContent :: String -> Float gcContent s = ((length filteredContent) `intDiv` (length s)) * 100.0 where filteredContent = filter (\c -> (c == 'C') || (c == 'G')) s intDiv = (/) `on` fromIntegral maxValue :: (String, Float) -> String -> Float -> (String, Float) maxValue acc key value = if value > snd acc then (key, value) else acc toString :: (String, Float) -> String toString (key, value) = displayKey ++ "\n" ++ show value where -- drop the leading '>' character. displayKey = drop 1 key main = do contents <- getContents let gcContentMap = Map.map gcContent (getFastaMap contents) let result = Map.foldlWithKey' maxValue ("", 0.0) gcContentMap putStrLn $ toString result
ctimmons/hs_rosalind
4 - Computing GC Content/Main.hs
unlicense
841
0
12
192
299
165
134
20
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE RecordWildCards #-} -- | A Service monitoring. -- -- Here we do merely use deptrack to record service dependencies for some -- internet hosts that I own. module Service where import Prelude hiding (lookup) import Deptrack.Graph import Deptrack.Monadic import Data.Traversable (sequenceA, traverse) import Text.Dot (showDot) import Data.Map.Strict import qualified Data.Map.Strict as M import Data.Tree import qualified Data.Array as A import Control.Monad import Control.Concurrent.Async (mapConcurrently) import Control.Concurrent.STM hiding (check) import Control.Monad.STM hiding (check) import System.Process import GHC.IO.Exception -- | A representation of our dependency data Dependency = Abstraction String | Checkable Check deriving (Show, Ord, Eq) data Check = Check { checkKey :: String , checkAction :: IO Bool } depAction (Checkable (Check _ x)) = x depAction s = print s >> return False instance ToDotInfos Dependency where toDotInfos (Checkable (Check k _)) = [("label",k), ("shape","rectangle")] toDotInfos (Abstraction k) = [("label",k), ("shape","egg")] instance Show Check where show a = show $ checkKey a instance Eq Check where a == b = checkKey a == checkKey b instance Ord Check where a `compare` b = checkKey a `compare` checkKey b check :: String -> IO (Bool) -> Dependency check n x = Checkable $ Check n x host :: String -> Dependency host = Abstraction pingDep :: String -> Dependency pingDep host = check ("can-ping: " ++ host) ((==ExitSuccess) <$> rawSystem "ping" ["-c", "3", host]) curlDep :: String -> Dependency curlDep url = check ("can-curl: " ++ url) ((==ExitSuccess) <$> rawSystem "curl" ["-i", url]) sshDep :: String -> Dependency sshDep host = check ("can-ssh: " ++ host) ((==ExitSuccess) <$> rawSystem "ssh" [host, "echo hi"]) pingable = nest pingDep curlable = nest curlDep sshable = nest sshDep webServer x = nest host $ do curlable (pure x) pingable (pure x) dnsRoot x = nest host $ do pingable (pure x) lautre = nest host $ do webServer "lautre.net" bookmyname = nest host $ do dnsRoot "bookmyname.com" dicioccio = nest host $ do bookmyname lautre webServer "dicioccio.fr" haskellParis = do bookmyname webServer "haskell-paris.fr" probecraft = do bookmyname sshable (pure "probecraft.net") webServer "probecraft.net" neverworks = do webServer "never-works.42.local" hostnames = traverse (nest host) [dicioccio, haskellParis, probecraft, neverworks] runDeps cache (Node Nothing xs) = all id <$> mapConcurrently (runDeps cache) xs runDeps cache (Node (Just dep) xs) = all id <$> zs where zs = (:) <$> runOne cache dep <*> mapConcurrently (runDeps cache) xs type Cache b a = TVar (Map b (TMVar (Maybe a))) newCache = newTVarIO M.empty -- | runs a dependency check if its result is not already known from the cache -- -- if there is a TVar for this key, we just wait for completion -- else we set a TVar and propose an action to fill the TVar with the value runOne :: Cache Dependency Bool -> Dependency -> IO Bool runOne cache dependency = do let waitFull tmvar = do maybe retry (return . return) =<< readTMVar tmvar let finalize tmvar = do x <- depAction dependency -- XXX here we run the check, we should atomically catch errors and do something about it => retry, cancel, let other processes take a chance etc. atomically $ swapTMVar tmvar $ Just x return x let go = do tmvar <- newTMVar Nothing modifyTVar cache $ insert dependency tmvar return $ finalize tmvar let begin = do c <- lookup dependency <$> readTVar cache maybe go waitFull c act <- atomically begin act example = do let x = fst $ evalTree hostnames newCache >>= flip runDeps x instance ToDotInfos (Dependency, Maybe Bool) where toDotInfos (Abstraction k, _)= [("label",k), ("shape","egg")] toDotInfos (x,Nothing) = ("color","blue") : toDotInfos x toDotInfos (x,Just True) = ("color","green") : toDotInfos x toDotInfos (x,Just False) = ("color","red") : toDotInfos x example2 :: IO (Dot ()) example2 = do let ((g,f1,f2),_) = evalGraph hostnames let rs = roots g cache <- newCache mapConcurrently (go cache g f1) rs r <- atomically $ readTVar cache >>= traverse readTMVar let f1' idx = let (d,_,_) = f1 idx in ((d,join $ lookup d r), undefined, undefined) return $ dotGraph (g,f1',undefined) where go c g f idx = do let (dependency,_,_) = (f idx) runOne c dependency let children = (A.!) g idx concat <$> mapConcurrently (go c g f) children example3 = do let ((g,f1,f2),_) = evalGraph hostnames let rs = roots g cache <- newCache mapConcurrently (go cache g f1) rs r <- atomically $ readTVar cache >>= traverse readTMVar let f1' idx = let (d,_,_) = f1 idx in ((d,join $ lookup d r), undefined, undefined) return $ dotGraph (g,f1',undefined) where go c g f idx = do let (dependency,_,_) = (f idx) x <- runOne c dependency if x then return [] else do let children = (A.!) g idx concat <$> mapConcurrently (go c g f) children
lucasdicioccio/deptrack
examples/Service.hs
apache-2.0
5,546
0
16
1,465
1,902
969
933
135
2
{-# LANGUAGE GADTs, KindSignatures, DataKinds #-} module Sysops where {- would be great to support something like - - worker = dep $ do - x `remote` (nat >> service "my-worker" []) - - we may want to explicit remotable actions from non-remotable, - GADTs/phantom types may help ensuring we only construct validly remotable actions - trick is to annotate all operations under a "remote" call to have them become remote - one option is to annotate the sub-tree by fmapping it before graph-generation - - remotely :: DepTrack (Remote SysOp) a -> DepTrack SysOp a - remotely = undefined -} import Deptrack.Monadic import Control.Applicative ((<$>),(<*>)) import Data.Traversable (traverse) import Control.Monad (forM_, void) import Control.Exception (catch, SomeException) import Data.Graph (topSort) import Data.Monoid ((<>)) import System.Process (createProcess, shell, proc, readProcessWithExitCode, callProcess) import System.Exit (ExitCode (..)) import System.Directory (doesFileExist, copyFile) newtype Key = Key String deriving (Show, Ord, Eq) newtype Source a = Source a newtype Destination a = Destination a newtype Action = Action { runAction :: IO () } newtype Check = Check { runCheck :: IO Bool } instance Show Action where show _ = "<runAction>" instance Show Check where show _ = "<runCheck>" data SysOp where -- operation that are idempotent (and cheap) IdempotentOperation :: Key -> Action -> SysOp -- operation that cannot be made idempotent (or that are prohibitevly -- expensive like compiling a kernel) CheckableOperation :: Key -> Check -> Action -> SysOp -- operation for checking a property dynamically VerificationOperation :: Key -> Check -> SysOp deriving Show instance Eq SysOp where IdempotentOperation j _ == IdempotentOperation k _ = k == j CheckableOperation j _ _ == CheckableOperation k _ _ = k == j VerificationOperation j _ == VerificationOperation k _ = k == j _ == _ = False instance Ord SysOp where IdempotentOperation j _ `compare` IdempotentOperation k _ = k `compare` j CheckableOperation j _ _ `compare` CheckableOperation k _ _ = k `compare` j VerificationOperation j _ `compare` VerificationOperation k _ = k `compare` j IdempotentOperation j _ `compare` VerificationOperation k _ = GT IdempotentOperation k _ `compare` CheckableOperation j _ _ = GT VerificationOperation k _ `compare` CheckableOperation j _ _ = GT _ `compare`_ = LT class IsSysOp a where toSysOp :: a -> SysOp instance IsSysOp SysOp where toSysOp = id -- modelization op :: IsSysOp a => a -> DepTrack SysOp a op = nest toSysOp . pure dep :: IsSysOp a => DepTrack SysOp a -> DepTrack SysOp a dep = nest toSysOp type Login = String type Name = String type FullName = String type Owner = String type UID = Int type GID = Int data SaltUser = PresentSaltUser Login FullName FilePath UID GID [SaltGroup] | AbsentSaltUser Login data SaltGroup = PresentSaltGroup Name GID | AbsentSaltGroup Name data User = User Login data Bridge = Bridge Name data Tap = Tap Name User data BridgedInterface = BridgedTap Bridge Tap data NAT = NAT data Forwarding = Forwarding data File = FilePresent FilePath | FileCopy (Source File) (Destination FilePath) data Process = ProcessRunning FilePath [String] Name data Package = DebianPackage Name procAction :: FilePath -> [String] -> Action procAction x xs = Action (void (log >> act)) where cp = proc x xs log = print (x,xs) act = createProcess cp instance IsSysOp User where toSysOp (User k) = IdempotentOperation (Key k) (procAction "adduser" [k]) instance IsSysOp Bridge where toSysOp (Bridge k) = IdempotentOperation (Key k) (procAction "brctl" ["addbr", k]) instance IsSysOp BridgedInterface where toSysOp (BridgedTap (Bridge k) (Tap t _)) = IdempotentOperation (Key $ "iface" <> k <> "t") (procAction "brctl" ["addif", k, t]) instance IsSysOp Tap where toSysOp (Tap k (User o)) = IdempotentOperation (Key k) (procAction "tunctl" ["-u",o,"-t",k]) instance IsSysOp File where toSysOp (FilePresent p) = VerificationOperation (Key p) (Check $ doesFileExist p) toSysOp (FileCopy (Source (FilePresent src)) (Destination p)) = CheckableOperation (Key p) (Check $ doesFileExist p) (Action $ copyFile src p) instance IsSysOp Forwarding where toSysOp Forwarding = IdempotentOperation (Key "forwarding") (Action $ writeFile "/proc/sys/net/ipv4/ip_forward" "1") instance IsSysOp Process where toSysOp (ProcessRunning k xs p) = CheckableOperation (Key $ "process:" <> k) (Check $ (\(c,_,_) -> c == ExitSuccess) <$> readProcessWithExitCode "pgrep" [k] "") (Action $ print (k,xs) >> callProcess k xs) instance IsSysOp Package where toSysOp (DebianPackage p) = IdempotentOperation (Key p) (Action $ print (x, xs) >> callProcess x xs) where (x,xs) = ("apt-get", ["install", p]) instance IsSysOp NAT where toSysOp NAT = CheckableOperation (Key "nat") (Check $ print "TODO: iptables -L …" >> return False) (Action $ print "TODO iptables -A FORWARD …") deb n = op (DebianPackage n) nat = op NAT forwarding = op Forwarding bridge k = op (Bridge k) tap `bridgedTo` bridge = dep (BridgedTap <$> bridge <*> tap) user k = op (User k) filePresent p = op (FilePresent p) fileCopy s d = dep (f <$> filePresent s) where f s = FileCopy (Source s) (Destination d) process k as p = op (ProcessRunning k as p) tap x = dep (Tap x <$> user "dicioccio") dhcp = dep $ do deb "isc-dhcp-server" let br0 = "br0" let dhcpConf = "./rundir/dhcp.conf" fileCopy "./conf/dhcpcd-alt.conf" dhcpConf bridge "br0" process "dhcpcd" [ "-f", "-d", "-cf", dhcpConf, br0 ] "dhcpcd" vm = dep $ do let qemuImage = "./rundir/qemu.img" let tapIface = "tap16" traverse deb ["qemu", "qemu-kvm", "qemu-system", "qemu-user", "qemu-utils"] forwarding >> nat >> tap tapIface `bridgedTo` bridge "br0" >> dhcp fileCopy "./imgdir/debian-7.6-x64.qcow2.HaLVM" qemuImage process "qemu-system-x86_64" [ "-enable-kvm", "-nographic" , "-daemonize" , "-m", "256" , "-hda", qemuImage , "-net", "nic,macaddr=52:54:11:22:33:16" , "-net", "tap,ifname=" <> tapIface <> ",script=no,downscript=no" ] "qemu" example = do let xs = vm let ((g,f1,f2),v) = evalGraph xs let indices = reverse $ topSort g forM_ indices $ \idx -> case (f1 idx) of ((CheckableOperation k c x), _, _) -> print k >> runCheck c >>= \r -> if r then print "skipped" else runAction x ((IdempotentOperation k x), _, _) -> print k >> runAction x ((VerificationOperation k c), _, _) -> print k >> runCheck c >>= \r -> if r then print "ok" else print "not verified" `catch` printException where printException :: SomeException -> IO () printException = print
lucasdicioccio/deptrack
examples/sysops.hs
apache-2.0
7,230
0
16
1,768
2,244
1,175
1,069
147
5
-- Copyright 2011 The Text.XHtml Authors. -- -- Licensed under the Apache License, Version 2.0 (the "License"); you may not -- use this file except in compliance with the License. You may obtain a copy -- of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -- WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -- License for the specific language governing permissions and limitations under -- the License. -- -- Contributors: -- Ian Lynagh <[email protected]> -- #hide ----------------------------------------------------------------------------- -- | -- Module : Text.XHtml.internals -- Copyright : (c) Andy Gill, and the Oregon Graduate Institute of -- Science and Technology, 1999-2001, -- (c) Bjorn Bringert, 2004-2006 -- License : Apache License, Version 2.0 (see the file LICENSE) -- Maintainer : Robin Bate Boerop <[email protected]> -- Stability : experimental -- Portability : portable -- -- Internals of the XHTML combinator library. ----------------------------------------------------------------------------- module Text.XHtml.Internals where import Data.Char import Data.Monoid infixr 2 +++ -- combining Html infixr 7 << -- nesting Html infixl 8 ! -- adding optional arguments -- -- * Data types -- -- | A important property of Html is that all strings inside the -- structure are already in Html friendly format. data HtmlElement = HtmlString String -- ^ ..just..plain..normal..text... but using &copy; and &amb;, etc. | HtmlTag { markupTag :: String, markupAttrs :: [HtmlAttr], markupContent :: Html } -- ^ tag with internal markup -- | Attributes with name and value. data HtmlAttr = HtmlAttr String String newtype Html = Html { getHtmlElements :: [HtmlElement] } -- -- * Classes -- instance Show Html where showsPrec _ html = showString (renderHtmlFragment html) showList htmls = foldr (.) id (map shows htmls) instance Show HtmlAttr where showsPrec _ (HtmlAttr str val) = showString str . showString "=" . shows val instance Monoid Html where mempty = noHtml mappend = (+++) -- | HTML is the class of things that can be validly put -- inside an HTML tag. So this can be one or more 'Html' elements, -- or a 'String', for example. class HTML a where toHtml :: a -> Html toHtmlFromList :: [a] -> Html toHtmlFromList xs = Html (concat [ x | (Html x) <- map toHtml xs]) instance HTML Html where toHtml a = a instance HTML Char where toHtml a = toHtml [a] toHtmlFromList [] = Html [] toHtmlFromList str = Html [HtmlString (stringToHtmlString str)] instance (HTML a) => HTML [a] where toHtml xs = toHtmlFromList xs instance HTML a => HTML (Maybe a) where toHtml = maybe noHtml toHtml class ADDATTRS a where (!) :: a -> [HtmlAttr] -> a instance (ADDATTRS b) => ADDATTRS (a -> b) where fn ! attr = \ arg -> fn arg ! attr instance ADDATTRS Html where (Html htmls) ! attr = Html (map addAttrs htmls) where addAttrs (html@(HtmlTag { markupAttrs = attrs }) ) = html { markupAttrs = attrs ++ attr } addAttrs html = html -- -- * Html primitives and basic combinators -- -- | Put something inside an HTML element. (<<) :: (HTML a) => (Html -> b) -- ^ Parent -> a -- ^ Child -> b fn << arg = fn (toHtml arg) concatHtml :: (HTML a) => [a] -> Html concatHtml as = Html (concat (map (getHtmlElements.toHtml) as)) -- | Create a piece of HTML which is the concatenation -- of two things which can be made into HTML. (+++) :: (HTML a,HTML b) => a -> b -> Html a +++ b = Html (getHtmlElements (toHtml a) ++ getHtmlElements (toHtml b)) -- | An empty piece of HTML. noHtml :: Html noHtml = Html [] -- | Checks whether the given piece of HTML is empty. isNoHtml :: Html -> Bool isNoHtml (Html xs) = null xs -- | Constructs an element with a custom name. tag :: String -- ^ Element name -> Html -- ^ Element contents -> Html tag str htmls = Html [ HtmlTag { markupTag = str, markupAttrs = [], markupContent = htmls }] -- | Constructs an element with a custom name, and -- without any children. itag :: String -> Html itag str = tag str noHtml emptyAttr :: String -> HtmlAttr emptyAttr s = HtmlAttr s s intAttr :: String -> Int -> HtmlAttr intAttr s i = HtmlAttr s (show i) strAttr :: String -> String -> HtmlAttr strAttr s t = HtmlAttr s (stringToHtmlString t) htmlAttr :: String -> Html -> HtmlAttr htmlAttr s t = HtmlAttr s (show t) {- foldHtml :: (String -> [HtmlAttr] -> [a] -> a) -> (String -> a) -> Html -> a foldHtml f g (HtmlTag str attr fmls) = f str attr (map (foldHtml f g) fmls) foldHtml f g (HtmlString str) = g str -} -- | Processing Strings into Html friendly things. stringToHtmlString :: String -> String stringToHtmlString = concatMap fixChar where fixChar '<' = "&lt;" fixChar '>' = "&gt;" fixChar '&' = "&amp;" fixChar '"' = "&quot;" fixChar c | ord c < 0x80 = [c] fixChar c = "&#" ++ show (ord c) ++ ";" -- | This is not processed for special chars. -- use stringToHtml or lineToHtml instead, for user strings, -- because they understand special chars, like @'<'@. primHtml :: String -> Html primHtml x | null x = Html [] | otherwise = Html [HtmlString x] -- -- * Html Rendering -- mkHtml :: HTML html => html -> Html mkHtml = (tag "html" ! [strAttr "xmlns" "http://www.w3.org/1999/xhtml"] <<) -- | Output the HTML without adding newlines or spaces within the markup. -- This should be the most time and space efficient way to -- render HTML, though the ouput is quite unreadable. showHtmlInternal :: HTML html => String -- ^ DOCTYPE declaration -> html -> String showHtmlInternal docType theHtml = docType ++ showHtmlFragment (mkHtml theHtml) -- | Outputs indented HTML. Because space matters in -- HTML, the output is quite messy. renderHtmlInternal :: HTML html => String -- ^ DOCTYPE declaration -> html -> String renderHtmlInternal docType theHtml = docType ++ "\n" ++ renderHtmlFragment (mkHtml theHtml) ++ "\n" -- | Outputs indented HTML, with indentation inside elements. -- This can change the meaning of the HTML document, and -- is mostly useful for debugging the HTML output. -- The implementation is inefficient, and you are normally -- better off using 'showHtml' or 'renderHtml'. prettyHtmlInternal :: HTML html => String -- ^ DOCTYPE declaration -> html -> String prettyHtmlInternal docType theHtml = docType ++ "\n" ++ prettyHtmlFragment (mkHtml theHtml) -- | Render a piece of HTML without adding a DOCTYPE declaration -- or root element. Does not add any extra whitespace. showHtmlFragment :: HTML html => html -> String showHtmlFragment h = (foldr (.) id $ map showHtml' $ getHtmlElements $ toHtml h) "" -- | Render a piece of indented HTML without adding a DOCTYPE declaration -- or root element. Only adds whitespace where it does not change -- the meaning of the document. renderHtmlFragment :: HTML html => html -> String renderHtmlFragment h = (foldr (.) id $ map (renderHtml' 0) $ getHtmlElements $ toHtml h) "" -- | Render a piece of indented HTML without adding a DOCTYPE declaration -- or a root element. -- The indentation is done inside elements. -- This can change the meaning of the HTML document, and -- is mostly useful for debugging the HTML output. -- The implementation is inefficient, and you are normally -- better off using 'showHtmlFragment' or 'renderHtmlFragment'. prettyHtmlFragment :: HTML html => html -> String prettyHtmlFragment = unlines . concat . map prettyHtml' . getHtmlElements . toHtml -- | Show a single HTML element, without adding whitespace. showHtml' :: HtmlElement -> ShowS showHtml' (HtmlString str) = (++) str showHtml'(HtmlTag { markupTag = name, markupContent = html, markupAttrs = attrs }) = if isNoHtml html && elem name validHtmlITags then renderTag True name attrs "" else (renderTag False name attrs "" . foldr (.) id (map showHtml' (getHtmlElements html)) . renderEndTag name "") renderHtml' :: Int -> HtmlElement -> ShowS renderHtml' _ (HtmlString str) = (++) str renderHtml' n (HtmlTag { markupTag = name, markupContent = html, markupAttrs = attrs }) = if isNoHtml html && elem name validHtmlITags then renderTag True name attrs (nl n) else (renderTag False name attrs (nl n) . foldr (.) id (map (renderHtml' (n+2)) (getHtmlElements html)) . renderEndTag name (nl n)) where nl n' = "\n" ++ replicate (n' `div` 8) '\t' ++ replicate (n' `mod` 8) ' ' prettyHtml' :: HtmlElement -> [String] prettyHtml' (HtmlString str) = [str] prettyHtml' (HtmlTag { markupTag = name, markupContent = html, markupAttrs = attrs }) = if isNoHtml html && elem name validHtmlITags then [rmNL (renderTag True name attrs "" "")] else [rmNL (renderTag False name attrs "" "")] ++ shift (concat (map prettyHtml' (getHtmlElements html))) ++ [rmNL (renderEndTag name "" "")] where shift = map (\x -> " " ++ x) rmNL = filter (/= '\n') -- | Show a start tag renderTag :: Bool -- ^ 'True' if the empty tag shorthand should be used -> String -- ^ Tag name -> [HtmlAttr] -- ^ Attributes -> String -- ^ Whitespace to add after attributes -> ShowS renderTag empty name attrs nl r = "<" ++ name ++ shownAttrs ++ nl ++ close ++ r where close = if empty then " />" else ">" shownAttrs = concat [' ':showPair attr | attr <- attrs ] showPair :: HtmlAttr -> String showPair (HtmlAttr key val) = key ++ "=\"" ++ val ++ "\"" -- | Show an end tag renderEndTag :: String -- ^ Tag name -> String -- ^ Whitespace to add after tag name -> ShowS renderEndTag name nl r = "</" ++ name ++ nl ++ ">" ++ r -- | The names of all elements which can represented using the empty tag -- short-hand. validHtmlITags :: [String] validHtmlITags = [ "area", "base", "basefont", "br", "col", "frame", "hr", "img", "input", "isindex", "link", "meta", "param" ]
robinbb/hs-text-xhtml
Text/XHtml/Internals.hs
apache-2.0
11,039
32
15
3,049
2,399
1,298
1,101
183
6
module Set1 ( challenge1 , challenge2 , challenge3 , challenge4 , challenge5 , challenge6 , challenge7 , challenge8 ) where import Lib import qualified Debug.Trace as Debug import Numeric (showHex) import Data.Bits import qualified Data.ByteString.Lazy as B import qualified Data.Function import Data.List import qualified Data.Map as Map import Data.Word -- Challenge 1 challenge1 :: [B.ByteString] -> Either Error B.ByteString challenge1 [x] | isHex x = Right $ plusNL $ hexToBase64 x | otherwise = Left ("Your hex string must be actual hex i.e. [A-Za-z0-9]+", [stringToBytes "1-1"], True) challenge1 [] = Left ("You need to supply exactly one hex string", [stringToBytes "1-1"], True) hexToBase64 :: B.ByteString -> B.ByteString hexToBase64 = bytesToBase64 . hexToBytes -- Challenge 2 challenge2 :: [B.ByteString] -> Either Error B.ByteString challenge2 [x,y] | isHex (B.append x y) = Right $ plusNL $ bytesToHex (bitwiseCombine xor (hexToBytes x) (hexToBytes y)) | otherwise = Left ("Your hex strings must be actual hex i.e. [A-Za-z0-9]+", [stringToBytes "1-2"], True) challenge2 _ = Left ("You need to supply two hex strings to xor together", [stringToBytes "1-2"], True) -- Challenge 3 challenge3 :: [B.ByteString] -> Either Error B.ByteString challenge3 [x,y] | not $ all (`elem` map charToWord8 ['0'..'9']) (B.unpack y) = Left ("The number of results to show must be a positive integer", [stringToBytes "1-3"], True) | yInt <= 0 = Left ("The number of results to show must be a positive integer", [stringToBytes "1-3"], True) | isHex x = Right $ hexToGuessList x yInt | otherwise = Left ("Your hex string must be actual hex i.e. [A-Za-z0-9]+ and the number to show must be a positive integer", [stringToBytes "1-3"], True) where yInt = read (bytesToString y)::Int challenge3 [x] | isHex x = Right $ plusNL $ hexToBestGuess x | otherwise = Left ("Your hex string must be actual hex i.e. [A-Za-z0-9]+", [stringToBytes "1-3"], True) challenge3 _ = Left ("You need to supply eactly one hex string and an optional number", [stringToBytes "1-3"], True) hexToGuessList :: B.ByteString -> Int -> B.ByteString hexToGuessList x y = stringToBytes $ unlines $ take y $ map bytesToString $ listOfBestGuesses probabilities bs where probabilities = singleByteXorProbabilities bs bs = hexToBytes x hexToBestGuess :: B.ByteString -> B.ByteString hexToBestGuess x = bestGuess bs where bestGuess = singleByteXor $ fst $ minimumBy (\(_, x) (_, y) -> compare x y) probabilities probabilities = singleByteXorProbabilities bs bs = hexToBytes x singleByteXor :: Word8 -> B.ByteString -> B.ByteString singleByteXor x = B.map (xor x) listOfBestGuesses :: [(Word8, Double)] -> B.ByteString -> [B.ByteString] listOfBestGuesses l bs = [ stringToBytes $ showHex (keyof x) "" ++ ":" ++ show (deltaof x) ++ ":" ++ bytesToString (plainof x) | x <- ordered_guesses ] where ordered_guesses = [(fst x, snd x, singleByteXor (fst x) bs) | x <- sortOn snd l] keyof (x, _, _) = x deltaof (_, x, _) = x plainof (_, _, x) = x singleByteXorProbabilities :: B.ByteString -> [(Word8, Double)] singleByteXorProbabilities str = [ (x, y) | x <- [0::Word8 .. 0xff] , let y = buildDelta (fromIntegral $ B.length str) asciiFreqTableNoNL $ singleByteXor x str ] letterFreq :: Int -> B.ByteString -> (Double, Map.Map Word8 Double) letterFreq strLen = buildFreqTable (0, strLen, Map.fromList [(n, 0) | n <- Map.keys asciiFreqTableNoNL]) -- Challenge 4 challenge4 :: [B.ByteString] -> Either Error B.ByteString challenge4 input | null input = Left ("You need to supply hex strings to standard input i.e. [A-Za-z0-9]+, one per line", [stringToBytes "1-4"], True) | otherwise = Right $ singleByteXor (fst $ snd absoluteBest) (fst absoluteBest) where absoluteBest = minimumBy (\(_, (_, x)) (_, (_, y)) -> compare x y) [(x, bestGuess x) | x <- map hexToBytes $ B.split (charToWord8 '\n') (head input)] bestGuess = minimumBy (\(_, x) (_, y) -> compare x y) . singleByteXorProbabilities solveSingleByteXor :: B.ByteString -> (Word8, Double) solveSingleByteXor = minimumBy (\(_, x) (_, y) -> compare x y) . singleByteXorProbabilities -- Challenge 5 challenge5 :: [B.ByteString] -> Either Error B.ByteString challenge5 input | null input = Left ("You need to supply a key", [stringToBytes "1-5"], True) | otherwise = Right $ plusNL $ B.concat [bytesToHex $ bitwiseCombine xor ln (B.cycle key) | ln <- text] where key = head input text = tail input -- Challenge 6 challenge6 :: [B.ByteString] -> Either Error B.ByteString challenge6 input | null input = Left ("You need to supply some input", [stringToBytes "1-6"], True) | otherwise = Right $ plusNL $ bitwiseCombine xor str (B.cycle key) where key = fst $ minimumBy (Data.Function.on compare snd) [ ( B.pack $ map fst [solveSingleByteXor c | c <- chunks], sum (map snd [solveSingleByteXor c | c <- chunks]) / fromIntegral (length chunks) ) | chunks <- possibleChunks] possibleChunks = [B.transpose (strToTranspose n) | n <- likelyKeyLengths] strToTranspose n = case Map.lookup n segmentedStr of Just x -> x _ -> [] likelyKeyLengths = map snd $ take numberOfLikelyKeyLengths $ Map.toAscList $ Map.foldWithKey (\size chunks acc -> Map.insert (averageNormalizedHammingDistance $ take (2 * numberOfSegmentsToCheck) chunks) size acc) Map.empty segmentedStr segmentedStr = Map.fromList [(n, splitBytes n str) | n <- [shortestKeyLength..longestKeyLength]] str = base64ToBytes $ head input numberOfSegmentsToCheck = 4 numberOfLikelyKeyLengths = 3 shortestKeyLength = 2 longestKeyLength = 40 -- Hamming distance between two byte strings, divided by the length of the shorter string -- (we use the shorter string because hammingDistance truncates the longer string) normalizedHammingDistance :: B.ByteString -> B.ByteString -> Double normalizedHammingDistance x y = realToFrac (hammingDistance x y) / realToFrac (min (B.length x) (B.length y)) -- Gets the average hamming distance of each sequential pair of ByteStrings in the array averageNormalizedHammingDistance :: [B.ByteString] -> Double averageNormalizedHammingDistance = averageNormalizedHammingDistance' (0, 0) averageNormalizedHammingDistance' :: (Double, Int) -> [B.ByteString] -> Double averageNormalizedHammingDistance' (acc, count) [] = if count == 0 then 0 else acc / fromIntegral count averageNormalizedHammingDistance' (acc, count) [_] = if count == 0 then 0 else acc / fromIntegral count averageNormalizedHammingDistance' (acc, count) (x:y:remainder) = averageNormalizedHammingDistance' (acc + h, count + 1) remainder where h = normalizedHammingDistance x y -- Challenge 7 challenge7 :: [B.ByteString] -> Either Error B.ByteString challenge7 input | null input = Left ("You need to supply a key and standard input", [stringToBytes "1-7"], True) | 16 /= B.length key = Left ("Your key must be exactly 16 ASCII bytes (maybe enclose it in quotes?)", [stringToBytes "1-7"], True) | otherwise = Right $ decryptAES128ECB key str where key = head input str = base64ToBytes $ head $ tail input -- Challenge 8 challenge8 :: [B.ByteString] -> Either Error B.ByteString challenge8 input | null input = Left ("You need to supply standard input", [stringToBytes "1-8"], True) | otherwise = Right $ plusNL . fst . minimumBy (compare `Data.Function.on` snd) $ filter (not . B.null . fst) [(i, allPairsHammingDistance $ splitBytes 16 (hexToBytes i)) | i <- B.split (charToWord8 '\n') $ head input] -- | otherwise = Right $ foldl B.append (stringToBytes "\n") $ map (\(a, b) -> B.append (stringToBytes $ show (fromIntegral b / 320) ++ " - ") $ B.append a (stringToBytes "\n")) $ sortOn snd $ filter (not . B.null . fst) [(i, allPairsHammingDistance $ splitBytes 16 (hexToBytes i)) | i <- B.split (charToWord8 '\n') $ head input]
mjec/cryptopals-haskell
src/Set1.hs
bsd-3-clause
9,064
0
17
2,570
2,566
1,345
1,221
140
3
-- Little Bob loves chocolates, and goes to the store with cash in his pocket. The price of each chocolate is price. The store offers a discount: for every 'wrappers needed' number of wrappers he gives the store, he’ll get one chocolate for free. -- -- The free chocolate program has been successful, and they've decided to tweak the promotion. -- -- Chocolate Types -- -- The store is now pushing certain types of chocolates. There are four types, white, dark, milk and sugar free and the store is giving away an extra sample of chocolates in addition to the original wrapper promotion. For the original wrapper promotion, the free chocolates will be of the same type that you are buying for that purchase. Note that if Bob accumulates enough wrappers of the other type, he can trade those in as well. -- -- If you trade in wrappers for milk or white, you get an extra sugar free chocolate along with every free milk or white chocolate that you would normally get. -- If you trade in wrappers for sugar free chocolate, you get an extra dark chocolate along with every free sugar free chocolate that you get. -- Since dark is all the rage, that is considered premium and there is no additional candy bonus. -- cash, price, wrappers needed, type -- -- 12, 2, 5, 'milk' -- 12, 4, 4, 'dark' -- 6, 2, 2, 'sugar free' -- 6, 2, 2, 'white'o -- -- milk 7, dark 0, white 0, sugar free 1 -- milk 0, dark 3, white 0, sugar free 0 -- milk 0, dark 3, white 0, sugar free 5 -- milk 0, dark 1, white 5, sugar free 3 import Data.Map (elems, fromList, insert, lookup, Map) import Data.Maybe (fromJust) type Cash = Int type Price = Int type WrappersNeeded = Int data ChocolateType = Milk | Dark | White | SugarFree deriving (Enum, Eq, Ord, Show) type Basket = Map ChocolateType Int type TotalChocolates = Int type WrappedChocolate = Int type UnredeemedWrappers = Int type BasketWithWrappers = Map ChocolateType (TotalChocolates, UnredeemedWrappers) data Scenario = Scenario { cash :: Cash, price :: Price, wrappersNeeded :: WrappersNeeded, chocolateType :: ChocolateType } deriving Show emptyBasket = fromList $ Prelude.map (\chocolateType -> (chocolateType, 0)) [Milk ..] emptyBasketWithWrappers = basketToBasketWithWrappers emptyBasket purchaseInitialChocolates :: Scenario -> Basket purchaseInitialChocolates scenario = insert (chocolateType scenario) totalBought emptyBasket where totalBought = cash scenario `div` price scenario redeemPurchasedChocolates :: Basket -> WrappersNeeded -> BasketWithWrappers redeemPurchasedChocolates basket wrappersNeeded = redeemForAll (basketToBasketWithWrappers basket) wrappersNeeded basketToBasketWithWrappers :: Basket -> BasketWithWrappers basketToBasketWithWrappers basket = fmap (\num -> (num, num)) basket {-redeem' :: BasketWithWrappers -> ChocolateType -> WrappersNeeded -> BasketWithWrappers-} {-redeem' basket chocolateType wrappersNeeded-} {-| wrappers < wrappersNeeded = basket-} {-| otherwise = redeem' updatedBasket chocolateType wrappersNeeded-} {-where (total, wrappers) = fromJust $ Data.Map.lookup chocolateType basket-} {-(redeemed, leftOver) = wrappers `divMod` wrappersNeeded-} {-updatedBasket = updateBasketWithPromotion basket chocolateType total redeemed (redeemed + leftOver)-} redeemForAll :: BasketWithWrappers -> WrappersNeeded -> BasketWithWrappers redeemForAll basket wrappersNeeded | all (\(total,wrappers) -> total + wrappers < wrappersNeeded) basket = basket | otherwise = redeemForAll updatedBasket wrappersNeeded where listOfTotalsAndWrappers = elems basket listOfRedeemedAndLeftOver = map (\(_, wrappers) -> wrappers `divMod` wrappersNeeded) listOfTotalsAndWrappers updatedBaskets = map (\(chocolateType,(redeemed, leftOver)) -> updateBasketWithPromotion basket chocolateType redeemed (redeemed + leftOver)) $ zip [Milk ..] listOfRedeemedAndLeftOver updatedBasket = mconcat updatedBaskets redeemForAll = undefined {-type OriginalTotal = Int-} {-type ChocolatesRedeemed = Int-} {-updateBasketWithPromotion :: BasketWithWrappers -> ChocolateType -> ChocolatesRedeemed -> UnredeemedWrappers -> BasketWithWrappers-} {-updateBasketWithPromotion basket chocolateType redeemed unredeemed-} {-| chocolateType == Milk || chocolateType == White = insert SugarFree (sugarFreeTotal + redeemed, sugarFreeWrappers + redeemed) updatedBasketWithoutPromotion-} {-| chocolateType == SugarFree = insert Dark (darkTotal + redeemed, darkWrappers + redeemed) updatedBasketWithoutPromotion-} {-| otherwise = updatedBasketWithoutPromotion-} {-where (darkTotal, darkWrappers) = fromJust $ Data.Map.lookup Dark basket-} {-(sugarFreeTotal, sugarFreeWrappers) = fromJust $ Data.Map.lookup SugarFree basket-} {-(currentTotal, currentWrappers) = fromJust $ Data.Map.lookup chocolateType basket-} {-updatedBasketWithoutPromotion = insert chocolateType (currentTotal+redeemed, unredeemed) basket-}
jleakakos/haskell-code-test
src/old/ChocolateShop.hs
bsd-3-clause
4,931
0
13
749
549
326
223
30
1
{-# LANGUAGE NPlusKPatterns #-} module Code11 where mnss0 :: [Int] -> Int mnss0 = maximum . map sum . nonsegs markings :: [a] -> [[(a,Bool)]] markings xs = [zip xs bs | bs <- booleans (length xs)] booleans :: Int -> [[Bool]] booleans 0 = [[]] booleans (n+1) = [b:bs | b <- [True,False], bs <- booleans n] booleans _ = error "Negative argument" nonsegs :: [a] -> [[a]] nonsegs = extract . filter nonseg . markings extract :: [[(a,Bool)]] -> [[a]] extract = map (map fst . filter snd) data State = E | S | M | N deriving (Eq) nonseg :: [(a,Bool)] -> Bool nonseg = (== N) . foldl step0 E . map snd step0 :: State -> Bool -> State step0 E False = E step0 E True = S step0 S False = M step0 S True = S step0 M False = M step0 M True = N step0 N _ = N -- Drivation mnss1 :: [Int] -> Int mnss1 = maximum . map sum . extract . filter nonseg . markings pick :: State -> [a] -> [[a]] pick q = extract . filter ((== q) . foldl step0 E . map snd) . markings -- pickall xs = (pick E xs, pick S xs, pick M xs, pick N xs) pickall :: [a] -> ([[a]],[[a]],[[a]],[[a]]) pickall = foldl step ([[]],[],[],[]) step :: ([[a]],[[a]],[[a]],[[a]]) -> a -> ([[a]],[[a]],[[a]],[[a]]) step (ess,sss,mss,nss) x = (ess ,map (++[x]) (sss ++ ess) ,mss ++ sss ,nss ++ map (++[x]) (nss ++ mss)) mnss2 :: [Int] -> Int mnss2 = maximum . map sum . fourth . pickall fourth :: (a,b,c,d) -> d fourth (_,_,_,z) = z mnss3 :: [Int] -> Int mnss3 = fourth . tuple (maximum . map sum) . pickall tuple :: (a -> b) -> (a,a,a,a) -> (b,b,b,b) tuple f (w,x,y,z) = (f w, f x, f y, f z) -- final mnss :: [Int] -> Int mnss xs = fourth (foldl h (start (take 3 xs)) (drop 3 xs)) where h (e,s,m,n) x = (e ,(s `max` e) + x ,m `max` s ,n `max` ((n `max` m) + x)) start :: [Int] -> (Int, Int, Int, Int) start [x,y,z] = (0,maximum [x+y+z,y+z,z],maximum [x,x+y,y],x+z) start _ = error "start: Length of list arg is not 3." -- sample :: [Int] sample = [-4,-3,-7,2,1,-2,-1,-4]
sampou-org/pfad
Code/Code11.hs
bsd-3-clause
2,188
1
12
668
1,252
714
538
55
1
module Nitpick.PatternMatches (patternMatches) where import Control.Arrow (second) import qualified Data.Foldable as F import qualified Data.Map as Map import qualified Data.Maybe as Maybe import qualified Data.Set as Set import qualified AST.Expression.General as E import qualified AST.Expression.Canonical as Canonical import qualified AST.Helpers as Help import qualified AST.Module as Module import qualified AST.Module.Name as ModuleName import qualified AST.Pattern as Pattern import qualified AST.Variable as Var import Elm.Utils ((|>)) import Nitpick.Pattern (Pattern(..), fromCanonicalPattern) import qualified Optimize.DecisionTree as DT import qualified Reporting.Annotation as A import qualified Reporting.Error.Pattern as Error import qualified Reporting.Region as Region import qualified Reporting.Result as Result patternMatches :: Module.Interfaces -> Module.CanonicalModule -> Result.Result w Error.Error DT.VariantDict patternMatches interfaces modul = let name = Module.name modul body = Module.body modul tagDict = toTagDict interfaces name (Module.datatypes body) in const (Map.map (Map.map length) tagDict) --Disable temporarily to test Type and Effect <$> Result.ok tagDict -- checkExpression tagDict (Module.program body) -- TAG DICT type TagDict = Map.Map Var.Home (Map.Map Tag [TagInfo]) type Tag = String data TagInfo = TagInfo { _tag :: Tag , _arity :: Int } toTagDict :: Module.Interfaces -> ModuleName.Canonical -> Module.ADTs -> TagDict toTagDict interfaces localName localAdts = let listTags = [ TagInfo "::" 2 , TagInfo "[]" 0 ] boolTags = [ TagInfo "True" 0 , TagInfo "False" 0 ] builtinDict = Map.singleton Var.BuiltIn $ Map.fromList [ ("::", listTags) , ("[]", listTags) , ("True", boolTags) , ("False", boolTags) ] interfaceDict = interfaces |> Map.map (toTagMapping . Module.iAdts) |> Map.mapKeysMonotonic Var.Module |> Map.insert (Var.Module localName) (toTagMapping localAdts) in Map.union builtinDict interfaceDict toTagMapping :: Module.ADTs -> Map.Map Tag [TagInfo] toTagMapping adts = let toTagAndArity (_tvars, tagInfoList) = let info = map (\(tag, args) -> TagInfo tag (length args)) tagInfoList in map (second (const info)) tagInfoList in Map.elems adts |> concatMap toTagAndArity |> Map.fromList lookupOtherTags :: Var.Canonical -> TagDict -> [TagInfo] lookupOtherTags (Var.Canonical home name) tagDict = case Map.lookup name =<< Map.lookup home tagDict of Just otherTags -> otherTags Nothing -> if Help.isTuple name then [ TagInfo name (read (drop 6 name)) ] else error "Since the Nitpick phase happens after canonicalization and type \ \inference, it is impossible that a pattern in a case cannot be \ \found." -- CHECK EXPRESSIONS checkExpression :: TagDict -> Canonical.Expr -> Result.Result w Error.Error () checkExpression tagDict (A.A region expression) = let go = checkExpression tagDict go2 a b = go a <* go b in case expression of E.Literal _ -> Result.ok () E.Var _ -> Result.ok () E.Range low high -> go2 low high E.ExplicitList listExprs -> F.traverse_ go listExprs E.Binop _ leftExpr rightExpr -> go2 leftExpr rightExpr E.Lambda pattern@(A.A patRegion _) body -> checkPatterns tagDict patRegion Error.Arg [pattern] <* go body E.App func arg -> go2 func arg E.If branches finally -> F.traverse_ (uncurry go2) branches <* go finally E.Let defs body -> go body <* F.traverse_ goDef defs where goDef (Canonical.Definition _ pattern@(A.A patRegion _) expr _) = checkPatterns tagDict patRegion Error.LetBound [pattern] <* go expr E.Case expr branches -> go expr <* checkPatterns tagDict region Error.Case (map fst branches) <* F.traverse_ (go . snd) branches E.Data _ctor exprs -> F.traverse_ go exprs E.Access record _field -> go record E.Update record fields -> go record <* F.traverse_ (go . snd) fields E.Record fields -> F.traverse_ (go . snd) fields E.Port impl -> case impl of E.In _ _ -> Result.ok () E.Out _ expr _ -> go expr E.Task _ expr _ -> go expr E.GLShader _ _ _ -> Result.ok () -- CHECK PATTERNS checkPatterns :: TagDict -> Region.Region -> Error.Origin -> [Pattern.CanonicalPattern] -> Result.Result w Error.Error () checkPatterns tagDict region origin patterns = checkPatternsHelp tagDict region origin [Anything] patterns checkPatternsHelp :: TagDict -> Region.Region -> Error.Origin -> [Pattern] -> [Pattern.CanonicalPattern] -> Result.Result w Error.Error () checkPatternsHelp tagDict region origin unhandled patterns = case (unhandled, patterns) of ([], []) -> return () (_:_, []) -> Result.throw region (Error.Incomplete origin unhandled) (_, pattern@(A.A localRegion _) : remainingPatterns) -> do newUnhandled <- filterPatterns tagDict localRegion pattern unhandled checkPatternsHelp tagDict region origin newUnhandled remainingPatterns filterPatterns :: TagDict -> Region.Region -> Pattern.CanonicalPattern -> [Pattern] -> Result.Result w Error.Error [Pattern] filterPatterns tagDict region pattern unhandled = let nitPattern = fromCanonicalPattern pattern noIntersection pat = intersection pat nitPattern == Nothing in if all noIntersection unhandled then Result.throw region Error.Redundant else do let complementPatterns = complement tagDict nitPattern return $ concatMap (\p -> Maybe.mapMaybe (intersection p) complementPatterns) unhandled -- PATTERN INTERSECTION intersection :: Pattern -> Pattern -> Maybe Pattern intersection pattern1 pattern2 = case (pattern1, pattern2) of (Alias _ pattern1', _) -> intersection pattern1' pattern2 (_, Alias _ pattern2') -> intersection pattern1 pattern2' (Anything, _) -> Just pattern2 (Var _, _) -> Just pattern2 (_, Anything) -> Just pattern1 (_, Var _) -> Just pattern1 (Data ctor1 args1, Data ctor2 args2) -> if ctor1 /= ctor2 then Nothing else Data ctor1 <$> sequence (zipWith intersection args1 args2) (Record _, Record _) -> Just pattern1 (Literal lit1, Literal lit2) -> if lit1 == lit2 then Just pattern1 else Nothing (AnythingBut literals, Literal lit) -> if Set.member lit literals then Nothing else Just pattern2 (Literal lit, AnythingBut literals) -> if Set.member lit literals then Nothing else Just pattern1 (AnythingBut literals1, AnythingBut literals2) -> Just (AnythingBut (Set.union literals1 literals2)) _ -> Nothing -- PATTERN COMPLEMENT complement :: TagDict -> Pattern -> [Pattern] complement tagDict nitPattern = case nitPattern of Record _fields -> [] Alias _name pattern -> complement tagDict pattern Var _name -> [] Anything -> [] Literal lit -> [AnythingBut (Set.singleton lit)] AnythingBut literals -> map Literal (Set.toList literals) Data ctor patterns -> complementData tagDict ctor patterns complementData :: TagDict -> Var.Canonical -> [Pattern] -> [Pattern] complementData tagDict tag patterns = let otherTags = lookupOtherTags tag tagDict tagComplements = Maybe.mapMaybe (tagToPattern tag) otherTags arity = length patterns argComplements = concat (zipWith (makeArgComplements tagDict tag arity) [0..] patterns) in tagComplements ++ argComplements tagToPattern :: Var.Canonical -> TagInfo -> Maybe Pattern tagToPattern (Var.Canonical home rootTag) (TagInfo tag arity) = if rootTag == tag then Nothing else Just (Data (Var.Canonical home tag) (replicate arity Anything)) makeArgComplements :: TagDict -> Var.Canonical -> Int -> Int -> Pattern -> [Pattern] makeArgComplements tagDict tag arity index argPattern = let complementList = complement tagDict argPattern padArgs pattern = replicate index Anything ++ pattern : replicate (arity - index - 1) Anything in map (Data tag . padArgs) complementList
JoeyEremondi/elm-pattern-effects
src/Nitpick/PatternMatches.hs
bsd-3-clause
9,011
0
18
2,591
2,649
1,354
1,295
262
18
----------------------------------------------------------------------------- -- | -- Module : Graphics.X11.Xlib.Context -- Copyright : (c) Alastair Reid, 1999-2003 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : [email protected] -- Stability : provisional -- Portability : portable -- -- A collection of FFI declarations for interfacing with Xlib Graphics -- Contexts. -- ----------------------------------------------------------------------------- module Graphics.X11.Xlib.Context( setArcMode, setBackground, setForeground, setFunction, setGraphicsExposures, setClipMask, setClipOrigin, setDashes, setFillRule, setFillStyle, setFont, setLineAttributes, setPlaneMask, setState, setStipple, setSubwindowMode, setTSOrigin, setTile, createGC, gContextFromGC, freeGC, flushGC, copyGC, ) where import Graphics.X11.Types import Graphics.X11.Xlib.Types import Foreign import Foreign.C ---------------------------------------------------------------- -- Graphics contexts ---------------------------------------------------------------- -- Convenience functions -- | interface to the X11 library function @XSetArcMode()@. foreign import ccall unsafe "HsXlib.h XSetArcMode" setArcMode :: Display -> GC -> ArcMode -> IO () -- | interface to the X11 library function @XSetBackground()@. foreign import ccall unsafe "HsXlib.h XSetBackground" setBackground :: Display -> GC -> Pixel -> IO () -- | interface to the X11 library function @XSetForeground()@. foreign import ccall unsafe "HsXlib.h XSetForeground" setForeground :: Display -> GC -> Pixel -> IO () -- | interface to the X11 library function @XSetFunction()@. foreign import ccall unsafe "HsXlib.h XSetFunction" setFunction :: Display -> GC -> GXFunction -> IO () -- | interface to the X11 library function @XSetGraphicsExposures()@. foreign import ccall unsafe "HsXlib.h XSetGraphicsExposures" setGraphicsExposures :: Display -> GC -> Bool -> IO () -- | interface to the X11 library function @XSetClipMask()@. foreign import ccall unsafe "HsXlib.h XSetClipMask" setClipMask :: Display -> GC -> Pixmap -> IO () -- | interface to the X11 library function @XSetClipOrigin()@. foreign import ccall unsafe "HsXlib.h XSetClipOrigin" setClipOrigin :: Display -> GC -> Position -> Position -> IO () -- XSetClipRectangles omitted because it's not clear when it's safe to delete the -- array of rectangles -- | interface to the X11 library function @XSetDashes()@. setDashes :: Display -> GC -> Int -> String -> Int -> IO () setDashes display gc dash_offset dashes n = withCString dashes $ \ dash_list -> xSetDashes display gc dash_offset dash_list n foreign import ccall unsafe "HsXlib.h XSetDashes" xSetDashes :: Display -> GC -> Int -> CString -> Int -> IO () -- | interface to the X11 library function @XSetFillRule()@. foreign import ccall unsafe "HsXlib.h XSetFillRule" setFillRule :: Display -> GC -> FillRule -> IO () -- | interface to the X11 library function @XSetFillStyle()@. foreign import ccall unsafe "HsXlib.h XSetFillStyle" setFillStyle :: Display -> GC -> FillStyle -> IO () -- | interface to the X11 library function @XSetFont()@. foreign import ccall unsafe "HsXlib.h XSetFont" setFont :: Display -> GC -> Font -> IO () -- | interface to the X11 library function @XSetLineAttributes()@. foreign import ccall unsafe "HsXlib.h XSetLineAttributes" setLineAttributes :: Display -> GC -> Int -> LineStyle -> CapStyle -> JoinStyle -> IO () -- | interface to the X11 library function @XSetPlaneMask()@. foreign import ccall unsafe "HsXlib.h XSetPlaneMask" setPlaneMask :: Display -> GC -> Pixel -> IO () -- | interface to the X11 library function @XSetState()@. foreign import ccall unsafe "HsXlib.h XSetState" setState :: Display -> GC -> Pixel -> Pixel -> GXFunction -> Pixel -> IO () -- | interface to the X11 library function @XSetStipple()@. foreign import ccall unsafe "HsXlib.h XSetStipple" setStipple :: Display -> GC -> Pixmap -> IO () -- | interface to the X11 library function @XSetSubwindowMode()@. foreign import ccall unsafe "HsXlib.h XSetSubwindowMode" setSubwindowMode :: Display -> GC -> SubWindowMode -> IO () -- | interface to the X11 library function @XSetTSOrigin()@. foreign import ccall unsafe "HsXlib.h XSetTSOrigin" setTSOrigin :: Display -> GC -> Position -> Position -> IO () -- | interface to the X11 library function @XSetTile()@. foreign import ccall unsafe "HsXlib.h XSetTile" setTile :: Display -> GC -> Pixmap -> IO () -- ToDo: create a real interface to this -- | partial interface to the X11 library function @XCreateGC()@. createGC :: Display -> Drawable -> IO GC createGC display d = xCreateGC display d 0 nullPtr foreign import ccall unsafe "HsXlib.h XCreateGC" xCreateGC :: Display -> Drawable -> ValueMask -> Ptr GCValues -> IO GC type ValueMask = Word32 -- OLD: -- %synonym : GCValueSet : Ptr -- in rtsDummy -- -- {% -- typedef unsigned long GCMask; /* cf XtGCMask */ -- typedef struct _gcvalues { -- GCMask mask; -- XGCValues values; -- }* GCValueSet; -- %} -- -- IMPURE GCValueSet emptyGCValueSet() -- RESULT: (RETVAL = (GCValueSet) malloc(sizeof(struct _gcvalues))) ? RETVAL->mask = 0, RETVAL : RETVAL; -- POST: RETVAL != NULL -- -- IMPURE void setGCForeground(colour, set) -- IN Pixel colour -- IN GCValueSet set -- RESULT: set->mask |= GCForeground; set->values.foreground = colour -- -- IMPURE void setGCBackground(colour, set) -- IN Pixel colour -- IN GCValueSet set -- RESULT: set->mask |= GCBackground; set->values.background = colour -- -- IMPURE void freeGCValueSet(set) -- IN GCValueSet set -- RESULT: free(set) -- -- IMPURE GC XCreateGC(display, d, set->mask, &(set->values)) -- NAME: xCreateGC -- IN Display* display -- IN Drawable d -- IN GCValueSet set -- -- IMPURE void XChangeGC(display, gc, set->mask, &(set->values)) -- NAME: xChangeGC -- IN Display* display -- IN GC gc -- IN GCValueSet set -- -- STARTH -- -- Code that packages GCValueSets up in a clean monoidic way. -- -- data GCSetter = GCSetter (GCValueSet -> IO ()) -- should be newtype -- -- createGC :: Display -> Drawable -> GCSetter -> IO GC -- createGC display d (GCSetter setter) = -- emptyGCValueSet >>= \ set -> -- setter set >> -- xCreateGC display d set >>= \ gc -> -- freeGCValueSet set >> -- return gc -- -- changeGC :: Display -> Drawable -> GC -> GCSetter -> IO () -- changeGC display d gc (GCSetter setter) = -- emptyGCValueSet >>= \ set -> -- setter set >> -- xChangeGC display d set >>= \ gc -> -- freeGCValueSet set -- -- instance Monoid GCSetter where -- (GCSetter m) >>> (GCSetter k) -- = GCSetter (\ settings -> m settings >> k settings) -- unit = GCSetter (\ _ -> return ()) -- -- set_Background :: Pixel -> GCSetter -- set_Background c = GCSetter (setGCBackground c) -- -- set_Foreground :: Pixel -> GCSetter -- set_Foreground c = GCSetter (setGCForeground c) -- ENDH -- | interface to the X11 library function @XGContextFromGC()@. foreign import ccall unsafe "HsXlib.h XGContextFromGC" gContextFromGC :: GC -> GContext -- | interface to the X11 library function @XFreeGC()@. foreign import ccall unsafe "HsXlib.h XFreeGC" freeGC :: Display -> GC -> IO () -- | interface to the X11 library function @XFlushGC()@. foreign import ccall unsafe "HsXlib.h XFlushGC" flushGC :: Display -> GC -> IO () -- | interface to the X11 library function @XCopyGC()@. foreign import ccall unsafe "HsXlib.h XCopyGC" copyGC :: Display -> GC -> Mask -> GC -> IO () ---------------------------------------------------------------- -- End ----------------------------------------------------------------
FranklinChen/hugs98-plus-Sep2006
packages/X11/Graphics/X11/Xlib/Context.hs
bsd-3-clause
8,228
62
13
1,830
1,134
656
478
83
1
{-#LANGUAGE OverloadedStrings #-} -- | This module replicates `pipes-http` as closely as will type-check, adding a -- conduit-like @http@ in @ResourceT@ and a primitive @simpleHTTP@ that emits -- a streaming bytestring rather than a lazy one. -- -- -- Here is an example GET request that streams the response body to standard output: -- -- > import qualified Data.ByteString.Streaming as Q -- > import Data.ByteString.Streaming.HTTP -- > -- > main = do -- > req <- parseRequest "https://www.example.com" -- > m <- newManager tlsManagerSettings -- > withHTTP req m $ \resp -> Q.stdout (responseBody resp) -- > -- -- Here is an example POST request that also streams the request body from -- standard input: -- -- > {-#LANGUAGE OverloadedStrings #-} -- > import qualified Data.ByteString.Streaming as Q -- > import Data.ByteString.Streaming.HTTP -- > -- > main = do -- > req <- parseRequest "https://httpbin.org/post" -- > let req' = req -- > { method = "POST" -- > , requestBody = stream Q.stdin -- > } -- > m <- newManager tlsManagerSettings -- > withHTTP req' m $ \resp -> Q.stdout (responseBody resp) -- -- Here is the GET request modified to use @http@ and write to a file. @runResourceT@ -- manages the file handle and the interaction. -- -- > import qualified Data.ByteString.Streaming as Q -- > import Data.ByteString.Streaming.HTTP -- > -- > main = do -- > req <- parseUrl "https://www.example.com" -- > m <- newManager tlsManagerSettings -- > runResourceT $ do -- > resp <- http request manager -- > Q.writeFile "example.html" (responseBody resp) -- -- -- @simpleHTTP@ can be used in @ghci@ like so: -- -- > ghci> runResourceT $ Q.stdout $ Q.take 137 $ simpleHTTP "http://lpaste.net/raw/13" -- > -- Adaptation and extension of a parser for data definitions given in -- > -- appendix of G. Huttons's paper - Monadic Parser Combinators. -- > -- -- For non-streaming request bodies, study the 'RequestBody' type, which also -- accepts strict \/ lazy bytestrings or builders. module Data.ByteString.Streaming.HTTP ( -- * Streaming Interface withHTTP , http , streamN , stream -- * ghci testing , simpleHTTP -- * re-exports , module Network.HTTP.Client , module Network.HTTP.Client.TLS , ResourceT (..) , MonadResource (..) , runResourceT ) where import Control.Monad (unless) import qualified Data.ByteString as B import Data.Int (Int64) import Data.IORef (newIORef, readIORef, writeIORef) import Network.HTTP.Client import Network.HTTP.Client.TLS import Data.ByteString.Streaming import Data.ByteString.Streaming.Internal import Control.Monad.Trans import Control.Monad.Trans.Resource import qualified Data.ByteString.Streaming.Char8 as Q {- $httpclient This module is a thin @streaming-bytestring@ wrapper around the @http-client@ and @http-client-tls@ libraries. Read the documentation in the "Network.HTTP.Client" module of the @http-client@ library to learn about how to: * manage connections using connection pooling, * use more advanced request\/response features, * handle exceptions, and: * manage cookies. @http-client-tls@ provides support for TLS connections (i.e. HTTPS). -} -- | Send an HTTP 'Request' and wait for an HTTP 'Response' withHTTP :: Request -- ^ -> Manager -- ^ -> (Response (ByteString IO ()) -> IO a) -- ^ Handler for response -> IO a withHTTP r m k = withResponse r m k' where k' resp = do let p = (from . brRead . responseBody) resp k (resp { responseBody = p}) {-# INLINABLE withHTTP #-} -- | Create a 'RequestBody' from a content length and an effectful 'ByteString' streamN :: Int64 -> ByteString IO () -> RequestBody streamN n p = RequestBodyStream n (to p) {-# INLINABLE streamN #-} {-| Create a 'RequestBody' from an effectful 'ByteString' 'stream' is more flexible than 'streamN', but requires the server to support chunked transfer encoding. -} stream :: ByteString IO () -> RequestBody stream p = RequestBodyStreamChunked (to p) {-# INLINABLE stream #-} to :: ByteString IO () -> (IO B.ByteString -> IO ()) -> IO () to p0 k = do ioref <- newIORef p0 let readAction :: IO B.ByteString readAction = do p <- readIORef ioref case p of Empty () -> do writeIORef ioref (return ()) return B.empty Go m -> do p' <- m writeIORef ioref p' readAction Chunk bs p' -> do writeIORef ioref p' return bs k readAction -- from :: IO B.ByteString -> ByteString IO () from io = go where go = do bs <- lift io unless (B.null bs) $ do chunk bs go {-| This is a quick method - oleg would call it \'unprofessional\' - to bring a web page in view. It sparks its own internal manager and closes itself. Thus something like this makes sense >>> runResourceT $ Q.putStrLn $ simpleHttp "http://lpaste.net/raw/12" chunk _ [] = [] chunk n xs = let h = take n xs in h : (chunk n (drop n xs)) but if you try something like >>> rest <- runResourceT $ Q.putStrLn $ Q.splitAt 40 $ simpleHTTP "http://lpaste.net/raw/146532" import Data.ByteString.Streaming.HTTP it will just be good luck if with >>> runResourceT $ Q.putStrLn rest you get the rest of the file: > import qualified Data.ByteString.Streaming.Char8 as Q > main = runResourceT $ Q.putStrLn $ simpleHTTP "http://lpaste.net/raw/146532" rather than > *** Exception: <socket: 13>: hGetBuf: illegal operation (handle is closed) Since, of course, the handle was already closed by the first use of @runResourceT@. The same applies of course to the more hygienic 'withHTTP' above, which permits one to extract an @IO (ByteString IO r)@, by using @splitAt@ or the like. The reaction of some streaming-io libraries was simply to forbid operations like @splitAt@. That this paternalism was not viewed as simply outrageous is a consequence of the opacity of the older iteratee-io libraries. It is /obvious/ that I can no more run an effectful bytestring after I have made its effects impossible by using @runResourceT@ (which basically means @closeEverythingDown@). I might as well try to run it after tossing my machine into the flames. Similarly, it is obvious that I cannot read from a handle after I have applied @hClose@; there is simply no difference between the two cases. -} simpleHTTP :: MonadResource m => String -> ByteString m () simpleHTTP url = do man <- liftIO (newManager tlsManagerSettings) req <- liftIO (parseUrl url) bracketByteString (responseOpen req man) responseClose ( from . liftIO . responseBody) http :: MonadResource m => Request -> Manager -> m (Response (ByteString m ())) http req man = do (key, res) <- allocate (responseOpen req man) responseClose return res {responseBody = from (liftIO (responseBody res))}
michaelt/streaming-utils
Data/ByteString/Streaming/HTTP.hs
bsd-3-clause
7,323
0
20
1,873
845
464
381
75
3
module LiveCoding where stops = "pbtdkg" vowels = "aeiou" allStopVowelStop stops vowels = [[s, v, s'] | s <- stops, s == 'p', v <- vowels, s' <- stops] seekritFunc :: Fractional a => String -> a seekritFunc x = let blah = fromIntegral . length in (/) (sum (map blah (words x))) (blah (words x)) myOr :: [Bool] -> Bool myOr = foldr (||) False myAny :: (a -> Bool) -> [a] -> Bool myAny = (myOr .) . map blah = (\g -> ((\f -> myOr . f) . map) g) myElem :: Eq a => a -> [a] -> Bool myElem = myAny . (==) myReverse :: [a] -> [a] myReverse = foldl (flip (:)) [] myMap :: (a -> b) -> [a] -> [b] myMap f = foldr ((:) . f) [] myMap' :: (a -> b) -> [a] -> [b] myMap' = flip foldr [] . ((:) .) myFilter :: (a -> Bool) -> [a] -> [a] myFilter p = let if' p x = if p x then (x:) else id in foldr (if' p) [] myFilter' :: (a -> Bool) -> [a] -> [a] myFilter' = myFilter squish :: [[a]] -> [a] squish = foldr (++) [] squishMap :: (a -> [b]) -> [a] -> [b] squishMap = (squish .) . myMap squishAgain :: [[a]] -> [a] squishAgain = squishMap id myMaximumBy :: (a -> a -> Ordering) -> [a] -> a myMaximumBy cmp = foldr1 (\x y -> if cmp x y == GT then x else y)
taojang/haskell-programming-book-exercise
src/ch10/LiveCoding.hs
bsd-3-clause
1,172
0
13
291
682
380
302
35
2
module JDec.Class.Parse.ParseAttribute ( deserializeAttribute ) where import JDec.Class.Raw.Attribute (Attribute(ConstantValueAttribute, SyntheticAttribute, SignatureAttribute, DeprecatedAttribute, EnclosingMethodAttribute, SourceFileAttribute, StackMapTableAttribute, ExceptionsAttribute, CodeAttribute, InnerClassesAttribute, SourceDebugExtensionAttribute, LineNumberTableAttribute, LocalVariableTableAttribute, LocalVariableTypeTableAttribute, RuntimeVisibleAnnotationsAttribute, RuntimeInvisibleAnnotationsAttribute, RuntimeVisibleParameterAnnotationsAttribute, RuntimeInvisibleParameterAnnotationsAttribute, AnnotationDefaultAttribute, BootstrapMethodsAttribute)) import JDec.Class.Raw.ConstantPoolIndex(ConstantPoolIndex(ConstantPoolIndex)) import JDec.Class.Raw.ConstantPoolEntry (ConstantPoolEntry(UTF8ConstantPoolEntry)) import JDec.Class.Raw.StackMapFrame (StackMapFrame(SameFrame, SameLocalsOneStackItemFrame, SameLocalsOneStackItemFrameExtended, ChopFrame, SameFrameExtended, AppendFrame, FullFrame)) import JDec.Class.Raw.VerificationTypeInfo (VerificationTypeInfo(TopVariableInfo, IntegerVariableInfo, FloatVariableInfo, LongVariableInfo, DoubleVariableInfo, NullVariableInfo, UninitializedThisVariableInfo, ObjectVariableInfo, UninitializedVariableInfo)) import JDec.Class.Raw.ExceptionHandlerInfo (ExceptionHandlerInfo(ExceptionHandlerInfo)) import JDec.Class.Raw.InnerClassInfo (InnerClassInfo(InnerClassInfo)) import JDec.Class.Raw.InnerClassModifier (InnerClassModifier(PublicInnerClassModifier, PrivateInnerClassModifier, ProtectedInnerClassModifier, StaticInnerClassModifier, FinalInnerClassModifier, InterfaceInnerClassModifier, AbstractInnerClassModifier, SyntheticInnerClassModifier, AnnotationInnerClassModifier, EnumInnerClassModifier)) import JDec.Class.Parse.ParseEncodedString (parseString) import JDec.Class.Raw.LineNumberInfo (LineNumberInfo(LineNumberInfo)) import JDec.Class.Raw.LocalVariableInfo (LocalVariableInfo(LocalVariableInfo)) import JDec.Class.Raw.LocalVariableTypeInfo (LocalVariableTypeInfo(LocalVariableTypeInfo)) import JDec.Class.Parse.ParseAnnotation(deserializeAnnotation, deserializeAnnotationElementValue) import JDec.Class.Raw.BootstrapMethodInfo (BootstrapMethodInfo(BootstrapMethodInfo)) import JDec.Class.Parse.ParseBytecode (deserializeBytecode) import Data.Binary.Get(Get, getWord16be, getWord32be, getLazyByteString, runGet, getWord8) import Data.Map as Map (Map, lookup) import Data.Text (unpack) import Data.Int(Int64) import Data.Word(Word16) import Control.Monad(when, void, replicateM) import Data.Maybe(catMaybes) import Data.Set as Set (empty, insert) import Data.Bits ((.&.)) -- | Deserialize one attribute deserializeAttribute :: Map ConstantPoolIndex ConstantPoolEntry -- ^ Constant pool -> Get (Maybe Attribute) -- ^ Attribute, if any deserializeAttribute constantPool = do nameIndex <- getWord16be attributeLength <- getWord32be parseAttribute constantPool (ConstantPoolIndex (toInteger nameIndex)) (fromIntegral attributeLength) -- | Parse attribute-specific data parseAttribute :: Map ConstantPoolIndex ConstantPoolEntry -- ^ Constant pool -> ConstantPoolIndex -- ^ Attribute name index -> Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseAttribute constantPool nameIndex attributeLength = case Map.lookup nameIndex constantPool of Just entry -> case entry of UTF8ConstantPoolEntry t -> case (unpack t) of "ConstantValue" -> if attributeLength >= 2 then parseConstantValue attributeLength else skipAttribute attributeLength "Synthetic" -> parseSynthetic attributeLength "Signature" -> if attributeLength >= 2 then parseSignatureValue attributeLength else skipAttribute attributeLength "Deprecated" -> parseDeprecated attributeLength "EnclosingMethod" -> if attributeLength >= 4 then parseEnclosingMethod attributeLength else skipAttribute attributeLength "SourceFile" -> if attributeLength >= 2 then parseSourceFile attributeLength else skipAttribute attributeLength "StackMapTable" -> parseStackMapTable attributeLength "Exceptions" -> parseExceptions attributeLength "Code" -> parseCode attributeLength constantPool "InnerClasses" -> parseInnerClasses attributeLength "SourceDebugExtension" -> parseSourceDebugExtension attributeLength "LineNumberTable" -> parseLineNumberTable attributeLength "LocalVariableTable" -> parseLocalVariableTable attributeLength "LocalVariableTypeTable" -> parseLocalVariableTypeTable attributeLength "RuntimeVisibleAnnotations" -> parseRuntimeVisibleAnnotations attributeLength "RuntimeInvisibleAnnotations" -> parseRuntimeInvisibleAnnotations attributeLength "RuntimeVisibleParameterAnnotations" -> parseRuntimeVisibleParameterAnnotations attributeLength "RuntimeInvisibleParameterAnnotations" -> parseRuntimeInvisibleParameterAnnotations attributeLength "AnnotationDefault" -> parseAnnotationDefault attributeLength "BootstrapMethods" -> parseBootstrapMethods attributeLength _ -> skipAttribute attributeLength _ -> skipAttribute attributeLength Nothing -> skipAttribute attributeLength -- | Parse constant value attribute-specific data parseConstantValue :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseConstantValue attributeLength = do constantIndex <- getWord16be when (attributeLength > 2) (void (getLazyByteString (attributeLength - 2))) return $! Just (ConstantValueAttribute (ConstantPoolIndex (toInteger constantIndex))) -- | Parse synthetic attribute-specific data parseSynthetic :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseSynthetic attributeLength = do when (attributeLength > 0) (void (getLazyByteString attributeLength)) return $! Just SyntheticAttribute -- | Parse signature attribute-specific data parseSignatureValue :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseSignatureValue attributeLength = do signatureIndex <- getWord16be when (attributeLength > 2) (void (getLazyByteString (attributeLength - 2))) return $! Just (SignatureAttribute (ConstantPoolIndex (toInteger signatureIndex))) -- | Parse deprecated attribute-specific data parseDeprecated :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseDeprecated attributeLength = do when (attributeLength > 0) (void (getLazyByteString attributeLength)) return $! Just DeprecatedAttribute -- | Parse enclosing method attribute-specific data parseEnclosingMethod :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseEnclosingMethod attributeLength = do classIndex <- getWord16be methodIndex <- getWord16be when (attributeLength > 4) (void (getLazyByteString (attributeLength - 4))) return $! Just (EnclosingMethodAttribute (ConstantPoolIndex (toInteger classIndex)) (ConstantPoolIndex (toInteger methodIndex))) -- | Parse source file attribute-specific data parseSourceFile :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseSourceFile attributeLength = do sourceFileIndex <- getWord16be when (attributeLength > 2) (void (getLazyByteString (attributeLength - 2))) return $! Just (SourceFileAttribute (ConstantPoolIndex (toInteger sourceFileIndex))) -- | Parse stack map table attribute-specific data parseStackMapTable :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseStackMapTable attributeLength = fmap (runGet deserializeStackMapTable) (getLazyByteString attributeLength) where deserializeStackMapTable = do entriesCount <- getWord16be frames <- replicateM (fromIntegral entriesCount) deserializeFrame return $! Just (StackMapTableAttribute frames) deserializeFrame = do tag <- getWord8 parseFrame tag parseFrame tag | tag >= 0 && tag <= 63 = return $! SameFrame (toInteger tag) | tag >= 64 && tag <= 127 = do verificationTypeInfo <- deserializeVerificationTypeInfo return $! SameLocalsOneStackItemFrame (toInteger (tag - 64)) verificationTypeInfo | tag == 247 = do offsetDelta <- getWord16be verificationTypeInfo <- deserializeVerificationTypeInfo return $! SameLocalsOneStackItemFrameExtended (toInteger offsetDelta) verificationTypeInfo | tag >= 248 && tag <= 250 = do offsetDelta <- getWord16be return $! ChopFrame (toInteger (251 - tag)) (toInteger offsetDelta) | tag == 251 = do offsetDelta <- getWord16be return $! SameFrameExtended (toInteger offsetDelta) | tag >= 252 && tag <= 254 = do offsetDelta <- getWord16be locals <- replicateM (fromIntegral (tag - 251)) deserializeVerificationTypeInfo return $! AppendFrame (toInteger offsetDelta) locals | tag == 255 = do offsetDelta <- getWord16be numberOfLocals <- getWord16be locals <- replicateM (fromIntegral numberOfLocals) deserializeVerificationTypeInfo numberOfStackItems <- getWord16be stack <- replicateM (fromIntegral numberOfStackItems) deserializeVerificationTypeInfo return $! FullFrame (toInteger offsetDelta) locals stack | otherwise = fail ("Unknown frame type " ++ (show tag)) deserializeVerificationTypeInfo = do typeTag <- getWord8 case typeTag of 0 -> return $! TopVariableInfo 1 -> return $! IntegerVariableInfo 2 -> return $! FloatVariableInfo 3 -> return $! DoubleVariableInfo 4 -> return $! LongVariableInfo 5 -> return $! NullVariableInfo 6 -> return $! UninitializedThisVariableInfo 7 -> do classIndex <- getWord16be return $! ObjectVariableInfo (ConstantPoolIndex (toInteger classIndex)) 8 -> do codeOffset <- getWord16be return $! UninitializedVariableInfo (toInteger codeOffset) _ -> fail ("Unknown variable info type " ++ (show typeTag)) -- | Parse exceptions attribute-specific data parseExceptions :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseExceptions attributeLength = fmap (runGet deserializeExceptions) (getLazyByteString attributeLength) where deserializeExceptions = do exceptionsCount <- getWord16be exceptionIndexes <- replicateM (fromIntegral exceptionsCount) (fmap (ConstantPoolIndex . toInteger) (getWord16be)) return $! Just (ExceptionsAttribute exceptionIndexes) -- | Parse code attribute-specific data parseCode :: Int64 -- ^ Attribute length -> Map ConstantPoolIndex ConstantPoolEntry -- ^ Constant pool -> Get (Maybe Attribute) -- ^ Attribute, if any parseCode attributeLength constantPool = fmap (runGet deserializeCode) (getLazyByteString attributeLength) where deserializeCode = do maxStack <- getWord16be maxLocals <- getWord16be codeLength <- getWord32be instructions <- fmap (runGet deserializeBytecode) (getLazyByteString (fromIntegral codeLength)) exceptionHandlersCount <- getWord16be exceptionHandlers <- replicateM (fromIntegral exceptionHandlersCount) deserializeExceptionHandlerInfo attributesCount <- getWord16be attributes <- replicateM (fromIntegral attributesCount) (deserializeAttribute constantPool) return $! Just (CodeAttribute (fromIntegral maxStack) (fromIntegral maxLocals) instructions exceptionHandlers (catMaybes attributes)) deserializeExceptionHandlerInfo = do startPC <- getWord16be endPC <- getWord16be handlerPC <- getWord16be catchTypeIndex <- getWord16be return $! ExceptionHandlerInfo (toInteger startPC) (toInteger endPC) (toInteger handlerPC) (ConstantPoolIndex (toInteger catchTypeIndex)) -- | Parse inner classes attribute-specific data parseInnerClasses :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseInnerClasses attributeLength = fmap (runGet deserializeInnerClasses) (getLazyByteString attributeLength) where deserializeInnerClasses = do classesCount <- getWord16be innerClasses <- replicateM (fromIntegral classesCount) deserializeInnerClassInfo return $! Just (InnerClassesAttribute innerClasses) deserializeInnerClassInfo = do innerClassInfoIndex <- getWord16be outerClassInfoIndex <- getWord16be innerNameIndex <- getWord16be innerClassAccessFlags <- getWord16be return $! InnerClassInfo (ConstantPoolIndex (toInteger innerClassInfoIndex)) (ConstantPoolIndex (toInteger outerClassInfoIndex)) (ConstantPoolIndex (toInteger innerNameIndex)) (deserializeInnerClassAccessFlags innerClassAccessFlags) deserializeInnerClassAccessFlags word = foldl (\s (x,y) -> if ((word .&. y) /= (0x0000 :: Word16)) then Set.insert x s else s) (Set.empty) [(PublicInnerClassModifier, 0x0001 :: Word16), (PrivateInnerClassModifier, 0x0002 :: Word16), (ProtectedInnerClassModifier, 0x0004 :: Word16), (StaticInnerClassModifier, 0x0008 :: Word16), (FinalInnerClassModifier, 0x0010 :: Word16), (InterfaceInnerClassModifier, 0x0200 :: Word16), (AbstractInnerClassModifier, 0x0400 :: Word16), (SyntheticInnerClassModifier, 0x1000 :: Word16), (AnnotationInnerClassModifier, 0x2000 :: Word16), (EnumInnerClassModifier, 0x4000 :: Word16)] -- | Parse source debug extension attribute-specific data parseSourceDebugExtension :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseSourceDebugExtension attributeLength = do bytes <- getLazyByteString attributeLength return $! Just (SourceDebugExtensionAttribute (parseString bytes)) -- | Parse line number table attribute-specific data parseLineNumberTable :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseLineNumberTable attributeLength = fmap (runGet deserializeLineNumberTable) (getLazyByteString attributeLength) where deserializeLineNumberTable = do entriesCount <- getWord16be entries <- replicateM (fromIntegral entriesCount) deserializeLineNumberInfo return $! Just (LineNumberTableAttribute entries) deserializeLineNumberInfo = do startPC <- getWord16be lineNumber <- getWord16be return $! LineNumberInfo (toInteger startPC) (toInteger lineNumber) -- | Parse local variable table attribute-specific data parseLocalVariableTable :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseLocalVariableTable attributeLength = fmap (runGet deserializeLocalVaribleTable) (getLazyByteString attributeLength) where deserializeLocalVaribleTable = do entriesCount <- getWord16be entries <- replicateM (fromIntegral entriesCount) deserializeLocalVaribleInfo return $! Just (LocalVariableTableAttribute entries) deserializeLocalVaribleInfo = do localVariableStartPC <- getWord16be localVariableLength <- getWord16be localVariableNameIndex <- getWord16be localVariableDescriptorIndex <- getWord16be localVariableIndex <- getWord16be return $! LocalVariableInfo (toInteger localVariableStartPC) (toInteger localVariableLength) (ConstantPoolIndex (toInteger localVariableNameIndex)) (ConstantPoolIndex (toInteger localVariableDescriptorIndex)) (toInteger localVariableIndex) -- | Parse local variable type table attribute-specific data parseLocalVariableTypeTable :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseLocalVariableTypeTable attributeLength = fmap (runGet deserializeLocalVaribleTypeTable) (getLazyByteString attributeLength) where deserializeLocalVaribleTypeTable = do entriesCount <- getWord16be entries <- replicateM (fromIntegral entriesCount) deserializeLocalVaribleTypeInfo return $! Just (LocalVariableTypeTableAttribute entries) deserializeLocalVaribleTypeInfo = do localVariableStartPC <- getWord16be localVariableLength <- getWord16be localVariableNameIndex <- getWord16be localVariableSignatureIndex <- getWord16be localVariableIndex <- getWord16be return $! LocalVariableTypeInfo (toInteger localVariableStartPC) (toInteger localVariableLength) (ConstantPoolIndex (toInteger localVariableNameIndex)) (ConstantPoolIndex (toInteger localVariableSignatureIndex)) (toInteger localVariableIndex) -- | Parse runtime visible annotations attribute-specific data parseRuntimeVisibleAnnotations :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseRuntimeVisibleAnnotations attributeLength = fmap (runGet deserializeRuntimeVisibleAnnotations) (getLazyByteString attributeLength) where deserializeRuntimeVisibleAnnotations = do annotationsCount <- getWord16be annotations <- replicateM (fromIntegral annotationsCount) deserializeAnnotation return $! Just (RuntimeVisibleAnnotationsAttribute annotations) -- | Parse runtime invisible annotations attribute-specific data parseRuntimeInvisibleAnnotations :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseRuntimeInvisibleAnnotations attributeLength = fmap (runGet deserializeRuntimeInvisibleAnnotations) (getLazyByteString attributeLength) where deserializeRuntimeInvisibleAnnotations = do annotationsCount <- getWord16be annotations <- replicateM (fromIntegral annotationsCount) deserializeAnnotation return $! Just (RuntimeInvisibleAnnotationsAttribute annotations) -- | Parse runtime visible parameter annotations attribute-specific data parseRuntimeVisibleParameterAnnotations :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseRuntimeVisibleParameterAnnotations attributeLength = fmap (runGet deserializeRuntimeVisibleAllParametersAnnotations) (getLazyByteString attributeLength) where deserializeRuntimeVisibleAllParametersAnnotations = do numParameters <- getWord8 annotationsForParameters <- replicateM (fromIntegral numParameters) deserializeRuntimeVisibleOneParameterAnnotations return $! Just (RuntimeVisibleParameterAnnotationsAttribute annotationsForParameters) deserializeRuntimeVisibleOneParameterAnnotations = do annotationsCount <- getWord16be replicateM (fromIntegral annotationsCount) deserializeAnnotation -- | Parse runtime invisible parameter annotations attribute-specific data parseRuntimeInvisibleParameterAnnotations :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseRuntimeInvisibleParameterAnnotations attributeLength = fmap (runGet deserializeRuntimeInvisibleAllParametersAnnotations) (getLazyByteString attributeLength) where deserializeRuntimeInvisibleAllParametersAnnotations = do numParameters <- getWord8 annotationsForParameters <- replicateM (fromIntegral numParameters) deserializeRuntimeInvisibleOneParameterAnnotations return $! Just (RuntimeInvisibleParameterAnnotationsAttribute annotationsForParameters) deserializeRuntimeInvisibleOneParameterAnnotations = do annotationsCount <- getWord16be replicateM (fromIntegral annotationsCount) deserializeAnnotation -- | Parse annotation default attribute-specific data parseAnnotationDefault :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseAnnotationDefault attributeLength = fmap (runGet deserializeAnnotationDefault) (getLazyByteString attributeLength) where deserializeAnnotationDefault = do defaultValue <- deserializeAnnotationElementValue return $! Just (AnnotationDefaultAttribute defaultValue) -- | Parse bootstrap methods attribute-specific data parseBootstrapMethods :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Attribute, if any parseBootstrapMethods attributeLength = fmap (runGet deserializeBootstrapMethods) (getLazyByteString attributeLength) where deserializeBootstrapMethods = do bootstrapMethodsCount <- getWord16be bootstrapMethods <- replicateM (fromIntegral bootstrapMethodsCount) deserializeBootstrapMethodInfo return $! Just (BootstrapMethodsAttribute bootstrapMethods) deserializeBootstrapMethodInfo = do bootstrapMethodRef <- getWord16be argumentsCount <- getWord16be bootstrapArguments <- replicateM (fromIntegral argumentsCount) (fmap (ConstantPoolIndex . toInteger) (getWord16be)) return $! BootstrapMethodInfo (ConstantPoolIndex (toInteger bootstrapMethodRef)) bootstrapArguments -- | Skip attribute skipAttribute :: Int64 -- ^ Attribute length -> Get (Maybe Attribute) -- ^ Nothing skipAttribute attributeLength = do _ <- getLazyByteString attributeLength return $! Nothing
rel-eng/jdec
src/JDec/Class/Parse/ParseAttribute.hs
bsd-3-clause
20,909
0
19
3,225
4,228
2,179
2,049
309
27
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.ARB.VertexBlend -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <[email protected]> -- Stability : stable -- Portability : portable -- -------------------------------------------------------------------------------- module Graphics.GL.ARB.VertexBlend ( -- * Extension Support glGetARBVertexBlend, gl_ARB_vertex_blend, -- * Enums pattern GL_ACTIVE_VERTEX_UNITS_ARB, pattern GL_CURRENT_WEIGHT_ARB, pattern GL_MAX_VERTEX_UNITS_ARB, pattern GL_MODELVIEW0_ARB, pattern GL_MODELVIEW10_ARB, pattern GL_MODELVIEW11_ARB, pattern GL_MODELVIEW12_ARB, pattern GL_MODELVIEW13_ARB, pattern GL_MODELVIEW14_ARB, pattern GL_MODELVIEW15_ARB, pattern GL_MODELVIEW16_ARB, pattern GL_MODELVIEW17_ARB, pattern GL_MODELVIEW18_ARB, pattern GL_MODELVIEW19_ARB, pattern GL_MODELVIEW1_ARB, pattern GL_MODELVIEW20_ARB, pattern GL_MODELVIEW21_ARB, pattern GL_MODELVIEW22_ARB, pattern GL_MODELVIEW23_ARB, pattern GL_MODELVIEW24_ARB, pattern GL_MODELVIEW25_ARB, pattern GL_MODELVIEW26_ARB, pattern GL_MODELVIEW27_ARB, pattern GL_MODELVIEW28_ARB, pattern GL_MODELVIEW29_ARB, pattern GL_MODELVIEW2_ARB, pattern GL_MODELVIEW30_ARB, pattern GL_MODELVIEW31_ARB, pattern GL_MODELVIEW3_ARB, pattern GL_MODELVIEW4_ARB, pattern GL_MODELVIEW5_ARB, pattern GL_MODELVIEW6_ARB, pattern GL_MODELVIEW7_ARB, pattern GL_MODELVIEW8_ARB, pattern GL_MODELVIEW9_ARB, pattern GL_VERTEX_BLEND_ARB, pattern GL_WEIGHT_ARRAY_ARB, pattern GL_WEIGHT_ARRAY_POINTER_ARB, pattern GL_WEIGHT_ARRAY_SIZE_ARB, pattern GL_WEIGHT_ARRAY_STRIDE_ARB, pattern GL_WEIGHT_ARRAY_TYPE_ARB, pattern GL_WEIGHT_SUM_UNITY_ARB, -- * Functions glVertexBlendARB, glWeightPointerARB, glWeightbvARB, glWeightdvARB, glWeightfvARB, glWeightivARB, glWeightsvARB, glWeightubvARB, glWeightuivARB, glWeightusvARB ) where import Graphics.GL.ExtensionPredicates import Graphics.GL.Tokens import Graphics.GL.Functions
haskell-opengl/OpenGLRaw
src/Graphics/GL/ARB/VertexBlend.hs
bsd-3-clause
2,140
0
5
292
289
184
105
59
0
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. {-# LANGUAGE OverloadedStrings #-} module Duckling.Ordinal.HR.Corpus ( corpus ) where import Prelude import Data.String import Duckling.Lang import Duckling.Ordinal.Types import Duckling.Resolve import Duckling.Testing.Types corpus :: Corpus corpus = (testContext {lang = HR}, allExamples) allExamples :: [Example] allExamples = concat [ examples (OrdinalData 3) [ "3." , "trece" , "treći" , "trećeg" ] , examples (OrdinalData 4) [ "4." , "4ti" , "4ta" , "četvrti" , "četvrta" , "četvrto" , "cetvrti" , "cetvrta" , "cetvrto" ] , examples (OrdinalData 6) [ "6." , "6ti" , "šesto" , "šestoga" , "sestog" ] ]
rfranek/duckling
Duckling/Ordinal/HR/Corpus.hs
bsd-3-clause
1,203
0
9
432
186
116
70
34
1
module Module4.Task4 where -- system code data LogLevel = Error | Warning | Info -- solution code cmp :: LogLevel -> LogLevel -> Ordering cmp a b = compare (i a) (i b) where i Error = 2 i Warning = 1 i Info = 0
dstarcev/stepic-haskell
src/Module4/Task4.hs
bsd-3-clause
230
0
7
65
87
47
40
7
3
module Internal.Mips.Default where import Foreign import Foreign.C.Types import Hapstone.Internal.Mips import Test.QuickCheck import Test.QuickCheck.Instances -- generators for our datatypes instance Arbitrary MipsOpType where arbitrary = elements [minBound..maxBound] instance Arbitrary MipsOpMemStruct where arbitrary = MipsOpMemStruct <$> arbitrary <*> arbitrary instance Arbitrary CsMipsOp where arbitrary = oneof [ Reg <$> arbitrary , Imm <$> arbitrary , Mem <$> arbitrary , pure Undefined ] instance Arbitrary CsMips where arbitrary = CsMips <$> (take 8 <$> arbitrary) instance Arbitrary MipsReg where arbitrary = elements [minBound..maxBound] instance Arbitrary MipsInsn where arbitrary = elements [minBound..maxBound] instance Arbitrary MipsInsnGroup where arbitrary = elements [minBound..maxBound]
ibabushkin/hapstone
test/Internal/Mips/Default.hs
bsd-3-clause
886
0
9
175
209
115
94
24
0
{-# LANGUAGE TypeOperators , KindSignatures , DataKinds , TypeFamilies , GADTs , FlexibleInstances , NoImplicitPrelude , ScopedTypeVariables , FlexibleContexts , Rank2Types #-} {-# OPTIONS_GHC -Wall -fwarn-tabs #-} ---------------------------------------------------------------- -- 2016.04.22 -- | -- Module : Language.Hakaru.Syntax.Prelude -- Copyright : Copyright (c) 2016 the Hakaru team -- License : BSD3 -- Maintainer : [email protected] -- Stability : experimental -- Portability : GHC-only -- -- A replacement for Haskell's Prelude, using the familiar symbols -- in order to construct 'AST's and 'ABT's. This is only necessary -- if we want to use Hakaru as an embedded language in Haskell, but -- it also provides some examples of how to use the infrastructure. -- -- TODO: is there a way to get rid of the need to specify @'[]@ everywhere in here? Some sort of distinction between the Var vs the Open parts of View? ---------------------------------------------------------------- module Language.Hakaru.Syntax.Prelude ( -- * Basic syntax -- ** Types and coercions ann_, triv, memo , coerceTo_, fromProb, nat2int, nat2prob, fromInt, nat2real , unsafeFrom_, unsafeProb, unsafeProbFraction, unsafeProbFraction_, unsafeProbSemiring, unsafeProbSemiring_ -- ** Numeric literals , literal_, nat_, int_, prob_, real_ , fromRational, half, third -- ** Booleans , true, false, bool_, if_ , not, (&&), and, (||), or, nand, nor -- ** Equality and ordering , (==), (/=), (<), (<=), (>), (>=), min, minimum, max, maximum -- ** Semirings , zero, zero_, one, one_, (+), sum, (*), prod, (^), square , unsafeMinusNat, unsafeMinusProb, unsafeMinus, unsafeMinus_ , unsafeDiv, unsafeDiv_ -- ** Rings , (-), negate, negative, abs, abs_, signum -- ** Fractional , (/), recip, (^^) -- ** Radical , sqrt, thRootOf -- ** Integration , integrate, summate, product -- ** Continuous , RealProb(..), Integrable(..) , betaFunc , log, logBase , negativeInfinity -- *** Trig , sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh -- * Measures -- ** Abstract nonsense , dirac, (<$>), (<*>), (<*), (*>), (>>=), (>>), bindx, liftM2 -- ** Linear operators , superpose, (<|>) , weight, withWeight, weightedDirac , reject, guard, withGuard -- ** Measure operators -- | When two versions of the same operator are given, the one without the prime builds an AST using the built-in operator, whereas the one with the prime is a default definition in terms of more primitive measure operators. , lebesgue, lebesgue' , counting , densityCategorical, categorical, categorical' , densityUniform, uniform, uniform' , densityNormal, normal, normal' , densityPoisson, poisson, poisson' , densityGamma, gamma, gamma' , densityBeta, beta, beta', beta'' , plateWithVar, plate, plate' , chain, chain' , invgamma , exponential , chi2 , cauchy , laplace , studentT , weibull , bern , mix , binomial , negativeBinomial , geometric , multinomial , dirichlet -- * Data types (other than booleans) , datum_ -- * Case and Branch , case_, branch -- ** HUnit , unit -- ** HPair , pair, pair_, unpair, fst, snd, swap -- ** HEither , left, right, uneither -- ** HMaybe , nothing, just, maybe, unmaybe -- ** HList , nil, cons, list -- * Lambda calculus , lam, lamWithVar, let_, letM , app, app2, app3 -- * Arrays , empty, arrayWithVar, array, arrayLit, (!), size, reduce , sumV, summateV, appendV, mapV, mapWithIndex, normalizeV, constV, unitV, zipWithV -- * Implementation details , primOp0_, primOp1_, primOp2_, primOp3_ , arrayOp0_, arrayOp1_, arrayOp2_, arrayOp3_ , measure0_, measure1_, measure2_ , unsafeNaryOp_, naryOp_withIdentity, naryOp2_ -- * Reducers , bucket, r_fanout, r_index, r_split, r_nop, r_add ) where -- TODO: implement and use Prelude's fromInteger and fromRational, so we can use numeric literals! import Prelude (Maybe(..), Functor(..), Bool(..), Integer, Rational, ($), flip, const, error) import qualified Prelude import Data.Sequence (Seq) import qualified Data.Sequence as Seq import qualified Data.Text as Text import Data.List.NonEmpty (NonEmpty(..)) import qualified Data.List.NonEmpty as L import Data.Semigroup (Semigroup(..)) import Control.Category (Category(..)) import Control.Monad (return) import Control.Monad.Fix import Data.Number.Natural import Language.Hakaru.Types.DataKind import Language.Hakaru.Types.Sing (Sing(..), SingI(sing), sUnPair, sUnEither, sUnMaybe, sUnMeasure, sUnArray) import Language.Hakaru.Syntax.TypeOf import Language.Hakaru.Types.HClasses import Language.Hakaru.Types.Coercion import Language.Hakaru.Syntax.Reducer import Language.Hakaru.Syntax.AST import Language.Hakaru.Syntax.Datum import Language.Hakaru.Syntax.ABT hiding (View(..)) ---------------------------------------------------------------- ----- Helper combinators for defining our EDSL {- Below we implement a lot of simple optimizations; however, these optimizations only apply if the client uses the type class methods to produce the AST. We should implement a stand-alone function which performs these sorts of optimizations, as a program transformation. -} -- TODO: constant propogation -- TODO: NBE to get rid of administrative redexes. app :: (ABT Term abt) => abt '[] (a ':-> b) -> abt '[] a -> abt '[] b app e1 e2 = syn (App_ :$ e1 :* e2 :* End) app2 :: (ABT Term abt) => abt '[] (a ':-> b ':-> c) -> abt '[] a -> abt '[] b -> abt '[] c app2 = (app .) . app app3 :: (ABT Term abt) => abt '[] (a ':-> b ':-> c ':-> d) -> abt '[] a -> abt '[] b -> abt '[] c -> abt '[] d app3 = (app2 .) . app triv :: TrivialABT Term '[] a -> TrivialABT Term '[] a triv = id memo :: MemoizedABT Term '[] a -> MemoizedABT Term '[] a memo = id primOp0_ :: (ABT Term abt) => PrimOp '[] a -> abt '[] a primOp0_ o = syn (PrimOp_ o :$ End) primOp1_ :: (ABT Term abt) => PrimOp '[ a ] b -> abt '[] a -> abt '[] b primOp1_ o e1 = syn (PrimOp_ o :$ e1 :* End) primOp2_ :: (ABT Term abt) => PrimOp '[ a, b ] c -> abt '[] a -> abt '[] b -> abt '[] c primOp2_ o e1 e2 = syn (PrimOp_ o :$ e1 :* e2 :* End) primOp3_ :: (ABT Term abt) => PrimOp '[ a, b, c ] d -> abt '[] a -> abt '[] b -> abt '[] c -> abt '[] d primOp3_ o e1 e2 e3 = syn (PrimOp_ o :$ e1 :* e2 :* e3 :* End) arrayOp0_ :: (ABT Term abt) => ArrayOp '[] a -> abt '[] a arrayOp0_ o = syn (ArrayOp_ o :$ End) arrayOp1_ :: (ABT Term abt) => ArrayOp '[ a ] b -> abt '[] a -> abt '[] b arrayOp1_ o e1 = syn (ArrayOp_ o :$ e1 :* End) arrayOp2_ :: (ABT Term abt) => ArrayOp '[ a, b ] c -> abt '[] a -> abt '[] b -> abt '[] c arrayOp2_ o e1 e2 = syn (ArrayOp_ o :$ e1 :* e2 :* End) arrayOp3_ :: (ABT Term abt) => ArrayOp '[ a, b, c ] d -> abt '[] a -> abt '[] b -> abt '[] c -> abt '[] d arrayOp3_ o e1 e2 e3 = syn (ArrayOp_ o :$ e1 :* e2 :* e3 :* End) measure0_ :: (ABT Term abt) => MeasureOp '[] a -> abt '[] ('HMeasure a) measure0_ o = syn (MeasureOp_ o :$ End) measure1_ :: (ABT Term abt) => MeasureOp '[ a ] b -> abt '[] a -> abt '[] ('HMeasure b) measure1_ o e1 = syn (MeasureOp_ o :$ e1 :* End) measure2_ :: (ABT Term abt) => MeasureOp '[ a, b ] c -> abt '[] a -> abt '[] b -> abt '[] ('HMeasure c) measure2_ o e1 e2 = syn (MeasureOp_ o :$ e1 :* e2 :* End) -- N.B., we don't take advantage of commutativity, for more predictable -- AST outputs. However, that means we can end up being slow... -- -- N.B., we also don't try to eliminate the identity elements or -- do cancellations because (a) it's undecidable in general, and -- (b) that's prolly better handled as a post-processing simplification -- step -- -- TODO: generalize these two from [] to Foldable? -- | Apply an n-ary operator to a list. This smart constructor will -- flatten nested calls to the same operator. And if there is exactly -- one element in the flattened sequence, then it will remove the -- 'NaryOp_' node from the AST. -- -- N.B., if the flattened sequence is empty, this smart constructor -- will return an AST which applies the operator to the empty -- sequence; which may or may not be unsafe. If the operator has -- an identity element, then it's fine (operating on the empty -- sequence evaluates to the identity element). However, if the -- operator doesn't have an identity, then the generated code will -- error whenever we attempt to run it. unsafeNaryOp_ :: (ABT Term abt) => NaryOp a -> [abt '[] a] -> abt '[] a unsafeNaryOp_ o = naryOp_withIdentity o (syn $ NaryOp_ o Seq.empty) -- | A variant of 'unsafeNaryOp_' which will replace operating over -- the empty sequence with a specified identity element. The produced -- AST has the same semantics, we're just preemptively -- evaluating\/simplifying the 'NaryOp_' node of the AST. -- -- N.B., this function does not simplify away the identity element -- if it exists in the flattened sequence! We should add that in -- the future. naryOp_withIdentity :: (ABT Term abt) => NaryOp a -> abt '[] a -> [abt '[] a] -> abt '[] a naryOp_withIdentity o i = go Seq.empty where go es [] = case Seq.viewl es of Seq.EmptyL -> i e Seq.:< es' -> case Seq.viewl es' of Seq.EmptyL -> e _ -> syn $ NaryOp_ o es go es (e:es') = case matchNaryOp o e of Nothing -> go (es Seq.|> e) es' Just es'' -> go (es Seq.>< es'') es' -- TODO: is this actually worth breaking out, performance-wise? Or should we simply use: -- > naryOp2_ o x y = unsafeNaryOp_ o [x,y] naryOp2_ :: (ABT Term abt) => NaryOp a -> abt '[] a -> abt '[] a -> abt '[] a naryOp2_ o x y = case (matchNaryOp o x, matchNaryOp o y) of (Just xs, Just ys) -> syn . NaryOp_ o $ xs Seq.>< ys (Just xs, Nothing) -> syn . NaryOp_ o $ xs Seq.|> y (Nothing, Just ys) -> syn . NaryOp_ o $ x Seq.<| ys (Nothing, Nothing) -> syn . NaryOp_ o $ x Seq.<| Seq.singleton y matchNaryOp :: (ABT Term abt) => NaryOp a -> abt '[] a -> Maybe (Seq (abt '[] a)) matchNaryOp o e = caseVarSyn e (const Nothing) $ \t -> case t of NaryOp_ o' xs | o' Prelude.== o -> Just xs _ -> Nothing ---------------------------------------------------------------- ---------------------------------------------------------------- ----- Now for the actual EDSL {- infixr 9 `pair` infixr 1 =<< infixr 1 <=<, >=> infixr 9 . infixr 0 $ -} infixl 1 >>=, >> infixr 2 || infixr 3 && infix 4 ==, /=, <, <=, >, >= infixl 4 <$>, <*>, <*, *> -- <$ infixl 6 +, - infixl 7 *, / infixr 8 ^, ^^, ** -- infixl9 is the default when things are unspecified infixl 9 !, `app`, `thRootOf` -- TODO: some infix notation reminiscent of \"::\" -- TODO: actually do something with the type argument? ann_ :: (ABT Term abt) => Sing a -> abt '[] a -> abt '[] a ann_ _ e = e coerceTo_ :: (ABT Term abt) => Coercion a b -> abt '[] a -> abt '[] b coerceTo_ CNil e = e coerceTo_ c e = syn (CoerceTo_ c :$ e :* End) unsafeFrom_ :: (ABT Term abt) => Coercion a b -> abt '[] b -> abt '[] a unsafeFrom_ CNil e = e unsafeFrom_ c e = syn (UnsafeFrom_ c :$ e :* End) literal_ :: (ABT Term abt) => Literal a -> abt '[] a literal_ = syn . Literal_ bool_ :: (ABT Term abt) => Bool -> abt '[] HBool bool_ = datum_ . (\b -> if b then dTrue else dFalse) nat_ :: (ABT Term abt) => Natural -> abt '[] 'HNat nat_ = literal_ . LNat int_ :: (ABT Term abt) => Integer -> abt '[] 'HInt int_ = literal_ . LInt prob_ :: (ABT Term abt) => NonNegativeRational -> abt '[] 'HProb prob_ = literal_ . LProb real_ :: (ABT Term abt) => Rational -> abt '[] 'HReal real_ = literal_ . LReal fromRational :: forall abt a . (ABT Term abt, HFractional_ a) => Rational -> abt '[] a fromRational = case (hFractional :: HFractional a) of HFractional_Prob -> prob_ . unsafeNonNegativeRational HFractional_Real -> real_ half :: forall abt a . (ABT Term abt, HFractional_ a) => abt '[] a half = fromRational (1 Prelude./ 2) third :: (ABT Term abt, HFractional_ a) => abt '[] a third = fromRational (1 Prelude./ 3) -- Boolean operators true, false :: (ABT Term abt) => abt '[] HBool true = bool_ True false = bool_ False -- TODO: simplifications: distribution, constant-propogation -- TODO: do we really want to distribute /by default/? Clearly we'll want to do that in some optimization\/partial-evaluation pass, but do note that it makes terms larger in general... not :: (ABT Term abt) => abt '[] HBool -> abt '[] HBool not e = Prelude.maybe (primOp1_ Not e) id $ caseVarSyn e (const Nothing) $ \t -> case t of PrimOp_ Not :$ es' -> case es' of e' :* End -> Just e' _ -> error "not: the impossible happened" NaryOp_ And xs -> Just . syn . NaryOp_ Or $ Prelude.fmap not xs NaryOp_ Or xs -> Just . syn . NaryOp_ And $ Prelude.fmap not xs NaryOp_ Xor xs -> Just . syn . NaryOp_ Iff $ Prelude.fmap not xs NaryOp_ Iff xs -> Just . syn . NaryOp_ Xor $ Prelude.fmap not xs Literal_ _ -> error "not: the impossible happened" _ -> Nothing and, or :: (ABT Term abt) => [abt '[] HBool] -> abt '[] HBool and = naryOp_withIdentity And true or = naryOp_withIdentity Or false (&&), (||), -- (</=>), (<==>), (==>), (<==), (\\), (//) -- TODO: better names? nand, nor :: (ABT Term abt) => abt '[] HBool -> abt '[] HBool -> abt '[] HBool (&&) = naryOp2_ And (||) = naryOp2_ Or -- (</=>) = naryOp2_ Xor -- (<==>) = naryOp2_ Iff -- (==>) = primOp2_ Impl -- (<==) = flip (==>) -- (\\) = primOp2_ Diff -- (//) = flip (\\) nand = primOp2_ Nand nor = primOp2_ Nor -- HEq & HOrder operators (==), (/=) :: (ABT Term abt, HEq_ a) => abt '[] a -> abt '[] a -> abt '[] HBool (==) = primOp2_ $ Equal hEq (/=) = (not .) . (==) (<), (<=), (>), (>=) :: (ABT Term abt, HOrd_ a) => abt '[] a -> abt '[] a -> abt '[] HBool (<) = primOp2_ $ Less hOrd x <= y = not (x > y) -- or: @(x < y) || (x == y)@ (>) = flip (<) (>=) = flip (<=) min, max :: (ABT Term abt, HOrd_ a) => abt '[] a -> abt '[] a -> abt '[] a min = naryOp2_ $ Min hOrd max = naryOp2_ $ Max hOrd -- TODO: if @a@ is bounded, then we can make these safe... minimum, maximum :: (ABT Term abt, HOrd_ a) => [abt '[] a] -> abt '[] a minimum = unsafeNaryOp_ $ Min hOrd maximum = unsafeNaryOp_ $ Max hOrd -- HSemiring operators (+), (*) :: (ABT Term abt, HSemiring_ a) => abt '[] a -> abt '[] a -> abt '[] a (+) = naryOp2_ $ Sum hSemiring (*) = naryOp2_ $ Prod hSemiring zero, one :: forall abt a. (ABT Term abt, HSemiring_ a) => abt '[] a zero = zero_ (hSemiring :: HSemiring a) one = one_ (hSemiring :: HSemiring a) zero_, one_ :: (ABT Term abt) => HSemiring a -> abt '[] a zero_ HSemiring_Nat = literal_ $ LNat 0 zero_ HSemiring_Int = literal_ $ LInt 0 zero_ HSemiring_Prob = literal_ $ LProb 0 zero_ HSemiring_Real = literal_ $ LReal 0 one_ HSemiring_Nat = literal_ $ LNat 1 one_ HSemiring_Int = literal_ $ LInt 1 one_ HSemiring_Prob = literal_ $ LProb 1 one_ HSemiring_Real = literal_ $ LReal 1 -- TODO: add a smart constructor for @HSemiring_ a => Natural -> abt '[] a@ and\/or @HRing_ a => Integer -> abt '[] a@ sum, prod :: (ABT Term abt, HSemiring_ a) => [abt '[] a] -> abt '[] a sum = naryOp_withIdentity (Sum hSemiring) zero prod = naryOp_withIdentity (Prod hSemiring) one {- sum, product :: (ABT Term abt, HSemiring_ a) => [abt '[] a] -> abt '[] a sum = unsafeNaryOp_ $ Sum hSemiring product = unsafeNaryOp_ $ Prod hSemiring -} -- TODO: simplifications (^) :: (ABT Term abt, HSemiring_ a) => abt '[] a -> abt '[] 'HNat -> abt '[] a (^) = primOp2_ $ NatPow hSemiring -- TODO: this is actually safe, how can we capture that? -- TODO: is this type restruction actually helpful anywhere for us? -- If so, we ought to make this function polymorphic so that we can -- use it for non-HRing HSemirings too... square :: (ABT Term abt, HRing_ a) => abt '[] a -> abt '[] (NonNegative a) square e = unsafeFrom_ signed (e ^ nat_ 2) -- HRing operators (-) :: (ABT Term abt, HRing_ a) => abt '[] a -> abt '[] a -> abt '[] a x - y = x + negate y -- TODO: do we really want to distribute negation over addition /by -- default/? Clearly we'll want to do that in some -- optimization\/partial-evaluation pass, but do note that it makes -- terms larger in general... negate :: (ABT Term abt, HRing_ a) => abt '[] a -> abt '[] a negate e = Prelude.maybe (primOp1_ (Negate hRing) e) id $ caseVarSyn e (const Nothing) $ \t -> case t of -- TODO: need we case analyze the @HSemiring@? NaryOp_ (Sum theSemi) xs -> Just . syn . NaryOp_ (Sum theSemi) $ Prelude.fmap negate xs -- TODO: need we case analyze the @HRing@? PrimOp_ (Negate _theRing) :$ es' -> case es' of e' :* End -> Just e' _ -> error "negate: the impossible happened" _ -> Nothing -- TODO: test case: @negative . square@ simplifies away the intermediate coercions. (cf., normal') -- BUG: this can lead to ambiguity when used with the polymorphic functions of RealProb. -- | An occasionally helpful variant of 'negate'. negative :: (ABT Term abt, HRing_ a) => abt '[] (NonNegative a) -> abt '[] a negative = negate . coerceTo_ signed abs :: (ABT Term abt, HRing_ a) => abt '[] a -> abt '[] a abs = coerceTo_ signed . abs_ abs_ :: (ABT Term abt, HRing_ a) => abt '[] a -> abt '[] (NonNegative a) abs_ e = Prelude.maybe (primOp1_ (Abs hRing) e) id $ caseVarSyn e (const Nothing) $ \t -> case t of -- BUG: can't use the 'Signed' pattern synonym here, because that /requires/ the input to be (NonNegative a), instead of giving us the information that it is. -- TODO: need we case analyze the @HRing@? CoerceTo_ (CCons (Signed _theRing) CNil) :$ es' -> case es' of e' :* End -> Just e' _ -> error "abs_: the impossible happened" _ -> Nothing -- TODO: any obvious simplifications? idempotent? signum :: (ABT Term abt, HRing_ a) => abt '[] a -> abt '[] a signum = primOp1_ $ Signum hRing -- HFractional operators (/) :: (ABT Term abt, HFractional_ a) => abt '[] a -> abt '[] a -> abt '[] a x / y = x * recip y -- TODO: generalize this pattern so we don't have to repeat it... -- -- TODO: do we really want to distribute reciprocal over multiplication -- /by default/? Clearly we'll want to do that in some -- optimization\/partial-evaluation pass, but do note that it makes -- terms larger in general... recip :: (ABT Term abt, HFractional_ a) => abt '[] a -> abt '[] a recip e0 = Prelude.maybe (primOp1_ (Recip hFractional) e0) id $ caseVarSyn e0 (const Nothing) $ \t0 -> case t0 of -- TODO: need we case analyze the @HSemiring@? NaryOp_ (Prod theSemi) xs -> Just . syn . NaryOp_ (Prod theSemi) $ Prelude.fmap recip xs -- TODO: need we case analyze the @HFractional@? PrimOp_ (Recip _theFrac) :$ es' -> case es' of e :* End -> Just e _ -> error "recip: the impossible happened" _ -> Nothing -- TODO: simplifications -- TODO: a variant of 'if_' which gives us the evidence that the argument is non-negative, so we don't need to coerce or use 'abs_' (^^) :: (ABT Term abt, HFractional_ a) => abt '[] a -> abt '[] 'HInt -> abt '[] a x ^^ y = if_ (y < int_ 0) (recip x ^ abs_ y) (x ^ abs_ y) -- HRadical operators -- N.B., HProb is the only HRadical type (for now...) -- TODO: simplifications thRootOf :: (ABT Term abt, HRadical_ a) => abt '[] 'HNat -> abt '[] a -> abt '[] a n `thRootOf` x = primOp2_ (NatRoot hRadical) x n sqrt :: (ABT Term abt, HRadical_ a) => abt '[] a -> abt '[] a sqrt = (nat_ 2 `thRootOf`) {- -- TODO: simplifications (^+) :: (ABT Term abt, HRadical_ a) => abt '[] a -> abt '[] 'HPositiveRational -> abt '[] a x ^+ y = casePositiveRational y $ \n d -> d `thRootOf` (x ^ n) (^*) :: (ABT Term abt, HRadical_ a) => abt '[] a -> abt '[] 'HRational -> abt '[] a x ^* y = caseRational y $ \n d -> d `thRootOf` (x ^^ n) -} betaFunc :: (ABT Term abt) => abt '[] 'HProb -> abt '[] 'HProb -> abt '[] 'HProb betaFunc = primOp2_ BetaFunc integrate :: (ABT Term abt) => abt '[] 'HReal -> abt '[] 'HReal -> (abt '[] 'HReal -> abt '[] 'HProb) -> abt '[] 'HProb integrate lo hi f = syn (Integrate :$ lo :* hi :* binder Text.empty sing f :* End) summate :: (ABT Term abt, HDiscrete_ a, HSemiring_ b, SingI a) => abt '[] a -> abt '[] a -> (abt '[] a -> abt '[] b) -> abt '[] b summate lo hi f = syn (Summate hDiscrete hSemiring :$ lo :* hi :* binder Text.empty sing f :* End) product :: (ABT Term abt, HDiscrete_ a, HSemiring_ b, SingI a) => abt '[] a -> abt '[] a -> (abt '[] a -> abt '[] b) -> abt '[] b product lo hi f = syn (Product hDiscrete hSemiring :$ lo :* hi :* binder Text.empty sing f :* End) class Integrable (a :: Hakaru) where infinity :: (ABT Term abt) => abt '[] a instance Integrable 'HNat where infinity = primOp0_ (Infinity HIntegrable_Nat) instance Integrable 'HInt where infinity = nat2int $ primOp0_ (Infinity HIntegrable_Nat) instance Integrable 'HProb where infinity = primOp0_ (Infinity HIntegrable_Prob) instance Integrable 'HReal where infinity = fromProb $ primOp0_ (Infinity HIntegrable_Prob) -- HACK: we define this class in order to gain more polymorphism; -- but, will it cause type inferencing issues? Excepting 'log' -- (which should be moved out of the class) these are all safe. class RealProb (a :: Hakaru) where (**) :: (ABT Term abt) => abt '[] 'HProb -> abt '[] a -> abt '[] 'HProb exp :: (ABT Term abt) => abt '[] a -> abt '[] 'HProb erf :: (ABT Term abt) => abt '[] a -> abt '[] a pi :: (ABT Term abt) => abt '[] a gammaFunc :: (ABT Term abt) => abt '[] a -> abt '[] 'HProb instance RealProb 'HReal where (**) = primOp2_ RealPow exp = primOp1_ Exp erf = primOp1_ $ Erf hContinuous pi = fromProb $ primOp0_ Pi gammaFunc = primOp1_ GammaFunc instance RealProb 'HProb where x ** y = primOp2_ RealPow x $ fromProb y exp = primOp1_ Exp . fromProb erf = primOp1_ $ Erf hContinuous pi = primOp0_ Pi gammaFunc = primOp1_ GammaFunc . fromProb log :: (ABT Term abt) => abt '[] 'HProb -> abt '[] 'HReal log = primOp1_ Log logBase :: (ABT Term abt) => abt '[] 'HProb -> abt '[] 'HProb -> abt '[] 'HReal logBase b x = log x / log b -- undefined when b == 1 sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh :: (ABT Term abt) => abt '[] 'HReal -> abt '[] 'HReal sin = primOp1_ Sin cos = primOp1_ Cos tan = primOp1_ Tan asin = primOp1_ Asin acos = primOp1_ Acos atan = primOp1_ Atan sinh = primOp1_ Sinh cosh = primOp1_ Cosh tanh = primOp1_ Tanh asinh = primOp1_ Asinh acosh = primOp1_ Acosh atanh = primOp1_ Atanh ---------------------------------------------------------------- datum_ :: (ABT Term abt) => Datum (abt '[]) (HData' t) -> abt '[] (HData' t) datum_ = syn . Datum_ case_ :: (ABT Term abt) => abt '[] a -> [Branch a abt b] -> abt '[] b case_ e bs = syn (Case_ e bs) branch :: (ABT Term abt) => Pattern xs a -> abt xs b -> Branch a abt b branch = Branch unit :: (ABT Term abt) => abt '[] HUnit unit = datum_ dUnit pair :: (ABT Term abt, SingI a, SingI b) => abt '[] a -> abt '[] b -> abt '[] (HPair a b) pair = (datum_ .) . dPair pair_ :: (ABT Term abt) => Sing a -> Sing b -> abt '[] a -> abt '[] b -> abt '[] (HPair a b) pair_ a b = (datum_ .) . dPair_ a b unpair :: forall abt a b c . (ABT Term abt) => abt '[] (HPair a b) -> (abt '[] a -> abt '[] b -> abt '[] c) -> abt '[] c unpair e hoas = let (aTyp,bTyp) = sUnPair $ typeOf e body = hoas (var a) (var b) inc x = 1 Prelude.+ x a = Variable Text.empty (nextBind body) aTyp b = Variable Text.empty (inc . nextBind $ body) bTyp in case_ e [Branch (pPair PVar PVar) (bind a (bind b body)) ] fst :: (ABT Term abt) => abt '[] (HPair a b) -> abt '[] a fst p = unpair p (\x _ -> x) snd :: (ABT Term abt) => abt '[] (HPair a b) -> abt '[] b snd p = unpair p (\_ y -> y) swap :: (ABT Term abt, SingI a, SingI b) => abt '[] (HPair a b) -> abt '[] (HPair b a) swap ab = unpair ab (flip pair) left :: (ABT Term abt, SingI a, SingI b) => abt '[] a -> abt '[] (HEither a b) left = datum_ . dLeft right :: (ABT Term abt, SingI a, SingI b) => abt '[] b -> abt '[] (HEither a b) right = datum_ . dRight uneither :: (ABT Term abt) => abt '[] (HEither a b) -> (abt '[] a -> abt '[] c) -> (abt '[] b -> abt '[] c) -> abt '[] c uneither e l r = let (a,b) = sUnEither $ typeOf e in case_ e [ Branch (pLeft PVar) (binder Text.empty a l) , Branch (pRight PVar) (binder Text.empty b r) ] if_ :: (ABT Term abt) => abt '[] HBool -> abt '[] a -> abt '[] a -> abt '[] a if_ b t f = case_ b [ Branch pTrue t , Branch pFalse f ] nil :: (ABT Term abt, SingI a) => abt '[] (HList a) nil = datum_ dNil cons :: (ABT Term abt, SingI a) => abt '[] a -> abt '[] (HList a) -> abt '[] (HList a) cons = (datum_ .) . dCons list :: (ABT Term abt, SingI a) => [abt '[] a] -> abt '[] (HList a) list = Prelude.foldr cons nil nothing :: (ABT Term abt, SingI a) => abt '[] (HMaybe a) nothing = datum_ dNothing just :: (ABT Term abt, SingI a) => abt '[] a -> abt '[] (HMaybe a) just = datum_ . dJust maybe :: (ABT Term abt, SingI a) => Maybe (abt '[] a) -> abt '[] (HMaybe a) maybe = Prelude.maybe nothing just unmaybe :: (ABT Term abt) => abt '[] (HMaybe a) -> abt '[] b -> (abt '[] a -> abt '[] b) -> abt '[] b unmaybe e n j = case_ e [ Branch pNothing n , Branch (pJust PVar) (binder Text.empty (sUnMaybe $ typeOf e) j) ] unsafeProb :: (ABT Term abt) => abt '[] 'HReal -> abt '[] 'HProb unsafeProb = unsafeFrom_ signed fromProb :: (ABT Term abt) => abt '[] 'HProb -> abt '[] 'HReal fromProb = coerceTo_ signed nat2int :: (ABT Term abt) => abt '[] 'HNat -> abt '[] 'HInt nat2int = coerceTo_ signed fromInt :: (ABT Term abt) => abt '[] 'HInt -> abt '[] 'HReal fromInt = coerceTo_ continuous nat2prob :: (ABT Term abt) => abt '[] 'HNat -> abt '[] 'HProb nat2prob = coerceTo_ continuous nat2real :: (ABT Term abt) => abt '[] 'HNat -> abt '[] 'HReal nat2real = coerceTo_ (continuous . signed) {- -- Uncomment only if we actually end up needing this anywhere class FromNat (a :: Hakaru) where fromNat :: (ABT Term abt) => abt '[] 'HNat -> abt '[] a instance FromNat 'HNat where fromNat = id instance FromNat 'HInt where fromNat = nat2int instance FromNat 'HProb where fromNat = nat2prob instance FromNat 'HReal where fromNat = fromProb . nat2prob -} unsafeProbFraction :: forall abt a . (ABT Term abt, HFractional_ a) => abt '[] a -> abt '[] 'HProb unsafeProbFraction e = unsafeProbFraction_ (hFractional :: HFractional a) e unsafeProbFraction_ :: (ABT Term abt) => HFractional a -> abt '[] a -> abt '[] 'HProb unsafeProbFraction_ HFractional_Prob = id unsafeProbFraction_ HFractional_Real = unsafeProb unsafeProbSemiring :: forall abt a . (ABT Term abt, HSemiring_ a) => abt '[] a -> abt '[] 'HProb unsafeProbSemiring e = unsafeProbSemiring_ (hSemiring :: HSemiring a) e unsafeProbSemiring_ :: (ABT Term abt) => HSemiring a -> abt '[] a -> abt '[] 'HProb unsafeProbSemiring_ HSemiring_Nat = nat2prob unsafeProbSemiring_ HSemiring_Int = coerceTo_ continuous . unsafeFrom_ signed unsafeProbSemiring_ HSemiring_Prob = id unsafeProbSemiring_ HSemiring_Real = unsafeProb negativeInfinity :: ( ABT Term abt , HRing_ a , Integrable a) => abt '[] a negativeInfinity = negate infinity -- instance (ABT Term abt) => Lambda abt where -- 'app' already defined -- TODO: use 'typeOf' to remove the 'SingI' requirement somehow -- | A variant of 'lamWithVar' for automatically computing the type -- via 'sing'. lam :: (ABT Term abt, SingI a) => (abt '[] a -> abt '[] b) -> abt '[] (a ':-> b) lam = lamWithVar Text.empty sing -- | Create a lambda abstraction. The first two arguments give the -- hint and type of the lambda-bound variable in the result. If you -- want to automatically fill those in, then see 'lam'. lamWithVar :: (ABT Term abt) => Text.Text -> Sing a -> (abt '[] a -> abt '[] b) -> abt '[] (a ':-> b) lamWithVar hint typ f = syn (Lam_ :$ binder hint typ f :* End) {- -- some test cases to make sure we tied-the-knot successfully: > let lam :: (ABT Term abt) => String -> Sing a -> (abt '[] a -> abt '[] b) -> abt '[] (a ':-> b) lam name typ f = syn (Lam_ :$ binder name typ f :* End) > lam "x" SInt (\x -> x) :: TrivialABT Term ('HInt ':-> 'HInt) > lam "x" SInt (\x -> lam "y" SInt $ \y -> x < y) :: TrivialABT Term ('HInt ':-> 'HInt ':-> 'HBool) -} -- TODO: make this smarter so that if the @e@ is already a variable then we just plug it into @f@ instead of introducing the trivial let-binding. let_ :: (ABT Term abt) => abt '[] a -> (abt '[] a -> abt '[] b) -> abt '[] b let_ e f = syn (Let_ :$ e :* binder Text.empty (typeOf e) f :* End) letM :: (Functor m, MonadFix m, ABT Term abt) => abt '[] a -> (abt '[] a -> m (abt '[] b)) -> m (abt '[] b) letM e f = fmap (\ body -> syn $ Let_ :$ e :* body :* End) (binderM Text.empty t f) where t = typeOf e ---------------------------------------------------------------- array :: (ABT Term abt) => abt '[] 'HNat -> (abt '[] 'HNat -> abt '[] a) -> abt '[] ('HArray a) array n = syn . Array_ n . binder Text.empty sing arrayWithVar :: (ABT Term abt) => abt '[] 'HNat -> Variable 'HNat -> abt '[] a -> abt '[] ('HArray a) arrayWithVar n x body = syn $ Array_ n (bind x body) arrayLit :: (ABT Term abt) => [abt '[] a] -> abt '[] ('HArray a) arrayLit = syn . ArrayLiteral_ empty :: (ABT Term abt, SingI a) => abt '[] ('HArray a) empty = syn (Empty_ sing) (!) :: (ABT Term abt) => abt '[] ('HArray a) -> abt '[] 'HNat -> abt '[] a (!) e = arrayOp2_ (Index . sUnArray $ typeOf e) e size :: (ABT Term abt) => abt '[] ('HArray a) -> abt '[] 'HNat size e = arrayOp1_ (Size . sUnArray $ typeOf e) e reduce :: (ABT Term abt) => (abt '[] a -> abt '[] a -> abt '[] a) -> abt '[] a -> abt '[] ('HArray a) -> abt '[] a reduce f e = let a = typeOf e f' = lamWithVar Text.empty a $ \x -> lamWithVar Text.empty a $ \y -> f x y in arrayOp3_ (Reduce a) f' e -- TODO: better names for all these. The \"V\" suffix doesn't make sense anymore since we're calling these arrays, not vectors... -- TODO: bust these all out into their own place, since the API for arrays is gonna be huge sumV :: (ABT Term abt, HSemiring_ a) => abt '[] ('HArray a) -> abt '[] a sumV = reduce (+) zero -- equivalent to summateV if @a ~ 'HProb@ summateV :: (ABT Term abt) => abt '[] ('HArray 'HProb) -> abt '[] 'HProb summateV x = summate (nat_ 0) (size x) (\i -> x ! i) -- TODO: a variant of 'if_' for giving us evidence that the subtraction is sound. unsafeMinusNat :: (ABT Term abt) => abt '[] 'HNat -> abt '[] 'HNat -> abt '[] 'HNat unsafeMinusNat x y = unsafeFrom_ signed (nat2int x - nat2int y) unsafeMinusProb :: (ABT Term abt) => abt '[] 'HProb -> abt '[] 'HProb -> abt '[] 'HProb unsafeMinusProb x y = unsafeProb (fromProb x - fromProb y) -- | For any semiring we can attempt subtraction by lifting to a -- ring, subtracting there, and then lowering back to the semiring. -- Of course, the lowering step may well fail. unsafeMinus :: (ABT Term abt, HSemiring_ a) => abt '[] a -> abt '[] a -> abt '[] a unsafeMinus = unsafeMinus_ hSemiring -- | A variant of 'unsafeMinus' for explicitly passing the semiring -- instance. unsafeMinus_ :: (ABT Term abt) => HSemiring a -> abt '[] a -> abt '[] a -> abt '[] a unsafeMinus_ theSemi = signed_HSemiring theSemi $ \c -> let lift = coerceTo_ c lower = unsafeFrom_ c in \e1 e2 -> lower (lift e1 - lift e2) -- TODO: move to Coercion.hs? -- | For any semiring, return a coercion to its ring completion. -- Because this completion is existentially quantified, we must use -- a cps trick to eliminate the existential. signed_HSemiring :: HSemiring a -> (forall b. (HRing_ b) => Coercion a b -> r) -> r signed_HSemiring c k = case c of HSemiring_Nat -> k $ singletonCoercion (Signed HRing_Int) HSemiring_Int -> k CNil HSemiring_Prob -> k $ singletonCoercion (Signed HRing_Real) HSemiring_Real -> k CNil -- | For any semiring we can attempt division by lifting to a -- semifield, dividing there, and then lowering back to the semiring. -- Of course, the lowering step may well fail. unsafeDiv :: (ABT Term abt, HSemiring_ a) => abt '[] a -> abt '[] a -> abt '[] a unsafeDiv = unsafeDiv_ hSemiring -- | A variant of 'unsafeDiv' for explicitly passing the semiring -- instance. unsafeDiv_ :: (ABT Term abt) => HSemiring a -> abt '[] a -> abt '[] a -> abt '[] a unsafeDiv_ theSemi = continuous_HSemiring theSemi $ \c -> let lift = coerceTo_ c lower = unsafeFrom_ c in \e1 e2 -> lower (lift e1 / lift e2) -- TODO: move to Coercion.hs? -- | For any semiring, return a coercion to its semifield completion. -- Because this completion is existentially quantified, we must use -- a cps trick to eliminate the existential. continuous_HSemiring :: HSemiring a -> (forall b. (HFractional_ b) => Coercion a b -> r) -> r continuous_HSemiring c k = case c of HSemiring_Nat -> k $ singletonCoercion (Continuous HContinuous_Prob) HSemiring_Int -> k $ singletonCoercion (Continuous HContinuous_Real) HSemiring_Prob -> k CNil HSemiring_Real -> k CNil appendV :: (ABT Term abt) => abt '[] ('HArray a) -> abt '[] ('HArray a) -> abt '[] ('HArray a) appendV v1 v2 = array (size v1 + size v2) $ \i -> if_ (i < size v1) (v1 ! i) (v2 ! (i `unsafeMinusNat` size v1)) mapWithIndex :: (ABT Term abt) => (abt '[] 'HNat -> abt '[] a -> abt '[] b) -> abt '[] ('HArray a) -> abt '[] ('HArray b) mapWithIndex f v = array (size v) $ \i -> f i (v ! i) mapV :: (ABT Term abt) => (abt '[] a -> abt '[] b) -> abt '[] ('HArray a) -> abt '[] ('HArray b) mapV f v = array (size v) $ \i -> f (v ! i) normalizeV :: (ABT Term abt) => abt '[] ('HArray 'HProb) -> abt '[] ('HArray 'HProb) normalizeV x = mapV (/ sumV x) x constV :: (ABT Term abt) => abt '[] 'HNat -> abt '[] b -> abt '[] ('HArray b) constV n c = array n (const c) unitV :: (ABT Term abt) => abt '[] 'HNat -> abt '[] 'HNat -> abt '[] ('HArray 'HProb) unitV s i = array s (\j -> if_ (i == j) (prob_ 1) (prob_ 0)) zipWithV :: (ABT Term abt) => (abt '[] a -> abt '[] b -> abt '[] c) -> abt '[] ('HArray a) -> abt '[] ('HArray b) -> abt '[] ('HArray c) zipWithV f v1 v2 = array (size v1) (\i -> f (v1 ! i) (v2 ! i)) ---------------------------------------------------------------- r_fanout :: (ABT Term abt) => Reducer abt xs a -> Reducer abt xs b -> Reducer abt xs (HPair a b) r_fanout = Red_Fanout r_index :: (Binders Term abt xs as) => (as -> abt '[] 'HNat) -> ((abt '[] 'HNat, as) -> abt '[] 'HNat) -> Reducer abt ( 'HNat ': xs) a -> Reducer abt xs ('HArray a) r_index n f = Red_Index (binders n) (binders f) r_split :: (Binders Term abt xs as) => ((abt '[] 'HNat, as) -> abt '[] HBool) -> Reducer abt xs a -> Reducer abt xs b -> Reducer abt xs (HPair a b) r_split b = Red_Split (binders b) r_nop :: (ABT Term abt) => Reducer abt xs HUnit r_nop = Red_Nop r_add :: (Binders Term abt xs as, HSemiring_ a) => ((abt '[] 'HNat, as) -> abt '[] a) -> Reducer abt xs a r_add f = Red_Add hSemiring (binders f) bucket :: (ABT Term abt) => abt '[] 'HNat -> abt '[] 'HNat -> Reducer abt '[] a -> abt '[] a bucket i j r = syn $ Bucket i j r ---------------------------------------------------------------- (>>=) :: (ABT Term abt) => abt '[] ('HMeasure a) -> (abt '[] a -> abt '[] ('HMeasure b)) -> abt '[] ('HMeasure b) m >>= f = syn (MBind :$ m :* binder Text.empty (sUnMeasure $ typeOf m) f :* End) dirac :: (ABT Term abt) => abt '[] a -> abt '[] ('HMeasure a) dirac e1 = syn (Dirac :$ e1 :* End) -- TODO: can we use let-binding instead of (>>=)-binding (i.e., for when the dirac is immediately (>>=)-bound again...)? (<$>) :: (ABT Term abt, SingI a) => (abt '[] a -> abt '[] b) -> abt '[] ('HMeasure a) -> abt '[] ('HMeasure b) f <$> m = m >>= dirac . f -- | N.B, this function may introduce administrative redexes. -- Moreover, it's not clear that we should even allow the type -- @'HMeasure (a ':-> b)@! (<*>) :: (ABT Term abt, SingI a, SingI b) => abt '[] ('HMeasure (a ':-> b)) -> abt '[] ('HMeasure a) -> abt '[] ('HMeasure b) mf <*> mx = mf >>= \f -> app f <$> mx -- TODO: ensure that @dirac a *> n@ simplifies to just @n@, regardless of @a@ but especially when @a = unit@. (*>), (>>) :: (ABT Term abt, SingI a) => abt '[] ('HMeasure a) -> abt '[] ('HMeasure b) -> abt '[] ('HMeasure b) m *> n = m >>= \_ -> n (>>) = (*>) -- TODO: ensure that @m <* dirac a@ simplifies to just @m@, regardless of @a@ but especially when @a = unit@. (<*) :: (ABT Term abt, SingI a, SingI b) => abt '[] ('HMeasure a) -> abt '[] ('HMeasure b) -> abt '[] ('HMeasure a) m <* n = m >>= \a -> n *> dirac a bindx :: (ABT Term abt, SingI a, SingI b) => abt '[] ('HMeasure a) -> (abt '[] a -> abt '[] ('HMeasure b)) -> abt '[] ('HMeasure (HPair a b)) m `bindx` f = m >>= \a -> pair a <$> f a -- Defined because using @(<$>)@ and @(<*>)@ would introduce administrative redexes liftM2 :: (ABT Term abt, SingI a, SingI b) => (abt '[] a -> abt '[] b -> abt '[] c) -> abt '[] ('HMeasure a) -> abt '[] ('HMeasure b) -> abt '[] ('HMeasure c) liftM2 f m n = m >>= \x -> f x <$> n lebesgue' :: (ABT Term abt) => abt '[] 'HReal -> abt '[] 'HReal -> abt '[] ('HMeasure 'HReal) lebesgue' = measure2_ Lebesgue lebesgue :: (ABT Term abt) => abt '[] ('HMeasure 'HReal) lebesgue = lebesgue' negativeInfinity infinity counting :: (ABT Term abt) => abt '[] ('HMeasure 'HInt) counting = measure0_ Counting -- TODO: make this smarter by collapsing nested @Superpose_@ similar to how we collapse nested NaryOps. Though beware, that could cause duplication of the computation for the probabilities\/weights; thus may want to only do it when the weights are constant values, or \"simplify\" things by generating let-bindings in order to share work. -- -- TODO: can we make this smarter enough to handle empty lists? superpose :: (ABT Term abt) => NonEmpty (abt '[] 'HProb, abt '[] ('HMeasure a)) -> abt '[] ('HMeasure a) superpose = syn . Superpose_ -- | The empty measure. Is called @fail@ in the Core Hakaru paper. reject :: (ABT Term abt) => (Sing ('HMeasure a)) -> abt '[] ('HMeasure a) reject = syn . Reject_ -- | The sum of two measures. Is called @mplus@ in the Core Hakaru paper. (<|>) :: (ABT Term abt) => abt '[] ('HMeasure a) -> abt '[] ('HMeasure a) -> abt '[] ('HMeasure a) x <|> y = superpose $ case (matchSuperpose x, matchSuperpose y) of (Just xs, Just ys) -> xs <> ys (Just xs, Nothing) -> (one, y) :| L.toList xs -- HACK: reordering! (Nothing, Just ys) -> (one, x) :| L.toList ys (Nothing, Nothing) -> (one, x) :| [(one, y)] matchSuperpose :: (ABT Term abt) => abt '[] ('HMeasure a) -> Maybe (NonEmpty (abt '[] 'HProb, abt '[] ('HMeasure a))) matchSuperpose e = caseVarSyn e (const Nothing) $ \t -> case t of Superpose_ xs -> Just xs _ -> Nothing -- TODO: we should ensure that the following reductions happen: -- > (withWeight p m >> n) ---> withWeight p (m >> n) -- > (m >> withWeight p n) ---> withWeight p (m >> n) -- > withWeight 1 m ---> m -- > withWeight p (withWeight q m) ---> withWeight (p*q) m -- > (weight p >> m) ---> withWeight p m -- -- | Adjust the weight of the current measure. -- -- /N.B.,/ the name for this function is terribly inconsistent -- across the literature, even just the Hakaru literature, let alone -- the Hakaru code base. It is variously called \"factor\" or -- \"weight\"; though \"factor\" is also used to mean the function -- 'factor' or the function 'observe', and \"weight\" is also used -- to mean the 'weight' function. weight :: (ABT Term abt) => abt '[] 'HProb -> abt '[] ('HMeasure HUnit) weight p = withWeight p (dirac unit) -- | A variant of 'weight' which removes an administrative @(dirac -- unit >>)@ redex. -- -- TODO: ideally we'll be able to get rid of this function entirely, -- and be able to trust optimization to clean up any redexes -- introduced by 'weight'. withWeight :: (ABT Term abt) => abt '[] 'HProb -> abt '[] ('HMeasure w) -> abt '[] ('HMeasure w) withWeight p m = syn $ Superpose_ ((p, m) :| []) -- | A particularly common use case of 'weight': -- -- > weightedDirac e p -- > == weight p (dirac e) -- > == weight p *> dirac e -- > == dirac e <* weight p weightedDirac :: (ABT Term abt, SingI a) => abt '[] a -> abt '[] 'HProb -> abt '[] ('HMeasure a) weightedDirac e p = withWeight p (dirac e) -- TODO: this taking of two arguments is as per the Core Hakaru specification; but for the EDSL, can we rephrase this as just taking the first argument, using @dirac unit@ for the else-branch, and then, making @(>>)@ work in the right way to plug the continuation measure in place of the @dirac unit@. -- TODO: would it help inference\/simplification at all to move this into the AST as a primitive? I mean, it is a primitive of Core Hakaru afterall... Also, that would help clarify whether the (first)argument should actually be an @HBool@ or whether it should be some sort of proposition. -- | Assert that a condition is true. -- -- /N.B.,/ the name for this function is terribly inconsistent -- across the literature, even just the Hakaru literature, let alone -- the Hakaru code base. It is variously called \"factor\" or -- \"observe\"; though \"factor\" is also used to mean the function -- 'pose', and \"observe\" is also used to mean the backwards part -- of Lazy.hs. guard :: (ABT Term abt) => abt '[] HBool -> abt '[] ('HMeasure HUnit) guard b = withGuard b (dirac unit) -- | A variant of 'guard' which removes an administrative @(dirac -- unit >>)@ redex. -- -- TODO: ideally we'll be able to get rid of this function entirely, -- and be able to trust optimization to clean up any redexes -- introduced by 'guard'. withGuard :: (ABT Term abt) => abt '[] HBool -> abt '[] ('HMeasure a) -> abt '[] ('HMeasure a) withGuard b m = if_ b m (reject (typeOf m)) densityCategorical :: (ABT Term abt) => abt '[] ('HArray 'HProb) -> abt '[] 'HNat -> abt '[] 'HProb densityCategorical v i = v ! i / summateV v categorical, categorical' :: (ABT Term abt) => abt '[] ('HArray 'HProb) -> abt '[] ('HMeasure 'HNat) categorical = measure1_ Categorical -- TODO: a variant of 'if_' which gives us the evidence that the argument is non-negative, so we don't need to coerce or use 'abs_' categorical' v = counting >>= \i -> withGuard (int_ 0 <= i && i < nat2int (size v)) $ let_ (unsafeFrom_ signed i) $ \i_ -> weightedDirac i_ (densityCategorical v i_) densityUniform :: (ABT Term abt) => abt '[] 'HReal -> abt '[] 'HReal -> abt '[] 'HReal -> abt '[] 'HProb densityUniform lo hi _ = recip . unsafeProb $ hi - lo -- TODO: make Uniform polymorphic, so that if the two inputs are -- HProb then we know the measure must be over HProb too uniform, uniform' :: (ABT Term abt) => abt '[] 'HReal -> abt '[] 'HReal -> abt '[] ('HMeasure 'HReal) uniform = measure2_ Uniform uniform' lo hi = lebesgue >>= \x -> withGuard (lo < x && x < hi) $ -- TODO: how can we capture that this 'unsafeProb' is safe? (and that this 'recip' isn't Infinity, for that matter) weightedDirac x (densityUniform lo hi x) densityNormal :: (ABT Term abt) => abt '[] 'HReal -> abt '[] 'HProb -> abt '[] 'HReal -> abt '[] 'HProb densityNormal mu sd x = exp (negate ((x - mu) ^ nat_ 2) -- TODO: use negative\/square instead of negate\/(^2) / fromProb (prob_ 2 * sd ^ nat_ 2)) -- TODO: use square? / sd / sqrt (prob_ 2 * pi) normal, normal' :: (ABT Term abt) => abt '[] 'HReal -> abt '[] 'HProb -> abt '[] ('HMeasure 'HReal) normal = measure2_ Normal normal' mu sd = lebesgue >>= \x -> weightedDirac x (densityNormal mu sd x) densityPoisson :: (ABT Term abt) => abt '[] 'HProb -> abt '[] 'HNat -> abt '[] 'HProb densityPoisson l x = l ^ x / gammaFunc (nat2real (x + nat_ 1)) -- TODO: use factorial instead of gammaFunc... / exp l poisson, poisson' :: (ABT Term abt) => abt '[] 'HProb -> abt '[] ('HMeasure 'HNat) poisson = measure1_ Poisson poisson' l = counting >>= \x -> -- TODO: use 'SafeFrom_' instead of @if_ (x >= int_ 0)@ so we can prove that @unsafeFrom_ signed x@ is actually always safe. withGuard (int_ 0 <= x && prob_ 0 < l) $ -- N.B., @0 < l@ means simply that @l /= 0@; why phrase it the other way? let_ (unsafeFrom_ signed x) $ \x_ -> weightedDirac x_ (densityPoisson l x_) densityGamma :: (ABT Term abt) => abt '[] 'HProb -> abt '[] 'HProb -> abt '[] 'HProb -> abt '[] 'HProb densityGamma shape scale x = x ** (fromProb shape - real_ 1) * exp (negate . fromProb $ x / scale) / (scale ** shape * gammaFunc shape) gamma, gamma' :: (ABT Term abt) => abt '[] 'HProb -> abt '[] 'HProb -> abt '[] ('HMeasure 'HProb) gamma = measure2_ Gamma gamma' shape scale = lebesgue >>= \x -> -- TODO: use 'SafeFrom_' instead of @if_ (real_ 0 < x)@ so we can prove that @unsafeProb x@ is actually always safe. Of course, then we'll need to mess around with checking (/=0) which'll get ugly... Use another SafeFrom_ with an associated NonZero type? withGuard (real_ 0 < x) $ let_ (unsafeProb x) $ \ x_ -> weightedDirac x_ (densityGamma shape scale x_) densityBeta :: (ABT Term abt) => abt '[] 'HProb -> abt '[] 'HProb -> abt '[] 'HProb -> abt '[] 'HProb densityBeta a b x = x ** (fromProb a - real_ 1) * unsafeProb (real_ 1 - fromProb x) ** (fromProb b - real_ 1) / betaFunc a b beta, beta', beta'' :: (ABT Term abt) => abt '[] 'HProb -> abt '[] 'HProb -> abt '[] ('HMeasure 'HProb) beta = measure2_ Beta beta' a b = -- TODO: make Uniform polymorphic, so that if the two inputs are HProb then we know the measure must be over HProb too, and hence @unsafeProb x@ must always be safe. Alas, capturing the safety of @unsafeProb (1-x)@ would take a lot more work... unsafeProb <$> uniform (real_ 0) (real_ 1) >>= \x -> weightedDirac x (densityBeta a b x) beta'' a b = gamma a (prob_ 1) >>= \x -> gamma b (prob_ 1) >>= \y -> dirac (x / (x+y)) plateWithVar :: (ABT Term abt) => abt '[] 'HNat -> Variable 'HNat -> abt '[] ('HMeasure a) -> abt '[] ('HMeasure ('HArray a)) plateWithVar e1 x e2 = syn (Plate :$ e1 :* bind x e2 :* End) plate :: (ABT Term abt) => abt '[] 'HNat -> (abt '[] 'HNat -> abt '[] ('HMeasure a)) -> abt '[] ('HMeasure ('HArray a)) plate e f = syn (Plate :$ e :* binder Text.empty sing f :* End) plate' :: (ABT Term abt, SingI a) => abt '[] ('HArray ('HMeasure a)) -> abt '[] ( 'HMeasure ('HArray a)) plate' v = reduce r z (mapV m v) where r = liftM2 appendV z = dirac empty m a = (array (nat_ 1) . const) <$> a -- BUG: remove the 'SingI' requirement! chain :: (ABT Term abt, SingI s) => abt '[] 'HNat -> abt '[] s -> (abt '[] s -> abt '[] ('HMeasure (HPair a s))) -> abt '[] ('HMeasure (HPair ('HArray a) s)) chain n s f = syn (Chain :$ n :* s :* binder Text.empty sing f :* End) chain' :: (ABT Term abt, SingI s, SingI a) => abt '[] ('HArray (s ':-> 'HMeasure (HPair a s))) -> abt '[] s -> abt '[] ('HMeasure (HPair ('HArray a) s)) chain' v s0 = reduce r z (mapV m v) `app` s0 where r x y = lam $ \s -> app x s >>= \v1s1 -> v1s1 `unpair` \v1 s1 -> app y s1 >>= \v2s2 -> v2s2 `unpair` \v2 s2 -> dirac $ pair (appendV v1 v2) s2 z = lam $ \s -> dirac (pair empty s) m a = lam $ \s -> (`unpair` pair . array (nat_ 1) . const) <$> app a s invgamma :: (ABT Term abt) => abt '[] 'HProb -> abt '[] 'HProb -> abt '[] ('HMeasure 'HProb) invgamma k t = recip <$> gamma k (recip t) exponential :: (ABT Term abt) => abt '[] 'HProb -> abt '[] ('HMeasure 'HProb) exponential = gamma (prob_ 1) chi2 :: (ABT Term abt) => abt '[] 'HProb -> abt '[] ('HMeasure 'HProb) chi2 v = gamma (v / prob_ 2) (prob_ 2) cauchy :: (ABT Term abt) => abt '[] 'HReal -> abt '[] 'HProb -> abt '[] ('HMeasure 'HReal) cauchy loc scale = normal (real_ 0) (prob_ 1) >>= \x -> normal (real_ 0) (prob_ 1) >>= \y -> dirac $ loc + fromProb scale * x / y laplace :: (ABT Term abt) => abt '[] 'HReal -> abt '[] 'HProb -> abt '[] ('HMeasure 'HReal) laplace loc scale = exponential (prob_ 1) >>= \v -> normal (real_ 0) (prob_ 1) >>= \z -> dirac $ loc + z * fromProb (scale * sqrt (prob_ 2 * v)) studentT :: (ABT Term abt) => abt '[] 'HReal -> abt '[] 'HProb -> abt '[] 'HProb -> abt '[] ('HMeasure 'HReal) studentT loc scale v = normal loc scale >>= \z -> chi2 v >>= \df -> dirac $ z * fromProb (sqrt (v / df)) weibull :: (ABT Term abt) => abt '[] 'HProb -> abt '[] 'HProb -> abt '[] ('HMeasure 'HProb) weibull b k = exponential (prob_ 1) >>= \x -> dirac $ b * x ** recip k bern :: (ABT Term abt) => abt '[] 'HProb -> abt '[] ('HMeasure HBool) bern p = categorical (arrayLit [p, prob_ 1 `unsafeMinusProb` p]) >>= \i -> dirac (arrayLit [true, false] ! i) mix :: (ABT Term abt) => abt '[] ('HArray 'HProb) -> abt '[] ('HMeasure 'HNat) mix v = withWeight (sumV v) (categorical v) binomial :: (ABT Term abt) => abt '[] 'HNat -> abt '[] 'HProb -> abt '[] ('HMeasure 'HInt) binomial n p = sumV <$> plate n (const $ ((\b -> if_ b (int_ 1) (int_ 0)) <$> bern p)) -- BUG: would it be better to 'observe' that @p >= 1@ before doing everything? At least that way things would be /defined/ for all inputs... negativeBinomial :: (ABT Term abt) => abt '[] 'HNat -> abt '[] 'HProb -- N.B., must actually be between 0 and 1 -> abt '[] ('HMeasure 'HNat) negativeBinomial r p = gamma (nat2prob r) (recip (recip p `unsafeMinusProb` prob_ 1)) >>= poisson geometric :: (ABT Term abt) => abt '[] 'HProb -> abt '[] ('HMeasure 'HNat) geometric = negativeBinomial (nat_ 1) multinomial :: (ABT Term abt) => abt '[] 'HNat -> abt '[] ('HArray 'HProb) -> abt '[] ('HMeasure ('HArray 'HProb)) multinomial n v = reduce (liftM2 (zipWithV (+))) (dirac (constV (size v) (prob_ 0))) (constV n (unitV (size v) <$> categorical v)) dirichlet :: (ABT Term abt) => abt '[] ('HArray 'HProb) -> abt '[] ('HMeasure ('HArray 'HProb)) dirichlet a = normalizeV <$> plate (size a) (\ i -> a ! i `gamma` prob_ 1) ---------------------------------------------------------------- ----------------------------------------------------------- fin.
zachsully/hakaru
haskell/Language/Hakaru/Syntax/Prelude.hs
bsd-3-clause
53,513
2
20
14,379
19,728
10,188
9,540
1,139
8
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Main where import Ballast.Client import Ballast.Types import Data.Maybe (fromJust) import Data.Monoid ((<>)) import qualified Data.Text as T import Data.Time (Day(..), secondsToDiffTime) import Data.Time.Clock (UTCTime(..), getCurrentTime, utctDayTime) import Network.HTTP.Client (Manager, newManager) import Network.HTTP.Client.TLS (tlsManagerSettings) import Safe (headMay, lastMay) import Test.Hspec import Test.Hspec.Expectations.Contrib (isRight) exampleItems :: SKU -> Items exampleItems productSku = [ItemInfo (productSku, Quantity 5)] exampleShipTo :: ShipTo exampleShipTo = ShipTo (AddressLine "6501 Railroad Avenue SE") (AddressLine "Room 315") (AddressLine "") (City "Snoqualmie") (PostalCode "85283") (Region "WA") (Country "US") Commercial NotPoBox exampleCreateReceiving :: SKU -> CreateReceiving exampleCreateReceiving productSku = CreateReceiving Nothing Nothing (Just $ ExpectedDate $ UTCTime (ModifiedJulianDay 155000) (secondsToDiffTime 10)) (ReceivingOptions Nothing Nothing $ Just $ WarehouseRegion "TEST 1") (ReceivingArrangement ArrangementTypeNone Nothing Nothing) (ReceivingShipments [ReceivingShipment Nothing Nothing Nothing Nothing $ Type "box"]) Nothing Nothing (ReceivingItems [ReceivingItem productSku (Quantity 5)]) (ReceivingShipFrom Nothing (Name "Stephen Alexander") (AddressLine "11 Prsilla St") Nothing (City "New York") (State "NY") (PostalCode "12345") (Country "USA") (Phone "12346")) Nothing exampleBadCreateReceiving :: CreateReceiving exampleBadCreateReceiving = CreateReceiving Nothing Nothing (Just $ ExpectedDate $ UTCTime (ModifiedJulianDay 100000) (secondsToDiffTime 10)) (ReceivingOptions Nothing Nothing $ Just $ WarehouseRegion "TEST 1") (ReceivingArrangement ArrangementTypeNone Nothing Nothing) (ReceivingShipments [ReceivingShipment Nothing Nothing Nothing Nothing $ Type "box"]) Nothing Nothing (ReceivingItems [ReceivingItem (SKU "HspecTest8") (Quantity 0)]) (ReceivingShipFrom Nothing (Name "Stephen Alexander") (AddressLine "11 Prsilla St") Nothing (City "New York") (State "NY") (PostalCode "12345") (Country "TestCountry") (Phone "12346")) Nothing exampleModifiedReceiving :: ModifyReceiving exampleModifiedReceiving = CreateReceiving Nothing Nothing (Just $ ExpectedDate $ UTCTime (ModifiedJulianDay 100000) (secondsToDiffTime 10)) (ReceivingOptions Nothing Nothing $ Just $ WarehouseRegion "TEST 1") (ReceivingArrangement ArrangementTypeNone Nothing Nothing) (ReceivingShipments [ReceivingShipment Nothing Nothing Nothing Nothing $ Type "box"]) Nothing Nothing (ReceivingItems [ReceivingItem (SKU "HspecTest8") (Quantity 5)]) (ReceivingShipFrom Nothing (Name "Stephen Alexander") (AddressLine "11 Prsilla St") Nothing (City "New York") (State "NY") (PostalCode "12345") (Country "Modified Country") (Phone "12346")) Nothing -- | Takes a product id as an integer and inserts it in the right spot. exampleCreateProduct :: ProductId -> [CreateProductsWrapper] exampleCreateProduct productId = [CpwVirtualKit $ VirtualKit Nothing (SKU "HspecTestVKit") VirtualKitClassification (Description "This is a virtual kit test") (VirtualKitContent [VirtualKitContentObject (Just productId) Nothing (Quantity 5) ] ), CpwKit $ Kit Nothing (SKU "HspecTestKit") Nothing KitClassification (Description "This is a kit test") HasLooseBatteryConfiguration (Just $ HsCode "010612") (Just $ CountryOfOrigin "US") (KitValues (CostValue 1) (WholesaleValue 2) (RetailValue 4) (Just $ CostCurrency "USD") (Just $ WholesaleCurrency "USD") (Just $ RetailCurrency "USD") ) (Just $ KitAlternateNames [KitAlternateName (Name "HspecTestAlt")]) -- KitContentObject needs to include ids of other products -- included in this kit. We use a helper function to create a -- product and get back that product's id. (KitContent [KitContentObject (Just productId) Nothing (Quantity 5) ] ) (KitDimensions (KitLength 2) (KitWidth 2) (KitHeight 2) (KitWeight 2) ) (Just $ KitTechnicalData (KitTechnicalDataBattery (BatteryType "ALKALINE") (Just $ BatteryWeight 3) (Just $ NumberOfBatteries 5) (Just $ Capacity 6) (Just $ NumberOfCells 7) (Just $ CapacityUnit "WATTHOUR") ) ) Nothing Nothing Nothing Nothing, CpwMarketingInsert $ MarketingInsert Nothing (SKU "HspecTestInsert3") Nothing MarketingInsertClassification (Description "Hspec test marketing insert2") (InclusionRuleType "CUSTOM") (Just $ MarketingInsertAlternateNames [MarketingInsertAlternateName (Name "HspecMI3")]) (MarketingInsertDimensions (MarketingInsertLength 0.1) (MarketingInsertWidth 0.1) (MarketingInsertHeight 0.1) (MarketingInsertWeight 0.2) ) Nothing (Just $ MarketingInsertInclusionRules (Just $ InsertAfterDate $ UTCTime (ModifiedJulianDay 160000) (secondsToDiffTime 10)) (Just $ InsertBeforeDate $ UTCTime (ModifiedJulianDay 160000) (secondsToDiffTime 10)) (Just $ InsertWhenWorthValue 5) (Just $ InsertWhenQuantity 5) (Just $ InsertWhenWorthCurrency "USD") ) (MarketingInsertMasterCase (IndividualItemsPerCase 10) (SKU "HspecTestMIMCSKU") Nothing (Description "Hspec test marketing insert master case2") (MarketingInsertMasterCaseDimensions (MarketingInsertMasterCaseDimensionsLength 8) (MarketingInsertMasterCaseDimensionsWidth 8) (MarketingInsertMasterCaseDimensionsHeight 8) (MarketingInsertMasterCaseDimensionsWeight 8) ) ), CpwBaseProduct $ BaseProduct Nothing (SKU "HspecTest9") Nothing BaseProductClassification (Description "Hspec test product2") Nothing Nothing (Category "TOYS_SPORTS_HOBBIES") NoBatteryConfiguration (Values (CostValue 1) Nothing (RetailValue 4) (Just $ CostCurrency "USD") (Just $ WholesaleCurrency "USD") (Just $ RetailCurrency "USD") ) Nothing (BaseProductDimensions (BaseProductLength 10) (BaseProductWidth 10) (BaseProductHeight 10) (BaseProductWeight 10) ) Nothing Nothing Nothing Nothing Nothing ] exampleModifyProducts :: Id -> SKU -> [CreateProductsWrapper] exampleModifyProducts i sku = [ CpwBaseProduct $ BaseProduct (Just i) sku Nothing BaseProductClassification (Description "Modified description") Nothing Nothing (Category "TOYS_SPORTS_HOBBIES") NoBatteryConfiguration (Values (CostValue 1) Nothing (RetailValue 4) (Just $ CostCurrency "USD") (Just $ WholesaleCurrency "USD") (Just $ RetailCurrency "USD")) Nothing (BaseProductDimensions (BaseProductLength 10) (BaseProductWidth 10) (BaseProductHeight 10) (BaseProductWeight 10)) Nothing Nothing Nothing Nothing Nothing ] exampleModifyProduct :: Id -> SKU -> CreateProductsWrapper exampleModifyProduct prId prSku = CpwBaseProduct $ BaseProduct (Just prId) prSku Nothing BaseProductClassification (Description "Modified description") Nothing Nothing (Category "TOYS_SPORTS_HOBBIES") NoBatteryConfiguration (Values (CostValue 1) Nothing (RetailValue 4) (Just $ CostCurrency "USD") (Just $ WholesaleCurrency "USD") (Just $ RetailCurrency "USD")) Nothing (BaseProductDimensions (BaseProductLength 10) (BaseProductWidth 10) (BaseProductHeight 10) (BaseProductWeight 10)) Nothing Nothing Nothing Nothing Nothing exampleCreateBaseProduct :: T.Text -> [CreateProductsWrapper] exampleCreateBaseProduct randomSecond = [ CpwBaseProduct $ BaseProduct Nothing (SKU $ "Test" <> randomSecond) (Just $ ExternalId $ "test" <> randomSecond) BaseProductClassification (Description "Hspec test product5") (Just $ HsCode "010612") (Just $ CountryOfOrigin "US") (Category "TOYS_SPORTS_HOBBIES") NoBatteryConfiguration (Values (CostValue 1) Nothing (RetailValue 4) (Just $ CostCurrency "USD") (Just $ WholesaleCurrency "USD") (Just $ RetailCurrency "USD")) Nothing (BaseProductDimensions (BaseProductLength 10) (BaseProductWidth 10) (BaseProductHeight 10) (BaseProductWeight 10)) Nothing (Just $ BaseProductFlags PackagedReadyToShip NotFragile NotDangerous NotPerishable NotMedia NotAdult NotLiquid NoInnerPack NoMasterCase NoPallet) Nothing Nothing Nothing ] exampleOrder :: T.Text -> SKU -> CreateOrder exampleOrder randomPart productSku = CreateOrder Nothing (Just $ OrderNo (T.concat ["testorder", randomPart])) Nothing Nothing (Just $ CreateOrderOptions (Just $ WarehouseId 10281) Nothing Nothing Nothing DomesticOneDay Nothing NotSameDay (Just DontForceDuplicate) (Just DontForceAddress) Nothing Nothing Nothing USD Nothing Nothing Nothing Nothing Nothing Nothing) Nothing (OrderShipTo (Just $ Email "[email protected]") (Name "Test Person") (Just $ Company "Best Company") (AddressLine "First line") (Just $ AddressLine "Second line 25") (Just $ AddressLine "") (City "Best city") (State "WA") (Just $ PostalCode "100100") (Country "US") (Phone "6315613729") NotCommercial (Just NotPoBox)) Nothing Nothing (OrderItems [ OrderItem (Just $ CommercialInvoiceValue 4.5) (Just $ CommercialInvoiceValueCurrency "USD") (Quantity 5) productSku ]) exampleAddress :: AddressToValidate exampleAddress = OrderShipTo (Just $ Email "[email protected]") (Name "Test Person") (Just $ Company "My Company") (AddressLine "3351 Michelson Dr STE 100") Nothing Nothing (City "Irvine") (State "CA") (Just $ PostalCode "92612-0697") (Country "US") (Phone "8885551212") Commercial Nothing createReceivingHelper :: ShipwireConfig -> Manager -> CreateReceiving -> IO (Either ShipwireError (ShipwireReturn CreateReceivingRequest), ReceivingId) createReceivingHelper conf manager cr = do receiving <- shipwireTest conf manager $ createReceiving cr let Right GenericResponse {..} = receiving Just ReceivingsResource {..} = genericResponseResource ReceivingsItems {..} = receivingsResponseItems case lastMay unReceivingsItems of Just ReceivingsItem {..} -> do let ReceivingsItemResource {..} = receivingsItemResource receivingId = T.pack $ show $ unId rirId return (receiving, ReceivingId receivingId) Nothing -> fail "Couldn't create this receiving, check your Shipwire dashboard" createBaseProductHelper :: ShipwireConfig -> Manager -> [CreateProductsWrapper] -> IO (Either ShipwireError (ShipwireReturn CreateProductsRequest), Id, SKU) createBaseProductHelper conf manager cp = do baseProduct <- shipwireTest conf manager $ createProduct cp let Right GetProductsResponse {..} = baseProduct GetProductsResponseResource {..} = gprResource GetProductsResponseResourceItems {..} = gprrItems case lastMay gprriItems of Just GetProductsResponseResourceItem {..} -> do let pwBaseProduct@(PwBaseProduct _) = gprriResource productId = bprId $ unwrapBaseProduct pwBaseProduct productSku = bprSku $ unwrapBaseProduct pwBaseProduct return (baseProduct, productId, productSku) Nothing -> fail "Couldn't create this product, check your Shipwire dashboard" createOrderHelper :: ShipwireConfig -> Manager -> CreateOrder -> IO (Either ShipwireError (ShipwireReturn CreateOrderRequest), Id) createOrderHelper conf manager co = do order <- shipwireTest conf manager $ createOrder co exampleOrd <- shipwireTest conf manager $ getOrders -&- (OrderNoParam $ getOrderNo co) let Right GenericResponse {..} = exampleOrd Just GetOrdersResponseResource {..} = genericResponseResource GetOrdersResponseResourceItems {..} = gorrItems case headMay gorriItems of Just GetOrdersResponseResourceItem {..} -> do let GetOrdersResponseResourceItemResource {..} = gorriResource return (order, gorrirId) Nothing -> fail "Couldn't get this order back, check your Shipwire dashboard." getOrderNo :: CreateOrder -> [T.Text] getOrderNo co = [unOrderNo $ fromJust $ coOrderNo co] getTimestamp :: IO T.Text getTimestamp = do x <- getCurrentTime let prec = show $ utctDayTime x result = T.pack $ takeWhile (/= '.') . reverse $ prec return result -- | This function unwraps the wrappers for each type of product and gets all of those products' ids -- It helps retire the products to clean up after the tests. getProductIds :: GetProductsResponse -> IO [Integer] getProductIds products = do let getProductsResponseResource = gprResource products getProductsResponseResourceItems = gprrItems getProductsResponseResource responseResourceItems = gprriItems getProductsResponseResourceItems productWrappers = map gprriResource responseResourceItems unwrappedBaseProducts = unwrapPwBaseProduct productWrappers unwrappedMarketingInserts = unwrapPwMarketingInsert productWrappers unwrappedKits = unwrapPwKit productWrappers unwrappedVirtualKits = unwrapPwVirtualKit productWrappers baseProductIds = map (unId . bprId) unwrappedBaseProducts marketingInsertIds = map (unId . mirId) unwrappedMarketingInserts kitIds = map (unId . krId) unwrappedKits virtualKitIds = map (unId . vkrId) unwrappedVirtualKits allIds = baseProductIds <> marketingInsertIds <> kitIds <> virtualKitIds return allIds getModifiedProductsIds :: ModifyProductsResponse -> IO [Integer] getModifiedProductsIds products = do let getProductsResponseResource = mprResource products getProductsResponseResourceItems = gprrItems getProductsResponseResource responseResourceItems = gprriItems getProductsResponseResourceItems productWrappers = map gprriResource responseResourceItems unwrappedBaseProducts = unwrapPwBaseProduct productWrappers unwrappedMarketingInserts = unwrapPwMarketingInsert productWrappers unwrappedKits = unwrapPwKit productWrappers unwrappedVirtualKits = unwrapPwVirtualKit productWrappers baseProductIds = map (unId . bprId) unwrappedBaseProducts marketingInsertIds = map (unId . mirId) unwrappedMarketingInserts kitIds = map (unId . krId) unwrappedKits virtualKitIds = map (unId . vkrId) unwrappedVirtualKits allIds = baseProductIds <> marketingInsertIds <> kitIds <> virtualKitIds return allIds getAllReceivingsIds :: GenericResponse ReceivingsResource -> IO [Integer] getAllReceivingsIds rr = do let (Just receivingsResource) = genericResponseResource rr receivingsItems = receivingsResponseItems receivingsResource ids = map (unId . rirId . receivingsItemResource) $ unReceivingsItems receivingsItems return ids unwrapBaseProduct :: ProductsWrapper -> BaseProductResponseResource unwrapBaseProduct (PwBaseProduct x) = x unwrapBaseProduct _ = error "Bad input" unwrapMarketingInsert :: ProductsWrapper -> MarketingInsertResponseResource unwrapMarketingInsert (PwMarketingInsert x) = x unwrapMarketingInsert _ = error "Bad input" unwrapPwBaseProduct :: [ProductsWrapper] -> [BaseProductResponseResource] unwrapPwBaseProduct [] = [] unwrapPwBaseProduct (PwBaseProduct x:xs) = x : unwrapPwBaseProduct xs unwrapPwBaseProduct (_:xs) = unwrapPwBaseProduct xs unwrapPwMarketingInsert :: [ProductsWrapper] -> [MarketingInsertResponseResource] unwrapPwMarketingInsert [] = [] unwrapPwMarketingInsert (PwMarketingInsert x:xs) = x : unwrapPwMarketingInsert xs unwrapPwMarketingInsert (_:xs) = unwrapPwMarketingInsert xs unwrapPwKit :: [ProductsWrapper] -> [KitResponseResource] unwrapPwKit [] = [] unwrapPwKit (PwKit x:xs) = x : unwrapPwKit xs unwrapPwKit (_:xs) = unwrapPwKit xs unwrapPwVirtualKit :: [ProductsWrapper] -> [VirtualKitResponseResource] unwrapPwVirtualKit [] = [] unwrapPwVirtualKit (PwVirtualKit x:xs) = x : unwrapPwVirtualKit xs unwrapPwVirtualKit (_:xs) = unwrapPwVirtualKit xs main :: IO () main = do manager <- newManager tlsManagerSettings config <- sandboxEnvConfig hspec $ parallel $ do describe "get rates" $ do it "gets the correct rates" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart let getRt = GetRate (RateOptions USD GroupByAll Nothing Nothing Nothing (Just IgnoreUnknownSkus) CanSplit (WarehouseArea "US") Nothing Nothing Nothing) (RateOrder exampleShipTo (exampleItems productSku)) result <- shipwireTest config manager $ createRateRequest getRt result `shouldSatisfy` isRight _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] let Right GenericResponse {..} = result genericResponseWarnings `shouldBe` Nothing genericResponseErrors `shouldBe` Nothing describe "get stock info" $ do it "gets stock info with optional args" $ do randomPart <- getTimestamp (_, productId, _) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart result <- shipwireTest config manager $ getStockInfo -&- SKU "HspecTest5" _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] result `shouldSatisfy` isRight let Right GenericResponse {..} = result genericResponseWarnings `shouldBe` Nothing genericResponseErrors `shouldBe` Nothing describe "get receivings" $ do it "gets an itemized list of receivings with optional args" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (_, receivingId) <- createReceivingHelper config manager $ exampleCreateReceiving productSku result <- shipwireTest config manager $ getReceivings -&- (ExpandReceivingsParam [ExpandAll]) -&- (ReceivingStatusParams [StatusCanceled]) -&- WarehouseIdParam ["TEST 1"] -&- (UpdatedAfter (UTCTime (ModifiedJulianDay 88000) (secondsToDiffTime 10))) _ <- shipwireTest config manager $ cancelReceiving receivingId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] result `shouldSatisfy` isRight describe "create a new receiving" $ do it "creates a new receiving with optional args" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (receiving, receivingId) <- createReceivingHelper config manager $ exampleCreateReceiving productSku receiving `shouldSatisfy` isRight _ <- shipwireTest config manager $ cancelReceiving receivingId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] let Right GenericResponse {..} = receiving genericResponseErrors `shouldBe` Nothing genericResponseWarnings `shouldBe` Nothing it "doesn't create a receiving with bad JSON" $ do randomPart <- getTimestamp (_, productId, _) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart result <- shipwireTest config manager $ createReceiving exampleBadCreateReceiving _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] let Right GenericResponse {..} = result genericResponseErrors `shouldBe` Just (ResponseErrors [ Error (ErrorCodeText "orderSubmitFailed") (ErrorMessage "Item quantity too low, please insert a quantity greater than 2.") ErrorError ]) describe "get information about a receiving" $ do it "gets info about a receiving" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (_, receivingId) <- createReceivingHelper config manager $ exampleCreateReceiving productSku result <- shipwireTest config manager $ getReceiving receivingId -&- ExpandReceivingsParam [ExpandHolds, ExpandItems] result `shouldSatisfy` isRight _ <- shipwireTest config manager $ cancelReceiving receivingId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] let Right GenericResponse {..} = result genericResponseErrors `shouldBe` Nothing genericResponseWarnings `shouldBe` Nothing describe "modify information about a receiving" $ do it "modifies info about a receiving" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (_, receivingId) <- createReceivingHelper config manager $ exampleCreateReceiving productSku result <- shipwireTest config manager $ modifyReceiving receivingId exampleModifiedReceiving result `shouldSatisfy` isRight let Right modifyReceivingResponse = result genericResponseErrors modifyReceivingResponse `shouldBe` Nothing genericResponseWarnings modifyReceivingResponse `shouldBe` Nothing modifiedReceiving <- shipwireTest config manager $ getReceiving receivingId _ <- shipwireTest config manager $ cancelReceiving receivingId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] let Right GenericResponse {..} = modifiedReceiving Just ReceivingsItemResource {..} = genericResponseResource ItemResourceShipFrom {..} = rirShipFrom ItemResourceShipFromResource {..} = irsfResource irsfrCountry `shouldBe` Just (Country "Modified Country") describe "cancel a receiving" $ do it "cancels a receiving" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (_, receivingId) <- createReceivingHelper config manager $ exampleCreateReceiving productSku result <- shipwireTest config manager $ cancelReceiving receivingId result `shouldSatisfy` isRight _ <- shipwireTest config manager $ cancelReceiving receivingId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] let Right SimpleResponse {..} = result message `shouldBe` ResponseMessage "Receiving was cancelled" describe "cancel shipping labels" $ do it "cancels shipping labels on a receiving" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (_, receivingId) <- createReceivingHelper config manager $ exampleCreateReceiving productSku result <- shipwireTest config manager $ cancelReceivingLabels receivingId result `shouldSatisfy` isRight _ <- shipwireTest config manager $ cancelReceiving receivingId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] let Right SimpleResponse {..} = result message `shouldBe` ResponseMessage "Labels cancelled" describe "get list of holds for a receiving" $ do it "gets a list of holds for a receiving" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (_, receivingId) <- createReceivingHelper config manager $ exampleCreateReceiving productSku result <- shipwireTest config manager $ getReceivingHolds receivingId -&- IncludeCleared result `shouldSatisfy` isRight _ <- shipwireTest config manager $ cancelReceiving receivingId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] let Right GenericResponse {..} = result genericResponseWarnings `shouldBe` Nothing genericResponseErrors `shouldBe` Nothing describe "get email recipients and instructions for a receiving" $ do it "gets email recipients and instructions for a receiving" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (_, receivingId) <- createReceivingHelper config manager $ exampleCreateReceiving productSku result <- shipwireTest config manager $ getReceivingInstructionsRecipients receivingId result `shouldSatisfy` isRight _ <- shipwireTest config manager $ cancelReceiving receivingId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] let Right GenericResponse {..} = result genericResponseWarnings `shouldBe` Nothing genericResponseErrors `shouldBe` Nothing describe "get contents of a receiving" $ do it "gets contents of a receiving" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (_, receivingId) <- createReceivingHelper config manager $ exampleCreateReceiving productSku result <- shipwireTest config manager $ getReceivingItems receivingId result `shouldSatisfy` isRight _ <- shipwireTest config manager $ cancelReceiving receivingId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] let Right GenericResponse {..} = result genericResponseWarnings `shouldBe` Nothing genericResponseErrors `shouldBe` Nothing describe "get shipping dimension and container information" $ do it "gets shipping dimension and container infromation" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (_, receivingId) <- createReceivingHelper config manager $ exampleCreateReceiving productSku result <- shipwireTest config manager $ getReceivingShipments receivingId result `shouldSatisfy` isRight _ <- shipwireTest config manager $ cancelReceiving receivingId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] let Right GenericResponse {..} = result genericResponseWarnings `shouldBe` Nothing genericResponseErrors `shouldBe` Nothing describe "get tracking information for a receiving" $ do it "gets tracking information for a receiving" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (_, receivingId) <- createReceivingHelper config manager $ exampleCreateReceiving productSku result <- shipwireTest config manager $ getReceivingTrackings receivingId result `shouldSatisfy` isRight _ <- shipwireTest config manager $ cancelReceiving receivingId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] let Right GenericResponse {..} = result genericResponseWarnings `shouldBe` Nothing genericResponseErrors `shouldBe` Nothing describe "get labels information for a receiving" $ do it "gets labels information for a receiving" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (_, receivingId) <- createReceivingHelper config manager $ exampleCreateReceiving productSku result <- shipwireTest config manager $ getReceivingLabels receivingId result `shouldSatisfy` isRight _ <- shipwireTest config manager $ cancelReceiving receivingId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] let Right GenericResponse {..} = result genericResponseWarnings `shouldBe` Nothing genericResponseErrors `shouldBe` Nothing describe "get an itemized list of products" $ do it "gets an itemized list of products" $ do randomPart <- getTimestamp (_, productId, _) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart result <- shipwireTest config manager getProducts result `shouldSatisfy` isRight _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] let Right GetProductsResponse {..} = result gprWarnings `shouldBe` Nothing gprErrors `shouldBe` Nothing describe "create a product" $ do it "creates all possible product classifications" $ do randomPart <- getTimestamp (prd, productId, _) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart prd `shouldSatisfy` isRight let Right GetProductsResponse {..} = prd _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] gprWarnings `shouldBe` Nothing gprErrors `shouldBe` Nothing describe "modify products" $ do it "modifies several previously created products" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart result <- shipwireTest config manager $ modifyProducts $ exampleModifyProducts productId productSku result `shouldSatisfy` isRight let Right GenericResponse {..} = result _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] genericResponseWarnings `shouldBe` Nothing genericResponseErrors `shouldBe` Nothing describe "modify a product" $ do it "modifies a single product" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart result <- shipwireTest config manager $ modifyProduct (exampleModifyProduct productId productSku) productId result `shouldSatisfy` isRight let Right GenericResponse {..} = result _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] genericResponseWarnings `shouldBe` Nothing genericResponseErrors `shouldBe` Nothing describe "get a product" $ do it "gets information about a single product" $ do randomPart <- getTimestamp (_, productId, _) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart result <- shipwireTest config manager $ getProduct productId result `shouldSatisfy` isRight _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] let Right GenericResponse {..} = result genericResponseStatus `shouldNotBe` ResponseStatus 404 genericResponseWarnings `shouldBe` Nothing genericResponseErrors `shouldBe` Nothing describe "retire a product" $ do it "retires a product" $ do randomPart <- getTimestamp (_, productId, _) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart result <- shipwire config $ retireProducts $ ProductsToRetire [productId] let Right RetireProductsResponse {..} = result MoreInfo {..} = fromJust rprMoreInfo status <- case lastMay miItems of Just MoreInfoItems {..} -> case lastMay miiItems of Just MoreInfoItem {..} -> do let status@Status {..} = miiStatus return status Nothing -> fail "Couldn't retire this product, check your Shipwire dashboard" Nothing -> fail "Couldn't retire this product, check your Shipwire dashboard" result `shouldSatisfy` isRight status `shouldBe` Status "deprecated" describe "create an order" $ do it "creates an order" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (result, orderId) <- createOrderHelper config manager $ exampleOrder randomPart productSku _ <- shipwireTest config manager $ cancelOrder $ WrappedId orderId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] result `shouldSatisfy` isRight let Right GenericResponse {..} = result genericResponseWarnings `shouldBe` Nothing genericResponseErrors `shouldBe` Nothing describe "get orders" $ do it "gets all the orders" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (_, orderId) <- createOrderHelper config manager $ exampleOrder randomPart productSku result <- shipwireTest config manager getOrders _ <- shipwireTest config manager $ cancelOrder $ WrappedId orderId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] result `shouldSatisfy` isRight let Right GenericResponse {..} = result genericResponseWarnings `shouldBe` Nothing genericResponseErrors `shouldBe` Nothing describe "get an order" $ do it "gets an information about an order" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (_, orderId) <- createOrderHelper config manager $ exampleOrder randomPart productSku result <- shipwireTest config manager $ getOrder $ WrappedId orderId _ <- shipwireTest config manager $ cancelOrder $ WrappedId orderId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] result `shouldSatisfy` isRight let Right GenericResponse {..} = result genericResponseWarnings `shouldBe` Nothing genericResponseErrors `shouldBe` Nothing describe "cancel an order" $ do it "cancels an order" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (_, orderId) <- createOrderHelper config manager $ exampleOrder randomPart productSku result <- shipwireTest config manager $ cancelOrder $ WrappedId orderId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] result `shouldSatisfy` isRight let Right SimpleResponse {..} = result warnings `shouldBe` Nothing errors `shouldBe` Nothing message `shouldBe` ResponseMessage "Order cancelled" describe "get tracking information for this order" $ do it "gets tracking information for this order" $ do randomPart <- getTimestamp (_, productId, productSku) <- createBaseProductHelper config manager $ exampleCreateBaseProduct randomPart (_, orderId) <- createOrderHelper config manager $ exampleOrder randomPart productSku result <- shipwireTest config manager $ getOrderTrackings $ WrappedId orderId _ <- shipwireTest config manager $ cancelOrder $ WrappedId orderId _ <- shipwireTest config manager $ retireProducts $ ProductsToRetire [productId] result `shouldSatisfy` isRight let Right GenericResponse {..} = result genericResponseWarnings `shouldBe` Nothing genericResponseErrors `shouldBe` Nothing describe "validate address" $ do it "validates an address" $ do result <- shipwireTest config manager $ validateAddress exampleAddress result `shouldSatisfy` isRight let Right ValidateAddressResponse {..} = result varMessage `shouldBe` ResponseMessage "The address provided is valid" varWarnings `shouldBe` Nothing varErrors `shouldBe` Nothing
bitemyapp/ballast
tests/tests.hs
bsd-3-clause
40,944
0
30
12,273
9,162
4,425
4,737
815
3
{-# LANGUAGE TypeOperators, DeriveGeneric, DefaultSignatures, DeriveAnyClass, FlexibleContexts #-} -- Source: -- Section 7.5.4, "Deriving Typeable instances" -- Section 7.6.1.4, "Default method signatures" -- Section 7.5.6, "Deriving any other class" -- Just a simple example of using GHC.Generics as a warm-up exercise towards the -- intended use in ../ARSim/ module GenPut (module GenPut, module GHC.Generics) where import GHC.Generics {- -- From GHC.Generics: -- | Unit: used for constructors without arguments data U1 p = U1 -- | Constants, additional parameters and recursion of kind * newtype K1 i c p = K1 { unK1 :: c } -- | Meta-information (constructor names, etc.) newtype M1 i c f p = M1 { unM1 :: f p } -- | Sums: encode choice between constructors infixr 5 :+: data (:+:) f g p = L1 (f p) | R1 (g p) -- | Products: encode multiple arguments to constructors infixr 6 :*: data (:*:) f g p = f p :*: g p class Generic a where -- Encode the representation of a user datatype type Rep a :: * -> * -- Convert from the datatype to its representation from :: a -> (Rep a) x -- Convert from the representation to the datatype to :: (Rep a) x -> a class Generic1 f where type Rep1 f :: * -> * from1 :: f a -> Rep1 f a to1 :: Rep1 f a -> f a -} data Bin = O | I deriving Show class GSerialize f where gput :: f a -> [Bin] instance GSerialize U1 where gput U1 = [] instance (GSerialize a, GSerialize b) => GSerialize (a :*: b) where gput (x :*: y) = gput x ++ gput y instance (GSerialize a, GSerialize b) => GSerialize (a :+: b) where gput (L1 x) = O : gput x gput (R1 x) = I : gput x instance (GSerialize a) => GSerialize (M1 i c a) where gput (M1 x) = gput x instance (Serialize a) => GSerialize (K1 i a) where gput (K1 x) = put x class Serialize a where put :: a -> [Bin] default put :: (Generic a, GSerialize (Rep a)) => a -> [Bin] put = gput . from
josefs/autosar
generics/GenPut.hs
bsd-3-clause
1,938
0
11
452
362
193
169
22
0
{-| Module : Idris.Docs Description : Data structures and utilities to work with Idris Documentation. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE DeriveFunctor, MultiWayIf, PatternGuards #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module Idris.Docs ( pprintDocs , getDocs, pprintConstDocs, pprintTypeDoc , FunDoc, FunDoc'(..), Docs, Docs'(..) ) where import Idris.AbsSyntax import Idris.AbsSyntaxTree import Idris.Core.Evaluate import Idris.Core.TT import Idris.Delaborate import Idris.Docstrings (DocTerm, Docstring, emptyDocstring, noDocs, nullDocstring, overview, renderDocTerm, renderDocstring) import Util.Pretty import Prelude hiding ((<$>)) import Control.Arrow (first) import Data.List import Data.Maybe import qualified Data.Text as T -- TODO: Only include names with public/export accessibility -- -- Issue #1573 on the Issue tracker. -- https://github.com/idris-lang/Idris-dev/issues/1573 data FunDoc' d = FD Name d [(Name, PTerm, Plicity, Maybe d)] -- args: name, ty, implicit, docs PTerm -- function type (Maybe Fixity) deriving Functor type FunDoc = FunDoc' (Docstring DocTerm) data Docs' d = FunDoc (FunDoc' d) | DataDoc (FunDoc' d) -- type constructor docs [FunDoc' d] -- data constructor docs | InterfaceDoc Name d -- interface docs [FunDoc' d] -- method docs [(Name, Maybe d)] -- parameters and their docstrings [(Maybe Name, PTerm, (d, [(Name, d)]))] -- implementations: name for named implementations, the constraint term, the docs [PTerm] -- sub interfaces [PTerm] -- super interfaces (Maybe (FunDoc' d)) -- explicit constructor | RecordDoc Name d -- record docs (FunDoc' d) -- data constructor docs [FunDoc' d] -- projection docs [(Name, PTerm, Maybe d)] -- parameters with type and doc | NamedImplementationDoc Name (FunDoc' d) -- name is interface | ModDoc [String] -- Module name d deriving Functor type Docs = Docs' (Docstring DocTerm) showDoc ist d | nullDocstring d = empty | otherwise = text " -- " <> renderDocstring (renderDocTerm (pprintDelab ist) (normaliseAll (tt_ctxt ist) [])) d pprintFD :: IState -> Bool -> Bool -> FunDoc -> Doc OutputAnnotation pprintFD ist totalityFlag nsFlag (FD n doc args ty f) = nest 4 (prettyName True nsFlag [] n <+> colon <+> pprintPTerm ppo [] [ n | (n@(UN n'),_,_,_) <- args , not (T.isPrefixOf (T.pack "__") n') ] infixes ty -- show doc <$> renderDocstring (renderDocTerm (pprintDelab ist) (normaliseAll (tt_ctxt ist) [])) doc -- show fixity <$> maybe empty (\f -> text (show f) <> line) f -- show arguments doc <> let argshow = showArgs args [] in (if not (null argshow) then nest 4 $ text "Arguments:" <$> vsep argshow else empty) -- show totality status <> let totality = getTotality in (if totalityFlag && not (null totality) then line <> (vsep . map (\t -> text "The function is" <+> t) $ totality) else empty)) where ppo = ppOptionIst ist infixes = idris_infixes ist -- Recurse over and show the Function's Documented arguments showArgs ((n, ty, Exp {}, Just d):args) bnd = -- Explicitly bound. bindingOf n False <+> colon <+> pprintPTerm ppo bnd [] infixes ty <> showDoc ist d <> line : showArgs args ((n, False):bnd) showArgs ((n, ty, Constraint {}, Just d):args) bnd = -- Interface constraints. text "Interface constraint" <+> pprintPTerm ppo bnd [] infixes ty <> showDoc ist d <> line : showArgs args ((n, True):bnd) showArgs ((n, ty, Imp {}, Just d):args) bnd = -- Implicit arguments. text "(implicit)" <+> bindingOf n True <+> colon <+> pprintPTerm ppo bnd [] infixes ty <> showDoc ist d <> line : showArgs args ((n, True):bnd) showArgs ((n, ty, TacImp{}, Just d):args) bnd = -- Tacit implicits text "(auto implicit)" <+> bindingOf n True <+> colon <+> pprintPTerm ppo bnd [] infixes ty <> showDoc ist d <> line : showArgs args ((n, True):bnd) showArgs ((n, _, _, _):args) bnd = -- Anything else showArgs args ((n, True):bnd) showArgs [] _ = [] -- end of arguments getTotality = map (text . show) $ lookupTotal n (tt_ctxt ist) pprintFDWithTotality :: IState -> Bool -> FunDoc -> Doc OutputAnnotation pprintFDWithTotality ist = pprintFD ist True pprintFDWithoutTotality :: IState -> Bool -> FunDoc -> Doc OutputAnnotation pprintFDWithoutTotality ist = pprintFD ist False pprintDocs :: IState -> Docs -> Doc OutputAnnotation pprintDocs ist (FunDoc d) = pprintFDWithTotality ist True d pprintDocs ist (DataDoc t args) = text "Data type" <+> pprintFDWithoutTotality ist True t <$> if null args then text "No constructors." else nest 4 (text "Constructors:" <> line <> vsep (map (pprintFDWithoutTotality ist False) args)) pprintDocs ist (InterfaceDoc n doc meths params implementations sub_interfaces super_interfaces ctor) = nest 4 (text "Interface" <+> prettyName True (ppopt_impl ppo) [] n <> if nullDocstring doc then empty else line <> renderDocstring (renderDocTerm (pprintDelab ist) (normaliseAll (tt_ctxt ist) [])) doc) <> line <$> nest 4 (text "Parameters:" <$> prettyParameters) <> line <$> nest 4 (text "Methods:" <$> vsep (map (pprintFDWithTotality ist False) meths)) <$> maybe empty ((<> line) . nest 4 . (text "Implementation constructor:" <$>) . pprintFDWithoutTotality ist False) ctor <> nest 4 (text "Implementations:" <$> vsep (if null implementations then [text "<no implementations>"] else map pprintImplementation normalImplementations)) <> (if null namedImplementations then empty else line <$> nest 4 (text "Named implementations:" <$> vsep (map pprintImplementation namedImplementations))) <> (if null sub_interfaces then empty else line <$> nest 4 (text "Child interfaces:" <$> vsep (map (dumpImplementation . prettifySubInterfaces) sub_interfaces))) <> (if null super_interfaces then empty else line <$> nest 4 (text "Default parent implementations:" <$> vsep (map dumpImplementation super_interfaces))) where params' = zip pNames (repeat False) (normalImplementations, namedImplementations) = partition (\(n, _, _) -> not $ isJust n) implementations pNames = map fst params ppo = ppOptionIst ist infixes = idris_infixes ist pprintImplementation (mname, term, (doc, argDocs)) = nest 4 (iname mname <> dumpImplementation term <> (if nullDocstring doc then empty else line <> renderDocstring (renderDocTerm (pprintDelab ist) (normaliseAll (tt_ctxt ist) [])) doc) <> if null argDocs then empty else line <> vsep (map (prettyImplementationParam (map fst argDocs)) argDocs)) iname Nothing = empty iname (Just n) = annName n <+> colon <> space prettyImplementationParam params (name, doc) = if nullDocstring doc then empty else prettyName True False (zip params (repeat False)) name <+> showDoc ist doc -- if any (isJust . snd) params -- then vsep (map (\(nm,md) -> prettyName True False params' nm <+> maybe empty (showDoc ist) md) params) -- else hsep (punctuate comma (map (prettyName True False params' . fst) params)) dumpImplementation :: PTerm -> Doc OutputAnnotation dumpImplementation = pprintPTerm ppo params' [] infixes prettifySubInterfaces (PPi (Constraint _ _) _ _ tm _) = prettifySubInterfaces tm prettifySubInterfaces (PPi plcity nm fc t1 t2) = PPi plcity (safeHead nm pNames) NoFC (prettifySubInterfaces t1) (prettifySubInterfaces t2) prettifySubInterfaces (PApp fc ref args) = PApp fc ref $ updateArgs pNames args prettifySubInterfaces tm = tm safeHead _ (y:_) = y safeHead x [] = x updateArgs (p:ps) ((PExp prty opts _ ref):as) = (PExp prty opts p (updateRef p ref)) : updateArgs ps as updateArgs ps (a:as) = a : updateArgs ps as updateArgs _ _ = [] updateRef nm (PRef fc _ _) = PRef fc [] nm updateRef _ pt = pt isSubInterface (PPi (Constraint _ _) _ _ (PApp _ _ args) (PApp _ (PRef _ _ nm) args')) = nm == n && map getTm args == map getTm args' isSubInterface (PPi _ _ _ _ pt) = isSubInterface pt isSubInterface _ = False prettyParameters = if any (isJust . snd) params then vsep (map (\(nm,md) -> prettyName True False params' nm <+> maybe empty (showDoc ist) md) params) else hsep (punctuate comma (map (prettyName True False params' . fst) params)) pprintDocs ist (RecordDoc n doc ctor projs params) = nest 4 (text "Record" <+> prettyName True (ppopt_impl ppo) [] n <> if nullDocstring doc then empty else line <> renderDocstring (renderDocTerm (pprintDelab ist) (normaliseAll (tt_ctxt ist) [])) doc) -- Parameters <$> (if null params then empty else line <> nest 4 (text "Parameters:" <$> prettyParameters) <> line) -- Constructor <$> nest 4 (text "Constructor:" <$> pprintFDWithoutTotality ist False ctor) -- Projections <$> nest 4 (text "Projections:" <$> vsep (map (pprintFDWithoutTotality ist False) projs)) where ppo = ppOptionIst ist infixes = idris_infixes ist pNames = [n | (n,_,_) <- params] params' = zip pNames (repeat False) prettyParameters = if any isJust [d | (_,_,d) <- params] then vsep (map (\(n,pt,d) -> prettyParam (n,pt) <+> maybe empty (showDoc ist) d) params) else hsep (punctuate comma (map prettyParam [(n,pt) | (n,pt,_) <- params])) prettyParam (n,pt) = prettyName True False params' n <+> text ":" <+> pprintPTerm ppo params' [] infixes pt pprintDocs ist (NamedImplementationDoc _cls doc) = nest 4 (text "Named implementation:" <$> pprintFDWithoutTotality ist True doc) pprintDocs ist (ModDoc mod docs) = nest 4 $ text "Module" <+> text (concat (intersperse "." mod)) <> colon <$> renderDocstring (renderDocTerm (pprintDelab ist) (normaliseAll (tt_ctxt ist) [])) docs -- | Determine a truncation function depending how much docs the user -- wants to see howMuch FullDocs = id howMuch OverviewDocs = overview -- | Given a fully-qualified, disambiguated name, construct the -- documentation object for it getDocs :: Name -> HowMuchDocs -> Idris Docs getDocs n@(NS n' ns) w | n' == modDocName = do i <- getIState case lookupCtxtExact n (idris_moduledocs i) of Just doc -> return . ModDoc (reverse (map T.unpack ns)) $ howMuch w doc Nothing -> fail $ "Module docs for " ++ show (reverse (map T.unpack ns)) ++ " do not exist! This shouldn't have happened and is a bug." getDocs n w = do i <- getIState docs <- if | Just ci <- lookupCtxtExact n (idris_interfaces i) -> docInterface n ci | Just ri <- lookupCtxtExact n (idris_records i) -> docRecord n ri | Just ti <- lookupCtxtExact n (idris_datatypes i) -> docData n ti | Just interface_ <- interfaceNameForImpl i n -> do fd <- docFun n return $ NamedImplementationDoc interface_ fd | otherwise -> do fd <- docFun n return (FunDoc fd) return $ fmap (howMuch w) docs where interfaceNameForImpl :: IState -> Name -> Maybe Name interfaceNameForImpl ist n = listToMaybe [ cn | (cn, ci) <- toAlist (idris_interfaces ist) , n `elem` map fst (interface_implementations ci) ] docData :: Name -> TypeInfo -> Idris Docs docData n ti = do tdoc <- docFun n cdocs <- mapM docFun (con_names ti) return (DataDoc tdoc cdocs) docInterface :: Name -> InterfaceInfo -> Idris Docs docInterface n ci = do i <- getIState let docStrings = listToMaybe $ lookupCtxt n $ idris_docstrings i docstr = maybe emptyDocstring fst docStrings params = map (\pn -> (pn, docStrings >>= (lookup pn . snd))) (interface_params ci) docsForImplementation impl = fromMaybe (emptyDocstring, []) . flip lookupCtxtExact (idris_docstrings i) $ impl implementations = map (\impl -> (namedImpl impl, delabTy i impl, docsForImplementation impl)) (nub (map fst (interface_implementations ci))) (sub_interfaces, implementations') = partition (isSubInterface . (\(_,tm,_) -> tm)) implementations super_interfaces = catMaybes $ map getDImpl (interface_default_super_interfaces ci) mdocs <- mapM (docFun . fst) (interface_methods ci) let ctorN = implementationCtorName ci ctorDocs <- case basename ctorN of SN _ -> return Nothing _ -> fmap Just $ docFun ctorN return $ InterfaceDoc n docstr mdocs params implementations' (map (\(_,tm,_) -> tm) sub_interfaces) super_interfaces ctorDocs where namedImpl (NS n ns) = fmap (flip NS ns) (namedImpl n) namedImpl n@(UN _) = Just n namedImpl _ = Nothing getDImpl (PImplementation _ _ _ _ _ _ _ _ _ _ _ _ t _ _) = Just t getDImpl _ = Nothing isSubInterface (PPi (Constraint _ _) _ _ (PApp _ _ args) (PApp _ (PRef _ _ nm) args')) = nm == n && map getTm args == map getTm args' isSubInterface (PPi _ _ _ _ pt) = isSubInterface pt isSubInterface _ = False docRecord :: Name -> RecordInfo -> Idris Docs docRecord n ri = do i <- getIState let docStrings = listToMaybe $ lookupCtxt n $ idris_docstrings i docstr = maybe emptyDocstring fst docStrings params = map (\(pn,pt) -> (pn, pt, docStrings >>= (lookup (nsroot pn) . snd))) (record_parameters ri) pdocs <- mapM docFun (record_projections ri) ctorDocs <- docFun $ record_constructor ri return $ RecordDoc n docstr ctorDocs pdocs params docFun :: Name -> Idris FunDoc docFun n = do i <- getIState let (docstr, argDocs) = case lookupCtxt n (idris_docstrings i) of [d] -> d _ -> noDocs let ty = delabTy i n let args = getPArgNames ty argDocs let infixes = idris_infixes i let fixdecls = filter (\(Fix _ x) -> x == funName n) infixes let f = case fixdecls of [] -> Nothing (Fix x _:_) -> Just x return (FD n docstr args ty f) where funName :: Name -> String funName (UN n) = str n funName (NS n _) = funName n funName n = show n getPArgNames :: PTerm -> [(Name, Docstring DocTerm)] -> [(Name, PTerm, Plicity, Maybe (Docstring DocTerm))] getPArgNames (PPi plicity name _ ty body) ds = (name, ty, plicity, lookup name ds) : getPArgNames body ds getPArgNames _ _ = [] pprintConstDocs :: IState -> Const -> String -> Doc OutputAnnotation pprintConstDocs ist c str = text "Primitive" <+> text (if constIsType c then "type" else "value") <+> pprintPTerm (ppOptionIst ist) [] [] [] (PConstant NoFC c) <+> colon <+> pprintPTerm (ppOptionIst ist) [] [] [] (t c) <> nest 4 (line <> text str) where t (Fl _) = PConstant NoFC $ AType ATFloat t (BI _) = PConstant NoFC $ AType (ATInt ITBig) t (Str _) = PConstant NoFC StrType t (Ch c) = PConstant NoFC $ AType (ATInt ITChar) t _ = PType NoFC pprintTypeDoc :: IState -> Doc OutputAnnotation pprintTypeDoc ist = prettyIst ist (PType emptyFC) <+> colon <+> type1Doc <+> nest 4 (line <> text typeDescription)
ben-schulz/Idris-dev
src/Idris/Docs.hs
bsd-3-clause
17,892
0
25
6,223
5,482
2,778
2,704
325
24
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE ScopedTypeVariables #-} -- | Dealing with the 00-index file and all its cabal files. module Stack.PackageIndex ( updateAllIndices , getPackageCaches , getPackageCachesIO , getPackageVersions , getPackageVersionsIO , lookupPackageVersions ) where import qualified Codec.Archive.Tar as Tar import Control.Exception (Exception) import Control.Exception.Enclosed (tryIO) import Control.Monad (unless, when, liftM, void) import Control.Monad.Catch (MonadThrow, throwM, MonadCatch) import qualified Control.Monad.Catch as C import Control.Monad.IO.Class (MonadIO, liftIO) import Control.Monad.Logger (MonadLogger, logDebug, logInfo, logWarn) import Control.Monad.Reader (asks) import Control.Monad.Trans.Control import Data.Aeson.Extended import Data.Binary.VersionTagged import qualified Data.ByteString.Lazy as L import Data.Conduit (($$), (=$)) import Data.Conduit.Binary (sinkHandle, sourceHandle) import Data.Conduit.Zlib (ungzip) import Data.Foldable (forM_) import Data.IORef import Data.Int (Int64) import Data.Map (Map) import qualified Data.Map.Strict as Map import Data.Set (Set) import qualified Data.Set as Set import Data.Monoid import Data.Text (Text) import qualified Data.Text as T import Data.Text.Unsafe (unsafeTail) import Data.Traversable (forM) import Data.Typeable (Typeable) import Network.HTTP.Download import Path (mkRelDir, parent, parseRelDir, toFilePath, parseAbsFile, (</>)) import Path.IO import Prelude -- Fix AMP warning import Stack.Types import Stack.Types.StackT import System.FilePath (takeBaseName, (<.>)) import System.IO (IOMode (ReadMode, WriteMode), withBinaryFile) import System.Process.Read (EnvOverride, ReadProcessException (..), doesExecutableExist, readInNull, tryProcessStdout) import System.Process.Run (Cmd(..), callProcessInheritStderrStdout) -- | Populate the package index caches and return them. populateCache :: (MonadIO m, MonadReader env m, HasConfig env, HasHttpManager env, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> PackageIndex -> m (Map PackageIdentifier PackageCache) populateCache menv index = do requireIndex menv index -- This uses full on lazy I/O instead of ResourceT to provide some -- protections. Caveat emptor path <- configPackageIndex (indexName index) let loadPIS = do $logSticky "Populating index cache ..." lbs <- liftIO $ L.readFile $ Path.toFilePath path loop 0 Map.empty (Tar.read lbs) pis <- loadPIS `C.catch` \e -> do $logWarn $ "Exception encountered when parsing index tarball: " <> T.pack (show (e :: Tar.FormatError)) $logWarn "Automatically updating index and trying again" updateIndex menv index loadPIS when (indexRequireHashes index) $ forM_ (Map.toList pis) $ \(ident, pc) -> case pcDownload pc of Just _ -> return () Nothing -> throwM $ MissingRequiredHashes (indexName index) ident $logStickyDone "Populated index cache." return pis where loop !blockNo !m (Tar.Next e es) = loop (blockNo + entrySizeInBlocks e) (goE blockNo m e) es loop _ m Tar.Done = return m loop _ _ (Tar.Fail e) = throwM e goE blockNo m e = case Tar.entryContent e of Tar.NormalFile lbs size -> case parseNameVersion $ Tar.entryPath e of Just (ident, ".cabal") -> addCabal ident size Just (ident, ".json") -> addJSON ident lbs _ -> m _ -> m where addCabal ident size = Map.insertWith (\_ pcOld -> pcNew { pcDownload = pcDownload pcOld }) ident pcNew m where pcNew = PackageCache { pcOffset = (blockNo + 1) * 512 , pcSize = size , pcDownload = Nothing } addJSON ident lbs = case decode lbs of Nothing -> m Just !pd -> Map.insertWith (\_ pc -> pc { pcDownload = Just pd }) ident PackageCache { pcOffset = 0 , pcSize = 0 , pcDownload = Just pd } m breakSlash x | T.null z = Nothing | otherwise = Just (y, unsafeTail z) where (y, z) = T.break (== '/') x parseNameVersion t1 = do (p', t3) <- breakSlash $ T.map (\c -> if c == '\\' then '/' else c) $ T.pack t1 p <- parsePackageName p' (v', t5) <- breakSlash t3 v <- parseVersion v' let (t6, suffix) = T.break (== '.') t5 if t6 == p' then return (PackageIdentifier p v, suffix) else Nothing data PackageIndexException = GitNotAvailable IndexName | MissingRequiredHashes IndexName PackageIdentifier deriving Typeable instance Exception PackageIndexException instance Show PackageIndexException where show (GitNotAvailable name) = concat [ "Package index " , T.unpack $ indexNameText name , " only provides Git access, and you do not have" , " the git executable on your PATH" ] show (MissingRequiredHashes name ident) = concat [ "Package index " , T.unpack $ indexNameText name , " is configured to require package hashes, but no" , " hash is available for " , packageIdentifierString ident ] -- | Require that an index be present, updating if it isn't. requireIndex :: (MonadIO m,MonadLogger m ,MonadReader env m,HasHttpManager env ,HasConfig env,MonadBaseControl IO m,MonadCatch m) => EnvOverride -> PackageIndex -> m () requireIndex menv index = do tarFile <- configPackageIndex $ indexName index exists <- doesFileExist tarFile unless exists $ updateIndex menv index -- | Update all of the package indices updateAllIndices :: (MonadIO m,MonadLogger m ,MonadReader env m,HasHttpManager env ,HasConfig env,MonadBaseControl IO m, MonadCatch m) => EnvOverride -> m () updateAllIndices menv = do clearPackageCaches asks (configPackageIndices . getConfig) >>= mapM_ (updateIndex menv) -- | Update the index tarball updateIndex :: (MonadIO m,MonadLogger m ,MonadReader env m,HasHttpManager env ,HasConfig env,MonadBaseControl IO m, MonadCatch m) => EnvOverride -> PackageIndex -> m () updateIndex menv index = do let name = indexName index logUpdate mirror = $logSticky $ "Updating package index " <> indexNameText (indexName index) <> " (mirrored at " <> mirror <> ") ..." git <- isGitInstalled menv case (git, indexLocation index) of (True, ILGit url) -> logUpdate url >> updateIndexGit menv name index url (True, ILGitHttp url _) -> logUpdate url >> updateIndexGit menv name index url (_, ILHttp url) -> logUpdate url >> updateIndexHTTP name index url (False, ILGitHttp _ url) -> logUpdate url >> updateIndexHTTP name index url (False, ILGit url) -> logUpdate url >> throwM (GitNotAvailable name) -- | Update the index Git repo and the index tarball updateIndexGit :: (MonadIO m,MonadLogger m,MonadReader env m,HasConfig env,MonadBaseControl IO m, MonadCatch m) => EnvOverride -> IndexName -> PackageIndex -> Text -- ^ Git URL -> m () updateIndexGit menv indexName' index gitUrl = do tarFile <- configPackageIndex indexName' let idxPath = parent tarFile ensureDir idxPath do repoName <- parseRelDir $ takeBaseName $ T.unpack gitUrl let cloneArgs = ["clone" ,T.unpack gitUrl ,toFilePath repoName ,"--depth" ,"1" ,"-b" -- ,"display"] sDir <- configPackageIndexRoot indexName' let suDir = sDir </> $(mkRelDir "git-update") acfDir = suDir </> repoName repoExists <- doesDirExist acfDir unless repoExists (readInNull suDir "git" menv cloneArgs Nothing) $logSticky "Fetching package index ..." let runFetch = callProcessInheritStderrStdout (Cmd (Just acfDir) "git" menv ["fetch","--tags","--depth=1"]) runFetch `C.catch` \(ex :: ReadProcessException) -> do -- we failed, so wipe the directory and try again, see #1418 $logWarn (T.pack (show ex)) $logStickyDone "Failed to fetch package index, retrying." removeDirRecur acfDir readInNull suDir "git" menv cloneArgs Nothing $logSticky "Fetching package index ..." runFetch $logStickyDone "Fetched package index." when (indexGpgVerify index) (readInNull acfDir "git" menv ["tag","-v","current-hackage"] (Just (T.unlines ["Signature verification failed. " ,"Please ensure you've set up your" ,"GPG keychain to accept the D6CF60FD signing key." ,"For more information, see:" ,"https://github.com/fpco/stackage-update#readme"]))) -- generate index archive when commit id differs from cloned repo tarId <- getTarCommitId (toFilePath tarFile) cloneId <- getCloneCommitId acfDir unless (tarId `equals` cloneId) (generateArchive acfDir tarFile) where getTarCommitId fp = tryProcessStdout Nothing menv "sh" ["-c","git get-tar-commit-id < "++fp] getCloneCommitId dir = tryProcessStdout (Just dir) menv "git" ["rev-parse","current-hackage^{}"] equals (Right cid1) (Right cid2) = cid1 == cid2 equals _ _ = False generateArchive acfDir tarFile = do ignoringAbsence (removeFile tarFile) deleteCache indexName' $logDebug ("Exporting a tarball to " <> (T.pack . toFilePath) tarFile) let tarFileTmp = toFilePath tarFile ++ ".tmp" readInNull acfDir "git" menv ["archive","--format=tar","-o",tarFileTmp,"current-hackage"] Nothing tarFileTmpPath <- parseAbsFile tarFileTmp renameFile tarFileTmpPath tarFile -- | Update the index tarball via HTTP updateIndexHTTP :: (MonadIO m,MonadLogger m ,MonadThrow m,MonadReader env m,HasHttpManager env,HasConfig env) => IndexName -> PackageIndex -> Text -- ^ url -> m () updateIndexHTTP indexName' index url = do req <- parseUrl $ T.unpack url $logInfo ("Downloading package index from " <> url) gz <- configPackageIndexGz indexName' tar <- configPackageIndex indexName' wasDownloaded <- redownload req gz toUnpack <- if wasDownloaded then return True else not `liftM` doesFileExist tar when toUnpack $ do let tmp = toFilePath tar <.> "tmp" tmpPath <- parseAbsFile tmp deleteCache indexName' liftIO $ do withBinaryFile (toFilePath gz) ReadMode $ \input -> withBinaryFile tmp WriteMode $ \output -> sourceHandle input $$ ungzip =$ sinkHandle output renameFile tmpPath tar when (indexGpgVerify index) $ $logWarn $ "You have enabled GPG verification of the package index, " <> "but GPG verification only works with Git downloading" -- | Is the git executable installed? isGitInstalled :: MonadIO m => EnvOverride -> m Bool isGitInstalled = flip doesExecutableExist "git" -- | Delete the package index cache deleteCache :: (MonadIO m, MonadReader env m, HasConfig env, MonadLogger m, MonadThrow m) => IndexName -> m () deleteCache indexName' = do fp <- configPackageIndexCache indexName' eres <- liftIO $ tryIO $ removeFile fp case eres of Left e -> $logDebug $ "Could not delete cache: " <> T.pack (show e) Right () -> $logDebug $ "Deleted index cache at " <> T.pack (toFilePath fp) -- | Lookup a package's versions from 'IO'. getPackageVersionsIO :: (MonadIO m, MonadReader env m, HasConfig env, MonadLogger m, HasHttpManager env, MonadBaseControl IO m, MonadCatch m) => m (PackageName -> IO (Set Version)) getPackageVersionsIO = do getCaches <- getPackageCachesIO return $ \name -> fmap (lookupPackageVersions name) getCaches -- | Get the known versions for a given package from the package caches. -- -- See 'getPackageCaches' for performance notes. getPackageVersions :: (MonadIO m, MonadLogger m, MonadReader env m, HasConfig env, HasHttpManager env, MonadBaseControl IO m, MonadCatch m) => PackageName -> m (Set Version) getPackageVersions pkgName = fmap (lookupPackageVersions pkgName) getPackageCaches lookupPackageVersions :: PackageName -> Map PackageIdentifier a -> Set Version lookupPackageVersions pkgName pkgCaches = Set.fromList [v | PackageIdentifier n v <- Map.keys pkgCaches, n == pkgName] -- | Access the package caches from 'IO'. -- -- FIXME: This is a temporary solution until a better solution -- to access the package caches from Stack.Build.ConstructPlan -- has been found. getPackageCachesIO :: (MonadIO m, MonadReader env m, HasConfig env, MonadLogger m, HasHttpManager env, MonadBaseControl IO m, MonadCatch m) => m (IO (Map PackageIdentifier (PackageIndex, PackageCache))) getPackageCachesIO = toIO getPackageCaches where toIO :: (MonadIO m, MonadBaseControl IO m) => m a -> m (IO a) toIO m = do runInBase <- liftBaseWith $ \run -> return (void . run) return $ do i <- newIORef (error "Impossible evaluation in toIO") runInBase $ do x <- m liftIO $ writeIORef i x readIORef i -- | Load the package caches, or create the caches if necessary. -- -- This has two levels of caching: in memory, and the on-disk cache. So, -- feel free to call this function multiple times. getPackageCaches :: (MonadIO m, MonadLogger m, MonadReader env m, HasConfig env, HasHttpManager env, MonadBaseControl IO m, MonadCatch m) => m (Map PackageIdentifier (PackageIndex, PackageCache)) getPackageCaches = do menv <- getMinimalEnvOverride config <- askConfig mcached <- liftIO $ readIORef (configPackageCaches config) case mcached of Just cached -> return cached Nothing -> do result <- liftM mconcat $ forM (configPackageIndices config) $ \index -> do fp <- configPackageIndexCache (indexName index) PackageCacheMap pis' <- taggedDecodeOrLoad fp $ liftM PackageCacheMap $ populateCache menv index return (fmap (index,) pis') liftIO $ writeIORef (configPackageCaches config) (Just result) return result -- | Clear the in-memory hackage index cache. This is needed when the -- hackage index is updated. clearPackageCaches :: (MonadIO m, MonadLogger m, MonadReader env m, HasConfig env, MonadThrow m, HasHttpManager env, MonadBaseControl IO m, MonadCatch m) => m () clearPackageCaches = do cacheRef <- asks (configPackageCaches . getConfig) liftIO $ writeIORef cacheRef Nothing --------------- Lifted from cabal-install, Distribution.Client.Tar: -- | Return the number of blocks in an entry. entrySizeInBlocks :: Tar.Entry -> Int64 entrySizeInBlocks entry = 1 + case Tar.entryContent entry of Tar.NormalFile _ size -> bytesToBlocks size Tar.OtherEntryType _ _ size -> bytesToBlocks size _ -> 0 where bytesToBlocks s = 1 + ((fromIntegral s - 1) `div` 512)
phadej/stack
src/Stack/PackageIndex.hs
bsd-3-clause
17,765
0
20
5,885
4,183
2,128
2,055
357
10
{-# LANGUAGE LambdaCase #-} module Opaleye.Internal.Optimize where import Prelude hiding (product) import qualified Opaleye.Internal.PrimQuery as PQ import Opaleye.Internal.Helpers ((.:)) import qualified Data.List.NonEmpty as NEL import Control.Applicative ((<$>), (<*>), pure) import qualified Data.Traversable as T optimize :: PQ.PrimQuery' a -> PQ.PrimQuery' a optimize = mergeProduct . removeUnit removeUnit :: PQ.PrimQuery' a -> PQ.PrimQuery' a removeUnit = PQ.foldPrimQuery PQ.primQueryFoldDefault { PQ.product = product } where product pqs pes = PQ.Product pqs' pes where pqs' = case NEL.nonEmpty (NEL.filter (not . PQ.isUnit) pqs) of Nothing -> return PQ.Unit Just xs -> xs mergeProduct :: PQ.PrimQuery' a -> PQ.PrimQuery' a mergeProduct = PQ.foldPrimQuery PQ.primQueryFoldDefault { PQ.product = product } where product pqs pes = PQ.Product pqs' (pes ++ pes') where pqs' = pqs >>= queries queries (PQ.Product qs _) = qs queries q = return q pes' = NEL.toList pqs >>= conds conds (PQ.Product _ cs) = cs conds _ = [] removeEmpty :: PQ.PrimQuery' a -> Maybe (PQ.PrimQuery' b) removeEmpty = PQ.foldPrimQuery PQ.PrimQueryFold { PQ.unit = return PQ.Unit , PQ.empty = const Nothing , PQ.baseTable = return .: PQ.BaseTable , PQ.product = \x y -> PQ.Product <$> (T.traverse removeEmpty =<< T.sequence x) <*> pure y , PQ.aggregate = fmap . PQ.Aggregate , PQ.order = fmap . PQ.Order , PQ.limit = fmap . PQ.Limit , PQ.join = \jt pe pq1 pq2 -> PQ.Join jt pe <$> pq1 <*> pq2 , PQ.values = return .: PQ.Values , PQ.binary = \case -- Some unfortunate duplication here PQ.Except -> binary Just (const Nothing) PQ.Except PQ.Union -> binary Just Just PQ.Union PQ.Intersect -> binary (const Nothing) (const Nothing) PQ.Intersect PQ.ExceptAll -> binary Just (const Nothing) PQ.ExceptAll PQ.UnionAll -> binary Just Just PQ.UnionAll PQ.IntersectAll -> binary (const Nothing) (const Nothing) PQ.IntersectAll , PQ.label = fmap . PQ.Label } where -- If only the first argument is Just, do n1 on it -- If only the second argument is Just, do n2 on it binary n1 n2 jj exprs = \case (Nothing, Nothing) -> Nothing (Nothing, Just pq2) -> n2 pq2 (Just pq1, Nothing) -> n1 pq1 (Just pq1, Just pq2) -> Just (PQ.Binary jj exprs (pq1, pq2))
hesselink/haskell-opaleye
src/Opaleye/Internal/Optimize.hs
bsd-3-clause
2,755
0
15
889
850
451
399
51
9
-- | Accessors (lenses and functions) to operate on the 'PreFiltset' -- part of a clatch-like type. module Penny.Clatch.Access.PreFiltset where import Control.Lens (Lens', _2, _1) import Penny.Clatch.Types -- | Operate on the 'PreFiltset'. -- -- @ -- 'preFiltset' :: 'Lens'' ('Prefilt' a) 'PreFiltset' -- 'preFiltset' :: 'Lens'' ('Sorted' a) 'PreFiltset' -- 'preFiltset' :: 'Lens'' ('Totaled' a) 'PreFiltset' -- 'preFiltset' :: 'Lens'' 'Clatch' 'PreFiltset' -- @ preFiltset :: Lens' (a, (b, (c, (PreFiltset, d)))) PreFiltset preFiltset = _2 . _2 . _2 . _1
massysett/penny
penny/lib/Penny/Clatch/Access/PreFiltset.hs
bsd-3-clause
566
0
9
93
91
60
31
5
1
{-# LANGUAGE CPP #-} module TcCanonical( canonicalize, unifyDerived, makeSuperClasses, mkGivensWithSuperClasses, StopOrContinue(..), stopWith, continueWith ) where #include "HsVersions.h" import TcRnTypes import TcType import Type import TcFlatten import TcSMonad import TcEvidence import Class import TyCon import TyCoRep -- cleverly decomposes types, good for completeness checking import Coercion import FamInstEnv ( FamInstEnvs ) import FamInst ( tcTopNormaliseNewTypeTF_maybe ) import Var import Name( isSystemName ) import OccName( OccName ) import Outputable import DynFlags( DynFlags ) import VarSet import NameSet import RdrName import Pair import Util import Bag import MonadUtils import Control.Monad import Data.List ( zip4, foldl' ) import BasicTypes import Data.Bifunctor ( bimap ) {- ************************************************************************ * * * The Canonicaliser * * * ************************************************************************ Note [Canonicalization] ~~~~~~~~~~~~~~~~~~~~~~~ Canonicalization converts a simple constraint to a canonical form. It is unary (i.e. treats individual constraints one at a time), does not do any zonking, but lives in TcS monad because it needs to create fresh variables (for flattening) and consult the inerts (for efficiency). The execution plan for canonicalization is the following: 1) Decomposition of equalities happens as necessary until we reach a variable or type family in one side. There is no decomposition step for other forms of constraints. 2) If, when we decompose, we discover a variable on the head then we look at inert_eqs from the current inert for a substitution for this variable and contine decomposing. Hence we lazily apply the inert substitution if it is needed. 3) If no more decomposition is possible, we deeply apply the substitution from the inert_eqs and continue with flattening. 4) During flattening, we examine whether we have already flattened some function application by looking at all the CTyFunEqs with the same function in the inert set. The reason for deeply applying the inert substitution at step (3) is to maximise our chances of matching an already flattened family application in the inert. The net result is that a constraint coming out of the canonicalization phase cannot be rewritten any further from the inerts (but maybe /it/ can rewrite an inert or still interact with an inert in a further phase in the simplifier. Note [Caching for canonicals] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Our plan with pre-canonicalization is to be able to solve a constraint really fast from existing bindings in TcEvBinds. So one may think that the condition (isCNonCanonical) is not necessary. However consider the following setup: InertSet = { [W] d1 : Num t } WorkList = { [W] d2 : Num t, [W] c : t ~ Int} Now, we prioritize equalities, but in our concrete example (should_run/mc17.hs) the first (d2) constraint is dealt with first, because (t ~ Int) is an equality that only later appears in the worklist since it is pulled out from a nested implication constraint. So, let's examine what happens: - We encounter work item (d2 : Num t) - Nothing is yet in EvBinds, so we reach the interaction with inerts and set: d2 := d1 and we discard d2 from the worklist. The inert set remains unaffected. - Now the equation ([W] c : t ~ Int) is encountered and kicks-out (d1 : Num t) from the inerts. Then that equation gets spontaneously solved, perhaps. We end up with: InertSet : { [G] c : t ~ Int } WorkList : { [W] d1 : Num t} - Now we examine (d1), we observe that there is a binding for (Num t) in the evidence binds and we set: d1 := d2 and end up in a loop! Now, the constraints that get kicked out from the inert set are always Canonical, so by restricting the use of the pre-canonicalizer to NonCanonical constraints we eliminate this danger. Moreover, for canonical constraints we already have good caching mechanisms (effectively the interaction solver) and we are interested in reducing things like superclasses of the same non-canonical constraint being generated hence I don't expect us to lose a lot by introducing the (isCNonCanonical) restriction. A similar situation can arise in TcSimplify, at the end of the solve_wanteds function, where constraints from the inert set are returned as new work -- our substCt ensures however that if they are not rewritten by subst, they remain canonical and hence we will not attempt to solve them from the EvBinds. If on the other hand they did get rewritten and are now non-canonical they will still not match the EvBinds, so we are again good. -} -- Top-level canonicalization -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ canonicalize :: Ct -> TcS (StopOrContinue Ct) canonicalize ct@(CNonCanonical { cc_ev = ev }) = do { traceTcS "canonicalize (non-canonical)" (ppr ct) ; {-# SCC "canEvVar" #-} canEvNC ev } canonicalize (CDictCan { cc_ev = ev, cc_class = cls , cc_tyargs = xis, cc_pend_sc = pend_sc }) = {-# SCC "canClass" #-} canClass ev cls xis pend_sc canonicalize (CTyEqCan { cc_ev = ev , cc_tyvar = tv , cc_rhs = xi , cc_eq_rel = eq_rel }) = {-# SCC "canEqLeafTyVarEq" #-} canEqNC ev eq_rel (mkTyVarTy tv) xi -- NB: Don't use canEqTyVar because that expects flattened types, -- and tv and xi may not be flat w.r.t. an updated inert set canonicalize (CFunEqCan { cc_ev = ev , cc_fun = fn , cc_tyargs = xis1 , cc_fsk = fsk }) = {-# SCC "canEqLeafFunEq" #-} canCFunEqCan ev fn xis1 fsk canonicalize (CIrredEvCan { cc_ev = ev }) = canIrred ev canonicalize (CHoleCan { cc_ev = ev, cc_occ = occ, cc_hole = hole }) = canHole ev occ hole canEvNC :: CtEvidence -> TcS (StopOrContinue Ct) -- Called only for non-canonical EvVars canEvNC ev = case classifyPredType (ctEvPred ev) of ClassPred cls tys -> do traceTcS "canEvNC:cls" (ppr cls <+> ppr tys) canClassNC ev cls tys EqPred eq_rel ty1 ty2 -> do traceTcS "canEvNC:eq" (ppr ty1 $$ ppr ty2) canEqNC ev eq_rel ty1 ty2 IrredPred {} -> do traceTcS "canEvNC:irred" (ppr (ctEvPred ev)) canIrred ev {- ************************************************************************ * * * Class Canonicalization * * ************************************************************************ -} canClassNC :: CtEvidence -> Class -> [Type] -> TcS (StopOrContinue Ct) -- Precondition: EvVar is class evidence canClassNC ev cls tys = canClass ev cls tys (has_scs cls) where has_scs cls = not (null (classSCTheta cls)) canClass :: CtEvidence -> Class -> [Type] -> Bool -> TcS (StopOrContinue Ct) -- Precondition: EvVar is class evidence canClass ev cls tys pend_sc = -- all classes do *nominal* matching ASSERT2( ctEvRole ev == Nominal, ppr ev $$ ppr cls $$ ppr tys ) do { (xis, cos) <- flattenManyNom ev tys ; let co = mkTcTyConAppCo Nominal (classTyCon cls) cos xi = mkClassPred cls xis mk_ct new_ev = CDictCan { cc_ev = new_ev , cc_tyargs = xis , cc_class = cls , cc_pend_sc = pend_sc } ; mb <- rewriteEvidence ev xi co ; traceTcS "canClass" (vcat [ ppr ev , ppr xi, ppr mb ]) ; return (fmap mk_ct mb) } {- Note [The superclass story] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We need to add superclass constraints for two reasons: * For givens, they give us a route to to proof. E.g. f :: Ord a => a -> Bool f x = x == x We get a Wanted (Eq a), which can only be solved from the superclass of the Given (Ord a). * For wanteds, they may give useful functional dependencies. E.g. class C a b | a -> b where ... class C a b => D a b where ... Now a Wanted constraint (D Int beta) has (C Int beta) as a superclass and that might tell us about beta, via C's fundeps. We can get this by generateing a Derived (C Int beta) constraint. It's derived because we don't actually have to cough up any evidence for it; it's only there to generate fundep equalities. See Note [Why adding superclasses can help]. For these reasons we want to generate superclass constraints for both Givens and Wanteds. But: * (Minor) they are often not needed, so generating them aggressively is a waste of time. * (Major) if we want recursive superclasses, there would be an infinite number of them. Here is a real-life example (Trac #10318); class (Frac (Frac a) ~ Frac a, Fractional (Frac a), IntegralDomain (Frac a)) => IntegralDomain a where type Frac a :: * Notice that IntegralDomain has an associated type Frac, and one of IntegralDomain's superclasses is another IntegralDomain constraint. So here's the plan: 1. Generate superclasses for given (but not wanted) constraints; see Note [Aggressively expand given superclasses]. However stop if you encounter the same class twice. That is, expand eagerly, but have a conservative termination condition: see Note [Expanding superclasses] in TcType. 2. Solve the wanteds as usual, but do /no/ expansion of superclasses in solveSimpleGivens or solveSimpleWanteds. See Note [Danger of adding superclasses during solving] 3. If we have any remaining unsolved wanteds (see Note [When superclasses help] in TcRnTypes) try harder: take both the Givens and Wanteds, and expand superclasses again. This may succeed in generating (a finite number of) extra Givens, and extra Deriveds. Both may help the proof. This is done in TcSimplify.expandSuperClasses. 4. Go round to (2) again. This loop (2,3,4) is implemented in TcSimplify.simpl_loop. We try to terminate the loop by flagging which class constraints (given or wanted) are potentially un-expanded. This is what the cc_pend_sc flag is for in CDictCan. So in Step 3 we only expand superclasses for constraints with cc_pend_sc set to true (i.e. isPendingScDict holds). When we take a CNonCanonical or CIrredCan, but end up classifying it as a CDictCan, we set the cc_pend_sc flag to False. Note [Aggressively expand given superclasses] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In step (1) of Note [The superclass story], why do we aggressively expand Given superclasses by one layer? Mainly because of some very obscure cases like this: instance Bad a => Eq (T a) f :: (Ord (T a)) => blah f x = ....needs Eq (T a), Ord (T a).... Here if we can't satisfy (Eq (T a)) from the givens we'll use the instance declaration; but then we are stuck with (Bad a). Sigh. This is really a case of non-confluent proofs, but to stop our users complaining we expand one layer in advance. Note [Why adding superclasses can help] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Examples of how adding superclasses can help: --- Example 1 class C a b | a -> b Suppose we want to solve [G] C a b [W] C a beta Then adding [D] beta~b will let us solve it. -- Example 2 (similar but using a type-equality superclass) class (F a ~ b) => C a b And try to sllve: [G] C a b [W] C a beta Follow the superclass rules to add [G] F a ~ b [D] F a ~ beta Now we we get [D] beta ~ b, and can solve that. -- Example (tcfail138) class L a b | a -> b class (G a, L a b) => C a b instance C a b' => G (Maybe a) instance C a b => C (Maybe a) a instance L (Maybe a) a When solving the superclasses of the (C (Maybe a) a) instance, we get [G] C a b, and hance by superclasses, [G] G a, [G] L a b [W] G (Maybe a) Use the instance decl to get [W] C a beta Generate its derived superclass [D] L a beta. Now using fundeps, combine with [G] L a b to get [D] beta ~ b which is what we want. Note [Danger of adding superclasses during solving] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here's a serious, but now out-dated example, from Trac #4497: class Num (RealOf t) => Normed t type family RealOf x Assume the generated wanted constraint is: [W] RealOf e ~ e [W] Normed e If we were to be adding the superclasses during simplification we'd get: [W] RealOf e ~ e [W] Normed e [D] RealOf e ~ fuv [D] Num fuv ==> e := fuv, Num fuv, Normed fuv, RealOf fuv ~ fuv While looks exactly like our original constraint. If we add the superclass of (Normed fuv) again we'd loop. By adding superclasses definitely only once, during canonicalisation, this situation can't happen. Mind you, now that Wanteds cannot rewrite Derived, I think this particular situation can't happen. -} mkGivensWithSuperClasses :: CtLoc -> [EvId] -> TcS [Ct] -- From a given EvId, make its Ct, plus the Ct's of its superclasses -- See Note [The superclass story] -- The loop-breaking here follows Note [Expanding superclasses] in TcType -- -- Example: class D a => C a -- class C [a] => D a -- makeGivensWithSuperClasses (C x) will return (C x, D x, C[x]) -- i.e. up to and including the first repetition of C mkGivensWithSuperClasses loc ev_ids = concatMapM go ev_ids where go ev_id = mk_superclasses emptyNameSet this_ev where this_ev = CtGiven { ctev_evar = ev_id , ctev_pred = evVarPred ev_id , ctev_loc = loc } makeSuperClasses :: [Ct] -> TcS [Ct] -- Returns strict superclasses, transitively, see Note [The superclasses story] -- See Note [The superclass story] -- The loop-breaking here follows Note [Expanding superclasses] in TcType -- Specifically, for an incoming (C t) constraint, we return all of (C t)'s -- superclasses, up to /and including/ the first repetition of C -- -- Example: class D a => C a -- class C [a] => D a -- makeSuperClasses (C x) will return (D x, C [x]) -- -- NB: the incoming constraints have had their cc_pend_sc flag already -- flipped to False, by isPendingScDict, so we are /obliged/ to at -- least produce the immediate superclasses makeSuperClasses cts = concatMapM go cts where go (CDictCan { cc_ev = ev, cc_class = cls, cc_tyargs = tys }) = mk_strict_superclasses (unitNameSet (className cls)) ev cls tys go ct = pprPanic "makeSuperClasses" (ppr ct) mk_superclasses :: NameSet -> CtEvidence -> TcS [Ct] -- Return this constraint, plus its superclasses, if any mk_superclasses rec_clss ev | ClassPred cls tys <- classifyPredType (ctEvPred ev) = mk_superclasses_of rec_clss ev cls tys | otherwise -- Superclass is not a class predicate = return [mkNonCanonical ev] mk_superclasses_of :: NameSet -> CtEvidence -> Class -> [Type] -> TcS [Ct] -- Always return this class constraint, -- and expand its superclasses mk_superclasses_of rec_clss ev cls tys | loop_found = return [this_ct] -- cc_pend_sc of this_ct = True | otherwise = do { sc_cts <- mk_strict_superclasses rec_clss' ev cls tys ; return (this_ct : sc_cts) } -- cc_pend_sc of this_ct = False where cls_nm = className cls loop_found = cls_nm `elemNameSet` rec_clss rec_clss' | isCTupleClass cls = rec_clss -- Never contribute to recursion | otherwise = rec_clss `extendNameSet` cls_nm this_ct = CDictCan { cc_ev = ev, cc_class = cls, cc_tyargs = tys , cc_pend_sc = loop_found } -- NB: If there is a loop, we cut off, so we have not -- added the superclasses, hence cc_pend_sc = True mk_strict_superclasses :: NameSet -> CtEvidence -> Class -> [Type] -> TcS [Ct] -- Always return the immediate superclasses of (cls tys); -- and expand their superclasses, provided none of them are in rec_clss -- nor are repeated mk_strict_superclasses rec_clss ev cls tys | CtGiven { ctev_evar = evar, ctev_loc = loc } <- ev = do { sc_evs <- newGivenEvVars (mk_given_loc loc) (mkEvScSelectors (EvId evar) cls tys) ; concatMapM (mk_superclasses rec_clss) sc_evs } | isEmptyVarSet (tyCoVarsOfTypes tys) = return [] -- Wanteds with no variables yield no deriveds. -- See Note [Improvement from Ground Wanteds] | otherwise -- Wanted/Derived case, just add those SC that can lead to improvement. = do { let loc = ctEvLoc ev ; sc_evs <- mapM (newDerivedNC loc) (immSuperClasses cls tys) ; concatMapM (mk_superclasses rec_clss) sc_evs } where size = sizeTypes tys mk_given_loc loc | isCTupleClass cls = loc -- For tuple predicates, just take them apart, without -- adding their (large) size into the chain. When we -- get down to a base predicate, we'll include its size. -- Trac #10335 | GivenOrigin skol_info <- ctLocOrigin loc -- See Note [Solving superclass constraints] in TcInstDcls -- for explantation of this transformation for givens = case skol_info of InstSkol -> loc { ctl_origin = GivenOrigin (InstSC size) } InstSC n -> loc { ctl_origin = GivenOrigin (InstSC (n `max` size)) } _ -> loc | otherwise -- Probably doesn't happen, since this function = loc -- is only used for Givens, but does no harm {- ************************************************************************ * * * Irreducibles canonicalization * * ************************************************************************ -} canIrred :: CtEvidence -> TcS (StopOrContinue Ct) -- Precondition: ty not a tuple and no other evidence form canIrred old_ev = do { let old_ty = ctEvPred old_ev ; traceTcS "can_pred" (text "IrredPred = " <+> ppr old_ty) ; (xi,co) <- flatten FM_FlattenAll old_ev old_ty -- co :: xi ~ old_ty ; rewriteEvidence old_ev xi co `andWhenContinue` \ new_ev -> do { -- Re-classify, in case flattening has improved its shape ; case classifyPredType (ctEvPred new_ev) of ClassPred cls tys -> canClassNC new_ev cls tys EqPred eq_rel ty1 ty2 -> canEqNC new_ev eq_rel ty1 ty2 _ -> continueWith $ CIrredEvCan { cc_ev = new_ev } } } canHole :: CtEvidence -> OccName -> HoleSort -> TcS (StopOrContinue Ct) canHole ev occ hole_sort = do { let ty = ctEvPred ev ; (xi,co) <- flatten FM_SubstOnly ev ty -- co :: xi ~ ty ; rewriteEvidence ev xi co `andWhenContinue` \ new_ev -> do { emitInsoluble (CHoleCan { cc_ev = new_ev , cc_occ = occ , cc_hole = hole_sort }) ; stopWith new_ev "Emit insoluble hole" } } {- ************************************************************************ * * * Equalities * * ************************************************************************ Note [Canonicalising equalities] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In order to canonicalise an equality, we look at the structure of the two types at hand, looking for similarities. A difficulty is that the types may look dissimilar before flattening but similar after flattening. However, we don't just want to jump in and flatten right away, because this might be wasted effort. So, after looking for similarities and failing, we flatten and then try again. Of course, we don't want to loop, so we track whether or not we've already flattened. It is conceivable to do a better job at tracking whether or not a type is flattened, but this is left as future work. (Mar '15) -} canEqNC :: CtEvidence -> EqRel -> Type -> Type -> TcS (StopOrContinue Ct) canEqNC ev eq_rel ty1 ty2 = do { result <- zonk_eq_types ty1 ty2 ; case result of Left (Pair ty1' ty2') -> can_eq_nc False ev eq_rel ty1' ty1 ty2' ty2 Right ty -> canEqReflexive ev eq_rel ty } can_eq_nc :: Bool -- True => both types are flat -> CtEvidence -> EqRel -> Type -> Type -- LHS, after and before type-synonym expansion, resp -> Type -> Type -- RHS, after and before type-synonym expansion, resp -> TcS (StopOrContinue Ct) can_eq_nc flat ev eq_rel ty1 ps_ty1 ty2 ps_ty2 = do { traceTcS "can_eq_nc" $ vcat [ ppr ev, ppr eq_rel, ppr ty1, ppr ps_ty1, ppr ty2, ppr ps_ty2 ] ; rdr_env <- getGlobalRdrEnvTcS ; fam_insts <- getFamInstEnvs ; can_eq_nc' flat rdr_env fam_insts ev eq_rel ty1 ps_ty1 ty2 ps_ty2 } can_eq_nc' :: Bool -- True => both input types are flattened -> GlobalRdrEnv -- needed to see which newtypes are in scope -> FamInstEnvs -- needed to unwrap data instances -> CtEvidence -> EqRel -> Type -> Type -- LHS, after and before type-synonym expansion, resp -> Type -> Type -- RHS, after and before type-synonym expansion, resp -> TcS (StopOrContinue Ct) -- Expand synonyms first; see Note [Type synonyms and canonicalization] can_eq_nc' flat _rdr_env _envs ev eq_rel ty1 ps_ty1 ty2 ps_ty2 | Just ty1' <- coreView ty1 = can_eq_nc flat ev eq_rel ty1' ps_ty1 ty2 ps_ty2 | Just ty2' <- coreView ty2 = can_eq_nc flat ev eq_rel ty1 ps_ty1 ty2' ps_ty2 -- need to check for reflexivity in the ReprEq case. -- See Note [Eager reflexivity check] -- Check only when flat because the zonk_eq_types check in canEqNC takes -- care of the non-flat case. can_eq_nc' True _rdr_env _envs ev ReprEq ty1 _ ty2 _ | ty1 `eqType` ty2 = canEqReflexive ev ReprEq ty1 -- When working with ReprEq, unwrap newtypes. can_eq_nc' _flat rdr_env envs ev ReprEq ty1 _ ty2 ps_ty2 | Just (co, ty1') <- tcTopNormaliseNewTypeTF_maybe envs rdr_env ty1 = can_eq_newtype_nc rdr_env ev NotSwapped co ty1 ty1' ty2 ps_ty2 can_eq_nc' _flat rdr_env envs ev ReprEq ty1 ps_ty1 ty2 _ | Just (co, ty2') <- tcTopNormaliseNewTypeTF_maybe envs rdr_env ty2 = can_eq_newtype_nc rdr_env ev IsSwapped co ty2 ty2' ty1 ps_ty1 -- Then, get rid of casts can_eq_nc' flat _rdr_env _envs ev eq_rel (CastTy ty1 co1) _ ty2 ps_ty2 = canEqCast flat ev eq_rel NotSwapped ty1 co1 ty2 ps_ty2 can_eq_nc' flat _rdr_env _envs ev eq_rel ty1 ps_ty1 (CastTy ty2 co2) _ = canEqCast flat ev eq_rel IsSwapped ty2 co2 ty1 ps_ty1 ---------------------- -- Otherwise try to decompose ---------------------- -- Literals can_eq_nc' _flat _rdr_env _envs ev eq_rel ty1@(LitTy l1) _ (LitTy l2) _ | l1 == l2 = do { setEqIfWanted ev (mkReflCo (eqRelRole eq_rel) ty1) ; stopWith ev "Equal LitTy" } -- Try to decompose type constructor applications -- Including FunTy (s -> t) can_eq_nc' _flat _rdr_env _envs ev eq_rel ty1 _ ty2 _ | Just (tc1, tys1) <- tcRepSplitTyConApp_maybe ty1 , Just (tc2, tys2) <- tcRepSplitTyConApp_maybe ty2 , not (isTypeFamilyTyCon tc1) , not (isTypeFamilyTyCon tc2) = canTyConApp ev eq_rel tc1 tys1 tc2 tys2 can_eq_nc' _flat _rdr_env _envs ev eq_rel s1@(ForAllTy (Named {}) _) _ s2@(ForAllTy (Named {}) _) _ | CtWanted { ctev_loc = loc, ctev_dest = orig_dest } <- ev = do { let (bndrs1,body1) = tcSplitNamedPiTys s1 (bndrs2,body2) = tcSplitNamedPiTys s2 ; if not (equalLength bndrs1 bndrs2) || not (map binderVisibility bndrs1 == map binderVisibility bndrs2) then canEqHardFailure ev s1 s2 else do { traceTcS "Creating implication for polytype equality" $ ppr ev ; kind_cos <- zipWithM (unifyWanted loc Nominal) (map binderType bndrs1) (map binderType bndrs2) ; all_co <- deferTcSForAllEq (eqRelRole eq_rel) loc kind_cos (bndrs1,body1) (bndrs2,body2) ; setWantedEq orig_dest all_co ; stopWith ev "Deferred polytype equality" } } | otherwise = do { traceTcS "Omitting decomposition of given polytype equality" $ pprEq s1 s2 -- See Note [Do not decompose given polytype equalities] ; stopWith ev "Discard given polytype equality" } -- See Note [Canonicalising type applications] about why we require flat types can_eq_nc' True _rdr_env _envs ev eq_rel (AppTy t1 s1) _ ty2 _ | Just (t2, s2) <- tcSplitAppTy_maybe ty2 = can_eq_app ev eq_rel t1 s1 t2 s2 can_eq_nc' True _rdr_env _envs ev eq_rel ty1 _ (AppTy t2 s2) _ | Just (t1, s1) <- tcSplitAppTy_maybe ty1 = can_eq_app ev eq_rel t1 s1 t2 s2 -- No similarity in type structure detected. Flatten and try again. can_eq_nc' False rdr_env envs ev eq_rel _ ps_ty1 _ ps_ty2 = do { (xi1, co1) <- flatten FM_FlattenAll ev ps_ty1 ; (xi2, co2) <- flatten FM_FlattenAll ev ps_ty2 ; rewriteEqEvidence ev NotSwapped xi1 xi2 co1 co2 `andWhenContinue` \ new_ev -> can_eq_nc' True rdr_env envs new_ev eq_rel xi1 xi1 xi2 xi2 } -- Type variable on LHS or RHS are last. We want only flat types sent -- to canEqTyVar. -- See also Note [No top-level newtypes on RHS of representational equalities] can_eq_nc' True _rdr_env _envs ev eq_rel (TyVarTy tv1) _ _ ps_ty2 = canEqTyVar ev eq_rel NotSwapped tv1 ps_ty2 can_eq_nc' True _rdr_env _envs ev eq_rel _ ps_ty1 (TyVarTy tv2) _ = canEqTyVar ev eq_rel IsSwapped tv2 ps_ty1 -- We've flattened and the types don't match. Give up. can_eq_nc' True _rdr_env _envs ev _eq_rel _ ps_ty1 _ ps_ty2 = do { traceTcS "can_eq_nc' catch-all case" (ppr ps_ty1 $$ ppr ps_ty2) ; canEqHardFailure ev ps_ty1 ps_ty2 } --------------------------------- -- | Compare types for equality, while zonking as necessary. Gives up -- as soon as it finds that two types are not equal. -- This is quite handy when some unification has made two -- types in an inert wanted to be equal. We can discover the equality without -- flattening, which is sometimes very expensive (in the case of type functions). -- In particular, this function makes a ~20% improvement in test case -- perf/compiler/T5030. -- -- Returns either the (partially zonked) types in the case of -- inequality, or the one type in the case of equality. canEqReflexive is -- a good next step in the 'Right' case. Returning 'Left' is always safe. -- -- NB: This does *not* look through type synonyms. In fact, it treats type -- synonyms as rigid constructors. In the future, it might be convenient -- to look at only those arguments of type synonyms that actually appear -- in the synonym RHS. But we're not there yet. zonk_eq_types :: TcType -> TcType -> TcS (Either (Pair TcType) TcType) zonk_eq_types = go where go (TyVarTy tv1) (TyVarTy tv2) = tyvar_tyvar tv1 tv2 go (TyVarTy tv1) ty2 = tyvar NotSwapped tv1 ty2 go ty1 (TyVarTy tv2) = tyvar IsSwapped tv2 ty1 go ty1 ty2 | Just (tc1, tys1) <- tcRepSplitTyConApp_maybe ty1 , Just (tc2, tys2) <- tcRepSplitTyConApp_maybe ty2 , tc1 == tc2 = tycon tc1 tys1 tys2 go ty1 ty2 | Just (ty1a, ty1b) <- tcRepSplitAppTy_maybe ty1 , Just (ty2a, ty2b) <- tcRepSplitAppTy_maybe ty2 = do { res_a <- go ty1a ty2a ; res_b <- go ty1b ty2b ; return $ combine_rev mkAppTy res_b res_a } go ty1@(LitTy lit1) (LitTy lit2) | lit1 == lit2 = return (Right ty1) go ty1 ty2 = return $ Left (Pair ty1 ty2) -- we don't handle more complex forms here tyvar :: SwapFlag -> TcTyVar -> TcType -> TcS (Either (Pair TcType) TcType) -- try to do as little as possible, as anything we do here is redundant -- with flattening. In particular, no need to zonk kinds. That's why -- we don't use the already-defined zonking functions tyvar swapped tv ty = case tcTyVarDetails tv of MetaTv { mtv_ref = ref } -> do { cts <- readTcRef ref ; case cts of Flexi -> give_up Indirect ty' -> unSwap swapped go ty' ty } _ -> give_up where give_up = return $ Left $ unSwap swapped Pair (mkTyVarTy tv) ty tyvar_tyvar tv1 tv2 | tv1 == tv2 = return (Right (mkTyVarTy tv1)) | otherwise = do { (ty1', progress1) <- quick_zonk tv1 ; (ty2', progress2) <- quick_zonk tv2 ; if progress1 || progress2 then go ty1' ty2' else return $ Left (Pair (TyVarTy tv1) (TyVarTy tv2)) } quick_zonk tv = case tcTyVarDetails tv of MetaTv { mtv_ref = ref } -> do { cts <- readTcRef ref ; case cts of Flexi -> return (TyVarTy tv, False) Indirect ty' -> return (ty', True) } _ -> return (TyVarTy tv, False) -- This happens for type families, too. But recall that failure -- here just means to try harder, so it's OK if the type function -- isn't injective. tycon :: TyCon -> [TcType] -> [TcType] -> TcS (Either (Pair TcType) TcType) tycon tc tys1 tys2 = do { results <- zipWithM go tys1 tys2 ; return $ case combine_results results of Left tys -> Left (mkTyConApp tc <$> tys) Right tys -> Right (mkTyConApp tc tys) } combine_results :: [Either (Pair TcType) TcType] -> Either (Pair [TcType]) [TcType] combine_results = bimap (fmap reverse) reverse . foldl' (combine_rev (:)) (Right []) -- combine (in reverse) a new result onto an already-combined result combine_rev :: (a -> b -> c) -> Either (Pair b) b -> Either (Pair a) a -> Either (Pair c) c combine_rev f (Left list) (Left elt) = Left (f <$> elt <*> list) combine_rev f (Left list) (Right ty) = Left (f <$> pure ty <*> list) combine_rev f (Right tys) (Left elt) = Left (f <$> elt <*> pure tys) combine_rev f (Right tys) (Right ty) = Right (f ty tys) {- Note [Newtypes can blow the stack] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppose we have newtype X = MkX (Int -> X) newtype Y = MkY (Int -> Y) and now wish to prove [W] X ~R Y This Wanted will loop, expanding out the newtypes ever deeper looking for a solid match or a solid discrepancy. Indeed, there is something appropriate to this looping, because X and Y *do* have the same representation, in the limit -- they're both (Fix ((->) Int)). However, no finitely-sized coercion will ever witness it. This loop won't actually cause GHC to hang, though, because we check our depth when unwrapping newtypes. Note [Eager reflexivity check] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppose we have newtype X = MkX (Int -> X) and [W] X ~R X Naively, we would start unwrapping X and end up in a loop. Instead, we do this eager reflexivity check. This is necessary only for representational equality because the flattener technology deals with the similar case (recursive type families) for nominal equality. Note that this check does not catch all cases, but it will catch the cases we're most worried about, types like X above that are actually inhabited. Here's another place where this reflexivity check is key: Consider trying to prove (f a) ~R (f a). The AppTys in there can't be decomposed, because representational equality isn't congruent with respect to AppTy. So, when canonicalising the equality above, we get stuck and would normally produce a CIrredEvCan. However, we really do want to be able to solve (f a) ~R (f a). So, in the representational case only, we do a reflexivity check. (This would be sound in the nominal case, but unnecessary, and I [Richard E.] am worried that it would slow down the common case.) -} ------------------------ -- | We're able to unwrap a newtype. Update the bits accordingly. can_eq_newtype_nc :: GlobalRdrEnv -> CtEvidence -- ^ :: ty1 ~ ty2 -> SwapFlag -> TcCoercion -- ^ :: ty1 ~ ty1' -> TcType -- ^ ty1 -> TcType -- ^ ty1' -> TcType -- ^ ty2 -> TcType -- ^ ty2, with type synonyms -> TcS (StopOrContinue Ct) can_eq_newtype_nc rdr_env ev swapped co ty1 ty1' ty2 ps_ty2 = do { traceTcS "can_eq_newtype_nc" $ vcat [ ppr ev, ppr swapped, ppr co, ppr ty1', ppr ty2 ] -- check for blowing our stack: -- See Note [Newtypes can blow the stack] ; checkReductionDepth (ctEvLoc ev) ty1 ; addUsedDataCons rdr_env (tyConAppTyCon ty1) -- we have actually used the newtype constructor here, so -- make sure we don't warn about importing it! ; rewriteEqEvidence ev swapped ty1' ps_ty2 (mkTcSymCo co) (mkTcReflCo Representational ps_ty2) `andWhenContinue` \ new_ev -> can_eq_nc False new_ev ReprEq ty1' ty1' ty2 ps_ty2 } --------- -- ^ Decompose a type application. -- All input types must be flat. See Note [Canonicalising type applications] can_eq_app :: CtEvidence -- :: s1 t1 ~r s2 t2 -> EqRel -- r -> Xi -> Xi -- s1 t1 -> Xi -> Xi -- s2 t2 -> TcS (StopOrContinue Ct) -- AppTys only decompose for nominal equality, so this case just leads -- to an irreducible constraint; see typecheck/should_compile/T10494 -- See Note [Decomposing equality], note {4} can_eq_app ev ReprEq _ _ _ _ = do { traceTcS "failing to decompose representational AppTy equality" (ppr ev) ; continueWith (CIrredEvCan { cc_ev = ev }) } -- no need to call canEqFailure, because that flattens, and the -- types involved here are already flat can_eq_app ev NomEq s1 t1 s2 t2 | CtDerived { ctev_loc = loc } <- ev = do { unifyDeriveds loc [Nominal, Nominal] [s1, t1] [s2, t2] ; stopWith ev "Decomposed [D] AppTy" } | CtWanted { ctev_dest = dest, ctev_loc = loc } <- ev = do { co_s <- unifyWanted loc Nominal s1 s2 ; co_t <- unifyWanted loc Nominal t1 t2 ; let co = mkAppCo co_s co_t ; setWantedEq dest co ; stopWith ev "Decomposed [W] AppTy" } | CtGiven { ctev_evar = evar, ctev_loc = loc } <- ev = do { let co = mkTcCoVarCo evar co_s = mkTcLRCo CLeft co co_t = mkTcLRCo CRight co ; evar_s <- newGivenEvVar loc ( mkTcEqPredLikeEv ev s1 s2 , EvCoercion co_s ) ; evar_t <- newGivenEvVar loc ( mkTcEqPredLikeEv ev t1 t2 , EvCoercion co_t ) ; emitWorkNC [evar_t] ; canEqNC evar_s NomEq s1 s2 } | otherwise -- Can't happen = error "can_eq_app" ----------------------- -- | Break apart an equality over a casted type -- looking like (ty1 |> co1) ~ ty2 (modulo a swap-flag) canEqCast :: Bool -- are both types flat? -> CtEvidence -> EqRel -> SwapFlag -> TcType -> Coercion -- LHS (res. RHS), ty1 |> co1 -> TcType -> TcType -- RHS (res. LHS), ty2 both normal and pretty -> TcS (StopOrContinue Ct) canEqCast flat ev eq_rel swapped ty1 co1 ty2 ps_ty2 = do { traceTcS "Decomposing cast" (vcat [ ppr ev , ppr ty1 <+> text "|>" <+> ppr co1 , ppr ps_ty2 ]) ; rewriteEqEvidence ev swapped ty1 ps_ty2 (mkTcReflCo role ty1 `mkTcCoherenceRightCo` co1) (mkTcReflCo role ps_ty2) `andWhenContinue` \ new_ev -> can_eq_nc flat new_ev eq_rel ty1 ty1 ty2 ps_ty2 } where role = eqRelRole eq_rel ------------------------ canTyConApp :: CtEvidence -> EqRel -> TyCon -> [TcType] -> TyCon -> [TcType] -> TcS (StopOrContinue Ct) -- See Note [Decomposing TyConApps] canTyConApp ev eq_rel tc1 tys1 tc2 tys2 | tc1 == tc2 , length tys1 == length tys2 = do { inerts <- getTcSInerts ; if can_decompose inerts then do { traceTcS "canTyConApp" (ppr ev $$ ppr eq_rel $$ ppr tc1 $$ ppr tys1 $$ ppr tys2) ; canDecomposableTyConAppOK ev eq_rel tc1 tys1 tys2 ; stopWith ev "Decomposed TyConApp" } else canEqFailure ev eq_rel ty1 ty2 } -- Fail straight away for better error messages -- See Note [Use canEqFailure in canDecomposableTyConApp] | eq_rel == ReprEq && not (isGenerativeTyCon tc1 Representational && isGenerativeTyCon tc2 Representational) = canEqFailure ev eq_rel ty1 ty2 | otherwise = canEqHardFailure ev ty1 ty2 where ty1 = mkTyConApp tc1 tys1 ty2 = mkTyConApp tc2 tys2 loc = ctEvLoc ev pred = ctEvPred ev -- See Note [Decomposing equality] can_decompose inerts = isInjectiveTyCon tc1 (eqRelRole eq_rel) || (ctEvFlavour ev /= Given && isEmptyBag (matchableGivens loc pred inerts)) {- Note [Use canEqFailure in canDecomposableTyConApp] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We must use canEqFailure, not canEqHardFailure here, because there is the possibility of success if working with a representational equality. Here is one case: type family TF a where TF Char = Bool data family DF a newtype instance DF Bool = MkDF Int Suppose we are canonicalising (Int ~R DF (TF a)), where we don't yet know `a`. This is *not* a hard failure, because we might soon learn that `a` is, in fact, Char, and then the equality succeeds. Here is another case: [G] Age ~R Int where Age's constructor is not in scope. We don't want to report an "inaccessible code" error in the context of this Given! For example, see typecheck/should_compile/T10493, repeated here: import Data.Ord (Down) -- no constructor foo :: Coercible (Down Int) Int => Down Int -> Int foo = coerce That should compile, but only because we use canEqFailure and not canEqHardFailure. Note [Decomposing equality] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ If we have a constraint (of any flavour and role) that looks like T tys1 ~ T tys2, what can we conclude about tys1 and tys2? The answer, of course, is "it depends". This Note spells it all out. In this Note, "decomposition" refers to taking the constraint [fl] (T tys1 ~X T tys2) (for some flavour fl and some role X) and replacing it with [fls'] (tys1 ~Xs' tys2) where that notation indicates a list of new constraints, where the new constraints may have different flavours and different roles. The key property to consider is injectivity. When decomposing a Given the decomposition is sound if and only if T is injective in all of its type arguments. When decomposing a Wanted, the decomposition is sound (assuming the correct roles in the produced equality constraints), but it may be a guess -- that is, an unforced decision by the constraint solver. Decomposing Wanteds over injective TyCons does not entail guessing. But sometimes we want to decompose a Wanted even when the TyCon involved is not injective! (See below.) So, in broad strokes, we want this rule: (*) Decompose a constraint (T tys1 ~X T tys2) if and only if T is injective at role X. Pursuing the details requires exploring three axes: * Flavour: Given vs. Derived vs. Wanted * Role: Nominal vs. Representational * TyCon species: datatype vs. newtype vs. data family vs. type family vs. type variable (So a type variable isn't a TyCon, but it's convenient to put the AppTy case in the same table.) Right away, we can say that Derived behaves just as Wanted for the purposes of decomposition. The difference between Derived and Wanted is the handling of evidence. Since decomposition in these cases isn't a matter of soundness but of guessing, we want the same behavior regardless of evidence. Here is a table (discussion following) detailing where decomposition of (T s1 ... sn) ~r (T t1 .. tn) is allowed. The first four lines (Data types ... type family) refer to TyConApps with various TyCons T; the last line is for AppTy, where there is presumably a type variable at the head, so it's actually (s s1 ... sn) ~r (t t1 .. tn) NOMINAL GIVEN WANTED Datatype YES YES Newtype YES YES Data family YES YES Type family YES, in injective args{1} YES, in injective args{1} Type variable YES YES REPRESENTATIONAL GIVEN WANTED Datatype YES YES Newtype NO{2} MAYBE{2} Data family NO{3} MAYBE{3} Type family NO NO Type variable NO{4} NO{4} {1}: Type families can be injective in some, but not all, of their arguments, so we want to do partial decomposition. This is quite different than the way other decomposition is done, where the decomposed equalities replace the original one. We thus proceed much like we do with superclasses: emitting new Givens when "decomposing" a partially-injective type family Given and new Deriveds when "decomposing" a partially-injective type family Wanted. (As of the time of writing, 13 June 2015, the implementation of injective type families has not been merged, but it should be soon. Please delete this parenthetical if the implementation is indeed merged.) {2}: See Note [Decomposing newtypes at representational role] {3}: Because of the possibility of newtype instances, we must treat data families like newtypes. See also Note [Decomposing newtypes at representational role]. See #10534 and test case typecheck/should_fail/T10534. {4}: Because type variables can stand in for newtypes, we conservatively do not decompose AppTys over representational equality. In the implementation of can_eq_nc and friends, we don't directly pattern match using lines like in the tables above, as those tables don't cover all cases (what about PrimTyCon? tuples?). Instead we just ask about injectivity, boiling the tables above down to rule (*). The exceptions to rule (*) are for injective type families, which are handled separately from other decompositions, and the MAYBE entries above. Note [Decomposing newtypes at representational role] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This note discusses the 'newtype' line in the REPRESENTATIONAL table in Note [Decomposing equality]. (At nominal role, newtypes are fully decomposable.) Here is a representative example of why representational equality over newtypes is tricky: newtype Nt a = Mk Bool -- NB: a is not used in the RHS, type role Nt representational -- but the user gives it an R role anyway If we have [W] Nt alpha ~R Nt beta, we *don't* want to decompose to [W] alpha ~R beta, because it's possible that alpha and beta aren't representationally equal. Here's another example. newtype Nt a = MkNt (Id a) type family Id a where Id a = a [W] Nt Int ~R Nt Age Because of its use of a type family, Nt's parameter will get inferred to have a nominal role. Thus, decomposing the wanted will yield [W] Int ~N Age, which is unsatisfiable. Unwrapping, though, leads to a solution. Conclusion: * Unwrap newtypes before attempting to decompose them. This is done in can_eq_nc'. It all comes from the fact that newtypes aren't necessarily injective w.r.t. representational equality. Furthermore, as explained in Note [NthCo and newtypes] in TyCoRep, we can't use NthCo on representational coercions over newtypes. NthCo comes into play only when decomposing givens. Conclusion: * Do not decompose [G] N s ~R N t Is it sensible to decompose *Wanted* constraints over newtypes? Yes! It's the only way we could ever prove (IO Int ~R IO Age), recalling that IO is a newtype. However we must be careful. Consider type role Nt representational [G] Nt a ~R Nt b (1) [W] NT alpha ~R Nt b (2) [W] alpha ~ a (3) If we focus on (3) first, we'll substitute in (2), and now it's identical to the given (1), so we succeed. But if we focus on (2) first, and decompose it, we'll get (alpha ~R b), which is not soluble. This is exactly like the question of overlapping Givens for class constraints: see Note [Instance and Given overlap] in TcInteract. Conclusion: * Decompose [W] N s ~R N t iff there no given constraint that could later solve it. -} canDecomposableTyConAppOK :: CtEvidence -> EqRel -> TyCon -> [TcType] -> [TcType] -> TcS () -- Precondition: tys1 and tys2 are the same length, hence "OK" canDecomposableTyConAppOK ev eq_rel tc tys1 tys2 = case ev of CtDerived {} -> unifyDeriveds loc tc_roles tys1 tys2 CtWanted { ctev_dest = dest } -> do { cos <- zipWith4M unifyWanted new_locs tc_roles tys1 tys2 ; setWantedEq dest (mkTyConAppCo role tc cos) } CtGiven { ctev_evar = evar } -> do { let ev_co = mkCoVarCo evar ; given_evs <- newGivenEvVars loc $ [ ( mkPrimEqPredRole r ty1 ty2 , EvCoercion (mkNthCo i ev_co) ) | (r, ty1, ty2, i) <- zip4 tc_roles tys1 tys2 [0..] , r /= Phantom , not (isCoercionTy ty1) && not (isCoercionTy ty2) ] ; emitWorkNC given_evs } where loc = ctEvLoc ev role = eqRelRole eq_rel tc_roles = tyConRolesX role tc -- the following makes a better distinction between "kind" and "type" -- in error messages bndrs = tyConBinders tc kind_loc = toKindLoc loc is_kinds = map isNamedBinder bndrs new_locs | Just KindLevel <- ctLocTypeOrKind_maybe loc = repeat loc | otherwise = map (\is_kind -> if is_kind then kind_loc else loc) is_kinds -- | Call when canonicalizing an equality fails, but if the equality is -- representational, there is some hope for the future. -- Examples in Note [Use canEqFailure in canDecomposableTyConApp] canEqFailure :: CtEvidence -> EqRel -> TcType -> TcType -> TcS (StopOrContinue Ct) canEqFailure ev NomEq ty1 ty2 = canEqHardFailure ev ty1 ty2 canEqFailure ev ReprEq ty1 ty2 = do { (xi1, co1) <- flatten FM_FlattenAll ev ty1 ; (xi2, co2) <- flatten FM_FlattenAll ev ty2 -- We must flatten the types before putting them in the -- inert set, so that we are sure to kick them out when -- new equalities become available ; traceTcS "canEqFailure with ReprEq" $ vcat [ ppr ev, ppr ty1, ppr ty2, ppr xi1, ppr xi2 ] ; rewriteEqEvidence ev NotSwapped xi1 xi2 co1 co2 `andWhenContinue` \ new_ev -> continueWith (CIrredEvCan { cc_ev = new_ev }) } -- | Call when canonicalizing an equality fails with utterly no hope. canEqHardFailure :: CtEvidence -> TcType -> TcType -> TcS (StopOrContinue Ct) -- See Note [Make sure that insolubles are fully rewritten] canEqHardFailure ev ty1 ty2 = do { (s1, co1) <- flatten FM_SubstOnly ev ty1 ; (s2, co2) <- flatten FM_SubstOnly ev ty2 ; rewriteEqEvidence ev NotSwapped s1 s2 co1 co2 `andWhenContinue` \ new_ev -> do { emitInsoluble (mkNonCanonical new_ev) ; stopWith new_ev "Definitely not equal" }} {- Note [Decomposing TyConApps] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If we see (T s1 t1 ~ T s2 t2), then we can just decompose to (s1 ~ s2, t1 ~ t2) and push those back into the work list. But if s1 = K k1 s2 = K k2 then we will just decomopose s1~s2, and it might be better to do so on the spot. An important special case is where s1=s2, and we get just Refl. So canDecomposableTyCon is a fast-path decomposition that uses unifyWanted etc to short-cut that work. Note [Canonicalising type applications] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Given (s1 t1) ~ ty2, how should we proceed? The simple things is to see if ty2 is of form (s2 t2), and decompose. By this time s1 and s2 can't be saturated type function applications, because those have been dealt with by an earlier equation in can_eq_nc, so it is always sound to decompose. However, over-eager decomposition gives bad error messages for things like a b ~ Maybe c e f ~ p -> q Suppose (in the first example) we already know a~Array. Then if we decompose the application eagerly, yielding a ~ Maybe b ~ c we get an error "Can't match Array ~ Maybe", but we'd prefer to get "Can't match Array b ~ Maybe c". So instead can_eq_wanted_app flattens the LHS and RHS, in the hope of replacing (a b) by (Array b), before using try_decompose_app to decompose it. Note [Make sure that insolubles are fully rewritten] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When an equality fails, we still want to rewrite the equality all the way down, so that it accurately reflects (a) the mutable reference substitution in force at start of solving (b) any ty-binds in force at this point in solving See Note [Kick out insolubles] in TcSMonad. And if we don't do this there is a bad danger that TcSimplify.applyTyVarDefaulting will find a variable that has in fact been substituted. Note [Do not decompose Given polytype equalities] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider [G] (forall a. t1 ~ forall a. t2). Can we decompose this? No -- what would the evidence look like? So instead we simply discard this given evidence. Note [Combining insoluble constraints] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ As this point we have an insoluble constraint, like Int~Bool. * If it is Wanted, delete it from the cache, so that subsequent Int~Bool constraints give rise to separate error messages * But if it is Derived, DO NOT delete from cache. A class constraint may get kicked out of the inert set, and then have its functional dependency Derived constraints generated a second time. In that case we don't want to get two (or more) error messages by generating two (or more) insoluble fundep constraints from the same class constraint. Note [No top-level newtypes on RHS of representational equalities] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppose we're in this situation: work item: [W] c1 : a ~R b inert: [G] c2 : b ~R Id a where newtype Id a = Id a We want to make sure canEqTyVar sees [W] a ~R a, after b is flattened and the Id newtype is unwrapped. This is assured by requiring only flat types in canEqTyVar *and* having the newtype-unwrapping check above the tyvar check in can_eq_nc. Note [Occurs check error] ~~~~~~~~~~~~~~~~~~~~~~~~~ If we have an occurs check error, are we necessarily hosed? Say our tyvar is tv1 and the type it appears in is xi2. Because xi2 is function free, then if we're computing w.r.t. nominal equality, then, yes, we're hosed. Nothing good can come from (a ~ [a]). If we're computing w.r.t. representational equality, this is a little subtler. Once again, (a ~R [a]) is a bad thing, but (a ~R N a) for a newtype N might be just fine. This means also that (a ~ b a) might be fine, because `b` might become a newtype. So, we must check: does tv1 appear in xi2 under any type constructor that is generative w.r.t. representational equality? That's what isTyVarUnderDatatype does. (The other name I considered, isTyVarUnderTyConGenerativeWrtReprEq was a bit verbose. And the shorter name gets the point across.) See also #10715, which induced this addition. Note [No derived kind equalities] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When we're working with a heterogeneous derived equality [D] (t1 :: k1) ~ (t2 :: k2) we want to homogenise to establish the kind invariant on CTyEqCans. But we can't emit [D] k1 ~ k2 because we wouldn't then be able to use the evidence in the homogenised types. So we emit a wanted constraint, because we do really need the evidence here. Thus: no derived kind equalities. -} canCFunEqCan :: CtEvidence -> TyCon -> [TcType] -- LHS -> TcTyVar -- RHS -> TcS (StopOrContinue Ct) -- ^ Canonicalise a CFunEqCan. We know that -- the arg types are already flat, -- and the RHS is a fsk, which we must *not* substitute. -- So just substitute in the LHS canCFunEqCan ev fn tys fsk = do { (tys', cos) <- flattenManyNom ev tys -- cos :: tys' ~ tys ; let lhs_co = mkTcTyConAppCo Nominal fn cos -- :: F tys' ~ F tys new_lhs = mkTyConApp fn tys' fsk_ty = mkTyVarTy fsk ; rewriteEqEvidence ev NotSwapped new_lhs fsk_ty lhs_co (mkTcNomReflCo fsk_ty) `andWhenContinue` \ ev' -> do { extendFlatCache fn tys' (ctEvCoercion ev', fsk_ty, ctEvFlavour ev') ; continueWith (CFunEqCan { cc_ev = ev', cc_fun = fn , cc_tyargs = tys', cc_fsk = fsk }) } } --------------------- canEqTyVar :: CtEvidence -> EqRel -> SwapFlag -> TcTyVar -- already flat -> TcType -- already flat -> TcS (StopOrContinue Ct) -- A TyVar on LHS, but so far un-zonked canEqTyVar ev eq_rel swapped tv1 ps_ty2 -- ev :: tv ~ s2 = do { traceTcS "canEqTyVar" (ppr tv1 $$ ppr ps_ty2 $$ ppr swapped) -- FM_Avoid commented out: see Note [Lazy flattening] in TcFlatten -- let fmode = FE { fe_ev = ev, fe_mode = FM_Avoid tv1' True } -- Flatten the RHS less vigorously, to avoid gratuitous flattening -- True <=> xi2 should not itself be a type-function application ; dflags <- getDynFlags ; canEqTyVar2 dflags ev eq_rel swapped tv1 ps_ty2 } canEqTyVar2 :: DynFlags -> CtEvidence -- lhs ~ rhs (or, if swapped, orhs ~ olhs) -> EqRel -> SwapFlag -> TcTyVar -- lhs, flat -> TcType -- rhs, flat -> TcS (StopOrContinue Ct) -- LHS is an inert type variable, -- and RHS is fully rewritten, but with type synonyms -- preserved as much as possible canEqTyVar2 dflags ev eq_rel swapped tv1 xi2 | Just (tv2, kco2) <- getCastedTyVar_maybe xi2 = canEqTyVarTyVar ev eq_rel swapped tv1 tv2 kco2 | OC_OK xi2' <- occurCheckExpand dflags tv1 xi2 -- No occurs check -- We use xi2' on the RHS of the new CTyEqCan, a ~ xi2' -- to establish the invariant that a does not appear in the -- rhs of the CTyEqCan. This is guaranteed by occurCheckExpand; -- see Note [Occurs check expansion] in TcType = rewriteEqEvidence ev swapped xi1 xi2' co1 (mkTcReflCo role xi2') `andWhenContinue` \ new_ev -> homogeniseRhsKind new_ev eq_rel xi1 xi2' $ \new_new_ev xi2'' -> CTyEqCan { cc_ev = new_new_ev, cc_tyvar = tv1 , cc_rhs = xi2'', cc_eq_rel = eq_rel } | otherwise -- Occurs check error = do { traceTcS "canEqTyVar2 occurs check error" (ppr tv1 $$ ppr xi2) ; rewriteEqEvidence ev swapped xi1 xi2 co1 co2 `andWhenContinue` \ new_ev -> if eq_rel == NomEq || isTyVarUnderDatatype tv1 xi2 then do { emitInsoluble (mkNonCanonical new_ev) -- If we have a ~ [a], it is not canonical, and in particular -- we don't want to rewrite existing inerts with it, otherwise -- we'd risk divergence in the constraint solver ; stopWith new_ev "Occurs check" } -- A representational equality with an occurs-check problem isn't -- insoluble! For example: -- a ~R b a -- We might learn that b is the newtype Id. -- But, the occurs-check certainly prevents the equality from being -- canonical, and we might loop if we were to use it in rewriting. else do { traceTcS "Occurs-check in representational equality" (ppr xi1 $$ ppr xi2) ; continueWith (CIrredEvCan { cc_ev = new_ev }) } } where role = eqRelRole eq_rel xi1 = mkTyVarTy tv1 co1 = mkTcReflCo role xi1 co2 = mkTcReflCo role xi2 canEqTyVarTyVar :: CtEvidence -- tv1 ~ rhs (or rhs ~ tv1, if swapped) -> EqRel -> SwapFlag -> TcTyVar -> TcTyVar -- tv1, tv2 -> Coercion -- the co in (rhs = tv2 |> co) -> TcS (StopOrContinue Ct) -- Both LHS and RHS rewrote to a type variable -- See Note [Canonical orientation for tyvar/tyvar equality constraints] canEqTyVarTyVar ev eq_rel swapped tv1 tv2 kco2 | tv1 == tv2 = do { let mk_coh = case swapped of IsSwapped -> mkTcCoherenceLeftCo NotSwapped -> mkTcCoherenceRightCo ; setEvBindIfWanted ev (EvCoercion $ mkTcReflCo role xi1 `mk_coh` kco2) ; stopWith ev "Equal tyvars" } -- We don't do this any more -- See Note [Orientation of equalities with fmvs] in TcFlatten -- | isFmvTyVar tv1 = do_fmv swapped tv1 xi1 xi2 co1 co2 -- | isFmvTyVar tv2 = do_fmv (flipSwap swapped) tv2 xi2 xi1 co2 co1 | swap_over = do_swap | otherwise = no_swap where role = eqRelRole eq_rel xi1 = mkTyVarTy tv1 co1 = mkTcReflCo role xi1 xi2 = mkTyVarTy tv2 co2 = mkTcReflCo role xi2 `mkTcCoherenceRightCo` kco2 no_swap = canon_eq swapped tv1 xi1 xi2 co1 co2 do_swap = canon_eq (flipSwap swapped) tv2 xi2 xi1 co2 co1 canon_eq swapped tv1 ty1 ty2 co1 co2 -- ev : tv1 ~ orhs (not swapped) or orhs ~ tv1 (swapped) -- co1 : xi1 ~ tv1 -- co2 : xi2 ~ tv2 = do { traceTcS "canEqTyVarTyVar" (vcat [ ppr swapped , ppr tv1 <+> dcolon <+> ppr (tyVarKind tv1) , ppr ty1 <+> dcolon <+> ppr (typeKind ty1) , ppr ty2 <+> dcolon <+> ppr (typeKind ty2) , ppr co1 <+> dcolon <+> ppr (tcCoercionKind co1) , ppr co2 <+> dcolon <+> ppr (tcCoercionKind co2) ]) ; rewriteEqEvidence ev swapped ty1 ty2 co1 co2 `andWhenContinue` \ new_ev -> homogeniseRhsKind new_ev eq_rel ty1 ty2 $ \new_new_ev ty2' -> CTyEqCan { cc_ev = new_new_ev, cc_tyvar = tv1 , cc_rhs = ty2', cc_eq_rel = eq_rel } } {- We don't do this any more See Note [Orientation of equalities with fmvs] in TcFlatten -- tv1 is the flatten meta-var do_fmv swapped tv1 xi1 xi2 co1 co2 | same_kind = canon_eq swapped tv1 xi1 xi2 co1 co2 | otherwise -- Presumably tv1 :: *, since it is a flatten meta-var, -- at a kind that has some interesting sub-kind structure. -- Since the two kinds are not the same, we must have -- tv1 `subKind` tv2, which is the wrong way round -- e.g. (fmv::*) ~ (a::OpenKind) -- So make a new meta-var and use that: -- fmv ~ (beta::*) -- (a::OpenKind) ~ (beta::*) = ASSERT2( k1_sub_k2, ppr tv1 <+> dcolon <+> ppr (tyVarKind tv1) $$ ppr xi2 <+> dcolon <+> ppr (typeKind xi2) ) ASSERT2( isWanted ev, ppr ev ) -- Only wanteds have flatten meta-vars do { tv_ty <- newFlexiTcSTy (tyVarKind tv1) ; new_ev <- newWantedEvVarNC (ctEvLoc ev) (mkPrimEqPredRole (eqRelRole eq_rel) g tv_ty xi2) ; emitWorkNC [new_ev] ; canon_eq swapped tv1 xi1 tv_ty co1 (ctEvCoercion new_ev) } -} swap_over -- If tv1 is touchable, swap only if tv2 is also -- touchable and it's strictly better to update the latter -- But see Note [Avoid unnecessary swaps] | Just lvl1 <- metaTyVarTcLevel_maybe tv1 = case metaTyVarTcLevel_maybe tv2 of Nothing -> False Just lvl2 | lvl2 `strictlyDeeperThan` lvl1 -> True | lvl1 `strictlyDeeperThan` lvl2 -> False | otherwise -> nicer_to_update_tv2 -- So tv1 is not a meta tyvar -- If only one is a meta tyvar, put it on the left -- This is not because it'll be solved; but because -- the floating step looks for meta tyvars on the left | isMetaTyVar tv2 = True -- So neither is a meta tyvar (including FlatMetaTv) -- If only one is a flatten skolem, put it on the left -- See Note [Eliminate flat-skols] | not (isFlattenTyVar tv1), isFlattenTyVar tv2 = True | otherwise = False nicer_to_update_tv2 = (isSigTyVar tv1 && not (isSigTyVar tv2)) || (isSystemName (Var.varName tv2) && not (isSystemName (Var.varName tv1))) -- | Solve a reflexive equality constraint canEqReflexive :: CtEvidence -- ty ~ ty -> EqRel -> TcType -- ty -> TcS (StopOrContinue Ct) -- always Stop canEqReflexive ev eq_rel ty = do { setEvBindIfWanted ev (EvCoercion $ mkTcReflCo (eqRelRole eq_rel) ty) ; stopWith ev "Solved by reflexivity" } -- See Note [Equalities with incompatible kinds] homogeniseRhsKind :: CtEvidence -- ^ the evidence to homogenise -> EqRel -> TcType -- ^ original LHS -> Xi -- ^ original RHS -> (CtEvidence -> Xi -> Ct) -- ^ how to build the homogenised constraint; -- the 'Xi' is the new RHS -> TcS (StopOrContinue Ct) homogeniseRhsKind ev eq_rel lhs rhs build_ct | k1 `eqType` k2 = continueWith (build_ct ev rhs) | CtGiven { ctev_evar = evar } <- ev -- tm :: (lhs :: k1) ~ (rhs :: k2) = do { kind_ev_id <- newBoundEvVarId kind_pty (EvCoercion $ mkTcKindCo $ mkTcCoVarCo evar) -- kind_ev_id :: (k1 :: *) ~# (k2 :: *) ; let kind_ev = CtGiven { ctev_pred = kind_pty , ctev_evar = kind_ev_id , ctev_loc = kind_loc } homo_co = mkSymCo $ mkCoVarCo kind_ev_id rhs' = mkCastTy rhs homo_co ; traceTcS "Hetero equality gives rise to given kind equality" (ppr kind_ev_id <+> dcolon <+> ppr kind_pty) ; emitWorkNC [kind_ev] ; type_ev <- newGivenEvVar loc ( mkTcEqPredLikeEv ev lhs rhs' , EvCoercion $ mkTcCoherenceRightCo (mkTcCoVarCo evar) homo_co ) -- type_ev :: (lhs :: k1) ~ ((rhs |> sym kind_ev_id) :: k1) ; continueWith (build_ct type_ev rhs') } | otherwise -- Wanted and Derived. See Note [No derived kind equalities] -- evar :: (lhs :: k1) ~ (rhs :: k2) = do { (kind_ev, kind_co) <- newWantedEq kind_loc Nominal k1 k2 -- kind_ev :: (k1 :: *) ~ (k2 :: *) ; traceTcS "Hetero equality gives rise to wanted kind equality" $ ppr (kind_ev) ; emitWorkNC [kind_ev] ; let homo_co = mkSymCo kind_co -- homo_co :: k2 ~ k1 rhs' = mkCastTy rhs homo_co ; case ev of CtGiven {} -> panic "homogeniseRhsKind" CtDerived {} -> continueWith (build_ct (ev { ctev_pred = homo_pred }) rhs') where homo_pred = mkTcEqPredLikeEv ev lhs rhs' CtWanted { ctev_dest = dest } -> do { (type_ev, hole_co) <- newWantedEq loc role lhs rhs' -- type_ev :: (lhs :: k1) ~ (rhs |> sym kind_ev :: k1) ; setWantedEq dest (hole_co `mkTransCo` (mkReflCo role rhs `mkCoherenceLeftCo` homo_co)) -- dest := hole ; <rhs> |> homo_co :: (lhs :: k1) ~ (rhs :: k2) ; continueWith (build_ct type_ev rhs') }} where k1 = typeKind lhs k2 = typeKind rhs kind_pty = mkHeteroPrimEqPred liftedTypeKind liftedTypeKind k1 k2 kind_loc = mkKindLoc lhs rhs loc loc = ctev_loc ev role = eqRelRole eq_rel {- Note [Canonical orientation for tyvar/tyvar equality constraints] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When we have a ~ b where both 'a' and 'b' are TcTyVars, which way round should be oriented in the CTyEqCan? The rules, implemented by canEqTyVarTyVar, are these * If either is a flatten-meta-variables, it goes on the left. * If one is a strict sub-kind of the other e.g. (alpha::?) ~ (beta::*) orient them so RHS is a subkind of LHS. That way we will replace 'a' with 'b', correctly narrowing the kind. This establishes the subkind invariant of CTyEqCan. * Put a meta-tyvar on the left if possible alpha[3] ~ r * If both are meta-tyvars, put the more touchable one (deepest level number) on the left, so there is the best chance of unifying it alpha[3] ~ beta[2] * If both are meta-tyvars and both at the same level, put a SigTv on the right if possible alpha[2] ~ beta[2](sig-tv) That way, when we unify alpha := beta, we don't lose the SigTv flag. * Put a meta-tv with a System Name on the left if possible so it gets eliminated (improves error messages) * If one is a flatten-skolem, put it on the left so that it is substituted out Note [Elminate flat-skols] fsk ~ a Note [Avoid unnecessary swaps] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If we swap without actually improving matters, we can get an infnite loop. Consider work item: a ~ b inert item: b ~ c We canonicalise the work-time to (a ~ c). If we then swap it before aeding to the inert set, we'll add (c ~ a), and therefore kick out the inert guy, so we get new work item: b ~ c inert item: c ~ a And now the cycle just repeats Note [Eliminate flat-skols] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppose we have [G] Num (F [a]) then we flatten to [G] Num fsk [G] F [a] ~ fsk where fsk is a flatten-skolem (FlatSkol). Suppose we have type instance F [a] = a then we'll reduce the second constraint to [G] a ~ fsk and then replace all uses of 'a' with fsk. That's bad because in error messages intead of saying 'a' we'll say (F [a]). In all places, including those where the programmer wrote 'a' in the first place. Very confusing! See Trac #7862. Solution: re-orient a~fsk to fsk~a, so that we preferentially eliminate the fsk. Note [Equalities with incompatible kinds] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ canEqLeaf is about to make a CTyEqCan or CFunEqCan; but both have the invariant that LHS and RHS satisfy the kind invariants for CTyEqCan, CFunEqCan. What if we try to unify two things with incompatible kinds? eg a ~ b where a::*, b::*->* or a ~ b where a::*, b::k, k is a kind variable The CTyEqCan compatKind invariant is important. If we make a CTyEqCan for a~b, then we might well *substitute* 'b' for 'a', and that might make a well-kinded type ill-kinded; and that is bad (eg typeKind can crash, see Trac #7696). So instead for these ill-kinded equalities we homogenise the RHS of the equality, emitting new constraints as necessary. Note [Type synonyms and canonicalization] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We treat type synonym applications as xi types, that is, they do not count as type function applications. However, we do need to be a bit careful with type synonyms: like type functions they may not be generative or injective. However, unlike type functions, they are parametric, so there is no problem in expanding them whenever we see them, since we do not need to know anything about their arguments in order to expand them; this is what justifies not having to treat them as specially as type function applications. The thing that causes some subtleties is that we prefer to leave type synonym applications *unexpanded* whenever possible, in order to generate better error messages. If we encounter an equality constraint with type synonym applications on both sides, or a type synonym application on one side and some sort of type application on the other, we simply must expand out the type synonyms in order to continue decomposing the equality constraint into primitive equality constraints. For example, suppose we have type F a = [Int] and we encounter the equality F a ~ [b] In order to continue we must expand F a into [Int], giving us the equality [Int] ~ [b] which we can then decompose into the more primitive equality constraint Int ~ b. However, if we encounter an equality constraint with a type synonym application on one side and a variable on the other side, we should NOT (necessarily) expand the type synonym, since for the purpose of good error messages we want to leave type synonyms unexpanded as much as possible. Hence the ps_ty1, ps_ty2 argument passed to canEqTyVar. -} {- ************************************************************************ * * Evidence transformation * * ************************************************************************ -} data StopOrContinue a = ContinueWith a -- The constraint was not solved, although it may have -- been rewritten | Stop CtEvidence -- The (rewritten) constraint was solved SDoc -- Tells how it was solved -- Any new sub-goals have been put on the work list instance Functor StopOrContinue where fmap f (ContinueWith x) = ContinueWith (f x) fmap _ (Stop ev s) = Stop ev s instance Outputable a => Outputable (StopOrContinue a) where ppr (Stop ev s) = text "Stop" <> parens s <+> ppr ev ppr (ContinueWith w) = text "ContinueWith" <+> ppr w continueWith :: a -> TcS (StopOrContinue a) continueWith = return . ContinueWith stopWith :: CtEvidence -> String -> TcS (StopOrContinue a) stopWith ev s = return (Stop ev (text s)) andWhenContinue :: TcS (StopOrContinue a) -> (a -> TcS (StopOrContinue b)) -> TcS (StopOrContinue b) andWhenContinue tcs1 tcs2 = do { r <- tcs1 ; case r of Stop ev s -> return (Stop ev s) ContinueWith ct -> tcs2 ct } infixr 0 `andWhenContinue` -- allow chaining with ($) rewriteEvidence :: CtEvidence -- old evidence -> TcPredType -- new predicate -> TcCoercion -- Of type :: new predicate ~ <type of old evidence> -> TcS (StopOrContinue CtEvidence) -- Returns Just new_ev iff either (i) 'co' is reflexivity -- or (ii) 'co' is not reflexivity, and 'new_pred' not cached -- In either case, there is nothing new to do with new_ev {- rewriteEvidence old_ev new_pred co Main purpose: create new evidence for new_pred; unless new_pred is cached already * Returns a new_ev : new_pred, with same wanted/given/derived flag as old_ev * If old_ev was wanted, create a binding for old_ev, in terms of new_ev * If old_ev was given, AND not cached, create a binding for new_ev, in terms of old_ev * Returns Nothing if new_ev is already cached Old evidence New predicate is Return new evidence flavour of same flavor ------------------------------------------------------------------- Wanted Already solved or in inert Nothing or Derived Not Just new_evidence Given Already in inert Nothing Not Just new_evidence Note [Rewriting with Refl] ~~~~~~~~~~~~~~~~~~~~~~~~~~ If the coercion is just reflexivity then you may re-use the same variable. But be careful! Although the coercion is Refl, new_pred may reflect the result of unification alpha := ty, so new_pred might not _look_ the same as old_pred, and it's vital to proceed from now on using new_pred. The flattener preserves type synonyms, so they should appear in new_pred as well as in old_pred; that is important for good error messages. -} rewriteEvidence old_ev@(CtDerived {}) new_pred _co = -- If derived, don't even look at the coercion. -- This is very important, DO NOT re-order the equations for -- rewriteEvidence to put the isTcReflCo test first! -- Why? Because for *Derived* constraints, c, the coercion, which -- was produced by flattening, may contain suspended calls to -- (ctEvTerm c), which fails for Derived constraints. -- (Getting this wrong caused Trac #7384.) continueWith (old_ev { ctev_pred = new_pred }) rewriteEvidence old_ev new_pred co | isTcReflCo co -- See Note [Rewriting with Refl] = continueWith (old_ev { ctev_pred = new_pred }) rewriteEvidence ev@(CtGiven { ctev_evar = old_evar , ctev_loc = loc }) new_pred co = do { new_ev <- newGivenEvVar loc (new_pred, new_tm) ; continueWith new_ev } where -- mkEvCast optimises ReflCo new_tm = mkEvCast (EvId old_evar) (tcDowngradeRole Representational (ctEvRole ev) (mkTcSymCo co)) rewriteEvidence ev@(CtWanted { ctev_dest = dest , ctev_loc = loc }) new_pred co = do { mb_new_ev <- newWanted loc new_pred ; MASSERT( tcCoercionRole co == ctEvRole ev ) ; setWantedEvTerm dest (mkEvCast (getEvTerm mb_new_ev) (tcDowngradeRole Representational (ctEvRole ev) co)) ; case mb_new_ev of Fresh new_ev -> continueWith new_ev Cached _ -> stopWith ev "Cached wanted" } rewriteEqEvidence :: CtEvidence -- Old evidence :: olhs ~ orhs (not swapped) -- or orhs ~ olhs (swapped) -> SwapFlag -> TcType -> TcType -- New predicate nlhs ~ nrhs -- Should be zonked, because we use typeKind on nlhs/nrhs -> TcCoercion -- lhs_co, of type :: nlhs ~ olhs -> TcCoercion -- rhs_co, of type :: nrhs ~ orhs -> TcS (StopOrContinue CtEvidence) -- Of type nlhs ~ nrhs -- For (rewriteEqEvidence (Given g olhs orhs) False nlhs nrhs lhs_co rhs_co) -- we generate -- If not swapped -- g1 : nlhs ~ nrhs = lhs_co ; g ; sym rhs_co -- If 'swapped' -- g1 : nlhs ~ nrhs = lhs_co ; Sym g ; sym rhs_co -- -- For (Wanted w) we do the dual thing. -- New w1 : nlhs ~ nrhs -- If not swapped -- w : olhs ~ orhs = sym lhs_co ; w1 ; rhs_co -- If swapped -- w : orhs ~ olhs = sym rhs_co ; sym w1 ; lhs_co -- -- It's all a form of rewwriteEvidence, specialised for equalities rewriteEqEvidence old_ev swapped nlhs nrhs lhs_co rhs_co | CtDerived {} <- old_ev -- Don't force the evidence for a Derived = continueWith (old_ev { ctev_pred = new_pred }) | NotSwapped <- swapped , isTcReflCo lhs_co -- See Note [Rewriting with Refl] , isTcReflCo rhs_co = continueWith (old_ev { ctev_pred = new_pred }) | CtGiven { ctev_evar = old_evar } <- old_ev = do { let new_tm = EvCoercion (lhs_co `mkTcTransCo` maybeSym swapped (mkTcCoVarCo old_evar) `mkTcTransCo` mkTcSymCo rhs_co) ; new_ev <- newGivenEvVar loc' (new_pred, new_tm) ; continueWith new_ev } | CtWanted { ctev_dest = dest } <- old_ev = do { (new_ev, hole_co) <- newWantedEq loc' (ctEvRole old_ev) nlhs nrhs ; let co = maybeSym swapped $ mkSymCo lhs_co `mkTransCo` hole_co `mkTransCo` rhs_co ; setWantedEq dest co ; traceTcS "rewriteEqEvidence" (vcat [ppr old_ev, ppr nlhs, ppr nrhs, ppr co]) ; continueWith new_ev } | otherwise = panic "rewriteEvidence" where new_pred = mkTcEqPredLikeEv old_ev nlhs nrhs -- equality is like a type class. Bumping the depth is necessary because -- of recursive newtypes, where "reducing" a newtype can actually make -- it bigger. See Note [Newtypes can blow the stack]. loc = ctEvLoc old_ev loc' = bumpCtLocDepth loc {- Note [unifyWanted and unifyDerived] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When decomposing equalities we often create new wanted constraints for (s ~ t). But what if s=t? Then it'd be faster to return Refl right away. Similar remarks apply for Derived. Rather than making an equality test (which traverses the structure of the type, perhaps fruitlessly, unifyWanted traverses the common structure, and bales out when it finds a difference by creating a new Wanted constraint. But where it succeeds in finding common structure, it just builds a coercion to reflect it. -} unifyWanted :: CtLoc -> Role -> TcType -> TcType -> TcS Coercion -- Return coercion witnessing the equality of the two types, -- emitting new work equalities where necessary to achieve that -- Very good short-cut when the two types are equal, or nearly so -- See Note [unifyWanted and unifyDerived] -- The returned coercion's role matches the input parameter unifyWanted loc Phantom ty1 ty2 = do { kind_co <- unifyWanted loc Nominal (typeKind ty1) (typeKind ty2) ; return (mkPhantomCo kind_co ty1 ty2) } unifyWanted loc role orig_ty1 orig_ty2 = go orig_ty1 orig_ty2 where go ty1 ty2 | Just ty1' <- coreView ty1 = go ty1' ty2 go ty1 ty2 | Just ty2' <- coreView ty2 = go ty1 ty2' go (ForAllTy (Anon s1) t1) (ForAllTy (Anon s2) t2) = do { co_s <- unifyWanted loc role s1 s2 ; co_t <- unifyWanted loc role t1 t2 ; return (mkTyConAppCo role funTyCon [co_s,co_t]) } go (TyConApp tc1 tys1) (TyConApp tc2 tys2) | tc1 == tc2, tys1 `equalLength` tys2 , isInjectiveTyCon tc1 role -- don't look under newtypes at Rep equality = do { cos <- zipWith3M (unifyWanted loc) (tyConRolesX role tc1) tys1 tys2 ; return (mkTyConAppCo role tc1 cos) } go (TyVarTy tv) ty2 = do { mb_ty <- isFilledMetaTyVar_maybe tv ; case mb_ty of Just ty1' -> go ty1' ty2 Nothing -> bale_out } go ty1 (TyVarTy tv) = do { mb_ty <- isFilledMetaTyVar_maybe tv ; case mb_ty of Just ty2' -> go ty1 ty2' Nothing -> bale_out } go ty1@(CoercionTy {}) (CoercionTy {}) = return (mkReflCo role ty1) -- we just don't care about coercions! go _ _ = bale_out bale_out = do { (new_ev, co) <- newWantedEq loc role orig_ty1 orig_ty2 ; emitWorkNC [new_ev] ; return co } unifyDeriveds :: CtLoc -> [Role] -> [TcType] -> [TcType] -> TcS () -- See Note [unifyWanted and unifyDerived] unifyDeriveds loc roles tys1 tys2 = zipWith3M_ (unify_derived loc) roles tys1 tys2 unifyDerived :: CtLoc -> Role -> Pair TcType -> TcS () -- See Note [unifyWanted and unifyDerived] unifyDerived loc role (Pair ty1 ty2) = unify_derived loc role ty1 ty2 unify_derived :: CtLoc -> Role -> TcType -> TcType -> TcS () -- Create new Derived and put it in the work list -- Should do nothing if the two types are equal -- See Note [unifyWanted and unifyDerived] unify_derived _ Phantom _ _ = return () unify_derived loc role orig_ty1 orig_ty2 = go orig_ty1 orig_ty2 where go ty1 ty2 | Just ty1' <- coreView ty1 = go ty1' ty2 go ty1 ty2 | Just ty2' <- coreView ty2 = go ty1 ty2' go (ForAllTy (Anon s1) t1) (ForAllTy (Anon s2) t2) = do { unify_derived loc role s1 s2 ; unify_derived loc role t1 t2 } go (TyConApp tc1 tys1) (TyConApp tc2 tys2) | tc1 == tc2, tys1 `equalLength` tys2 , isInjectiveTyCon tc1 role = unifyDeriveds loc (tyConRolesX role tc1) tys1 tys2 go (TyVarTy tv) ty2 = do { mb_ty <- isFilledMetaTyVar_maybe tv ; case mb_ty of Just ty1' -> go ty1' ty2 Nothing -> bale_out } go ty1 (TyVarTy tv) = do { mb_ty <- isFilledMetaTyVar_maybe tv ; case mb_ty of Just ty2' -> go ty1 ty2' Nothing -> bale_out } go _ _ = bale_out bale_out = emitNewDerivedEq loc role orig_ty1 orig_ty2 maybeSym :: SwapFlag -> TcCoercion -> TcCoercion maybeSym IsSwapped co = mkTcSymCo co maybeSym NotSwapped co = co
mcschroeder/ghc
compiler/typecheck/TcCanonical.hs
bsd-3-clause
81,965
191
30
23,117
9,531
5,262
4,269
-1
-1
{-# LANGUAGE QuasiQuotes #-} module Languages.I3 where import DataTypes.Key import DataTypes.Other import Data.List (intercalate) import Control.Monad.Free import Data.String.Interpolate import Data.String.Interpolate.Util data Binding = BindSym [KeyName] ActionsWithCriteria | BindCode ShouldRelease Shortcut ActionsWithCriteria data StatementF next = ExecStatement String next | ExecNoStartupId String next | ExecAlways String next | Font [String] Int next | Bar String next | HideEdgeBorders next | ForWindow ActionsWithCriteria next | ModeDefinition ModeIdentifier (Free BindingF next) next | Raw String next -- TODO: remove. deriving Functor data Action = Exec String | FocusWorkspace WorkspaceNumber | Resize GrowOrShrink WidthOrHeight Int | ResizeTo Int Int | CloseWindow | ReloadWM | RestartWM | ExitWM | MoveToScratchpad | ToggleScratchpad | Nop | SplitVertical | SplitHorizontal | SplitToggle | LayoutDefault | LayoutTabbed | LayoutStacking | LayoutSplitVertically | LayoutSplitHorizontally | LayoutToggleSplit | LayoutToggleAll | FocusLeft | FocusRight | FocusDown | FocusUp | Focus | FocusParent | FocusChild | FocusFloating | FocusTiling | FocusModeToggle | MoveLeft Int | MoveRight Int | MoveUp Int | MoveDown Int | MoveToCenter | MoveToPosition Int Int | MoveToMousePosition | MoveToWorkspace WorkspaceNumber | FloatingEnable | FloatingDisable | FloatingToggle | FullscreenEnable | FullscreenDisable | FullscreenToggle | StickyEnable | StickyDisable | StickyToggle | ActivateMode ModeIdentifier data ActionF next = ActionF Action next deriving Functor data ActionCriteria = Instance String | Class String | Title String | IsFloating | IsCurrent data ActionsWithCriteria = ActionsWithCriteria [ActionCriteria] (Free ActionF ()) data BindingF next = BindingF Binding next deriving (Functor) data TopLevelF next = LL (StatementF next) | RR (BindingF next) deriving Functor instance Show ActionCriteria where show = \case Instance name -> "instance=\"" ++ name ++ "\"" Class name -> "class=\"" ++ name ++ "\"" Title name -> [i|title="#{name}"|] IsFloating -> "floating" IsCurrent -> "con_id=__focused__" escapeForExec = concatMap escape where escape '"' = "\\\\\"" escape chr = [chr] instance Show Action where show = \case Exec x -> [i|exec "#{escapeForExec x}"|] FocusWorkspace workspaceNumber -> [i|workspace #{workspaceNumber}|] ActivateMode modeName -> [i|mode "#{modeName}"|] FloatingEnable -> "floating enable" FloatingDisable -> "floating disable" FloatingToggle -> "floating toggle" StickyEnable -> "sticky enable" StickyDisable -> "sticky disable" StickyToggle -> "sticky toggle" FullscreenEnable -> "fullscreen enable" FullscreenDisable -> "fullscreen disable" FullscreenToggle -> "fullscreen toggle" MoveToScratchpad -> "move scratchpad" ToggleScratchpad -> "scratchpad show" Nop -> "nop" SplitVertical -> "split vertical" SplitHorizontal -> "split horizontal" SplitToggle -> "split toggle" LayoutDefault -> "layout default" LayoutTabbed -> "layout tabbed" LayoutStacking -> "layout stacking" LayoutSplitVertically -> "layout splitv" LayoutSplitHorizontally -> "layout splith" LayoutToggleSplit -> "layout toggle split" LayoutToggleAll -> "layout toggle all" FocusLeft -> "focus left" FocusRight -> "focus right" FocusDown -> "foI3Actioncus down" FocusUp -> "focus up" Focus -> "focus" FocusParent -> "focus parent" FocusChild -> "focus child" FocusFloating -> "focus floating" FocusTiling -> "focus tiling" FocusModeToggle -> "focus mode_toggle" MoveLeft x -> [i|move left #{x}|] MoveRight x -> [i|move right #{x}|] MoveUp x -> [i|move up #{x}|] MoveDown x -> [i|move down #{x}|] MoveToCenter -> "move position center" MoveToPosition x y -> [i|move position #{x} #{y}|] MoveToMousePosition -> "move position mouse" MoveToWorkspace workspaceNumber -> [i|move workspace #{workspaceNumber}|] Resize growOrShrink widthOrHeight amount -> [i|resize #{growOrShrink} #{widthOrHeight} #{amount} px or #{amount} ppt|] ResizeTo w h -> [i|resize set #{w} #{h}|] CloseWindow -> "kill" ReloadWM -> "reload" RestartWM -> "restart" ExitWM -> "exit" interpretStatementF :: StatementF (IO a) -> IO a interpretStatementF = \case ExecStatement exec next -> putStrLn [i|exec #{exec}|] >> next ExecNoStartupId exec next -> putStrLn [i|exec --no-startup-id #{exec}|] >> next ExecAlways x next -> putStrLn [i|exec_always #{x}|] >> next Font names size next -> putStrLn [i|font #{intercalate ":" names} #{size}|] >> next HideEdgeBorders next -> putStrLn "hide_edge_borders both" >> next ForWindow as next -> do putStr "for_window " putActionsWithCriteria as putChar '\n' next Raw string next -> putStrLn string >> next Bar command next -> putStrLn (unindent [i| bar { status_command #{command} position top } |]) >> next ModeDefinition name bindings next -> do putStrLn [i|mode "#{name}" {|] _ <- iterM interpretBindingF bindings putStrLn "}\n" next interpretBindingF :: BindingF (IO a) -> IO a interpretBindingF (BindingF binding next) = printBinding binding >> next where printBinding (BindSym keys as) = do putStr [i|bindsym #{intercalate "+" (map show keys)} |] putActionsWithCriteria as putChar '\n' printBinding (BindCode shouldRelease shortcut as) = do putStr [i|bindcode #{shouldRelease} #{shortcut} |] putActionsWithCriteria as putChar '\n' putActionsWithCriteria (ActionsWithCriteria criteria actionsF) = do putStr $ showCriteria criteria iterM interpretActionF actionsF putStr "nop" where showCriteria = \case [] -> "" criteria -> "[" ++ unwords (map show criteria) ++ "] " interpretTopLevelF :: TopLevelF (IO a) -> IO a interpretTopLevelF (LL x) = interpretStatementF x interpretTopLevelF (RR x) = interpretBindingF x interpretActionF :: ActionF (IO a) -> IO a interpretActionF (ActionF action next) = do putStr (show action) putStr ", " next
vshatskyi/i3wm-config-haskell
app/Languages/I3.hs
bsd-3-clause
6,445
0
14
1,458
1,520
813
707
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TupleSections #-} ------------------------------------------------------------------------------- -- | -- Module : Database.Bloodhound.Client -- Copyright : (C) 2014 Chris Allen -- License : BSD-style (see the file LICENSE) -- Maintainer : Chris Allen <[email protected] -- Stability : provisional -- Portability : OverloadedStrings -- -- Client side functions for talking to Elasticsearch servers. -- ------------------------------------------------------------------------------- module Database.V1.Bloodhound.Client ( -- * Bloodhound client functions -- | The examples in this module assume the following code has been run. -- The :{ and :} will only work in GHCi. You'll only need the data types -- and typeclass instances for the functions that make use of them. -- $setup withBH -- ** Indices , createIndex , deleteIndex , updateIndexSettings , getIndexSettings , optimizeIndex , indexExists , openIndex , closeIndex , listIndices , waitForYellowIndex -- *** Index Aliases , updateIndexAliases , getIndexAliases -- *** Index Templates , putTemplate , templateExists , deleteTemplate -- ** Mapping , putMapping , deleteMapping -- ** Documents , indexDocument , updateDocument , getDocument , documentExists , deleteDocument -- ** Searching , searchAll , searchByIndex , searchByType , scanSearch , getInitialScroll , advanceScroll , refreshIndex , mkSearch , mkAggregateSearch , mkHighlightSearch , bulk , pageSearch , mkShardCount , mkReplicaCount , getStatus -- ** Snapshot/Restore -- *** Snapshot Repos , getSnapshotRepos , updateSnapshotRepo , verifySnapshotRepo , deleteSnapshotRepo -- *** Snapshots , createSnapshot , getSnapshots , deleteSnapshot -- *** Restoring Snapshots , restoreSnapshot -- ** Nodes , getNodesInfo , getNodesStats -- ** Request Utilities , encodeBulkOperations , encodeBulkOperation -- * Authentication , basicAuthHook -- * Reply-handling tools , isVersionConflict , isSuccess , isCreated , parseEsResponse ) where import qualified Blaze.ByteString.Builder as BB import Control.Applicative as A import Control.Monad import Control.Monad.Catch import Control.Monad.IO.Class import Data.Aeson import Data.ByteString.Lazy.Builder import qualified Data.ByteString.Lazy.Char8 as L import Data.Foldable (toList) import qualified Data.HashMap.Strict as HM import Data.Ix import qualified Data.List as LS (filter, foldl') import Data.List.NonEmpty (NonEmpty (..)) import Data.Maybe (catMaybes, fromMaybe, isJust) import Data.Monoid import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.Encoding as T import Data.Time.Clock import qualified Data.Vector as V import Network.HTTP.Client import qualified Network.HTTP.Types.Method as NHTM import qualified Network.HTTP.Types.Status as NHTS import qualified Network.HTTP.Types.URI as NHTU import qualified Network.URI as URI import Prelude hiding (filter, head) import Database.V1.Bloodhound.Types -- | 'mkShardCount' is a straight-forward smart constructor for 'ShardCount' -- which rejects 'Int' values below 1 and above 1000. mkShardCount :: Int -> Maybe ShardCount mkShardCount n | n < 1 = Nothing | n > 1000 = Nothing | otherwise = Just (ShardCount n) -- | 'mkReplicaCount' is a straight-forward smart constructor for 'ReplicaCount' -- which rejects 'Int' values below 0 and above 1000. mkReplicaCount :: Int -> Maybe ReplicaCount mkReplicaCount n | n < 0 = Nothing | n > 1000 = Nothing -- ... | otherwise = Just (ReplicaCount n) emptyBody :: L.ByteString emptyBody = L.pack "" dispatch :: MonadBH m => Method -> Text -> Maybe L.ByteString -> m Reply dispatch dMethod url body = do initReq <- liftIO $ parseUrl' url reqHook <- bhRequestHook A.<$> getBHEnv let reqBody = RequestBodyLBS $ fromMaybe emptyBody body req <- liftIO $ reqHook $ setRequestIgnoreStatus $ initReq { method = dMethod , requestBody = reqBody } mgr <- bhManager <$> getBHEnv liftIO $ httpLbs req mgr joinPath' :: [Text] -> Text joinPath' = T.intercalate "/" joinPath :: MonadBH m => [Text] -> m Text joinPath ps = do Server s <- bhServer <$> getBHEnv return $ joinPath' (s:ps) appendSearchTypeParam :: Text -> SearchType -> Text appendSearchTypeParam originalUrl st = addQuery params originalUrl where stText = "search_type" params | st == SearchTypeDfsQueryThenFetch = [(stText, Just "dfs_query_then_fetch")] | st == SearchTypeCount = [(stText, Just "count")] | st == SearchTypeScan = [(stText, Just "scan"), ("scroll", Just "1m")] | st == SearchTypeQueryAndFetch = [(stText, Just "query_and_fetch")] | st == SearchTypeDfsQueryAndFetch = [(stText, Just "dfs_query_and_fetch")] -- used to catch 'SearchTypeQueryThenFetch', which is also the default | otherwise = [(stText, Just "query_then_fetch")] -- | Severely dumbed down query renderer. Assumes your data doesn't -- need any encoding addQuery :: [(Text, Maybe Text)] -> Text -> Text addQuery q u = u <> rendered where rendered = T.decodeUtf8 $ BB.toByteString $ NHTU.renderQueryText prependQuestionMark q prependQuestionMark = True bindM2 :: (Applicative m, Monad m) => (a -> b -> m c) -> m a -> m b -> m c bindM2 f ma mb = join (f <$> ma <*> mb) -- | Convenience function that sets up a manager and BHEnv and runs -- the given set of bloodhound operations. Connections will be -- pipelined automatically in accordance with the given manager -- settings in IO. If you've got your own monad transformer stack, you -- should use 'runBH' directly. withBH :: ManagerSettings -> Server -> BH IO a -> IO a withBH ms s f = do mgr <- newManager ms let env = mkBHEnv s mgr runBH env f -- Shortcut functions for HTTP methods delete :: MonadBH m => Text -> m Reply delete = flip (dispatch NHTM.methodDelete) Nothing get :: MonadBH m => Text -> m Reply get = flip (dispatch NHTM.methodGet) Nothing head :: MonadBH m => Text -> m Reply head = flip (dispatch NHTM.methodHead) Nothing put :: MonadBH m => Text -> Maybe L.ByteString -> m Reply put = dispatch NHTM.methodPut post :: MonadBH m => Text -> Maybe L.ByteString -> m Reply post = dispatch NHTM.methodPost -- indexDocument s ix name doc = put (root </> s </> ix </> name </> doc) (Just encode doc) -- http://hackage.haskell.org/package/http-client-lens-0.1.0/docs/Network-HTTP-Client-Lens.html -- https://github.com/supki/libjenkins/blob/master/src/Jenkins/Rest/Internal.hs -- | 'getStatus' fetches the 'Status' of a 'Server' getStatus :: MonadBH m => m (Maybe Status) getStatus = do response <- get =<< url return $ decode (responseBody response) where url = joinPath [] -- | 'getSnapshotRepos' gets the definitions of a subset of the -- defined snapshot repos. getSnapshotRepos :: ( MonadBH m , MonadThrow m ) => SnapshotRepoSelection -> m (Either EsError [GenericSnapshotRepo]) getSnapshotRepos sel = fmap (fmap unGSRs) . parseEsResponse =<< get =<< url where url = joinPath ["_snapshot", selectorSeg] selectorSeg = case sel of AllSnapshotRepos -> "_all" SnapshotRepoList (p :| ps) -> T.intercalate "," (renderPat <$> (p:ps)) renderPat (RepoPattern t) = t renderPat (ExactRepo (SnapshotRepoName t)) = t -- | Wrapper to extract the list of 'GenericSnapshotRepo' in the -- format they're returned in newtype GSRs = GSRs { unGSRs :: [GenericSnapshotRepo] } instance FromJSON GSRs where parseJSON = withObject "Collection of GenericSnapshotRepo" parse where parse = fmap GSRs . mapM (uncurry go) . HM.toList go rawName = withObject "GenericSnapshotRepo" $ \o -> do GenericSnapshotRepo (SnapshotRepoName rawName) <$> o .: "type" <*> o .: "settings" -- | Create or update a snapshot repo updateSnapshotRepo :: ( MonadBH m , SnapshotRepo repo ) => SnapshotRepoUpdateSettings -- ^ Use 'defaultSnapshotRepoUpdateSettings' if unsure -> repo -> m Reply updateSnapshotRepo SnapshotRepoUpdateSettings {..} repo = bindM2 put url (return (Just body)) where url = addQuery params <$> joinPath ["_snapshot", snapshotRepoName gSnapshotRepoName] params | repoUpdateVerify = [] | otherwise = [("verify", Just "false")] body = encode $ object [ "type" .= gSnapshotRepoType , "settings" .= gSnapshotRepoSettings ] GenericSnapshotRepo {..} = toGSnapshotRepo repo -- | Verify if a snapshot repo is working. __NOTE:__ this API did not -- make it into ElasticSearch until 1.4. If you use an older version, -- you will get an error here. verifySnapshotRepo :: ( MonadBH m , MonadThrow m ) => SnapshotRepoName -> m (Either EsError SnapshotVerification) verifySnapshotRepo (SnapshotRepoName n) = parseEsResponse =<< bindM2 post url (return Nothing) where url = joinPath ["_snapshot", n, "_verify"] deleteSnapshotRepo :: MonadBH m => SnapshotRepoName -> m Reply deleteSnapshotRepo (SnapshotRepoName n) = delete =<< url where url = joinPath ["_snapshot", n] -- | Create and start a snapshot createSnapshot :: (MonadBH m) => SnapshotRepoName -> SnapshotName -> SnapshotCreateSettings -> m Reply createSnapshot (SnapshotRepoName repoName) (SnapshotName snapName) SnapshotCreateSettings {..} = bindM2 put url (return (Just body)) where url = addQuery params <$> joinPath ["_snapshot", repoName, snapName] params = [("wait_for_completion", Just (boolQP snapWaitForCompletion))] body = encode $ object prs prs = catMaybes [ ("indices" .=) . indexSelectionName <$> snapIndices , Just ("ignore_unavailable" .= snapIgnoreUnavailable) , Just ("ignore_global_state" .= snapIncludeGlobalState) , Just ("partial" .= snapPartial) ] indexSelectionName :: IndexSelection -> Text indexSelectionName AllIndexes = "_all" indexSelectionName (IndexList (i :| is)) = T.intercalate "," (renderIndex <$> (i:is)) where renderIndex (IndexName n) = n -- | Get info about known snapshots given a pattern and repo name. getSnapshots :: ( MonadBH m , MonadThrow m ) => SnapshotRepoName -> SnapshotSelection -> m (Either EsError [SnapshotInfo]) getSnapshots (SnapshotRepoName repoName) sel = fmap (fmap unSIs) . parseEsResponse =<< get =<< url where url = joinPath ["_snapshot", repoName, snapPath] snapPath = case sel of AllSnapshots -> "_all" SnapshotList (s :| ss) -> T.intercalate "," (renderPath <$> (s:ss)) renderPath (SnapPattern t) = t renderPath (ExactSnap (SnapshotName t)) = t newtype SIs = SIs { unSIs :: [SnapshotInfo] } instance FromJSON SIs where parseJSON = withObject "Collection of SnapshotInfo" parse where parse o = SIs <$> o .: "snapshots" -- | Delete a snapshot. Cancels if it is running. deleteSnapshot :: MonadBH m => SnapshotRepoName -> SnapshotName -> m Reply deleteSnapshot (SnapshotRepoName repoName) (SnapshotName snapName) = delete =<< url where url = joinPath ["_snapshot", repoName, snapName] -- | Restore a snapshot to the cluster See -- <https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-snapshots.html#_restore> -- for more details. restoreSnapshot :: MonadBH m => SnapshotRepoName -> SnapshotName -> SnapshotRestoreSettings -- ^ Start with 'defaultSnapshotRestoreSettings' and customize -- from there for reasonable defaults. -> m Reply restoreSnapshot (SnapshotRepoName repoName) (SnapshotName snapName) SnapshotRestoreSettings {..} = bindM2 post url (return (Just body)) where url = addQuery params <$> joinPath ["_snapshot", repoName, snapName, "_restore"] params = [("wait_for_completion", Just (boolQP snapRestoreWaitForCompletion))] body = encode (object prs) prs = catMaybes [ ("indices" .=) . indexSelectionName <$> snapRestoreIndices , Just ("ignore_unavailable" .= snapRestoreIgnoreUnavailable) , Just ("include_global_state" .= snapRestoreIncludeGlobalState) , ("rename_pattern" .=) <$> snapRestoreRenamePattern , ("rename_replacement" .=) . renderTokens <$> snapRestoreRenameReplacement , Just ("include_aliases" .= snapRestoreIncludeAliases) , ("index_settings" .= ) <$> snapRestoreIndexSettingsOverrides , ("ignore_index_settings" .= ) <$> snapRestoreIgnoreIndexSettings ] renderTokens (t :| ts) = mconcat (renderToken <$> (t:ts)) renderToken (RRTLit t) = t renderToken RRSubWholeMatch = "$0" renderToken (RRSubGroup g) = T.pack (show (rrGroupRefNum g)) getNodesInfo :: ( MonadBH m , MonadThrow m ) => NodeSelection -> m (Either EsError NodesInfo) getNodesInfo sel = parseEsResponse =<< get =<< url where url = joinPath ["_nodes", selectionSeg] selectionSeg = case sel of LocalNode -> "_local" NodeList (l :| ls) -> T.intercalate "," (selToSeg <$> (l:ls)) AllNodes -> "_all" selToSeg (NodeByName (NodeName n)) = n selToSeg (NodeByFullNodeId (FullNodeId i)) = i selToSeg (NodeByHost (Server s)) = s selToSeg (NodeByAttribute (NodeAttrName a) v) = a <> ":" <> v getNodesStats :: ( MonadBH m , MonadThrow m ) => NodeSelection -> m (Either EsError NodesStats) getNodesStats sel = parseEsResponse =<< get =<< url where url = joinPath ["_nodes", selectionSeg, "stats"] selectionSeg = case sel of LocalNode -> "_local" NodeList (l :| ls) -> T.intercalate "," (selToSeg <$> (l:ls)) AllNodes -> "_all" selToSeg (NodeByName (NodeName n)) = n selToSeg (NodeByFullNodeId (FullNodeId i)) = i selToSeg (NodeByHost (Server s)) = s selToSeg (NodeByAttribute (NodeAttrName a) v) = a <> ":" <> v -- | 'createIndex' will create an index given a 'Server', 'IndexSettings', and an 'IndexName'. createIndex :: MonadBH m => IndexSettings -> IndexName -> m Reply createIndex indexSettings (IndexName indexName) = bindM2 put url (return body) where url = joinPath [indexName] body = Just $ encode indexSettings -- | 'deleteIndex' will delete an index given a 'Server', and an 'IndexName'. deleteIndex :: MonadBH m => IndexName -> m Reply deleteIndex (IndexName indexName) = delete =<< joinPath [indexName] -- | 'updateIndexSettings' will apply a non-empty list of setting updates to an index updateIndexSettings :: MonadBH m => NonEmpty UpdatableIndexSetting -> IndexName -> m Reply updateIndexSettings updates (IndexName indexName) = bindM2 put url (return body) where url = joinPath [indexName, "_settings"] body = Just (encode jsonBody) jsonBody = Object (deepMerge [u | Object u <- toJSON <$> toList updates]) getIndexSettings :: (MonadBH m, MonadThrow m) => IndexName -> m (Either EsError IndexSettingsSummary) getIndexSettings (IndexName indexName) = do parseEsResponse =<< get =<< url where url = joinPath [indexName, "_settings"] -- | 'optimizeIndex' will optimize a single index, list of indexes or -- all indexes. Note that this call will block until finishing but -- will continue even if the request times out. Concurrent requests to -- optimize an index while another is performing will block until the -- previous one finishes. For more information see -- <https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-optimize.html>. Nothing -- worthwhile comes back in the reply body, so matching on the status -- should suffice. -- -- 'optimizeIndex' with a maxNumSegments of 1 and onlyExpungeDeletes -- to True is the main way to release disk space back to the OS being -- held by deleted documents. -- -- Note that this API was deprecated in ElasticSearch 2.1 for the -- almost completely identical forcemerge API. Adding support to that -- API would be trivial but due to the significant breaking changes, -- this library cannot currently be used with >= 2.0, so that feature was omitted. optimizeIndex :: MonadBH m => IndexSelection -> IndexOptimizationSettings -> m Reply optimizeIndex ixs IndexOptimizationSettings {..} = bindM2 post url (return body) where url = addQuery params <$> joinPath [indexName, "_optimize"] params = catMaybes [ ("max_num_segments",) . Just . showText <$> maxNumSegments , Just ("only_expunge_deletes", Just (boolQP onlyExpungeDeletes)) , Just ("flush", Just (boolQP flushAfterOptimize)) ] indexName = indexSelectionName ixs body = Nothing deepMerge :: [Object] -> Object deepMerge = LS.foldl' go mempty where go acc = LS.foldl' go' acc . HM.toList go' acc (k, v) = HM.insertWith merge k v acc merge (Object a) (Object b) = Object (deepMerge [a, b]) merge _ b = b statusCodeIs :: (Int, Int) -> Reply -> Bool statusCodeIs r resp = inRange r $ NHTS.statusCode (responseStatus resp) respIsTwoHunna :: Reply -> Bool respIsTwoHunna = statusCodeIs (200, 299) existentialQuery :: MonadBH m => Text -> m (Reply, Bool) existentialQuery url = do reply <- head url return (reply, respIsTwoHunna reply) -- | Tries to parse a response body as the expected type @a@ and -- failing that tries to parse it as an EsError. All well-formed, JSON -- responses from elasticsearch should fall into these two -- categories. If they don't, a 'EsProtocolException' will be -- thrown. If you encounter this, please report the full body it -- reports along with your ElasticSearch verison. parseEsResponse :: (MonadThrow m, FromJSON a) => Reply -> m (Either EsError a) parseEsResponse reply | respIsTwoHunna reply = case eitherDecode body of Right a -> return (Right a) Left _ -> tryParseError | otherwise = tryParseError where body = responseBody reply tryParseError = case eitherDecode body of Right e -> return (Left e) -- this case should not be possible Left _ -> explode explode = throwM (EsProtocolException body) -- | 'indexExists' enables you to check if an index exists. Returns 'Bool' -- in IO indexExists :: MonadBH m => IndexName -> m Bool indexExists (IndexName indexName) = do (_, exists) <- existentialQuery =<< joinPath [indexName] return exists -- | 'refreshIndex' will force a refresh on an index. You must -- do this if you want to read what you wrote. refreshIndex :: MonadBH m => IndexName -> m Reply refreshIndex (IndexName indexName) = bindM2 post url (return Nothing) where url = joinPath [indexName, "_refresh"] -- | Block until the index becomes available for indexing -- documents. This is useful for integration tests in which -- indices are rapidly created and deleted. waitForYellowIndex :: MonadBH m => IndexName -> m Reply waitForYellowIndex (IndexName indexName) = get =<< url where url = addQuery q <$> joinPath ["_cluster","health",indexName] q = [("wait_for_status",Just "yellow"),("timeout",Just "10s")] stringifyOCIndex :: OpenCloseIndex -> Text stringifyOCIndex oci = case oci of OpenIndex -> "_open" CloseIndex -> "_close" openOrCloseIndexes :: MonadBH m => OpenCloseIndex -> IndexName -> m Reply openOrCloseIndexes oci (IndexName indexName) = bindM2 post url (return Nothing) where ociString = stringifyOCIndex oci url = joinPath [indexName, ociString] -- | 'openIndex' opens an index given a 'Server' and an 'IndexName'. Explained in further detail at -- <http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html> openIndex :: MonadBH m => IndexName -> m Reply openIndex = openOrCloseIndexes OpenIndex -- | 'closeIndex' closes an index given a 'Server' and an 'IndexName'. Explained in further detail at -- <http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html> closeIndex :: MonadBH m => IndexName -> m Reply closeIndex = openOrCloseIndexes CloseIndex -- | 'listIndices' returns a list of all index names on a given 'Server' listIndices :: (MonadThrow m, MonadBH m) => m [IndexName] listIndices = parse . responseBody =<< get =<< url where url = joinPath ["_cat/indices?v"] -- parses the tabular format the indices api provides parse body = case T.lines (T.decodeUtf8 (L.toStrict body)) of (hdr:rows) -> let ks = T.words hdr keyedRows = [ HM.fromList (zip ks (T.words row)) | row <- rows ] names = catMaybes (HM.lookup "index" <$> keyedRows) in return (IndexName <$> names) [] -> throwM (EsProtocolException body) -- | 'updateIndexAliases' updates the server's index alias -- table. Operations are atomic. Explained in further detail at -- <https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html> updateIndexAliases :: MonadBH m => NonEmpty IndexAliasAction -> m Reply updateIndexAliases actions = bindM2 post url (return body) where url = joinPath ["_aliases"] body = Just (encode bodyJSON) bodyJSON = object [ "actions" .= toList actions] -- | Get all aliases configured on the server. getIndexAliases :: (MonadBH m, MonadThrow m) => m (Either EsError IndexAliasesSummary) getIndexAliases = parseEsResponse =<< get =<< url where url = joinPath ["_aliases"] -- | 'putTemplate' creates a template given an 'IndexTemplate' and a 'TemplateName'. -- Explained in further detail at -- <https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-templates.html> putTemplate :: MonadBH m => IndexTemplate -> TemplateName -> m Reply putTemplate indexTemplate (TemplateName templateName) = bindM2 put url (return body) where url = joinPath ["_template", templateName] body = Just $ encode indexTemplate -- | 'templateExists' checks to see if a template exists. templateExists :: MonadBH m => TemplateName -> m Bool templateExists (TemplateName templateName) = do (_, exists) <- existentialQuery =<< joinPath ["_template", templateName] return exists -- | 'deleteTemplate' is an HTTP DELETE and deletes a template. deleteTemplate :: MonadBH m => TemplateName -> m Reply deleteTemplate (TemplateName templateName) = delete =<< joinPath ["_template", templateName] -- | 'putMapping' is an HTTP PUT and has upsert semantics. Mappings are schemas -- for documents in indexes. putMapping :: (MonadBH m, ToJSON a) => IndexName -> MappingName -> a -> m Reply putMapping (IndexName indexName) (MappingName mappingName) mapping = bindM2 put url (return body) where url = joinPath [indexName, "_mapping", mappingName] -- "_mapping" and mappingName above were originally transposed -- erroneously. The correct API call is: "/INDEX/_mapping/MAPPING_NAME" body = Just $ encode mapping -- | 'deleteMapping' is an HTTP DELETE and deletes a mapping for a given index. -- Mappings are schemas for documents in indexes. deleteMapping :: MonadBH m => IndexName -> MappingName -> m Reply deleteMapping (IndexName indexName) (MappingName mappingName) = -- "_mapping" and mappingName below were originally transposed -- erroneously. The correct API call is: "/INDEX/_mapping/MAPPING_NAME" delete =<< joinPath [indexName, "_mapping", mappingName] versionCtlParams :: IndexDocumentSettings -> [(Text, Maybe Text)] versionCtlParams cfg = case idsVersionControl cfg of NoVersionControl -> [] InternalVersion v -> versionParams v "internal" ExternalGT (ExternalDocVersion v) -> versionParams v "external_gt" ExternalGTE (ExternalDocVersion v) -> versionParams v "external_gte" ForceVersion (ExternalDocVersion v) -> versionParams v "force" where vt = showText . docVersionNumber versionParams v t = [ ("version", Just $ vt v) , ("version_type", Just t) ] -- | 'indexDocument' is the primary way to save a single document in -- Elasticsearch. The document itself is simply something we can -- convert into a JSON 'Value'. The 'DocId' will function as the -- primary key for the document. indexDocument :: (ToJSON doc, MonadBH m) => IndexName -> MappingName -> IndexDocumentSettings -> doc -> DocId -> m Reply indexDocument (IndexName indexName) (MappingName mappingName) cfg document (DocId docId) = bindM2 put url (return body) where url = addQuery params <$> joinPath [indexName, mappingName, docId] parentParams = case idsParent cfg of Nothing -> [] Just (DocumentParent (DocId p)) -> [ ("parent", Just p) ] params = versionCtlParams cfg ++ parentParams body = Just (encode document) -- | 'updateDocument' provides a way to perform an partial update of a -- an already indexed document. updateDocument :: (ToJSON patch, MonadBH m) => IndexName -> MappingName -> IndexDocumentSettings -> patch -> DocId -> m Reply updateDocument (IndexName indexName) (MappingName mappingName) cfg patch (DocId docId) = bindM2 post url (return body) where url = addQuery (versionCtlParams cfg) <$> joinPath [indexName, mappingName, docId, "_update"] body = Just (encode $ object ["doc" .= toJSON patch]) -- | 'deleteDocument' is the primary way to delete a single document. deleteDocument :: MonadBH m => IndexName -> MappingName -> DocId -> m Reply deleteDocument (IndexName indexName) (MappingName mappingName) (DocId docId) = delete =<< joinPath [indexName, mappingName, docId] -- | 'bulk' uses -- <http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-bulk.html Elasticsearch's bulk API> -- to perform bulk operations. The 'BulkOperation' data type encodes the -- index\/update\/delete\/create operations. You pass a 'V.Vector' of 'BulkOperation's -- and a 'Server' to 'bulk' in order to send those operations up to your Elasticsearch -- server to be performed. I changed from [BulkOperation] to a Vector due to memory overhead. bulk :: MonadBH m => V.Vector BulkOperation -> m Reply bulk bulkOps = bindM2 post url (return body) where url = joinPath ["_bulk"] body = Just $ encodeBulkOperations bulkOps -- | 'encodeBulkOperations' is a convenience function for dumping a vector of 'BulkOperation' -- into an 'L.ByteString' encodeBulkOperations :: V.Vector BulkOperation -> L.ByteString encodeBulkOperations stream = collapsed where blobs = fmap encodeBulkOperation stream mashedTaters = mash (mempty :: Builder) blobs collapsed = toLazyByteString $ mappend mashedTaters (byteString "\n") mash :: Builder -> V.Vector L.ByteString -> Builder mash = V.foldl' (\b x -> b `mappend` (byteString "\n") `mappend` (lazyByteString x)) mkBulkStreamValue :: Text -> Text -> Text -> Text -> Value mkBulkStreamValue operation indexName mappingName docId = object [operation .= object [ "_index" .= indexName , "_type" .= mappingName , "_id" .= docId]] -- | 'encodeBulkOperation' is a convenience function for dumping a single 'BulkOperation' -- into an 'L.ByteString' encodeBulkOperation :: BulkOperation -> L.ByteString encodeBulkOperation (BulkIndex (IndexName indexName) (MappingName mappingName) (DocId docId) value) = blob where metadata = mkBulkStreamValue "index" indexName mappingName docId blob = encode metadata `mappend` "\n" `mappend` encode value encodeBulkOperation (BulkCreate (IndexName indexName) (MappingName mappingName) (DocId docId) value) = blob where metadata = mkBulkStreamValue "create" indexName mappingName docId blob = encode metadata `mappend` "\n" `mappend` encode value encodeBulkOperation (BulkDelete (IndexName indexName) (MappingName mappingName) (DocId docId)) = blob where metadata = mkBulkStreamValue "delete" indexName mappingName docId blob = encode metadata encodeBulkOperation (BulkUpdate (IndexName indexName) (MappingName mappingName) (DocId docId) value) = blob where metadata = mkBulkStreamValue "update" indexName mappingName docId doc = object ["doc" .= value] blob = encode metadata `mappend` "\n" `mappend` encode doc -- | 'getDocument' is a straight-forward way to fetch a single document from -- Elasticsearch using a 'Server', 'IndexName', 'MappingName', and a 'DocId'. -- The 'DocId' is the primary key for your Elasticsearch document. getDocument :: MonadBH m => IndexName -> MappingName -> DocId -> m Reply getDocument (IndexName indexName) (MappingName mappingName) (DocId docId) = get =<< joinPath [indexName, mappingName, docId] -- | 'documentExists' enables you to check if a document exists. Returns 'Bool' -- in IO documentExists :: MonadBH m => IndexName -> MappingName -> Maybe DocumentParent -> DocId -> m Bool documentExists (IndexName indexName) (MappingName mappingName) parent (DocId docId) = do (_, exists) <- existentialQuery =<< url return exists where url = addQuery params <$> joinPath [indexName, mappingName, docId] parentParam = fmap (\(DocumentParent (DocId p)) -> p) parent params = LS.filter (\(_, v) -> isJust v) [("parent", parentParam)] dispatchSearch :: MonadBH m => Text -> Search -> m Reply dispatchSearch url search = post url' (Just (encode search)) where url' = appendSearchTypeParam url (searchType search) -- | 'searchAll', given a 'Search', will perform that search against all indexes -- on an Elasticsearch server. Try to avoid doing this if it can be helped. searchAll :: MonadBH m => Search -> m Reply searchAll = bindM2 dispatchSearch url . return where url = joinPath ["_search"] -- | 'searchByIndex', given a 'Search' and an 'IndexName', will perform that search -- against all mappings within an index on an Elasticsearch server. searchByIndex :: MonadBH m => IndexName -> Search -> m Reply searchByIndex (IndexName indexName) = bindM2 dispatchSearch url . return where url = joinPath [indexName, "_search"] -- | 'searchByType', given a 'Search', 'IndexName', and 'MappingName', will perform that -- search against a specific mapping within an index on an Elasticsearch server. searchByType :: MonadBH m => IndexName -> MappingName -> Search -> m Reply searchByType (IndexName indexName) (MappingName mappingName) = bindM2 dispatchSearch url . return where url = joinPath [indexName, mappingName, "_search"] -- | For a given search, request a scroll for efficient streaming of -- search results. Note that the search is put into 'SearchTypeScan' -- mode and thus results will not be sorted. Combine this with -- 'advanceScroll' to efficiently stream through the full result set getInitialScroll :: MonadBH m => IndexName -> MappingName -> Search -> m (Maybe ScrollId) getInitialScroll (IndexName indexName) (MappingName mappingName) search = do let url = joinPath [indexName, mappingName, "_search"] search' = search { searchType = SearchTypeScan } resp' <- bindM2 dispatchSearch url (return search') let msr = decode' $ responseBody resp' :: Maybe (SearchResult ()) msid = maybe Nothing scrollId msr return msid scroll' :: (FromJSON a, MonadBH m, MonadThrow m) => Maybe ScrollId -> m ([Hit a], Maybe ScrollId) scroll' Nothing = return ([], Nothing) scroll' (Just sid) = do res <- advanceScroll sid 60 case res of Right SearchResult {..} -> return (hits searchHits, scrollId) Left _ -> return ([], Nothing) -- | Use the given scroll to fetch the next page of documents. If there are no -- further pages, 'SearchResult.searchHits.hits' will be '[]'. advanceScroll :: ( FromJSON a , MonadBH m , MonadThrow m ) => ScrollId -> NominalDiffTime -- ^ How long should the snapshot of data be kept around? This timeout is updated every time 'advanceScroll' is used, so don't feel the need to set it to the entire duration of your search processing. Note that durations < 1s will be rounded up. Also note that 'NominalDiffTime' is an instance of Num so literals like 60 will be interpreted as seconds. 60s is a reasonable default. -> m (Either EsError (SearchResult a)) advanceScroll (ScrollId sid) scroll = do url <- joinPath ["_search/scroll?scroll=" <> scrollTime] parseEsResponse =<< post url (Just . L.fromStrict $ T.encodeUtf8 sid) where scrollTime = showText secs <> "s" secs :: Integer secs = round scroll simpleAccumulator :: (FromJSON a, MonadBH m, MonadThrow m) => [Hit a] -> ([Hit a], Maybe ScrollId) -> m ([Hit a], Maybe ScrollId) simpleAccumulator oldHits (newHits, Nothing) = return (oldHits ++ newHits, Nothing) simpleAccumulator oldHits ([], _) = return (oldHits, Nothing) simpleAccumulator oldHits (newHits, msid) = do (newHits', msid') <- scroll' msid simpleAccumulator (oldHits ++ newHits) (newHits', msid') -- | 'scanSearch' uses the 'scan&scroll' API of elastic, -- for a given 'IndexName' and 'MappingName'. Note that this will -- consume the entire search result set and will be doing O(n) list -- appends so this may not be suitable for large result sets. In that -- case, 'getInitialScroll' and 'advanceScroll' are good low level -- tools. You should be able to hook them up trivially to conduit, -- pipes, or your favorite streaming IO abstraction of choice. Note -- that ordering on the search would destroy performance and thus is -- ignored. scanSearch :: (FromJSON a, MonadBH m, MonadThrow m) => IndexName -> MappingName -> Search -> m [Hit a] scanSearch indexName mappingName search = do msid <- getInitialScroll indexName mappingName search (hits, msid') <- scroll' msid (totalHits, _) <- simpleAccumulator [] (hits, msid') return totalHits -- | 'mkSearch' is a helper function for defaulting additional fields of a 'Search' -- to Nothing in case you only care about your 'Query' and 'Filter'. Use record update -- syntax if you want to add things like aggregations or highlights while still using -- this helper function. mkSearch :: Maybe Query -> Maybe Filter -> Search mkSearch query filter = Search query filter Nothing Nothing Nothing False (From 0) (Size 10) SearchTypeQueryThenFetch Nothing Nothing Nothing -- | 'mkAggregateSearch' is a helper function that defaults everything in a 'Search' except for -- the 'Query' and the 'Aggregation'. mkAggregateSearch :: Maybe Query -> Aggregations -> Search mkAggregateSearch query mkSearchAggs = Search query Nothing Nothing (Just mkSearchAggs) Nothing False (From 0) (Size 0) SearchTypeQueryThenFetch Nothing Nothing Nothing -- | 'mkHighlightSearch' is a helper function that defaults everything in a 'Search' except for -- the 'Query' and the 'Aggregation'. mkHighlightSearch :: Maybe Query -> Highlights -> Search mkHighlightSearch query searchHighlights = Search query Nothing Nothing Nothing (Just searchHighlights) False (From 0) (Size 10) SearchTypeQueryThenFetch Nothing Nothing Nothing -- | 'pageSearch' is a helper function that takes a search and assigns the from -- and size fields for the search. The from parameter defines the offset -- from the first result you want to fetch. The size parameter allows you to -- configure the maximum amount of hits to be returned. pageSearch :: From -- ^ The result offset -> Size -- ^ The number of results to return -> Search -- ^ The current seach -> Search -- ^ The paged search pageSearch resultOffset pageSize search = search { from = resultOffset, size = pageSize } parseUrl' :: MonadThrow m => Text -> m Request parseUrl' t = parseRequest (URI.escapeURIString URI.isAllowedInURI (T.unpack t)) -- | Was there an optimistic concurrency control conflict when -- indexing a document? isVersionConflict :: Reply -> Bool isVersionConflict = statusCheck (== 409) isSuccess :: Reply -> Bool isSuccess = statusCheck (inRange (200, 299)) isCreated :: Reply -> Bool isCreated = statusCheck (== 201) statusCheck :: (Int -> Bool) -> Reply -> Bool statusCheck prd = prd . NHTS.statusCode . responseStatus -- | This is a hook that can be set via the 'bhRequestHook' function -- that will authenticate all requests using an HTTP Basic -- Authentication header. Note that it is *strongly* recommended that -- this option only be used over an SSL connection. -- -- >> (mkBHEnv myServer myManager) { bhRequestHook = basicAuthHook (EsUsername "myuser") (EsPassword "mypass") } basicAuthHook :: Monad m => EsUsername -> EsPassword -> Request -> m Request basicAuthHook (EsUsername u) (EsPassword p) = return . applyBasicAuth u' p' where u' = T.encodeUtf8 u p' = T.encodeUtf8 p boolQP :: Bool -> Text boolQP True = "true" boolQP False = "false"
bermanjosh/bloodhound
src/Database/V1/Bloodhound/Client.hs
bsd-3-clause
38,317
0
20
8,811
8,488
4,472
4,016
590
6
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeOperators #-} -- | -- Module : Crypto.Classical.Vigenere -- Copyright : (c) Colin Woodbury, 2015 - 2020 -- License : BSD3 -- Maintainer: Colin Woodbury <[email protected]> module Crypto.Classical.Cipher.Vigenere where import Crypto.Classical.Cipher.Stream import Crypto.Classical.Types import qualified Data.ByteString.Lazy.Char8 as B import Data.Modular --- -- | A Vigenère Cipher is just a Stream Cipher with a finite key, -- shorter than the length of the plaintext. The key is repeated for -- the entire length of the plaintext. newtype Vigenère a = Vigenère { _vigenère :: a } deriving (Eq,Show,Functor) instance Applicative Vigenère where pure = Vigenère Vigenère f <*> Vigenère a = Vigenère $ f a instance Monad Vigenère where return = pure Vigenère a >>= f = f a instance Cipher [ℤ/26] Vigenère where encrypt k m = pure . _stream . encrypt (vigKey m k) $ m decrypt k m = pure . _stream . decrypt (vigKey m k) $ m -- | Determine a Vigenère key from a Stream key. -- Weakness here: key length is a factor of the plaintext length. vigKey :: B.ByteString -> [ℤ/26] -> [ℤ/26] vigKey m = concat . repeat . take (n+1) where n = floor @Double . logBase 2 . fromIntegral . B.length $ m
fosskers/crypto-classical
lib/Crypto/Classical/Cipher/Vigenere.hs
bsd-3-clause
1,482
17
8
320
151
123
28
24
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DuplicateRecordFields #-} module Language.LSP.Types.WorkspaceSymbol where import Data.Aeson.TH import Data.Default import Language.LSP.Types.Common import Language.LSP.Types.DocumentSymbol import Language.LSP.Types.Progress import Language.LSP.Types.Utils import Data.Text (Text) data WorkspaceSymbolKindClientCapabilities = WorkspaceSymbolKindClientCapabilities { -- | The symbol kind values the client supports. When this -- property exists the client also guarantees that it will -- handle values outside its set gracefully and falls back -- to a default value when unknown. -- -- If this property is not present the client only supports -- the symbol kinds from `File` to `Array` as defined in -- the initial version of the protocol. _valueSet :: Maybe (List SymbolKind) } deriving (Show, Read, Eq) deriveJSON lspOptions ''WorkspaceSymbolKindClientCapabilities data WorkspaceSymbolTagClientCapabilities = WorkspaceSymbolTagClientCapabilities { -- | The tags supported by the client. _valueSet :: Maybe (List SymbolTag) } deriving (Show, Read, Eq) deriveJSON lspOptions ''WorkspaceSymbolTagClientCapabilities instance Default WorkspaceSymbolKindClientCapabilities where def = WorkspaceSymbolKindClientCapabilities (Just $ List allKinds) where allKinds = [ SkFile , SkModule , SkNamespace , SkPackage , SkClass , SkMethod , SkProperty , SkField , SkConstructor , SkEnum , SkInterface , SkFunction , SkVariable , SkConstant , SkString , SkNumber , SkBoolean , SkArray ] data WorkspaceSymbolClientCapabilities = WorkspaceSymbolClientCapabilities { _dynamicRegistration :: Maybe Bool -- ^Symbol request supports dynamic -- registration. , _symbolKind :: Maybe WorkspaceSymbolKindClientCapabilities -- ^ Specific capabilities for the `SymbolKind`. -- | The client supports tags on `SymbolInformation`. -- Clients supporting tags have to handle unknown tags gracefully. -- -- @since 3.16.0 , _tagSupport :: Maybe WorkspaceSymbolTagClientCapabilities } deriving (Show, Read, Eq) deriveJSON lspOptions ''WorkspaceSymbolClientCapabilities -- ------------------------------------- makeExtendingDatatype "WorkspaceSymbolOptions" [''WorkDoneProgressOptions] [] deriveJSON lspOptions ''WorkspaceSymbolOptions makeExtendingDatatype "WorkspaceSymbolRegistrationOptions" [''WorkspaceSymbolOptions] [] deriveJSON lspOptions ''WorkspaceSymbolRegistrationOptions -- ------------------------------------- makeExtendingDatatype "WorkspaceSymbolParams" [ ''WorkDoneProgressParams , ''PartialResultParams ] [("_query", [t| Text |])] deriveJSON lspOptions ''WorkspaceSymbolParams
alanz/haskell-lsp
lsp-types/src/Language/LSP/Types/WorkspaceSymbol.hs
mit
3,170
0
11
849
420
242
178
57
0
module Util.Formatting ( formatZonedTimeVerbose ) where import qualified Data.Time.Format as DTF import qualified Data.Time.LocalTime as LT import Prelude formatZonedTimeVerbose :: LT.ZonedTime -> String formatZonedTimeVerbose = DTF.formatTime DTF.defaultTimeLocale "at %H:%M UTC%z on %A %-d %B %Y"
rcook/seattlehaskell-org
Util/Formatting.hs
mit
323
0
6
59
57
36
21
8
1
module Handler.Who where import Import import Data.List (sortBy) import Model.Markdown userShortName :: User -> Text userShortName user = fromMaybe (userIdent user) $ userName user getWhoR :: Text -> Handler Html getWhoR project_handle = do Entity project_id project <- runYDB $ getBy404 $ UniqueProjectHandle project_handle team_members <- runDB $ select $ from $ \(user `InnerJoin` project_user_role) -> do on_ $ user ^. UserId ==. project_user_role ^. ProjectUserRoleUser where_ $ (project_user_role ^. ProjectUserRoleProject ==. val project_id) &&. (project_user_role ^. ProjectUserRoleRole ==. val TeamMember) return user let members = sortBy (compare `on` (userCreatedTs . entityVal)) team_members discussion = DiscussionOnProject $ Entity project_id project defaultLayout $ do snowdriftDashTitle (projectName project) "Team" $(widgetFile "who")
chreekat/snowdrift
Handler/Who.hs
agpl-3.0
953
0
16
210
272
135
137
21
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} -- | Nix types. module Stack.Types.Nix where import Control.Applicative import Data.Aeson.Extended import Data.Monoid import Data.Text (Text) import GHC.Generics (Generic) import Generics.Deriving.Monoid (mappenddefault, memptydefault) import Prelude -- | Nix configuration. Parameterize by resolver type to avoid cyclic -- dependency. data NixOpts = NixOpts {nixEnable :: !Bool ,nixPureShell :: !Bool ,nixPackages :: ![Text] -- ^ The system packages to be installed in the environment before it runs ,nixInitFile :: !(Maybe FilePath) -- ^ The path of a file containing preconfiguration of the environment (e.g shell.nix) ,nixShellOptions :: ![Text] -- ^ Options to be given to the nix-shell command line } deriving (Show) -- | An uninterpreted representation of nix options. -- Configurations may be "cascaded" using mappend (left-biased). data NixOptsMonoid = NixOptsMonoid {nixMonoidDefaultEnable :: !Any -- ^ Should nix-shell be defaulted to enabled (does @nix:@ section exist in the config)? ,nixMonoidEnable :: !(First Bool) -- ^ Is using nix-shell enabled? ,nixMonoidPureShell :: !(First Bool) -- ^ Should the nix-shell be pure ,nixMonoidPackages :: !(First [Text]) -- ^ System packages to use (given to nix-shell) ,nixMonoidInitFile :: !(First FilePath) -- ^ The path of a file containing preconfiguration of the environment (e.g shell.nix) ,nixMonoidShellOptions :: !(First [Text]) -- ^ Options to be given to the nix-shell command line ,nixMonoidPath :: !(First [Text]) -- ^ Override parts of NIX_PATH (notably 'nixpkgs') } deriving (Eq, Show, Generic) -- | Decode uninterpreted nix options from JSON/YAML. instance FromJSON (WithJSONWarnings NixOptsMonoid) where parseJSON = withObjectWarnings "NixOptsMonoid" (\o -> do nixMonoidDefaultEnable <- pure (Any False) nixMonoidEnable <- First <$> o ..:? nixEnableArgName nixMonoidPureShell <- First <$> o ..:? nixPureShellArgName nixMonoidPackages <- First <$> o ..:? nixPackagesArgName nixMonoidInitFile <- First <$> o ..:? nixInitFileArgName nixMonoidShellOptions <- First <$> o ..:? nixShellOptsArgName nixMonoidPath <- First <$> o ..:? nixPathArgName return NixOptsMonoid{..}) -- | Left-biased combine Nix options instance Monoid NixOptsMonoid where mempty = memptydefault mappend = mappenddefault -- | Nix enable argument name. nixEnableArgName :: Text nixEnableArgName = "enable" -- | Nix run in pure shell argument name. nixPureShellArgName :: Text nixPureShellArgName = "pure" -- | Nix packages (build inputs) argument name. nixPackagesArgName :: Text nixPackagesArgName = "packages" -- | shell.nix file path argument name. nixInitFileArgName :: Text nixInitFileArgName = "shell-file" -- | Extra options for the nix-shell command argument name. nixShellOptsArgName :: Text nixShellOptsArgName = "nix-shell-options" -- | NIX_PATH override argument name nixPathArgName :: Text nixPathArgName = "path"
sjakobi/stack
src/Stack/Types/Nix.hs
bsd-3-clause
3,223
0
14
631
495
283
212
77
1
{-# LANGUAGE OverloadedStrings #-} module Tests.Readers.HTML (tests) where import Text.Pandoc.Definition import Test.Framework import Tests.Helpers import Tests.Arbitrary() import Text.Pandoc.Builder import Text.Pandoc import Text.Pandoc.Error html :: String -> Pandoc html = handleError . readHtml def tests :: [Test] tests = [ testGroup "base tag" [ test html "simple" $ "<head><base href=\"http://www.w3schools.com/images/foo\" ></head><body><img src=\"stickman.gif\" alt=\"Stickman\"></head>" =?> plain (image "http://www.w3schools.com/images/stickman.gif" "" (text "Stickman")) , test html "slash at end of base" $ "<head><base href=\"http://www.w3schools.com/images/\" ></head><body><img src=\"stickman.gif\" alt=\"Stickman\"></head>" =?> plain (image "http://www.w3schools.com/images/stickman.gif" "" (text "Stickman")) , test html "slash at beginning of href" $ "<head><base href=\"http://www.w3schools.com/images/\" ></head><body><img src=\"/stickman.gif\" alt=\"Stickman\"></head>" =?> plain (image "http://www.w3schools.com/stickman.gif" "" (text "Stickman")) , test html "absolute URL" $ "<head><base href=\"http://www.w3schools.com/images/\" ></head><body><img src=\"http://example.com/stickman.gif\" alt=\"Stickman\"></head>" =?> plain (image "http://example.com/stickman.gif" "" (text "Stickman")) ] ]
janschulz/pandoc
tests/Tests/Readers/HTML.hs
gpl-2.0
1,474
0
13
278
236
126
110
25
1
module WhereIn1 where f = (case (x, z) of (1, 2) -> "First Branch" _ -> "Second Branch") where (x, z) = (1, 2) f_1 = (case (x, z) of (1, 2) -> return 0 _ -> return 1) where (x, z) = (1, 2)
kmate/HaRe
old/testing/simplifyExpr/WhereIn1AST.hs
bsd-3-clause
254
0
9
110
122
71
51
9
2
{-# LANGUAGE CPP #-} module Map ( Map, member, lookup, findWithDefault, empty, insert, insertWith, delete, union, unionWith, unions, mapWithKey, elems, fromList, fromListWith, toAscList ) where #if __GLASGOW_HASKELL__ >= 603 import Data.Map import Prelude () #else import Data.FiniteMap import Prelude hiding ( lookup ) type Map k a = FiniteMap k a member :: Ord k => k -> Map k a -> Bool member = elemFM lookup :: Ord k => k -> Map k a -> Maybe a lookup = flip lookupFM findWithDefault :: Ord k => a -> k -> Map k a -> a findWithDefault a k m = lookupWithDefaultFM m a k empty :: Map k a empty = emptyFM insert :: Ord k => k -> a -> Map k a -> Map k a insert k a m = addToFM m k a insertWith :: Ord k => (a -> a -> a) -> k -> a -> Map k a -> Map k a insertWith c k a m = addToFM_C c m k a delete :: Ord k => k -> Map k a -> Map k a delete = flip delFromFM union :: Ord k => Map k a -> Map k a -> Map k a union = flip plusFM unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a unionWith c l r = plusFM_C c r l unions :: Ord k => [Map k a] -> Map k a unions = foldl (flip plusFM) emptyFM mapWithKey :: (k -> a -> b) -> Map k a -> Map k b mapWithKey = mapFM elems :: Map k a -> [a] elems = eltsFM fromList :: Ord k => [(k,a)] -> Map k a fromList = listToFM fromListWith :: Ord k => (a -> a -> a) -> [(k,a)] -> Map k a fromListWith c = addListToFM_C (flip c) emptyFM toAscList :: Map k a -> [(k,a)] toAscList = fmToList #endif
beni55/alex
src/Map.hs
bsd-3-clause
1,489
0
4
382
69
47
22
45
1
module T9204 where import {-# SOURCE #-} T9204 data D a
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/roles/should_fail/T9204.hs
bsd-3-clause
59
0
3
14
12
9
3
-1
-1
{-# LANGUAGE TypeOperators, GADTs, KindSignatures #-} -- Tests infix type constructors in GADT declarations module ShouldCompile where import Data.Kind infix 1 `DArrowX` -- (->) has precedence 0 data DArrowX :: Type -> Type -> Type where First :: a `DArrowX` a' -> (a,b) `DArrowX` (a',b)
sdiehl/ghc
testsuite/tests/typecheck/should_compile/tc205.hs
bsd-3-clause
304
0
8
61
68
44
24
-1
-1
{-# LANGUAGE KindSignatures, RankNTypes, PolyKinds, GADTs, FlexibleContexts, DataKinds, TypeFamilies #-} module T7020 where import GHC.Exts data family Sing (a :: k) class SingKind (Any :: k) => SingI (s :: k) where sing :: Sing s data SingInstance (a :: k) where SingInstance :: SingI a => SingInstance a class (b ~ Any) => SingKind (b :: k) where singInstance :: forall (a :: k). Sing a -> SingInstance a
urbanslug/ghc
testsuite/tests/polykinds/T7020.hs
bsd-3-clause
436
1
9
99
137
77
60
11
0
-- !!! Importing Tycon with duplicate constructor module M where import Prelude(Either(Left,Right,Right))
ghc-android/ghc
testsuite/tests/module/mod83.hs
bsd-3-clause
107
0
6
13
21
16
5
2
0
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} -- | Lish internal commands module Lish.InternalCommands ( lookup , toArg ) where import Data.Fix import qualified Data.Map.Strict as Map import qualified Data.Text as Text import GHC.IO.Handle (hGetContents) import Protolude hiding (show) import System.Environment (setEnv) import Lish.Parser (parseCmd) import Lish.Types toArg :: SExp -> StateT Env IO (Maybe Text) toArg (Atom x) = do env <- get return $ Just $ case Map.lookup x env of Just (Str s) -> s _ -> toS x toArg (Str s) = return $ Just $ toS s toArg (Num i) = return . Just . toS . show $ i toArg (Stream (Just h)) = lift $ fmap (Just . Text.strip .toS) (hGetContents h) toArg (List xs) = do strs <- traverse toArg (map unFix xs) return (Just ("["<> Text.intercalate " " (catMaybes strs) <> "]")) toArg _ = return Nothing -- | Print with return line prn :: ReduceUnawareCommand prn args = do strs <- catMaybes <$> mapM toArg args putStrLn (Text.intercalate " " strs) return Void -- | Print pr :: ReduceUnawareCommand pr args = do strs <- catMaybes <$> mapM toArg args putStr (Text.intercalate " " strs) return Void evalErr :: Text -> StateT Env IO SExp evalErr errmsg = do putText $ "EvalError: " <> errmsg return Void -- | Undefine a var undef :: ReduceUnawareCommand undef [Atom name] = do modify (Map.delete name) return Void undef x = evalErr $ "undef wait an atom got" <> toS (show x) -- | replace à la `sed s/old/new/g text` replace :: ReduceUnawareCommand replace [Str old,Str new,Str text] = return $ Str $ Text.replace old new text replace _ = evalErr "replace should take 3 String arguments" -- | create a string and concat multiple elements str :: ReduceUnawareCommand str exprs = do args <- catMaybes <$> mapM toArg exprs return $ Str $ Text.concat args -- | create an atom from a string (do nothing to atoms) atom :: ReduceUnawareCommand atom [Atom a] = return $ Atom a atom [Str s] = return $ Atom s atom _ = evalErr "atom need an atom or a string" -- | Numbers Ops binop :: (Integer -> Integer -> Integer) -> ReduceUnawareCommand binop f [Num x,Num y] = return $ Num (f x y) binop _ exprs = evalErr ("binary operator needs two numbers. Got: " <> toS (show exprs)) bbinop :: (Bool -> Bool -> Bool) -> ReduceUnawareCommand bbinop f [Bool x,Bool y] = return $ Bool (f x y) bbinop _ _ = evalErr "boolean binary operator need two booleans arguments" lnot :: ReduceUnawareCommand lnot [Bool x] = return (Bool (not x)) lnot _ = evalErr "not need a boolean" toWaitingStream :: ReduceUnawareCommand toWaitingStream [Stream (Just h) ] = return (WaitingStream (Just h)) toWaitingStream _ = return Void bintest :: (Integer -> Integer -> Bool) -> ReduceUnawareCommand bintest f [Num x,Num y] = return $ Bool (f x y) bintest _ args = evalErr $ "bin test need two numbers got " <> toS (show args) isReduced :: SExp -> Bool isReduced (Atom _) = False isReduced (Lambda _) = False isReduced _ = True deepReduce :: (Monad m) => (SExp -> m SExp) -> SExp -> m SExp deepReduce f x = if isReduced x then pure x else do reducedOnce <- f x deepReduce f reducedOnce toStrictCmd :: ReduceUnawareCommand -> Command toStrictCmd f reducer sexps = f =<< mapM (deepReduce reducer) sexps -- | fn to declare a lish function -- (fn [arg1 arg2] body1 body2) -- (fn [x y] (if (> x 3) (* 2 x) (* y y))) fn :: Command fn reducer (p:bodies) = do reducedParams <- reducer p case reducedParams of List args -> do let parameters = map fromAtom args if all isJust parameters then return Fn { params = catMaybes parameters , body = Fix . Lambda . map Fix $ Atom "do":bodies , closure = mempty , types = ([],LCommand) } else return Void _ -> return Void where fromAtom (Fix (Atom a)) = Just a fromAtom _ = Nothing fn _ _ = return Void strictCommands :: [(Text,ReduceUnawareCommand)] strictCommands = [ ("prn", prn) , ("pr", pr) , ("<-", toWaitingStream) , ("replace", replace) , ("undef",undef) , ("str",str) , ("atom",atom) -- binary operators , ("+",binop (+)) , ("-",binop (-)) , ("*",binop (*)) , ("/",binop div) , ("^",binop (^)) -- bin numeric test , ("<",bintest (<)) , ("<=",bintest (<=)) , (">",bintest (>)) , (">=",bintest (>=)) -- boolean bin ops , ("and", bbinop (&&)) , ("or", bbinop (||)) , ("not", lnot) ] -- | Define a var def :: Command def _ [Atom name,v] = do modify (Map.insert name v) return v def _ exprs = evalErr $ "def need 2 args, an atom and an S-Expr. Ex: (def foo \"foo\")" <> "instead got: " <> toS (show exprs) doCommand :: Command doCommand reduceLambda (expr:nexpr:exprs) = do _ <- reduceLambda expr doCommand reduceLambda (nexpr:exprs) doCommand reduceLambda [expr] = reduceLambda expr doCommand _ _ = return Void lishIf :: Command lishIf reduceLambda [sexp,sexp1,sexp2] = do reducedSexp <- reduceLambda sexp case reducedSexp of Bool True -> reduceLambda sexp1 Bool False -> reduceLambda sexp2 _ -> evalErr "first argument to if must be a Bool" lishIf _ _ = evalErr "if need a bool, a then body and an else one" emptyCmd :: Command emptyCmd _ [List []] = return (Bool True) emptyCmd _ [List _] = return (Bool False) emptyCmd r [x@(Atom _)] = do val <- r x emptyCmd r [val] emptyCmd r [x@(Lambda _)] = do val <- r x emptyCmd r [val] emptyCmd _ _ = return Void firstCmd :: Command firstCmd reducer [List (x:_)] = reducer (unFix x) firstCmd _ [List _] = return Void firstCmd r [x@(Atom _)] = do val <- r x firstCmd r [val] firstCmd r [x@(Lambda _)] = do val <- r x firstCmd r [val] firstCmd _ _ = return Void restCmd :: Command restCmd _ [List (_:xs)] = return (List xs) restCmd _ [List _] = return Void restCmd r [x@(Atom _)] = do val <- r x restCmd r [val] restCmd r [x@(Lambda _)] = do val <- r x restCmd r [val] restCmd _ _ = return Void consCmd :: Command consCmd r [x,List ls] = do xreduced <- r x return (List (Fix xreduced:ls)) consCmd r [x,y@(Atom _)] = do val <- r y consCmd r [x,val] consCmd r [x,y@(Lambda _)] = do val <- r y consCmd r [x,val] consCmd _ _ = return Void equal :: Command equal r [List xs,List ys] = do reducedListX <- traverse r (map unFix xs) reducedListY <- traverse r (map unFix ys) return (Bool (reducedListX == reducedListY)) equal r [x,y] = do reducedX <- r x reducedY <- r y return (Bool (reducedX == reducedY)) equal _ args = evalErr $ "= need two args, got " <> toS (show args) -- | Export a var as Environment variable export :: Command export _ [Atom name,v@(Str s)] = do liftIO $ setEnv (toS name) (toS s) modify (Map.insert name v) return v export r [n,value] = do reducedVal <- r value export r [n,reducedVal] export _ _ = evalErr "eval need an atom and a string (eval foo \"foo\")" evalStr :: Command evalStr r [Str program] = do let parsed = parseCmd program case parsed of Right expr -> r (unFix expr) _ -> evalErr "evalStr error" evalStr r [x@(Atom _)] = do reduced <- r x evalStr r [reduced] evalStr r [x@(Lambda _)] = do reduced <- r x evalStr r [reduced] evalStr _ _ = evalErr "evalStr error" -- | retrieve the value of a var getenv :: Command getenv _ [Atom varname] = do hm <- get return $ fromMaybe Void (Map.lookup varname hm) getenv _ [Str varname] = do hm <- get return $ fromMaybe Void (Map.lookup varname hm) getenv r (expr:_) = do reduced <- r expr hm <- get case reduced of (Str varname) -> return $ fromMaybe Void (Map.lookup varname hm) _ -> evalErr "getenv need on atom or a string as argument" getenv _ _ = evalErr "getenv need on atom or a string as argument" comment :: Command comment _ _ = return Void quote :: Command quote _ exprs = return (List (map Fix exprs)) evalList :: Command evalList r [List exprs] = r (Lambda exprs) evalList r [x@(Atom _)] = do evaluated <- r x evalList r [evaluated] evalList r [x@(Lambda _)] = do evaluated <- r x evalList r [evaluated] evalList _ x = evalErr ("Waiting for a list of exprs got: " <> toS (show x)) unstrictCommands :: [(Text,InternalCommand)] unstrictCommands = [ ("if", InternalCommand "if" lishIf) , ("def", InternalCommand "def" def) , ("fn", InternalCommand "fn" fn) , ("do", InternalCommand "do" doCommand) , ("=", InternalCommand "=" equal) , ("export", InternalCommand "export" export) , ("quote", InternalCommand "quote" quote) , ("eval-str", InternalCommand "eval-str" evalStr) , ("eval", InternalCommand "eval" evalList) , ("getenv", InternalCommand "getenv" getenv) , ("$", InternalCommand "$" getenv) , ("comment", InternalCommand "comment" comment) -- list ops , ("empty?",InternalCommand "empty?" emptyCmd) , ("first",InternalCommand "first" firstCmd) , ("rest",InternalCommand "rest" restCmd) , ("cons",InternalCommand "cons" consCmd) ] internalCommands :: Map.Map Text InternalCommand internalCommands = (strictCommands & map (\(x,y) -> (x,InternalCommand x (toStrictCmd y)))) <> unstrictCommands & Map.fromList lookup :: Text -> Maybe InternalCommand lookup = flip Map.lookup internalCommands
yogsototh/lish
src/Lish/InternalCommands.hs
isc
10,099
1
19
2,883
3,741
1,902
1,839
267
4
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} module Turnip.Eval.Lib (loadBaseLibrary) where import Turnip.Eval.Types import Turnip.Eval.Util import Turnip.Eval.UtilNumbers import Turnip.Eval.Eval (callRef, callFunction, call) import Turnip.Eval.Metatables import qualified Turnip.Parser as Parser import qualified Turnip.Eval.Lib.Math as Math (loadBaseLibraryGen) import Control.Monad.Except import Control.Applicative ((<|>)) import Data.Maybe (fromMaybe) import Numeric (showGFloat) luaerror :: NativeFunction luaerror (a:_) = throwError a luaerror _ = throwError Nil luaassert :: NativeFunction luaassert (a : msg : _) = if not $ coerceToBool [a] then luaerror [msg] else return [Nil] luaassert (a : []) = if not $ coerceToBool [a] then luaerror [Str "assertion failed!"] else return [Nil] luaassert _ = throwErrorStr "Bad argument to 'assert': value expected" luapcall :: NativeFunction luapcall (Function fref : args) = ((callRef fref args) >>= prependTrue) `catchError` pcallHandler where prependTrue result = return $ Boolean True : result pcallHandler e = return [Boolean False, e] luapcall (_a : _) = return [Boolean False, Str "Attempt to call something that isn't a function"] luapcall _ = throwErrorStr "Bad argument to 'pcall': value expected" -- from https://www.lua.org/manual/5.4/manual.html#pdf-setmetatables -- "If metatable is nil, removes the metatable of the given table. -- If the original metatable has a __metatable field, raises an error." luasetmetatable :: NativeFunction luasetmetatable (Table tr : mtv : _) = do mth <- getMetatableHider (Table tr) case mth of Just _ -> throwErrorStr "Cannot change a protected metatable" Nothing -> case mtv of Nil -> setMetatable tr Nothing >> return [Table tr] Table mtr -> setMetatable tr (Just mtr) >> return [Table tr] _ -> throwErrorStr "Wrong 2nd parameter to setmetatable, table or nil expected" luasetmetatable _ = throwErrorStr "Wrong parameter to setmetatable, table expected" luagetmetatable :: NativeFunction luagetmetatable (v : _) = do mth <- getMetatableHider v mt <- getMetatable v return $ maybe [Nil] (:[]) (mth <|> (Table <$> mt)) luagetmetatable _ = throwErrorStr "Wrong argument to luagetmetatable, table expected" luarawset :: NativeFunction luarawset (Table tr : k : v : _) = setTableField tr (k,v) >> return [Table tr] luarawset _ = throwErrorStr "Invalid rawset parameters" luarawget :: NativeFunction luarawget (Table tr : k : _) = (:[]) . fromMaybe Nil <$> rawGetTableField tr k luarawget _ = throwErrorStr "Invalid rawget parameters" luarawlen :: NativeFunction luarawlen (Str s : _) = return [Number . fromIntegral . length $ s] luarawlen (Table tr : _) = (:[]) <$> getTableLength tr luarawlen _ = throwErrorStr "Invalid rawget parameters" luarawequal :: NativeFunction luarawequal (Nil : Nil : _) = return [Boolean False] luarawequal (a : b : _) = return [Boolean $ a == b] luarawequal _ = throwErrorStr "rawequal needs at least two parameters" luatostring :: NativeFunction luatostring (Nil : _) = return [Str "nil"] luatostring (Table tr : _) = do mt <- getMetatable (Table tr) case mt of Just mtr -> do toString <- getTableField mtr (Str "__tostring") call toString [(Table tr)] Nothing -> return [Str $ "table: " ++ show tr] luatostring (Function fr : _) = return [Str $ "function: " ++ show fr] luatostring (Str s : _) = return [Str s] luatostring (Boolean True : _) = return [Str "true"] luatostring (Boolean False : _) = return [Str "false"] luatostring (Number n : _) = return [Str $ showGFloat (decimalDigits n) n ""] luatostring _ = throwErrorStr "Wrong argument to 'tostring', value expected" readNumberBase' :: Double -> String -> LuaM [Value] readNumberBase' base s = case toInt base of Just basei -> return $ [readNumberBase basei s] Nothing -> throwErrorStr "Wrong argument #2 to 'tonumber' (base must be an integer)" luatonumber :: NativeFunction luatonumber (Number n : []) = return [Number n] luatonumber (Str s : []) = return $ [readNumberBase 10 s] luatonumber (Str s : Number base : _) = readNumberBase' base s luatonumber (_ : _) = return [Nil] luatonumber _ = throwErrorStr "Wrong argument to 'tonumber'" luatype :: NativeFunction luatype (Nil : _) = return [Str "nil"] luatype (Table _ : _) = return [Str "table"] luatype (Function _ : _) = return [Str "function"] luatype (Str _ : _) = return [Str "string"] luatype (Boolean _ : _) = return [Str "boolean"] luatype (Number _ : _) = return [Str "number"] luatype _ = throwErrorStr "Wrong argument to 'type', value expected" luaselect :: NativeFunction luaselect (Str "#" : args) = return [Number . fromIntegral . length $ args] -- luaselect (Str n : args) = return [args !! luatonuber n] -- cursed implicit coercion version -- it works in the original Lua but I'm not implementing this. luaselect (Number n : args) = case toInt n of Just i -> return $ drop (i-1) args Nothing -> throwErrorStr "Wrong argument to select (number has no integer representation)" luaselect _ = throwErrorStr "Wrong argument to select, either number or string '#' required." luaload :: NativeFunction -- ld, source, mode, env luaload (Str src : _) = loadstring src luaload (Function f : _) = do fd <- getFunctionData f src <- getChunkSource fd "" loadstring src where getChunkSource fd src = do chunkPiece <- callFunction fd [] case chunkPiece of -- https://www.lua.org/manual/5.4/manual.html#pdf-load -- "Each call to ld must return a string that concatenates with previous results. -- A return of an empty string, nil, or no value signals the end of the chunk." [] -> return src [Str ""] -> return src [Nil] -> return src [Str s] -> getChunkSource fd (src ++ s) _ -> throwErrorStr "Function passed to 'load' didn't return a string." luaload _ = throwErrorStr "Wrong argument to loadstring, string required." loadstring :: String -> LuaM [Value] loadstring src = do b <- case Parser.parseLua src of Right block -> return block Left err -> throwErrorStr $ "Parse error: " ++ show err f <- makeNewLambda (FunctionData [] b [] False) return [Function f] -- TODO: duplication luanext :: NativeFunction luanext (Table tr : Nil : _) = do f <- getFirstTableField tr case f of (Nil, Nil) -> return [Nil] (k,v) -> return [k, v] luanext (Table tr : k : _) = do f <- getNextTableField tr k case f of Just (Nil, Nil) -> return [Nil] Just (k',v) -> return [k', v] Nothing -> throwErrorStr "Wrong argument no 'next', invalid key" luanext (Table tr : _) = do f <- getFirstTableField tr case f of (Nil, Nil) -> return [Nil] (k,v) -> return [k, v] luanext _ = throwErrorStr "Wrong argument to 'next', table [and key] required." -- directly from https://www.lua.org/pil/7.3.html -- it takes a reference to `next` which it depends on -- Lua allows the C API to push C functions to the stack directly; -- maybe I could change the types to allow that somehow? genluapairs :: FunctionRef -> NativeFunction genluapairs nextRef (x : _) = do mpairs <- getMetaFunction "__pairs" x case mpairs of Just pairs -> callRef pairs [x] Nothing -> return [Function nextRef, x, Nil] genluapairs _ _ = throwErrorStr "Wrong argument to 'pairs' (value expected)" {- This is directly based on 7.3 as well: function iter (a, i) i = i + 1 local v = a[i] if v then return i, v end end function ipairs (a) return iter, a, 0 end -} luaiter :: NativeFunction luaiter (Table tr : Number i : _) = do v <- getTableField tr (Number $ i+1) if coerceToBool [v] then return [Number $ i+1, v] else return [] luaiter _ = throwErrorStr "Wrong argument to 'iter', table and index required." genluaipairs :: FunctionRef -> NativeFunction genluaipairs iterRef (x : _) = do mipairs <- getMetaFunction "__ipairs" x case mipairs of Just ipairs -> callRef ipairs [x] Nothing -> return [Function iterRef, x, Number 0] genluaipairs _ _ = throwErrorStr "Wrong argument to 'ipairs' (value expected)" loadBaseLibrary :: LuaM () loadBaseLibrary = do Math.loadBaseLibraryGen "math" _ <- addNativeFunction "error" (BuiltinFunction luaerror) _ <- addNativeFunction "assert" (BuiltinFunction luaassert) _ <- addNativeFunction "pcall" (BuiltinFunction luapcall) _ <- addNativeFunction "getmetatable" (BuiltinFunction luagetmetatable) _ <- addNativeFunction "setmetatable" (BuiltinFunction luasetmetatable) _ <- addNativeFunction "rawset" (BuiltinFunction luarawset) _ <- addNativeFunction "rawget" (BuiltinFunction luarawget) _ <- addNativeFunction "rawlen" (BuiltinFunction luarawlen) _ <- addNativeFunction "rawequal" (BuiltinFunction luarawequal) _ <- addNativeFunction "tostring" (BuiltinFunction luatostring) _ <- addNativeFunction "tonumber" (BuiltinFunction luatonumber) _ <- addNativeFunction "type" (BuiltinFunction luatype) _ <- addNativeFunction "select" (BuiltinFunction luaselect) -- loadstring has been removed in 5.2 _ <- addNativeFunction "load" (BuiltinFunction luaload) nextRef <- addNativeFunction "next" (BuiltinFunction luanext) _ <- addNativeFunction "pairs" (BuiltinFunction (genluapairs nextRef)) iterRef <- createNativeFunction (BuiltinFunction luaiter) _ <- addNativeFunction "ipairs" (BuiltinFunction (genluaipairs iterRef)) return ()
bananu7/Turnip
src/Turnip/Eval/Lib.hs
mit
9,832
0
16
2,181
2,935
1,450
1,485
182
5
import Text.ParserCombinators.Parsec hiding (spaces) import System.Environment import Control.Monad instance Show LispVal where show = showVal data LispVal = Atom String | List [LispVal] | DottedList [LispVal] LispVal | Number Integer | String String | Bool Bool unwordsList :: [LispVal] -> String unwordsList = unwords . map showVal showVal :: LispVal -> String showVal (String contents) = "\"" ++ contents ++ "\"" showVal (Atom name) = name showVal (Number contents) = show contents showVal (Bool True) = "#t" showVal (Bool False) = "#f" showVal (List contents) = "(" ++ unwordsList contents ++ ")" showVal (DottedList head tail) = "(" ++ unwordsList head ++ " . " ++ showVal tail ++ ")" parseString :: Parser LispVal parseString = do char '"' x <- many (noneOf "\"") char '"' return $ String x parseList :: Parser LispVal parseList = liftM List $ sepBy parseExpr spaces parseDottedList :: Parser LispVal parseDottedList = do head <- endBy parseExpr spaces tail <- char '.' >> spaces >> parseExpr return $ DottedList head tail parseQuoted :: Parser LispVal parseQuoted = do char '\'' x <- parseExpr return $ List [Atom "quote", x] parseAtom :: Parser LispVal parseAtom = do first <- letter <|> symbol rest <- many (letter <|> digit <|> symbol) let atom = first:rest return $ case atom of "#t" -> Bool True "#f" -> Bool False _ -> Atom atom parseNumber :: Parser LispVal parseNumber = liftM (Number . read) $ many1 digit parseExpr :: Parser LispVal parseExpr = parseAtom <|> parseString <|> parseNumber <|> parseQuoted <|> do char '(' x <- try parseList <|> parseDottedList char ')' return x symbol :: Parser Char symbol = oneOf "!#$%&|*+-/:<=>?@^_~" spaces :: Parser () spaces = skipMany1 space readExpr :: String -> String readExpr input = case parse parseExpr "lisp" input of Left err -> "No match: " ++ show err Right val -> "Found: " ++ show val main :: IO () main = do (expr:_) <- getArgs putStrLn $ readExpr expr
mmwtsn/write-yourself-a-scheme
03-evaluation/01-beginning-the-evaluator.hs
mit
2,104
0
11
510
751
365
386
70
3
{-# LANGUAGE OverloadedStrings #-} import Data.Bits import qualified Data.ByteString as B import qualified Data.ByteString.Char8 as B8 import System.Environment import System.Exit import System.IO -- | Hamming distance between bytestrings. -- -- Returns Nothing if bytestrings are of unequal length. distance :: B.ByteString -> B.ByteString -> Maybe Int distance s0 s1 | B.length s0 /= B.length s1 = Nothing | otherwise = Just (foldr alg 0 (B.zip s0 s1)) where hamming (a, b) = popCount (xor a b) alg = (+) . hamming main :: IO () main = do args <- getArgs case args of (s0:s1:_) -> do let b0 = B8.pack s0 b1 = B8.pack s1 mhamming = distance b0 b1 case mhamming of Nothing -> do hPutStrLn stderr "hamming: string lengths unequal" exitFailure Just hamming -> print hamming _ -> hPutStrLn stderr "USAGE: ./hamming STRING STRING"
jtobin/cryptopals
lib/hamming/Hamming.hs
mit
944
1
17
254
290
147
143
27
3
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE MultiParamTypeClasses #-} module Data.ByteString.Base64.URL.Extended ( Base64 , encode , unBase64 , fromByteString , fromByteStringUnsafe , decode , fromTextUnsafe , toByteString )where import Data.Aeson (FromJSON (..), ToJSON (..)) import Data.ByteString (ByteString) import qualified Data.ByteString.Base64.URL as Base64 import Data.Proxy (Proxy (..)) import Data.Text (Text) import qualified Data.Text as Text import qualified Data.Text.Encoding as Text import qualified TextShow as Text import Database.Persist.Sql (PersistField (..), PersistFieldSql (..)) newtype Base64 = Base64 { unBase64 :: ByteString } deriving(Eq, Ord, Read, Show) instance ToJSON Base64 where toJSON = toJSON . Text.decodeUtf8 . unBase64 instance FromJSON Base64 where parseJSON = fmap (Base64 . Text.encodeUtf8) . parseJSON instance PersistField Base64 where toPersistValue = toPersistValue . unBase64 fromPersistValue = fmap Base64 . fromPersistValue instance PersistFieldSql Base64 where sqlType _ = sqlType (Proxy :: Proxy ByteString) encode :: ByteString -> Base64 encode = Base64 . Base64.encode fromByteStringUnsafe :: ByteString -> Base64 fromByteStringUnsafe = Base64 fromByteString :: ByteString -> Either Text Base64 fromByteString bs = case Base64.decode bs of Left err -> Left $ Text.pack err Right _ -> Right $ Base64 bs toByteString :: Base64 -> ByteString toByteString = unBase64 decode :: Base64 -> ByteString decode = Base64.decodeLenient . unBase64 instance Text.TextShow Base64 where showb = Text.fromText . Text.decodeUtf8 . unBase64 fromTextUnsafe :: Text -> Base64 fromTextUnsafe = Base64 . Text.encodeUtf8
rubenmoor/skull
skull-server/src/Data/ByteString/Base64/URL/Extended.hs
mit
1,918
0
10
482
468
270
198
48
2
-- | Describes the types of objects that can be encountered at runtime. module Nix.Evaluator.RuntimeTypes where import Nix.Common import Nix.Atoms import qualified Data.Text as T -- | Runtime types of values. data RuntimeType = RT_Null | RT_Bool | RT_Int | RT_String | RT_Lambda | RT_List | RT_Set | RT_Path deriving (Show, Eq, Ord, Enum, Generic) instance NFData RuntimeType -- | String representation of runtime types. typeToString :: RuntimeType -> Text typeToString = T.toLower . T.replace "RT_" "" . tshow -- | Atoms have a runtime type which can be determined in O(1). typeOfAtom :: NAtom -> RuntimeType typeOfAtom (NUri _) = RT_String typeOfAtom (NInt _) = RT_Int typeOfAtom (NBool _) = RT_Bool typeOfAtom NNull = RT_Null
adnelson/nix-eval
src/Nix/Evaluator/RuntimeTypes.hs
mit
752
0
8
139
177
100
77
22
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE TemplateHaskell #-} module PrinterParser where import qualified Control.Applicative as Applicative ((<$>)) import Control.Category (id, (.)) import Control.Isomorphism.Partial import Control.Isomorphism.Partial.TH import Control.Isomorphism.Partial.Unsafe (Iso (Iso)) import Data.Char (isDigit, isLetter) import qualified Data.Graph.Inductive as Graph import Data.Maybe import qualified Data.Text.Lazy as L import OperatorGraph import Prelude hiding (id, print, (*>), (.), (<$>), (<*), (<*>)) import Text.Syntax import qualified Text.Syntax.Parser.Naive as Parser import qualified Text.Syntax.Printer.Naive as Printer -- for debug purposes: import qualified Prelude as P (print) import System.IO.Unsafe (unsafePerformIO) -- for unknown reason there is no `chainr1`, so here is a straighforward implementation chainr1 :: Syntax delta => delta alpha -> delta beta -> Iso (alpha, (beta, alpha)) alpha -> delta alpha chainr1 p op x = (x <$> p <*> op <*> chainr1 p op x) <|> p -- class ExpressionList a -- instance ExpressionList Expression -- instance ExpressionList b => ExpressionList (a, b) data Expression = Variable String | Literal Integer | ExplicitParens Expression | BinOp Expression Operator Expression | PrefOp Operator Expression deriving (Show, Eq) $(defineIsomorphisms ''Expression) keywords :: [String] keywords = [] letter, digit :: Syntax delta => delta Char letter = subset isLetter <$> token digit = subset isDigit <$> token identifier :: Syntax delta => delta String identifier = subset (`notElem` keywords) . cons <$> letter <*> many (letter <|> digit) keyword :: Syntax delta => String -> delta () keyword s = inverse right <$> (identifier <+> text s) integer :: Syntax delta => delta Integer integer = Iso read' show' <$> many digit where read' s = case [ x | (x, "") <- reads s ] of [] -> Nothing (x : _) -> Just x show' = Just . show parens :: Syntax delta => delta alpha -> delta alpha parens = between (text "(") (text ")") spaced :: Syntax delta => delta alpha -> delta alpha spaced = between optSpace optSpace operator :: Syntax delta => Operator -> delta Operator operator op@(Operator _ _ symbols nID) = Iso read' show' <$> bb where read' () = Just op show' (Operator _ _ symbols' nID') = if symbols == symbols' then Just () else Nothing aa = unsafePerformIO $ P.print op >> return (map text symbols) bb = foldl1 (*>) aa -- My hacks on invertibles: getOperator :: Expression -> Maybe Operator getOperator (BinOp _ op _) = Just op getOperator (PrefOp op _) = Just op getOperator _ = Nothing areExplicitParensNeeded :: OperatorGraph -> Operator -> Expression -> Bool areExplicitParensNeeded graph op expr = case getOperator expr of Just op' -> let fromNode = opNodeID op toNode = opNodeID op' sp = Graph.sp fromNode toNode graph notConnected = null sp in notConnected Nothing -> False addExplicitParens :: OperatorGraph -> Operator -> Expression -> Expression addExplicitParens graph op expr = if areExplicitParensNeeded graph op expr then ExplicitParens expr else expr removeExplicitParens :: OperatorGraph -> Operator -> Expression -> Expression removeExplicitParens graph op expr@(ExplicitParens innerExpr) = if areExplicitParensNeeded graph op innerExpr then innerExpr else expr removeExplicitParens _ _ expr = expr binOp' :: OperatorGraph -> Iso (Expression, (Operator, Expression)) Expression binOp' graph = Iso read' show' where read' (x, (op, y)) = let x' = removeExplicitParens graph op x y' = removeExplicitParens graph op y in Just $ BinOp x' op y' show' (BinOp x op y) = let x' = addExplicitParens graph op x y' = addExplicitParens graph op y in Just (x', (op, y')) show' _ = Nothing prefOp' :: OperatorGraph -> Iso (Operator, Expression) Expression prefOp' graph = Iso read' show' where read' (op, x) = let x' = removeExplicitParens graph op x in unsafePerformIO $ P.print "AAAAAA" >> P.print op >> return ( Just $ PrefOp op x' ) show' (PrefOp op x) = let x' = addExplicitParens graph op x in Just (op, x) show' _ = Nothing -- TODO: Rewrite tho following code via fgl's dfs data DeltaGraph delta = DeltaGraph Operator (delta Expression) [DeltaGraph delta] extractRule :: Syntax delta => DeltaGraph delta -> delta Expression extractRule (DeltaGraph _ rule _) = rule addRules :: Syntax delta => delta Expression -> OperatorGraph -> [DeltaGraph delta] addRules expression graph = map f leaves where leafAccumulator (_, node, _, _) acc = if null (Graph.pre graph node) then node : acc else acc leaves = Graph.ufold leafAccumulator [] graph operatorsList = Graph.ufold (\(_, _, op, _) acc -> op : acc) [] graph operators = foldl1 (<|>) $ map operator operatorsList isLast = null . Graph.suc graph endRules = literal <$> integer <|> variable <$> identifier <|> explicitParens <$> parens (skipSpace *> expression <* skipSpace) getOp node = fromMaybe (error "Wrong node") $ Graph.lab graph node f node = let sucRules = map f $ Graph.suc graph node op = getOp node in if null sucRules then DeltaGraph op endRules sucRules else DeltaGraph op (handleOp (foldl1 (<|>) $ map extractRule sucRules) op) sucRules handleOp next (Operator Infix LeftAssoc symbols _) = chainl1 next (spaced operators) (binOpWrap symbols) handleOp next (Operator Infix RightAssoc symbols _) = chainr1 next (spaced operators) (binOpWrap symbols) handleOp next (Operator Infix NoneAssoc symbols _) = binOpWrap symbols <$> next <*> spaced operators <*> next handleOp next op@(Operator Prefix RightAssoc symbols _) = (prefOpWrap symbols <$> spaced operators <*> handleOp next op) <|> next handleOp next (Operator Closed NoneAssoc symbols _) = undefined -- TODO handleOp _ op = error $ "Wrong op: " ++ show op binOpWrap symbols' = binOp' graph . subset (\ (_, (op, _)) -> symbols op == symbols') prefOpWrap symbols' = prefOp' graph . subset (\ (op, _) -> symbols op == symbols') -- expressionFactory :: Syntax delta => OperatorGraph -> delta Expression expressionFactory graph = foldl1 (<|>) $ map extractRule $ addRules (expressionFactory graph) graph processGraph :: OperatorGraph -> (Expression -> Maybe L.Text, L.Text -> Maybe Expression) processGraph graph = (printer, parser) where printer expr = L.pack Applicative.<$> Printer.print expressionObject expr parser str = case Parser.parse expressionObject . L.unpack $ str of (x:_) -> Just x [] -> Nothing expressionObject = expressionFactory graph
nightuser/parensprinter
src/PrinterParser.hs
mit
7,196
0
15
1,778
2,305
1,204
1,101
147
8
module Sudoku.Strategy.NakedSingle where import Data.Char import Data.List import Prelude import Sudoku import Sudoku.Strategy resolveAllCandidates :: Sudoku -> [[(Char, String)]] resolveAllCandidates su = mapWithIndeces su (\i j -> (su !! i !! j, findCandidates su i j))
thomasbrus/sudoku-solver
src/Sudoku/Strategy/NakedSingle.hs
mit
275
0
10
39
93
54
39
8
1
module Language.Binal.Util.LitKind where import Language.Binal.Types extractSym :: LitKind -> Maybe String extractSym (SymLit s) = Just s extractSym _ = Nothing extractStr :: LitKind -> Maybe String extractStr (StrLit s) = Just s extractStr _ = Nothing extractNum :: LitKind -> Maybe Double extractNum (NumLit n) = Just n extractNum _ = Nothing
pasberth/binal1
Language/Binal/Util/LitKind.hs
mit
359
0
7
67
125
64
61
11
1
{-# OPTIONS_GHC -w #-} {-# LANGUAGE BangPatterns #-} -- required for versions of Happy before 1.18.6 {-# LANGUAGE ImplicitPrelude #-} {-# OPTIONS -Wwarn -w #-} -- The above warning supression flag is a temporary kludge. -- While working on this module you are encouraged to remove it and fix -- any warnings in the module. See -- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings -- for details {- Careful optimisation of the parser: we don't want to throw everything at it, because that takes too long and doesn't buy much, but we do want to inline certain key external functions, so we instruct GHC not to throw away inlinings as it would normally do in -O0 mode. -} module Language.Haskell.GHC.HappyParser ( fullModule, fullTypeSignature, fullStatement, fullExpression, fullImport, fullDeclaration, partialModule, partialTypeSignature, partialStatement, partialExpression, partialImport, partialDeclaration ) where import HsSyn import RdrHsSyn import HscTypes ( IsBootInterface, WarningTxt(..) ) import Lexer import RdrName import TcEvidence ( emptyTcEvBinds ) import TysPrim ( liftedTypeKindTyConName, eqPrimTyCon ) import TysWiredIn ( unitTyCon, unitDataCon, tupleTyCon, tupleCon, nilDataCon, unboxedUnitTyCon, unboxedUnitDataCon, listTyCon_RDR, parrTyCon_RDR, consDataCon_RDR, eqTyCon_RDR ) import Type ( funTyCon ) import ForeignCall import OccName ( varName, dataName, tcClsName, tvName ) import DataCon ( DataCon, dataConName ) import SrcLoc import Module import StaticFlags ( opt_SccProfilingOn, opt_Hpc ) import Kind ( Kind, liftedTypeKind, unliftedTypeKind, mkArrowKind ) import Class ( FunDep ) import BasicTypes import DynFlags import OrdList import HaddockUtils import FastString import Maybes ( orElse ) import Outputable import Control.Monad ( unless, liftM ) import GHC.Exts import Data.Char import Control.Monad ( mplus ) import Control.Applicative(Applicative(..)) import Control.Monad (ap) -- parser produced by Happy Version 1.19.5 data HappyAbsSyn = HappyTerminal ((Located Token)) | HappyErrorToken Int | HappyAbsSyn15 (LHsDecl RdrName) | HappyAbsSyn16 (Located (HsModule RdrName)) | HappyAbsSyn17 (Located RdrName) | HappyAbsSyn19 (Maybe LHsDocString) | HappyAbsSyn20 (()) | HappyAbsSyn21 (Maybe WarningTxt) | HappyAbsSyn22 (([LImportDecl RdrName], [LHsDecl RdrName])) | HappyAbsSyn25 ([LHsDecl RdrName]) | HappyAbsSyn27 ([LImportDecl RdrName]) | HappyAbsSyn29 (Maybe [LIE RdrName]) | HappyAbsSyn30 ([LIE RdrName]) | HappyAbsSyn33 (LIE RdrName) | HappyAbsSyn35 (Located ImpExpSubSpec) | HappyAbsSyn36 ([RdrName]) | HappyAbsSyn40 (LImportDecl RdrName) | HappyAbsSyn41 (IsBootInterface) | HappyAbsSyn42 (Bool) | HappyAbsSyn43 (Maybe FastString) | HappyAbsSyn45 (Located (Maybe ModuleName)) | HappyAbsSyn46 (Located (Maybe (Bool, [LIE RdrName]))) | HappyAbsSyn47 (Located (Bool, [LIE RdrName])) | HappyAbsSyn48 (Int) | HappyAbsSyn49 (Located FixityDirection) | HappyAbsSyn50 (Located [Located RdrName]) | HappyAbsSyn51 (OrdList (LHsDecl RdrName)) | HappyAbsSyn53 (LTyClDecl RdrName) | HappyAbsSyn55 (LInstDecl RdrName) | HappyAbsSyn57 (LFamInstDecl RdrName) | HappyAbsSyn58 (Located NewOrData) | HappyAbsSyn59 (Located (Maybe (LHsKind RdrName))) | HappyAbsSyn60 (Located (Maybe (LHsContext RdrName), LHsType RdrName)) | HappyAbsSyn61 (Maybe CType) | HappyAbsSyn62 (LDerivDecl RdrName) | HappyAbsSyn63 (Located (OrdList (LHsDecl RdrName))) | HappyAbsSyn73 (Located (HsLocalBinds RdrName)) | HappyAbsSyn77 (Maybe Activation) | HappyAbsSyn78 (Activation) | HappyAbsSyn79 ([RuleBndr RdrName]) | HappyAbsSyn81 (RuleBndr RdrName) | HappyAbsSyn86 (Located [FastString]) | HappyAbsSyn87 (Located (OrdList FastString)) | HappyAbsSyn90 (CCallConv) | HappyAbsSyn91 (Safety) | HappyAbsSyn92 (Located (Located FastString, Located RdrName, LHsType RdrName)) | HappyAbsSyn93 (Maybe (LHsType RdrName)) | HappyAbsSyn95 (LHsType RdrName) | HappyAbsSyn98 ([LHsType RdrName]) | HappyAbsSyn100 (Located HsBang) | HappyAbsSyn103 (LHsContext RdrName) | HappyAbsSyn112 ([LHsTyVarBndr RdrName]) | HappyAbsSyn113 (LHsTyVarBndr RdrName) | HappyAbsSyn114 (Located [Located (FunDep RdrName)]) | HappyAbsSyn116 (Located (FunDep RdrName)) | HappyAbsSyn117 (Located [RdrName]) | HappyAbsSyn118 (LHsKind RdrName) | HappyAbsSyn122 ([LHsKind RdrName]) | HappyAbsSyn123 (Located [LConDecl RdrName]) | HappyAbsSyn125 ([LConDecl RdrName]) | HappyAbsSyn128 (LConDecl RdrName) | HappyAbsSyn129 (Located [LHsTyVarBndr RdrName]) | HappyAbsSyn130 (Located (Located RdrName, HsConDeclDetails RdrName)) | HappyAbsSyn131 ([ConDeclField RdrName]) | HappyAbsSyn134 (Located (Maybe [LHsType RdrName])) | HappyAbsSyn136 (LDocDecl) | HappyAbsSyn138 (Located (GRHSs RdrName)) | HappyAbsSyn139 (Located [LGRHS RdrName]) | HappyAbsSyn140 (LGRHS RdrName) | HappyAbsSyn142 (Located (HsQuasiQuote RdrName)) | HappyAbsSyn143 (LHsExpr RdrName) | HappyAbsSyn147 (Located FastString) | HappyAbsSyn148 (Located (FastString,(Int,Int),(Int,Int))) | HappyAbsSyn153 ([LHsCmdTop RdrName]) | HappyAbsSyn154 (LHsCmdTop RdrName) | HappyAbsSyn158 ([HsTupArg RdrName]) | HappyAbsSyn162 (Located [LHsExpr RdrName]) | HappyAbsSyn163 (Located [LStmt RdrName]) | HappyAbsSyn164 (Located [[LStmt RdrName]]) | HappyAbsSyn166 (Located ([LStmt RdrName] -> Stmt RdrName)) | HappyAbsSyn170 (Located [LMatch RdrName]) | HappyAbsSyn173 (LMatch RdrName) | HappyAbsSyn178 (LPat RdrName) | HappyAbsSyn180 ([LPat RdrName]) | HappyAbsSyn184 (Maybe (LStmt RdrName)) | HappyAbsSyn185 (LStmt RdrName) | HappyAbsSyn187 (([HsRecField RdrName (LHsExpr RdrName)], Bool)) | HappyAbsSyn189 (HsRecField RdrName (LHsExpr RdrName)) | HappyAbsSyn190 (Located [LIPBind RdrName]) | HappyAbsSyn191 (LIPBind RdrName) | HappyAbsSyn192 (Located HsIPName) | HappyAbsSyn198 (Located DataCon) | HappyAbsSyn233 (Located HsLit) | HappyAbsSyn235 (Located ModuleName) | HappyAbsSyn237 (LHsDocString) | HappyAbsSyn239 (Located (String, HsDocString)) | HappyAbsSyn240 (Located (Int, HsDocString)) {- to allow type-synonyms as our monads (likely - with explicitly-specified bind and return) - in Haskell98, it seems that with - /type M a = .../, then /(HappyReduction M)/ - is not allowed. But Happy is a - code-generator that can just substitute it. type HappyReduction m = Int -> ((Located Token)) -> HappyState ((Located Token)) (HappyStk HappyAbsSyn -> m HappyAbsSyn) -> [HappyState ((Located Token)) (HappyStk HappyAbsSyn -> m HappyAbsSyn)] -> HappyStk HappyAbsSyn -> m HappyAbsSyn -} action_0, action_1, action_2, action_3, action_4, action_5, action_6, action_7, action_8, action_9, action_10, action_11, action_12, action_13, action_14, action_15, action_16, action_17, action_18, action_19, action_20, action_21, action_22, action_23, action_24, action_25, action_26, action_27, action_28, action_29, action_30, action_31, action_32, action_33, action_34, action_35, action_36, action_37, action_38, action_39, action_40, action_41, action_42, action_43, action_44, action_45, action_46, action_47, action_48, action_49, action_50, action_51, action_52, action_53, action_54, action_55, action_56, action_57, action_58, action_59, action_60, action_61, action_62, action_63, action_64, action_65, action_66, action_67, action_68, action_69, action_70, action_71, action_72, action_73, action_74, action_75, action_76, action_77, action_78, action_79, action_80, action_81, action_82, action_83, action_84, action_85, action_86, action_87, action_88, action_89, action_90, action_91, action_92, action_93, action_94, action_95, action_96, action_97, action_98, action_99, action_100, action_101, action_102, action_103, action_104, action_105, action_106, action_107, action_108, action_109, action_110, action_111, action_112, action_113, action_114, action_115, action_116, action_117, action_118, action_119, action_120, action_121, action_122, action_123, action_124, action_125, action_126, action_127, action_128, action_129, action_130, action_131, action_132, action_133, action_134, action_135, action_136, action_137, action_138, action_139, action_140, action_141, action_142, action_143, action_144, action_145, action_146, action_147, action_148, action_149, action_150, action_151, action_152, action_153, action_154, action_155, action_156, action_157, action_158, action_159, action_160, action_161, action_162, action_163, action_164, action_165, action_166, action_167, action_168, action_169, action_170, action_171, action_172, action_173, action_174, action_175, action_176, action_177, action_178, action_179, action_180, action_181, action_182, action_183, action_184, action_185, action_186, action_187, action_188, action_189, action_190, action_191, action_192, action_193, action_194, action_195, action_196, action_197, action_198, action_199, action_200, action_201, action_202, action_203, action_204, action_205, action_206, action_207, action_208, action_209, action_210, action_211, action_212, action_213, action_214, action_215, action_216, action_217, action_218, action_219, action_220, action_221, action_222, action_223, action_224, action_225, action_226, action_227, action_228, action_229, action_230, action_231, action_232, action_233, action_234, action_235, action_236, action_237, action_238, action_239, action_240, action_241, action_242, action_243, action_244, action_245, action_246, action_247, action_248, action_249, action_250, action_251, action_252, action_253, action_254, action_255, action_256, action_257, action_258, action_259, action_260, action_261, action_262, action_263, action_264, action_265, action_266, action_267, action_268, action_269, action_270, action_271, action_272, action_273, action_274, action_275, action_276, action_277, action_278, action_279, action_280, action_281, action_282, action_283, action_284, action_285, action_286, action_287, action_288, action_289, action_290, action_291, action_292, action_293, action_294, action_295, action_296, action_297, action_298, action_299, action_300, action_301, action_302, action_303, action_304, action_305, action_306, action_307, action_308, action_309, action_310, action_311, action_312, action_313, action_314, action_315, action_316, action_317, action_318, action_319, action_320, action_321, action_322, action_323, action_324, action_325, action_326, action_327, action_328, action_329, action_330, action_331, action_332, action_333, action_334, action_335, action_336, action_337, action_338, action_339, action_340, action_341, action_342, action_343, action_344, action_345, action_346, action_347, action_348, action_349, action_350, action_351, action_352, action_353, action_354, action_355, action_356, action_357, action_358, action_359, action_360, action_361, action_362, action_363, action_364, action_365, action_366, action_367, action_368, action_369, action_370, action_371, action_372, action_373, action_374, action_375, action_376, action_377, action_378, action_379, action_380, action_381, action_382, action_383, action_384, action_385, action_386, action_387, action_388, action_389, action_390, action_391, action_392, action_393, action_394, action_395, action_396, action_397, action_398, action_399, action_400, action_401, action_402, action_403, action_404, action_405, action_406, action_407, action_408, action_409, action_410, action_411, action_412, action_413, action_414, action_415, action_416, action_417, action_418, action_419, action_420, action_421, action_422, action_423, action_424, action_425, action_426, action_427, action_428, action_429, action_430, action_431, action_432, action_433, action_434, action_435, action_436, action_437, action_438, action_439, action_440, action_441, action_442, action_443, action_444, action_445, action_446, action_447, action_448, action_449, action_450, action_451, action_452, action_453, action_454, action_455, action_456, action_457, action_458, action_459, action_460, action_461, action_462, action_463, action_464, action_465, action_466, action_467, action_468, action_469, action_470, action_471, action_472, action_473, action_474, action_475, action_476, action_477, action_478, action_479, action_480, action_481, action_482, action_483, action_484, action_485, action_486, action_487, action_488, action_489, action_490, action_491, action_492, action_493, action_494, action_495, action_496, action_497, action_498, action_499, action_500, action_501, action_502, action_503, action_504, action_505, action_506, action_507, action_508, action_509, action_510, action_511, action_512, action_513, action_514, action_515, action_516, action_517, action_518, action_519, action_520, action_521, action_522, action_523, action_524, action_525, action_526, action_527, action_528, action_529, action_530, action_531, action_532, action_533, action_534, action_535, action_536, action_537, action_538, action_539, action_540, action_541, action_542, action_543, action_544, action_545, action_546, action_547, action_548, action_549, action_550, action_551, action_552, action_553, action_554, action_555, action_556, action_557, action_558, action_559, action_560, action_561, action_562, action_563, action_564, action_565, action_566, action_567, action_568, action_569, action_570, action_571, action_572, action_573, action_574, action_575, action_576, action_577, action_578, action_579, action_580, action_581, action_582, action_583, action_584, action_585, action_586, action_587, action_588, action_589, action_590, action_591, action_592, action_593, action_594, action_595, action_596, action_597, action_598, action_599, action_600, action_601, action_602, action_603, action_604, action_605, action_606, action_607, action_608, action_609, action_610, action_611, action_612, action_613, action_614, action_615, action_616, action_617, action_618, action_619, action_620, action_621, action_622, action_623, action_624, action_625, action_626, action_627, action_628, action_629, action_630, action_631, action_632, action_633, action_634, action_635, action_636, action_637, action_638, action_639, action_640, action_641, action_642, action_643, action_644, action_645, action_646, action_647, action_648, action_649, action_650, action_651, action_652, action_653, action_654, action_655, action_656, action_657, action_658, action_659, action_660, action_661, action_662, action_663, action_664, action_665, action_666, action_667, action_668, action_669, action_670, action_671, action_672, action_673, action_674, action_675, action_676, action_677, action_678, action_679, action_680, action_681, action_682, action_683, action_684, action_685, action_686, action_687, action_688, action_689, action_690, action_691, action_692, action_693, action_694, action_695, action_696, action_697, action_698, action_699, action_700, action_701, action_702, action_703, action_704, action_705, action_706, action_707, action_708, action_709, action_710, action_711, action_712, action_713, action_714, action_715, action_716, action_717, action_718, action_719, action_720, action_721, action_722, action_723, action_724, action_725, action_726, action_727, action_728, action_729, action_730, action_731, action_732, action_733, action_734, action_735, action_736, action_737, action_738, action_739, action_740, action_741, action_742, action_743, action_744, action_745, action_746, action_747, action_748, action_749, action_750, action_751, action_752, action_753, action_754, action_755, action_756, action_757, action_758, action_759, action_760, action_761, action_762, action_763, action_764, action_765, action_766, action_767, action_768, action_769, action_770, action_771, action_772, action_773, action_774, action_775, action_776, action_777, action_778, action_779, action_780, action_781, action_782, action_783, action_784, action_785, action_786, action_787, action_788, action_789, action_790, action_791, action_792, action_793, action_794, action_795, action_796, action_797, action_798, action_799, action_800, action_801, action_802, action_803, action_804, action_805, action_806, action_807, action_808, action_809, action_810, action_811, action_812, action_813, action_814, action_815, action_816, action_817, action_818, action_819, action_820, action_821, action_822, action_823, action_824, action_825, action_826, action_827, action_828, action_829, action_830, action_831, action_832, action_833, action_834, action_835, action_836, action_837, action_838, action_839, action_840, action_841, action_842, action_843, action_844, action_845, action_846, action_847, action_848, action_849, action_850, action_851, action_852, action_853, action_854, action_855, action_856, action_857, action_858, action_859, action_860, action_861, action_862, action_863, action_864, action_865, action_866, action_867, action_868, action_869, action_870, action_871, action_872, action_873, action_874, action_875, action_876, action_877, action_878, action_879, action_880, action_881, action_882, action_883, action_884, action_885, action_886, action_887, action_888, action_889, action_890, action_891, action_892, action_893, action_894, action_895, action_896, action_897, action_898, action_899, action_900, action_901, action_902, action_903, action_904, action_905, action_906, action_907, action_908, action_909, action_910, action_911, action_912, action_913, action_914, action_915, action_916, action_917, action_918, action_919, action_920, action_921, action_922, action_923, action_924, action_925, action_926, action_927, action_928, action_929, action_930, action_931, action_932, action_933, action_934, action_935, action_936, action_937, action_938, action_939, action_940, action_941, action_942, action_943, action_944, action_945, action_946, action_947, action_948, action_949, action_950, action_951, action_952, action_953, action_954, action_955, action_956, action_957, action_958, action_959, action_960, action_961, action_962, action_963, action_964, action_965, action_966, action_967, action_968, action_969, action_970, action_971, action_972, action_973, action_974, action_975, action_976, action_977, action_978, action_979, action_980, action_981, action_982, action_983, action_984, action_985, action_986, action_987, action_988, action_989, action_990, action_991, action_992, action_993, action_994, action_995, action_996, action_997, action_998, action_999, action_1000, action_1001, action_1002, action_1003, action_1004, action_1005, action_1006, action_1007, action_1008, action_1009, action_1010, action_1011, action_1012, action_1013, action_1014, action_1015, action_1016, action_1017, action_1018, action_1019, action_1020, action_1021, action_1022, action_1023, action_1024, action_1025, action_1026, action_1027, action_1028, action_1029, action_1030, action_1031, action_1032, action_1033, action_1034, action_1035, action_1036, action_1037, action_1038, action_1039, action_1040, action_1041, action_1042, action_1043, action_1044, action_1045, action_1046, action_1047, action_1048, action_1049, action_1050, action_1051, action_1052, action_1053, action_1054, action_1055, action_1056, action_1057, action_1058, action_1059, action_1060, action_1061, action_1062, action_1063, action_1064, action_1065, action_1066, action_1067, action_1068, action_1069, action_1070, action_1071, action_1072, action_1073, action_1074, action_1075, action_1076, action_1077, action_1078, action_1079, action_1080, action_1081, action_1082, action_1083, action_1084, action_1085, action_1086, action_1087, action_1088, action_1089, action_1090, action_1091, action_1092, action_1093, action_1094, action_1095, action_1096, action_1097, action_1098, action_1099, action_1100, action_1101, action_1102, action_1103, action_1104, action_1105, action_1106, action_1107, action_1108, action_1109, action_1110, action_1111, action_1112, action_1113, action_1114, action_1115, action_1116, action_1117, action_1118, action_1119, action_1120, action_1121, action_1122, action_1123, action_1124, action_1125, action_1126, action_1127, action_1128, action_1129, action_1130, action_1131, action_1132, action_1133, action_1134, action_1135, action_1136, action_1137, action_1138, action_1139, action_1140 :: () => Int -> ({-HappyReduction (P) = -} Int -> ((Located Token)) -> HappyState ((Located Token)) (HappyStk HappyAbsSyn -> (P) HappyAbsSyn) -> [HappyState ((Located Token)) (HappyStk HappyAbsSyn -> (P) HappyAbsSyn)] -> HappyStk HappyAbsSyn -> (P) HappyAbsSyn) happyReduce_12, happyReduce_13, happyReduce_14, happyReduce_15, happyReduce_16, happyReduce_17, happyReduce_18, happyReduce_19, happyReduce_20, happyReduce_21, happyReduce_22, happyReduce_23, happyReduce_24, happyReduce_25, happyReduce_26, happyReduce_27, happyReduce_28, happyReduce_29, happyReduce_30, happyReduce_31, happyReduce_32, happyReduce_33, happyReduce_34, happyReduce_35, happyReduce_36, happyReduce_37, happyReduce_38, happyReduce_39, happyReduce_40, happyReduce_41, happyReduce_42, happyReduce_43, happyReduce_44, happyReduce_45, happyReduce_46, happyReduce_47, happyReduce_48, happyReduce_49, happyReduce_50, happyReduce_51, happyReduce_52, happyReduce_53, happyReduce_54, happyReduce_55, happyReduce_56, happyReduce_57, happyReduce_58, happyReduce_59, happyReduce_60, happyReduce_61, happyReduce_62, happyReduce_63, happyReduce_64, happyReduce_65, happyReduce_66, happyReduce_67, happyReduce_68, happyReduce_69, happyReduce_70, happyReduce_71, happyReduce_72, happyReduce_73, happyReduce_74, happyReduce_75, happyReduce_76, happyReduce_77, happyReduce_78, happyReduce_79, happyReduce_80, happyReduce_81, happyReduce_82, happyReduce_83, happyReduce_84, happyReduce_85, happyReduce_86, happyReduce_87, happyReduce_88, happyReduce_89, happyReduce_90, happyReduce_91, happyReduce_92, happyReduce_93, happyReduce_94, happyReduce_95, happyReduce_96, happyReduce_97, happyReduce_98, happyReduce_99, happyReduce_100, happyReduce_101, happyReduce_102, happyReduce_103, happyReduce_104, happyReduce_105, happyReduce_106, happyReduce_107, happyReduce_108, happyReduce_109, happyReduce_110, happyReduce_111, happyReduce_112, happyReduce_113, happyReduce_114, happyReduce_115, happyReduce_116, happyReduce_117, happyReduce_118, happyReduce_119, happyReduce_120, happyReduce_121, happyReduce_122, happyReduce_123, happyReduce_124, happyReduce_125, happyReduce_126, happyReduce_127, happyReduce_128, happyReduce_129, happyReduce_130, happyReduce_131, happyReduce_132, happyReduce_133, happyReduce_134, happyReduce_135, happyReduce_136, happyReduce_137, happyReduce_138, happyReduce_139, happyReduce_140, happyReduce_141, happyReduce_142, happyReduce_143, happyReduce_144, happyReduce_145, happyReduce_146, happyReduce_147, happyReduce_148, happyReduce_149, happyReduce_150, happyReduce_151, happyReduce_152, happyReduce_153, happyReduce_154, happyReduce_155, happyReduce_156, happyReduce_157, happyReduce_158, happyReduce_159, happyReduce_160, happyReduce_161, happyReduce_162, happyReduce_163, happyReduce_164, happyReduce_165, happyReduce_166, happyReduce_167, happyReduce_168, happyReduce_169, happyReduce_170, happyReduce_171, happyReduce_172, happyReduce_173, happyReduce_174, happyReduce_175, happyReduce_176, happyReduce_177, happyReduce_178, happyReduce_179, happyReduce_180, happyReduce_181, happyReduce_182, happyReduce_183, happyReduce_184, happyReduce_185, happyReduce_186, happyReduce_187, happyReduce_188, happyReduce_189, happyReduce_190, happyReduce_191, happyReduce_192, happyReduce_193, happyReduce_194, happyReduce_195, happyReduce_196, happyReduce_197, happyReduce_198, happyReduce_199, happyReduce_200, happyReduce_201, happyReduce_202, happyReduce_203, happyReduce_204, happyReduce_205, happyReduce_206, happyReduce_207, happyReduce_208, happyReduce_209, happyReduce_210, happyReduce_211, happyReduce_212, happyReduce_213, happyReduce_214, happyReduce_215, happyReduce_216, happyReduce_217, happyReduce_218, happyReduce_219, happyReduce_220, happyReduce_221, happyReduce_222, happyReduce_223, happyReduce_224, happyReduce_225, happyReduce_226, happyReduce_227, happyReduce_228, happyReduce_229, happyReduce_230, happyReduce_231, happyReduce_232, happyReduce_233, happyReduce_234, happyReduce_235, happyReduce_236, happyReduce_237, happyReduce_238, happyReduce_239, happyReduce_240, happyReduce_241, happyReduce_242, happyReduce_243, happyReduce_244, happyReduce_245, happyReduce_246, happyReduce_247, happyReduce_248, happyReduce_249, happyReduce_250, happyReduce_251, happyReduce_252, happyReduce_253, happyReduce_254, happyReduce_255, happyReduce_256, happyReduce_257, happyReduce_258, happyReduce_259, happyReduce_260, happyReduce_261, happyReduce_262, happyReduce_263, happyReduce_264, happyReduce_265, happyReduce_266, happyReduce_267, happyReduce_268, happyReduce_269, happyReduce_270, happyReduce_271, happyReduce_272, happyReduce_273, happyReduce_274, happyReduce_275, happyReduce_276, happyReduce_277, happyReduce_278, happyReduce_279, happyReduce_280, happyReduce_281, happyReduce_282, happyReduce_283, happyReduce_284, happyReduce_285, happyReduce_286, happyReduce_287, happyReduce_288, happyReduce_289, happyReduce_290, happyReduce_291, happyReduce_292, happyReduce_293, happyReduce_294, happyReduce_295, happyReduce_296, happyReduce_297, happyReduce_298, happyReduce_299, happyReduce_300, happyReduce_301, happyReduce_302, happyReduce_303, happyReduce_304, happyReduce_305, happyReduce_306, happyReduce_307, happyReduce_308, happyReduce_309, happyReduce_310, happyReduce_311, happyReduce_312, happyReduce_313, happyReduce_314, happyReduce_315, happyReduce_316, happyReduce_317, happyReduce_318, happyReduce_319, happyReduce_320, happyReduce_321, happyReduce_322, happyReduce_323, happyReduce_324, happyReduce_325, happyReduce_326, happyReduce_327, happyReduce_328, happyReduce_329, happyReduce_330, happyReduce_331, happyReduce_332, happyReduce_333, happyReduce_334, happyReduce_335, happyReduce_336, happyReduce_337, happyReduce_338, happyReduce_339, happyReduce_340, happyReduce_341, happyReduce_342, happyReduce_343, happyReduce_344, happyReduce_345, happyReduce_346, happyReduce_347, happyReduce_348, happyReduce_349, happyReduce_350, happyReduce_351, happyReduce_352, happyReduce_353, happyReduce_354, happyReduce_355, happyReduce_356, happyReduce_357, happyReduce_358, happyReduce_359, happyReduce_360, happyReduce_361, happyReduce_362, happyReduce_363, happyReduce_364, happyReduce_365, happyReduce_366, happyReduce_367, happyReduce_368, happyReduce_369, happyReduce_370, happyReduce_371, happyReduce_372, happyReduce_373, happyReduce_374, happyReduce_375, happyReduce_376, happyReduce_377, happyReduce_378, happyReduce_379, happyReduce_380, happyReduce_381, happyReduce_382, happyReduce_383, happyReduce_384, happyReduce_385, happyReduce_386, happyReduce_387, happyReduce_388, happyReduce_389, happyReduce_390, happyReduce_391, happyReduce_392, happyReduce_393, happyReduce_394, happyReduce_395, happyReduce_396, happyReduce_397, happyReduce_398, happyReduce_399, happyReduce_400, happyReduce_401, happyReduce_402, happyReduce_403, happyReduce_404, happyReduce_405, happyReduce_406, happyReduce_407, happyReduce_408, happyReduce_409, happyReduce_410, happyReduce_411, happyReduce_412, happyReduce_413, happyReduce_414, happyReduce_415, happyReduce_416, happyReduce_417, happyReduce_418, happyReduce_419, happyReduce_420, happyReduce_421, happyReduce_422, happyReduce_423, happyReduce_424, happyReduce_425, happyReduce_426, happyReduce_427, happyReduce_428, happyReduce_429, happyReduce_430, happyReduce_431, happyReduce_432, happyReduce_433, happyReduce_434, happyReduce_435, happyReduce_436, happyReduce_437, happyReduce_438, happyReduce_439, happyReduce_440, happyReduce_441, happyReduce_442, happyReduce_443, happyReduce_444, happyReduce_445, happyReduce_446, happyReduce_447, happyReduce_448, happyReduce_449, happyReduce_450, happyReduce_451, happyReduce_452, happyReduce_453, happyReduce_454, happyReduce_455, happyReduce_456, happyReduce_457, happyReduce_458, happyReduce_459, happyReduce_460, happyReduce_461, happyReduce_462, happyReduce_463, happyReduce_464, happyReduce_465, happyReduce_466, happyReduce_467, happyReduce_468, happyReduce_469, happyReduce_470, happyReduce_471, happyReduce_472, happyReduce_473, happyReduce_474, happyReduce_475, happyReduce_476, happyReduce_477, happyReduce_478, happyReduce_479, happyReduce_480, happyReduce_481, happyReduce_482, happyReduce_483, happyReduce_484, happyReduce_485, happyReduce_486, happyReduce_487, happyReduce_488, happyReduce_489, happyReduce_490, happyReduce_491, happyReduce_492, happyReduce_493, happyReduce_494, happyReduce_495, happyReduce_496, happyReduce_497, happyReduce_498, happyReduce_499, happyReduce_500, happyReduce_501, happyReduce_502, happyReduce_503, happyReduce_504, happyReduce_505, happyReduce_506, happyReduce_507, happyReduce_508, happyReduce_509, happyReduce_510, happyReduce_511, happyReduce_512, happyReduce_513, happyReduce_514, happyReduce_515, happyReduce_516, happyReduce_517, happyReduce_518, happyReduce_519, happyReduce_520, happyReduce_521, happyReduce_522, happyReduce_523, happyReduce_524, happyReduce_525, happyReduce_526, happyReduce_527, happyReduce_528, happyReduce_529, happyReduce_530, happyReduce_531, happyReduce_532, happyReduce_533, happyReduce_534, happyReduce_535, happyReduce_536, happyReduce_537, happyReduce_538, happyReduce_539, happyReduce_540, happyReduce_541, happyReduce_542, happyReduce_543, happyReduce_544, happyReduce_545, happyReduce_546, happyReduce_547, happyReduce_548, happyReduce_549, happyReduce_550, happyReduce_551, happyReduce_552, happyReduce_553, happyReduce_554, happyReduce_555, happyReduce_556, happyReduce_557, happyReduce_558, happyReduce_559, happyReduce_560, happyReduce_561, happyReduce_562, happyReduce_563, happyReduce_564, happyReduce_565, happyReduce_566, happyReduce_567, happyReduce_568, happyReduce_569, happyReduce_570, happyReduce_571, happyReduce_572, happyReduce_573, happyReduce_574, happyReduce_575, happyReduce_576, happyReduce_577, happyReduce_578, happyReduce_579, happyReduce_580, happyReduce_581, happyReduce_582, happyReduce_583, happyReduce_584, happyReduce_585, happyReduce_586, happyReduce_587, happyReduce_588, happyReduce_589, happyReduce_590, happyReduce_591, happyReduce_592, happyReduce_593, happyReduce_594, happyReduce_595, happyReduce_596, happyReduce_597, happyReduce_598, happyReduce_599, happyReduce_600, happyReduce_601, happyReduce_602, happyReduce_603, happyReduce_604, happyReduce_605, happyReduce_606, happyReduce_607, happyReduce_608, happyReduce_609, happyReduce_610, happyReduce_611, happyReduce_612, happyReduce_613, happyReduce_614, happyReduce_615, happyReduce_616, happyReduce_617, happyReduce_618, happyReduce_619, happyReduce_620, happyReduce_621, happyReduce_622, happyReduce_623, happyReduce_624, happyReduce_625, happyReduce_626, happyReduce_627, happyReduce_628, happyReduce_629, happyReduce_630, happyReduce_631, happyReduce_632, happyReduce_633, happyReduce_634, happyReduce_635, happyReduce_636, happyReduce_637, happyReduce_638, happyReduce_639, happyReduce_640, happyReduce_641, happyReduce_642, happyReduce_643, happyReduce_644, happyReduce_645, happyReduce_646, happyReduce_647, happyReduce_648, happyReduce_649 :: () => ({-HappyReduction (P) = -} Int -> ((Located Token)) -> HappyState ((Located Token)) (HappyStk HappyAbsSyn -> (P) HappyAbsSyn) -> [HappyState ((Located Token)) (HappyStk HappyAbsSyn -> (P) HappyAbsSyn)] -> HappyStk HappyAbsSyn -> (P) HappyAbsSyn) action_0 (244) = happyShift action_36 action_0 (245) = happyShift action_37 action_0 (246) = happyShift action_38 action_0 (251) = happyShift action_39 action_0 (253) = happyShift action_40 action_0 (254) = happyShift action_41 action_0 (261) = happyShift action_155 action_0 (265) = happyShift action_46 action_0 (269) = happyShift action_47 action_0 (270) = happyShift action_48 action_0 (272) = happyShift action_49 action_0 (273) = happyShift action_50 action_0 (274) = happyShift action_51 action_0 (275) = happyShift action_52 action_0 (276) = happyShift action_53 action_0 (277) = happyShift action_54 action_0 (278) = happyShift action_55 action_0 (279) = happyShift action_56 action_0 (280) = happyShift action_57 action_0 (281) = happyShift action_58 action_0 (282) = happyShift action_59 action_0 (283) = happyShift action_60 action_0 (284) = happyShift action_61 action_0 (285) = happyShift action_156 action_0 (286) = happyShift action_62 action_0 (294) = happyShift action_66 action_0 (295) = happyShift action_67 action_0 (296) = happyShift action_68 action_0 (311) = happyShift action_69 action_0 (317) = happyShift action_70 action_0 (320) = happyShift action_71 action_0 (321) = happyShift action_157 action_0 (332) = happyShift action_72 action_0 (334) = happyShift action_73 action_0 (336) = happyShift action_112 action_0 (338) = happyShift action_75 action_0 (340) = happyShift action_76 action_0 (345) = happyShift action_77 action_0 (346) = happyShift action_78 action_0 (347) = happyShift action_79 action_0 (350) = happyShift action_80 action_0 (351) = happyShift action_81 action_0 (354) = happyShift action_82 action_0 (355) = happyShift action_83 action_0 (356) = happyShift action_84 action_0 (357) = happyShift action_85 action_0 (358) = happyShift action_86 action_0 (359) = happyShift action_87 action_0 (360) = happyShift action_88 action_0 (361) = happyShift action_89 action_0 (362) = happyShift action_90 action_0 (363) = happyShift action_91 action_0 (364) = happyShift action_92 action_0 (365) = happyShift action_93 action_0 (366) = happyShift action_94 action_0 (371) = happyShift action_95 action_0 (372) = happyShift action_96 action_0 (373) = happyShift action_97 action_0 (374) = happyShift action_98 action_0 (376) = happyShift action_99 action_0 (377) = happyShift action_100 action_0 (378) = happyShift action_101 action_0 (379) = happyShift action_102 action_0 (380) = happyShift action_103 action_0 (38) = happyGoto action_13 action_0 (142) = happyGoto action_16 action_0 (143) = happyGoto action_151 action_0 (144) = happyGoto action_110 action_0 (145) = happyGoto action_18 action_0 (147) = happyGoto action_19 action_0 (148) = happyGoto action_20 action_0 (149) = happyGoto action_21 action_0 (150) = happyGoto action_22 action_0 (151) = happyGoto action_23 action_0 (152) = happyGoto action_24 action_0 (178) = happyGoto action_152 action_0 (185) = happyGoto action_163 action_0 (186) = happyGoto action_154 action_0 (192) = happyGoto action_25 action_0 (195) = happyGoto action_26 action_0 (198) = happyGoto action_27 action_0 (219) = happyGoto action_29 action_0 (220) = happyGoto action_30 action_0 (221) = happyGoto action_111 action_0 (227) = happyGoto action_32 action_0 (229) = happyGoto action_33 action_0 (230) = happyGoto action_34 action_0 (233) = happyGoto action_35 action_0 _ = happyFail action_1 (255) = happyShift action_150 action_1 (40) = happyGoto action_162 action_1 _ = happyFail action_2 (244) = happyShift action_36 action_2 (245) = happyShift action_37 action_2 (246) = happyShift action_38 action_2 (247) = happyShift action_129 action_2 (248) = happyShift action_130 action_2 (249) = happyShift action_131 action_2 (250) = happyShift action_132 action_2 (251) = happyShift action_39 action_2 (253) = happyShift action_40 action_2 (254) = happyShift action_41 action_2 (257) = happyShift action_42 action_2 (258) = happyShift action_43 action_2 (259) = happyShift action_44 action_2 (260) = happyShift action_133 action_2 (261) = happyShift action_45 action_2 (263) = happyShift action_134 action_2 (265) = happyShift action_46 action_2 (267) = happyShift action_135 action_2 (269) = happyShift action_47 action_2 (270) = happyShift action_48 action_2 (271) = happyShift action_136 action_2 (272) = happyShift action_49 action_2 (273) = happyShift action_50 action_2 (274) = happyShift action_51 action_2 (275) = happyShift action_52 action_2 (276) = happyShift action_53 action_2 (277) = happyShift action_54 action_2 (278) = happyShift action_55 action_2 (279) = happyShift action_56 action_2 (280) = happyShift action_57 action_2 (281) = happyShift action_58 action_2 (282) = happyShift action_59 action_2 (283) = happyShift action_60 action_2 (284) = happyShift action_61 action_2 (286) = happyShift action_62 action_2 (289) = happyShift action_63 action_2 (290) = happyShift action_64 action_2 (291) = happyShift action_65 action_2 (293) = happyShift action_137 action_2 (294) = happyShift action_66 action_2 (295) = happyShift action_67 action_2 (296) = happyShift action_68 action_2 (297) = happyShift action_138 action_2 (298) = happyShift action_139 action_2 (301) = happyShift action_140 action_2 (302) = happyShift action_141 action_2 (303) = happyShift action_142 action_2 (304) = happyShift action_143 action_2 (311) = happyShift action_69 action_2 (317) = happyShift action_70 action_2 (320) = happyShift action_71 action_2 (321) = happyShift action_144 action_2 (332) = happyShift action_72 action_2 (334) = happyShift action_73 action_2 (336) = happyShift action_74 action_2 (338) = happyShift action_75 action_2 (340) = happyShift action_76 action_2 (345) = happyShift action_77 action_2 (346) = happyShift action_78 action_2 (347) = happyShift action_79 action_2 (350) = happyShift action_80 action_2 (351) = happyShift action_81 action_2 (354) = happyShift action_82 action_2 (355) = happyShift action_83 action_2 (356) = happyShift action_84 action_2 (357) = happyShift action_85 action_2 (358) = happyShift action_86 action_2 (359) = happyShift action_87 action_2 (360) = happyShift action_88 action_2 (361) = happyShift action_89 action_2 (362) = happyShift action_90 action_2 (363) = happyShift action_91 action_2 (364) = happyShift action_92 action_2 (365) = happyShift action_93 action_2 (366) = happyShift action_94 action_2 (367) = happyShift action_145 action_2 (368) = happyShift action_146 action_2 (369) = happyShift action_147 action_2 (370) = happyShift action_148 action_2 (371) = happyShift action_95 action_2 (372) = happyShift action_96 action_2 (373) = happyShift action_97 action_2 (374) = happyShift action_98 action_2 (376) = happyShift action_99 action_2 (377) = happyShift action_100 action_2 (378) = happyShift action_101 action_2 (379) = happyShift action_102 action_2 (380) = happyShift action_103 action_2 (38) = happyGoto action_13 action_2 (49) = happyGoto action_14 action_2 (52) = happyGoto action_161 action_2 (53) = happyGoto action_114 action_2 (54) = happyGoto action_115 action_2 (55) = happyGoto action_116 action_2 (58) = happyGoto action_117 action_2 (62) = happyGoto action_118 action_2 (88) = happyGoto action_119 action_2 (135) = happyGoto action_120 action_2 (136) = happyGoto action_121 action_2 (137) = happyGoto action_122 action_2 (141) = happyGoto action_123 action_2 (142) = happyGoto action_16 action_2 (144) = happyGoto action_124 action_2 (145) = happyGoto action_18 action_2 (147) = happyGoto action_19 action_2 (148) = happyGoto action_20 action_2 (149) = happyGoto action_21 action_2 (150) = happyGoto action_22 action_2 (151) = happyGoto action_23 action_2 (152) = happyGoto action_24 action_2 (192) = happyGoto action_25 action_2 (195) = happyGoto action_26 action_2 (198) = happyGoto action_27 action_2 (218) = happyGoto action_28 action_2 (219) = happyGoto action_29 action_2 (220) = happyGoto action_30 action_2 (221) = happyGoto action_31 action_2 (227) = happyGoto action_32 action_2 (229) = happyGoto action_33 action_2 (230) = happyGoto action_34 action_2 (233) = happyGoto action_35 action_2 (237) = happyGoto action_125 action_2 (238) = happyGoto action_126 action_2 (239) = happyGoto action_127 action_2 (240) = happyGoto action_128 action_2 _ = happyFail action_3 (244) = happyShift action_36 action_3 (245) = happyShift action_37 action_3 (246) = happyShift action_38 action_3 (251) = happyShift action_39 action_3 (253) = happyShift action_40 action_3 (254) = happyShift action_41 action_3 (257) = happyShift action_42 action_3 (258) = happyShift action_43 action_3 (259) = happyShift action_44 action_3 (261) = happyShift action_45 action_3 (265) = happyShift action_46 action_3 (269) = happyShift action_47 action_3 (270) = happyShift action_48 action_3 (272) = happyShift action_49 action_3 (273) = happyShift action_50 action_3 (274) = happyShift action_51 action_3 (275) = happyShift action_52 action_3 (276) = happyShift action_53 action_3 (277) = happyShift action_54 action_3 (278) = happyShift action_55 action_3 (279) = happyShift action_56 action_3 (280) = happyShift action_57 action_3 (281) = happyShift action_58 action_3 (282) = happyShift action_59 action_3 (283) = happyShift action_60 action_3 (284) = happyShift action_61 action_3 (286) = happyShift action_62 action_3 (289) = happyShift action_63 action_3 (290) = happyShift action_64 action_3 (291) = happyShift action_65 action_3 (294) = happyShift action_66 action_3 (295) = happyShift action_67 action_3 (296) = happyShift action_68 action_3 (311) = happyShift action_69 action_3 (317) = happyShift action_70 action_3 (320) = happyShift action_71 action_3 (332) = happyShift action_72 action_3 (334) = happyShift action_73 action_3 (336) = happyShift action_74 action_3 (338) = happyShift action_75 action_3 (340) = happyShift action_76 action_3 (345) = happyShift action_77 action_3 (346) = happyShift action_78 action_3 (347) = happyShift action_79 action_3 (350) = happyShift action_80 action_3 (351) = happyShift action_81 action_3 (354) = happyShift action_82 action_3 (355) = happyShift action_83 action_3 (356) = happyShift action_84 action_3 (357) = happyShift action_85 action_3 (358) = happyShift action_86 action_3 (359) = happyShift action_87 action_3 (360) = happyShift action_88 action_3 (361) = happyShift action_89 action_3 (362) = happyShift action_90 action_3 (363) = happyShift action_91 action_3 (364) = happyShift action_92 action_3 (365) = happyShift action_93 action_3 (366) = happyShift action_94 action_3 (371) = happyShift action_95 action_3 (372) = happyShift action_96 action_3 (373) = happyShift action_97 action_3 (374) = happyShift action_98 action_3 (376) = happyShift action_99 action_3 (377) = happyShift action_100 action_3 (378) = happyShift action_101 action_3 (379) = happyShift action_102 action_3 (380) = happyShift action_103 action_3 (15) = happyGoto action_160 action_3 (38) = happyGoto action_13 action_3 (49) = happyGoto action_14 action_3 (141) = happyGoto action_15 action_3 (142) = happyGoto action_16 action_3 (144) = happyGoto action_17 action_3 (145) = happyGoto action_18 action_3 (147) = happyGoto action_19 action_3 (148) = happyGoto action_20 action_3 (149) = happyGoto action_21 action_3 (150) = happyGoto action_22 action_3 (151) = happyGoto action_23 action_3 (152) = happyGoto action_24 action_3 (192) = happyGoto action_25 action_3 (195) = happyGoto action_26 action_3 (198) = happyGoto action_27 action_3 (218) = happyGoto action_28 action_3 (219) = happyGoto action_29 action_3 (220) = happyGoto action_30 action_3 (221) = happyGoto action_31 action_3 (227) = happyGoto action_32 action_3 (229) = happyGoto action_33 action_3 (230) = happyGoto action_34 action_3 (233) = happyGoto action_35 action_3 _ = happyFail action_4 (367) = happyShift action_107 action_4 (16) = happyGoto action_159 action_4 (19) = happyGoto action_105 action_4 (241) = happyGoto action_106 action_4 _ = happyReduce_22 action_5 (244) = happyShift action_36 action_5 (245) = happyShift action_37 action_5 (246) = happyShift action_38 action_5 (251) = happyShift action_39 action_5 (253) = happyShift action_40 action_5 (254) = happyShift action_41 action_5 (261) = happyShift action_45 action_5 (265) = happyShift action_46 action_5 (269) = happyShift action_47 action_5 (270) = happyShift action_48 action_5 (272) = happyShift action_49 action_5 (273) = happyShift action_50 action_5 (274) = happyShift action_51 action_5 (275) = happyShift action_52 action_5 (276) = happyShift action_53 action_5 (277) = happyShift action_54 action_5 (278) = happyShift action_55 action_5 (279) = happyShift action_56 action_5 (280) = happyShift action_57 action_5 (281) = happyShift action_58 action_5 (282) = happyShift action_59 action_5 (283) = happyShift action_60 action_5 (284) = happyShift action_61 action_5 (286) = happyShift action_62 action_5 (294) = happyShift action_66 action_5 (295) = happyShift action_67 action_5 (296) = happyShift action_68 action_5 (311) = happyShift action_69 action_5 (317) = happyShift action_70 action_5 (320) = happyShift action_71 action_5 (332) = happyShift action_72 action_5 (334) = happyShift action_73 action_5 (336) = happyShift action_112 action_5 (338) = happyShift action_75 action_5 (340) = happyShift action_76 action_5 (345) = happyShift action_77 action_5 (346) = happyShift action_78 action_5 (347) = happyShift action_79 action_5 (350) = happyShift action_80 action_5 (351) = happyShift action_81 action_5 (354) = happyShift action_82 action_5 (355) = happyShift action_83 action_5 (356) = happyShift action_84 action_5 (357) = happyShift action_85 action_5 (358) = happyShift action_86 action_5 (359) = happyShift action_87 action_5 (360) = happyShift action_88 action_5 (361) = happyShift action_89 action_5 (362) = happyShift action_90 action_5 (363) = happyShift action_91 action_5 (364) = happyShift action_92 action_5 (365) = happyShift action_93 action_5 (366) = happyShift action_94 action_5 (371) = happyShift action_95 action_5 (372) = happyShift action_96 action_5 (373) = happyShift action_97 action_5 (374) = happyShift action_98 action_5 (376) = happyShift action_99 action_5 (377) = happyShift action_100 action_5 (378) = happyShift action_101 action_5 (379) = happyShift action_102 action_5 (380) = happyShift action_103 action_5 (38) = happyGoto action_13 action_5 (142) = happyGoto action_16 action_5 (143) = happyGoto action_158 action_5 (144) = happyGoto action_110 action_5 (145) = happyGoto action_18 action_5 (147) = happyGoto action_19 action_5 (148) = happyGoto action_20 action_5 (149) = happyGoto action_21 action_5 (150) = happyGoto action_22 action_5 (151) = happyGoto action_23 action_5 (152) = happyGoto action_24 action_5 (192) = happyGoto action_25 action_5 (195) = happyGoto action_26 action_5 (198) = happyGoto action_27 action_5 (219) = happyGoto action_29 action_5 (220) = happyGoto action_30 action_5 (221) = happyGoto action_111 action_5 (227) = happyGoto action_32 action_5 (229) = happyGoto action_33 action_5 (230) = happyGoto action_34 action_5 (233) = happyGoto action_35 action_5 _ = happyFail action_6 (244) = happyShift action_36 action_6 (245) = happyShift action_37 action_6 (246) = happyShift action_38 action_6 (251) = happyShift action_39 action_6 (253) = happyShift action_40 action_6 (254) = happyShift action_41 action_6 (261) = happyShift action_155 action_6 (265) = happyShift action_46 action_6 (269) = happyShift action_47 action_6 (270) = happyShift action_48 action_6 (272) = happyShift action_49 action_6 (273) = happyShift action_50 action_6 (274) = happyShift action_51 action_6 (275) = happyShift action_52 action_6 (276) = happyShift action_53 action_6 (277) = happyShift action_54 action_6 (278) = happyShift action_55 action_6 (279) = happyShift action_56 action_6 (280) = happyShift action_57 action_6 (281) = happyShift action_58 action_6 (282) = happyShift action_59 action_6 (283) = happyShift action_60 action_6 (284) = happyShift action_61 action_6 (285) = happyShift action_156 action_6 (286) = happyShift action_62 action_6 (294) = happyShift action_66 action_6 (295) = happyShift action_67 action_6 (296) = happyShift action_68 action_6 (311) = happyShift action_69 action_6 (317) = happyShift action_70 action_6 (320) = happyShift action_71 action_6 (321) = happyShift action_157 action_6 (332) = happyShift action_72 action_6 (334) = happyShift action_73 action_6 (336) = happyShift action_112 action_6 (338) = happyShift action_75 action_6 (340) = happyShift action_76 action_6 (345) = happyShift action_77 action_6 (346) = happyShift action_78 action_6 (347) = happyShift action_79 action_6 (350) = happyShift action_80 action_6 (351) = happyShift action_81 action_6 (354) = happyShift action_82 action_6 (355) = happyShift action_83 action_6 (356) = happyShift action_84 action_6 (357) = happyShift action_85 action_6 (358) = happyShift action_86 action_6 (359) = happyShift action_87 action_6 (360) = happyShift action_88 action_6 (361) = happyShift action_89 action_6 (362) = happyShift action_90 action_6 (363) = happyShift action_91 action_6 (364) = happyShift action_92 action_6 (365) = happyShift action_93 action_6 (366) = happyShift action_94 action_6 (371) = happyShift action_95 action_6 (372) = happyShift action_96 action_6 (373) = happyShift action_97 action_6 (374) = happyShift action_98 action_6 (376) = happyShift action_99 action_6 (377) = happyShift action_100 action_6 (378) = happyShift action_101 action_6 (379) = happyShift action_102 action_6 (380) = happyShift action_103 action_6 (38) = happyGoto action_13 action_6 (142) = happyGoto action_16 action_6 (143) = happyGoto action_151 action_6 (144) = happyGoto action_110 action_6 (145) = happyGoto action_18 action_6 (147) = happyGoto action_19 action_6 (148) = happyGoto action_20 action_6 (149) = happyGoto action_21 action_6 (150) = happyGoto action_22 action_6 (151) = happyGoto action_23 action_6 (152) = happyGoto action_24 action_6 (178) = happyGoto action_152 action_6 (185) = happyGoto action_153 action_6 (186) = happyGoto action_154 action_6 (192) = happyGoto action_25 action_6 (195) = happyGoto action_26 action_6 (198) = happyGoto action_27 action_6 (219) = happyGoto action_29 action_6 (220) = happyGoto action_30 action_6 (221) = happyGoto action_111 action_6 (227) = happyGoto action_32 action_6 (229) = happyGoto action_33 action_6 (230) = happyGoto action_34 action_6 (233) = happyGoto action_35 action_6 _ = happyFail action_7 (255) = happyShift action_150 action_7 (40) = happyGoto action_149 action_7 _ = happyFail action_8 (244) = happyShift action_36 action_8 (245) = happyShift action_37 action_8 (246) = happyShift action_38 action_8 (247) = happyShift action_129 action_8 (248) = happyShift action_130 action_8 (249) = happyShift action_131 action_8 (250) = happyShift action_132 action_8 (251) = happyShift action_39 action_8 (253) = happyShift action_40 action_8 (254) = happyShift action_41 action_8 (257) = happyShift action_42 action_8 (258) = happyShift action_43 action_8 (259) = happyShift action_44 action_8 (260) = happyShift action_133 action_8 (261) = happyShift action_45 action_8 (263) = happyShift action_134 action_8 (265) = happyShift action_46 action_8 (267) = happyShift action_135 action_8 (269) = happyShift action_47 action_8 (270) = happyShift action_48 action_8 (271) = happyShift action_136 action_8 (272) = happyShift action_49 action_8 (273) = happyShift action_50 action_8 (274) = happyShift action_51 action_8 (275) = happyShift action_52 action_8 (276) = happyShift action_53 action_8 (277) = happyShift action_54 action_8 (278) = happyShift action_55 action_8 (279) = happyShift action_56 action_8 (280) = happyShift action_57 action_8 (281) = happyShift action_58 action_8 (282) = happyShift action_59 action_8 (283) = happyShift action_60 action_8 (284) = happyShift action_61 action_8 (286) = happyShift action_62 action_8 (289) = happyShift action_63 action_8 (290) = happyShift action_64 action_8 (291) = happyShift action_65 action_8 (293) = happyShift action_137 action_8 (294) = happyShift action_66 action_8 (295) = happyShift action_67 action_8 (296) = happyShift action_68 action_8 (297) = happyShift action_138 action_8 (298) = happyShift action_139 action_8 (301) = happyShift action_140 action_8 (302) = happyShift action_141 action_8 (303) = happyShift action_142 action_8 (304) = happyShift action_143 action_8 (311) = happyShift action_69 action_8 (317) = happyShift action_70 action_8 (320) = happyShift action_71 action_8 (321) = happyShift action_144 action_8 (332) = happyShift action_72 action_8 (334) = happyShift action_73 action_8 (336) = happyShift action_74 action_8 (338) = happyShift action_75 action_8 (340) = happyShift action_76 action_8 (345) = happyShift action_77 action_8 (346) = happyShift action_78 action_8 (347) = happyShift action_79 action_8 (350) = happyShift action_80 action_8 (351) = happyShift action_81 action_8 (354) = happyShift action_82 action_8 (355) = happyShift action_83 action_8 (356) = happyShift action_84 action_8 (357) = happyShift action_85 action_8 (358) = happyShift action_86 action_8 (359) = happyShift action_87 action_8 (360) = happyShift action_88 action_8 (361) = happyShift action_89 action_8 (362) = happyShift action_90 action_8 (363) = happyShift action_91 action_8 (364) = happyShift action_92 action_8 (365) = happyShift action_93 action_8 (366) = happyShift action_94 action_8 (367) = happyShift action_145 action_8 (368) = happyShift action_146 action_8 (369) = happyShift action_147 action_8 (370) = happyShift action_148 action_8 (371) = happyShift action_95 action_8 (372) = happyShift action_96 action_8 (373) = happyShift action_97 action_8 (374) = happyShift action_98 action_8 (376) = happyShift action_99 action_8 (377) = happyShift action_100 action_8 (378) = happyShift action_101 action_8 (379) = happyShift action_102 action_8 (380) = happyShift action_103 action_8 (38) = happyGoto action_13 action_8 (49) = happyGoto action_14 action_8 (52) = happyGoto action_113 action_8 (53) = happyGoto action_114 action_8 (54) = happyGoto action_115 action_8 (55) = happyGoto action_116 action_8 (58) = happyGoto action_117 action_8 (62) = happyGoto action_118 action_8 (88) = happyGoto action_119 action_8 (135) = happyGoto action_120 action_8 (136) = happyGoto action_121 action_8 (137) = happyGoto action_122 action_8 (141) = happyGoto action_123 action_8 (142) = happyGoto action_16 action_8 (144) = happyGoto action_124 action_8 (145) = happyGoto action_18 action_8 (147) = happyGoto action_19 action_8 (148) = happyGoto action_20 action_8 (149) = happyGoto action_21 action_8 (150) = happyGoto action_22 action_8 (151) = happyGoto action_23 action_8 (152) = happyGoto action_24 action_8 (192) = happyGoto action_25 action_8 (195) = happyGoto action_26 action_8 (198) = happyGoto action_27 action_8 (218) = happyGoto action_28 action_8 (219) = happyGoto action_29 action_8 (220) = happyGoto action_30 action_8 (221) = happyGoto action_31 action_8 (227) = happyGoto action_32 action_8 (229) = happyGoto action_33 action_8 (230) = happyGoto action_34 action_8 (233) = happyGoto action_35 action_8 (237) = happyGoto action_125 action_8 (238) = happyGoto action_126 action_8 (239) = happyGoto action_127 action_8 (240) = happyGoto action_128 action_8 _ = happyFail action_9 (244) = happyShift action_36 action_9 (245) = happyShift action_37 action_9 (246) = happyShift action_38 action_9 (251) = happyShift action_39 action_9 (253) = happyShift action_40 action_9 (254) = happyShift action_41 action_9 (261) = happyShift action_45 action_9 (265) = happyShift action_46 action_9 (269) = happyShift action_47 action_9 (270) = happyShift action_48 action_9 (272) = happyShift action_49 action_9 (273) = happyShift action_50 action_9 (274) = happyShift action_51 action_9 (275) = happyShift action_52 action_9 (276) = happyShift action_53 action_9 (277) = happyShift action_54 action_9 (278) = happyShift action_55 action_9 (279) = happyShift action_56 action_9 (280) = happyShift action_57 action_9 (281) = happyShift action_58 action_9 (282) = happyShift action_59 action_9 (283) = happyShift action_60 action_9 (284) = happyShift action_61 action_9 (286) = happyShift action_62 action_9 (294) = happyShift action_66 action_9 (295) = happyShift action_67 action_9 (296) = happyShift action_68 action_9 (311) = happyShift action_69 action_9 (317) = happyShift action_70 action_9 (320) = happyShift action_71 action_9 (332) = happyShift action_72 action_9 (334) = happyShift action_73 action_9 (336) = happyShift action_112 action_9 (338) = happyShift action_75 action_9 (340) = happyShift action_76 action_9 (345) = happyShift action_77 action_9 (346) = happyShift action_78 action_9 (347) = happyShift action_79 action_9 (350) = happyShift action_80 action_9 (351) = happyShift action_81 action_9 (354) = happyShift action_82 action_9 (355) = happyShift action_83 action_9 (356) = happyShift action_84 action_9 (357) = happyShift action_85 action_9 (358) = happyShift action_86 action_9 (359) = happyShift action_87 action_9 (360) = happyShift action_88 action_9 (361) = happyShift action_89 action_9 (362) = happyShift action_90 action_9 (363) = happyShift action_91 action_9 (364) = happyShift action_92 action_9 (365) = happyShift action_93 action_9 (366) = happyShift action_94 action_9 (371) = happyShift action_95 action_9 (372) = happyShift action_96 action_9 (373) = happyShift action_97 action_9 (374) = happyShift action_98 action_9 (376) = happyShift action_99 action_9 (377) = happyShift action_100 action_9 (378) = happyShift action_101 action_9 (379) = happyShift action_102 action_9 (380) = happyShift action_103 action_9 (38) = happyGoto action_13 action_9 (142) = happyGoto action_16 action_9 (143) = happyGoto action_109 action_9 (144) = happyGoto action_110 action_9 (145) = happyGoto action_18 action_9 (147) = happyGoto action_19 action_9 (148) = happyGoto action_20 action_9 (149) = happyGoto action_21 action_9 (150) = happyGoto action_22 action_9 (151) = happyGoto action_23 action_9 (152) = happyGoto action_24 action_9 (192) = happyGoto action_25 action_9 (195) = happyGoto action_26 action_9 (198) = happyGoto action_27 action_9 (219) = happyGoto action_29 action_9 (220) = happyGoto action_30 action_9 (221) = happyGoto action_111 action_9 (227) = happyGoto action_32 action_9 (229) = happyGoto action_33 action_9 (230) = happyGoto action_34 action_9 (233) = happyGoto action_35 action_9 _ = happyFail action_10 (244) = happyShift action_36 action_10 (245) = happyShift action_37 action_10 (246) = happyShift action_38 action_10 (251) = happyShift action_39 action_10 (253) = happyShift action_40 action_10 (254) = happyShift action_41 action_10 (257) = happyShift action_42 action_10 (258) = happyShift action_43 action_10 (259) = happyShift action_44 action_10 (261) = happyShift action_45 action_10 (265) = happyShift action_46 action_10 (269) = happyShift action_47 action_10 (270) = happyShift action_48 action_10 (272) = happyShift action_49 action_10 (273) = happyShift action_50 action_10 (274) = happyShift action_51 action_10 (275) = happyShift action_52 action_10 (276) = happyShift action_53 action_10 (277) = happyShift action_54 action_10 (278) = happyShift action_55 action_10 (279) = happyShift action_56 action_10 (280) = happyShift action_57 action_10 (281) = happyShift action_58 action_10 (282) = happyShift action_59 action_10 (283) = happyShift action_60 action_10 (284) = happyShift action_61 action_10 (286) = happyShift action_62 action_10 (289) = happyShift action_63 action_10 (290) = happyShift action_64 action_10 (291) = happyShift action_65 action_10 (294) = happyShift action_66 action_10 (295) = happyShift action_67 action_10 (296) = happyShift action_68 action_10 (311) = happyShift action_69 action_10 (317) = happyShift action_70 action_10 (320) = happyShift action_71 action_10 (332) = happyShift action_72 action_10 (334) = happyShift action_73 action_10 (336) = happyShift action_74 action_10 (338) = happyShift action_75 action_10 (340) = happyShift action_76 action_10 (345) = happyShift action_77 action_10 (346) = happyShift action_78 action_10 (347) = happyShift action_79 action_10 (350) = happyShift action_80 action_10 (351) = happyShift action_81 action_10 (354) = happyShift action_82 action_10 (355) = happyShift action_83 action_10 (356) = happyShift action_84 action_10 (357) = happyShift action_85 action_10 (358) = happyShift action_86 action_10 (359) = happyShift action_87 action_10 (360) = happyShift action_88 action_10 (361) = happyShift action_89 action_10 (362) = happyShift action_90 action_10 (363) = happyShift action_91 action_10 (364) = happyShift action_92 action_10 (365) = happyShift action_93 action_10 (366) = happyShift action_94 action_10 (371) = happyShift action_95 action_10 (372) = happyShift action_96 action_10 (373) = happyShift action_97 action_10 (374) = happyShift action_98 action_10 (376) = happyShift action_99 action_10 (377) = happyShift action_100 action_10 (378) = happyShift action_101 action_10 (379) = happyShift action_102 action_10 (380) = happyShift action_103 action_10 (15) = happyGoto action_108 action_10 (38) = happyGoto action_13 action_10 (49) = happyGoto action_14 action_10 (141) = happyGoto action_15 action_10 (142) = happyGoto action_16 action_10 (144) = happyGoto action_17 action_10 (145) = happyGoto action_18 action_10 (147) = happyGoto action_19 action_10 (148) = happyGoto action_20 action_10 (149) = happyGoto action_21 action_10 (150) = happyGoto action_22 action_10 (151) = happyGoto action_23 action_10 (152) = happyGoto action_24 action_10 (192) = happyGoto action_25 action_10 (195) = happyGoto action_26 action_10 (198) = happyGoto action_27 action_10 (218) = happyGoto action_28 action_10 (219) = happyGoto action_29 action_10 (220) = happyGoto action_30 action_10 (221) = happyGoto action_31 action_10 (227) = happyGoto action_32 action_10 (229) = happyGoto action_33 action_10 (230) = happyGoto action_34 action_10 (233) = happyGoto action_35 action_10 _ = happyFail action_11 (367) = happyShift action_107 action_11 (16) = happyGoto action_104 action_11 (19) = happyGoto action_105 action_11 (241) = happyGoto action_106 action_11 _ = happyReduce_22 action_12 (244) = happyShift action_36 action_12 (245) = happyShift action_37 action_12 (246) = happyShift action_38 action_12 (251) = happyShift action_39 action_12 (253) = happyShift action_40 action_12 (254) = happyShift action_41 action_12 (257) = happyShift action_42 action_12 (258) = happyShift action_43 action_12 (259) = happyShift action_44 action_12 (261) = happyShift action_45 action_12 (265) = happyShift action_46 action_12 (269) = happyShift action_47 action_12 (270) = happyShift action_48 action_12 (272) = happyShift action_49 action_12 (273) = happyShift action_50 action_12 (274) = happyShift action_51 action_12 (275) = happyShift action_52 action_12 (276) = happyShift action_53 action_12 (277) = happyShift action_54 action_12 (278) = happyShift action_55 action_12 (279) = happyShift action_56 action_12 (280) = happyShift action_57 action_12 (281) = happyShift action_58 action_12 (282) = happyShift action_59 action_12 (283) = happyShift action_60 action_12 (284) = happyShift action_61 action_12 (286) = happyShift action_62 action_12 (289) = happyShift action_63 action_12 (290) = happyShift action_64 action_12 (291) = happyShift action_65 action_12 (294) = happyShift action_66 action_12 (295) = happyShift action_67 action_12 (296) = happyShift action_68 action_12 (311) = happyShift action_69 action_12 (317) = happyShift action_70 action_12 (320) = happyShift action_71 action_12 (332) = happyShift action_72 action_12 (334) = happyShift action_73 action_12 (336) = happyShift action_74 action_12 (338) = happyShift action_75 action_12 (340) = happyShift action_76 action_12 (345) = happyShift action_77 action_12 (346) = happyShift action_78 action_12 (347) = happyShift action_79 action_12 (350) = happyShift action_80 action_12 (351) = happyShift action_81 action_12 (354) = happyShift action_82 action_12 (355) = happyShift action_83 action_12 (356) = happyShift action_84 action_12 (357) = happyShift action_85 action_12 (358) = happyShift action_86 action_12 (359) = happyShift action_87 action_12 (360) = happyShift action_88 action_12 (361) = happyShift action_89 action_12 (362) = happyShift action_90 action_12 (363) = happyShift action_91 action_12 (364) = happyShift action_92 action_12 (365) = happyShift action_93 action_12 (366) = happyShift action_94 action_12 (371) = happyShift action_95 action_12 (372) = happyShift action_96 action_12 (373) = happyShift action_97 action_12 (374) = happyShift action_98 action_12 (376) = happyShift action_99 action_12 (377) = happyShift action_100 action_12 (378) = happyShift action_101 action_12 (379) = happyShift action_102 action_12 (380) = happyShift action_103 action_12 (38) = happyGoto action_13 action_12 (49) = happyGoto action_14 action_12 (141) = happyGoto action_15 action_12 (142) = happyGoto action_16 action_12 (144) = happyGoto action_17 action_12 (145) = happyGoto action_18 action_12 (147) = happyGoto action_19 action_12 (148) = happyGoto action_20 action_12 (149) = happyGoto action_21 action_12 (150) = happyGoto action_22 action_12 (151) = happyGoto action_23 action_12 (152) = happyGoto action_24 action_12 (192) = happyGoto action_25 action_12 (195) = happyGoto action_26 action_12 (198) = happyGoto action_27 action_12 (218) = happyGoto action_28 action_12 (219) = happyGoto action_29 action_12 (220) = happyGoto action_30 action_12 (221) = happyGoto action_31 action_12 (227) = happyGoto action_32 action_12 (229) = happyGoto action_33 action_12 (230) = happyGoto action_34 action_12 (233) = happyGoto action_35 action_12 _ = happyFail action_13 _ = happyReduce_400 action_14 (359) = happyShift action_371 action_14 (48) = happyGoto action_370 action_14 _ = happyReduce_84 action_15 _ = happyReduce_12 action_16 _ = happyReduce_421 action_17 (308) = happyShift action_267 action_17 (309) = happyShift action_369 action_17 (320) = happyShift action_269 action_17 (321) = happyShift action_270 action_17 (322) = happyShift action_271 action_17 (327) = happyShift action_272 action_17 (344) = happyShift action_273 action_17 (348) = happyShift action_274 action_17 (349) = happyShift action_275 action_17 (352) = happyShift action_276 action_17 (353) = happyShift action_277 action_17 (200) = happyGoto action_257 action_17 (211) = happyGoto action_258 action_17 (213) = happyGoto action_259 action_17 (222) = happyGoto action_260 action_17 (224) = happyGoto action_261 action_17 (225) = happyGoto action_262 action_17 (226) = happyGoto action_263 action_17 (228) = happyGoto action_264 action_17 (231) = happyGoto action_265 action_17 (232) = happyGoto action_266 action_17 _ = happyFail action_18 _ = happyReduce_370 action_19 (244) = happyShift action_36 action_19 (245) = happyShift action_37 action_19 (246) = happyShift action_38 action_19 (251) = happyShift action_39 action_19 (253) = happyShift action_40 action_19 (254) = happyShift action_41 action_19 (261) = happyShift action_45 action_19 (265) = happyShift action_46 action_19 (269) = happyShift action_47 action_19 (270) = happyShift action_48 action_19 (272) = happyShift action_49 action_19 (273) = happyShift action_50 action_19 (274) = happyShift action_51 action_19 (275) = happyShift action_52 action_19 (276) = happyShift action_53 action_19 (277) = happyShift action_54 action_19 (278) = happyShift action_55 action_19 (279) = happyShift action_56 action_19 (280) = happyShift action_57 action_19 (281) = happyShift action_58 action_19 (282) = happyShift action_59 action_19 (283) = happyShift action_60 action_19 (284) = happyShift action_61 action_19 (286) = happyShift action_62 action_19 (294) = happyShift action_66 action_19 (295) = happyShift action_67 action_19 (296) = happyShift action_68 action_19 (311) = happyShift action_69 action_19 (317) = happyShift action_70 action_19 (320) = happyShift action_71 action_19 (332) = happyShift action_72 action_19 (334) = happyShift action_73 action_19 (336) = happyShift action_112 action_19 (338) = happyShift action_75 action_19 (340) = happyShift action_76 action_19 (345) = happyShift action_77 action_19 (346) = happyShift action_78 action_19 (347) = happyShift action_79 action_19 (350) = happyShift action_80 action_19 (351) = happyShift action_81 action_19 (354) = happyShift action_82 action_19 (355) = happyShift action_83 action_19 (356) = happyShift action_84 action_19 (357) = happyShift action_85 action_19 (358) = happyShift action_86 action_19 (359) = happyShift action_87 action_19 (360) = happyShift action_88 action_19 (361) = happyShift action_89 action_19 (362) = happyShift action_90 action_19 (363) = happyShift action_91 action_19 (364) = happyShift action_92 action_19 (365) = happyShift action_93 action_19 (366) = happyShift action_94 action_19 (371) = happyShift action_95 action_19 (372) = happyShift action_96 action_19 (373) = happyShift action_97 action_19 (374) = happyShift action_98 action_19 (376) = happyShift action_99 action_19 (377) = happyShift action_100 action_19 (378) = happyShift action_101 action_19 (379) = happyShift action_102 action_19 (380) = happyShift action_103 action_19 (38) = happyGoto action_13 action_19 (142) = happyGoto action_16 action_19 (143) = happyGoto action_368 action_19 (144) = happyGoto action_110 action_19 (145) = happyGoto action_18 action_19 (147) = happyGoto action_19 action_19 (148) = happyGoto action_20 action_19 (149) = happyGoto action_21 action_19 (150) = happyGoto action_22 action_19 (151) = happyGoto action_23 action_19 (152) = happyGoto action_24 action_19 (192) = happyGoto action_25 action_19 (195) = happyGoto action_26 action_19 (198) = happyGoto action_27 action_19 (219) = happyGoto action_29 action_19 (220) = happyGoto action_30 action_19 (221) = happyGoto action_111 action_19 (227) = happyGoto action_32 action_19 (229) = happyGoto action_33 action_19 (230) = happyGoto action_34 action_19 (233) = happyGoto action_35 action_19 _ = happyFail action_20 (244) = happyShift action_36 action_20 (245) = happyShift action_37 action_20 (246) = happyShift action_38 action_20 (251) = happyShift action_39 action_20 (253) = happyShift action_40 action_20 (254) = happyShift action_41 action_20 (261) = happyShift action_45 action_20 (265) = happyShift action_46 action_20 (269) = happyShift action_47 action_20 (270) = happyShift action_48 action_20 (272) = happyShift action_49 action_20 (273) = happyShift action_50 action_20 (274) = happyShift action_51 action_20 (275) = happyShift action_52 action_20 (276) = happyShift action_53 action_20 (277) = happyShift action_54 action_20 (278) = happyShift action_55 action_20 (279) = happyShift action_56 action_20 (280) = happyShift action_57 action_20 (281) = happyShift action_58 action_20 (282) = happyShift action_59 action_20 (283) = happyShift action_60 action_20 (284) = happyShift action_61 action_20 (286) = happyShift action_62 action_20 (294) = happyShift action_66 action_20 (295) = happyShift action_67 action_20 (296) = happyShift action_68 action_20 (311) = happyShift action_69 action_20 (317) = happyShift action_70 action_20 (320) = happyShift action_71 action_20 (332) = happyShift action_72 action_20 (334) = happyShift action_73 action_20 (336) = happyShift action_112 action_20 (338) = happyShift action_75 action_20 (340) = happyShift action_76 action_20 (345) = happyShift action_77 action_20 (346) = happyShift action_78 action_20 (347) = happyShift action_79 action_20 (350) = happyShift action_80 action_20 (351) = happyShift action_81 action_20 (354) = happyShift action_82 action_20 (355) = happyShift action_83 action_20 (356) = happyShift action_84 action_20 (357) = happyShift action_85 action_20 (358) = happyShift action_86 action_20 (359) = happyShift action_87 action_20 (360) = happyShift action_88 action_20 (361) = happyShift action_89 action_20 (362) = happyShift action_90 action_20 (363) = happyShift action_91 action_20 (364) = happyShift action_92 action_20 (365) = happyShift action_93 action_20 (366) = happyShift action_94 action_20 (371) = happyShift action_95 action_20 (372) = happyShift action_96 action_20 (373) = happyShift action_97 action_20 (374) = happyShift action_98 action_20 (376) = happyShift action_99 action_20 (377) = happyShift action_100 action_20 (378) = happyShift action_101 action_20 (379) = happyShift action_102 action_20 (380) = happyShift action_103 action_20 (38) = happyGoto action_13 action_20 (142) = happyGoto action_16 action_20 (143) = happyGoto action_367 action_20 (144) = happyGoto action_110 action_20 (145) = happyGoto action_18 action_20 (147) = happyGoto action_19 action_20 (148) = happyGoto action_20 action_20 (149) = happyGoto action_21 action_20 (150) = happyGoto action_22 action_20 (151) = happyGoto action_23 action_20 (152) = happyGoto action_24 action_20 (192) = happyGoto action_25 action_20 (195) = happyGoto action_26 action_20 (198) = happyGoto action_27 action_20 (219) = happyGoto action_29 action_20 (220) = happyGoto action_30 action_20 (221) = happyGoto action_111 action_20 (227) = happyGoto action_32 action_20 (229) = happyGoto action_33 action_20 (230) = happyGoto action_34 action_20 (233) = happyGoto action_35 action_20 _ = happyFail action_21 (244) = happyShift action_36 action_21 (245) = happyShift action_37 action_21 (253) = happyShift action_40 action_21 (265) = happyShift action_46 action_21 (270) = happyShift action_48 action_21 (272) = happyShift action_49 action_21 (273) = happyShift action_50 action_21 (274) = happyShift action_51 action_21 (275) = happyShift action_52 action_21 (276) = happyShift action_53 action_21 (277) = happyShift action_54 action_21 (279) = happyShift action_56 action_21 (280) = happyShift action_57 action_21 (281) = happyShift action_58 action_21 (282) = happyShift action_59 action_21 (283) = happyShift action_60 action_21 (286) = happyShift action_62 action_21 (317) = happyShift action_70 action_21 (332) = happyShift action_72 action_21 (334) = happyShift action_73 action_21 (336) = happyShift action_112 action_21 (338) = happyShift action_75 action_21 (340) = happyShift action_76 action_21 (345) = happyShift action_77 action_21 (346) = happyShift action_78 action_21 (347) = happyShift action_79 action_21 (350) = happyShift action_80 action_21 (351) = happyShift action_81 action_21 (354) = happyShift action_82 action_21 (355) = happyShift action_83 action_21 (356) = happyShift action_84 action_21 (357) = happyShift action_85 action_21 (358) = happyShift action_86 action_21 (359) = happyShift action_87 action_21 (360) = happyShift action_88 action_21 (361) = happyShift action_89 action_21 (362) = happyShift action_90 action_21 (363) = happyShift action_91 action_21 (364) = happyShift action_92 action_21 (365) = happyShift action_93 action_21 (366) = happyShift action_94 action_21 (371) = happyShift action_95 action_21 (372) = happyShift action_96 action_21 (373) = happyShift action_97 action_21 (374) = happyShift action_98 action_21 (376) = happyShift action_99 action_21 (377) = happyShift action_100 action_21 (378) = happyShift action_101 action_21 (379) = happyShift action_102 action_21 (380) = happyShift action_103 action_21 (38) = happyGoto action_13 action_21 (142) = happyGoto action_16 action_21 (150) = happyGoto action_366 action_21 (151) = happyGoto action_23 action_21 (152) = happyGoto action_24 action_21 (192) = happyGoto action_25 action_21 (195) = happyGoto action_26 action_21 (198) = happyGoto action_27 action_21 (219) = happyGoto action_29 action_21 (220) = happyGoto action_30 action_21 (221) = happyGoto action_111 action_21 (227) = happyGoto action_32 action_21 (229) = happyGoto action_33 action_21 (230) = happyGoto action_34 action_21 (233) = happyGoto action_35 action_21 _ = happyReduce_385 action_22 _ = happyReduce_393 action_23 (328) = happyShift action_365 action_23 _ = happyReduce_396 action_24 _ = happyReduce_398 action_25 _ = happyReduce_399 action_26 _ = happyReduce_64 action_27 _ = happyReduce_521 action_28 (343) = happyShift action_364 action_28 _ = happyFail action_29 (316) = happyShift action_363 action_29 _ = happyReduce_63 action_30 _ = happyReduce_583 action_31 (343) = happyReduce_581 action_31 _ = happyReduce_586 action_32 _ = happyReduce_590 action_33 _ = happyReduce_519 action_34 _ = happyReduce_619 action_35 _ = happyReduce_401 action_36 _ = happyReduce_410 action_37 _ = happyReduce_605 action_38 (244) = happyShift action_36 action_38 (245) = happyShift action_37 action_38 (246) = happyShift action_38 action_38 (251) = happyShift action_39 action_38 (253) = happyShift action_40 action_38 (254) = happyShift action_41 action_38 (261) = happyShift action_45 action_38 (265) = happyShift action_46 action_38 (269) = happyShift action_47 action_38 (270) = happyShift action_48 action_38 (272) = happyShift action_49 action_38 (273) = happyShift action_50 action_38 (274) = happyShift action_51 action_38 (275) = happyShift action_52 action_38 (276) = happyShift action_53 action_38 (277) = happyShift action_54 action_38 (278) = happyShift action_55 action_38 (279) = happyShift action_56 action_38 (280) = happyShift action_57 action_38 (281) = happyShift action_58 action_38 (282) = happyShift action_59 action_38 (283) = happyShift action_60 action_38 (284) = happyShift action_61 action_38 (286) = happyShift action_62 action_38 (294) = happyShift action_66 action_38 (295) = happyShift action_67 action_38 (296) = happyShift action_68 action_38 (311) = happyShift action_69 action_38 (317) = happyShift action_70 action_38 (320) = happyShift action_71 action_38 (332) = happyShift action_72 action_38 (334) = happyShift action_73 action_38 (336) = happyShift action_112 action_38 (338) = happyShift action_75 action_38 (340) = happyShift action_76 action_38 (345) = happyShift action_77 action_38 (346) = happyShift action_78 action_38 (347) = happyShift action_79 action_38 (350) = happyShift action_80 action_38 (351) = happyShift action_81 action_38 (354) = happyShift action_82 action_38 (355) = happyShift action_83 action_38 (356) = happyShift action_84 action_38 (357) = happyShift action_85 action_38 (358) = happyShift action_86 action_38 (359) = happyShift action_87 action_38 (360) = happyShift action_88 action_38 (361) = happyShift action_89 action_38 (362) = happyShift action_90 action_38 (363) = happyShift action_91 action_38 (364) = happyShift action_92 action_38 (365) = happyShift action_93 action_38 (366) = happyShift action_94 action_38 (371) = happyShift action_95 action_38 (372) = happyShift action_96 action_38 (373) = happyShift action_97 action_38 (374) = happyShift action_98 action_38 (376) = happyShift action_99 action_38 (377) = happyShift action_100 action_38 (378) = happyShift action_101 action_38 (379) = happyShift action_102 action_38 (380) = happyShift action_103 action_38 (38) = happyGoto action_13 action_38 (142) = happyGoto action_16 action_38 (143) = happyGoto action_362 action_38 (144) = happyGoto action_110 action_38 (145) = happyGoto action_18 action_38 (147) = happyGoto action_19 action_38 (148) = happyGoto action_20 action_38 (149) = happyGoto action_21 action_38 (150) = happyGoto action_22 action_38 (151) = happyGoto action_23 action_38 (152) = happyGoto action_24 action_38 (192) = happyGoto action_25 action_38 (195) = happyGoto action_26 action_38 (198) = happyGoto action_27 action_38 (219) = happyGoto action_29 action_38 (220) = happyGoto action_30 action_38 (221) = happyGoto action_111 action_38 (227) = happyGoto action_32 action_38 (229) = happyGoto action_33 action_38 (230) = happyGoto action_34 action_38 (233) = happyGoto action_35 action_38 _ = happyFail action_39 (328) = happyShift action_166 action_39 (330) = happyShift action_167 action_39 (181) = happyGoto action_361 action_39 _ = happyFail action_40 _ = happyReduce_607 action_41 (244) = happyShift action_36 action_41 (245) = happyShift action_37 action_41 (246) = happyShift action_38 action_41 (251) = happyShift action_39 action_41 (253) = happyShift action_40 action_41 (254) = happyShift action_41 action_41 (261) = happyShift action_45 action_41 (265) = happyShift action_46 action_41 (269) = happyShift action_47 action_41 (270) = happyShift action_48 action_41 (272) = happyShift action_49 action_41 (273) = happyShift action_50 action_41 (274) = happyShift action_51 action_41 (275) = happyShift action_52 action_41 (276) = happyShift action_53 action_41 (277) = happyShift action_54 action_41 (278) = happyShift action_55 action_41 (279) = happyShift action_56 action_41 (280) = happyShift action_57 action_41 (281) = happyShift action_58 action_41 (282) = happyShift action_59 action_41 (283) = happyShift action_60 action_41 (284) = happyShift action_61 action_41 (286) = happyShift action_62 action_41 (294) = happyShift action_66 action_41 (295) = happyShift action_67 action_41 (296) = happyShift action_68 action_41 (311) = happyShift action_69 action_41 (313) = happyShift action_360 action_41 (317) = happyShift action_70 action_41 (320) = happyShift action_71 action_41 (332) = happyShift action_72 action_41 (334) = happyShift action_73 action_41 (336) = happyShift action_112 action_41 (338) = happyShift action_75 action_41 (340) = happyShift action_76 action_41 (345) = happyShift action_77 action_41 (346) = happyShift action_78 action_41 (347) = happyShift action_79 action_41 (350) = happyShift action_80 action_41 (351) = happyShift action_81 action_41 (354) = happyShift action_82 action_41 (355) = happyShift action_83 action_41 (356) = happyShift action_84 action_41 (357) = happyShift action_85 action_41 (358) = happyShift action_86 action_41 (359) = happyShift action_87 action_41 (360) = happyShift action_88 action_41 (361) = happyShift action_89 action_41 (362) = happyShift action_90 action_41 (363) = happyShift action_91 action_41 (364) = happyShift action_92 action_41 (365) = happyShift action_93 action_41 (366) = happyShift action_94 action_41 (371) = happyShift action_95 action_41 (372) = happyShift action_96 action_41 (373) = happyShift action_97 action_41 (374) = happyShift action_98 action_41 (376) = happyShift action_99 action_41 (377) = happyShift action_100 action_41 (378) = happyShift action_101 action_41 (379) = happyShift action_102 action_41 (380) = happyShift action_103 action_41 (38) = happyGoto action_13 action_41 (142) = happyGoto action_16 action_41 (143) = happyGoto action_357 action_41 (144) = happyGoto action_110 action_41 (145) = happyGoto action_18 action_41 (147) = happyGoto action_19 action_41 (148) = happyGoto action_20 action_41 (149) = happyGoto action_21 action_41 (150) = happyGoto action_22 action_41 (151) = happyGoto action_23 action_41 (152) = happyGoto action_24 action_41 (176) = happyGoto action_358 action_41 (177) = happyGoto action_359 action_41 (192) = happyGoto action_25 action_41 (195) = happyGoto action_26 action_41 (198) = happyGoto action_27 action_41 (219) = happyGoto action_29 action_41 (220) = happyGoto action_30 action_41 (221) = happyGoto action_111 action_41 (227) = happyGoto action_32 action_41 (229) = happyGoto action_33 action_41 (230) = happyGoto action_34 action_41 (233) = happyGoto action_35 action_41 _ = happyFail action_42 _ = happyReduce_86 action_43 _ = happyReduce_87 action_44 _ = happyReduce_88 action_45 (328) = happyShift action_170 action_45 (330) = happyShift action_171 action_45 (72) = happyGoto action_168 action_45 (73) = happyGoto action_356 action_45 _ = happyFail action_46 _ = happyReduce_606 action_47 (358) = happyShift action_355 action_47 _ = happyFail action_48 _ = happyReduce_594 action_49 _ = happyReduce_608 action_50 _ = happyReduce_609 action_51 _ = happyReduce_610 action_52 _ = happyReduce_592 action_53 _ = happyReduce_593 action_54 _ = happyReduce_591 action_55 (328) = happyShift action_166 action_55 (330) = happyShift action_167 action_55 (181) = happyGoto action_354 action_55 _ = happyFail action_56 _ = happyReduce_595 action_57 _ = happyReduce_611 action_58 _ = happyReduce_612 action_59 _ = happyReduce_613 action_60 _ = happyReduce_614 action_61 (244) = happyShift action_36 action_61 (245) = happyShift action_37 action_61 (253) = happyShift action_40 action_61 (265) = happyShift action_46 action_61 (270) = happyShift action_48 action_61 (272) = happyShift action_49 action_61 (273) = happyShift action_50 action_61 (274) = happyShift action_51 action_61 (275) = happyShift action_52 action_61 (276) = happyShift action_53 action_61 (277) = happyShift action_54 action_61 (279) = happyShift action_56 action_61 (280) = happyShift action_57 action_61 (281) = happyShift action_58 action_61 (282) = happyShift action_59 action_61 (283) = happyShift action_60 action_61 (286) = happyShift action_62 action_61 (317) = happyShift action_70 action_61 (332) = happyShift action_72 action_61 (334) = happyShift action_73 action_61 (336) = happyShift action_112 action_61 (338) = happyShift action_75 action_61 (340) = happyShift action_76 action_61 (345) = happyShift action_77 action_61 (346) = happyShift action_78 action_61 (347) = happyShift action_79 action_61 (350) = happyShift action_80 action_61 (351) = happyShift action_81 action_61 (354) = happyShift action_82 action_61 (355) = happyShift action_83 action_61 (356) = happyShift action_84 action_61 (357) = happyShift action_85 action_61 (358) = happyShift action_86 action_61 (359) = happyShift action_87 action_61 (360) = happyShift action_88 action_61 (361) = happyShift action_89 action_61 (362) = happyShift action_90 action_61 (363) = happyShift action_91 action_61 (364) = happyShift action_92 action_61 (365) = happyShift action_93 action_61 (366) = happyShift action_94 action_61 (371) = happyShift action_95 action_61 (372) = happyShift action_96 action_61 (373) = happyShift action_97 action_61 (374) = happyShift action_98 action_61 (376) = happyShift action_99 action_61 (377) = happyShift action_100 action_61 (378) = happyShift action_101 action_61 (379) = happyShift action_102 action_61 (380) = happyShift action_103 action_61 (38) = happyGoto action_13 action_61 (142) = happyGoto action_16 action_61 (150) = happyGoto action_353 action_61 (151) = happyGoto action_23 action_61 (152) = happyGoto action_24 action_61 (192) = happyGoto action_25 action_61 (195) = happyGoto action_26 action_61 (198) = happyGoto action_27 action_61 (219) = happyGoto action_29 action_61 (220) = happyGoto action_30 action_61 (221) = happyGoto action_111 action_61 (227) = happyGoto action_32 action_61 (229) = happyGoto action_33 action_61 (230) = happyGoto action_34 action_61 (233) = happyGoto action_35 action_61 _ = happyFail action_62 _ = happyReduce_615 action_63 (332) = happyShift action_349 action_63 (77) = happyGoto action_352 action_63 (78) = happyGoto action_348 action_63 _ = happyReduce_177 action_64 (260) = happyShift action_351 action_64 (332) = happyShift action_349 action_64 (77) = happyGoto action_350 action_64 (78) = happyGoto action_348 action_64 _ = happyReduce_177 action_65 (332) = happyShift action_349 action_65 (77) = happyGoto action_347 action_65 (78) = happyGoto action_348 action_65 _ = happyReduce_177 action_66 (358) = happyShift action_346 action_66 _ = happyFail action_67 (346) = happyShift action_344 action_67 (358) = happyShift action_345 action_67 _ = happyFail action_68 (358) = happyShift action_343 action_68 _ = happyFail action_69 (244) = happyShift action_36 action_69 (245) = happyShift action_37 action_69 (253) = happyShift action_40 action_69 (265) = happyShift action_46 action_69 (270) = happyShift action_48 action_69 (272) = happyShift action_49 action_69 (273) = happyShift action_50 action_69 (274) = happyShift action_51 action_69 (275) = happyShift action_52 action_69 (276) = happyShift action_53 action_69 (277) = happyShift action_54 action_69 (279) = happyShift action_56 action_69 (280) = happyShift action_57 action_69 (281) = happyShift action_58 action_69 (282) = happyShift action_59 action_69 (283) = happyShift action_60 action_69 (286) = happyShift action_62 action_69 (312) = happyShift action_341 action_69 (317) = happyShift action_70 action_69 (321) = happyShift action_342 action_69 (332) = happyShift action_72 action_69 (334) = happyShift action_73 action_69 (336) = happyShift action_112 action_69 (338) = happyShift action_75 action_69 (340) = happyShift action_76 action_69 (345) = happyShift action_77 action_69 (346) = happyShift action_78 action_69 (347) = happyShift action_79 action_69 (350) = happyShift action_80 action_69 (351) = happyShift action_81 action_69 (354) = happyShift action_82 action_69 (355) = happyShift action_83 action_69 (356) = happyShift action_84 action_69 (357) = happyShift action_85 action_69 (358) = happyShift action_86 action_69 (359) = happyShift action_87 action_69 (360) = happyShift action_88 action_69 (361) = happyShift action_89 action_69 (362) = happyShift action_90 action_69 (363) = happyShift action_91 action_69 (364) = happyShift action_92 action_69 (365) = happyShift action_93 action_69 (366) = happyShift action_94 action_69 (371) = happyShift action_95 action_69 (372) = happyShift action_96 action_69 (373) = happyShift action_97 action_69 (374) = happyShift action_98 action_69 (376) = happyShift action_99 action_69 (377) = happyShift action_100 action_69 (378) = happyShift action_101 action_69 (379) = happyShift action_102 action_69 (380) = happyShift action_103 action_69 (38) = happyGoto action_13 action_69 (142) = happyGoto action_16 action_69 (150) = happyGoto action_339 action_69 (151) = happyGoto action_23 action_69 (152) = happyGoto action_24 action_69 (179) = happyGoto action_340 action_69 (192) = happyGoto action_25 action_69 (195) = happyGoto action_26 action_69 (198) = happyGoto action_27 action_69 (219) = happyGoto action_29 action_69 (220) = happyGoto action_30 action_69 (221) = happyGoto action_111 action_69 (227) = happyGoto action_32 action_69 (229) = happyGoto action_33 action_69 (230) = happyGoto action_34 action_69 (233) = happyGoto action_35 action_69 _ = happyFail action_70 (244) = happyShift action_36 action_70 (245) = happyShift action_37 action_70 (253) = happyShift action_40 action_70 (265) = happyShift action_46 action_70 (270) = happyShift action_48 action_70 (272) = happyShift action_49 action_70 (273) = happyShift action_50 action_70 (274) = happyShift action_51 action_70 (275) = happyShift action_52 action_70 (276) = happyShift action_53 action_70 (277) = happyShift action_54 action_70 (279) = happyShift action_56 action_70 (280) = happyShift action_57 action_70 (281) = happyShift action_58 action_70 (282) = happyShift action_59 action_70 (283) = happyShift action_60 action_70 (286) = happyShift action_62 action_70 (317) = happyShift action_70 action_70 (332) = happyShift action_72 action_70 (334) = happyShift action_73 action_70 (336) = happyShift action_112 action_70 (338) = happyShift action_75 action_70 (340) = happyShift action_76 action_70 (345) = happyShift action_77 action_70 (346) = happyShift action_78 action_70 (347) = happyShift action_79 action_70 (350) = happyShift action_80 action_70 (351) = happyShift action_81 action_70 (354) = happyShift action_82 action_70 (355) = happyShift action_83 action_70 (356) = happyShift action_84 action_70 (357) = happyShift action_85 action_70 (358) = happyShift action_86 action_70 (359) = happyShift action_87 action_70 (360) = happyShift action_88 action_70 (361) = happyShift action_89 action_70 (362) = happyShift action_90 action_70 (363) = happyShift action_91 action_70 (364) = happyShift action_92 action_70 (365) = happyShift action_93 action_70 (366) = happyShift action_94 action_70 (371) = happyShift action_95 action_70 (372) = happyShift action_96 action_70 (373) = happyShift action_97 action_70 (374) = happyShift action_98 action_70 (376) = happyShift action_99 action_70 (377) = happyShift action_100 action_70 (378) = happyShift action_101 action_70 (379) = happyShift action_102 action_70 (380) = happyShift action_103 action_70 (38) = happyGoto action_13 action_70 (142) = happyGoto action_16 action_70 (150) = happyGoto action_338 action_70 (151) = happyGoto action_23 action_70 (152) = happyGoto action_24 action_70 (192) = happyGoto action_25 action_70 (195) = happyGoto action_26 action_70 (198) = happyGoto action_27 action_70 (219) = happyGoto action_29 action_70 (220) = happyGoto action_30 action_70 (221) = happyGoto action_111 action_70 (227) = happyGoto action_32 action_70 (229) = happyGoto action_33 action_70 (230) = happyGoto action_34 action_70 (233) = happyGoto action_35 action_70 _ = happyFail action_71 (244) = happyShift action_36 action_71 (245) = happyShift action_37 action_71 (253) = happyShift action_40 action_71 (265) = happyShift action_46 action_71 (270) = happyShift action_48 action_71 (272) = happyShift action_49 action_71 (273) = happyShift action_50 action_71 (274) = happyShift action_51 action_71 (275) = happyShift action_52 action_71 (276) = happyShift action_53 action_71 (277) = happyShift action_54 action_71 (279) = happyShift action_56 action_71 (280) = happyShift action_57 action_71 (281) = happyShift action_58 action_71 (282) = happyShift action_59 action_71 (283) = happyShift action_60 action_71 (286) = happyShift action_62 action_71 (317) = happyShift action_70 action_71 (332) = happyShift action_72 action_71 (334) = happyShift action_73 action_71 (336) = happyShift action_112 action_71 (338) = happyShift action_75 action_71 (340) = happyShift action_76 action_71 (345) = happyShift action_77 action_71 (346) = happyShift action_78 action_71 (347) = happyShift action_79 action_71 (350) = happyShift action_80 action_71 (351) = happyShift action_81 action_71 (354) = happyShift action_82 action_71 (355) = happyShift action_83 action_71 (356) = happyShift action_84 action_71 (357) = happyShift action_85 action_71 (358) = happyShift action_86 action_71 (359) = happyShift action_87 action_71 (360) = happyShift action_88 action_71 (361) = happyShift action_89 action_71 (362) = happyShift action_90 action_71 (363) = happyShift action_91 action_71 (364) = happyShift action_92 action_71 (365) = happyShift action_93 action_71 (366) = happyShift action_94 action_71 (371) = happyShift action_95 action_71 (372) = happyShift action_96 action_71 (373) = happyShift action_97 action_71 (374) = happyShift action_98 action_71 (376) = happyShift action_99 action_71 (377) = happyShift action_100 action_71 (378) = happyShift action_101 action_71 (379) = happyShift action_102 action_71 (380) = happyShift action_103 action_71 (38) = happyGoto action_13 action_71 (142) = happyGoto action_16 action_71 (149) = happyGoto action_337 action_71 (150) = happyGoto action_22 action_71 (151) = happyGoto action_23 action_71 (152) = happyGoto action_24 action_71 (192) = happyGoto action_25 action_71 (195) = happyGoto action_26 action_71 (198) = happyGoto action_27 action_71 (219) = happyGoto action_29 action_71 (220) = happyGoto action_30 action_71 (221) = happyGoto action_111 action_71 (227) = happyGoto action_32 action_71 (229) = happyGoto action_33 action_71 (230) = happyGoto action_34 action_71 (233) = happyGoto action_35 action_71 _ = happyFail action_72 (244) = happyShift action_36 action_72 (245) = happyShift action_37 action_72 (246) = happyShift action_38 action_72 (251) = happyShift action_39 action_72 (253) = happyShift action_40 action_72 (254) = happyShift action_41 action_72 (261) = happyShift action_45 action_72 (265) = happyShift action_46 action_72 (269) = happyShift action_47 action_72 (270) = happyShift action_48 action_72 (272) = happyShift action_49 action_72 (273) = happyShift action_50 action_72 (274) = happyShift action_51 action_72 (275) = happyShift action_52 action_72 (276) = happyShift action_53 action_72 (277) = happyShift action_54 action_72 (278) = happyShift action_55 action_72 (279) = happyShift action_56 action_72 (280) = happyShift action_57 action_72 (281) = happyShift action_58 action_72 (282) = happyShift action_59 action_72 (283) = happyShift action_60 action_72 (284) = happyShift action_61 action_72 (286) = happyShift action_62 action_72 (294) = happyShift action_66 action_72 (295) = happyShift action_67 action_72 (296) = happyShift action_68 action_72 (308) = happyShift action_267 action_72 (311) = happyShift action_69 action_72 (317) = happyShift action_70 action_72 (320) = happyShift action_71 action_72 (321) = happyShift action_270 action_72 (322) = happyShift action_271 action_72 (327) = happyShift action_272 action_72 (332) = happyShift action_72 action_72 (333) = happyShift action_336 action_72 (334) = happyShift action_73 action_72 (336) = happyShift action_112 action_72 (338) = happyShift action_75 action_72 (340) = happyShift action_76 action_72 (344) = happyShift action_297 action_72 (345) = happyShift action_77 action_72 (346) = happyShift action_78 action_72 (347) = happyShift action_79 action_72 (348) = happyShift action_274 action_72 (349) = happyShift action_275 action_72 (350) = happyShift action_80 action_72 (351) = happyShift action_81 action_72 (352) = happyShift action_276 action_72 (353) = happyShift action_277 action_72 (354) = happyShift action_82 action_72 (355) = happyShift action_83 action_72 (356) = happyShift action_84 action_72 (357) = happyShift action_85 action_72 (358) = happyShift action_86 action_72 (359) = happyShift action_87 action_72 (360) = happyShift action_88 action_72 (361) = happyShift action_89 action_72 (362) = happyShift action_90 action_72 (363) = happyShift action_91 action_72 (364) = happyShift action_92 action_72 (365) = happyShift action_93 action_72 (366) = happyShift action_94 action_72 (371) = happyShift action_95 action_72 (372) = happyShift action_96 action_72 (373) = happyShift action_97 action_72 (374) = happyShift action_98 action_72 (376) = happyShift action_99 action_72 (377) = happyShift action_100 action_72 (378) = happyShift action_101 action_72 (379) = happyShift action_102 action_72 (380) = happyShift action_103 action_72 (38) = happyGoto action_13 action_72 (142) = happyGoto action_16 action_72 (143) = happyGoto action_281 action_72 (144) = happyGoto action_282 action_72 (145) = happyGoto action_18 action_72 (147) = happyGoto action_19 action_72 (148) = happyGoto action_20 action_72 (149) = happyGoto action_21 action_72 (150) = happyGoto action_22 action_72 (151) = happyGoto action_23 action_72 (152) = happyGoto action_24 action_72 (157) = happyGoto action_333 action_72 (161) = happyGoto action_334 action_72 (162) = happyGoto action_335 action_72 (192) = happyGoto action_25 action_72 (195) = happyGoto action_26 action_72 (198) = happyGoto action_27 action_72 (200) = happyGoto action_285 action_72 (212) = happyGoto action_286 action_72 (214) = happyGoto action_287 action_72 (219) = happyGoto action_29 action_72 (220) = happyGoto action_30 action_72 (221) = happyGoto action_111 action_72 (223) = happyGoto action_288 action_72 (224) = happyGoto action_325 action_72 (226) = happyGoto action_326 action_72 (227) = happyGoto action_32 action_72 (228) = happyGoto action_264 action_72 (229) = happyGoto action_33 action_72 (230) = happyGoto action_34 action_72 (231) = happyGoto action_265 action_72 (232) = happyGoto action_266 action_72 (233) = happyGoto action_35 action_72 _ = happyFail action_73 (244) = happyShift action_36 action_73 (245) = happyShift action_37 action_73 (246) = happyShift action_38 action_73 (251) = happyShift action_39 action_73 (253) = happyShift action_40 action_73 (254) = happyShift action_41 action_73 (261) = happyShift action_45 action_73 (265) = happyShift action_46 action_73 (269) = happyShift action_47 action_73 (270) = happyShift action_48 action_73 (272) = happyShift action_49 action_73 (273) = happyShift action_50 action_73 (274) = happyShift action_51 action_73 (275) = happyShift action_52 action_73 (276) = happyShift action_53 action_73 (277) = happyShift action_54 action_73 (278) = happyShift action_55 action_73 (279) = happyShift action_56 action_73 (280) = happyShift action_57 action_73 (281) = happyShift action_58 action_73 (282) = happyShift action_59 action_73 (283) = happyShift action_60 action_73 (284) = happyShift action_61 action_73 (286) = happyShift action_62 action_73 (294) = happyShift action_66 action_73 (295) = happyShift action_67 action_73 (296) = happyShift action_68 action_73 (308) = happyShift action_267 action_73 (311) = happyShift action_69 action_73 (317) = happyShift action_70 action_73 (320) = happyShift action_71 action_73 (321) = happyShift action_270 action_73 (322) = happyShift action_271 action_73 (327) = happyShift action_272 action_73 (332) = happyShift action_72 action_73 (334) = happyShift action_73 action_73 (336) = happyShift action_112 action_73 (338) = happyShift action_75 action_73 (340) = happyShift action_76 action_73 (344) = happyShift action_297 action_73 (345) = happyShift action_77 action_73 (346) = happyShift action_78 action_73 (347) = happyShift action_79 action_73 (348) = happyShift action_274 action_73 (349) = happyShift action_275 action_73 (350) = happyShift action_80 action_73 (351) = happyShift action_81 action_73 (352) = happyShift action_276 action_73 (353) = happyShift action_277 action_73 (354) = happyShift action_82 action_73 (355) = happyShift action_83 action_73 (356) = happyShift action_84 action_73 (357) = happyShift action_85 action_73 (358) = happyShift action_86 action_73 (359) = happyShift action_87 action_73 (360) = happyShift action_88 action_73 (361) = happyShift action_89 action_73 (362) = happyShift action_90 action_73 (363) = happyShift action_91 action_73 (364) = happyShift action_92 action_73 (365) = happyShift action_93 action_73 (366) = happyShift action_94 action_73 (371) = happyShift action_95 action_73 (372) = happyShift action_96 action_73 (373) = happyShift action_97 action_73 (374) = happyShift action_98 action_73 (376) = happyShift action_99 action_73 (377) = happyShift action_100 action_73 (378) = happyShift action_101 action_73 (379) = happyShift action_102 action_73 (380) = happyShift action_103 action_73 (38) = happyGoto action_13 action_73 (142) = happyGoto action_16 action_73 (143) = happyGoto action_281 action_73 (144) = happyGoto action_282 action_73 (145) = happyGoto action_18 action_73 (147) = happyGoto action_19 action_73 (148) = happyGoto action_20 action_73 (149) = happyGoto action_21 action_73 (150) = happyGoto action_22 action_73 (151) = happyGoto action_23 action_73 (152) = happyGoto action_24 action_73 (157) = happyGoto action_330 action_73 (162) = happyGoto action_331 action_73 (167) = happyGoto action_332 action_73 (192) = happyGoto action_25 action_73 (195) = happyGoto action_26 action_73 (198) = happyGoto action_27 action_73 (200) = happyGoto action_285 action_73 (212) = happyGoto action_286 action_73 (214) = happyGoto action_287 action_73 (219) = happyGoto action_29 action_73 (220) = happyGoto action_30 action_73 (221) = happyGoto action_111 action_73 (223) = happyGoto action_288 action_73 (224) = happyGoto action_325 action_73 (226) = happyGoto action_326 action_73 (227) = happyGoto action_32 action_73 (228) = happyGoto action_264 action_73 (229) = happyGoto action_33 action_73 (230) = happyGoto action_34 action_73 (231) = happyGoto action_265 action_73 (232) = happyGoto action_266 action_73 (233) = happyGoto action_35 action_73 _ = happyReduce_460 action_74 (244) = happyShift action_36 action_74 (245) = happyShift action_37 action_74 (246) = happyShift action_38 action_74 (251) = happyShift action_39 action_74 (253) = happyShift action_40 action_74 (254) = happyShift action_41 action_74 (261) = happyShift action_45 action_74 (265) = happyShift action_46 action_74 (269) = happyShift action_47 action_74 (270) = happyShift action_48 action_74 (272) = happyShift action_49 action_74 (273) = happyShift action_50 action_74 (274) = happyShift action_51 action_74 (275) = happyShift action_52 action_74 (276) = happyShift action_53 action_74 (277) = happyShift action_54 action_74 (278) = happyShift action_55 action_74 (279) = happyShift action_56 action_74 (280) = happyShift action_57 action_74 (281) = happyShift action_58 action_74 (282) = happyShift action_59 action_74 (283) = happyShift action_60 action_74 (284) = happyShift action_61 action_74 (286) = happyShift action_62 action_74 (294) = happyShift action_66 action_74 (295) = happyShift action_67 action_74 (296) = happyShift action_68 action_74 (308) = happyShift action_267 action_74 (311) = happyShift action_69 action_74 (317) = happyShift action_70 action_74 (320) = happyShift action_294 action_74 (321) = happyShift action_270 action_74 (322) = happyShift action_271 action_74 (327) = happyShift action_272 action_74 (332) = happyShift action_72 action_74 (334) = happyShift action_73 action_74 (336) = happyShift action_112 action_74 (337) = happyShift action_295 action_74 (338) = happyShift action_75 action_74 (340) = happyShift action_76 action_74 (343) = happyShift action_296 action_74 (344) = happyShift action_297 action_74 (345) = happyShift action_77 action_74 (346) = happyShift action_78 action_74 (347) = happyShift action_79 action_74 (348) = happyShift action_274 action_74 (349) = happyShift action_275 action_74 (350) = happyShift action_80 action_74 (351) = happyShift action_81 action_74 (352) = happyShift action_276 action_74 (353) = happyShift action_277 action_74 (354) = happyShift action_82 action_74 (355) = happyShift action_83 action_74 (356) = happyShift action_84 action_74 (357) = happyShift action_85 action_74 (358) = happyShift action_86 action_74 (359) = happyShift action_87 action_74 (360) = happyShift action_88 action_74 (361) = happyShift action_89 action_74 (362) = happyShift action_90 action_74 (363) = happyShift action_91 action_74 (364) = happyShift action_92 action_74 (365) = happyShift action_93 action_74 (366) = happyShift action_94 action_74 (371) = happyShift action_95 action_74 (372) = happyShift action_96 action_74 (373) = happyShift action_97 action_74 (374) = happyShift action_98 action_74 (376) = happyShift action_99 action_74 (377) = happyShift action_100 action_74 (378) = happyShift action_101 action_74 (379) = happyShift action_102 action_74 (380) = happyShift action_103 action_74 (38) = happyGoto action_13 action_74 (142) = happyGoto action_16 action_74 (143) = happyGoto action_281 action_74 (144) = happyGoto action_282 action_74 (145) = happyGoto action_18 action_74 (147) = happyGoto action_19 action_74 (148) = happyGoto action_20 action_74 (149) = happyGoto action_21 action_74 (150) = happyGoto action_22 action_74 (151) = happyGoto action_23 action_74 (152) = happyGoto action_24 action_74 (157) = happyGoto action_283 action_74 (158) = happyGoto action_284 action_74 (192) = happyGoto action_25 action_74 (195) = happyGoto action_26 action_74 (198) = happyGoto action_27 action_74 (200) = happyGoto action_285 action_74 (212) = happyGoto action_286 action_74 (214) = happyGoto action_287 action_74 (219) = happyGoto action_29 action_74 (220) = happyGoto action_30 action_74 (221) = happyGoto action_111 action_74 (223) = happyGoto action_288 action_74 (224) = happyGoto action_289 action_74 (225) = happyGoto action_329 action_74 (226) = happyGoto action_291 action_74 (227) = happyGoto action_32 action_74 (228) = happyGoto action_264 action_74 (229) = happyGoto action_33 action_74 (230) = happyGoto action_34 action_74 (231) = happyGoto action_292 action_74 (232) = happyGoto action_266 action_74 (233) = happyGoto action_35 action_74 (236) = happyGoto action_293 action_74 _ = happyFail action_75 (244) = happyShift action_36 action_75 (245) = happyShift action_37 action_75 (246) = happyShift action_38 action_75 (251) = happyShift action_39 action_75 (253) = happyShift action_40 action_75 (254) = happyShift action_41 action_75 (261) = happyShift action_45 action_75 (265) = happyShift action_46 action_75 (269) = happyShift action_47 action_75 (270) = happyShift action_48 action_75 (272) = happyShift action_49 action_75 (273) = happyShift action_50 action_75 (274) = happyShift action_51 action_75 (275) = happyShift action_52 action_75 (276) = happyShift action_53 action_75 (277) = happyShift action_54 action_75 (278) = happyShift action_55 action_75 (279) = happyShift action_56 action_75 (280) = happyShift action_57 action_75 (281) = happyShift action_58 action_75 (282) = happyShift action_59 action_75 (283) = happyShift action_60 action_75 (284) = happyShift action_61 action_75 (286) = happyShift action_62 action_75 (294) = happyShift action_66 action_75 (295) = happyShift action_67 action_75 (296) = happyShift action_68 action_75 (308) = happyShift action_267 action_75 (311) = happyShift action_69 action_75 (317) = happyShift action_70 action_75 (320) = happyShift action_71 action_75 (321) = happyShift action_270 action_75 (322) = happyShift action_271 action_75 (327) = happyShift action_272 action_75 (332) = happyShift action_72 action_75 (334) = happyShift action_73 action_75 (336) = happyShift action_112 action_75 (338) = happyShift action_75 action_75 (339) = happyShift action_328 action_75 (340) = happyShift action_76 action_75 (343) = happyShift action_296 action_75 (344) = happyShift action_297 action_75 (345) = happyShift action_77 action_75 (346) = happyShift action_78 action_75 (347) = happyShift action_79 action_75 (348) = happyShift action_274 action_75 (349) = happyShift action_275 action_75 (350) = happyShift action_80 action_75 (351) = happyShift action_81 action_75 (352) = happyShift action_276 action_75 (353) = happyShift action_277 action_75 (354) = happyShift action_82 action_75 (355) = happyShift action_83 action_75 (356) = happyShift action_84 action_75 (357) = happyShift action_85 action_75 (358) = happyShift action_86 action_75 (359) = happyShift action_87 action_75 (360) = happyShift action_88 action_75 (361) = happyShift action_89 action_75 (362) = happyShift action_90 action_75 (363) = happyShift action_91 action_75 (364) = happyShift action_92 action_75 (365) = happyShift action_93 action_75 (366) = happyShift action_94 action_75 (371) = happyShift action_95 action_75 (372) = happyShift action_96 action_75 (373) = happyShift action_97 action_75 (374) = happyShift action_98 action_75 (376) = happyShift action_99 action_75 (377) = happyShift action_100 action_75 (378) = happyShift action_101 action_75 (379) = happyShift action_102 action_75 (380) = happyShift action_103 action_75 (38) = happyGoto action_13 action_75 (142) = happyGoto action_16 action_75 (143) = happyGoto action_281 action_75 (144) = happyGoto action_282 action_75 (145) = happyGoto action_18 action_75 (147) = happyGoto action_19 action_75 (148) = happyGoto action_20 action_75 (149) = happyGoto action_21 action_75 (150) = happyGoto action_22 action_75 (151) = happyGoto action_23 action_75 (152) = happyGoto action_24 action_75 (157) = happyGoto action_323 action_75 (158) = happyGoto action_324 action_75 (192) = happyGoto action_25 action_75 (195) = happyGoto action_26 action_75 (198) = happyGoto action_27 action_75 (200) = happyGoto action_285 action_75 (212) = happyGoto action_286 action_75 (214) = happyGoto action_287 action_75 (219) = happyGoto action_29 action_75 (220) = happyGoto action_30 action_75 (221) = happyGoto action_111 action_75 (223) = happyGoto action_288 action_75 (224) = happyGoto action_325 action_75 (226) = happyGoto action_326 action_75 (227) = happyGoto action_32 action_75 (228) = happyGoto action_264 action_75 (229) = happyGoto action_33 action_75 (230) = happyGoto action_34 action_75 (231) = happyGoto action_265 action_75 (232) = happyGoto action_266 action_75 (233) = happyGoto action_35 action_75 (236) = happyGoto action_327 action_75 _ = happyFail action_76 (244) = happyShift action_36 action_76 (245) = happyShift action_37 action_76 (253) = happyShift action_40 action_76 (265) = happyShift action_46 action_76 (270) = happyShift action_48 action_76 (272) = happyShift action_49 action_76 (273) = happyShift action_50 action_76 (274) = happyShift action_51 action_76 (275) = happyShift action_52 action_76 (276) = happyShift action_53 action_76 (277) = happyShift action_54 action_76 (279) = happyShift action_56 action_76 (280) = happyShift action_57 action_76 (281) = happyShift action_58 action_76 (282) = happyShift action_59 action_76 (283) = happyShift action_60 action_76 (286) = happyShift action_62 action_76 (332) = happyShift action_72 action_76 (334) = happyShift action_73 action_76 (336) = happyShift action_112 action_76 (338) = happyShift action_75 action_76 (340) = happyShift action_76 action_76 (345) = happyShift action_77 action_76 (346) = happyShift action_78 action_76 (347) = happyShift action_79 action_76 (350) = happyShift action_80 action_76 (351) = happyShift action_81 action_76 (354) = happyShift action_82 action_76 (355) = happyShift action_83 action_76 (356) = happyShift action_84 action_76 (357) = happyShift action_85 action_76 (358) = happyShift action_86 action_76 (359) = happyShift action_87 action_76 (360) = happyShift action_88 action_76 (361) = happyShift action_89 action_76 (362) = happyShift action_90 action_76 (363) = happyShift action_91 action_76 (364) = happyShift action_92 action_76 (365) = happyShift action_93 action_76 (366) = happyShift action_94 action_76 (371) = happyShift action_95 action_76 (372) = happyShift action_96 action_76 (373) = happyShift action_97 action_76 (374) = happyShift action_98 action_76 (376) = happyShift action_99 action_76 (377) = happyShift action_100 action_76 (378) = happyShift action_101 action_76 (379) = happyShift action_102 action_76 (380) = happyShift action_103 action_76 (38) = happyGoto action_13 action_76 (142) = happyGoto action_16 action_76 (152) = happyGoto action_321 action_76 (192) = happyGoto action_25 action_76 (195) = happyGoto action_26 action_76 (198) = happyGoto action_27 action_76 (219) = happyGoto action_322 action_76 (220) = happyGoto action_30 action_76 (221) = happyGoto action_111 action_76 (227) = happyGoto action_32 action_76 (229) = happyGoto action_33 action_76 (230) = happyGoto action_34 action_76 (233) = happyGoto action_35 action_76 _ = happyFail action_77 (245) = happyShift action_37 action_77 (253) = happyShift action_40 action_77 (265) = happyShift action_46 action_77 (270) = happyShift action_48 action_77 (272) = happyShift action_49 action_77 (273) = happyShift action_50 action_77 (274) = happyShift action_51 action_77 (275) = happyShift action_52 action_77 (276) = happyShift action_53 action_77 (277) = happyShift action_54 action_77 (279) = happyShift action_56 action_77 (280) = happyShift action_57 action_77 (281) = happyShift action_58 action_77 (282) = happyShift action_59 action_77 (283) = happyShift action_60 action_77 (286) = happyShift action_62 action_77 (332) = happyShift action_192 action_77 (336) = happyShift action_320 action_77 (338) = happyShift action_194 action_77 (346) = happyShift action_78 action_77 (347) = happyShift action_79 action_77 (350) = happyShift action_80 action_77 (351) = happyShift action_81 action_77 (354) = happyShift action_82 action_77 (355) = happyShift action_83 action_77 (195) = happyGoto action_318 action_77 (198) = happyGoto action_27 action_77 (219) = happyGoto action_319 action_77 (220) = happyGoto action_30 action_77 (221) = happyGoto action_111 action_77 (227) = happyGoto action_32 action_77 (229) = happyGoto action_33 action_77 (230) = happyGoto action_34 action_77 _ = happyFail action_78 _ = happyReduce_589 action_79 _ = happyReduce_622 action_80 _ = happyReduce_587 action_81 _ = happyReduce_620 action_82 _ = happyReduce_588 action_83 _ = happyReduce_621 action_84 _ = happyReduce_514 action_85 _ = happyReduce_627 action_86 _ = happyReduce_628 action_87 _ = happyReduce_402 action_88 _ = happyReduce_403 action_89 _ = happyReduce_631 action_90 _ = happyReduce_632 action_91 _ = happyReduce_629 action_92 _ = happyReduce_630 action_93 _ = happyReduce_633 action_94 _ = happyReduce_634 action_95 (244) = happyShift action_36 action_95 (245) = happyShift action_37 action_95 (246) = happyShift action_38 action_95 (251) = happyShift action_39 action_95 (253) = happyShift action_40 action_95 (254) = happyShift action_41 action_95 (261) = happyShift action_45 action_95 (265) = happyShift action_46 action_95 (269) = happyShift action_47 action_95 (270) = happyShift action_48 action_95 (272) = happyShift action_49 action_95 (273) = happyShift action_50 action_95 (274) = happyShift action_51 action_95 (275) = happyShift action_52 action_95 (276) = happyShift action_53 action_95 (277) = happyShift action_54 action_95 (278) = happyShift action_55 action_95 (279) = happyShift action_56 action_95 (280) = happyShift action_57 action_95 (281) = happyShift action_58 action_95 (282) = happyShift action_59 action_95 (283) = happyShift action_60 action_95 (284) = happyShift action_61 action_95 (286) = happyShift action_62 action_95 (294) = happyShift action_66 action_95 (295) = happyShift action_67 action_95 (296) = happyShift action_68 action_95 (311) = happyShift action_69 action_95 (317) = happyShift action_70 action_95 (320) = happyShift action_71 action_95 (332) = happyShift action_72 action_95 (334) = happyShift action_73 action_95 (336) = happyShift action_112 action_95 (338) = happyShift action_75 action_95 (340) = happyShift action_76 action_95 (345) = happyShift action_77 action_95 (346) = happyShift action_78 action_95 (347) = happyShift action_79 action_95 (350) = happyShift action_80 action_95 (351) = happyShift action_81 action_95 (354) = happyShift action_82 action_95 (355) = happyShift action_83 action_95 (356) = happyShift action_84 action_95 (357) = happyShift action_85 action_95 (358) = happyShift action_86 action_95 (359) = happyShift action_87 action_95 (360) = happyShift action_88 action_95 (361) = happyShift action_89 action_95 (362) = happyShift action_90 action_95 (363) = happyShift action_91 action_95 (364) = happyShift action_92 action_95 (365) = happyShift action_93 action_95 (366) = happyShift action_94 action_95 (371) = happyShift action_95 action_95 (372) = happyShift action_96 action_95 (373) = happyShift action_97 action_95 (374) = happyShift action_98 action_95 (376) = happyShift action_99 action_95 (377) = happyShift action_100 action_95 (378) = happyShift action_101 action_95 (379) = happyShift action_102 action_95 (380) = happyShift action_103 action_95 (38) = happyGoto action_13 action_95 (142) = happyGoto action_16 action_95 (143) = happyGoto action_317 action_95 (144) = happyGoto action_110 action_95 (145) = happyGoto action_18 action_95 (147) = happyGoto action_19 action_95 (148) = happyGoto action_20 action_95 (149) = happyGoto action_21 action_95 (150) = happyGoto action_22 action_95 (151) = happyGoto action_23 action_95 (152) = happyGoto action_24 action_95 (192) = happyGoto action_25 action_95 (195) = happyGoto action_26 action_95 (198) = happyGoto action_27 action_95 (219) = happyGoto action_29 action_95 (220) = happyGoto action_30 action_95 (221) = happyGoto action_111 action_95 (227) = happyGoto action_32 action_95 (229) = happyGoto action_33 action_95 (230) = happyGoto action_34 action_95 (233) = happyGoto action_35 action_95 _ = happyFail action_96 (244) = happyShift action_36 action_96 (245) = happyShift action_37 action_96 (246) = happyShift action_38 action_96 (251) = happyShift action_39 action_96 (253) = happyShift action_40 action_96 (254) = happyShift action_41 action_96 (261) = happyShift action_45 action_96 (265) = happyShift action_46 action_96 (269) = happyShift action_47 action_96 (270) = happyShift action_48 action_96 (272) = happyShift action_49 action_96 (273) = happyShift action_50 action_96 (274) = happyShift action_51 action_96 (275) = happyShift action_52 action_96 (276) = happyShift action_53 action_96 (277) = happyShift action_54 action_96 (278) = happyShift action_55 action_96 (279) = happyShift action_56 action_96 (280) = happyShift action_57 action_96 (281) = happyShift action_58 action_96 (282) = happyShift action_59 action_96 (283) = happyShift action_60 action_96 (284) = happyShift action_61 action_96 (286) = happyShift action_62 action_96 (294) = happyShift action_66 action_96 (295) = happyShift action_67 action_96 (296) = happyShift action_68 action_96 (311) = happyShift action_69 action_96 (317) = happyShift action_70 action_96 (320) = happyShift action_71 action_96 (332) = happyShift action_72 action_96 (334) = happyShift action_73 action_96 (336) = happyShift action_112 action_96 (338) = happyShift action_75 action_96 (340) = happyShift action_76 action_96 (345) = happyShift action_77 action_96 (346) = happyShift action_78 action_96 (347) = happyShift action_79 action_96 (350) = happyShift action_80 action_96 (351) = happyShift action_81 action_96 (354) = happyShift action_82 action_96 (355) = happyShift action_83 action_96 (356) = happyShift action_84 action_96 (357) = happyShift action_85 action_96 (358) = happyShift action_86 action_96 (359) = happyShift action_87 action_96 (360) = happyShift action_88 action_96 (361) = happyShift action_89 action_96 (362) = happyShift action_90 action_96 (363) = happyShift action_91 action_96 (364) = happyShift action_92 action_96 (365) = happyShift action_93 action_96 (366) = happyShift action_94 action_96 (371) = happyShift action_95 action_96 (372) = happyShift action_96 action_96 (373) = happyShift action_97 action_96 (374) = happyShift action_98 action_96 (376) = happyShift action_99 action_96 (377) = happyShift action_100 action_96 (378) = happyShift action_101 action_96 (379) = happyShift action_102 action_96 (380) = happyShift action_103 action_96 (38) = happyGoto action_13 action_96 (142) = happyGoto action_16 action_96 (144) = happyGoto action_316 action_96 (145) = happyGoto action_18 action_96 (147) = happyGoto action_19 action_96 (148) = happyGoto action_20 action_96 (149) = happyGoto action_21 action_96 (150) = happyGoto action_22 action_96 (151) = happyGoto action_23 action_96 (152) = happyGoto action_24 action_96 (192) = happyGoto action_25 action_96 (195) = happyGoto action_26 action_96 (198) = happyGoto action_27 action_96 (219) = happyGoto action_29 action_96 (220) = happyGoto action_30 action_96 (221) = happyGoto action_111 action_96 (227) = happyGoto action_32 action_96 (229) = happyGoto action_33 action_96 (230) = happyGoto action_34 action_96 (233) = happyGoto action_35 action_96 _ = happyFail action_97 (245) = happyShift action_37 action_97 (253) = happyShift action_40 action_97 (265) = happyShift action_46 action_97 (270) = happyShift action_249 action_97 (272) = happyShift action_49 action_97 (273) = happyShift action_50 action_97 (274) = happyShift action_51 action_97 (275) = happyShift action_221 action_97 (276) = happyShift action_222 action_97 (277) = happyShift action_223 action_97 (280) = happyShift action_57 action_97 (281) = happyShift action_58 action_97 (282) = happyShift action_59 action_97 (283) = happyShift action_60 action_97 (286) = happyShift action_62 action_97 (299) = happyShift action_225 action_97 (300) = happyShift action_226 action_97 (321) = happyShift action_227 action_97 (328) = happyShift action_228 action_97 (332) = happyShift action_229 action_97 (334) = happyShift action_230 action_97 (336) = happyShift action_231 action_97 (338) = happyShift action_232 action_97 (345) = happyShift action_233 action_97 (346) = happyShift action_234 action_97 (347) = happyShift action_235 action_97 (351) = happyShift action_236 action_97 (355) = happyShift action_237 action_97 (356) = happyShift action_84 action_97 (358) = happyShift action_238 action_97 (359) = happyShift action_239 action_97 (376) = happyShift action_240 action_97 (377) = happyShift action_241 action_97 (379) = happyShift action_102 action_97 (380) = happyShift action_103 action_97 (100) = happyGoto action_208 action_97 (101) = happyGoto action_315 action_97 (103) = happyGoto action_244 action_97 (104) = happyGoto action_245 action_97 (106) = happyGoto action_246 action_97 (107) = happyGoto action_211 action_97 (142) = happyGoto action_212 action_97 (192) = happyGoto action_248 action_97 (202) = happyGoto action_213 action_97 (203) = happyGoto action_214 action_97 (205) = happyGoto action_215 action_97 (206) = happyGoto action_216 action_97 (215) = happyGoto action_217 action_97 (217) = happyGoto action_218 action_97 (227) = happyGoto action_219 action_97 _ = happyFail action_98 (328) = happyShift action_313 action_98 (330) = happyShift action_314 action_98 (155) = happyGoto action_312 action_98 _ = happyFail action_99 _ = happyReduce_411 action_100 (244) = happyShift action_36 action_100 (245) = happyShift action_37 action_100 (246) = happyShift action_38 action_100 (251) = happyShift action_39 action_100 (253) = happyShift action_40 action_100 (254) = happyShift action_41 action_100 (261) = happyShift action_45 action_100 (265) = happyShift action_46 action_100 (269) = happyShift action_47 action_100 (270) = happyShift action_48 action_100 (272) = happyShift action_49 action_100 (273) = happyShift action_50 action_100 (274) = happyShift action_51 action_100 (275) = happyShift action_52 action_100 (276) = happyShift action_53 action_100 (277) = happyShift action_54 action_100 (278) = happyShift action_55 action_100 (279) = happyShift action_56 action_100 (280) = happyShift action_57 action_100 (281) = happyShift action_58 action_100 (282) = happyShift action_59 action_100 (283) = happyShift action_60 action_100 (284) = happyShift action_61 action_100 (286) = happyShift action_62 action_100 (294) = happyShift action_66 action_100 (295) = happyShift action_67 action_100 (296) = happyShift action_68 action_100 (311) = happyShift action_69 action_100 (317) = happyShift action_70 action_100 (320) = happyShift action_71 action_100 (332) = happyShift action_72 action_100 (334) = happyShift action_73 action_100 (336) = happyShift action_112 action_100 (338) = happyShift action_75 action_100 (340) = happyShift action_76 action_100 (345) = happyShift action_77 action_100 (346) = happyShift action_78 action_100 (347) = happyShift action_79 action_100 (350) = happyShift action_80 action_100 (351) = happyShift action_81 action_100 (354) = happyShift action_82 action_100 (355) = happyShift action_83 action_100 (356) = happyShift action_84 action_100 (357) = happyShift action_85 action_100 (358) = happyShift action_86 action_100 (359) = happyShift action_87 action_100 (360) = happyShift action_88 action_100 (361) = happyShift action_89 action_100 (362) = happyShift action_90 action_100 (363) = happyShift action_91 action_100 (364) = happyShift action_92 action_100 (365) = happyShift action_93 action_100 (366) = happyShift action_94 action_100 (371) = happyShift action_95 action_100 (372) = happyShift action_96 action_100 (373) = happyShift action_97 action_100 (374) = happyShift action_98 action_100 (376) = happyShift action_99 action_100 (377) = happyShift action_100 action_100 (378) = happyShift action_101 action_100 (379) = happyShift action_102 action_100 (380) = happyShift action_103 action_100 (38) = happyGoto action_13 action_100 (142) = happyGoto action_16 action_100 (143) = happyGoto action_311 action_100 (144) = happyGoto action_110 action_100 (145) = happyGoto action_18 action_100 (147) = happyGoto action_19 action_100 (148) = happyGoto action_20 action_100 (149) = happyGoto action_21 action_100 (150) = happyGoto action_22 action_100 (151) = happyGoto action_23 action_100 (152) = happyGoto action_24 action_100 (192) = happyGoto action_25 action_100 (195) = happyGoto action_26 action_100 (198) = happyGoto action_27 action_100 (219) = happyGoto action_29 action_100 (220) = happyGoto action_30 action_100 (221) = happyGoto action_111 action_100 (227) = happyGoto action_32 action_100 (229) = happyGoto action_33 action_100 (230) = happyGoto action_34 action_100 (233) = happyGoto action_35 action_100 _ = happyFail action_101 (245) = happyShift action_37 action_101 (253) = happyShift action_40 action_101 (265) = happyShift action_46 action_101 (272) = happyShift action_49 action_101 (273) = happyShift action_50 action_101 (274) = happyShift action_51 action_101 (275) = happyShift action_221 action_101 (276) = happyShift action_222 action_101 (277) = happyShift action_223 action_101 (280) = happyShift action_57 action_101 (281) = happyShift action_58 action_101 (282) = happyShift action_59 action_101 (283) = happyShift action_60 action_101 (286) = happyShift action_62 action_101 (332) = happyShift action_307 action_101 (334) = happyShift action_308 action_101 (336) = happyShift action_309 action_101 (338) = happyShift action_310 action_101 (346) = happyShift action_234 action_101 (347) = happyShift action_235 action_101 (351) = happyShift action_236 action_101 (355) = happyShift action_237 action_101 (201) = happyGoto action_304 action_101 (202) = happyGoto action_305 action_101 (203) = happyGoto action_214 action_101 (205) = happyGoto action_215 action_101 (206) = happyGoto action_216 action_101 (215) = happyGoto action_306 action_101 (217) = happyGoto action_218 action_101 (227) = happyGoto action_219 action_101 _ = happyFail action_102 _ = happyReduce_362 action_103 _ = happyReduce_363 action_104 (381) = happyAccept action_104 _ = happyFail action_105 (262) = happyShift action_303 action_105 _ = happyFail action_106 _ = happyReduce_21 action_107 _ = happyReduce_645 action_108 (381) = happyAccept action_108 _ = happyFail action_109 (381) = happyAccept action_109 _ = happyFail action_110 (308) = happyShift action_267 action_110 (309) = happyShift action_298 action_110 (320) = happyShift action_269 action_110 (321) = happyShift action_270 action_110 (322) = happyShift action_271 action_110 (323) = happyShift action_299 action_110 (324) = happyShift action_300 action_110 (325) = happyShift action_301 action_110 (326) = happyShift action_302 action_110 (327) = happyShift action_272 action_110 (344) = happyShift action_273 action_110 (348) = happyShift action_274 action_110 (349) = happyShift action_275 action_110 (352) = happyShift action_276 action_110 (353) = happyShift action_277 action_110 (200) = happyGoto action_257 action_110 (211) = happyGoto action_258 action_110 (213) = happyGoto action_259 action_110 (222) = happyGoto action_260 action_110 (224) = happyGoto action_261 action_110 (225) = happyGoto action_262 action_110 (226) = happyGoto action_263 action_110 (228) = happyGoto action_264 action_110 (231) = happyGoto action_265 action_110 (232) = happyGoto action_266 action_110 _ = happyReduce_369 action_111 _ = happyReduce_586 action_112 (244) = happyShift action_36 action_112 (245) = happyShift action_37 action_112 (246) = happyShift action_38 action_112 (251) = happyShift action_39 action_112 (253) = happyShift action_40 action_112 (254) = happyShift action_41 action_112 (261) = happyShift action_45 action_112 (265) = happyShift action_46 action_112 (269) = happyShift action_47 action_112 (270) = happyShift action_48 action_112 (272) = happyShift action_49 action_112 (273) = happyShift action_50 action_112 (274) = happyShift action_51 action_112 (275) = happyShift action_52 action_112 (276) = happyShift action_53 action_112 (277) = happyShift action_54 action_112 (278) = happyShift action_55 action_112 (279) = happyShift action_56 action_112 (280) = happyShift action_57 action_112 (281) = happyShift action_58 action_112 (282) = happyShift action_59 action_112 (283) = happyShift action_60 action_112 (284) = happyShift action_61 action_112 (286) = happyShift action_62 action_112 (294) = happyShift action_66 action_112 (295) = happyShift action_67 action_112 (296) = happyShift action_68 action_112 (308) = happyShift action_267 action_112 (311) = happyShift action_69 action_112 (317) = happyShift action_70 action_112 (320) = happyShift action_294 action_112 (321) = happyShift action_270 action_112 (322) = happyShift action_271 action_112 (327) = happyShift action_272 action_112 (332) = happyShift action_72 action_112 (334) = happyShift action_73 action_112 (336) = happyShift action_112 action_112 (337) = happyShift action_295 action_112 (338) = happyShift action_75 action_112 (340) = happyShift action_76 action_112 (343) = happyShift action_296 action_112 (344) = happyShift action_297 action_112 (345) = happyShift action_77 action_112 (346) = happyShift action_78 action_112 (347) = happyShift action_79 action_112 (348) = happyShift action_274 action_112 (349) = happyShift action_275 action_112 (350) = happyShift action_80 action_112 (351) = happyShift action_81 action_112 (352) = happyShift action_276 action_112 (353) = happyShift action_277 action_112 (354) = happyShift action_82 action_112 (355) = happyShift action_83 action_112 (356) = happyShift action_84 action_112 (357) = happyShift action_85 action_112 (358) = happyShift action_86 action_112 (359) = happyShift action_87 action_112 (360) = happyShift action_88 action_112 (361) = happyShift action_89 action_112 (362) = happyShift action_90 action_112 (363) = happyShift action_91 action_112 (364) = happyShift action_92 action_112 (365) = happyShift action_93 action_112 (366) = happyShift action_94 action_112 (371) = happyShift action_95 action_112 (372) = happyShift action_96 action_112 (373) = happyShift action_97 action_112 (374) = happyShift action_98 action_112 (376) = happyShift action_99 action_112 (377) = happyShift action_100 action_112 (378) = happyShift action_101 action_112 (379) = happyShift action_102 action_112 (380) = happyShift action_103 action_112 (38) = happyGoto action_13 action_112 (142) = happyGoto action_16 action_112 (143) = happyGoto action_281 action_112 (144) = happyGoto action_282 action_112 (145) = happyGoto action_18 action_112 (147) = happyGoto action_19 action_112 (148) = happyGoto action_20 action_112 (149) = happyGoto action_21 action_112 (150) = happyGoto action_22 action_112 (151) = happyGoto action_23 action_112 (152) = happyGoto action_24 action_112 (157) = happyGoto action_283 action_112 (158) = happyGoto action_284 action_112 (192) = happyGoto action_25 action_112 (195) = happyGoto action_26 action_112 (198) = happyGoto action_27 action_112 (200) = happyGoto action_285 action_112 (212) = happyGoto action_286 action_112 (214) = happyGoto action_287 action_112 (219) = happyGoto action_29 action_112 (220) = happyGoto action_30 action_112 (221) = happyGoto action_111 action_112 (223) = happyGoto action_288 action_112 (224) = happyGoto action_289 action_112 (225) = happyGoto action_290 action_112 (226) = happyGoto action_291 action_112 (227) = happyGoto action_32 action_112 (228) = happyGoto action_264 action_112 (229) = happyGoto action_33 action_112 (230) = happyGoto action_34 action_112 (231) = happyGoto action_292 action_112 (232) = happyGoto action_266 action_112 (233) = happyGoto action_35 action_112 (236) = happyGoto action_293 action_112 _ = happyFail action_113 (381) = happyAccept action_113 _ = happyFail action_114 _ = happyReduce_94 action_115 _ = happyReduce_95 action_116 _ = happyReduce_96 action_117 (260) = happyShift action_279 action_117 (305) = happyShift action_280 action_117 (61) = happyGoto action_278 action_117 _ = happyReduce_138 action_118 _ = happyReduce_97 action_119 _ = happyReduce_112 action_120 _ = happyReduce_349 action_121 _ = happyReduce_341 action_122 _ = happyReduce_113 action_123 _ = happyReduce_346 action_124 (308) = happyShift action_267 action_124 (309) = happyShift action_268 action_124 (320) = happyShift action_269 action_124 (321) = happyShift action_270 action_124 (322) = happyShift action_271 action_124 (327) = happyShift action_272 action_124 (344) = happyShift action_273 action_124 (348) = happyShift action_274 action_124 (349) = happyShift action_275 action_124 (352) = happyShift action_276 action_124 (353) = happyShift action_277 action_124 (93) = happyGoto action_256 action_124 (200) = happyGoto action_257 action_124 (211) = happyGoto action_258 action_124 (213) = happyGoto action_259 action_124 (222) = happyGoto action_260 action_124 (224) = happyGoto action_261 action_124 (225) = happyGoto action_262 action_124 (226) = happyGoto action_263 action_124 (228) = happyGoto action_264 action_124 (231) = happyGoto action_265 action_124 (232) = happyGoto action_266 action_124 _ = happyReduce_216 action_125 _ = happyReduce_342 action_126 _ = happyReduce_343 action_127 _ = happyReduce_344 action_128 _ = happyReduce_345 action_129 (245) = happyShift action_37 action_129 (253) = happyShift action_40 action_129 (265) = happyShift action_46 action_129 (272) = happyShift action_49 action_129 (273) = happyShift action_50 action_129 (274) = happyShift action_51 action_129 (275) = happyShift action_221 action_129 (276) = happyShift action_222 action_129 (277) = happyShift action_223 action_129 (280) = happyShift action_57 action_129 (281) = happyShift action_58 action_129 (282) = happyShift action_59 action_129 (283) = happyShift action_60 action_129 (286) = happyShift action_62 action_129 (299) = happyShift action_225 action_129 (300) = happyShift action_226 action_129 (321) = happyShift action_227 action_129 (328) = happyShift action_228 action_129 (332) = happyShift action_229 action_129 (334) = happyShift action_230 action_129 (336) = happyShift action_231 action_129 (338) = happyShift action_232 action_129 (345) = happyShift action_233 action_129 (346) = happyShift action_234 action_129 (347) = happyShift action_235 action_129 (351) = happyShift action_236 action_129 (355) = happyShift action_237 action_129 (358) = happyShift action_238 action_129 (359) = happyShift action_239 action_129 (376) = happyShift action_240 action_129 (377) = happyShift action_241 action_129 (379) = happyShift action_102 action_129 (380) = happyShift action_103 action_129 (60) = happyGoto action_253 action_129 (100) = happyGoto action_208 action_129 (103) = happyGoto action_254 action_129 (104) = happyGoto action_255 action_129 (106) = happyGoto action_246 action_129 (107) = happyGoto action_211 action_129 (142) = happyGoto action_212 action_129 (202) = happyGoto action_213 action_129 (203) = happyGoto action_214 action_129 (205) = happyGoto action_215 action_129 (206) = happyGoto action_216 action_129 (215) = happyGoto action_217 action_129 (217) = happyGoto action_218 action_129 (227) = happyGoto action_219 action_129 _ = happyFail action_130 (279) = happyShift action_252 action_130 _ = happyReduce_130 action_131 (336) = happyShift action_251 action_131 _ = happyFail action_132 (260) = happyShift action_250 action_132 _ = happyFail action_133 (245) = happyShift action_37 action_133 (253) = happyShift action_40 action_133 (265) = happyShift action_46 action_133 (270) = happyShift action_249 action_133 (272) = happyShift action_49 action_133 (273) = happyShift action_50 action_133 (274) = happyShift action_51 action_133 (275) = happyShift action_221 action_133 (276) = happyShift action_222 action_133 (277) = happyShift action_223 action_133 (280) = happyShift action_57 action_133 (281) = happyShift action_58 action_133 (282) = happyShift action_59 action_133 (283) = happyShift action_60 action_133 (286) = happyShift action_62 action_133 (299) = happyShift action_225 action_133 (300) = happyShift action_226 action_133 (321) = happyShift action_227 action_133 (328) = happyShift action_228 action_133 (332) = happyShift action_229 action_133 (334) = happyShift action_230 action_133 (336) = happyShift action_231 action_133 (338) = happyShift action_232 action_133 (345) = happyShift action_233 action_133 (346) = happyShift action_234 action_133 (347) = happyShift action_235 action_133 (351) = happyShift action_236 action_133 (355) = happyShift action_237 action_133 (356) = happyShift action_84 action_133 (358) = happyShift action_238 action_133 (359) = happyShift action_239 action_133 (376) = happyShift action_240 action_133 (377) = happyShift action_241 action_133 (379) = happyShift action_102 action_133 (380) = happyShift action_103 action_133 (95) = happyGoto action_242 action_133 (100) = happyGoto action_208 action_133 (101) = happyGoto action_243 action_133 (103) = happyGoto action_244 action_133 (104) = happyGoto action_245 action_133 (106) = happyGoto action_246 action_133 (107) = happyGoto action_211 action_133 (108) = happyGoto action_247 action_133 (142) = happyGoto action_212 action_133 (192) = happyGoto action_248 action_133 (202) = happyGoto action_213 action_133 (203) = happyGoto action_214 action_133 (205) = happyGoto action_215 action_133 (206) = happyGoto action_216 action_133 (215) = happyGoto action_217 action_133 (217) = happyGoto action_218 action_133 (227) = happyGoto action_219 action_133 _ = happyFail action_134 _ = happyReduce_131 action_135 (245) = happyShift action_37 action_135 (253) = happyShift action_40 action_135 (260) = happyShift action_220 action_135 (265) = happyShift action_46 action_135 (272) = happyShift action_49 action_135 (273) = happyShift action_50 action_135 (274) = happyShift action_51 action_135 (275) = happyShift action_221 action_135 (276) = happyShift action_222 action_135 (277) = happyShift action_223 action_135 (279) = happyShift action_224 action_135 (280) = happyShift action_57 action_135 (281) = happyShift action_58 action_135 (282) = happyShift action_59 action_135 (283) = happyShift action_60 action_135 (286) = happyShift action_62 action_135 (299) = happyShift action_225 action_135 (300) = happyShift action_226 action_135 (321) = happyShift action_227 action_135 (328) = happyShift action_228 action_135 (332) = happyShift action_229 action_135 (334) = happyShift action_230 action_135 (336) = happyShift action_231 action_135 (338) = happyShift action_232 action_135 (345) = happyShift action_233 action_135 (346) = happyShift action_234 action_135 (347) = happyShift action_235 action_135 (351) = happyShift action_236 action_135 (355) = happyShift action_237 action_135 (358) = happyShift action_238 action_135 (359) = happyShift action_239 action_135 (376) = happyShift action_240 action_135 (377) = happyShift action_241 action_135 (379) = happyShift action_102 action_135 (380) = happyShift action_103 action_135 (100) = happyGoto action_208 action_135 (104) = happyGoto action_209 action_135 (106) = happyGoto action_210 action_135 (107) = happyGoto action_211 action_135 (142) = happyGoto action_212 action_135 (202) = happyGoto action_213 action_135 (203) = happyGoto action_214 action_135 (205) = happyGoto action_215 action_135 (206) = happyGoto action_216 action_135 (215) = happyGoto action_217 action_135 (217) = happyGoto action_218 action_135 (227) = happyGoto action_219 action_135 _ = happyFail action_136 (255) = happyShift action_206 action_136 (272) = happyShift action_207 action_136 (89) = happyGoto action_205 action_136 _ = happyFail action_137 (358) = happyShift action_204 action_137 (75) = happyGoto action_202 action_137 (76) = happyGoto action_203 action_137 _ = happyReduce_175 action_138 (245) = happyShift action_37 action_138 (253) = happyShift action_40 action_138 (265) = happyShift action_46 action_138 (270) = happyShift action_48 action_138 (272) = happyShift action_49 action_138 (273) = happyShift action_50 action_138 (274) = happyShift action_51 action_138 (275) = happyShift action_52 action_138 (276) = happyShift action_53 action_138 (277) = happyShift action_54 action_138 (279) = happyShift action_56 action_138 (280) = happyShift action_57 action_138 (281) = happyShift action_58 action_138 (282) = happyShift action_59 action_138 (283) = happyShift action_60 action_138 (286) = happyShift action_62 action_138 (332) = happyShift action_192 action_138 (336) = happyShift action_193 action_138 (338) = happyShift action_194 action_138 (346) = happyShift action_78 action_138 (347) = happyShift action_79 action_138 (84) = happyGoto action_199 action_138 (85) = happyGoto action_200 action_138 (193) = happyGoto action_201 action_138 (194) = happyGoto action_198 action_138 (196) = happyGoto action_185 action_138 (198) = happyGoto action_186 action_138 (218) = happyGoto action_187 action_138 (221) = happyGoto action_188 action_138 (227) = happyGoto action_32 action_138 (230) = happyGoto action_189 action_138 _ = happyReduce_195 action_139 (245) = happyShift action_37 action_139 (253) = happyShift action_40 action_139 (265) = happyShift action_46 action_139 (270) = happyShift action_48 action_139 (272) = happyShift action_49 action_139 (273) = happyShift action_50 action_139 (274) = happyShift action_51 action_139 (275) = happyShift action_52 action_139 (276) = happyShift action_53 action_139 (277) = happyShift action_54 action_139 (279) = happyShift action_56 action_139 (280) = happyShift action_57 action_139 (281) = happyShift action_58 action_139 (282) = happyShift action_59 action_139 (283) = happyShift action_60 action_139 (286) = happyShift action_62 action_139 (332) = happyShift action_192 action_139 (336) = happyShift action_193 action_139 (338) = happyShift action_194 action_139 (346) = happyShift action_78 action_139 (347) = happyShift action_79 action_139 (82) = happyGoto action_195 action_139 (83) = happyGoto action_196 action_139 (193) = happyGoto action_197 action_139 (194) = happyGoto action_198 action_139 (196) = happyGoto action_185 action_139 (198) = happyGoto action_186 action_139 (218) = happyGoto action_187 action_139 (221) = happyGoto action_188 action_139 (227) = happyGoto action_32 action_139 (230) = happyGoto action_189 action_139 _ = happyReduce_190 action_140 (245) = happyShift action_37 action_140 (253) = happyShift action_40 action_140 (262) = happyShift action_190 action_140 (265) = happyShift action_46 action_140 (267) = happyShift action_191 action_140 (270) = happyShift action_48 action_140 (272) = happyShift action_49 action_140 (273) = happyShift action_50 action_140 (274) = happyShift action_51 action_140 (275) = happyShift action_52 action_140 (276) = happyShift action_53 action_140 (277) = happyShift action_54 action_140 (279) = happyShift action_56 action_140 (280) = happyShift action_57 action_140 (281) = happyShift action_58 action_140 (282) = happyShift action_59 action_140 (283) = happyShift action_60 action_140 (286) = happyShift action_62 action_140 (332) = happyShift action_192 action_140 (336) = happyShift action_193 action_140 (338) = happyShift action_194 action_140 (346) = happyShift action_78 action_140 (347) = happyShift action_79 action_140 (194) = happyGoto action_184 action_140 (196) = happyGoto action_185 action_140 (198) = happyGoto action_186 action_140 (218) = happyGoto action_187 action_140 (221) = happyGoto action_188 action_140 (227) = happyGoto action_32 action_140 (230) = happyGoto action_189 action_140 _ = happyFail action_141 (245) = happyShift action_37 action_141 (247) = happyShift action_182 action_141 (253) = happyShift action_40 action_141 (265) = happyShift action_46 action_141 (267) = happyShift action_183 action_141 (270) = happyShift action_48 action_141 (272) = happyShift action_49 action_141 (273) = happyShift action_50 action_141 (274) = happyShift action_51 action_141 (275) = happyShift action_52 action_141 (276) = happyShift action_53 action_141 (277) = happyShift action_54 action_141 (279) = happyShift action_56 action_141 (280) = happyShift action_57 action_141 (281) = happyShift action_58 action_141 (282) = happyShift action_59 action_141 (283) = happyShift action_60 action_141 (286) = happyShift action_62 action_141 (336) = happyShift action_177 action_141 (346) = happyShift action_78 action_141 (350) = happyShift action_80 action_141 (354) = happyShift action_82 action_141 (219) = happyGoto action_181 action_141 (220) = happyGoto action_30 action_141 (221) = happyGoto action_111 action_141 (227) = happyGoto action_32 action_141 _ = happyFail action_142 (245) = happyShift action_37 action_142 (253) = happyShift action_40 action_142 (260) = happyShift action_179 action_142 (265) = happyShift action_46 action_142 (267) = happyShift action_180 action_142 (270) = happyShift action_48 action_142 (272) = happyShift action_49 action_142 (273) = happyShift action_50 action_142 (274) = happyShift action_51 action_142 (275) = happyShift action_52 action_142 (276) = happyShift action_53 action_142 (277) = happyShift action_54 action_142 (279) = happyShift action_56 action_142 (280) = happyShift action_57 action_142 (281) = happyShift action_58 action_142 (282) = happyShift action_59 action_142 (283) = happyShift action_60 action_142 (286) = happyShift action_62 action_142 (336) = happyShift action_177 action_142 (346) = happyShift action_78 action_142 (350) = happyShift action_80 action_142 (354) = happyShift action_82 action_142 (219) = happyGoto action_178 action_142 (220) = happyGoto action_30 action_142 (221) = happyGoto action_111 action_142 (227) = happyGoto action_32 action_142 _ = happyFail action_143 (245) = happyShift action_37 action_143 (253) = happyShift action_40 action_143 (265) = happyShift action_46 action_143 (270) = happyShift action_48 action_143 (272) = happyShift action_49 action_143 (273) = happyShift action_50 action_143 (274) = happyShift action_51 action_143 (275) = happyShift action_52 action_143 (276) = happyShift action_53 action_143 (277) = happyShift action_54 action_143 (279) = happyShift action_56 action_143 (280) = happyShift action_57 action_143 (281) = happyShift action_58 action_143 (282) = happyShift action_59 action_143 (283) = happyShift action_60 action_143 (286) = happyShift action_62 action_143 (336) = happyShift action_177 action_143 (346) = happyShift action_78 action_143 (350) = happyShift action_80 action_143 (354) = happyShift action_82 action_143 (219) = happyGoto action_176 action_143 (220) = happyGoto action_30 action_143 (221) = happyGoto action_111 action_143 (227) = happyGoto action_32 action_143 _ = happyFail action_144 (244) = happyShift action_36 action_144 (245) = happyShift action_37 action_144 (253) = happyShift action_40 action_144 (265) = happyShift action_46 action_144 (270) = happyShift action_48 action_144 (272) = happyShift action_49 action_144 (273) = happyShift action_50 action_144 (274) = happyShift action_51 action_144 (275) = happyShift action_52 action_144 (276) = happyShift action_53 action_144 (277) = happyShift action_54 action_144 (279) = happyShift action_56 action_144 (280) = happyShift action_57 action_144 (281) = happyShift action_58 action_144 (282) = happyShift action_59 action_144 (283) = happyShift action_60 action_144 (286) = happyShift action_62 action_144 (317) = happyShift action_70 action_144 (332) = happyShift action_72 action_144 (334) = happyShift action_73 action_144 (336) = happyShift action_112 action_144 (338) = happyShift action_75 action_144 (340) = happyShift action_76 action_144 (345) = happyShift action_77 action_144 (346) = happyShift action_78 action_144 (347) = happyShift action_79 action_144 (350) = happyShift action_80 action_144 (351) = happyShift action_81 action_144 (354) = happyShift action_82 action_144 (355) = happyShift action_83 action_144 (356) = happyShift action_84 action_144 (357) = happyShift action_85 action_144 (358) = happyShift action_86 action_144 (359) = happyShift action_87 action_144 (360) = happyShift action_88 action_144 (361) = happyShift action_89 action_144 (362) = happyShift action_90 action_144 (363) = happyShift action_91 action_144 (364) = happyShift action_92 action_144 (365) = happyShift action_93 action_144 (366) = happyShift action_94 action_144 (371) = happyShift action_95 action_144 (372) = happyShift action_96 action_144 (373) = happyShift action_97 action_144 (374) = happyShift action_98 action_144 (376) = happyShift action_99 action_144 (377) = happyShift action_100 action_144 (378) = happyShift action_101 action_144 (379) = happyShift action_102 action_144 (380) = happyShift action_103 action_144 (38) = happyGoto action_13 action_144 (142) = happyGoto action_16 action_144 (150) = happyGoto action_175 action_144 (151) = happyGoto action_23 action_144 (152) = happyGoto action_24 action_144 (192) = happyGoto action_25 action_144 (195) = happyGoto action_26 action_144 (198) = happyGoto action_27 action_144 (219) = happyGoto action_29 action_144 (220) = happyGoto action_30 action_144 (221) = happyGoto action_111 action_144 (227) = happyGoto action_32 action_144 (229) = happyGoto action_33 action_144 (230) = happyGoto action_34 action_144 (233) = happyGoto action_35 action_144 _ = happyFail action_145 _ = happyReduce_641 action_146 _ = happyReduce_642 action_147 _ = happyReduce_643 action_148 _ = happyReduce_644 action_149 (381) = happyAccept action_149 _ = happyFail action_150 (292) = happyShift action_174 action_150 (41) = happyGoto action_173 action_150 _ = happyReduce_71 action_151 (314) = happyReduce_483 action_151 _ = happyReduce_501 action_152 (314) = happyShift action_172 action_152 _ = happyFail action_153 (381) = happyAccept action_153 _ = happyFail action_154 _ = happyReduce_498 action_155 (328) = happyShift action_170 action_155 (330) = happyShift action_171 action_155 (72) = happyGoto action_168 action_155 (73) = happyGoto action_169 action_155 _ = happyFail action_156 (328) = happyShift action_166 action_156 (330) = happyShift action_167 action_156 (181) = happyGoto action_165 action_156 _ = happyFail action_157 (244) = happyShift action_36 action_157 (245) = happyShift action_37 action_157 (253) = happyShift action_40 action_157 (265) = happyShift action_46 action_157 (270) = happyShift action_48 action_157 (272) = happyShift action_49 action_157 (273) = happyShift action_50 action_157 (274) = happyShift action_51 action_157 (275) = happyShift action_52 action_157 (276) = happyShift action_53 action_157 (277) = happyShift action_54 action_157 (279) = happyShift action_56 action_157 (280) = happyShift action_57 action_157 (281) = happyShift action_58 action_157 (282) = happyShift action_59 action_157 (283) = happyShift action_60 action_157 (286) = happyShift action_62 action_157 (317) = happyShift action_70 action_157 (332) = happyShift action_72 action_157 (334) = happyShift action_73 action_157 (336) = happyShift action_112 action_157 (338) = happyShift action_75 action_157 (340) = happyShift action_76 action_157 (345) = happyShift action_77 action_157 (346) = happyShift action_78 action_157 (347) = happyShift action_79 action_157 (350) = happyShift action_80 action_157 (351) = happyShift action_81 action_157 (354) = happyShift action_82 action_157 (355) = happyShift action_83 action_157 (356) = happyShift action_84 action_157 (357) = happyShift action_85 action_157 (358) = happyShift action_86 action_157 (359) = happyShift action_87 action_157 (360) = happyShift action_88 action_157 (361) = happyShift action_89 action_157 (362) = happyShift action_90 action_157 (363) = happyShift action_91 action_157 (364) = happyShift action_92 action_157 (365) = happyShift action_93 action_157 (366) = happyShift action_94 action_157 (371) = happyShift action_95 action_157 (372) = happyShift action_96 action_157 (373) = happyShift action_97 action_157 (374) = happyShift action_98 action_157 (376) = happyShift action_99 action_157 (377) = happyShift action_100 action_157 (378) = happyShift action_101 action_157 (379) = happyShift action_102 action_157 (380) = happyShift action_103 action_157 (38) = happyGoto action_13 action_157 (142) = happyGoto action_16 action_157 (150) = happyGoto action_164 action_157 (151) = happyGoto action_23 action_157 (152) = happyGoto action_24 action_157 (192) = happyGoto action_25 action_157 (195) = happyGoto action_26 action_157 (198) = happyGoto action_27 action_157 (219) = happyGoto action_29 action_157 (220) = happyGoto action_30 action_157 (221) = happyGoto action_111 action_157 (227) = happyGoto action_32 action_157 (229) = happyGoto action_33 action_157 (230) = happyGoto action_34 action_157 (233) = happyGoto action_35 action_157 _ = happyFail action_158 (1) = happyAccept action_158 _ = happyFail action_159 (1) = happyAccept action_159 _ = happyFail action_160 (1) = happyAccept action_160 _ = happyFail action_161 (1) = happyAccept action_161 _ = happyFail action_162 (1) = happyAccept action_162 _ = happyFail action_163 (1) = happyAccept action_163 _ = happyFail action_164 _ = happyReduce_484 action_165 _ = happyReduce_499 action_166 (244) = happyShift action_36 action_166 (245) = happyShift action_37 action_166 (246) = happyShift action_38 action_166 (251) = happyShift action_39 action_166 (253) = happyShift action_40 action_166 (254) = happyShift action_41 action_166 (261) = happyShift action_155 action_166 (265) = happyShift action_46 action_166 (269) = happyShift action_47 action_166 (270) = happyShift action_48 action_166 (272) = happyShift action_49 action_166 (273) = happyShift action_50 action_166 (274) = happyShift action_51 action_166 (275) = happyShift action_52 action_166 (276) = happyShift action_53 action_166 (277) = happyShift action_54 action_166 (278) = happyShift action_55 action_166 (279) = happyShift action_56 action_166 (280) = happyShift action_57 action_166 (281) = happyShift action_58 action_166 (282) = happyShift action_59 action_166 (283) = happyShift action_60 action_166 (284) = happyShift action_61 action_166 (285) = happyShift action_156 action_166 (286) = happyShift action_62 action_166 (294) = happyShift action_66 action_166 (295) = happyShift action_67 action_166 (296) = happyShift action_68 action_166 (311) = happyShift action_69 action_166 (317) = happyShift action_70 action_166 (320) = happyShift action_71 action_166 (321) = happyShift action_157 action_166 (332) = happyShift action_72 action_166 (334) = happyShift action_73 action_166 (336) = happyShift action_112 action_166 (338) = happyShift action_75 action_166 (340) = happyShift action_76 action_166 (342) = happyShift action_594 action_166 (345) = happyShift action_77 action_166 (346) = happyShift action_78 action_166 (347) = happyShift action_79 action_166 (350) = happyShift action_80 action_166 (351) = happyShift action_81 action_166 (354) = happyShift action_82 action_166 (355) = happyShift action_83 action_166 (356) = happyShift action_84 action_166 (357) = happyShift action_85 action_166 (358) = happyShift action_86 action_166 (359) = happyShift action_87 action_166 (360) = happyShift action_88 action_166 (361) = happyShift action_89 action_166 (362) = happyShift action_90 action_166 (363) = happyShift action_91 action_166 (364) = happyShift action_92 action_166 (365) = happyShift action_93 action_166 (366) = happyShift action_94 action_166 (371) = happyShift action_95 action_166 (372) = happyShift action_96 action_166 (373) = happyShift action_97 action_166 (374) = happyShift action_98 action_166 (376) = happyShift action_99 action_166 (377) = happyShift action_100 action_166 (378) = happyShift action_101 action_166 (379) = happyShift action_102 action_166 (380) = happyShift action_103 action_166 (38) = happyGoto action_13 action_166 (142) = happyGoto action_16 action_166 (143) = happyGoto action_151 action_166 (144) = happyGoto action_110 action_166 (145) = happyGoto action_18 action_166 (147) = happyGoto action_19 action_166 (148) = happyGoto action_20 action_166 (149) = happyGoto action_21 action_166 (150) = happyGoto action_22 action_166 (151) = happyGoto action_23 action_166 (152) = happyGoto action_24 action_166 (178) = happyGoto action_152 action_166 (182) = happyGoto action_595 action_166 (185) = happyGoto action_593 action_166 (186) = happyGoto action_154 action_166 (192) = happyGoto action_25 action_166 (195) = happyGoto action_26 action_166 (198) = happyGoto action_27 action_166 (219) = happyGoto action_29 action_166 (220) = happyGoto action_30 action_166 (221) = happyGoto action_111 action_166 (227) = happyGoto action_32 action_166 (229) = happyGoto action_33 action_166 (230) = happyGoto action_34 action_166 (233) = happyGoto action_35 action_166 _ = happyReduce_493 action_167 (244) = happyShift action_36 action_167 (245) = happyShift action_37 action_167 (246) = happyShift action_38 action_167 (251) = happyShift action_39 action_167 (253) = happyShift action_40 action_167 (254) = happyShift action_41 action_167 (261) = happyShift action_155 action_167 (265) = happyShift action_46 action_167 (269) = happyShift action_47 action_167 (270) = happyShift action_48 action_167 (272) = happyShift action_49 action_167 (273) = happyShift action_50 action_167 (274) = happyShift action_51 action_167 (275) = happyShift action_52 action_167 (276) = happyShift action_53 action_167 (277) = happyShift action_54 action_167 (278) = happyShift action_55 action_167 (279) = happyShift action_56 action_167 (280) = happyShift action_57 action_167 (281) = happyShift action_58 action_167 (282) = happyShift action_59 action_167 (283) = happyShift action_60 action_167 (284) = happyShift action_61 action_167 (285) = happyShift action_156 action_167 (286) = happyShift action_62 action_167 (294) = happyShift action_66 action_167 (295) = happyShift action_67 action_167 (296) = happyShift action_68 action_167 (311) = happyShift action_69 action_167 (317) = happyShift action_70 action_167 (320) = happyShift action_71 action_167 (321) = happyShift action_157 action_167 (332) = happyShift action_72 action_167 (334) = happyShift action_73 action_167 (336) = happyShift action_112 action_167 (338) = happyShift action_75 action_167 (340) = happyShift action_76 action_167 (342) = happyShift action_594 action_167 (345) = happyShift action_77 action_167 (346) = happyShift action_78 action_167 (347) = happyShift action_79 action_167 (350) = happyShift action_80 action_167 (351) = happyShift action_81 action_167 (354) = happyShift action_82 action_167 (355) = happyShift action_83 action_167 (356) = happyShift action_84 action_167 (357) = happyShift action_85 action_167 (358) = happyShift action_86 action_167 (359) = happyShift action_87 action_167 (360) = happyShift action_88 action_167 (361) = happyShift action_89 action_167 (362) = happyShift action_90 action_167 (363) = happyShift action_91 action_167 (364) = happyShift action_92 action_167 (365) = happyShift action_93 action_167 (366) = happyShift action_94 action_167 (371) = happyShift action_95 action_167 (372) = happyShift action_96 action_167 (373) = happyShift action_97 action_167 (374) = happyShift action_98 action_167 (376) = happyShift action_99 action_167 (377) = happyShift action_100 action_167 (378) = happyShift action_101 action_167 (379) = happyShift action_102 action_167 (380) = happyShift action_103 action_167 (38) = happyGoto action_13 action_167 (142) = happyGoto action_16 action_167 (143) = happyGoto action_151 action_167 (144) = happyGoto action_110 action_167 (145) = happyGoto action_18 action_167 (147) = happyGoto action_19 action_167 (148) = happyGoto action_20 action_167 (149) = happyGoto action_21 action_167 (150) = happyGoto action_22 action_167 (151) = happyGoto action_23 action_167 (152) = happyGoto action_24 action_167 (178) = happyGoto action_152 action_167 (182) = happyGoto action_592 action_167 (185) = happyGoto action_593 action_167 (186) = happyGoto action_154 action_167 (192) = happyGoto action_25 action_167 (195) = happyGoto action_26 action_167 (198) = happyGoto action_27 action_167 (219) = happyGoto action_29 action_167 (220) = happyGoto action_30 action_167 (221) = happyGoto action_111 action_167 (227) = happyGoto action_32 action_167 (229) = happyGoto action_33 action_167 (230) = happyGoto action_34 action_167 (233) = happyGoto action_35 action_167 _ = happyReduce_493 action_168 _ = happyReduce_167 action_169 (256) = happyShift action_402 action_169 _ = happyReduce_502 action_170 (244) = happyShift action_36 action_170 (245) = happyShift action_37 action_170 (246) = happyShift action_38 action_170 (251) = happyShift action_39 action_170 (253) = happyShift action_40 action_170 (254) = happyShift action_41 action_170 (257) = happyShift action_42 action_170 (258) = happyShift action_43 action_170 (259) = happyShift action_44 action_170 (261) = happyShift action_45 action_170 (265) = happyShift action_46 action_170 (269) = happyShift action_47 action_170 (270) = happyShift action_48 action_170 (272) = happyShift action_49 action_170 (273) = happyShift action_50 action_170 (274) = happyShift action_51 action_170 (275) = happyShift action_52 action_170 (276) = happyShift action_53 action_170 (277) = happyShift action_54 action_170 (278) = happyShift action_55 action_170 (279) = happyShift action_56 action_170 (280) = happyShift action_57 action_170 (281) = happyShift action_58 action_170 (282) = happyShift action_59 action_170 (283) = happyShift action_60 action_170 (284) = happyShift action_61 action_170 (286) = happyShift action_62 action_170 (289) = happyShift action_63 action_170 (290) = happyShift action_64 action_170 (291) = happyShift action_65 action_170 (294) = happyShift action_66 action_170 (295) = happyShift action_67 action_170 (296) = happyShift action_68 action_170 (311) = happyShift action_69 action_170 (317) = happyShift action_70 action_170 (320) = happyShift action_71 action_170 (321) = happyShift action_144 action_170 (332) = happyShift action_72 action_170 (334) = happyShift action_73 action_170 (336) = happyShift action_74 action_170 (338) = happyShift action_75 action_170 (340) = happyShift action_76 action_170 (345) = happyShift action_77 action_170 (346) = happyShift action_78 action_170 (347) = happyShift action_79 action_170 (350) = happyShift action_80 action_170 (351) = happyShift action_81 action_170 (354) = happyShift action_82 action_170 (355) = happyShift action_83 action_170 (356) = happyShift action_84 action_170 (357) = happyShift action_85 action_170 (358) = happyShift action_86 action_170 (359) = happyShift action_87 action_170 (360) = happyShift action_88 action_170 (361) = happyShift action_89 action_170 (362) = happyShift action_90 action_170 (363) = happyShift action_91 action_170 (364) = happyShift action_92 action_170 (365) = happyShift action_93 action_170 (366) = happyShift action_94 action_170 (367) = happyShift action_145 action_170 (368) = happyShift action_146 action_170 (369) = happyShift action_147 action_170 (370) = happyShift action_148 action_170 (371) = happyShift action_95 action_170 (372) = happyShift action_96 action_170 (373) = happyShift action_97 action_170 (374) = happyShift action_98 action_170 (376) = happyShift action_99 action_170 (377) = happyShift action_100 action_170 (378) = happyShift action_101 action_170 (379) = happyShift action_102 action_170 (380) = happyShift action_103 action_170 (38) = happyGoto action_13 action_170 (49) = happyGoto action_14 action_170 (71) = happyGoto action_590 action_170 (135) = happyGoto action_120 action_170 (136) = happyGoto action_121 action_170 (137) = happyGoto action_586 action_170 (141) = happyGoto action_123 action_170 (142) = happyGoto action_16 action_170 (144) = happyGoto action_124 action_170 (145) = happyGoto action_18 action_170 (147) = happyGoto action_19 action_170 (148) = happyGoto action_20 action_170 (149) = happyGoto action_21 action_170 (150) = happyGoto action_22 action_170 (151) = happyGoto action_23 action_170 (152) = happyGoto action_24 action_170 (190) = happyGoto action_591 action_170 (191) = happyGoto action_588 action_170 (192) = happyGoto action_589 action_170 (195) = happyGoto action_26 action_170 (198) = happyGoto action_27 action_170 (218) = happyGoto action_28 action_170 (219) = happyGoto action_29 action_170 (220) = happyGoto action_30 action_170 (221) = happyGoto action_31 action_170 (227) = happyGoto action_32 action_170 (229) = happyGoto action_33 action_170 (230) = happyGoto action_34 action_170 (233) = happyGoto action_35 action_170 (237) = happyGoto action_125 action_170 (238) = happyGoto action_126 action_170 (239) = happyGoto action_127 action_170 (240) = happyGoto action_128 action_170 _ = happyReduce_164 action_171 (244) = happyShift action_36 action_171 (245) = happyShift action_37 action_171 (246) = happyShift action_38 action_171 (251) = happyShift action_39 action_171 (253) = happyShift action_40 action_171 (254) = happyShift action_41 action_171 (257) = happyShift action_42 action_171 (258) = happyShift action_43 action_171 (259) = happyShift action_44 action_171 (261) = happyShift action_45 action_171 (265) = happyShift action_46 action_171 (269) = happyShift action_47 action_171 (270) = happyShift action_48 action_171 (272) = happyShift action_49 action_171 (273) = happyShift action_50 action_171 (274) = happyShift action_51 action_171 (275) = happyShift action_52 action_171 (276) = happyShift action_53 action_171 (277) = happyShift action_54 action_171 (278) = happyShift action_55 action_171 (279) = happyShift action_56 action_171 (280) = happyShift action_57 action_171 (281) = happyShift action_58 action_171 (282) = happyShift action_59 action_171 (283) = happyShift action_60 action_171 (284) = happyShift action_61 action_171 (286) = happyShift action_62 action_171 (289) = happyShift action_63 action_171 (290) = happyShift action_64 action_171 (291) = happyShift action_65 action_171 (294) = happyShift action_66 action_171 (295) = happyShift action_67 action_171 (296) = happyShift action_68 action_171 (311) = happyShift action_69 action_171 (317) = happyShift action_70 action_171 (320) = happyShift action_71 action_171 (321) = happyShift action_144 action_171 (332) = happyShift action_72 action_171 (334) = happyShift action_73 action_171 (336) = happyShift action_74 action_171 (338) = happyShift action_75 action_171 (340) = happyShift action_76 action_171 (345) = happyShift action_77 action_171 (346) = happyShift action_78 action_171 (347) = happyShift action_79 action_171 (350) = happyShift action_80 action_171 (351) = happyShift action_81 action_171 (354) = happyShift action_82 action_171 (355) = happyShift action_83 action_171 (356) = happyShift action_84 action_171 (357) = happyShift action_85 action_171 (358) = happyShift action_86 action_171 (359) = happyShift action_87 action_171 (360) = happyShift action_88 action_171 (361) = happyShift action_89 action_171 (362) = happyShift action_90 action_171 (363) = happyShift action_91 action_171 (364) = happyShift action_92 action_171 (365) = happyShift action_93 action_171 (366) = happyShift action_94 action_171 (367) = happyShift action_145 action_171 (368) = happyShift action_146 action_171 (369) = happyShift action_147 action_171 (370) = happyShift action_148 action_171 (371) = happyShift action_95 action_171 (372) = happyShift action_96 action_171 (373) = happyShift action_97 action_171 (374) = happyShift action_98 action_171 (376) = happyShift action_99 action_171 (377) = happyShift action_100 action_171 (378) = happyShift action_101 action_171 (379) = happyShift action_102 action_171 (380) = happyShift action_103 action_171 (38) = happyGoto action_13 action_171 (49) = happyGoto action_14 action_171 (71) = happyGoto action_585 action_171 (135) = happyGoto action_120 action_171 (136) = happyGoto action_121 action_171 (137) = happyGoto action_586 action_171 (141) = happyGoto action_123 action_171 (142) = happyGoto action_16 action_171 (144) = happyGoto action_124 action_171 (145) = happyGoto action_18 action_171 (147) = happyGoto action_19 action_171 (148) = happyGoto action_20 action_171 (149) = happyGoto action_21 action_171 (150) = happyGoto action_22 action_171 (151) = happyGoto action_23 action_171 (152) = happyGoto action_24 action_171 (190) = happyGoto action_587 action_171 (191) = happyGoto action_588 action_171 (192) = happyGoto action_589 action_171 (195) = happyGoto action_26 action_171 (198) = happyGoto action_27 action_171 (218) = happyGoto action_28 action_171 (219) = happyGoto action_29 action_171 (220) = happyGoto action_30 action_171 (221) = happyGoto action_31 action_171 (227) = happyGoto action_32 action_171 (229) = happyGoto action_33 action_171 (230) = happyGoto action_34 action_171 (233) = happyGoto action_35 action_171 (237) = happyGoto action_125 action_171 (238) = happyGoto action_126 action_171 (239) = happyGoto action_127 action_171 (240) = happyGoto action_128 action_171 _ = happyReduce_164 action_172 (244) = happyShift action_36 action_172 (245) = happyShift action_37 action_172 (246) = happyShift action_38 action_172 (251) = happyShift action_39 action_172 (253) = happyShift action_40 action_172 (254) = happyShift action_41 action_172 (261) = happyShift action_45 action_172 (265) = happyShift action_46 action_172 (269) = happyShift action_47 action_172 (270) = happyShift action_48 action_172 (272) = happyShift action_49 action_172 (273) = happyShift action_50 action_172 (274) = happyShift action_51 action_172 (275) = happyShift action_52 action_172 (276) = happyShift action_53 action_172 (277) = happyShift action_54 action_172 (278) = happyShift action_55 action_172 (279) = happyShift action_56 action_172 (280) = happyShift action_57 action_172 (281) = happyShift action_58 action_172 (282) = happyShift action_59 action_172 (283) = happyShift action_60 action_172 (284) = happyShift action_61 action_172 (286) = happyShift action_62 action_172 (294) = happyShift action_66 action_172 (295) = happyShift action_67 action_172 (296) = happyShift action_68 action_172 (311) = happyShift action_69 action_172 (317) = happyShift action_70 action_172 (320) = happyShift action_71 action_172 (332) = happyShift action_72 action_172 (334) = happyShift action_73 action_172 (336) = happyShift action_112 action_172 (338) = happyShift action_75 action_172 (340) = happyShift action_76 action_172 (345) = happyShift action_77 action_172 (346) = happyShift action_78 action_172 (347) = happyShift action_79 action_172 (350) = happyShift action_80 action_172 (351) = happyShift action_81 action_172 (354) = happyShift action_82 action_172 (355) = happyShift action_83 action_172 (356) = happyShift action_84 action_172 (357) = happyShift action_85 action_172 (358) = happyShift action_86 action_172 (359) = happyShift action_87 action_172 (360) = happyShift action_88 action_172 (361) = happyShift action_89 action_172 (362) = happyShift action_90 action_172 (363) = happyShift action_91 action_172 (364) = happyShift action_92 action_172 (365) = happyShift action_93 action_172 (366) = happyShift action_94 action_172 (371) = happyShift action_95 action_172 (372) = happyShift action_96 action_172 (373) = happyShift action_97 action_172 (374) = happyShift action_98 action_172 (376) = happyShift action_99 action_172 (377) = happyShift action_100 action_172 (378) = happyShift action_101 action_172 (379) = happyShift action_102 action_172 (380) = happyShift action_103 action_172 (38) = happyGoto action_13 action_172 (142) = happyGoto action_16 action_172 (143) = happyGoto action_584 action_172 (144) = happyGoto action_110 action_172 (145) = happyGoto action_18 action_172 (147) = happyGoto action_19 action_172 (148) = happyGoto action_20 action_172 (149) = happyGoto action_21 action_172 (150) = happyGoto action_22 action_172 (151) = happyGoto action_23 action_172 (152) = happyGoto action_24 action_172 (192) = happyGoto action_25 action_172 (195) = happyGoto action_26 action_172 (198) = happyGoto action_27 action_172 (219) = happyGoto action_29 action_172 (220) = happyGoto action_30 action_172 (221) = happyGoto action_111 action_172 (227) = happyGoto action_32 action_172 (229) = happyGoto action_33 action_172 (230) = happyGoto action_34 action_172 (233) = happyGoto action_35 action_172 _ = happyFail action_173 (275) = happyShift action_583 action_173 (42) = happyGoto action_582 action_173 _ = happyReduce_73 action_174 (306) = happyShift action_581 action_174 _ = happyFail action_175 (310) = happyShift action_500 action_175 (313) = happyShift action_501 action_175 (138) = happyGoto action_580 action_175 (139) = happyGoto action_498 action_175 (140) = happyGoto action_499 action_175 _ = happyFail action_176 (306) = happyShift action_579 action_176 _ = happyFail action_177 (320) = happyShift action_269 action_177 (321) = happyShift action_270 action_177 (322) = happyShift action_271 action_177 (327) = happyShift action_272 action_177 (348) = happyShift action_274 action_177 (352) = happyShift action_276 action_177 (224) = happyGoto action_439 action_177 (225) = happyGoto action_290 action_177 (226) = happyGoto action_263 action_177 (228) = happyGoto action_264 action_177 _ = happyFail action_178 (306) = happyShift action_578 action_178 _ = happyFail action_179 (245) = happyShift action_37 action_179 (253) = happyShift action_40 action_179 (265) = happyShift action_46 action_179 (272) = happyShift action_49 action_179 (273) = happyShift action_50 action_179 (274) = happyShift action_51 action_179 (275) = happyShift action_221 action_179 (276) = happyShift action_222 action_179 (277) = happyShift action_223 action_179 (280) = happyShift action_57 action_179 (281) = happyShift action_58 action_179 (282) = happyShift action_59 action_179 (283) = happyShift action_60 action_179 (286) = happyShift action_62 action_179 (299) = happyShift action_225 action_179 (300) = happyShift action_226 action_179 (321) = happyShift action_227 action_179 (328) = happyShift action_228 action_179 (332) = happyShift action_229 action_179 (334) = happyShift action_230 action_179 (336) = happyShift action_231 action_179 (338) = happyShift action_232 action_179 (345) = happyShift action_233 action_179 (346) = happyShift action_234 action_179 (347) = happyShift action_235 action_179 (351) = happyShift action_236 action_179 (355) = happyShift action_237 action_179 (358) = happyShift action_238 action_179 (359) = happyShift action_239 action_179 (376) = happyShift action_240 action_179 (377) = happyShift action_241 action_179 (379) = happyShift action_102 action_179 (380) = happyShift action_103 action_179 (100) = happyGoto action_208 action_179 (104) = happyGoto action_577 action_179 (106) = happyGoto action_210 action_179 (107) = happyGoto action_211 action_179 (142) = happyGoto action_212 action_179 (202) = happyGoto action_213 action_179 (203) = happyGoto action_214 action_179 (205) = happyGoto action_215 action_179 (206) = happyGoto action_216 action_179 (215) = happyGoto action_217 action_179 (217) = happyGoto action_218 action_179 (227) = happyGoto action_219 action_179 _ = happyFail action_180 (332) = happyShift action_307 action_180 (334) = happyShift action_308 action_180 (336) = happyShift action_309 action_180 (338) = happyShift action_310 action_180 (347) = happyShift action_235 action_180 (351) = happyShift action_236 action_180 (355) = happyShift action_237 action_180 (201) = happyGoto action_576 action_180 (202) = happyGoto action_305 action_180 (203) = happyGoto action_214 action_180 (205) = happyGoto action_215 action_180 (206) = happyGoto action_216 action_180 _ = happyFail action_181 (310) = happyShift action_575 action_181 _ = happyFail action_182 (332) = happyShift action_307 action_182 (334) = happyShift action_308 action_182 (336) = happyShift action_309 action_182 (338) = happyShift action_310 action_182 (347) = happyShift action_235 action_182 (351) = happyShift action_236 action_182 (355) = happyShift action_237 action_182 (201) = happyGoto action_574 action_182 (202) = happyGoto action_305 action_182 (203) = happyGoto action_214 action_182 (205) = happyGoto action_215 action_182 (206) = happyGoto action_216 action_182 _ = happyFail action_183 (332) = happyShift action_307 action_183 (334) = happyShift action_308 action_183 (336) = happyShift action_309 action_183 (338) = happyShift action_310 action_183 (347) = happyShift action_235 action_183 (351) = happyShift action_236 action_183 (355) = happyShift action_237 action_183 (201) = happyGoto action_573 action_183 (202) = happyGoto action_305 action_183 (203) = happyGoto action_214 action_183 (205) = happyGoto action_215 action_183 (206) = happyGoto action_216 action_183 _ = happyFail action_184 (244) = happyShift action_36 action_184 (245) = happyShift action_37 action_184 (253) = happyShift action_40 action_184 (265) = happyShift action_46 action_184 (270) = happyShift action_48 action_184 (272) = happyShift action_49 action_184 (273) = happyShift action_50 action_184 (274) = happyShift action_51 action_184 (275) = happyShift action_52 action_184 (276) = happyShift action_53 action_184 (277) = happyShift action_54 action_184 (279) = happyShift action_56 action_184 (280) = happyShift action_57 action_184 (281) = happyShift action_58 action_184 (282) = happyShift action_59 action_184 (283) = happyShift action_60 action_184 (286) = happyShift action_62 action_184 (317) = happyShift action_70 action_184 (332) = happyShift action_72 action_184 (334) = happyShift action_73 action_184 (336) = happyShift action_112 action_184 (338) = happyShift action_75 action_184 (340) = happyShift action_76 action_184 (345) = happyShift action_77 action_184 (346) = happyShift action_78 action_184 (347) = happyShift action_79 action_184 (350) = happyShift action_80 action_184 (351) = happyShift action_81 action_184 (354) = happyShift action_82 action_184 (355) = happyShift action_83 action_184 (356) = happyShift action_84 action_184 (357) = happyShift action_85 action_184 (358) = happyShift action_86 action_184 (359) = happyShift action_87 action_184 (360) = happyShift action_88 action_184 (361) = happyShift action_89 action_184 (362) = happyShift action_90 action_184 (363) = happyShift action_91 action_184 (364) = happyShift action_92 action_184 (365) = happyShift action_93 action_184 (366) = happyShift action_94 action_184 (371) = happyShift action_95 action_184 (372) = happyShift action_96 action_184 (373) = happyShift action_97 action_184 (374) = happyShift action_98 action_184 (376) = happyShift action_99 action_184 (377) = happyShift action_100 action_184 (378) = happyShift action_101 action_184 (379) = happyShift action_102 action_184 (380) = happyShift action_103 action_184 (38) = happyGoto action_13 action_184 (142) = happyGoto action_16 action_184 (150) = happyGoto action_572 action_184 (151) = happyGoto action_23 action_184 (152) = happyGoto action_24 action_184 (192) = happyGoto action_25 action_184 (195) = happyGoto action_26 action_184 (198) = happyGoto action_27 action_184 (219) = happyGoto action_29 action_184 (220) = happyGoto action_30 action_184 (221) = happyGoto action_111 action_184 (227) = happyGoto action_32 action_184 (229) = happyGoto action_33 action_184 (230) = happyGoto action_34 action_184 (233) = happyGoto action_35 action_184 _ = happyFail action_185 _ = happyReduce_518 action_186 _ = happyReduce_524 action_187 _ = happyReduce_517 action_188 _ = happyReduce_581 action_189 _ = happyReduce_522 action_190 (244) = happyShift action_36 action_190 (245) = happyShift action_37 action_190 (253) = happyShift action_40 action_190 (265) = happyShift action_46 action_190 (270) = happyShift action_48 action_190 (272) = happyShift action_49 action_190 (273) = happyShift action_50 action_190 (274) = happyShift action_51 action_190 (275) = happyShift action_52 action_190 (276) = happyShift action_53 action_190 (277) = happyShift action_54 action_190 (279) = happyShift action_56 action_190 (280) = happyShift action_57 action_190 (281) = happyShift action_58 action_190 (282) = happyShift action_59 action_190 (283) = happyShift action_60 action_190 (286) = happyShift action_62 action_190 (317) = happyShift action_70 action_190 (332) = happyShift action_72 action_190 (334) = happyShift action_73 action_190 (336) = happyShift action_112 action_190 (338) = happyShift action_75 action_190 (340) = happyShift action_76 action_190 (345) = happyShift action_77 action_190 (346) = happyShift action_78 action_190 (347) = happyShift action_79 action_190 (350) = happyShift action_80 action_190 (351) = happyShift action_81 action_190 (354) = happyShift action_82 action_190 (355) = happyShift action_83 action_190 (356) = happyShift action_84 action_190 (357) = happyShift action_85 action_190 (358) = happyShift action_86 action_190 (359) = happyShift action_87 action_190 (360) = happyShift action_88 action_190 (361) = happyShift action_89 action_190 (362) = happyShift action_90 action_190 (363) = happyShift action_91 action_190 (364) = happyShift action_92 action_190 (365) = happyShift action_93 action_190 (366) = happyShift action_94 action_190 (371) = happyShift action_95 action_190 (372) = happyShift action_96 action_190 (373) = happyShift action_97 action_190 (374) = happyShift action_98 action_190 (376) = happyShift action_99 action_190 (377) = happyShift action_100 action_190 (378) = happyShift action_101 action_190 (379) = happyShift action_102 action_190 (380) = happyShift action_103 action_190 (38) = happyGoto action_13 action_190 (142) = happyGoto action_16 action_190 (150) = happyGoto action_571 action_190 (151) = happyGoto action_23 action_190 (152) = happyGoto action_24 action_190 (192) = happyGoto action_25 action_190 (195) = happyGoto action_26 action_190 (198) = happyGoto action_27 action_190 (219) = happyGoto action_29 action_190 (220) = happyGoto action_30 action_190 (221) = happyGoto action_111 action_190 (227) = happyGoto action_32 action_190 (229) = happyGoto action_33 action_190 (230) = happyGoto action_34 action_190 (233) = happyGoto action_35 action_190 _ = happyFail action_191 (347) = happyShift action_235 action_191 (206) = happyGoto action_570 action_191 _ = happyFail action_192 (333) = happyShift action_336 action_192 _ = happyFail action_193 (308) = happyShift action_267 action_193 (320) = happyShift action_269 action_193 (321) = happyShift action_270 action_193 (322) = happyShift action_271 action_193 (327) = happyShift action_272 action_193 (337) = happyShift action_295 action_193 (343) = happyShift action_296 action_193 (348) = happyShift action_274 action_193 (349) = happyShift action_275 action_193 (225) = happyGoto action_568 action_193 (226) = happyGoto action_263 action_193 (228) = happyGoto action_264 action_193 (232) = happyGoto action_569 action_193 (236) = happyGoto action_441 action_193 _ = happyFail action_194 (339) = happyShift action_328 action_194 (343) = happyShift action_296 action_194 (236) = happyGoto action_567 action_194 _ = happyFail action_195 (306) = happyShift action_565 action_195 (342) = happyShift action_566 action_195 _ = happyFail action_196 _ = happyReduce_189 action_197 (332) = happyShift action_559 action_197 (358) = happyShift action_560 action_197 (86) = happyGoto action_564 action_197 _ = happyFail action_198 (343) = happyShift action_563 action_198 _ = happyReduce_515 action_199 (306) = happyShift action_561 action_199 (342) = happyShift action_562 action_199 _ = happyFail action_200 _ = happyReduce_194 action_201 (332) = happyShift action_559 action_201 (358) = happyShift action_560 action_201 (86) = happyGoto action_558 action_201 _ = happyFail action_202 (306) = happyShift action_556 action_202 (342) = happyShift action_557 action_202 _ = happyFail action_203 _ = happyReduce_174 action_204 (332) = happyShift action_349 action_204 (77) = happyGoto action_555 action_204 (78) = happyGoto action_348 action_204 _ = happyReduce_177 action_205 _ = happyReduce_99 action_206 (280) = happyShift action_550 action_206 (281) = happyShift action_551 action_206 (282) = happyShift action_552 action_206 (283) = happyShift action_553 action_206 (90) = happyGoto action_554 action_206 _ = happyFail action_207 (280) = happyShift action_550 action_207 (281) = happyShift action_551 action_207 (282) = happyShift action_552 action_207 (283) = happyShift action_553 action_207 (90) = happyGoto action_549 action_207 _ = happyFail action_208 (245) = happyShift action_37 action_208 (253) = happyShift action_40 action_208 (265) = happyShift action_46 action_208 (272) = happyShift action_49 action_208 (273) = happyShift action_50 action_208 (274) = happyShift action_51 action_208 (275) = happyShift action_221 action_208 (276) = happyShift action_222 action_208 (277) = happyShift action_223 action_208 (280) = happyShift action_57 action_208 (281) = happyShift action_58 action_208 (282) = happyShift action_59 action_208 (283) = happyShift action_60 action_208 (286) = happyShift action_62 action_208 (299) = happyShift action_225 action_208 (300) = happyShift action_226 action_208 (321) = happyShift action_227 action_208 (328) = happyShift action_228 action_208 (332) = happyShift action_229 action_208 (334) = happyShift action_230 action_208 (336) = happyShift action_231 action_208 (338) = happyShift action_232 action_208 (345) = happyShift action_233 action_208 (346) = happyShift action_234 action_208 (347) = happyShift action_235 action_208 (351) = happyShift action_236 action_208 (355) = happyShift action_237 action_208 (358) = happyShift action_238 action_208 (359) = happyShift action_239 action_208 (376) = happyShift action_240 action_208 (377) = happyShift action_241 action_208 (379) = happyShift action_102 action_208 (380) = happyShift action_103 action_208 (100) = happyGoto action_208 action_208 (107) = happyGoto action_548 action_208 (142) = happyGoto action_212 action_208 (202) = happyGoto action_213 action_208 (203) = happyGoto action_214 action_208 (205) = happyGoto action_215 action_208 (206) = happyGoto action_216 action_208 (215) = happyGoto action_217 action_208 (217) = happyGoto action_218 action_208 (227) = happyGoto action_219 action_208 _ = happyFail action_209 (310) = happyShift action_547 action_209 _ = happyFail action_210 (245) = happyShift action_37 action_210 (253) = happyShift action_40 action_210 (265) = happyShift action_46 action_210 (272) = happyShift action_49 action_210 (273) = happyShift action_50 action_210 (274) = happyShift action_51 action_210 (275) = happyShift action_221 action_210 (276) = happyShift action_222 action_210 (277) = happyShift action_223 action_210 (280) = happyShift action_57 action_210 (281) = happyShift action_58 action_210 (282) = happyShift action_59 action_210 (283) = happyShift action_60 action_210 (286) = happyShift action_62 action_210 (299) = happyShift action_225 action_210 (300) = happyShift action_226 action_210 (315) = happyShift action_521 action_210 (317) = happyShift action_546 action_210 (321) = happyShift action_227 action_210 (322) = happyShift action_460 action_210 (327) = happyShift action_523 action_210 (328) = happyShift action_228 action_210 (332) = happyShift action_229 action_210 (334) = happyShift action_230 action_210 (336) = happyShift action_231 action_210 (338) = happyShift action_232 action_210 (344) = happyShift action_524 action_210 (345) = happyShift action_525 action_210 (346) = happyShift action_234 action_210 (347) = happyShift action_235 action_210 (348) = happyShift action_462 action_210 (349) = happyShift action_463 action_210 (351) = happyShift action_236 action_210 (352) = happyShift action_464 action_210 (353) = happyShift action_465 action_210 (355) = happyShift action_237 action_210 (358) = happyShift action_238 action_210 (359) = happyShift action_239 action_210 (376) = happyShift action_240 action_210 (377) = happyShift action_241 action_210 (379) = happyShift action_102 action_210 (380) = happyShift action_103 action_210 (100) = happyGoto action_208 action_210 (107) = happyGoto action_517 action_210 (142) = happyGoto action_212 action_210 (202) = happyGoto action_213 action_210 (203) = happyGoto action_214 action_210 (204) = happyGoto action_518 action_210 (205) = happyGoto action_215 action_210 (206) = happyGoto action_216 action_210 (207) = happyGoto action_519 action_210 (208) = happyGoto action_455 action_210 (215) = happyGoto action_217 action_210 (216) = happyGoto action_520 action_210 (217) = happyGoto action_218 action_210 (227) = happyGoto action_219 action_210 _ = happyReduce_241 action_211 _ = happyReduce_260 action_212 _ = happyReduce_273 action_213 _ = happyReduce_261 action_214 _ = happyReduce_539 action_215 _ = happyReduce_546 action_216 _ = happyReduce_553 action_217 _ = happyReduce_262 action_218 _ = happyReduce_573 action_219 _ = happyReduce_577 action_220 (245) = happyShift action_37 action_220 (253) = happyShift action_40 action_220 (265) = happyShift action_46 action_220 (272) = happyShift action_49 action_220 (273) = happyShift action_50 action_220 (274) = happyShift action_51 action_220 (275) = happyShift action_221 action_220 (276) = happyShift action_222 action_220 (277) = happyShift action_223 action_220 (280) = happyShift action_57 action_220 (281) = happyShift action_58 action_220 (282) = happyShift action_59 action_220 (283) = happyShift action_60 action_220 (286) = happyShift action_62 action_220 (299) = happyShift action_225 action_220 (300) = happyShift action_226 action_220 (321) = happyShift action_227 action_220 (328) = happyShift action_228 action_220 (332) = happyShift action_229 action_220 (334) = happyShift action_230 action_220 (336) = happyShift action_231 action_220 (338) = happyShift action_232 action_220 (345) = happyShift action_233 action_220 (346) = happyShift action_234 action_220 (347) = happyShift action_235 action_220 (351) = happyShift action_236 action_220 (355) = happyShift action_237 action_220 (358) = happyShift action_238 action_220 (359) = happyShift action_239 action_220 (376) = happyShift action_240 action_220 (377) = happyShift action_241 action_220 (379) = happyShift action_102 action_220 (380) = happyShift action_103 action_220 (100) = happyGoto action_208 action_220 (104) = happyGoto action_545 action_220 (106) = happyGoto action_210 action_220 (107) = happyGoto action_211 action_220 (142) = happyGoto action_212 action_220 (202) = happyGoto action_213 action_220 (203) = happyGoto action_214 action_220 (205) = happyGoto action_215 action_220 (206) = happyGoto action_216 action_220 (215) = happyGoto action_217 action_220 (217) = happyGoto action_218 action_220 (227) = happyGoto action_219 action_220 _ = happyFail action_221 _ = happyReduce_579 action_222 _ = happyReduce_580 action_223 _ = happyReduce_578 action_224 (245) = happyShift action_37 action_224 (253) = happyShift action_40 action_224 (265) = happyShift action_46 action_224 (272) = happyShift action_49 action_224 (273) = happyShift action_50 action_224 (274) = happyShift action_51 action_224 (275) = happyShift action_221 action_224 (276) = happyShift action_222 action_224 (277) = happyShift action_223 action_224 (280) = happyShift action_57 action_224 (281) = happyShift action_58 action_224 (282) = happyShift action_59 action_224 (283) = happyShift action_60 action_224 (286) = happyShift action_62 action_224 (299) = happyShift action_225 action_224 (300) = happyShift action_226 action_224 (321) = happyShift action_227 action_224 (328) = happyShift action_228 action_224 (332) = happyShift action_229 action_224 (334) = happyShift action_230 action_224 (336) = happyShift action_231 action_224 (338) = happyShift action_232 action_224 (345) = happyShift action_233 action_224 (346) = happyShift action_234 action_224 (347) = happyShift action_235 action_224 (351) = happyShift action_236 action_224 (355) = happyShift action_237 action_224 (358) = happyShift action_238 action_224 (359) = happyShift action_239 action_224 (376) = happyShift action_240 action_224 (377) = happyShift action_241 action_224 (379) = happyShift action_102 action_224 (380) = happyShift action_103 action_224 (100) = happyGoto action_208 action_224 (104) = happyGoto action_544 action_224 (106) = happyGoto action_210 action_224 (107) = happyGoto action_211 action_224 (142) = happyGoto action_212 action_224 (202) = happyGoto action_213 action_224 (203) = happyGoto action_214 action_224 (205) = happyGoto action_215 action_224 (206) = happyGoto action_216 action_224 (215) = happyGoto action_217 action_224 (217) = happyGoto action_218 action_224 (227) = happyGoto action_219 action_224 _ = happyFail action_225 (306) = happyShift action_543 action_225 _ = happyFail action_226 (306) = happyShift action_542 action_226 _ = happyFail action_227 _ = happyReduce_228 action_228 (329) = happyReduce_332 action_228 (367) = happyShift action_145 action_228 (131) = happyGoto action_537 action_228 (132) = happyGoto action_538 action_228 (133) = happyGoto action_539 action_228 (237) = happyGoto action_540 action_228 (243) = happyGoto action_541 action_228 _ = happyReduce_649 action_229 (245) = happyShift action_37 action_229 (253) = happyShift action_40 action_229 (265) = happyShift action_46 action_229 (270) = happyShift action_249 action_229 (272) = happyShift action_49 action_229 (273) = happyShift action_50 action_229 (274) = happyShift action_51 action_229 (275) = happyShift action_221 action_229 (276) = happyShift action_222 action_229 (277) = happyShift action_223 action_229 (280) = happyShift action_57 action_229 (281) = happyShift action_58 action_229 (282) = happyShift action_59 action_229 (283) = happyShift action_60 action_229 (286) = happyShift action_62 action_229 (299) = happyShift action_225 action_229 (300) = happyShift action_226 action_229 (321) = happyShift action_227 action_229 (328) = happyShift action_228 action_229 (332) = happyShift action_229 action_229 (333) = happyShift action_467 action_229 (334) = happyShift action_230 action_229 (336) = happyShift action_231 action_229 (338) = happyShift action_232 action_229 (345) = happyShift action_233 action_229 (346) = happyShift action_234 action_229 (347) = happyShift action_235 action_229 (351) = happyShift action_236 action_229 (355) = happyShift action_237 action_229 (356) = happyShift action_84 action_229 (358) = happyShift action_238 action_229 (359) = happyShift action_239 action_229 (376) = happyShift action_240 action_229 (377) = happyShift action_241 action_229 (379) = happyShift action_102 action_229 (380) = happyShift action_103 action_229 (100) = happyGoto action_208 action_229 (101) = happyGoto action_536 action_229 (103) = happyGoto action_244 action_229 (104) = happyGoto action_245 action_229 (106) = happyGoto action_246 action_229 (107) = happyGoto action_211 action_229 (142) = happyGoto action_212 action_229 (192) = happyGoto action_248 action_229 (202) = happyGoto action_213 action_229 (203) = happyGoto action_214 action_229 (205) = happyGoto action_215 action_229 (206) = happyGoto action_216 action_229 (215) = happyGoto action_217 action_229 (217) = happyGoto action_218 action_229 (227) = happyGoto action_219 action_229 _ = happyFail action_230 (245) = happyShift action_37 action_230 (253) = happyShift action_40 action_230 (265) = happyShift action_46 action_230 (270) = happyShift action_249 action_230 (272) = happyShift action_49 action_230 (273) = happyShift action_50 action_230 (274) = happyShift action_51 action_230 (275) = happyShift action_221 action_230 (276) = happyShift action_222 action_230 (277) = happyShift action_223 action_230 (280) = happyShift action_57 action_230 (281) = happyShift action_58 action_230 (282) = happyShift action_59 action_230 (283) = happyShift action_60 action_230 (286) = happyShift action_62 action_230 (299) = happyShift action_225 action_230 (300) = happyShift action_226 action_230 (321) = happyShift action_227 action_230 (328) = happyShift action_228 action_230 (332) = happyShift action_229 action_230 (334) = happyShift action_230 action_230 (335) = happyShift action_466 action_230 (336) = happyShift action_231 action_230 (338) = happyShift action_232 action_230 (345) = happyShift action_233 action_230 (346) = happyShift action_234 action_230 (347) = happyShift action_235 action_230 (351) = happyShift action_236 action_230 (355) = happyShift action_237 action_230 (356) = happyShift action_84 action_230 (358) = happyShift action_238 action_230 (359) = happyShift action_239 action_230 (376) = happyShift action_240 action_230 (377) = happyShift action_241 action_230 (379) = happyShift action_102 action_230 (380) = happyShift action_103 action_230 (100) = happyGoto action_208 action_230 (101) = happyGoto action_535 action_230 (103) = happyGoto action_244 action_230 (104) = happyGoto action_245 action_230 (106) = happyGoto action_246 action_230 (107) = happyGoto action_211 action_230 (142) = happyGoto action_212 action_230 (192) = happyGoto action_248 action_230 (202) = happyGoto action_213 action_230 (203) = happyGoto action_214 action_230 (205) = happyGoto action_215 action_230 (206) = happyGoto action_216 action_230 (215) = happyGoto action_217 action_230 (217) = happyGoto action_218 action_230 (227) = happyGoto action_219 action_230 _ = happyFail action_231 (245) = happyShift action_37 action_231 (253) = happyShift action_40 action_231 (265) = happyShift action_46 action_231 (270) = happyShift action_249 action_231 (272) = happyShift action_49 action_231 (273) = happyShift action_50 action_231 (274) = happyShift action_51 action_231 (275) = happyShift action_221 action_231 (276) = happyShift action_222 action_231 (277) = happyShift action_223 action_231 (280) = happyShift action_57 action_231 (281) = happyShift action_58 action_231 (282) = happyShift action_59 action_231 (283) = happyShift action_60 action_231 (286) = happyShift action_62 action_231 (299) = happyShift action_225 action_231 (300) = happyShift action_226 action_231 (315) = happyShift action_457 action_231 (317) = happyShift action_458 action_231 (318) = happyShift action_459 action_231 (321) = happyShift action_227 action_231 (322) = happyShift action_460 action_231 (328) = happyShift action_228 action_231 (332) = happyShift action_229 action_231 (334) = happyShift action_230 action_231 (336) = happyShift action_231 action_231 (337) = happyShift action_534 action_231 (338) = happyShift action_232 action_231 (343) = happyShift action_296 action_231 (345) = happyShift action_233 action_231 (346) = happyShift action_234 action_231 (347) = happyShift action_235 action_231 (348) = happyShift action_462 action_231 (349) = happyShift action_463 action_231 (351) = happyShift action_236 action_231 (352) = happyShift action_464 action_231 (353) = happyShift action_465 action_231 (355) = happyShift action_237 action_231 (356) = happyShift action_84 action_231 (358) = happyShift action_238 action_231 (359) = happyShift action_239 action_231 (376) = happyShift action_240 action_231 (377) = happyShift action_241 action_231 (379) = happyShift action_102 action_231 (380) = happyShift action_103 action_231 (100) = happyGoto action_208 action_231 (101) = happyGoto action_533 action_231 (103) = happyGoto action_244 action_231 (104) = happyGoto action_245 action_231 (106) = happyGoto action_246 action_231 (107) = happyGoto action_211 action_231 (142) = happyGoto action_212 action_231 (192) = happyGoto action_248 action_231 (202) = happyGoto action_213 action_231 (203) = happyGoto action_214 action_231 (205) = happyGoto action_215 action_231 (206) = happyGoto action_216 action_231 (207) = happyGoto action_454 action_231 (208) = happyGoto action_455 action_231 (215) = happyGoto action_217 action_231 (217) = happyGoto action_218 action_231 (227) = happyGoto action_219 action_231 (236) = happyGoto action_456 action_231 _ = happyFail action_232 (245) = happyShift action_37 action_232 (253) = happyShift action_40 action_232 (265) = happyShift action_46 action_232 (270) = happyShift action_249 action_232 (272) = happyShift action_49 action_232 (273) = happyShift action_50 action_232 (274) = happyShift action_51 action_232 (275) = happyShift action_221 action_232 (276) = happyShift action_222 action_232 (277) = happyShift action_223 action_232 (280) = happyShift action_57 action_232 (281) = happyShift action_58 action_232 (282) = happyShift action_59 action_232 (283) = happyShift action_60 action_232 (286) = happyShift action_62 action_232 (299) = happyShift action_225 action_232 (300) = happyShift action_226 action_232 (321) = happyShift action_227 action_232 (328) = happyShift action_228 action_232 (332) = happyShift action_229 action_232 (334) = happyShift action_230 action_232 (336) = happyShift action_231 action_232 (338) = happyShift action_232 action_232 (339) = happyShift action_532 action_232 (343) = happyShift action_296 action_232 (345) = happyShift action_233 action_232 (346) = happyShift action_234 action_232 (347) = happyShift action_235 action_232 (351) = happyShift action_236 action_232 (355) = happyShift action_237 action_232 (356) = happyShift action_84 action_232 (358) = happyShift action_238 action_232 (359) = happyShift action_239 action_232 (376) = happyShift action_240 action_232 (377) = happyShift action_241 action_232 (379) = happyShift action_102 action_232 (380) = happyShift action_103 action_232 (100) = happyGoto action_208 action_232 (101) = happyGoto action_506 action_232 (103) = happyGoto action_244 action_232 (104) = happyGoto action_245 action_232 (106) = happyGoto action_246 action_232 (107) = happyGoto action_211 action_232 (111) = happyGoto action_531 action_232 (142) = happyGoto action_212 action_232 (192) = happyGoto action_248 action_232 (202) = happyGoto action_213 action_232 (203) = happyGoto action_214 action_232 (205) = happyGoto action_215 action_232 (206) = happyGoto action_216 action_232 (215) = happyGoto action_217 action_232 (217) = happyGoto action_218 action_232 (227) = happyGoto action_219 action_232 (236) = happyGoto action_452 action_232 _ = happyFail action_233 (332) = happyShift action_529 action_233 (336) = happyShift action_530 action_233 (347) = happyShift action_79 action_233 (351) = happyShift action_81 action_233 (355) = happyShift action_83 action_233 (229) = happyGoto action_528 action_233 (230) = happyGoto action_34 action_233 _ = happyFail action_234 _ = happyReduce_576 action_235 _ = happyReduce_554 action_236 _ = happyReduce_551 action_237 _ = happyReduce_552 action_238 _ = happyReduce_282 action_239 _ = happyReduce_281 action_240 _ = happyReduce_275 action_241 (244) = happyShift action_36 action_241 (245) = happyShift action_37 action_241 (246) = happyShift action_38 action_241 (251) = happyShift action_39 action_241 (253) = happyShift action_40 action_241 (254) = happyShift action_41 action_241 (261) = happyShift action_45 action_241 (265) = happyShift action_46 action_241 (269) = happyShift action_47 action_241 (270) = happyShift action_48 action_241 (272) = happyShift action_49 action_241 (273) = happyShift action_50 action_241 (274) = happyShift action_51 action_241 (275) = happyShift action_52 action_241 (276) = happyShift action_53 action_241 (277) = happyShift action_54 action_241 (278) = happyShift action_55 action_241 (279) = happyShift action_56 action_241 (280) = happyShift action_57 action_241 (281) = happyShift action_58 action_241 (282) = happyShift action_59 action_241 (283) = happyShift action_60 action_241 (284) = happyShift action_61 action_241 (286) = happyShift action_62 action_241 (294) = happyShift action_66 action_241 (295) = happyShift action_67 action_241 (296) = happyShift action_68 action_241 (311) = happyShift action_69 action_241 (317) = happyShift action_70 action_241 (320) = happyShift action_71 action_241 (332) = happyShift action_72 action_241 (334) = happyShift action_73 action_241 (336) = happyShift action_112 action_241 (338) = happyShift action_75 action_241 (340) = happyShift action_76 action_241 (345) = happyShift action_77 action_241 (346) = happyShift action_78 action_241 (347) = happyShift action_79 action_241 (350) = happyShift action_80 action_241 (351) = happyShift action_81 action_241 (354) = happyShift action_82 action_241 (355) = happyShift action_83 action_241 (356) = happyShift action_84 action_241 (357) = happyShift action_85 action_241 (358) = happyShift action_86 action_241 (359) = happyShift action_87 action_241 (360) = happyShift action_88 action_241 (361) = happyShift action_89 action_241 (362) = happyShift action_90 action_241 (363) = happyShift action_91 action_241 (364) = happyShift action_92 action_241 (365) = happyShift action_93 action_241 (366) = happyShift action_94 action_241 (371) = happyShift action_95 action_241 (372) = happyShift action_96 action_241 (373) = happyShift action_97 action_241 (374) = happyShift action_98 action_241 (376) = happyShift action_99 action_241 (377) = happyShift action_100 action_241 (378) = happyShift action_101 action_241 (379) = happyShift action_102 action_241 (380) = happyShift action_103 action_241 (38) = happyGoto action_13 action_241 (142) = happyGoto action_16 action_241 (143) = happyGoto action_527 action_241 (144) = happyGoto action_110 action_241 (145) = happyGoto action_18 action_241 (147) = happyGoto action_19 action_241 (148) = happyGoto action_20 action_241 (149) = happyGoto action_21 action_241 (150) = happyGoto action_22 action_241 (151) = happyGoto action_23 action_241 (152) = happyGoto action_24 action_241 (192) = happyGoto action_25 action_241 (195) = happyGoto action_26 action_241 (198) = happyGoto action_27 action_241 (219) = happyGoto action_29 action_241 (220) = happyGoto action_30 action_241 (221) = happyGoto action_111 action_241 (227) = happyGoto action_32 action_241 (229) = happyGoto action_33 action_241 (230) = happyGoto action_34 action_241 (233) = happyGoto action_35 action_241 _ = happyFail action_242 _ = happyReduce_283 action_243 _ = happyReduce_220 action_244 (319) = happyShift action_526 action_244 _ = happyFail action_245 _ = happyReduce_234 action_246 (245) = happyShift action_37 action_246 (253) = happyShift action_40 action_246 (265) = happyShift action_46 action_246 (272) = happyShift action_49 action_246 (273) = happyShift action_50 action_246 (274) = happyShift action_51 action_246 (275) = happyShift action_221 action_246 (276) = happyShift action_222 action_246 (277) = happyShift action_223 action_246 (280) = happyShift action_57 action_246 (281) = happyShift action_58 action_246 (282) = happyShift action_59 action_246 (283) = happyShift action_60 action_246 (286) = happyShift action_62 action_246 (299) = happyShift action_225 action_246 (300) = happyShift action_226 action_246 (315) = happyShift action_521 action_246 (317) = happyShift action_522 action_246 (319) = happyReduce_240 action_246 (321) = happyShift action_227 action_246 (322) = happyShift action_460 action_246 (327) = happyShift action_523 action_246 (328) = happyShift action_228 action_246 (332) = happyShift action_229 action_246 (334) = happyShift action_230 action_246 (336) = happyShift action_231 action_246 (338) = happyShift action_232 action_246 (344) = happyShift action_524 action_246 (345) = happyShift action_525 action_246 (346) = happyShift action_234 action_246 (347) = happyShift action_235 action_246 (348) = happyShift action_462 action_246 (349) = happyShift action_463 action_246 (351) = happyShift action_236 action_246 (352) = happyShift action_464 action_246 (353) = happyShift action_465 action_246 (355) = happyShift action_237 action_246 (358) = happyShift action_238 action_246 (359) = happyShift action_239 action_246 (376) = happyShift action_240 action_246 (377) = happyShift action_241 action_246 (379) = happyShift action_102 action_246 (380) = happyShift action_103 action_246 (100) = happyGoto action_208 action_246 (107) = happyGoto action_517 action_246 (142) = happyGoto action_212 action_246 (202) = happyGoto action_213 action_246 (203) = happyGoto action_214 action_246 (204) = happyGoto action_518 action_246 (205) = happyGoto action_215 action_246 (206) = happyGoto action_216 action_246 (207) = happyGoto action_519 action_246 (208) = happyGoto action_455 action_246 (215) = happyGoto action_217 action_246 (216) = happyGoto action_520 action_246 (217) = happyGoto action_218 action_246 (227) = happyGoto action_219 action_246 _ = happyReduce_241 action_247 (268) = happyShift action_516 action_247 (70) = happyGoto action_515 action_247 _ = happyReduce_160 action_248 (309) = happyShift action_514 action_248 _ = happyFail action_249 (245) = happyShift action_37 action_249 (253) = happyShift action_40 action_249 (265) = happyShift action_46 action_249 (272) = happyShift action_49 action_249 (273) = happyShift action_50 action_249 (274) = happyShift action_51 action_249 (275) = happyShift action_221 action_249 (276) = happyShift action_222 action_249 (277) = happyShift action_223 action_249 (280) = happyShift action_57 action_249 (281) = happyShift action_58 action_249 (282) = happyShift action_59 action_249 (283) = happyShift action_60 action_249 (286) = happyShift action_62 action_249 (336) = happyShift action_513 action_249 (346) = happyShift action_234 action_249 (112) = happyGoto action_510 action_249 (113) = happyGoto action_511 action_249 (215) = happyGoto action_512 action_249 (217) = happyGoto action_218 action_249 (227) = happyGoto action_219 action_249 _ = happyReduce_291 action_250 (245) = happyShift action_37 action_250 (253) = happyShift action_40 action_250 (265) = happyShift action_46 action_250 (270) = happyShift action_249 action_250 (272) = happyShift action_49 action_250 (273) = happyShift action_50 action_250 (274) = happyShift action_51 action_250 (275) = happyShift action_221 action_250 (276) = happyShift action_222 action_250 (277) = happyShift action_223 action_250 (280) = happyShift action_57 action_250 (281) = happyShift action_58 action_250 (282) = happyShift action_59 action_250 (283) = happyShift action_60 action_250 (286) = happyShift action_62 action_250 (299) = happyShift action_225 action_250 (300) = happyShift action_226 action_250 (321) = happyShift action_227 action_250 (328) = happyShift action_228 action_250 (332) = happyShift action_229 action_250 (334) = happyShift action_230 action_250 (336) = happyShift action_231 action_250 (338) = happyShift action_232 action_250 (345) = happyShift action_233 action_250 (346) = happyShift action_234 action_250 (347) = happyShift action_235 action_250 (351) = happyShift action_236 action_250 (355) = happyShift action_237 action_250 (356) = happyShift action_84 action_250 (358) = happyShift action_238 action_250 (359) = happyShift action_239 action_250 (376) = happyShift action_240 action_250 (377) = happyShift action_241 action_250 (379) = happyShift action_102 action_250 (380) = happyShift action_103 action_250 (95) = happyGoto action_242 action_250 (100) = happyGoto action_208 action_250 (101) = happyGoto action_243 action_250 (103) = happyGoto action_244 action_250 (104) = happyGoto action_245 action_250 (106) = happyGoto action_246 action_250 (107) = happyGoto action_211 action_250 (108) = happyGoto action_509 action_250 (142) = happyGoto action_212 action_250 (192) = happyGoto action_248 action_250 (202) = happyGoto action_213 action_250 (203) = happyGoto action_214 action_250 (205) = happyGoto action_215 action_250 (206) = happyGoto action_216 action_250 (215) = happyGoto action_217 action_250 (217) = happyGoto action_218 action_250 (227) = happyGoto action_219 action_250 _ = happyFail action_251 (245) = happyShift action_37 action_251 (253) = happyShift action_40 action_251 (265) = happyShift action_46 action_251 (270) = happyShift action_249 action_251 (272) = happyShift action_49 action_251 (273) = happyShift action_50 action_251 (274) = happyShift action_51 action_251 (275) = happyShift action_221 action_251 (276) = happyShift action_222 action_251 (277) = happyShift action_223 action_251 (280) = happyShift action_57 action_251 (281) = happyShift action_58 action_251 (282) = happyShift action_59 action_251 (283) = happyShift action_60 action_251 (286) = happyShift action_62 action_251 (299) = happyShift action_225 action_251 (300) = happyShift action_226 action_251 (321) = happyShift action_227 action_251 (328) = happyShift action_228 action_251 (332) = happyShift action_229 action_251 (334) = happyShift action_230 action_251 (336) = happyShift action_231 action_251 (338) = happyShift action_232 action_251 (345) = happyShift action_233 action_251 (346) = happyShift action_234 action_251 (347) = happyShift action_235 action_251 (351) = happyShift action_236 action_251 (355) = happyShift action_237 action_251 (356) = happyShift action_84 action_251 (358) = happyShift action_238 action_251 (359) = happyShift action_239 action_251 (376) = happyShift action_240 action_251 (377) = happyShift action_241 action_251 (379) = happyShift action_102 action_251 (380) = happyShift action_103 action_251 (100) = happyGoto action_208 action_251 (101) = happyGoto action_506 action_251 (103) = happyGoto action_244 action_251 (104) = happyGoto action_245 action_251 (106) = happyGoto action_246 action_251 (107) = happyGoto action_211 action_251 (110) = happyGoto action_507 action_251 (111) = happyGoto action_508 action_251 (142) = happyGoto action_212 action_251 (192) = happyGoto action_248 action_251 (202) = happyGoto action_213 action_251 (203) = happyGoto action_214 action_251 (205) = happyGoto action_215 action_251 (206) = happyGoto action_216 action_251 (215) = happyGoto action_217 action_251 (217) = happyGoto action_218 action_251 (227) = happyGoto action_219 action_251 _ = happyReduce_287 action_252 (245) = happyShift action_37 action_252 (253) = happyShift action_40 action_252 (265) = happyShift action_46 action_252 (272) = happyShift action_49 action_252 (273) = happyShift action_50 action_252 (274) = happyShift action_51 action_252 (275) = happyShift action_221 action_252 (276) = happyShift action_222 action_252 (277) = happyShift action_223 action_252 (280) = happyShift action_57 action_252 (281) = happyShift action_58 action_252 (282) = happyShift action_59 action_252 (283) = happyShift action_60 action_252 (286) = happyShift action_62 action_252 (299) = happyShift action_225 action_252 (300) = happyShift action_226 action_252 (321) = happyShift action_227 action_252 (328) = happyShift action_228 action_252 (332) = happyShift action_229 action_252 (334) = happyShift action_230 action_252 (336) = happyShift action_231 action_252 (338) = happyShift action_232 action_252 (345) = happyShift action_233 action_252 (346) = happyShift action_234 action_252 (347) = happyShift action_235 action_252 (351) = happyShift action_236 action_252 (355) = happyShift action_237 action_252 (358) = happyShift action_238 action_252 (359) = happyShift action_239 action_252 (376) = happyShift action_240 action_252 (377) = happyShift action_241 action_252 (379) = happyShift action_102 action_252 (380) = happyShift action_103 action_252 (100) = happyGoto action_208 action_252 (104) = happyGoto action_505 action_252 (106) = happyGoto action_210 action_252 (107) = happyGoto action_211 action_252 (142) = happyGoto action_212 action_252 (202) = happyGoto action_213 action_252 (203) = happyGoto action_214 action_252 (205) = happyGoto action_215 action_252 (206) = happyGoto action_216 action_252 (215) = happyGoto action_217 action_252 (217) = happyGoto action_218 action_252 (227) = happyGoto action_219 action_252 _ = happyFail action_253 (313) = happyShift action_504 action_253 (114) = happyGoto action_503 action_253 _ = happyReduce_294 action_254 (319) = happyShift action_502 action_254 _ = happyFail action_255 _ = happyReduce_135 action_256 (310) = happyShift action_500 action_256 (313) = happyShift action_501 action_256 (138) = happyGoto action_497 action_256 (139) = happyGoto action_498 action_256 (140) = happyGoto action_499 action_256 _ = happyFail action_257 _ = happyReduce_566 action_258 (244) = happyShift action_36 action_258 (245) = happyShift action_37 action_258 (246) = happyShift action_38 action_258 (251) = happyShift action_39 action_258 (253) = happyShift action_40 action_258 (254) = happyShift action_41 action_258 (261) = happyShift action_45 action_258 (265) = happyShift action_46 action_258 (269) = happyShift action_47 action_258 (270) = happyShift action_48 action_258 (272) = happyShift action_49 action_258 (273) = happyShift action_50 action_258 (274) = happyShift action_51 action_258 (275) = happyShift action_52 action_258 (276) = happyShift action_53 action_258 (277) = happyShift action_54 action_258 (278) = happyShift action_55 action_258 (279) = happyShift action_56 action_258 (280) = happyShift action_57 action_258 (281) = happyShift action_58 action_258 (282) = happyShift action_59 action_258 (283) = happyShift action_60 action_258 (284) = happyShift action_61 action_258 (286) = happyShift action_62 action_258 (294) = happyShift action_66 action_258 (295) = happyShift action_67 action_258 (296) = happyShift action_68 action_258 (311) = happyShift action_69 action_258 (317) = happyShift action_70 action_258 (320) = happyShift action_71 action_258 (332) = happyShift action_72 action_258 (334) = happyShift action_73 action_258 (336) = happyShift action_112 action_258 (338) = happyShift action_75 action_258 (340) = happyShift action_76 action_258 (345) = happyShift action_77 action_258 (346) = happyShift action_78 action_258 (347) = happyShift action_79 action_258 (350) = happyShift action_80 action_258 (351) = happyShift action_81 action_258 (354) = happyShift action_82 action_258 (355) = happyShift action_83 action_258 (356) = happyShift action_84 action_258 (357) = happyShift action_85 action_258 (358) = happyShift action_86 action_258 (359) = happyShift action_87 action_258 (360) = happyShift action_88 action_258 (361) = happyShift action_89 action_258 (362) = happyShift action_90 action_258 (363) = happyShift action_91 action_258 (364) = happyShift action_92 action_258 (365) = happyShift action_93 action_258 (366) = happyShift action_94 action_258 (371) = happyShift action_95 action_258 (372) = happyShift action_96 action_258 (373) = happyShift action_97 action_258 (374) = happyShift action_98 action_258 (376) = happyShift action_99 action_258 (377) = happyShift action_100 action_258 (378) = happyShift action_101 action_258 (379) = happyShift action_102 action_258 (380) = happyShift action_103 action_258 (38) = happyGoto action_13 action_258 (142) = happyGoto action_16 action_258 (145) = happyGoto action_496 action_258 (147) = happyGoto action_19 action_258 (148) = happyGoto action_20 action_258 (149) = happyGoto action_21 action_258 (150) = happyGoto action_22 action_258 (151) = happyGoto action_23 action_258 (152) = happyGoto action_24 action_258 (192) = happyGoto action_25 action_258 (195) = happyGoto action_26 action_258 (198) = happyGoto action_27 action_258 (219) = happyGoto action_29 action_258 (220) = happyGoto action_30 action_258 (221) = happyGoto action_111 action_258 (227) = happyGoto action_32 action_258 (229) = happyGoto action_33 action_258 (230) = happyGoto action_34 action_258 (233) = happyGoto action_35 action_258 _ = happyFail action_259 _ = happyReduce_565 action_260 _ = happyReduce_569 action_261 _ = happyReduce_597 action_262 _ = happyReduce_596 action_263 _ = happyReduce_601 action_264 _ = happyReduce_604 action_265 _ = happyReduce_534 action_266 _ = happyReduce_623 action_267 _ = happyReduce_626 action_268 (245) = happyShift action_37 action_268 (253) = happyShift action_40 action_268 (265) = happyShift action_46 action_268 (270) = happyShift action_495 action_268 (272) = happyShift action_49 action_268 (273) = happyShift action_50 action_268 (274) = happyShift action_51 action_268 (275) = happyShift action_221 action_268 (276) = happyShift action_222 action_268 (277) = happyShift action_223 action_268 (280) = happyShift action_57 action_268 (281) = happyShift action_58 action_268 (282) = happyShift action_59 action_268 (283) = happyShift action_60 action_268 (286) = happyShift action_62 action_268 (299) = happyShift action_225 action_268 (300) = happyShift action_226 action_268 (321) = happyShift action_227 action_268 (328) = happyShift action_228 action_268 (332) = happyShift action_229 action_268 (334) = happyShift action_230 action_268 (336) = happyShift action_231 action_268 (338) = happyShift action_232 action_268 (345) = happyShift action_233 action_268 (346) = happyShift action_234 action_268 (347) = happyShift action_235 action_268 (351) = happyShift action_236 action_268 (355) = happyShift action_237 action_268 (356) = happyShift action_84 action_268 (358) = happyShift action_238 action_268 (359) = happyShift action_239 action_268 (376) = happyShift action_240 action_268 (377) = happyShift action_241 action_268 (379) = happyShift action_102 action_268 (380) = happyShift action_103 action_268 (95) = happyGoto action_491 action_268 (96) = happyGoto action_379 action_268 (100) = happyGoto action_208 action_268 (101) = happyGoto action_243 action_268 (102) = happyGoto action_380 action_268 (103) = happyGoto action_492 action_268 (104) = happyGoto action_245 action_268 (105) = happyGoto action_382 action_268 (106) = happyGoto action_493 action_268 (107) = happyGoto action_211 action_268 (142) = happyGoto action_212 action_268 (192) = happyGoto action_494 action_268 (202) = happyGoto action_213 action_268 (203) = happyGoto action_214 action_268 (205) = happyGoto action_215 action_268 (206) = happyGoto action_216 action_268 (215) = happyGoto action_217 action_268 (217) = happyGoto action_218 action_268 (227) = happyGoto action_219 action_268 _ = happyFail action_269 _ = happyReduce_602 action_270 _ = happyReduce_616 action_271 _ = happyReduce_618 action_272 _ = happyReduce_617 action_273 (245) = happyShift action_37 action_273 (253) = happyShift action_40 action_273 (265) = happyShift action_46 action_273 (270) = happyShift action_48 action_273 (272) = happyShift action_49 action_273 (273) = happyShift action_50 action_273 (274) = happyShift action_51 action_273 (275) = happyShift action_52 action_273 (276) = happyShift action_53 action_273 (277) = happyShift action_54 action_273 (279) = happyShift action_56 action_273 (280) = happyShift action_57 action_273 (281) = happyShift action_58 action_273 (282) = happyShift action_59 action_273 (283) = happyShift action_60 action_273 (286) = happyShift action_62 action_273 (346) = happyShift action_78 action_273 (347) = happyShift action_79 action_273 (350) = happyShift action_80 action_273 (351) = happyShift action_81 action_273 (354) = happyShift action_82 action_273 (355) = happyShift action_83 action_273 (220) = happyGoto action_490 action_273 (221) = happyGoto action_111 action_273 (227) = happyGoto action_32 action_273 (229) = happyGoto action_477 action_273 (230) = happyGoto action_34 action_273 _ = happyFail action_274 _ = happyReduce_603 action_275 _ = happyReduce_625 action_276 _ = happyReduce_600 action_277 _ = happyReduce_624 action_278 (245) = happyShift action_37 action_278 (253) = happyShift action_40 action_278 (265) = happyShift action_46 action_278 (272) = happyShift action_49 action_278 (273) = happyShift action_50 action_278 (274) = happyShift action_51 action_278 (275) = happyShift action_221 action_278 (276) = happyShift action_222 action_278 (277) = happyShift action_223 action_278 (280) = happyShift action_57 action_278 (281) = happyShift action_58 action_278 (282) = happyShift action_59 action_278 (283) = happyShift action_60 action_278 (286) = happyShift action_62 action_278 (299) = happyShift action_225 action_278 (300) = happyShift action_226 action_278 (321) = happyShift action_227 action_278 (328) = happyShift action_228 action_278 (332) = happyShift action_229 action_278 (334) = happyShift action_230 action_278 (336) = happyShift action_231 action_278 (338) = happyShift action_232 action_278 (345) = happyShift action_233 action_278 (346) = happyShift action_234 action_278 (347) = happyShift action_235 action_278 (351) = happyShift action_236 action_278 (355) = happyShift action_237 action_278 (358) = happyShift action_238 action_278 (359) = happyShift action_239 action_278 (376) = happyShift action_240 action_278 (377) = happyShift action_241 action_278 (379) = happyShift action_102 action_278 (380) = happyShift action_103 action_278 (60) = happyGoto action_489 action_278 (100) = happyGoto action_208 action_278 (103) = happyGoto action_254 action_278 (104) = happyGoto action_255 action_278 (106) = happyGoto action_246 action_278 (107) = happyGoto action_211 action_278 (142) = happyGoto action_212 action_278 (202) = happyGoto action_213 action_278 (203) = happyGoto action_214 action_278 (205) = happyGoto action_215 action_278 (206) = happyGoto action_216 action_278 (215) = happyGoto action_217 action_278 (217) = happyGoto action_218 action_278 (227) = happyGoto action_219 action_278 _ = happyFail action_279 (245) = happyShift action_37 action_279 (253) = happyShift action_40 action_279 (265) = happyShift action_46 action_279 (272) = happyShift action_49 action_279 (273) = happyShift action_50 action_279 (274) = happyShift action_51 action_279 (275) = happyShift action_221 action_279 (276) = happyShift action_222 action_279 (277) = happyShift action_223 action_279 (280) = happyShift action_57 action_279 (281) = happyShift action_58 action_279 (282) = happyShift action_59 action_279 (283) = happyShift action_60 action_279 (286) = happyShift action_62 action_279 (299) = happyShift action_225 action_279 (300) = happyShift action_226 action_279 (321) = happyShift action_227 action_279 (328) = happyShift action_228 action_279 (332) = happyShift action_229 action_279 (334) = happyShift action_230 action_279 (336) = happyShift action_231 action_279 (338) = happyShift action_232 action_279 (345) = happyShift action_233 action_279 (346) = happyShift action_234 action_279 (347) = happyShift action_235 action_279 (351) = happyShift action_236 action_279 (355) = happyShift action_237 action_279 (358) = happyShift action_238 action_279 (359) = happyShift action_239 action_279 (376) = happyShift action_240 action_279 (377) = happyShift action_241 action_279 (379) = happyShift action_102 action_279 (380) = happyShift action_103 action_279 (60) = happyGoto action_488 action_279 (100) = happyGoto action_208 action_279 (103) = happyGoto action_254 action_279 (104) = happyGoto action_255 action_279 (106) = happyGoto action_246 action_279 (107) = happyGoto action_211 action_279 (142) = happyGoto action_212 action_279 (202) = happyGoto action_213 action_279 (203) = happyGoto action_214 action_279 (205) = happyGoto action_215 action_279 (206) = happyGoto action_216 action_279 (215) = happyGoto action_217 action_279 (217) = happyGoto action_218 action_279 (227) = happyGoto action_219 action_279 _ = happyFail action_280 (358) = happyShift action_487 action_280 _ = happyFail action_281 (315) = happyShift action_486 action_281 _ = happyReduce_430 action_282 (308) = happyShift action_267 action_282 (309) = happyShift action_298 action_282 (320) = happyShift action_269 action_282 (321) = happyShift action_270 action_282 (322) = happyShift action_271 action_282 (323) = happyShift action_299 action_282 (324) = happyShift action_300 action_282 (325) = happyShift action_301 action_282 (326) = happyShift action_302 action_282 (327) = happyShift action_272 action_282 (344) = happyShift action_273 action_282 (348) = happyShift action_274 action_282 (349) = happyShift action_275 action_282 (352) = happyShift action_276 action_282 (353) = happyShift action_277 action_282 (200) = happyGoto action_257 action_282 (211) = happyGoto action_485 action_282 (213) = happyGoto action_259 action_282 (222) = happyGoto action_260 action_282 (224) = happyGoto action_261 action_282 (225) = happyGoto action_262 action_282 (226) = happyGoto action_263 action_282 (228) = happyGoto action_264 action_282 (231) = happyGoto action_265 action_282 (232) = happyGoto action_266 action_282 _ = happyReduce_369 action_283 (337) = happyShift action_484 action_283 (343) = happyShift action_296 action_283 (159) = happyGoto action_435 action_283 (236) = happyGoto action_436 action_283 _ = happyFail action_284 (337) = happyShift action_483 action_284 _ = happyFail action_285 _ = happyReduce_568 action_286 (244) = happyShift action_36 action_286 (245) = happyShift action_37 action_286 (246) = happyShift action_38 action_286 (251) = happyShift action_39 action_286 (253) = happyShift action_40 action_286 (254) = happyShift action_41 action_286 (261) = happyShift action_45 action_286 (265) = happyShift action_46 action_286 (269) = happyShift action_47 action_286 (270) = happyShift action_48 action_286 (272) = happyShift action_49 action_286 (273) = happyShift action_50 action_286 (274) = happyShift action_51 action_286 (275) = happyShift action_52 action_286 (276) = happyShift action_53 action_286 (277) = happyShift action_54 action_286 (278) = happyShift action_55 action_286 (279) = happyShift action_56 action_286 (280) = happyShift action_57 action_286 (281) = happyShift action_58 action_286 (282) = happyShift action_59 action_286 (283) = happyShift action_60 action_286 (284) = happyShift action_61 action_286 (286) = happyShift action_62 action_286 (294) = happyShift action_66 action_286 (295) = happyShift action_67 action_286 (296) = happyShift action_68 action_286 (311) = happyShift action_69 action_286 (317) = happyShift action_70 action_286 (320) = happyShift action_71 action_286 (332) = happyShift action_72 action_286 (334) = happyShift action_73 action_286 (336) = happyShift action_112 action_286 (338) = happyShift action_75 action_286 (340) = happyShift action_76 action_286 (345) = happyShift action_77 action_286 (346) = happyShift action_78 action_286 (347) = happyShift action_79 action_286 (350) = happyShift action_80 action_286 (351) = happyShift action_81 action_286 (354) = happyShift action_82 action_286 (355) = happyShift action_83 action_286 (356) = happyShift action_84 action_286 (357) = happyShift action_85 action_286 (358) = happyShift action_86 action_286 (359) = happyShift action_87 action_286 (360) = happyShift action_88 action_286 (361) = happyShift action_89 action_286 (362) = happyShift action_90 action_286 (363) = happyShift action_91 action_286 (364) = happyShift action_92 action_286 (365) = happyShift action_93 action_286 (366) = happyShift action_94 action_286 (371) = happyShift action_95 action_286 (372) = happyShift action_96 action_286 (373) = happyShift action_97 action_286 (374) = happyShift action_98 action_286 (376) = happyShift action_99 action_286 (377) = happyShift action_100 action_286 (378) = happyShift action_101 action_286 (379) = happyShift action_102 action_286 (380) = happyShift action_103 action_286 (38) = happyGoto action_13 action_286 (142) = happyGoto action_16 action_286 (144) = happyGoto action_482 action_286 (145) = happyGoto action_18 action_286 (147) = happyGoto action_19 action_286 (148) = happyGoto action_20 action_286 (149) = happyGoto action_21 action_286 (150) = happyGoto action_22 action_286 (151) = happyGoto action_23 action_286 (152) = happyGoto action_24 action_286 (192) = happyGoto action_25 action_286 (195) = happyGoto action_26 action_286 (198) = happyGoto action_27 action_286 (219) = happyGoto action_29 action_286 (220) = happyGoto action_30 action_286 (221) = happyGoto action_111 action_286 (227) = happyGoto action_32 action_286 (229) = happyGoto action_33 action_286 (230) = happyGoto action_34 action_286 (233) = happyGoto action_35 action_286 _ = happyFail action_287 _ = happyReduce_567 action_288 _ = happyReduce_571 action_289 (337) = happyShift action_481 action_289 _ = happyReduce_599 action_290 (337) = happyShift action_480 action_290 _ = happyFail action_291 (337) = happyReduce_601 action_291 _ = happyReduce_598 action_292 (337) = happyShift action_479 action_292 _ = happyReduce_534 action_293 (244) = happyShift action_36 action_293 (245) = happyShift action_37 action_293 (246) = happyShift action_38 action_293 (251) = happyShift action_39 action_293 (253) = happyShift action_40 action_293 (254) = happyShift action_41 action_293 (261) = happyShift action_45 action_293 (265) = happyShift action_46 action_293 (269) = happyShift action_47 action_293 (270) = happyShift action_48 action_293 (272) = happyShift action_49 action_293 (273) = happyShift action_50 action_293 (274) = happyShift action_51 action_293 (275) = happyShift action_52 action_293 (276) = happyShift action_53 action_293 (277) = happyShift action_54 action_293 (278) = happyShift action_55 action_293 (279) = happyShift action_56 action_293 (280) = happyShift action_57 action_293 (281) = happyShift action_58 action_293 (282) = happyShift action_59 action_293 (283) = happyShift action_60 action_293 (284) = happyShift action_61 action_293 (286) = happyShift action_62 action_293 (294) = happyShift action_66 action_293 (295) = happyShift action_67 action_293 (296) = happyShift action_68 action_293 (308) = happyShift action_267 action_293 (311) = happyShift action_69 action_293 (317) = happyShift action_70 action_293 (320) = happyShift action_71 action_293 (321) = happyShift action_270 action_293 (322) = happyShift action_271 action_293 (327) = happyShift action_272 action_293 (332) = happyShift action_72 action_293 (334) = happyShift action_73 action_293 (336) = happyShift action_112 action_293 (337) = happyShift action_478 action_293 (338) = happyShift action_75 action_293 (340) = happyShift action_76 action_293 (343) = happyShift action_433 action_293 (344) = happyShift action_297 action_293 (345) = happyShift action_77 action_293 (346) = happyShift action_78 action_293 (347) = happyShift action_79 action_293 (348) = happyShift action_274 action_293 (349) = happyShift action_275 action_293 (350) = happyShift action_80 action_293 (351) = happyShift action_81 action_293 (352) = happyShift action_276 action_293 (353) = happyShift action_277 action_293 (354) = happyShift action_82 action_293 (355) = happyShift action_83 action_293 (356) = happyShift action_84 action_293 (357) = happyShift action_85 action_293 (358) = happyShift action_86 action_293 (359) = happyShift action_87 action_293 (360) = happyShift action_88 action_293 (361) = happyShift action_89 action_293 (362) = happyShift action_90 action_293 (363) = happyShift action_91 action_293 (364) = happyShift action_92 action_293 (365) = happyShift action_93 action_293 (366) = happyShift action_94 action_293 (371) = happyShift action_95 action_293 (372) = happyShift action_96 action_293 (373) = happyShift action_97 action_293 (374) = happyShift action_98 action_293 (376) = happyShift action_99 action_293 (377) = happyShift action_100 action_293 (378) = happyShift action_101 action_293 (379) = happyShift action_102 action_293 (380) = happyShift action_103 action_293 (38) = happyGoto action_13 action_293 (142) = happyGoto action_16 action_293 (143) = happyGoto action_281 action_293 (144) = happyGoto action_282 action_293 (145) = happyGoto action_18 action_293 (147) = happyGoto action_19 action_293 (148) = happyGoto action_20 action_293 (149) = happyGoto action_21 action_293 (150) = happyGoto action_22 action_293 (151) = happyGoto action_23 action_293 (152) = happyGoto action_24 action_293 (157) = happyGoto action_430 action_293 (160) = happyGoto action_431 action_293 (192) = happyGoto action_25 action_293 (195) = happyGoto action_26 action_293 (198) = happyGoto action_27 action_293 (200) = happyGoto action_285 action_293 (212) = happyGoto action_286 action_293 (214) = happyGoto action_287 action_293 (219) = happyGoto action_29 action_293 (220) = happyGoto action_30 action_293 (221) = happyGoto action_111 action_293 (223) = happyGoto action_288 action_293 (224) = happyGoto action_325 action_293 (226) = happyGoto action_326 action_293 (227) = happyGoto action_32 action_293 (228) = happyGoto action_264 action_293 (229) = happyGoto action_33 action_293 (230) = happyGoto action_34 action_293 (231) = happyGoto action_265 action_293 (232) = happyGoto action_266 action_293 (233) = happyGoto action_35 action_293 _ = happyFail action_294 (244) = happyShift action_36 action_294 (245) = happyShift action_37 action_294 (253) = happyShift action_40 action_294 (265) = happyShift action_46 action_294 (270) = happyShift action_48 action_294 (272) = happyShift action_49 action_294 (273) = happyShift action_50 action_294 (274) = happyShift action_51 action_294 (275) = happyShift action_52 action_294 (276) = happyShift action_53 action_294 (277) = happyShift action_54 action_294 (279) = happyShift action_56 action_294 (280) = happyShift action_57 action_294 (281) = happyShift action_58 action_294 (282) = happyShift action_59 action_294 (283) = happyShift action_60 action_294 (286) = happyShift action_62 action_294 (317) = happyShift action_70 action_294 (332) = happyShift action_72 action_294 (334) = happyShift action_73 action_294 (336) = happyShift action_112 action_294 (338) = happyShift action_75 action_294 (340) = happyShift action_76 action_294 (345) = happyShift action_77 action_294 (346) = happyShift action_78 action_294 (347) = happyShift action_79 action_294 (350) = happyShift action_80 action_294 (351) = happyShift action_81 action_294 (354) = happyShift action_82 action_294 (355) = happyShift action_83 action_294 (356) = happyShift action_84 action_294 (357) = happyShift action_85 action_294 (358) = happyShift action_86 action_294 (359) = happyShift action_87 action_294 (360) = happyShift action_88 action_294 (361) = happyShift action_89 action_294 (362) = happyShift action_90 action_294 (363) = happyShift action_91 action_294 (364) = happyShift action_92 action_294 (365) = happyShift action_93 action_294 (366) = happyShift action_94 action_294 (371) = happyShift action_95 action_294 (372) = happyShift action_96 action_294 (373) = happyShift action_97 action_294 (374) = happyShift action_98 action_294 (376) = happyShift action_99 action_294 (377) = happyShift action_100 action_294 (378) = happyShift action_101 action_294 (379) = happyShift action_102 action_294 (380) = happyShift action_103 action_294 (38) = happyGoto action_13 action_294 (142) = happyGoto action_16 action_294 (149) = happyGoto action_337 action_294 (150) = happyGoto action_22 action_294 (151) = happyGoto action_23 action_294 (152) = happyGoto action_24 action_294 (192) = happyGoto action_25 action_294 (195) = happyGoto action_26 action_294 (198) = happyGoto action_27 action_294 (219) = happyGoto action_29 action_294 (220) = happyGoto action_30 action_294 (221) = happyGoto action_111 action_294 (227) = happyGoto action_32 action_294 (229) = happyGoto action_33 action_294 (230) = happyGoto action_34 action_294 (233) = happyGoto action_35 action_294 _ = happyReduce_602 action_295 _ = happyReduce_527 action_296 _ = happyReduce_640 action_297 (245) = happyShift action_37 action_297 (253) = happyShift action_40 action_297 (265) = happyShift action_46 action_297 (270) = happyShift action_48 action_297 (272) = happyShift action_49 action_297 (273) = happyShift action_50 action_297 (274) = happyShift action_51 action_297 (275) = happyShift action_52 action_297 (276) = happyShift action_53 action_297 (277) = happyShift action_54 action_297 (279) = happyShift action_56 action_297 (280) = happyShift action_57 action_297 (281) = happyShift action_58 action_297 (282) = happyShift action_59 action_297 (283) = happyShift action_60 action_297 (286) = happyShift action_62 action_297 (346) = happyShift action_78 action_297 (347) = happyShift action_79 action_297 (350) = happyShift action_80 action_297 (351) = happyShift action_81 action_297 (354) = happyShift action_82 action_297 (355) = happyShift action_83 action_297 (220) = happyGoto action_476 action_297 (221) = happyGoto action_111 action_297 (227) = happyGoto action_32 action_297 (229) = happyGoto action_477 action_297 (230) = happyGoto action_34 action_297 _ = happyFail action_298 (245) = happyShift action_37 action_298 (253) = happyShift action_40 action_298 (265) = happyShift action_46 action_298 (270) = happyShift action_249 action_298 (272) = happyShift action_49 action_298 (273) = happyShift action_50 action_298 (274) = happyShift action_51 action_298 (275) = happyShift action_221 action_298 (276) = happyShift action_222 action_298 (277) = happyShift action_223 action_298 (280) = happyShift action_57 action_298 (281) = happyShift action_58 action_298 (282) = happyShift action_59 action_298 (283) = happyShift action_60 action_298 (286) = happyShift action_62 action_298 (299) = happyShift action_225 action_298 (300) = happyShift action_226 action_298 (321) = happyShift action_227 action_298 (328) = happyShift action_228 action_298 (332) = happyShift action_229 action_298 (334) = happyShift action_230 action_298 (336) = happyShift action_231 action_298 (338) = happyShift action_232 action_298 (345) = happyShift action_233 action_298 (346) = happyShift action_234 action_298 (347) = happyShift action_235 action_298 (351) = happyShift action_236 action_298 (355) = happyShift action_237 action_298 (356) = happyShift action_84 action_298 (358) = happyShift action_238 action_298 (359) = happyShift action_239 action_298 (376) = happyShift action_240 action_298 (377) = happyShift action_241 action_298 (379) = happyShift action_102 action_298 (380) = happyShift action_103 action_298 (95) = happyGoto action_475 action_298 (100) = happyGoto action_208 action_298 (101) = happyGoto action_243 action_298 (103) = happyGoto action_244 action_298 (104) = happyGoto action_245 action_298 (106) = happyGoto action_246 action_298 (107) = happyGoto action_211 action_298 (142) = happyGoto action_212 action_298 (192) = happyGoto action_248 action_298 (202) = happyGoto action_213 action_298 (203) = happyGoto action_214 action_298 (205) = happyGoto action_215 action_298 (206) = happyGoto action_216 action_298 (215) = happyGoto action_217 action_298 (217) = happyGoto action_218 action_298 (227) = happyGoto action_219 action_298 _ = happyFail action_299 (244) = happyShift action_36 action_299 (245) = happyShift action_37 action_299 (246) = happyShift action_38 action_299 (251) = happyShift action_39 action_299 (253) = happyShift action_40 action_299 (254) = happyShift action_41 action_299 (261) = happyShift action_45 action_299 (265) = happyShift action_46 action_299 (269) = happyShift action_47 action_299 (270) = happyShift action_48 action_299 (272) = happyShift action_49 action_299 (273) = happyShift action_50 action_299 (274) = happyShift action_51 action_299 (275) = happyShift action_52 action_299 (276) = happyShift action_53 action_299 (277) = happyShift action_54 action_299 (278) = happyShift action_55 action_299 (279) = happyShift action_56 action_299 (280) = happyShift action_57 action_299 (281) = happyShift action_58 action_299 (282) = happyShift action_59 action_299 (283) = happyShift action_60 action_299 (284) = happyShift action_61 action_299 (286) = happyShift action_62 action_299 (294) = happyShift action_66 action_299 (295) = happyShift action_67 action_299 (296) = happyShift action_68 action_299 (311) = happyShift action_69 action_299 (317) = happyShift action_70 action_299 (320) = happyShift action_71 action_299 (332) = happyShift action_72 action_299 (334) = happyShift action_73 action_299 (336) = happyShift action_112 action_299 (338) = happyShift action_75 action_299 (340) = happyShift action_76 action_299 (345) = happyShift action_77 action_299 (346) = happyShift action_78 action_299 (347) = happyShift action_79 action_299 (350) = happyShift action_80 action_299 (351) = happyShift action_81 action_299 (354) = happyShift action_82 action_299 (355) = happyShift action_83 action_299 (356) = happyShift action_84 action_299 (357) = happyShift action_85 action_299 (358) = happyShift action_86 action_299 (359) = happyShift action_87 action_299 (360) = happyShift action_88 action_299 (361) = happyShift action_89 action_299 (362) = happyShift action_90 action_299 (363) = happyShift action_91 action_299 (364) = happyShift action_92 action_299 (365) = happyShift action_93 action_299 (366) = happyShift action_94 action_299 (371) = happyShift action_95 action_299 (372) = happyShift action_96 action_299 (373) = happyShift action_97 action_299 (374) = happyShift action_98 action_299 (376) = happyShift action_99 action_299 (377) = happyShift action_100 action_299 (378) = happyShift action_101 action_299 (379) = happyShift action_102 action_299 (380) = happyShift action_103 action_299 (38) = happyGoto action_13 action_299 (142) = happyGoto action_16 action_299 (143) = happyGoto action_474 action_299 (144) = happyGoto action_110 action_299 (145) = happyGoto action_18 action_299 (147) = happyGoto action_19 action_299 (148) = happyGoto action_20 action_299 (149) = happyGoto action_21 action_299 (150) = happyGoto action_22 action_299 (151) = happyGoto action_23 action_299 (152) = happyGoto action_24 action_299 (192) = happyGoto action_25 action_299 (195) = happyGoto action_26 action_299 (198) = happyGoto action_27 action_299 (219) = happyGoto action_29 action_299 (220) = happyGoto action_30 action_299 (221) = happyGoto action_111 action_299 (227) = happyGoto action_32 action_299 (229) = happyGoto action_33 action_299 (230) = happyGoto action_34 action_299 (233) = happyGoto action_35 action_299 _ = happyFail action_300 (244) = happyShift action_36 action_300 (245) = happyShift action_37 action_300 (246) = happyShift action_38 action_300 (251) = happyShift action_39 action_300 (253) = happyShift action_40 action_300 (254) = happyShift action_41 action_300 (261) = happyShift action_45 action_300 (265) = happyShift action_46 action_300 (269) = happyShift action_47 action_300 (270) = happyShift action_48 action_300 (272) = happyShift action_49 action_300 (273) = happyShift action_50 action_300 (274) = happyShift action_51 action_300 (275) = happyShift action_52 action_300 (276) = happyShift action_53 action_300 (277) = happyShift action_54 action_300 (278) = happyShift action_55 action_300 (279) = happyShift action_56 action_300 (280) = happyShift action_57 action_300 (281) = happyShift action_58 action_300 (282) = happyShift action_59 action_300 (283) = happyShift action_60 action_300 (284) = happyShift action_61 action_300 (286) = happyShift action_62 action_300 (294) = happyShift action_66 action_300 (295) = happyShift action_67 action_300 (296) = happyShift action_68 action_300 (311) = happyShift action_69 action_300 (317) = happyShift action_70 action_300 (320) = happyShift action_71 action_300 (332) = happyShift action_72 action_300 (334) = happyShift action_73 action_300 (336) = happyShift action_112 action_300 (338) = happyShift action_75 action_300 (340) = happyShift action_76 action_300 (345) = happyShift action_77 action_300 (346) = happyShift action_78 action_300 (347) = happyShift action_79 action_300 (350) = happyShift action_80 action_300 (351) = happyShift action_81 action_300 (354) = happyShift action_82 action_300 (355) = happyShift action_83 action_300 (356) = happyShift action_84 action_300 (357) = happyShift action_85 action_300 (358) = happyShift action_86 action_300 (359) = happyShift action_87 action_300 (360) = happyShift action_88 action_300 (361) = happyShift action_89 action_300 (362) = happyShift action_90 action_300 (363) = happyShift action_91 action_300 (364) = happyShift action_92 action_300 (365) = happyShift action_93 action_300 (366) = happyShift action_94 action_300 (371) = happyShift action_95 action_300 (372) = happyShift action_96 action_300 (373) = happyShift action_97 action_300 (374) = happyShift action_98 action_300 (376) = happyShift action_99 action_300 (377) = happyShift action_100 action_300 (378) = happyShift action_101 action_300 (379) = happyShift action_102 action_300 (380) = happyShift action_103 action_300 (38) = happyGoto action_13 action_300 (142) = happyGoto action_16 action_300 (143) = happyGoto action_473 action_300 (144) = happyGoto action_110 action_300 (145) = happyGoto action_18 action_300 (147) = happyGoto action_19 action_300 (148) = happyGoto action_20 action_300 (149) = happyGoto action_21 action_300 (150) = happyGoto action_22 action_300 (151) = happyGoto action_23 action_300 (152) = happyGoto action_24 action_300 (192) = happyGoto action_25 action_300 (195) = happyGoto action_26 action_300 (198) = happyGoto action_27 action_300 (219) = happyGoto action_29 action_300 (220) = happyGoto action_30 action_300 (221) = happyGoto action_111 action_300 (227) = happyGoto action_32 action_300 (229) = happyGoto action_33 action_300 (230) = happyGoto action_34 action_300 (233) = happyGoto action_35 action_300 _ = happyFail action_301 (244) = happyShift action_36 action_301 (245) = happyShift action_37 action_301 (246) = happyShift action_38 action_301 (251) = happyShift action_39 action_301 (253) = happyShift action_40 action_301 (254) = happyShift action_41 action_301 (261) = happyShift action_45 action_301 (265) = happyShift action_46 action_301 (269) = happyShift action_47 action_301 (270) = happyShift action_48 action_301 (272) = happyShift action_49 action_301 (273) = happyShift action_50 action_301 (274) = happyShift action_51 action_301 (275) = happyShift action_52 action_301 (276) = happyShift action_53 action_301 (277) = happyShift action_54 action_301 (278) = happyShift action_55 action_301 (279) = happyShift action_56 action_301 (280) = happyShift action_57 action_301 (281) = happyShift action_58 action_301 (282) = happyShift action_59 action_301 (283) = happyShift action_60 action_301 (284) = happyShift action_61 action_301 (286) = happyShift action_62 action_301 (294) = happyShift action_66 action_301 (295) = happyShift action_67 action_301 (296) = happyShift action_68 action_301 (311) = happyShift action_69 action_301 (317) = happyShift action_70 action_301 (320) = happyShift action_71 action_301 (332) = happyShift action_72 action_301 (334) = happyShift action_73 action_301 (336) = happyShift action_112 action_301 (338) = happyShift action_75 action_301 (340) = happyShift action_76 action_301 (345) = happyShift action_77 action_301 (346) = happyShift action_78 action_301 (347) = happyShift action_79 action_301 (350) = happyShift action_80 action_301 (351) = happyShift action_81 action_301 (354) = happyShift action_82 action_301 (355) = happyShift action_83 action_301 (356) = happyShift action_84 action_301 (357) = happyShift action_85 action_301 (358) = happyShift action_86 action_301 (359) = happyShift action_87 action_301 (360) = happyShift action_88 action_301 (361) = happyShift action_89 action_301 (362) = happyShift action_90 action_301 (363) = happyShift action_91 action_301 (364) = happyShift action_92 action_301 (365) = happyShift action_93 action_301 (366) = happyShift action_94 action_301 (371) = happyShift action_95 action_301 (372) = happyShift action_96 action_301 (373) = happyShift action_97 action_301 (374) = happyShift action_98 action_301 (376) = happyShift action_99 action_301 (377) = happyShift action_100 action_301 (378) = happyShift action_101 action_301 (379) = happyShift action_102 action_301 (380) = happyShift action_103 action_301 (38) = happyGoto action_13 action_301 (142) = happyGoto action_16 action_301 (143) = happyGoto action_472 action_301 (144) = happyGoto action_110 action_301 (145) = happyGoto action_18 action_301 (147) = happyGoto action_19 action_301 (148) = happyGoto action_20 action_301 (149) = happyGoto action_21 action_301 (150) = happyGoto action_22 action_301 (151) = happyGoto action_23 action_301 (152) = happyGoto action_24 action_301 (192) = happyGoto action_25 action_301 (195) = happyGoto action_26 action_301 (198) = happyGoto action_27 action_301 (219) = happyGoto action_29 action_301 (220) = happyGoto action_30 action_301 (221) = happyGoto action_111 action_301 (227) = happyGoto action_32 action_301 (229) = happyGoto action_33 action_301 (230) = happyGoto action_34 action_301 (233) = happyGoto action_35 action_301 _ = happyFail action_302 (244) = happyShift action_36 action_302 (245) = happyShift action_37 action_302 (246) = happyShift action_38 action_302 (251) = happyShift action_39 action_302 (253) = happyShift action_40 action_302 (254) = happyShift action_41 action_302 (261) = happyShift action_45 action_302 (265) = happyShift action_46 action_302 (269) = happyShift action_47 action_302 (270) = happyShift action_48 action_302 (272) = happyShift action_49 action_302 (273) = happyShift action_50 action_302 (274) = happyShift action_51 action_302 (275) = happyShift action_52 action_302 (276) = happyShift action_53 action_302 (277) = happyShift action_54 action_302 (278) = happyShift action_55 action_302 (279) = happyShift action_56 action_302 (280) = happyShift action_57 action_302 (281) = happyShift action_58 action_302 (282) = happyShift action_59 action_302 (283) = happyShift action_60 action_302 (284) = happyShift action_61 action_302 (286) = happyShift action_62 action_302 (294) = happyShift action_66 action_302 (295) = happyShift action_67 action_302 (296) = happyShift action_68 action_302 (311) = happyShift action_69 action_302 (317) = happyShift action_70 action_302 (320) = happyShift action_71 action_302 (332) = happyShift action_72 action_302 (334) = happyShift action_73 action_302 (336) = happyShift action_112 action_302 (338) = happyShift action_75 action_302 (340) = happyShift action_76 action_302 (345) = happyShift action_77 action_302 (346) = happyShift action_78 action_302 (347) = happyShift action_79 action_302 (350) = happyShift action_80 action_302 (351) = happyShift action_81 action_302 (354) = happyShift action_82 action_302 (355) = happyShift action_83 action_302 (356) = happyShift action_84 action_302 (357) = happyShift action_85 action_302 (358) = happyShift action_86 action_302 (359) = happyShift action_87 action_302 (360) = happyShift action_88 action_302 (361) = happyShift action_89 action_302 (362) = happyShift action_90 action_302 (363) = happyShift action_91 action_302 (364) = happyShift action_92 action_302 (365) = happyShift action_93 action_302 (366) = happyShift action_94 action_302 (371) = happyShift action_95 action_302 (372) = happyShift action_96 action_302 (373) = happyShift action_97 action_302 (374) = happyShift action_98 action_302 (376) = happyShift action_99 action_302 (377) = happyShift action_100 action_302 (378) = happyShift action_101 action_302 (379) = happyShift action_102 action_302 (380) = happyShift action_103 action_302 (38) = happyGoto action_13 action_302 (142) = happyGoto action_16 action_302 (143) = happyGoto action_471 action_302 (144) = happyGoto action_110 action_302 (145) = happyGoto action_18 action_302 (147) = happyGoto action_19 action_302 (148) = happyGoto action_20 action_302 (149) = happyGoto action_21 action_302 (150) = happyGoto action_22 action_302 (151) = happyGoto action_23 action_302 (152) = happyGoto action_24 action_302 (192) = happyGoto action_25 action_302 (195) = happyGoto action_26 action_302 (198) = happyGoto action_27 action_302 (219) = happyGoto action_29 action_302 (220) = happyGoto action_30 action_302 (221) = happyGoto action_111 action_302 (227) = happyGoto action_32 action_302 (229) = happyGoto action_33 action_302 (230) = happyGoto action_34 action_302 (233) = happyGoto action_35 action_302 _ = happyFail action_303 (347) = happyShift action_469 action_303 (351) = happyShift action_470 action_303 (235) = happyGoto action_468 action_303 _ = happyFail action_304 _ = happyReduce_416 action_305 _ = happyReduce_536 action_306 _ = happyReduce_415 action_307 (333) = happyShift action_467 action_307 _ = happyFail action_308 (335) = happyShift action_466 action_308 _ = happyFail action_309 (315) = happyShift action_457 action_309 (317) = happyShift action_458 action_309 (318) = happyShift action_459 action_309 (322) = happyShift action_460 action_309 (337) = happyShift action_461 action_309 (343) = happyShift action_296 action_309 (348) = happyShift action_462 action_309 (349) = happyShift action_463 action_309 (352) = happyShift action_464 action_309 (353) = happyShift action_465 action_309 (207) = happyGoto action_454 action_309 (208) = happyGoto action_455 action_309 (236) = happyGoto action_456 action_309 _ = happyFail action_310 (339) = happyShift action_453 action_310 (343) = happyShift action_296 action_310 (236) = happyGoto action_452 action_310 _ = happyFail action_311 (337) = happyShift action_451 action_311 _ = happyFail action_312 (375) = happyShift action_450 action_312 _ = happyFail action_313 (244) = happyShift action_36 action_313 (245) = happyShift action_37 action_313 (246) = happyShift action_38 action_313 (247) = happyShift action_129 action_313 (248) = happyShift action_130 action_313 (249) = happyShift action_131 action_313 (250) = happyShift action_132 action_313 (251) = happyShift action_39 action_313 (253) = happyShift action_40 action_313 (254) = happyShift action_41 action_313 (257) = happyShift action_42 action_313 (258) = happyShift action_43 action_313 (259) = happyShift action_44 action_313 (260) = happyShift action_133 action_313 (261) = happyShift action_45 action_313 (263) = happyShift action_134 action_313 (265) = happyShift action_46 action_313 (267) = happyShift action_135 action_313 (269) = happyShift action_47 action_313 (270) = happyShift action_48 action_313 (271) = happyShift action_136 action_313 (272) = happyShift action_49 action_313 (273) = happyShift action_50 action_313 (274) = happyShift action_51 action_313 (275) = happyShift action_52 action_313 (276) = happyShift action_53 action_313 (277) = happyShift action_54 action_313 (278) = happyShift action_55 action_313 (279) = happyShift action_56 action_313 (280) = happyShift action_57 action_313 (281) = happyShift action_58 action_313 (282) = happyShift action_59 action_313 (283) = happyShift action_60 action_313 (284) = happyShift action_61 action_313 (286) = happyShift action_62 action_313 (289) = happyShift action_63 action_313 (290) = happyShift action_64 action_313 (291) = happyShift action_65 action_313 (293) = happyShift action_137 action_313 (294) = happyShift action_66 action_313 (295) = happyShift action_67 action_313 (296) = happyShift action_68 action_313 (297) = happyShift action_138 action_313 (298) = happyShift action_139 action_313 (301) = happyShift action_140 action_313 (302) = happyShift action_141 action_313 (303) = happyShift action_142 action_313 (304) = happyShift action_143 action_313 (311) = happyShift action_69 action_313 (317) = happyShift action_70 action_313 (320) = happyShift action_71 action_313 (321) = happyShift action_144 action_313 (332) = happyShift action_72 action_313 (334) = happyShift action_73 action_313 (336) = happyShift action_74 action_313 (338) = happyShift action_75 action_313 (340) = happyShift action_76 action_313 (345) = happyShift action_77 action_313 (346) = happyShift action_78 action_313 (347) = happyShift action_79 action_313 (350) = happyShift action_80 action_313 (351) = happyShift action_81 action_313 (354) = happyShift action_82 action_313 (355) = happyShift action_83 action_313 (356) = happyShift action_84 action_313 (357) = happyShift action_85 action_313 (358) = happyShift action_86 action_313 (359) = happyShift action_87 action_313 (360) = happyShift action_88 action_313 (361) = happyShift action_89 action_313 (362) = happyShift action_90 action_313 (363) = happyShift action_91 action_313 (364) = happyShift action_92 action_313 (365) = happyShift action_93 action_313 (366) = happyShift action_94 action_313 (367) = happyShift action_145 action_313 (368) = happyShift action_146 action_313 (369) = happyShift action_147 action_313 (370) = happyShift action_148 action_313 (371) = happyShift action_95 action_313 (372) = happyShift action_96 action_313 (373) = happyShift action_97 action_313 (374) = happyShift action_98 action_313 (376) = happyShift action_99 action_313 (377) = happyShift action_100 action_313 (378) = happyShift action_101 action_313 (379) = happyShift action_102 action_313 (380) = happyShift action_103 action_313 (25) = happyGoto action_445 action_313 (38) = happyGoto action_13 action_313 (49) = happyGoto action_14 action_313 (51) = happyGoto action_446 action_313 (52) = happyGoto action_447 action_313 (53) = happyGoto action_114 action_313 (54) = happyGoto action_115 action_313 (55) = happyGoto action_116 action_313 (58) = happyGoto action_117 action_313 (62) = happyGoto action_118 action_313 (88) = happyGoto action_119 action_313 (135) = happyGoto action_120 action_313 (136) = happyGoto action_121 action_313 (137) = happyGoto action_122 action_313 (141) = happyGoto action_123 action_313 (142) = happyGoto action_16 action_313 (144) = happyGoto action_124 action_313 (145) = happyGoto action_18 action_313 (147) = happyGoto action_19 action_313 (148) = happyGoto action_20 action_313 (149) = happyGoto action_21 action_313 (150) = happyGoto action_22 action_313 (151) = happyGoto action_23 action_313 (152) = happyGoto action_24 action_313 (156) = happyGoto action_449 action_313 (192) = happyGoto action_25 action_313 (195) = happyGoto action_26 action_313 (198) = happyGoto action_27 action_313 (218) = happyGoto action_28 action_313 (219) = happyGoto action_29 action_313 (220) = happyGoto action_30 action_313 (221) = happyGoto action_31 action_313 (227) = happyGoto action_32 action_313 (229) = happyGoto action_33 action_313 (230) = happyGoto action_34 action_313 (233) = happyGoto action_35 action_313 (237) = happyGoto action_125 action_313 (238) = happyGoto action_126 action_313 (239) = happyGoto action_127 action_313 (240) = happyGoto action_128 action_313 _ = happyReduce_428 action_314 (244) = happyShift action_36 action_314 (245) = happyShift action_37 action_314 (246) = happyShift action_38 action_314 (247) = happyShift action_129 action_314 (248) = happyShift action_130 action_314 (249) = happyShift action_131 action_314 (250) = happyShift action_132 action_314 (251) = happyShift action_39 action_314 (253) = happyShift action_40 action_314 (254) = happyShift action_41 action_314 (257) = happyShift action_42 action_314 (258) = happyShift action_43 action_314 (259) = happyShift action_44 action_314 (260) = happyShift action_133 action_314 (261) = happyShift action_45 action_314 (263) = happyShift action_134 action_314 (265) = happyShift action_46 action_314 (267) = happyShift action_135 action_314 (269) = happyShift action_47 action_314 (270) = happyShift action_48 action_314 (271) = happyShift action_136 action_314 (272) = happyShift action_49 action_314 (273) = happyShift action_50 action_314 (274) = happyShift action_51 action_314 (275) = happyShift action_52 action_314 (276) = happyShift action_53 action_314 (277) = happyShift action_54 action_314 (278) = happyShift action_55 action_314 (279) = happyShift action_56 action_314 (280) = happyShift action_57 action_314 (281) = happyShift action_58 action_314 (282) = happyShift action_59 action_314 (283) = happyShift action_60 action_314 (284) = happyShift action_61 action_314 (286) = happyShift action_62 action_314 (289) = happyShift action_63 action_314 (290) = happyShift action_64 action_314 (291) = happyShift action_65 action_314 (293) = happyShift action_137 action_314 (294) = happyShift action_66 action_314 (295) = happyShift action_67 action_314 (296) = happyShift action_68 action_314 (297) = happyShift action_138 action_314 (298) = happyShift action_139 action_314 (301) = happyShift action_140 action_314 (302) = happyShift action_141 action_314 (303) = happyShift action_142 action_314 (304) = happyShift action_143 action_314 (311) = happyShift action_69 action_314 (317) = happyShift action_70 action_314 (320) = happyShift action_71 action_314 (321) = happyShift action_144 action_314 (332) = happyShift action_72 action_314 (334) = happyShift action_73 action_314 (336) = happyShift action_74 action_314 (338) = happyShift action_75 action_314 (340) = happyShift action_76 action_314 (345) = happyShift action_77 action_314 (346) = happyShift action_78 action_314 (347) = happyShift action_79 action_314 (350) = happyShift action_80 action_314 (351) = happyShift action_81 action_314 (354) = happyShift action_82 action_314 (355) = happyShift action_83 action_314 (356) = happyShift action_84 action_314 (357) = happyShift action_85 action_314 (358) = happyShift action_86 action_314 (359) = happyShift action_87 action_314 (360) = happyShift action_88 action_314 (361) = happyShift action_89 action_314 (362) = happyShift action_90 action_314 (363) = happyShift action_91 action_314 (364) = happyShift action_92 action_314 (365) = happyShift action_93 action_314 (366) = happyShift action_94 action_314 (367) = happyShift action_145 action_314 (368) = happyShift action_146 action_314 (369) = happyShift action_147 action_314 (370) = happyShift action_148 action_314 (371) = happyShift action_95 action_314 (372) = happyShift action_96 action_314 (373) = happyShift action_97 action_314 (374) = happyShift action_98 action_314 (376) = happyShift action_99 action_314 (377) = happyShift action_100 action_314 (378) = happyShift action_101 action_314 (379) = happyShift action_102 action_314 (380) = happyShift action_103 action_314 (25) = happyGoto action_445 action_314 (38) = happyGoto action_13 action_314 (49) = happyGoto action_14 action_314 (51) = happyGoto action_446 action_314 (52) = happyGoto action_447 action_314 (53) = happyGoto action_114 action_314 (54) = happyGoto action_115 action_314 (55) = happyGoto action_116 action_314 (58) = happyGoto action_117 action_314 (62) = happyGoto action_118 action_314 (88) = happyGoto action_119 action_314 (135) = happyGoto action_120 action_314 (136) = happyGoto action_121 action_314 (137) = happyGoto action_122 action_314 (141) = happyGoto action_123 action_314 (142) = happyGoto action_16 action_314 (144) = happyGoto action_124 action_314 (145) = happyGoto action_18 action_314 (147) = happyGoto action_19 action_314 (148) = happyGoto action_20 action_314 (149) = happyGoto action_21 action_314 (150) = happyGoto action_22 action_314 (151) = happyGoto action_23 action_314 (152) = happyGoto action_24 action_314 (156) = happyGoto action_448 action_314 (192) = happyGoto action_25 action_314 (195) = happyGoto action_26 action_314 (198) = happyGoto action_27 action_314 (218) = happyGoto action_28 action_314 (219) = happyGoto action_29 action_314 (220) = happyGoto action_30 action_314 (221) = happyGoto action_31 action_314 (227) = happyGoto action_32 action_314 (229) = happyGoto action_33 action_314 (230) = happyGoto action_34 action_314 (233) = happyGoto action_35 action_314 (237) = happyGoto action_125 action_314 (238) = happyGoto action_126 action_314 (239) = happyGoto action_127 action_314 (240) = happyGoto action_128 action_314 _ = happyReduce_428 action_315 (375) = happyShift action_444 action_315 _ = happyFail action_316 (308) = happyShift action_267 action_316 (320) = happyShift action_269 action_316 (321) = happyShift action_270 action_316 (322) = happyShift action_271 action_316 (327) = happyShift action_272 action_316 (344) = happyShift action_273 action_316 (348) = happyShift action_274 action_316 (349) = happyShift action_275 action_316 (352) = happyShift action_276 action_316 (353) = happyShift action_277 action_316 (375) = happyShift action_443 action_316 (200) = happyGoto action_257 action_316 (211) = happyGoto action_258 action_316 (213) = happyGoto action_259 action_316 (222) = happyGoto action_260 action_316 (224) = happyGoto action_261 action_316 (225) = happyGoto action_262 action_316 (226) = happyGoto action_263 action_316 (228) = happyGoto action_264 action_316 (231) = happyGoto action_265 action_316 (232) = happyGoto action_266 action_316 _ = happyFail action_317 (375) = happyShift action_442 action_317 _ = happyFail action_318 _ = happyReduce_414 action_319 _ = happyReduce_413 action_320 (308) = happyShift action_267 action_320 (320) = happyShift action_269 action_320 (321) = happyShift action_270 action_320 (322) = happyShift action_271 action_320 (327) = happyShift action_272 action_320 (337) = happyShift action_295 action_320 (343) = happyShift action_296 action_320 (348) = happyShift action_274 action_320 (349) = happyShift action_275 action_320 (352) = happyShift action_276 action_320 (353) = happyShift action_277 action_320 (224) = happyGoto action_439 action_320 (225) = happyGoto action_290 action_320 (226) = happyGoto action_263 action_320 (228) = happyGoto action_264 action_320 (231) = happyGoto action_440 action_320 (232) = happyGoto action_266 action_320 (236) = happyGoto action_441 action_320 _ = happyFail action_321 (153) = happyGoto action_438 action_321 _ = happyReduce_424 action_322 _ = happyReduce_63 action_323 (339) = happyShift action_437 action_323 (343) = happyShift action_296 action_323 (159) = happyGoto action_435 action_323 (236) = happyGoto action_436 action_323 _ = happyFail action_324 (339) = happyShift action_434 action_324 _ = happyFail action_325 _ = happyReduce_599 action_326 _ = happyReduce_598 action_327 (244) = happyShift action_36 action_327 (245) = happyShift action_37 action_327 (246) = happyShift action_38 action_327 (251) = happyShift action_39 action_327 (253) = happyShift action_40 action_327 (254) = happyShift action_41 action_327 (261) = happyShift action_45 action_327 (265) = happyShift action_46 action_327 (269) = happyShift action_47 action_327 (270) = happyShift action_48 action_327 (272) = happyShift action_49 action_327 (273) = happyShift action_50 action_327 (274) = happyShift action_51 action_327 (275) = happyShift action_52 action_327 (276) = happyShift action_53 action_327 (277) = happyShift action_54 action_327 (278) = happyShift action_55 action_327 (279) = happyShift action_56 action_327 (280) = happyShift action_57 action_327 (281) = happyShift action_58 action_327 (282) = happyShift action_59 action_327 (283) = happyShift action_60 action_327 (284) = happyShift action_61 action_327 (286) = happyShift action_62 action_327 (294) = happyShift action_66 action_327 (295) = happyShift action_67 action_327 (296) = happyShift action_68 action_327 (308) = happyShift action_267 action_327 (311) = happyShift action_69 action_327 (317) = happyShift action_70 action_327 (320) = happyShift action_71 action_327 (321) = happyShift action_270 action_327 (322) = happyShift action_271 action_327 (327) = happyShift action_272 action_327 (332) = happyShift action_72 action_327 (334) = happyShift action_73 action_327 (336) = happyShift action_112 action_327 (338) = happyShift action_75 action_327 (339) = happyShift action_432 action_327 (340) = happyShift action_76 action_327 (343) = happyShift action_433 action_327 (344) = happyShift action_297 action_327 (345) = happyShift action_77 action_327 (346) = happyShift action_78 action_327 (347) = happyShift action_79 action_327 (348) = happyShift action_274 action_327 (349) = happyShift action_275 action_327 (350) = happyShift action_80 action_327 (351) = happyShift action_81 action_327 (352) = happyShift action_276 action_327 (353) = happyShift action_277 action_327 (354) = happyShift action_82 action_327 (355) = happyShift action_83 action_327 (356) = happyShift action_84 action_327 (357) = happyShift action_85 action_327 (358) = happyShift action_86 action_327 (359) = happyShift action_87 action_327 (360) = happyShift action_88 action_327 (361) = happyShift action_89 action_327 (362) = happyShift action_90 action_327 (363) = happyShift action_91 action_327 (364) = happyShift action_92 action_327 (365) = happyShift action_93 action_327 (366) = happyShift action_94 action_327 (371) = happyShift action_95 action_327 (372) = happyShift action_96 action_327 (373) = happyShift action_97 action_327 (374) = happyShift action_98 action_327 (376) = happyShift action_99 action_327 (377) = happyShift action_100 action_327 (378) = happyShift action_101 action_327 (379) = happyShift action_102 action_327 (380) = happyShift action_103 action_327 (38) = happyGoto action_13 action_327 (142) = happyGoto action_16 action_327 (143) = happyGoto action_281 action_327 (144) = happyGoto action_282 action_327 (145) = happyGoto action_18 action_327 (147) = happyGoto action_19 action_327 (148) = happyGoto action_20 action_327 (149) = happyGoto action_21 action_327 (150) = happyGoto action_22 action_327 (151) = happyGoto action_23 action_327 (152) = happyGoto action_24 action_327 (157) = happyGoto action_430 action_327 (160) = happyGoto action_431 action_327 (192) = happyGoto action_25 action_327 (195) = happyGoto action_26 action_327 (198) = happyGoto action_27 action_327 (200) = happyGoto action_285 action_327 (212) = happyGoto action_286 action_327 (214) = happyGoto action_287 action_327 (219) = happyGoto action_29 action_327 (220) = happyGoto action_30 action_327 (221) = happyGoto action_111 action_327 (223) = happyGoto action_288 action_327 (224) = happyGoto action_325 action_327 (226) = happyGoto action_326 action_327 (227) = happyGoto action_32 action_327 (228) = happyGoto action_264 action_327 (229) = happyGoto action_33 action_327 (230) = happyGoto action_34 action_327 (231) = happyGoto action_265 action_327 (232) = happyGoto action_266 action_327 (233) = happyGoto action_35 action_327 _ = happyFail action_328 _ = happyReduce_529 action_329 (337) = happyShift action_429 action_329 _ = happyFail action_330 (307) = happyShift action_426 action_330 (313) = happyShift action_427 action_330 (343) = happyShift action_428 action_330 _ = happyReduce_461 action_331 (343) = happyShift action_420 action_331 _ = happyReduce_462 action_332 (335) = happyShift action_425 action_332 _ = happyFail action_333 (307) = happyShift action_422 action_333 (313) = happyShift action_423 action_333 (343) = happyShift action_424 action_333 _ = happyReduce_440 action_334 (333) = happyShift action_421 action_334 _ = happyFail action_335 (343) = happyShift action_420 action_335 _ = happyReduce_441 action_336 _ = happyReduce_531 action_337 (244) = happyShift action_36 action_337 (245) = happyShift action_37 action_337 (253) = happyShift action_40 action_337 (265) = happyShift action_46 action_337 (270) = happyShift action_48 action_337 (272) = happyShift action_49 action_337 (273) = happyShift action_50 action_337 (274) = happyShift action_51 action_337 (275) = happyShift action_52 action_337 (276) = happyShift action_53 action_337 (277) = happyShift action_54 action_337 (279) = happyShift action_56 action_337 (280) = happyShift action_57 action_337 (281) = happyShift action_58 action_337 (282) = happyShift action_59 action_337 (283) = happyShift action_60 action_337 (286) = happyShift action_62 action_337 (317) = happyShift action_70 action_337 (332) = happyShift action_72 action_337 (334) = happyShift action_73 action_337 (336) = happyShift action_112 action_337 (338) = happyShift action_75 action_337 (340) = happyShift action_76 action_337 (345) = happyShift action_77 action_337 (346) = happyShift action_78 action_337 (347) = happyShift action_79 action_337 (350) = happyShift action_80 action_337 (351) = happyShift action_81 action_337 (354) = happyShift action_82 action_337 (355) = happyShift action_83 action_337 (356) = happyShift action_84 action_337 (357) = happyShift action_85 action_337 (358) = happyShift action_86 action_337 (359) = happyShift action_87 action_337 (360) = happyShift action_88 action_337 (361) = happyShift action_89 action_337 (362) = happyShift action_90 action_337 (363) = happyShift action_91 action_337 (364) = happyShift action_92 action_337 (365) = happyShift action_93 action_337 (366) = happyShift action_94 action_337 (371) = happyShift action_95 action_337 (372) = happyShift action_96 action_337 (373) = happyShift action_97 action_337 (374) = happyShift action_98 action_337 (376) = happyShift action_99 action_337 (377) = happyShift action_100 action_337 (378) = happyShift action_101 action_337 (379) = happyShift action_102 action_337 (380) = happyShift action_103 action_337 (38) = happyGoto action_13 action_337 (142) = happyGoto action_16 action_337 (150) = happyGoto action_366 action_337 (151) = happyGoto action_23 action_337 (152) = happyGoto action_24 action_337 (192) = happyGoto action_25 action_337 (195) = happyGoto action_26 action_337 (198) = happyGoto action_27 action_337 (219) = happyGoto action_29 action_337 (220) = happyGoto action_30 action_337 (221) = happyGoto action_111 action_337 (227) = happyGoto action_32 action_337 (229) = happyGoto action_33 action_337 (230) = happyGoto action_34 action_337 (233) = happyGoto action_35 action_337 _ = happyReduce_378 action_338 _ = happyReduce_395 action_339 _ = happyReduce_485 action_340 (244) = happyShift action_36 action_340 (245) = happyShift action_37 action_340 (253) = happyShift action_40 action_340 (265) = happyShift action_46 action_340 (270) = happyShift action_48 action_340 (272) = happyShift action_49 action_340 (273) = happyShift action_50 action_340 (274) = happyShift action_51 action_340 (275) = happyShift action_52 action_340 (276) = happyShift action_53 action_340 (277) = happyShift action_54 action_340 (279) = happyShift action_56 action_340 (280) = happyShift action_57 action_340 (281) = happyShift action_58 action_340 (282) = happyShift action_59 action_340 (283) = happyShift action_60 action_340 (286) = happyShift action_62 action_340 (317) = happyShift action_70 action_340 (321) = happyShift action_342 action_340 (332) = happyShift action_72 action_340 (334) = happyShift action_73 action_340 (336) = happyShift action_112 action_340 (338) = happyShift action_75 action_340 (340) = happyShift action_76 action_340 (345) = happyShift action_77 action_340 (346) = happyShift action_78 action_340 (347) = happyShift action_79 action_340 (350) = happyShift action_80 action_340 (351) = happyShift action_81 action_340 (354) = happyShift action_82 action_340 (355) = happyShift action_83 action_340 (356) = happyShift action_84 action_340 (357) = happyShift action_85 action_340 (358) = happyShift action_86 action_340 (359) = happyShift action_87 action_340 (360) = happyShift action_88 action_340 (361) = happyShift action_89 action_340 (362) = happyShift action_90 action_340 (363) = happyShift action_91 action_340 (364) = happyShift action_92 action_340 (365) = happyShift action_93 action_340 (366) = happyShift action_94 action_340 (371) = happyShift action_95 action_340 (372) = happyShift action_96 action_340 (373) = happyShift action_97 action_340 (374) = happyShift action_98 action_340 (376) = happyShift action_99 action_340 (377) = happyShift action_100 action_340 (378) = happyShift action_101 action_340 (379) = happyShift action_102 action_340 (380) = happyShift action_103 action_340 (38) = happyGoto action_13 action_340 (142) = happyGoto action_16 action_340 (150) = happyGoto action_339 action_340 (151) = happyGoto action_23 action_340 (152) = happyGoto action_24 action_340 (179) = happyGoto action_418 action_340 (180) = happyGoto action_419 action_340 (192) = happyGoto action_25 action_340 (195) = happyGoto action_26 action_340 (198) = happyGoto action_27 action_340 (219) = happyGoto action_29 action_340 (220) = happyGoto action_30 action_340 (221) = happyGoto action_111 action_340 (227) = happyGoto action_32 action_340 (229) = happyGoto action_33 action_340 (230) = happyGoto action_34 action_340 (233) = happyGoto action_35 action_340 _ = happyReduce_488 action_341 (328) = happyShift action_416 action_341 (330) = happyShift action_417 action_341 (170) = happyGoto action_415 action_341 _ = happyFail action_342 (244) = happyShift action_36 action_342 (245) = happyShift action_37 action_342 (253) = happyShift action_40 action_342 (265) = happyShift action_46 action_342 (270) = happyShift action_48 action_342 (272) = happyShift action_49 action_342 (273) = happyShift action_50 action_342 (274) = happyShift action_51 action_342 (275) = happyShift action_52 action_342 (276) = happyShift action_53 action_342 (277) = happyShift action_54 action_342 (279) = happyShift action_56 action_342 (280) = happyShift action_57 action_342 (281) = happyShift action_58 action_342 (282) = happyShift action_59 action_342 (283) = happyShift action_60 action_342 (286) = happyShift action_62 action_342 (317) = happyShift action_70 action_342 (332) = happyShift action_72 action_342 (334) = happyShift action_73 action_342 (336) = happyShift action_112 action_342 (338) = happyShift action_75 action_342 (340) = happyShift action_76 action_342 (345) = happyShift action_77 action_342 (346) = happyShift action_78 action_342 (347) = happyShift action_79 action_342 (350) = happyShift action_80 action_342 (351) = happyShift action_81 action_342 (354) = happyShift action_82 action_342 (355) = happyShift action_83 action_342 (356) = happyShift action_84 action_342 (357) = happyShift action_85 action_342 (358) = happyShift action_86 action_342 (359) = happyShift action_87 action_342 (360) = happyShift action_88 action_342 (361) = happyShift action_89 action_342 (362) = happyShift action_90 action_342 (363) = happyShift action_91 action_342 (364) = happyShift action_92 action_342 (365) = happyShift action_93 action_342 (366) = happyShift action_94 action_342 (371) = happyShift action_95 action_342 (372) = happyShift action_96 action_342 (373) = happyShift action_97 action_342 (374) = happyShift action_98 action_342 (376) = happyShift action_99 action_342 (377) = happyShift action_100 action_342 (378) = happyShift action_101 action_342 (379) = happyShift action_102 action_342 (380) = happyShift action_103 action_342 (38) = happyGoto action_13 action_342 (142) = happyGoto action_16 action_342 (150) = happyGoto action_414 action_342 (151) = happyGoto action_23 action_342 (152) = happyGoto action_24 action_342 (192) = happyGoto action_25 action_342 (195) = happyGoto action_26 action_342 (198) = happyGoto action_27 action_342 (219) = happyGoto action_29 action_342 (220) = happyGoto action_30 action_342 (221) = happyGoto action_111 action_342 (227) = happyGoto action_32 action_342 (229) = happyGoto action_33 action_342 (230) = happyGoto action_34 action_342 (233) = happyGoto action_35 action_342 _ = happyFail action_343 (359) = happyShift action_413 action_343 _ = happyFail action_344 (306) = happyShift action_412 action_344 _ = happyFail action_345 (306) = happyShift action_411 action_345 _ = happyFail action_346 (306) = happyShift action_410 action_346 _ = happyFail action_347 (245) = happyShift action_37 action_347 (253) = happyShift action_40 action_347 (265) = happyShift action_46 action_347 (270) = happyShift action_48 action_347 (272) = happyShift action_49 action_347 (273) = happyShift action_50 action_347 (274) = happyShift action_51 action_347 (275) = happyShift action_52 action_347 (276) = happyShift action_53 action_347 (277) = happyShift action_54 action_347 (279) = happyShift action_56 action_347 (280) = happyShift action_57 action_347 (281) = happyShift action_58 action_347 (282) = happyShift action_59 action_347 (283) = happyShift action_60 action_347 (286) = happyShift action_62 action_347 (336) = happyShift action_177 action_347 (346) = happyShift action_78 action_347 (350) = happyShift action_80 action_347 (354) = happyShift action_82 action_347 (219) = happyGoto action_409 action_347 (220) = happyGoto action_30 action_347 (221) = happyGoto action_111 action_347 (227) = happyGoto action_32 action_347 _ = happyFail action_348 _ = happyReduce_178 action_349 (317) = happyShift action_407 action_349 (359) = happyShift action_408 action_349 _ = happyFail action_350 (245) = happyShift action_37 action_350 (253) = happyShift action_40 action_350 (265) = happyShift action_46 action_350 (270) = happyShift action_48 action_350 (272) = happyShift action_49 action_350 (273) = happyShift action_50 action_350 (274) = happyShift action_51 action_350 (275) = happyShift action_52 action_350 (276) = happyShift action_53 action_350 (277) = happyShift action_54 action_350 (279) = happyShift action_56 action_350 (280) = happyShift action_57 action_350 (281) = happyShift action_58 action_350 (282) = happyShift action_59 action_350 (283) = happyShift action_60 action_350 (286) = happyShift action_62 action_350 (336) = happyShift action_177 action_350 (346) = happyShift action_78 action_350 (350) = happyShift action_80 action_350 (354) = happyShift action_82 action_350 (219) = happyGoto action_406 action_350 (220) = happyGoto action_30 action_350 (221) = happyGoto action_111 action_350 (227) = happyGoto action_32 action_350 _ = happyFail action_351 (245) = happyShift action_37 action_351 (253) = happyShift action_40 action_351 (265) = happyShift action_46 action_351 (270) = happyShift action_249 action_351 (272) = happyShift action_49 action_351 (273) = happyShift action_50 action_351 (274) = happyShift action_51 action_351 (275) = happyShift action_221 action_351 (276) = happyShift action_222 action_351 (277) = happyShift action_223 action_351 (280) = happyShift action_57 action_351 (281) = happyShift action_58 action_351 (282) = happyShift action_59 action_351 (283) = happyShift action_60 action_351 (286) = happyShift action_62 action_351 (299) = happyShift action_225 action_351 (300) = happyShift action_226 action_351 (321) = happyShift action_227 action_351 (328) = happyShift action_228 action_351 (332) = happyShift action_229 action_351 (334) = happyShift action_230 action_351 (336) = happyShift action_231 action_351 (338) = happyShift action_232 action_351 (345) = happyShift action_233 action_351 (346) = happyShift action_234 action_351 (347) = happyShift action_235 action_351 (351) = happyShift action_236 action_351 (355) = happyShift action_237 action_351 (356) = happyShift action_84 action_351 (358) = happyShift action_238 action_351 (359) = happyShift action_239 action_351 (376) = happyShift action_240 action_351 (377) = happyShift action_241 action_351 (379) = happyShift action_102 action_351 (380) = happyShift action_103 action_351 (95) = happyGoto action_242 action_351 (100) = happyGoto action_208 action_351 (101) = happyGoto action_243 action_351 (103) = happyGoto action_244 action_351 (104) = happyGoto action_245 action_351 (106) = happyGoto action_246 action_351 (107) = happyGoto action_211 action_351 (108) = happyGoto action_405 action_351 (142) = happyGoto action_212 action_351 (192) = happyGoto action_248 action_351 (202) = happyGoto action_213 action_351 (203) = happyGoto action_214 action_351 (205) = happyGoto action_215 action_351 (206) = happyGoto action_216 action_351 (215) = happyGoto action_217 action_351 (217) = happyGoto action_218 action_351 (227) = happyGoto action_219 action_351 _ = happyFail action_352 (245) = happyShift action_37 action_352 (253) = happyShift action_40 action_352 (265) = happyShift action_46 action_352 (270) = happyShift action_48 action_352 (272) = happyShift action_49 action_352 (273) = happyShift action_50 action_352 (274) = happyShift action_51 action_352 (275) = happyShift action_52 action_352 (276) = happyShift action_53 action_352 (277) = happyShift action_54 action_352 (279) = happyShift action_56 action_352 (280) = happyShift action_57 action_352 (281) = happyShift action_58 action_352 (282) = happyShift action_59 action_352 (283) = happyShift action_60 action_352 (286) = happyShift action_62 action_352 (336) = happyShift action_177 action_352 (346) = happyShift action_78 action_352 (350) = happyShift action_80 action_352 (354) = happyShift action_82 action_352 (219) = happyGoto action_404 action_352 (220) = happyGoto action_30 action_352 (221) = happyGoto action_111 action_352 (227) = happyGoto action_32 action_352 _ = happyFail action_353 (315) = happyShift action_403 action_353 _ = happyFail action_354 _ = happyReduce_380 action_355 _ = happyReduce_388 action_356 (256) = happyShift action_402 action_356 _ = happyFail action_357 (342) = happyShift action_401 action_357 (146) = happyGoto action_400 action_357 _ = happyReduce_387 action_358 (313) = happyShift action_360 action_358 (177) = happyGoto action_399 action_358 _ = happyReduce_376 action_359 _ = happyReduce_481 action_360 (244) = happyShift action_36 action_360 (245) = happyShift action_37 action_360 (246) = happyShift action_38 action_360 (251) = happyShift action_39 action_360 (253) = happyShift action_40 action_360 (254) = happyShift action_41 action_360 (261) = happyShift action_155 action_360 (265) = happyShift action_46 action_360 (269) = happyShift action_47 action_360 (270) = happyShift action_48 action_360 (272) = happyShift action_49 action_360 (273) = happyShift action_50 action_360 (274) = happyShift action_51 action_360 (275) = happyShift action_52 action_360 (276) = happyShift action_53 action_360 (277) = happyShift action_54 action_360 (278) = happyShift action_55 action_360 (279) = happyShift action_56 action_360 (280) = happyShift action_57 action_360 (281) = happyShift action_58 action_360 (282) = happyShift action_59 action_360 (283) = happyShift action_60 action_360 (284) = happyShift action_61 action_360 (286) = happyShift action_62 action_360 (294) = happyShift action_66 action_360 (295) = happyShift action_67 action_360 (296) = happyShift action_68 action_360 (311) = happyShift action_69 action_360 (317) = happyShift action_70 action_360 (320) = happyShift action_71 action_360 (321) = happyShift action_157 action_360 (332) = happyShift action_72 action_360 (334) = happyShift action_73 action_360 (336) = happyShift action_112 action_360 (338) = happyShift action_75 action_360 (340) = happyShift action_76 action_360 (345) = happyShift action_77 action_360 (346) = happyShift action_78 action_360 (347) = happyShift action_79 action_360 (350) = happyShift action_80 action_360 (351) = happyShift action_81 action_360 (354) = happyShift action_82 action_360 (355) = happyShift action_83 action_360 (356) = happyShift action_84 action_360 (357) = happyShift action_85 action_360 (358) = happyShift action_86 action_360 (359) = happyShift action_87 action_360 (360) = happyShift action_88 action_360 (361) = happyShift action_89 action_360 (362) = happyShift action_90 action_360 (363) = happyShift action_91 action_360 (364) = happyShift action_92 action_360 (365) = happyShift action_93 action_360 (366) = happyShift action_94 action_360 (371) = happyShift action_95 action_360 (372) = happyShift action_96 action_360 (373) = happyShift action_97 action_360 (374) = happyShift action_98 action_360 (376) = happyShift action_99 action_360 (377) = happyShift action_100 action_360 (378) = happyShift action_101 action_360 (379) = happyShift action_102 action_360 (380) = happyShift action_103 action_360 (38) = happyGoto action_13 action_360 (142) = happyGoto action_16 action_360 (143) = happyGoto action_151 action_360 (144) = happyGoto action_110 action_360 (145) = happyGoto action_18 action_360 (147) = happyGoto action_19 action_360 (148) = happyGoto action_20 action_360 (149) = happyGoto action_21 action_360 (150) = happyGoto action_22 action_360 (151) = happyGoto action_23 action_360 (152) = happyGoto action_24 action_360 (168) = happyGoto action_396 action_360 (169) = happyGoto action_397 action_360 (178) = happyGoto action_152 action_360 (186) = happyGoto action_398 action_360 (192) = happyGoto action_25 action_360 (195) = happyGoto action_26 action_360 (198) = happyGoto action_27 action_360 (219) = happyGoto action_29 action_360 (220) = happyGoto action_30 action_360 (221) = happyGoto action_111 action_360 (227) = happyGoto action_32 action_360 (229) = happyGoto action_33 action_360 (230) = happyGoto action_34 action_360 (233) = happyGoto action_35 action_360 _ = happyFail action_361 _ = happyReduce_379 action_362 (264) = happyShift action_395 action_362 _ = happyFail action_363 (244) = happyShift action_36 action_363 (245) = happyShift action_37 action_363 (253) = happyShift action_40 action_363 (265) = happyShift action_46 action_363 (270) = happyShift action_48 action_363 (272) = happyShift action_49 action_363 (273) = happyShift action_50 action_363 (274) = happyShift action_51 action_363 (275) = happyShift action_52 action_363 (276) = happyShift action_53 action_363 (277) = happyShift action_54 action_363 (279) = happyShift action_56 action_363 (280) = happyShift action_57 action_363 (281) = happyShift action_58 action_363 (282) = happyShift action_59 action_363 (283) = happyShift action_60 action_363 (286) = happyShift action_62 action_363 (317) = happyShift action_70 action_363 (332) = happyShift action_72 action_363 (334) = happyShift action_73 action_363 (336) = happyShift action_112 action_363 (338) = happyShift action_75 action_363 (340) = happyShift action_76 action_363 (345) = happyShift action_77 action_363 (346) = happyShift action_78 action_363 (347) = happyShift action_79 action_363 (350) = happyShift action_80 action_363 (351) = happyShift action_81 action_363 (354) = happyShift action_82 action_363 (355) = happyShift action_83 action_363 (356) = happyShift action_84 action_363 (357) = happyShift action_85 action_363 (358) = happyShift action_86 action_363 (359) = happyShift action_87 action_363 (360) = happyShift action_88 action_363 (361) = happyShift action_89 action_363 (362) = happyShift action_90 action_363 (363) = happyShift action_91 action_363 (364) = happyShift action_92 action_363 (365) = happyShift action_93 action_363 (366) = happyShift action_94 action_363 (371) = happyShift action_95 action_363 (372) = happyShift action_96 action_363 (373) = happyShift action_97 action_363 (374) = happyShift action_98 action_363 (376) = happyShift action_99 action_363 (377) = happyShift action_100 action_363 (378) = happyShift action_101 action_363 (379) = happyShift action_102 action_363 (380) = happyShift action_103 action_363 (38) = happyGoto action_13 action_363 (142) = happyGoto action_16 action_363 (150) = happyGoto action_394 action_363 (151) = happyGoto action_23 action_363 (152) = happyGoto action_24 action_363 (192) = happyGoto action_25 action_363 (195) = happyGoto action_26 action_363 (198) = happyGoto action_27 action_363 (219) = happyGoto action_29 action_363 (220) = happyGoto action_30 action_363 (221) = happyGoto action_111 action_363 (227) = happyGoto action_32 action_363 (229) = happyGoto action_33 action_363 (230) = happyGoto action_34 action_363 (233) = happyGoto action_35 action_363 _ = happyFail action_364 (245) = happyShift action_37 action_364 (253) = happyShift action_40 action_364 (265) = happyShift action_46 action_364 (270) = happyShift action_48 action_364 (272) = happyShift action_49 action_364 (273) = happyShift action_50 action_364 (274) = happyShift action_51 action_364 (275) = happyShift action_52 action_364 (276) = happyShift action_53 action_364 (277) = happyShift action_54 action_364 (279) = happyShift action_56 action_364 (280) = happyShift action_57 action_364 (281) = happyShift action_58 action_364 (282) = happyShift action_59 action_364 (283) = happyShift action_60 action_364 (286) = happyShift action_62 action_364 (336) = happyShift action_393 action_364 (346) = happyShift action_78 action_364 (97) = happyGoto action_391 action_364 (218) = happyGoto action_392 action_364 (221) = happyGoto action_188 action_364 (227) = happyGoto action_32 action_364 _ = happyFail action_365 (245) = happyShift action_37 action_365 (253) = happyShift action_40 action_365 (265) = happyShift action_46 action_365 (270) = happyShift action_48 action_365 (272) = happyShift action_49 action_365 (273) = happyShift action_50 action_365 (274) = happyShift action_51 action_365 (275) = happyShift action_52 action_365 (276) = happyShift action_53 action_365 (277) = happyShift action_54 action_365 (279) = happyShift action_56 action_365 (280) = happyShift action_57 action_365 (281) = happyShift action_58 action_365 (282) = happyShift action_59 action_365 (283) = happyShift action_60 action_365 (286) = happyShift action_62 action_365 (307) = happyShift action_390 action_365 (336) = happyShift action_177 action_365 (346) = happyShift action_78 action_365 (350) = happyShift action_80 action_365 (354) = happyShift action_82 action_365 (187) = happyGoto action_386 action_365 (188) = happyGoto action_387 action_365 (189) = happyGoto action_388 action_365 (219) = happyGoto action_389 action_365 (220) = happyGoto action_30 action_365 (221) = happyGoto action_111 action_365 (227) = happyGoto action_32 action_365 _ = happyReduce_504 action_366 _ = happyReduce_392 action_367 _ = happyReduce_382 action_368 _ = happyReduce_381 action_369 (245) = happyShift action_37 action_369 (253) = happyShift action_40 action_369 (265) = happyShift action_46 action_369 (270) = happyShift action_385 action_369 (272) = happyShift action_49 action_369 (273) = happyShift action_50 action_369 (274) = happyShift action_51 action_369 (275) = happyShift action_221 action_369 (276) = happyShift action_222 action_369 (277) = happyShift action_223 action_369 (280) = happyShift action_57 action_369 (281) = happyShift action_58 action_369 (282) = happyShift action_59 action_369 (283) = happyShift action_60 action_369 (286) = happyShift action_62 action_369 (299) = happyShift action_225 action_369 (300) = happyShift action_226 action_369 (321) = happyShift action_227 action_369 (328) = happyShift action_228 action_369 (332) = happyShift action_229 action_369 (334) = happyShift action_230 action_369 (336) = happyShift action_231 action_369 (338) = happyShift action_232 action_369 (345) = happyShift action_233 action_369 (346) = happyShift action_234 action_369 (347) = happyShift action_235 action_369 (351) = happyShift action_236 action_369 (355) = happyShift action_237 action_369 (356) = happyShift action_84 action_369 (358) = happyShift action_238 action_369 (359) = happyShift action_239 action_369 (376) = happyShift action_240 action_369 (377) = happyShift action_241 action_369 (379) = happyShift action_102 action_369 (380) = happyShift action_103 action_369 (96) = happyGoto action_379 action_369 (100) = happyGoto action_208 action_369 (102) = happyGoto action_380 action_369 (103) = happyGoto action_381 action_369 (105) = happyGoto action_382 action_369 (106) = happyGoto action_383 action_369 (107) = happyGoto action_211 action_369 (142) = happyGoto action_212 action_369 (192) = happyGoto action_384 action_369 (202) = happyGoto action_213 action_369 (203) = happyGoto action_214 action_369 (205) = happyGoto action_215 action_369 (206) = happyGoto action_216 action_369 (215) = happyGoto action_217 action_369 (217) = happyGoto action_218 action_369 (227) = happyGoto action_219 action_369 _ = happyFail action_370 (308) = happyShift action_267 action_370 (320) = happyShift action_269 action_370 (321) = happyShift action_270 action_370 (322) = happyShift action_271 action_370 (327) = happyShift action_272 action_370 (344) = happyShift action_378 action_370 (348) = happyShift action_274 action_370 (349) = happyShift action_275 action_370 (50) = happyGoto action_372 action_370 (199) = happyGoto action_373 action_370 (209) = happyGoto action_374 action_370 (210) = happyGoto action_375 action_370 (225) = happyGoto action_376 action_370 (226) = happyGoto action_263 action_370 (228) = happyGoto action_264 action_370 (232) = happyGoto action_377 action_370 _ = happyFail action_371 _ = happyReduce_85 action_372 (343) = happyShift action_781 action_372 _ = happyReduce_357 action_373 _ = happyReduce_562 action_374 _ = happyReduce_90 action_375 _ = happyReduce_561 action_376 _ = happyReduce_563 action_377 _ = happyReduce_532 action_378 (245) = happyShift action_37 action_378 (253) = happyShift action_40 action_378 (265) = happyShift action_46 action_378 (270) = happyShift action_48 action_378 (272) = happyShift action_49 action_378 (273) = happyShift action_50 action_378 (274) = happyShift action_51 action_378 (275) = happyShift action_52 action_378 (276) = happyShift action_53 action_378 (277) = happyShift action_54 action_378 (279) = happyShift action_56 action_378 (280) = happyShift action_57 action_378 (281) = happyShift action_58 action_378 (282) = happyShift action_59 action_378 (283) = happyShift action_60 action_378 (286) = happyShift action_62 action_378 (346) = happyShift action_78 action_378 (347) = happyShift action_79 action_378 (221) = happyGoto action_779 action_378 (227) = happyGoto action_32 action_378 (230) = happyGoto action_780 action_378 _ = happyFail action_379 _ = happyReduce_355 action_380 _ = happyReduce_221 action_381 (319) = happyShift action_778 action_381 _ = happyFail action_382 _ = happyReduce_238 action_383 (245) = happyShift action_37 action_383 (253) = happyShift action_40 action_383 (265) = happyShift action_46 action_383 (272) = happyShift action_49 action_383 (273) = happyShift action_50 action_383 (274) = happyShift action_51 action_383 (275) = happyShift action_221 action_383 (276) = happyShift action_222 action_383 (277) = happyShift action_223 action_383 (280) = happyShift action_57 action_383 (281) = happyShift action_58 action_383 (282) = happyShift action_59 action_383 (283) = happyShift action_60 action_383 (286) = happyShift action_62 action_383 (299) = happyShift action_225 action_383 (300) = happyShift action_226 action_383 (315) = happyShift action_775 action_383 (317) = happyShift action_776 action_383 (319) = happyReduce_240 action_383 (321) = happyShift action_227 action_383 (322) = happyShift action_460 action_383 (327) = happyShift action_523 action_383 (328) = happyShift action_228 action_383 (332) = happyShift action_229 action_383 (334) = happyShift action_230 action_383 (336) = happyShift action_231 action_383 (338) = happyShift action_232 action_383 (344) = happyShift action_524 action_383 (345) = happyShift action_777 action_383 (346) = happyShift action_234 action_383 (347) = happyShift action_235 action_383 (348) = happyShift action_462 action_383 (349) = happyShift action_463 action_383 (351) = happyShift action_236 action_383 (352) = happyShift action_464 action_383 (353) = happyShift action_465 action_383 (355) = happyShift action_237 action_383 (358) = happyShift action_238 action_383 (359) = happyShift action_239 action_383 (368) = happyShift action_146 action_383 (376) = happyShift action_240 action_383 (377) = happyShift action_241 action_383 (379) = happyShift action_102 action_383 (380) = happyShift action_103 action_383 (100) = happyGoto action_208 action_383 (107) = happyGoto action_517 action_383 (142) = happyGoto action_212 action_383 (202) = happyGoto action_213 action_383 (203) = happyGoto action_214 action_383 (204) = happyGoto action_773 action_383 (205) = happyGoto action_215 action_383 (206) = happyGoto action_216 action_383 (207) = happyGoto action_519 action_383 (208) = happyGoto action_455 action_383 (215) = happyGoto action_217 action_383 (216) = happyGoto action_774 action_383 (217) = happyGoto action_218 action_383 (227) = happyGoto action_219 action_383 (238) = happyGoto action_696 action_383 _ = happyReduce_248 action_384 (309) = happyShift action_772 action_384 _ = happyFail action_385 (245) = happyShift action_37 action_385 (253) = happyShift action_40 action_385 (265) = happyShift action_46 action_385 (272) = happyShift action_49 action_385 (273) = happyShift action_50 action_385 (274) = happyShift action_51 action_385 (275) = happyShift action_221 action_385 (276) = happyShift action_222 action_385 (277) = happyShift action_223 action_385 (280) = happyShift action_57 action_385 (281) = happyShift action_58 action_385 (282) = happyShift action_59 action_385 (283) = happyShift action_60 action_385 (286) = happyShift action_62 action_385 (336) = happyShift action_513 action_385 (346) = happyShift action_234 action_385 (112) = happyGoto action_771 action_385 (113) = happyGoto action_511 action_385 (215) = happyGoto action_512 action_385 (217) = happyGoto action_218 action_385 (227) = happyGoto action_219 action_385 _ = happyReduce_291 action_386 (329) = happyShift action_770 action_386 _ = happyFail action_387 _ = happyReduce_503 action_388 (343) = happyShift action_769 action_388 _ = happyReduce_506 action_389 (310) = happyShift action_768 action_389 _ = happyReduce_509 action_390 _ = happyReduce_507 action_391 (309) = happyShift action_766 action_391 (343) = happyShift action_767 action_391 _ = happyFail action_392 _ = happyReduce_223 action_393 (320) = happyShift action_269 action_393 (321) = happyShift action_270 action_393 (322) = happyShift action_271 action_393 (327) = happyShift action_272 action_393 (348) = happyShift action_274 action_393 (225) = happyGoto action_568 action_393 (226) = happyGoto action_263 action_393 (228) = happyGoto action_264 action_393 _ = happyFail action_394 _ = happyReduce_394 action_395 (328) = happyShift action_416 action_395 (330) = happyShift action_417 action_395 (170) = happyGoto action_765 action_395 _ = happyFail action_396 (315) = happyShift action_764 action_396 _ = happyFail action_397 (343) = happyShift action_763 action_397 _ = happyReduce_466 action_398 _ = happyReduce_468 action_399 _ = happyReduce_480 action_400 (266) = happyShift action_762 action_400 _ = happyFail action_401 _ = happyReduce_386 action_402 (244) = happyShift action_36 action_402 (245) = happyShift action_37 action_402 (246) = happyShift action_38 action_402 (251) = happyShift action_39 action_402 (253) = happyShift action_40 action_402 (254) = happyShift action_41 action_402 (261) = happyShift action_45 action_402 (265) = happyShift action_46 action_402 (269) = happyShift action_47 action_402 (270) = happyShift action_48 action_402 (272) = happyShift action_49 action_402 (273) = happyShift action_50 action_402 (274) = happyShift action_51 action_402 (275) = happyShift action_52 action_402 (276) = happyShift action_53 action_402 (277) = happyShift action_54 action_402 (278) = happyShift action_55 action_402 (279) = happyShift action_56 action_402 (280) = happyShift action_57 action_402 (281) = happyShift action_58 action_402 (282) = happyShift action_59 action_402 (283) = happyShift action_60 action_402 (284) = happyShift action_61 action_402 (286) = happyShift action_62 action_402 (294) = happyShift action_66 action_402 (295) = happyShift action_67 action_402 (296) = happyShift action_68 action_402 (311) = happyShift action_69 action_402 (317) = happyShift action_70 action_402 (320) = happyShift action_71 action_402 (332) = happyShift action_72 action_402 (334) = happyShift action_73 action_402 (336) = happyShift action_112 action_402 (338) = happyShift action_75 action_402 (340) = happyShift action_76 action_402 (345) = happyShift action_77 action_402 (346) = happyShift action_78 action_402 (347) = happyShift action_79 action_402 (350) = happyShift action_80 action_402 (351) = happyShift action_81 action_402 (354) = happyShift action_82 action_402 (355) = happyShift action_83 action_402 (356) = happyShift action_84 action_402 (357) = happyShift action_85 action_402 (358) = happyShift action_86 action_402 (359) = happyShift action_87 action_402 (360) = happyShift action_88 action_402 (361) = happyShift action_89 action_402 (362) = happyShift action_90 action_402 (363) = happyShift action_91 action_402 (364) = happyShift action_92 action_402 (365) = happyShift action_93 action_402 (366) = happyShift action_94 action_402 (371) = happyShift action_95 action_402 (372) = happyShift action_96 action_402 (373) = happyShift action_97 action_402 (374) = happyShift action_98 action_402 (376) = happyShift action_99 action_402 (377) = happyShift action_100 action_402 (378) = happyShift action_101 action_402 (379) = happyShift action_102 action_402 (380) = happyShift action_103 action_402 (38) = happyGoto action_13 action_402 (142) = happyGoto action_16 action_402 (143) = happyGoto action_761 action_402 (144) = happyGoto action_110 action_402 (145) = happyGoto action_18 action_402 (147) = happyGoto action_19 action_402 (148) = happyGoto action_20 action_402 (149) = happyGoto action_21 action_402 (150) = happyGoto action_22 action_402 (151) = happyGoto action_23 action_402 (152) = happyGoto action_24 action_402 (192) = happyGoto action_25 action_402 (195) = happyGoto action_26 action_402 (198) = happyGoto action_27 action_402 (219) = happyGoto action_29 action_402 (220) = happyGoto action_30 action_402 (221) = happyGoto action_111 action_402 (227) = happyGoto action_32 action_402 (229) = happyGoto action_33 action_402 (230) = happyGoto action_34 action_402 (233) = happyGoto action_35 action_402 _ = happyFail action_403 (244) = happyShift action_36 action_403 (245) = happyShift action_37 action_403 (246) = happyShift action_38 action_403 (251) = happyShift action_39 action_403 (253) = happyShift action_40 action_403 (254) = happyShift action_41 action_403 (261) = happyShift action_45 action_403 (265) = happyShift action_46 action_403 (269) = happyShift action_47 action_403 (270) = happyShift action_48 action_403 (272) = happyShift action_49 action_403 (273) = happyShift action_50 action_403 (274) = happyShift action_51 action_403 (275) = happyShift action_52 action_403 (276) = happyShift action_53 action_403 (277) = happyShift action_54 action_403 (278) = happyShift action_55 action_403 (279) = happyShift action_56 action_403 (280) = happyShift action_57 action_403 (281) = happyShift action_58 action_403 (282) = happyShift action_59 action_403 (283) = happyShift action_60 action_403 (284) = happyShift action_61 action_403 (286) = happyShift action_62 action_403 (294) = happyShift action_66 action_403 (295) = happyShift action_67 action_403 (296) = happyShift action_68 action_403 (311) = happyShift action_69 action_403 (317) = happyShift action_70 action_403 (320) = happyShift action_71 action_403 (332) = happyShift action_72 action_403 (334) = happyShift action_73 action_403 (336) = happyShift action_112 action_403 (338) = happyShift action_75 action_403 (340) = happyShift action_76 action_403 (345) = happyShift action_77 action_403 (346) = happyShift action_78 action_403 (347) = happyShift action_79 action_403 (350) = happyShift action_80 action_403 (351) = happyShift action_81 action_403 (354) = happyShift action_82 action_403 (355) = happyShift action_83 action_403 (356) = happyShift action_84 action_403 (357) = happyShift action_85 action_403 (358) = happyShift action_86 action_403 (359) = happyShift action_87 action_403 (360) = happyShift action_88 action_403 (361) = happyShift action_89 action_403 (362) = happyShift action_90 action_403 (363) = happyShift action_91 action_403 (364) = happyShift action_92 action_403 (365) = happyShift action_93 action_403 (366) = happyShift action_94 action_403 (371) = happyShift action_95 action_403 (372) = happyShift action_96 action_403 (373) = happyShift action_97 action_403 (374) = happyShift action_98 action_403 (376) = happyShift action_99 action_403 (377) = happyShift action_100 action_403 (378) = happyShift action_101 action_403 (379) = happyShift action_102 action_403 (380) = happyShift action_103 action_403 (38) = happyGoto action_13 action_403 (142) = happyGoto action_16 action_403 (143) = happyGoto action_760 action_403 (144) = happyGoto action_110 action_403 (145) = happyGoto action_18 action_403 (147) = happyGoto action_19 action_403 (148) = happyGoto action_20 action_403 (149) = happyGoto action_21 action_403 (150) = happyGoto action_22 action_403 (151) = happyGoto action_23 action_403 (152) = happyGoto action_24 action_403 (192) = happyGoto action_25 action_403 (195) = happyGoto action_26 action_403 (198) = happyGoto action_27 action_403 (219) = happyGoto action_29 action_403 (220) = happyGoto action_30 action_403 (221) = happyGoto action_111 action_403 (227) = happyGoto action_32 action_403 (229) = happyGoto action_33 action_403 (230) = happyGoto action_34 action_403 (233) = happyGoto action_35 action_403 _ = happyFail action_404 (306) = happyShift action_759 action_404 _ = happyFail action_405 (306) = happyShift action_758 action_405 _ = happyFail action_406 (309) = happyShift action_757 action_406 _ = happyFail action_407 (359) = happyShift action_756 action_407 _ = happyFail action_408 (333) = happyShift action_755 action_408 _ = happyFail action_409 (309) = happyShift action_754 action_409 _ = happyFail action_410 (244) = happyShift action_36 action_410 (245) = happyShift action_37 action_410 (246) = happyShift action_38 action_410 (251) = happyShift action_39 action_410 (253) = happyShift action_40 action_410 (254) = happyShift action_41 action_410 (261) = happyShift action_45 action_410 (265) = happyShift action_46 action_410 (269) = happyShift action_47 action_410 (270) = happyShift action_48 action_410 (272) = happyShift action_49 action_410 (273) = happyShift action_50 action_410 (274) = happyShift action_51 action_410 (275) = happyShift action_52 action_410 (276) = happyShift action_53 action_410 (277) = happyShift action_54 action_410 (278) = happyShift action_55 action_410 (279) = happyShift action_56 action_410 (280) = happyShift action_57 action_410 (281) = happyShift action_58 action_410 (282) = happyShift action_59 action_410 (283) = happyShift action_60 action_410 (284) = happyShift action_61 action_410 (286) = happyShift action_62 action_410 (294) = happyShift action_66 action_410 (295) = happyShift action_67 action_410 (296) = happyShift action_68 action_410 (311) = happyShift action_69 action_410 (317) = happyShift action_70 action_410 (320) = happyShift action_71 action_410 (332) = happyShift action_72 action_410 (334) = happyShift action_73 action_410 (336) = happyShift action_112 action_410 (338) = happyShift action_75 action_410 (340) = happyShift action_76 action_410 (345) = happyShift action_77 action_410 (346) = happyShift action_78 action_410 (347) = happyShift action_79 action_410 (350) = happyShift action_80 action_410 (351) = happyShift action_81 action_410 (354) = happyShift action_82 action_410 (355) = happyShift action_83 action_410 (356) = happyShift action_84 action_410 (357) = happyShift action_85 action_410 (358) = happyShift action_86 action_410 (359) = happyShift action_87 action_410 (360) = happyShift action_88 action_410 (361) = happyShift action_89 action_410 (362) = happyShift action_90 action_410 (363) = happyShift action_91 action_410 (364) = happyShift action_92 action_410 (365) = happyShift action_93 action_410 (366) = happyShift action_94 action_410 (371) = happyShift action_95 action_410 (372) = happyShift action_96 action_410 (373) = happyShift action_97 action_410 (374) = happyShift action_98 action_410 (376) = happyShift action_99 action_410 (377) = happyShift action_100 action_410 (378) = happyShift action_101 action_410 (379) = happyShift action_102 action_410 (380) = happyShift action_103 action_410 (38) = happyGoto action_13 action_410 (142) = happyGoto action_16 action_410 (143) = happyGoto action_753 action_410 (144) = happyGoto action_110 action_410 (145) = happyGoto action_18 action_410 (147) = happyGoto action_19 action_410 (148) = happyGoto action_20 action_410 (149) = happyGoto action_21 action_410 (150) = happyGoto action_22 action_410 (151) = happyGoto action_23 action_410 (152) = happyGoto action_24 action_410 (192) = happyGoto action_25 action_410 (195) = happyGoto action_26 action_410 (198) = happyGoto action_27 action_410 (219) = happyGoto action_29 action_410 (220) = happyGoto action_30 action_410 (221) = happyGoto action_111 action_410 (227) = happyGoto action_32 action_410 (229) = happyGoto action_33 action_410 (230) = happyGoto action_34 action_410 (233) = happyGoto action_35 action_410 _ = happyFail action_411 _ = happyReduce_389 action_412 _ = happyReduce_390 action_413 (308) = happyShift action_752 action_413 _ = happyFail action_414 _ = happyReduce_486 action_415 _ = happyReduce_374 action_416 (244) = happyShift action_36 action_416 (245) = happyShift action_37 action_416 (246) = happyShift action_38 action_416 (251) = happyShift action_39 action_416 (253) = happyShift action_40 action_416 (254) = happyShift action_41 action_416 (261) = happyShift action_45 action_416 (265) = happyShift action_46 action_416 (269) = happyShift action_47 action_416 (270) = happyShift action_48 action_416 (272) = happyShift action_49 action_416 (273) = happyShift action_50 action_416 (274) = happyShift action_51 action_416 (275) = happyShift action_52 action_416 (276) = happyShift action_53 action_416 (277) = happyShift action_54 action_416 (278) = happyShift action_55 action_416 (279) = happyShift action_56 action_416 (280) = happyShift action_57 action_416 (281) = happyShift action_58 action_416 (282) = happyShift action_59 action_416 (283) = happyShift action_60 action_416 (284) = happyShift action_61 action_416 (286) = happyShift action_62 action_416 (294) = happyShift action_66 action_416 (295) = happyShift action_67 action_416 (296) = happyShift action_68 action_416 (311) = happyShift action_69 action_416 (317) = happyShift action_70 action_416 (320) = happyShift action_71 action_416 (321) = happyShift action_157 action_416 (332) = happyShift action_72 action_416 (334) = happyShift action_73 action_416 (336) = happyShift action_112 action_416 (338) = happyShift action_75 action_416 (340) = happyShift action_76 action_416 (342) = happyShift action_750 action_416 (345) = happyShift action_77 action_416 (346) = happyShift action_78 action_416 (347) = happyShift action_79 action_416 (350) = happyShift action_80 action_416 (351) = happyShift action_81 action_416 (354) = happyShift action_82 action_416 (355) = happyShift action_83 action_416 (356) = happyShift action_84 action_416 (357) = happyShift action_85 action_416 (358) = happyShift action_86 action_416 (359) = happyShift action_87 action_416 (360) = happyShift action_88 action_416 (361) = happyShift action_89 action_416 (362) = happyShift action_90 action_416 (363) = happyShift action_91 action_416 (364) = happyShift action_92 action_416 (365) = happyShift action_93 action_416 (366) = happyShift action_94 action_416 (371) = happyShift action_95 action_416 (372) = happyShift action_96 action_416 (373) = happyShift action_97 action_416 (374) = happyShift action_98 action_416 (376) = happyShift action_99 action_416 (377) = happyShift action_100 action_416 (378) = happyShift action_101 action_416 (379) = happyShift action_102 action_416 (380) = happyShift action_103 action_416 (38) = happyGoto action_13 action_416 (142) = happyGoto action_16 action_416 (143) = happyGoto action_745 action_416 (144) = happyGoto action_110 action_416 (145) = happyGoto action_18 action_416 (147) = happyGoto action_19 action_416 (148) = happyGoto action_20 action_416 (149) = happyGoto action_21 action_416 (150) = happyGoto action_22 action_416 (151) = happyGoto action_23 action_416 (152) = happyGoto action_24 action_416 (171) = happyGoto action_751 action_416 (172) = happyGoto action_747 action_416 (173) = happyGoto action_748 action_416 (178) = happyGoto action_749 action_416 (192) = happyGoto action_25 action_416 (195) = happyGoto action_26 action_416 (198) = happyGoto action_27 action_416 (219) = happyGoto action_29 action_416 (220) = happyGoto action_30 action_416 (221) = happyGoto action_111 action_416 (227) = happyGoto action_32 action_416 (229) = happyGoto action_33 action_416 (230) = happyGoto action_34 action_416 (233) = happyGoto action_35 action_416 _ = happyFail action_417 (244) = happyShift action_36 action_417 (245) = happyShift action_37 action_417 (246) = happyShift action_38 action_417 (251) = happyShift action_39 action_417 (253) = happyShift action_40 action_417 (254) = happyShift action_41 action_417 (261) = happyShift action_45 action_417 (265) = happyShift action_46 action_417 (269) = happyShift action_47 action_417 (270) = happyShift action_48 action_417 (272) = happyShift action_49 action_417 (273) = happyShift action_50 action_417 (274) = happyShift action_51 action_417 (275) = happyShift action_52 action_417 (276) = happyShift action_53 action_417 (277) = happyShift action_54 action_417 (278) = happyShift action_55 action_417 (279) = happyShift action_56 action_417 (280) = happyShift action_57 action_417 (281) = happyShift action_58 action_417 (282) = happyShift action_59 action_417 (283) = happyShift action_60 action_417 (284) = happyShift action_61 action_417 (286) = happyShift action_62 action_417 (294) = happyShift action_66 action_417 (295) = happyShift action_67 action_417 (296) = happyShift action_68 action_417 (311) = happyShift action_69 action_417 (317) = happyShift action_70 action_417 (320) = happyShift action_71 action_417 (321) = happyShift action_157 action_417 (332) = happyShift action_72 action_417 (334) = happyShift action_73 action_417 (336) = happyShift action_112 action_417 (338) = happyShift action_75 action_417 (340) = happyShift action_76 action_417 (342) = happyShift action_750 action_417 (345) = happyShift action_77 action_417 (346) = happyShift action_78 action_417 (347) = happyShift action_79 action_417 (350) = happyShift action_80 action_417 (351) = happyShift action_81 action_417 (354) = happyShift action_82 action_417 (355) = happyShift action_83 action_417 (356) = happyShift action_84 action_417 (357) = happyShift action_85 action_417 (358) = happyShift action_86 action_417 (359) = happyShift action_87 action_417 (360) = happyShift action_88 action_417 (361) = happyShift action_89 action_417 (362) = happyShift action_90 action_417 (363) = happyShift action_91 action_417 (364) = happyShift action_92 action_417 (365) = happyShift action_93 action_417 (366) = happyShift action_94 action_417 (371) = happyShift action_95 action_417 (372) = happyShift action_96 action_417 (373) = happyShift action_97 action_417 (374) = happyShift action_98 action_417 (376) = happyShift action_99 action_417 (377) = happyShift action_100 action_417 (378) = happyShift action_101 action_417 (379) = happyShift action_102 action_417 (380) = happyShift action_103 action_417 (38) = happyGoto action_13 action_417 (142) = happyGoto action_16 action_417 (143) = happyGoto action_745 action_417 (144) = happyGoto action_110 action_417 (145) = happyGoto action_18 action_417 (147) = happyGoto action_19 action_417 (148) = happyGoto action_20 action_417 (149) = happyGoto action_21 action_417 (150) = happyGoto action_22 action_417 (151) = happyGoto action_23 action_417 (152) = happyGoto action_24 action_417 (171) = happyGoto action_746 action_417 (172) = happyGoto action_747 action_417 (173) = happyGoto action_748 action_417 (178) = happyGoto action_749 action_417 (192) = happyGoto action_25 action_417 (195) = happyGoto action_26 action_417 (198) = happyGoto action_27 action_417 (219) = happyGoto action_29 action_417 (220) = happyGoto action_30 action_417 (221) = happyGoto action_111 action_417 (227) = happyGoto action_32 action_417 (229) = happyGoto action_33 action_417 (230) = happyGoto action_34 action_417 (233) = happyGoto action_35 action_417 _ = happyFail action_418 (244) = happyShift action_36 action_418 (245) = happyShift action_37 action_418 (253) = happyShift action_40 action_418 (265) = happyShift action_46 action_418 (270) = happyShift action_48 action_418 (272) = happyShift action_49 action_418 (273) = happyShift action_50 action_418 (274) = happyShift action_51 action_418 (275) = happyShift action_52 action_418 (276) = happyShift action_53 action_418 (277) = happyShift action_54 action_418 (279) = happyShift action_56 action_418 (280) = happyShift action_57 action_418 (281) = happyShift action_58 action_418 (282) = happyShift action_59 action_418 (283) = happyShift action_60 action_418 (286) = happyShift action_62 action_418 (317) = happyShift action_70 action_418 (321) = happyShift action_342 action_418 (332) = happyShift action_72 action_418 (334) = happyShift action_73 action_418 (336) = happyShift action_112 action_418 (338) = happyShift action_75 action_418 (340) = happyShift action_76 action_418 (345) = happyShift action_77 action_418 (346) = happyShift action_78 action_418 (347) = happyShift action_79 action_418 (350) = happyShift action_80 action_418 (351) = happyShift action_81 action_418 (354) = happyShift action_82 action_418 (355) = happyShift action_83 action_418 (356) = happyShift action_84 action_418 (357) = happyShift action_85 action_418 (358) = happyShift action_86 action_418 (359) = happyShift action_87 action_418 (360) = happyShift action_88 action_418 (361) = happyShift action_89 action_418 (362) = happyShift action_90 action_418 (363) = happyShift action_91 action_418 (364) = happyShift action_92 action_418 (365) = happyShift action_93 action_418 (366) = happyShift action_94 action_418 (371) = happyShift action_95 action_418 (372) = happyShift action_96 action_418 (373) = happyShift action_97 action_418 (374) = happyShift action_98 action_418 (376) = happyShift action_99 action_418 (377) = happyShift action_100 action_418 (378) = happyShift action_101 action_418 (379) = happyShift action_102 action_418 (380) = happyShift action_103 action_418 (38) = happyGoto action_13 action_418 (142) = happyGoto action_16 action_418 (150) = happyGoto action_339 action_418 (151) = happyGoto action_23 action_418 (152) = happyGoto action_24 action_418 (179) = happyGoto action_418 action_418 (180) = happyGoto action_744 action_418 (192) = happyGoto action_25 action_418 (195) = happyGoto action_26 action_418 (198) = happyGoto action_27 action_418 (219) = happyGoto action_29 action_418 (220) = happyGoto action_30 action_418 (221) = happyGoto action_111 action_418 (227) = happyGoto action_32 action_418 (229) = happyGoto action_33 action_418 (230) = happyGoto action_34 action_418 (233) = happyGoto action_35 action_418 _ = happyReduce_488 action_419 (309) = happyShift action_743 action_419 (94) = happyGoto action_742 action_419 _ = happyReduce_218 action_420 (244) = happyShift action_36 action_420 (245) = happyShift action_37 action_420 (246) = happyShift action_38 action_420 (251) = happyShift action_39 action_420 (253) = happyShift action_40 action_420 (254) = happyShift action_41 action_420 (261) = happyShift action_45 action_420 (265) = happyShift action_46 action_420 (269) = happyShift action_47 action_420 (270) = happyShift action_48 action_420 (272) = happyShift action_49 action_420 (273) = happyShift action_50 action_420 (274) = happyShift action_51 action_420 (275) = happyShift action_52 action_420 (276) = happyShift action_53 action_420 (277) = happyShift action_54 action_420 (278) = happyShift action_55 action_420 (279) = happyShift action_56 action_420 (280) = happyShift action_57 action_420 (281) = happyShift action_58 action_420 (282) = happyShift action_59 action_420 (283) = happyShift action_60 action_420 (284) = happyShift action_61 action_420 (286) = happyShift action_62 action_420 (294) = happyShift action_66 action_420 (295) = happyShift action_67 action_420 (296) = happyShift action_68 action_420 (308) = happyShift action_267 action_420 (311) = happyShift action_69 action_420 (317) = happyShift action_70 action_420 (320) = happyShift action_71 action_420 (321) = happyShift action_270 action_420 (322) = happyShift action_271 action_420 (327) = happyShift action_272 action_420 (332) = happyShift action_72 action_420 (334) = happyShift action_73 action_420 (336) = happyShift action_112 action_420 (338) = happyShift action_75 action_420 (340) = happyShift action_76 action_420 (344) = happyShift action_297 action_420 (345) = happyShift action_77 action_420 (346) = happyShift action_78 action_420 (347) = happyShift action_79 action_420 (348) = happyShift action_274 action_420 (349) = happyShift action_275 action_420 (350) = happyShift action_80 action_420 (351) = happyShift action_81 action_420 (352) = happyShift action_276 action_420 (353) = happyShift action_277 action_420 (354) = happyShift action_82 action_420 (355) = happyShift action_83 action_420 (356) = happyShift action_84 action_420 (357) = happyShift action_85 action_420 (358) = happyShift action_86 action_420 (359) = happyShift action_87 action_420 (360) = happyShift action_88 action_420 (361) = happyShift action_89 action_420 (362) = happyShift action_90 action_420 (363) = happyShift action_91 action_420 (364) = happyShift action_92 action_420 (365) = happyShift action_93 action_420 (366) = happyShift action_94 action_420 (371) = happyShift action_95 action_420 (372) = happyShift action_96 action_420 (373) = happyShift action_97 action_420 (374) = happyShift action_98 action_420 (376) = happyShift action_99 action_420 (377) = happyShift action_100 action_420 (378) = happyShift action_101 action_420 (379) = happyShift action_102 action_420 (380) = happyShift action_103 action_420 (38) = happyGoto action_13 action_420 (142) = happyGoto action_16 action_420 (143) = happyGoto action_281 action_420 (144) = happyGoto action_282 action_420 (145) = happyGoto action_18 action_420 (147) = happyGoto action_19 action_420 (148) = happyGoto action_20 action_420 (149) = happyGoto action_21 action_420 (150) = happyGoto action_22 action_420 (151) = happyGoto action_23 action_420 (152) = happyGoto action_24 action_420 (157) = happyGoto action_741 action_420 (192) = happyGoto action_25 action_420 (195) = happyGoto action_26 action_420 (198) = happyGoto action_27 action_420 (200) = happyGoto action_285 action_420 (212) = happyGoto action_286 action_420 (214) = happyGoto action_287 action_420 (219) = happyGoto action_29 action_420 (220) = happyGoto action_30 action_420 (221) = happyGoto action_111 action_420 (223) = happyGoto action_288 action_420 (224) = happyGoto action_325 action_420 (226) = happyGoto action_326 action_420 (227) = happyGoto action_32 action_420 (228) = happyGoto action_264 action_420 (229) = happyGoto action_33 action_420 (230) = happyGoto action_34 action_420 (231) = happyGoto action_265 action_420 (232) = happyGoto action_266 action_420 (233) = happyGoto action_35 action_420 _ = happyFail action_421 _ = happyReduce_408 action_422 (244) = happyShift action_36 action_422 (245) = happyShift action_37 action_422 (246) = happyShift action_38 action_422 (251) = happyShift action_39 action_422 (253) = happyShift action_40 action_422 (254) = happyShift action_41 action_422 (261) = happyShift action_45 action_422 (265) = happyShift action_46 action_422 (269) = happyShift action_47 action_422 (270) = happyShift action_48 action_422 (272) = happyShift action_49 action_422 (273) = happyShift action_50 action_422 (274) = happyShift action_51 action_422 (275) = happyShift action_52 action_422 (276) = happyShift action_53 action_422 (277) = happyShift action_54 action_422 (278) = happyShift action_55 action_422 (279) = happyShift action_56 action_422 (280) = happyShift action_57 action_422 (281) = happyShift action_58 action_422 (282) = happyShift action_59 action_422 (283) = happyShift action_60 action_422 (284) = happyShift action_61 action_422 (286) = happyShift action_62 action_422 (294) = happyShift action_66 action_422 (295) = happyShift action_67 action_422 (296) = happyShift action_68 action_422 (311) = happyShift action_69 action_422 (317) = happyShift action_70 action_422 (320) = happyShift action_71 action_422 (332) = happyShift action_72 action_422 (334) = happyShift action_73 action_422 (336) = happyShift action_112 action_422 (338) = happyShift action_75 action_422 (340) = happyShift action_76 action_422 (345) = happyShift action_77 action_422 (346) = happyShift action_78 action_422 (347) = happyShift action_79 action_422 (350) = happyShift action_80 action_422 (351) = happyShift action_81 action_422 (354) = happyShift action_82 action_422 (355) = happyShift action_83 action_422 (356) = happyShift action_84 action_422 (357) = happyShift action_85 action_422 (358) = happyShift action_86 action_422 (359) = happyShift action_87 action_422 (360) = happyShift action_88 action_422 (361) = happyShift action_89 action_422 (362) = happyShift action_90 action_422 (363) = happyShift action_91 action_422 (364) = happyShift action_92 action_422 (365) = happyShift action_93 action_422 (366) = happyShift action_94 action_422 (371) = happyShift action_95 action_422 (372) = happyShift action_96 action_422 (373) = happyShift action_97 action_422 (374) = happyShift action_98 action_422 (376) = happyShift action_99 action_422 (377) = happyShift action_100 action_422 (378) = happyShift action_101 action_422 (379) = happyShift action_102 action_422 (380) = happyShift action_103 action_422 (38) = happyGoto action_13 action_422 (142) = happyGoto action_16 action_422 (143) = happyGoto action_740 action_422 (144) = happyGoto action_110 action_422 (145) = happyGoto action_18 action_422 (147) = happyGoto action_19 action_422 (148) = happyGoto action_20 action_422 (149) = happyGoto action_21 action_422 (150) = happyGoto action_22 action_422 (151) = happyGoto action_23 action_422 (152) = happyGoto action_24 action_422 (192) = happyGoto action_25 action_422 (195) = happyGoto action_26 action_422 (198) = happyGoto action_27 action_422 (219) = happyGoto action_29 action_422 (220) = happyGoto action_30 action_422 (221) = happyGoto action_111 action_422 (227) = happyGoto action_32 action_422 (229) = happyGoto action_33 action_422 (230) = happyGoto action_34 action_422 (233) = happyGoto action_35 action_422 _ = happyReduce_442 action_423 (244) = happyShift action_36 action_423 (245) = happyShift action_37 action_423 (246) = happyShift action_38 action_423 (251) = happyShift action_39 action_423 (253) = happyShift action_40 action_423 (254) = happyShift action_41 action_423 (261) = happyShift action_155 action_423 (265) = happyShift action_46 action_423 (266) = happyShift action_736 action_423 (269) = happyShift action_47 action_423 (270) = happyShift action_48 action_423 (272) = happyShift action_49 action_423 (273) = happyShift action_50 action_423 (274) = happyShift action_51 action_423 (275) = happyShift action_52 action_423 (276) = happyShift action_53 action_423 (277) = happyShift action_54 action_423 (278) = happyShift action_55 action_423 (279) = happyShift action_56 action_423 (280) = happyShift action_57 action_423 (281) = happyShift action_58 action_423 (282) = happyShift action_59 action_423 (283) = happyShift action_60 action_423 (284) = happyShift action_61 action_423 (286) = happyShift action_62 action_423 (294) = happyShift action_66 action_423 (295) = happyShift action_67 action_423 (296) = happyShift action_68 action_423 (311) = happyShift action_69 action_423 (317) = happyShift action_70 action_423 (320) = happyShift action_71 action_423 (321) = happyShift action_157 action_423 (332) = happyShift action_72 action_423 (334) = happyShift action_73 action_423 (336) = happyShift action_112 action_423 (338) = happyShift action_75 action_423 (340) = happyShift action_76 action_423 (345) = happyShift action_77 action_423 (346) = happyShift action_78 action_423 (347) = happyShift action_79 action_423 (350) = happyShift action_80 action_423 (351) = happyShift action_81 action_423 (354) = happyShift action_82 action_423 (355) = happyShift action_83 action_423 (356) = happyShift action_84 action_423 (357) = happyShift action_85 action_423 (358) = happyShift action_86 action_423 (359) = happyShift action_87 action_423 (360) = happyShift action_88 action_423 (361) = happyShift action_89 action_423 (362) = happyShift action_90 action_423 (363) = happyShift action_91 action_423 (364) = happyShift action_92 action_423 (365) = happyShift action_93 action_423 (366) = happyShift action_94 action_423 (371) = happyShift action_95 action_423 (372) = happyShift action_96 action_423 (373) = happyShift action_97 action_423 (374) = happyShift action_98 action_423 (376) = happyShift action_99 action_423 (377) = happyShift action_100 action_423 (378) = happyShift action_101 action_423 (379) = happyShift action_102 action_423 (380) = happyShift action_103 action_423 (38) = happyGoto action_13 action_423 (142) = happyGoto action_16 action_423 (143) = happyGoto action_151 action_423 (144) = happyGoto action_110 action_423 (145) = happyGoto action_18 action_423 (147) = happyGoto action_19 action_423 (148) = happyGoto action_20 action_423 (149) = happyGoto action_21 action_423 (150) = happyGoto action_22 action_423 (151) = happyGoto action_23 action_423 (152) = happyGoto action_24 action_423 (163) = happyGoto action_739 action_423 (164) = happyGoto action_732 action_423 (165) = happyGoto action_733 action_423 (166) = happyGoto action_734 action_423 (178) = happyGoto action_152 action_423 (186) = happyGoto action_735 action_423 (192) = happyGoto action_25 action_423 (195) = happyGoto action_26 action_423 (198) = happyGoto action_27 action_423 (219) = happyGoto action_29 action_423 (220) = happyGoto action_30 action_423 (221) = happyGoto action_111 action_423 (227) = happyGoto action_32 action_423 (229) = happyGoto action_33 action_423 (230) = happyGoto action_34 action_423 (233) = happyGoto action_35 action_423 _ = happyFail action_424 (244) = happyShift action_36 action_424 (245) = happyShift action_37 action_424 (246) = happyShift action_38 action_424 (251) = happyShift action_39 action_424 (253) = happyShift action_40 action_424 (254) = happyShift action_41 action_424 (261) = happyShift action_45 action_424 (265) = happyShift action_46 action_424 (269) = happyShift action_47 action_424 (270) = happyShift action_48 action_424 (272) = happyShift action_49 action_424 (273) = happyShift action_50 action_424 (274) = happyShift action_51 action_424 (275) = happyShift action_52 action_424 (276) = happyShift action_53 action_424 (277) = happyShift action_54 action_424 (278) = happyShift action_55 action_424 (279) = happyShift action_56 action_424 (280) = happyShift action_57 action_424 (281) = happyShift action_58 action_424 (282) = happyShift action_59 action_424 (283) = happyShift action_60 action_424 (284) = happyShift action_61 action_424 (286) = happyShift action_62 action_424 (294) = happyShift action_66 action_424 (295) = happyShift action_67 action_424 (296) = happyShift action_68 action_424 (308) = happyShift action_267 action_424 (311) = happyShift action_69 action_424 (317) = happyShift action_70 action_424 (320) = happyShift action_71 action_424 (321) = happyShift action_270 action_424 (322) = happyShift action_271 action_424 (327) = happyShift action_272 action_424 (332) = happyShift action_72 action_424 (334) = happyShift action_73 action_424 (336) = happyShift action_112 action_424 (338) = happyShift action_75 action_424 (340) = happyShift action_76 action_424 (344) = happyShift action_297 action_424 (345) = happyShift action_77 action_424 (346) = happyShift action_78 action_424 (347) = happyShift action_79 action_424 (348) = happyShift action_274 action_424 (349) = happyShift action_275 action_424 (350) = happyShift action_80 action_424 (351) = happyShift action_81 action_424 (352) = happyShift action_276 action_424 (353) = happyShift action_277 action_424 (354) = happyShift action_82 action_424 (355) = happyShift action_83 action_424 (356) = happyShift action_84 action_424 (357) = happyShift action_85 action_424 (358) = happyShift action_86 action_424 (359) = happyShift action_87 action_424 (360) = happyShift action_88 action_424 (361) = happyShift action_89 action_424 (362) = happyShift action_90 action_424 (363) = happyShift action_91 action_424 (364) = happyShift action_92 action_424 (365) = happyShift action_93 action_424 (366) = happyShift action_94 action_424 (371) = happyShift action_95 action_424 (372) = happyShift action_96 action_424 (373) = happyShift action_97 action_424 (374) = happyShift action_98 action_424 (376) = happyShift action_99 action_424 (377) = happyShift action_100 action_424 (378) = happyShift action_101 action_424 (379) = happyShift action_102 action_424 (380) = happyShift action_103 action_424 (38) = happyGoto action_13 action_424 (142) = happyGoto action_16 action_424 (143) = happyGoto action_738 action_424 (144) = happyGoto action_282 action_424 (145) = happyGoto action_18 action_424 (147) = happyGoto action_19 action_424 (148) = happyGoto action_20 action_424 (149) = happyGoto action_21 action_424 (150) = happyGoto action_22 action_424 (151) = happyGoto action_23 action_424 (152) = happyGoto action_24 action_424 (157) = happyGoto action_730 action_424 (192) = happyGoto action_25 action_424 (195) = happyGoto action_26 action_424 (198) = happyGoto action_27 action_424 (200) = happyGoto action_285 action_424 (212) = happyGoto action_286 action_424 (214) = happyGoto action_287 action_424 (219) = happyGoto action_29 action_424 (220) = happyGoto action_30 action_424 (221) = happyGoto action_111 action_424 (223) = happyGoto action_288 action_424 (224) = happyGoto action_325 action_424 (226) = happyGoto action_326 action_424 (227) = happyGoto action_32 action_424 (228) = happyGoto action_264 action_424 (229) = happyGoto action_33 action_424 (230) = happyGoto action_34 action_424 (231) = happyGoto action_265 action_424 (232) = happyGoto action_266 action_424 (233) = happyGoto action_35 action_424 _ = happyFail action_425 _ = happyReduce_409 action_426 (244) = happyShift action_36 action_426 (245) = happyShift action_37 action_426 (246) = happyShift action_38 action_426 (251) = happyShift action_39 action_426 (253) = happyShift action_40 action_426 (254) = happyShift action_41 action_426 (261) = happyShift action_45 action_426 (265) = happyShift action_46 action_426 (269) = happyShift action_47 action_426 (270) = happyShift action_48 action_426 (272) = happyShift action_49 action_426 (273) = happyShift action_50 action_426 (274) = happyShift action_51 action_426 (275) = happyShift action_52 action_426 (276) = happyShift action_53 action_426 (277) = happyShift action_54 action_426 (278) = happyShift action_55 action_426 (279) = happyShift action_56 action_426 (280) = happyShift action_57 action_426 (281) = happyShift action_58 action_426 (282) = happyShift action_59 action_426 (283) = happyShift action_60 action_426 (284) = happyShift action_61 action_426 (286) = happyShift action_62 action_426 (294) = happyShift action_66 action_426 (295) = happyShift action_67 action_426 (296) = happyShift action_68 action_426 (311) = happyShift action_69 action_426 (317) = happyShift action_70 action_426 (320) = happyShift action_71 action_426 (332) = happyShift action_72 action_426 (334) = happyShift action_73 action_426 (336) = happyShift action_112 action_426 (338) = happyShift action_75 action_426 (340) = happyShift action_76 action_426 (345) = happyShift action_77 action_426 (346) = happyShift action_78 action_426 (347) = happyShift action_79 action_426 (350) = happyShift action_80 action_426 (351) = happyShift action_81 action_426 (354) = happyShift action_82 action_426 (355) = happyShift action_83 action_426 (356) = happyShift action_84 action_426 (357) = happyShift action_85 action_426 (358) = happyShift action_86 action_426 (359) = happyShift action_87 action_426 (360) = happyShift action_88 action_426 (361) = happyShift action_89 action_426 (362) = happyShift action_90 action_426 (363) = happyShift action_91 action_426 (364) = happyShift action_92 action_426 (365) = happyShift action_93 action_426 (366) = happyShift action_94 action_426 (371) = happyShift action_95 action_426 (372) = happyShift action_96 action_426 (373) = happyShift action_97 action_426 (374) = happyShift action_98 action_426 (376) = happyShift action_99 action_426 (377) = happyShift action_100 action_426 (378) = happyShift action_101 action_426 (379) = happyShift action_102 action_426 (380) = happyShift action_103 action_426 (38) = happyGoto action_13 action_426 (142) = happyGoto action_16 action_426 (143) = happyGoto action_737 action_426 (144) = happyGoto action_110 action_426 (145) = happyGoto action_18 action_426 (147) = happyGoto action_19 action_426 (148) = happyGoto action_20 action_426 (149) = happyGoto action_21 action_426 (150) = happyGoto action_22 action_426 (151) = happyGoto action_23 action_426 (152) = happyGoto action_24 action_426 (192) = happyGoto action_25 action_426 (195) = happyGoto action_26 action_426 (198) = happyGoto action_27 action_426 (219) = happyGoto action_29 action_426 (220) = happyGoto action_30 action_426 (221) = happyGoto action_111 action_426 (227) = happyGoto action_32 action_426 (229) = happyGoto action_33 action_426 (230) = happyGoto action_34 action_426 (233) = happyGoto action_35 action_426 _ = happyFail action_427 (244) = happyShift action_36 action_427 (245) = happyShift action_37 action_427 (246) = happyShift action_38 action_427 (251) = happyShift action_39 action_427 (253) = happyShift action_40 action_427 (254) = happyShift action_41 action_427 (261) = happyShift action_155 action_427 (265) = happyShift action_46 action_427 (266) = happyShift action_736 action_427 (269) = happyShift action_47 action_427 (270) = happyShift action_48 action_427 (272) = happyShift action_49 action_427 (273) = happyShift action_50 action_427 (274) = happyShift action_51 action_427 (275) = happyShift action_52 action_427 (276) = happyShift action_53 action_427 (277) = happyShift action_54 action_427 (278) = happyShift action_55 action_427 (279) = happyShift action_56 action_427 (280) = happyShift action_57 action_427 (281) = happyShift action_58 action_427 (282) = happyShift action_59 action_427 (283) = happyShift action_60 action_427 (284) = happyShift action_61 action_427 (286) = happyShift action_62 action_427 (294) = happyShift action_66 action_427 (295) = happyShift action_67 action_427 (296) = happyShift action_68 action_427 (311) = happyShift action_69 action_427 (317) = happyShift action_70 action_427 (320) = happyShift action_71 action_427 (321) = happyShift action_157 action_427 (332) = happyShift action_72 action_427 (334) = happyShift action_73 action_427 (336) = happyShift action_112 action_427 (338) = happyShift action_75 action_427 (340) = happyShift action_76 action_427 (345) = happyShift action_77 action_427 (346) = happyShift action_78 action_427 (347) = happyShift action_79 action_427 (350) = happyShift action_80 action_427 (351) = happyShift action_81 action_427 (354) = happyShift action_82 action_427 (355) = happyShift action_83 action_427 (356) = happyShift action_84 action_427 (357) = happyShift action_85 action_427 (358) = happyShift action_86 action_427 (359) = happyShift action_87 action_427 (360) = happyShift action_88 action_427 (361) = happyShift action_89 action_427 (362) = happyShift action_90 action_427 (363) = happyShift action_91 action_427 (364) = happyShift action_92 action_427 (365) = happyShift action_93 action_427 (366) = happyShift action_94 action_427 (371) = happyShift action_95 action_427 (372) = happyShift action_96 action_427 (373) = happyShift action_97 action_427 (374) = happyShift action_98 action_427 (376) = happyShift action_99 action_427 (377) = happyShift action_100 action_427 (378) = happyShift action_101 action_427 (379) = happyShift action_102 action_427 (380) = happyShift action_103 action_427 (38) = happyGoto action_13 action_427 (142) = happyGoto action_16 action_427 (143) = happyGoto action_151 action_427 (144) = happyGoto action_110 action_427 (145) = happyGoto action_18 action_427 (147) = happyGoto action_19 action_427 (148) = happyGoto action_20 action_427 (149) = happyGoto action_21 action_427 (150) = happyGoto action_22 action_427 (151) = happyGoto action_23 action_427 (152) = happyGoto action_24 action_427 (163) = happyGoto action_731 action_427 (164) = happyGoto action_732 action_427 (165) = happyGoto action_733 action_427 (166) = happyGoto action_734 action_427 (178) = happyGoto action_152 action_427 (186) = happyGoto action_735 action_427 (192) = happyGoto action_25 action_427 (195) = happyGoto action_26 action_427 (198) = happyGoto action_27 action_427 (219) = happyGoto action_29 action_427 (220) = happyGoto action_30 action_427 (221) = happyGoto action_111 action_427 (227) = happyGoto action_32 action_427 (229) = happyGoto action_33 action_427 (230) = happyGoto action_34 action_427 (233) = happyGoto action_35 action_427 _ = happyFail action_428 (244) = happyShift action_36 action_428 (245) = happyShift action_37 action_428 (246) = happyShift action_38 action_428 (251) = happyShift action_39 action_428 (253) = happyShift action_40 action_428 (254) = happyShift action_41 action_428 (261) = happyShift action_45 action_428 (265) = happyShift action_46 action_428 (269) = happyShift action_47 action_428 (270) = happyShift action_48 action_428 (272) = happyShift action_49 action_428 (273) = happyShift action_50 action_428 (274) = happyShift action_51 action_428 (275) = happyShift action_52 action_428 (276) = happyShift action_53 action_428 (277) = happyShift action_54 action_428 (278) = happyShift action_55 action_428 (279) = happyShift action_56 action_428 (280) = happyShift action_57 action_428 (281) = happyShift action_58 action_428 (282) = happyShift action_59 action_428 (283) = happyShift action_60 action_428 (284) = happyShift action_61 action_428 (286) = happyShift action_62 action_428 (294) = happyShift action_66 action_428 (295) = happyShift action_67 action_428 (296) = happyShift action_68 action_428 (308) = happyShift action_267 action_428 (311) = happyShift action_69 action_428 (317) = happyShift action_70 action_428 (320) = happyShift action_71 action_428 (321) = happyShift action_270 action_428 (322) = happyShift action_271 action_428 (327) = happyShift action_272 action_428 (332) = happyShift action_72 action_428 (334) = happyShift action_73 action_428 (336) = happyShift action_112 action_428 (338) = happyShift action_75 action_428 (340) = happyShift action_76 action_428 (344) = happyShift action_297 action_428 (345) = happyShift action_77 action_428 (346) = happyShift action_78 action_428 (347) = happyShift action_79 action_428 (348) = happyShift action_274 action_428 (349) = happyShift action_275 action_428 (350) = happyShift action_80 action_428 (351) = happyShift action_81 action_428 (352) = happyShift action_276 action_428 (353) = happyShift action_277 action_428 (354) = happyShift action_82 action_428 (355) = happyShift action_83 action_428 (356) = happyShift action_84 action_428 (357) = happyShift action_85 action_428 (358) = happyShift action_86 action_428 (359) = happyShift action_87 action_428 (360) = happyShift action_88 action_428 (361) = happyShift action_89 action_428 (362) = happyShift action_90 action_428 (363) = happyShift action_91 action_428 (364) = happyShift action_92 action_428 (365) = happyShift action_93 action_428 (366) = happyShift action_94 action_428 (371) = happyShift action_95 action_428 (372) = happyShift action_96 action_428 (373) = happyShift action_97 action_428 (374) = happyShift action_98 action_428 (376) = happyShift action_99 action_428 (377) = happyShift action_100 action_428 (378) = happyShift action_101 action_428 (379) = happyShift action_102 action_428 (380) = happyShift action_103 action_428 (38) = happyGoto action_13 action_428 (142) = happyGoto action_16 action_428 (143) = happyGoto action_729 action_428 (144) = happyGoto action_282 action_428 (145) = happyGoto action_18 action_428 (147) = happyGoto action_19 action_428 (148) = happyGoto action_20 action_428 (149) = happyGoto action_21 action_428 (150) = happyGoto action_22 action_428 (151) = happyGoto action_23 action_428 (152) = happyGoto action_24 action_428 (157) = happyGoto action_730 action_428 (192) = happyGoto action_25 action_428 (195) = happyGoto action_26 action_428 (198) = happyGoto action_27 action_428 (200) = happyGoto action_285 action_428 (212) = happyGoto action_286 action_428 (214) = happyGoto action_287 action_428 (219) = happyGoto action_29 action_428 (220) = happyGoto action_30 action_428 (221) = happyGoto action_111 action_428 (223) = happyGoto action_288 action_428 (224) = happyGoto action_325 action_428 (226) = happyGoto action_326 action_428 (227) = happyGoto action_32 action_428 (228) = happyGoto action_264 action_428 (229) = happyGoto action_33 action_428 (230) = happyGoto action_34 action_428 (231) = happyGoto action_265 action_428 (232) = happyGoto action_266 action_428 (233) = happyGoto action_35 action_428 _ = happyFail action_429 (343) = happyReduce_582 action_429 _ = happyReduce_584 action_430 (343) = happyShift action_296 action_430 (159) = happyGoto action_728 action_430 (236) = happyGoto action_436 action_430 _ = happyReduce_438 action_431 _ = happyReduce_435 action_432 _ = happyReduce_530 action_433 _ = happyReduce_639 action_434 _ = happyReduce_407 action_435 _ = happyReduce_434 action_436 (244) = happyShift action_36 action_436 (245) = happyShift action_37 action_436 (246) = happyShift action_38 action_436 (251) = happyShift action_39 action_436 (253) = happyShift action_40 action_436 (254) = happyShift action_41 action_436 (261) = happyShift action_45 action_436 (265) = happyShift action_46 action_436 (269) = happyShift action_47 action_436 (270) = happyShift action_48 action_436 (272) = happyShift action_49 action_436 (273) = happyShift action_50 action_436 (274) = happyShift action_51 action_436 (275) = happyShift action_52 action_436 (276) = happyShift action_53 action_436 (277) = happyShift action_54 action_436 (278) = happyShift action_55 action_436 (279) = happyShift action_56 action_436 (280) = happyShift action_57 action_436 (281) = happyShift action_58 action_436 (282) = happyShift action_59 action_436 (283) = happyShift action_60 action_436 (284) = happyShift action_61 action_436 (286) = happyShift action_62 action_436 (294) = happyShift action_66 action_436 (295) = happyShift action_67 action_436 (296) = happyShift action_68 action_436 (308) = happyShift action_267 action_436 (311) = happyShift action_69 action_436 (317) = happyShift action_70 action_436 (320) = happyShift action_71 action_436 (321) = happyShift action_270 action_436 (322) = happyShift action_271 action_436 (327) = happyShift action_272 action_436 (332) = happyShift action_72 action_436 (334) = happyShift action_73 action_436 (336) = happyShift action_112 action_436 (338) = happyShift action_75 action_436 (340) = happyShift action_76 action_436 (343) = happyShift action_433 action_436 (344) = happyShift action_297 action_436 (345) = happyShift action_77 action_436 (346) = happyShift action_78 action_436 (347) = happyShift action_79 action_436 (348) = happyShift action_274 action_436 (349) = happyShift action_275 action_436 (350) = happyShift action_80 action_436 (351) = happyShift action_81 action_436 (352) = happyShift action_276 action_436 (353) = happyShift action_277 action_436 (354) = happyShift action_82 action_436 (355) = happyShift action_83 action_436 (356) = happyShift action_84 action_436 (357) = happyShift action_85 action_436 (358) = happyShift action_86 action_436 (359) = happyShift action_87 action_436 (360) = happyShift action_88 action_436 (361) = happyShift action_89 action_436 (362) = happyShift action_90 action_436 (363) = happyShift action_91 action_436 (364) = happyShift action_92 action_436 (365) = happyShift action_93 action_436 (366) = happyShift action_94 action_436 (371) = happyShift action_95 action_436 (372) = happyShift action_96 action_436 (373) = happyShift action_97 action_436 (374) = happyShift action_98 action_436 (376) = happyShift action_99 action_436 (377) = happyShift action_100 action_436 (378) = happyShift action_101 action_436 (379) = happyShift action_102 action_436 (380) = happyShift action_103 action_436 (38) = happyGoto action_13 action_436 (142) = happyGoto action_16 action_436 (143) = happyGoto action_281 action_436 (144) = happyGoto action_282 action_436 (145) = happyGoto action_18 action_436 (147) = happyGoto action_19 action_436 (148) = happyGoto action_20 action_436 (149) = happyGoto action_21 action_436 (150) = happyGoto action_22 action_436 (151) = happyGoto action_23 action_436 (152) = happyGoto action_24 action_436 (157) = happyGoto action_430 action_436 (160) = happyGoto action_727 action_436 (192) = happyGoto action_25 action_436 (195) = happyGoto action_26 action_436 (198) = happyGoto action_27 action_436 (200) = happyGoto action_285 action_436 (212) = happyGoto action_286 action_436 (214) = happyGoto action_287 action_436 (219) = happyGoto action_29 action_436 (220) = happyGoto action_30 action_436 (221) = happyGoto action_111 action_436 (223) = happyGoto action_288 action_436 (224) = happyGoto action_325 action_436 (226) = happyGoto action_326 action_436 (227) = happyGoto action_32 action_436 (228) = happyGoto action_264 action_436 (229) = happyGoto action_33 action_436 (230) = happyGoto action_34 action_436 (231) = happyGoto action_265 action_436 (232) = happyGoto action_266 action_436 (233) = happyGoto action_35 action_436 _ = happyReduce_439 action_437 _ = happyReduce_406 action_438 (244) = happyShift action_36 action_438 (245) = happyShift action_37 action_438 (253) = happyShift action_40 action_438 (265) = happyShift action_46 action_438 (270) = happyShift action_48 action_438 (272) = happyShift action_49 action_438 (273) = happyShift action_50 action_438 (274) = happyShift action_51 action_438 (275) = happyShift action_52 action_438 (276) = happyShift action_53 action_438 (277) = happyShift action_54 action_438 (279) = happyShift action_56 action_438 (280) = happyShift action_57 action_438 (281) = happyShift action_58 action_438 (282) = happyShift action_59 action_438 (283) = happyShift action_60 action_438 (286) = happyShift action_62 action_438 (332) = happyShift action_72 action_438 (334) = happyShift action_73 action_438 (336) = happyShift action_112 action_438 (338) = happyShift action_75 action_438 (340) = happyShift action_76 action_438 (341) = happyShift action_726 action_438 (345) = happyShift action_77 action_438 (346) = happyShift action_78 action_438 (347) = happyShift action_79 action_438 (350) = happyShift action_80 action_438 (351) = happyShift action_81 action_438 (354) = happyShift action_82 action_438 (355) = happyShift action_83 action_438 (356) = happyShift action_84 action_438 (357) = happyShift action_85 action_438 (358) = happyShift action_86 action_438 (359) = happyShift action_87 action_438 (360) = happyShift action_88 action_438 (361) = happyShift action_89 action_438 (362) = happyShift action_90 action_438 (363) = happyShift action_91 action_438 (364) = happyShift action_92 action_438 (365) = happyShift action_93 action_438 (366) = happyShift action_94 action_438 (371) = happyShift action_95 action_438 (372) = happyShift action_96 action_438 (373) = happyShift action_97 action_438 (374) = happyShift action_98 action_438 (376) = happyShift action_99 action_438 (377) = happyShift action_100 action_438 (378) = happyShift action_101 action_438 (379) = happyShift action_102 action_438 (380) = happyShift action_103 action_438 (38) = happyGoto action_13 action_438 (142) = happyGoto action_16 action_438 (152) = happyGoto action_724 action_438 (154) = happyGoto action_725 action_438 (192) = happyGoto action_25 action_438 (195) = happyGoto action_26 action_438 (198) = happyGoto action_27 action_438 (219) = happyGoto action_322 action_438 (220) = happyGoto action_30 action_438 (221) = happyGoto action_111 action_438 (227) = happyGoto action_32 action_438 (229) = happyGoto action_33 action_438 (230) = happyGoto action_34 action_438 (233) = happyGoto action_35 action_438 _ = happyFail action_439 (337) = happyShift action_481 action_439 _ = happyFail action_440 (337) = happyShift action_479 action_440 _ = happyFail action_441 (337) = happyShift action_478 action_441 (343) = happyShift action_433 action_441 _ = happyFail action_442 _ = happyReduce_417 action_443 _ = happyReduce_419 action_444 _ = happyReduce_418 action_445 _ = happyReduce_429 action_446 (342) = happyShift action_723 action_446 _ = happyReduce_34 action_447 _ = happyReduce_93 action_448 (1) = happyShift action_601 action_448 (331) = happyShift action_602 action_448 (234) = happyGoto action_722 action_448 _ = happyFail action_449 (329) = happyShift action_721 action_449 _ = happyFail action_450 _ = happyReduce_420 action_451 _ = happyReduce_412 action_452 (339) = happyShift action_720 action_452 (343) = happyShift action_433 action_452 _ = happyFail action_453 _ = happyReduce_538 action_454 (337) = happyShift action_719 action_454 _ = happyFail action_455 _ = happyReduce_557 action_456 (337) = happyShift action_718 action_456 (343) = happyShift action_433 action_456 _ = happyFail action_457 (337) = happyShift action_717 action_457 _ = happyFail action_458 (337) = happyShift action_716 action_458 _ = happyFail action_459 (337) = happyShift action_715 action_459 _ = happyFail action_460 _ = happyReduce_560 action_461 _ = happyReduce_537 action_462 _ = happyReduce_559 action_463 _ = happyReduce_558 action_464 _ = happyReduce_556 action_465 _ = happyReduce_555 action_466 _ = happyReduce_544 action_467 _ = happyReduce_543 action_468 (297) = happyShift action_713 action_468 (298) = happyShift action_714 action_468 (21) = happyGoto action_712 action_468 _ = happyReduce_26 action_469 _ = happyReduce_637 action_470 _ = happyReduce_638 action_471 _ = happyReduce_368 action_472 _ = happyReduce_367 action_473 _ = happyReduce_366 action_474 _ = happyReduce_365 action_475 _ = happyReduce_364 action_476 (344) = happyShift action_711 action_476 _ = happyFail action_477 (344) = happyShift action_710 action_477 _ = happyFail action_478 _ = happyReduce_528 action_479 _ = happyReduce_520 action_480 _ = happyReduce_584 action_481 _ = happyReduce_585 action_482 (308) = happyShift action_267 action_482 (320) = happyShift action_269 action_482 (321) = happyShift action_270 action_482 (322) = happyShift action_271 action_482 (327) = happyShift action_272 action_482 (344) = happyShift action_273 action_482 (348) = happyShift action_274 action_482 (349) = happyShift action_275 action_482 (352) = happyShift action_276 action_482 (353) = happyShift action_277 action_482 (200) = happyGoto action_257 action_482 (211) = happyGoto action_258 action_482 (213) = happyGoto action_259 action_482 (222) = happyGoto action_260 action_482 (224) = happyGoto action_261 action_482 (225) = happyGoto action_262 action_482 (226) = happyGoto action_263 action_482 (228) = happyGoto action_264 action_482 (231) = happyGoto action_265 action_482 (232) = happyGoto action_266 action_482 _ = happyReduce_432 action_483 _ = happyReduce_405 action_484 _ = happyReduce_404 action_485 (244) = happyShift action_36 action_485 (245) = happyShift action_37 action_485 (246) = happyShift action_38 action_485 (251) = happyShift action_39 action_485 (253) = happyShift action_40 action_485 (254) = happyShift action_41 action_485 (261) = happyShift action_45 action_485 (265) = happyShift action_46 action_485 (269) = happyShift action_47 action_485 (270) = happyShift action_48 action_485 (272) = happyShift action_49 action_485 (273) = happyShift action_50 action_485 (274) = happyShift action_51 action_485 (275) = happyShift action_52 action_485 (276) = happyShift action_53 action_485 (277) = happyShift action_54 action_485 (278) = happyShift action_55 action_485 (279) = happyShift action_56 action_485 (280) = happyShift action_57 action_485 (281) = happyShift action_58 action_485 (282) = happyShift action_59 action_485 (283) = happyShift action_60 action_485 (284) = happyShift action_61 action_485 (286) = happyShift action_62 action_485 (294) = happyShift action_66 action_485 (295) = happyShift action_67 action_485 (296) = happyShift action_68 action_485 (311) = happyShift action_69 action_485 (317) = happyShift action_70 action_485 (320) = happyShift action_71 action_485 (332) = happyShift action_72 action_485 (334) = happyShift action_73 action_485 (336) = happyShift action_112 action_485 (338) = happyShift action_75 action_485 (340) = happyShift action_76 action_485 (345) = happyShift action_77 action_485 (346) = happyShift action_78 action_485 (347) = happyShift action_79 action_485 (350) = happyShift action_80 action_485 (351) = happyShift action_81 action_485 (354) = happyShift action_82 action_485 (355) = happyShift action_83 action_485 (356) = happyShift action_84 action_485 (357) = happyShift action_85 action_485 (358) = happyShift action_86 action_485 (359) = happyShift action_87 action_485 (360) = happyShift action_88 action_485 (361) = happyShift action_89 action_485 (362) = happyShift action_90 action_485 (363) = happyShift action_91 action_485 (364) = happyShift action_92 action_485 (365) = happyShift action_93 action_485 (366) = happyShift action_94 action_485 (371) = happyShift action_95 action_485 (372) = happyShift action_96 action_485 (373) = happyShift action_97 action_485 (374) = happyShift action_98 action_485 (376) = happyShift action_99 action_485 (377) = happyShift action_100 action_485 (378) = happyShift action_101 action_485 (379) = happyShift action_102 action_485 (380) = happyShift action_103 action_485 (38) = happyGoto action_13 action_485 (142) = happyGoto action_16 action_485 (145) = happyGoto action_496 action_485 (147) = happyGoto action_19 action_485 (148) = happyGoto action_20 action_485 (149) = happyGoto action_21 action_485 (150) = happyGoto action_22 action_485 (151) = happyGoto action_23 action_485 (152) = happyGoto action_24 action_485 (192) = happyGoto action_25 action_485 (195) = happyGoto action_26 action_485 (198) = happyGoto action_27 action_485 (219) = happyGoto action_29 action_485 (220) = happyGoto action_30 action_485 (221) = happyGoto action_111 action_485 (227) = happyGoto action_32 action_485 (229) = happyGoto action_33 action_485 (230) = happyGoto action_34 action_485 (233) = happyGoto action_35 action_485 _ = happyReduce_431 action_486 (244) = happyShift action_36 action_486 (245) = happyShift action_37 action_486 (246) = happyShift action_38 action_486 (251) = happyShift action_39 action_486 (253) = happyShift action_40 action_486 (254) = happyShift action_41 action_486 (261) = happyShift action_45 action_486 (265) = happyShift action_46 action_486 (269) = happyShift action_47 action_486 (270) = happyShift action_48 action_486 (272) = happyShift action_49 action_486 (273) = happyShift action_50 action_486 (274) = happyShift action_51 action_486 (275) = happyShift action_52 action_486 (276) = happyShift action_53 action_486 (277) = happyShift action_54 action_486 (278) = happyShift action_55 action_486 (279) = happyShift action_56 action_486 (280) = happyShift action_57 action_486 (281) = happyShift action_58 action_486 (282) = happyShift action_59 action_486 (283) = happyShift action_60 action_486 (284) = happyShift action_61 action_486 (286) = happyShift action_62 action_486 (294) = happyShift action_66 action_486 (295) = happyShift action_67 action_486 (296) = happyShift action_68 action_486 (308) = happyShift action_267 action_486 (311) = happyShift action_69 action_486 (317) = happyShift action_70 action_486 (320) = happyShift action_71 action_486 (321) = happyShift action_270 action_486 (322) = happyShift action_271 action_486 (327) = happyShift action_272 action_486 (332) = happyShift action_72 action_486 (334) = happyShift action_73 action_486 (336) = happyShift action_112 action_486 (338) = happyShift action_75 action_486 (340) = happyShift action_76 action_486 (344) = happyShift action_297 action_486 (345) = happyShift action_77 action_486 (346) = happyShift action_78 action_486 (347) = happyShift action_79 action_486 (348) = happyShift action_274 action_486 (349) = happyShift action_275 action_486 (350) = happyShift action_80 action_486 (351) = happyShift action_81 action_486 (352) = happyShift action_276 action_486 (353) = happyShift action_277 action_486 (354) = happyShift action_82 action_486 (355) = happyShift action_83 action_486 (356) = happyShift action_84 action_486 (357) = happyShift action_85 action_486 (358) = happyShift action_86 action_486 (359) = happyShift action_87 action_486 (360) = happyShift action_88 action_486 (361) = happyShift action_89 action_486 (362) = happyShift action_90 action_486 (363) = happyShift action_91 action_486 (364) = happyShift action_92 action_486 (365) = happyShift action_93 action_486 (366) = happyShift action_94 action_486 (371) = happyShift action_95 action_486 (372) = happyShift action_96 action_486 (373) = happyShift action_97 action_486 (374) = happyShift action_98 action_486 (376) = happyShift action_99 action_486 (377) = happyShift action_100 action_486 (378) = happyShift action_101 action_486 (379) = happyShift action_102 action_486 (380) = happyShift action_103 action_486 (38) = happyGoto action_13 action_486 (142) = happyGoto action_16 action_486 (143) = happyGoto action_281 action_486 (144) = happyGoto action_282 action_486 (145) = happyGoto action_18 action_486 (147) = happyGoto action_19 action_486 (148) = happyGoto action_20 action_486 (149) = happyGoto action_21 action_486 (150) = happyGoto action_22 action_486 (151) = happyGoto action_23 action_486 (152) = happyGoto action_24 action_486 (157) = happyGoto action_709 action_486 (192) = happyGoto action_25 action_486 (195) = happyGoto action_26 action_486 (198) = happyGoto action_27 action_486 (200) = happyGoto action_285 action_486 (212) = happyGoto action_286 action_486 (214) = happyGoto action_287 action_486 (219) = happyGoto action_29 action_486 (220) = happyGoto action_30 action_486 (221) = happyGoto action_111 action_486 (223) = happyGoto action_288 action_486 (224) = happyGoto action_325 action_486 (226) = happyGoto action_326 action_486 (227) = happyGoto action_32 action_486 (228) = happyGoto action_264 action_486 (229) = happyGoto action_33 action_486 (230) = happyGoto action_34 action_486 (231) = happyGoto action_265 action_486 (232) = happyGoto action_266 action_486 (233) = happyGoto action_35 action_486 _ = happyFail action_487 (306) = happyShift action_707 action_487 (358) = happyShift action_708 action_487 _ = happyFail action_488 (309) = happyShift action_644 action_488 (310) = happyReduce_649 action_488 (367) = happyShift action_145 action_488 (59) = happyGoto action_705 action_488 (126) = happyGoto action_706 action_488 (237) = happyGoto action_540 action_488 (243) = happyGoto action_704 action_488 _ = happyReduce_132 action_489 (309) = happyShift action_644 action_489 (310) = happyReduce_649 action_489 (367) = happyShift action_145 action_489 (59) = happyGoto action_702 action_489 (126) = happyGoto action_703 action_489 (237) = happyGoto action_540 action_489 (243) = happyGoto action_704 action_489 _ = happyReduce_132 action_490 (344) = happyShift action_701 action_490 _ = happyFail action_491 _ = happyReduce_217 action_492 (319) = happyShift action_700 action_492 _ = happyFail action_493 (245) = happyShift action_37 action_493 (253) = happyShift action_40 action_493 (265) = happyShift action_46 action_493 (272) = happyShift action_49 action_493 (273) = happyShift action_50 action_493 (274) = happyShift action_51 action_493 (275) = happyShift action_221 action_493 (276) = happyShift action_222 action_493 (277) = happyShift action_223 action_493 (280) = happyShift action_57 action_493 (281) = happyShift action_58 action_493 (282) = happyShift action_59 action_493 (283) = happyShift action_60 action_493 (286) = happyShift action_62 action_493 (299) = happyShift action_225 action_493 (300) = happyShift action_226 action_493 (310) = happyReduce_241 action_493 (313) = happyReduce_241 action_493 (315) = happyShift action_697 action_493 (317) = happyShift action_698 action_493 (319) = happyReduce_240 action_493 (321) = happyShift action_227 action_493 (322) = happyShift action_460 action_493 (327) = happyShift action_523 action_493 (328) = happyShift action_228 action_493 (332) = happyShift action_229 action_493 (334) = happyShift action_230 action_493 (336) = happyShift action_231 action_493 (338) = happyShift action_232 action_493 (344) = happyShift action_524 action_493 (345) = happyShift action_699 action_493 (346) = happyShift action_234 action_493 (347) = happyShift action_235 action_493 (348) = happyShift action_462 action_493 (349) = happyShift action_463 action_493 (351) = happyShift action_236 action_493 (352) = happyShift action_464 action_493 (353) = happyShift action_465 action_493 (355) = happyShift action_237 action_493 (358) = happyShift action_238 action_493 (359) = happyShift action_239 action_493 (368) = happyShift action_146 action_493 (376) = happyShift action_240 action_493 (377) = happyShift action_241 action_493 (379) = happyShift action_102 action_493 (380) = happyShift action_103 action_493 (100) = happyGoto action_208 action_493 (107) = happyGoto action_517 action_493 (142) = happyGoto action_212 action_493 (202) = happyGoto action_213 action_493 (203) = happyGoto action_214 action_493 (204) = happyGoto action_694 action_493 (205) = happyGoto action_215 action_493 (206) = happyGoto action_216 action_493 (207) = happyGoto action_519 action_493 (208) = happyGoto action_455 action_493 (215) = happyGoto action_217 action_493 (216) = happyGoto action_695 action_493 (217) = happyGoto action_218 action_493 (227) = happyGoto action_219 action_493 (238) = happyGoto action_696 action_493 _ = happyReduce_248 action_494 (309) = happyShift action_693 action_494 _ = happyFail action_495 (245) = happyShift action_37 action_495 (253) = happyShift action_40 action_495 (265) = happyShift action_46 action_495 (272) = happyShift action_49 action_495 (273) = happyShift action_50 action_495 (274) = happyShift action_51 action_495 (275) = happyShift action_221 action_495 (276) = happyShift action_222 action_495 (277) = happyShift action_223 action_495 (280) = happyShift action_57 action_495 (281) = happyShift action_58 action_495 (282) = happyShift action_59 action_495 (283) = happyShift action_60 action_495 (286) = happyShift action_62 action_495 (336) = happyShift action_513 action_495 (346) = happyShift action_234 action_495 (112) = happyGoto action_692 action_495 (113) = happyGoto action_511 action_495 (215) = happyGoto action_512 action_495 (217) = happyGoto action_218 action_495 (227) = happyGoto action_219 action_495 _ = happyReduce_291 action_496 _ = happyReduce_371 action_497 _ = happyReduce_348 action_498 (268) = happyShift action_691 action_498 (313) = happyShift action_501 action_498 (74) = happyGoto action_689 action_498 (140) = happyGoto action_690 action_498 _ = happyReduce_171 action_499 _ = happyReduce_353 action_500 (244) = happyShift action_36 action_500 (245) = happyShift action_37 action_500 (246) = happyShift action_38 action_500 (251) = happyShift action_39 action_500 (253) = happyShift action_40 action_500 (254) = happyShift action_41 action_500 (261) = happyShift action_45 action_500 (265) = happyShift action_46 action_500 (269) = happyShift action_47 action_500 (270) = happyShift action_48 action_500 (272) = happyShift action_49 action_500 (273) = happyShift action_50 action_500 (274) = happyShift action_51 action_500 (275) = happyShift action_52 action_500 (276) = happyShift action_53 action_500 (277) = happyShift action_54 action_500 (278) = happyShift action_55 action_500 (279) = happyShift action_56 action_500 (280) = happyShift action_57 action_500 (281) = happyShift action_58 action_500 (282) = happyShift action_59 action_500 (283) = happyShift action_60 action_500 (284) = happyShift action_61 action_500 (286) = happyShift action_62 action_500 (294) = happyShift action_66 action_500 (295) = happyShift action_67 action_500 (296) = happyShift action_68 action_500 (311) = happyShift action_69 action_500 (317) = happyShift action_70 action_500 (320) = happyShift action_71 action_500 (332) = happyShift action_72 action_500 (334) = happyShift action_73 action_500 (336) = happyShift action_112 action_500 (338) = happyShift action_75 action_500 (340) = happyShift action_76 action_500 (345) = happyShift action_77 action_500 (346) = happyShift action_78 action_500 (347) = happyShift action_79 action_500 (350) = happyShift action_80 action_500 (351) = happyShift action_81 action_500 (354) = happyShift action_82 action_500 (355) = happyShift action_83 action_500 (356) = happyShift action_84 action_500 (357) = happyShift action_85 action_500 (358) = happyShift action_86 action_500 (359) = happyShift action_87 action_500 (360) = happyShift action_88 action_500 (361) = happyShift action_89 action_500 (362) = happyShift action_90 action_500 (363) = happyShift action_91 action_500 (364) = happyShift action_92 action_500 (365) = happyShift action_93 action_500 (366) = happyShift action_94 action_500 (371) = happyShift action_95 action_500 (372) = happyShift action_96 action_500 (373) = happyShift action_97 action_500 (374) = happyShift action_98 action_500 (376) = happyShift action_99 action_500 (377) = happyShift action_100 action_500 (378) = happyShift action_101 action_500 (379) = happyShift action_102 action_500 (380) = happyShift action_103 action_500 (38) = happyGoto action_13 action_500 (142) = happyGoto action_16 action_500 (143) = happyGoto action_688 action_500 (144) = happyGoto action_110 action_500 (145) = happyGoto action_18 action_500 (147) = happyGoto action_19 action_500 (148) = happyGoto action_20 action_500 (149) = happyGoto action_21 action_500 (150) = happyGoto action_22 action_500 (151) = happyGoto action_23 action_500 (152) = happyGoto action_24 action_500 (192) = happyGoto action_25 action_500 (195) = happyGoto action_26 action_500 (198) = happyGoto action_27 action_500 (219) = happyGoto action_29 action_500 (220) = happyGoto action_30 action_500 (221) = happyGoto action_111 action_500 (227) = happyGoto action_32 action_500 (229) = happyGoto action_33 action_500 (230) = happyGoto action_34 action_500 (233) = happyGoto action_35 action_500 _ = happyFail action_501 (244) = happyShift action_36 action_501 (245) = happyShift action_37 action_501 (246) = happyShift action_38 action_501 (251) = happyShift action_39 action_501 (253) = happyShift action_40 action_501 (254) = happyShift action_41 action_501 (261) = happyShift action_155 action_501 (265) = happyShift action_46 action_501 (269) = happyShift action_47 action_501 (270) = happyShift action_48 action_501 (272) = happyShift action_49 action_501 (273) = happyShift action_50 action_501 (274) = happyShift action_51 action_501 (275) = happyShift action_52 action_501 (276) = happyShift action_53 action_501 (277) = happyShift action_54 action_501 (278) = happyShift action_55 action_501 (279) = happyShift action_56 action_501 (280) = happyShift action_57 action_501 (281) = happyShift action_58 action_501 (282) = happyShift action_59 action_501 (283) = happyShift action_60 action_501 (284) = happyShift action_61 action_501 (286) = happyShift action_62 action_501 (294) = happyShift action_66 action_501 (295) = happyShift action_67 action_501 (296) = happyShift action_68 action_501 (311) = happyShift action_69 action_501 (317) = happyShift action_70 action_501 (320) = happyShift action_71 action_501 (321) = happyShift action_157 action_501 (332) = happyShift action_72 action_501 (334) = happyShift action_73 action_501 (336) = happyShift action_112 action_501 (338) = happyShift action_75 action_501 (340) = happyShift action_76 action_501 (345) = happyShift action_77 action_501 (346) = happyShift action_78 action_501 (347) = happyShift action_79 action_501 (350) = happyShift action_80 action_501 (351) = happyShift action_81 action_501 (354) = happyShift action_82 action_501 (355) = happyShift action_83 action_501 (356) = happyShift action_84 action_501 (357) = happyShift action_85 action_501 (358) = happyShift action_86 action_501 (359) = happyShift action_87 action_501 (360) = happyShift action_88 action_501 (361) = happyShift action_89 action_501 (362) = happyShift action_90 action_501 (363) = happyShift action_91 action_501 (364) = happyShift action_92 action_501 (365) = happyShift action_93 action_501 (366) = happyShift action_94 action_501 (371) = happyShift action_95 action_501 (372) = happyShift action_96 action_501 (373) = happyShift action_97 action_501 (374) = happyShift action_98 action_501 (376) = happyShift action_99 action_501 (377) = happyShift action_100 action_501 (378) = happyShift action_101 action_501 (379) = happyShift action_102 action_501 (380) = happyShift action_103 action_501 (38) = happyGoto action_13 action_501 (142) = happyGoto action_16 action_501 (143) = happyGoto action_151 action_501 (144) = happyGoto action_110 action_501 (145) = happyGoto action_18 action_501 (147) = happyGoto action_19 action_501 (148) = happyGoto action_20 action_501 (149) = happyGoto action_21 action_501 (150) = happyGoto action_22 action_501 (151) = happyGoto action_23 action_501 (152) = happyGoto action_24 action_501 (168) = happyGoto action_687 action_501 (169) = happyGoto action_397 action_501 (178) = happyGoto action_152 action_501 (186) = happyGoto action_398 action_501 (192) = happyGoto action_25 action_501 (195) = happyGoto action_26 action_501 (198) = happyGoto action_27 action_501 (219) = happyGoto action_29 action_501 (220) = happyGoto action_30 action_501 (221) = happyGoto action_111 action_501 (227) = happyGoto action_32 action_501 (229) = happyGoto action_33 action_501 (230) = happyGoto action_34 action_501 (233) = happyGoto action_35 action_501 _ = happyFail action_502 (245) = happyShift action_37 action_502 (253) = happyShift action_40 action_502 (265) = happyShift action_46 action_502 (272) = happyShift action_49 action_502 (273) = happyShift action_50 action_502 (274) = happyShift action_51 action_502 (275) = happyShift action_221 action_502 (276) = happyShift action_222 action_502 (277) = happyShift action_223 action_502 (280) = happyShift action_57 action_502 (281) = happyShift action_58 action_502 (282) = happyShift action_59 action_502 (283) = happyShift action_60 action_502 (286) = happyShift action_62 action_502 (299) = happyShift action_225 action_502 (300) = happyShift action_226 action_502 (321) = happyShift action_227 action_502 (328) = happyShift action_228 action_502 (332) = happyShift action_229 action_502 (334) = happyShift action_230 action_502 (336) = happyShift action_231 action_502 (338) = happyShift action_232 action_502 (345) = happyShift action_233 action_502 (346) = happyShift action_234 action_502 (347) = happyShift action_235 action_502 (351) = happyShift action_236 action_502 (355) = happyShift action_237 action_502 (358) = happyShift action_238 action_502 (359) = happyShift action_239 action_502 (376) = happyShift action_240 action_502 (377) = happyShift action_241 action_502 (379) = happyShift action_102 action_502 (380) = happyShift action_103 action_502 (100) = happyGoto action_208 action_502 (104) = happyGoto action_686 action_502 (106) = happyGoto action_210 action_502 (107) = happyGoto action_211 action_502 (142) = happyGoto action_212 action_502 (202) = happyGoto action_213 action_502 (203) = happyGoto action_214 action_502 (205) = happyGoto action_215 action_502 (206) = happyGoto action_216 action_502 (215) = happyGoto action_217 action_502 (217) = happyGoto action_218 action_502 (227) = happyGoto action_219 action_502 _ = happyFail action_503 (268) = happyShift action_685 action_503 (66) = happyGoto action_684 action_503 _ = happyReduce_150 action_504 (115) = happyGoto action_681 action_504 (116) = happyGoto action_682 action_504 (117) = happyGoto action_683 action_504 _ = happyReduce_299 action_505 (309) = happyShift action_644 action_505 (59) = happyGoto action_680 action_505 _ = happyReduce_132 action_506 (343) = happyShift action_679 action_506 _ = happyReduce_288 action_507 (337) = happyShift action_678 action_507 _ = happyFail action_508 _ = happyReduce_286 action_509 _ = happyReduce_139 action_510 (327) = happyShift action_677 action_510 _ = happyFail action_511 (245) = happyShift action_37 action_511 (253) = happyShift action_40 action_511 (265) = happyShift action_46 action_511 (272) = happyShift action_49 action_511 (273) = happyShift action_50 action_511 (274) = happyShift action_51 action_511 (275) = happyShift action_221 action_511 (276) = happyShift action_222 action_511 (277) = happyShift action_223 action_511 (280) = happyShift action_57 action_511 (281) = happyShift action_58 action_511 (282) = happyShift action_59 action_511 (283) = happyShift action_60 action_511 (286) = happyShift action_62 action_511 (336) = happyShift action_513 action_511 (346) = happyShift action_234 action_511 (112) = happyGoto action_676 action_511 (113) = happyGoto action_511 action_511 (215) = happyGoto action_512 action_511 (217) = happyGoto action_218 action_511 (227) = happyGoto action_219 action_511 _ = happyReduce_291 action_512 _ = happyReduce_292 action_513 (245) = happyShift action_37 action_513 (253) = happyShift action_40 action_513 (265) = happyShift action_46 action_513 (272) = happyShift action_49 action_513 (273) = happyShift action_50 action_513 (274) = happyShift action_51 action_513 (275) = happyShift action_221 action_513 (276) = happyShift action_222 action_513 (277) = happyShift action_223 action_513 (280) = happyShift action_57 action_513 (281) = happyShift action_58 action_513 (282) = happyShift action_59 action_513 (283) = happyShift action_60 action_513 (286) = happyShift action_62 action_513 (346) = happyShift action_234 action_513 (215) = happyGoto action_675 action_513 (217) = happyGoto action_218 action_513 (227) = happyGoto action_219 action_513 _ = happyFail action_514 (245) = happyShift action_37 action_514 (253) = happyShift action_40 action_514 (265) = happyShift action_46 action_514 (272) = happyShift action_49 action_514 (273) = happyShift action_50 action_514 (274) = happyShift action_51 action_514 (275) = happyShift action_221 action_514 (276) = happyShift action_222 action_514 (277) = happyShift action_223 action_514 (280) = happyShift action_57 action_514 (281) = happyShift action_58 action_514 (282) = happyShift action_59 action_514 (283) = happyShift action_60 action_514 (286) = happyShift action_62 action_514 (299) = happyShift action_225 action_514 (300) = happyShift action_226 action_514 (321) = happyShift action_227 action_514 (328) = happyShift action_228 action_514 (332) = happyShift action_229 action_514 (334) = happyShift action_230 action_514 (336) = happyShift action_231 action_514 (338) = happyShift action_232 action_514 (345) = happyShift action_233 action_514 (346) = happyShift action_234 action_514 (347) = happyShift action_235 action_514 (351) = happyShift action_236 action_514 (355) = happyShift action_237 action_514 (358) = happyShift action_238 action_514 (359) = happyShift action_239 action_514 (376) = happyShift action_240 action_514 (377) = happyShift action_241 action_514 (379) = happyShift action_102 action_514 (380) = happyShift action_103 action_514 (100) = happyGoto action_208 action_514 (104) = happyGoto action_674 action_514 (106) = happyGoto action_210 action_514 (107) = happyGoto action_211 action_514 (142) = happyGoto action_212 action_514 (202) = happyGoto action_213 action_514 (203) = happyGoto action_214 action_514 (205) = happyGoto action_215 action_514 (206) = happyGoto action_216 action_514 (215) = happyGoto action_217 action_514 (217) = happyGoto action_218 action_514 (227) = happyGoto action_219 action_514 _ = happyFail action_515 _ = happyReduce_120 action_516 (328) = happyShift action_672 action_516 (330) = happyShift action_673 action_516 (69) = happyGoto action_671 action_516 _ = happyFail action_517 _ = happyReduce_259 action_518 (245) = happyShift action_37 action_518 (253) = happyShift action_40 action_518 (265) = happyShift action_46 action_518 (272) = happyShift action_49 action_518 (273) = happyShift action_50 action_518 (274) = happyShift action_51 action_518 (275) = happyShift action_221 action_518 (276) = happyShift action_222 action_518 (277) = happyShift action_223 action_518 (280) = happyShift action_57 action_518 (281) = happyShift action_58 action_518 (282) = happyShift action_59 action_518 (283) = happyShift action_60 action_518 (286) = happyShift action_62 action_518 (299) = happyShift action_225 action_518 (300) = happyShift action_226 action_518 (321) = happyShift action_227 action_518 (328) = happyShift action_228 action_518 (332) = happyShift action_229 action_518 (334) = happyShift action_230 action_518 (336) = happyShift action_231 action_518 (338) = happyShift action_232 action_518 (345) = happyShift action_233 action_518 (346) = happyShift action_234 action_518 (347) = happyShift action_235 action_518 (351) = happyShift action_236 action_518 (355) = happyShift action_237 action_518 (358) = happyShift action_238 action_518 (359) = happyShift action_239 action_518 (376) = happyShift action_240 action_518 (377) = happyShift action_241 action_518 (379) = happyShift action_102 action_518 (380) = happyShift action_103 action_518 (100) = happyGoto action_208 action_518 (104) = happyGoto action_670 action_518 (106) = happyGoto action_210 action_518 (107) = happyGoto action_211 action_518 (142) = happyGoto action_212 action_518 (202) = happyGoto action_213 action_518 (203) = happyGoto action_214 action_518 (205) = happyGoto action_215 action_518 (206) = happyGoto action_216 action_518 (215) = happyGoto action_217 action_518 (217) = happyGoto action_218 action_518 (227) = happyGoto action_219 action_518 _ = happyFail action_519 _ = happyReduce_549 action_520 (245) = happyShift action_37 action_520 (253) = happyShift action_40 action_520 (265) = happyShift action_46 action_520 (272) = happyShift action_49 action_520 (273) = happyShift action_50 action_520 (274) = happyShift action_51 action_520 (275) = happyShift action_221 action_520 (276) = happyShift action_222 action_520 (277) = happyShift action_223 action_520 (280) = happyShift action_57 action_520 (281) = happyShift action_58 action_520 (282) = happyShift action_59 action_520 (283) = happyShift action_60 action_520 (286) = happyShift action_62 action_520 (299) = happyShift action_225 action_520 (300) = happyShift action_226 action_520 (321) = happyShift action_227 action_520 (328) = happyShift action_228 action_520 (332) = happyShift action_229 action_520 (334) = happyShift action_230 action_520 (336) = happyShift action_231 action_520 (338) = happyShift action_232 action_520 (345) = happyShift action_233 action_520 (346) = happyShift action_234 action_520 (347) = happyShift action_235 action_520 (351) = happyShift action_236 action_520 (355) = happyShift action_237 action_520 (358) = happyShift action_238 action_520 (359) = happyShift action_239 action_520 (376) = happyShift action_240 action_520 (377) = happyShift action_241 action_520 (379) = happyShift action_102 action_520 (380) = happyShift action_103 action_520 (100) = happyGoto action_208 action_520 (104) = happyGoto action_669 action_520 (106) = happyGoto action_210 action_520 (107) = happyGoto action_211 action_520 (142) = happyGoto action_212 action_520 (202) = happyGoto action_213 action_520 (203) = happyGoto action_214 action_520 (205) = happyGoto action_215 action_520 (206) = happyGoto action_216 action_520 (215) = happyGoto action_217 action_520 (217) = happyGoto action_218 action_520 (227) = happyGoto action_219 action_520 _ = happyFail action_521 (245) = happyShift action_37 action_521 (253) = happyShift action_40 action_521 (265) = happyShift action_46 action_521 (270) = happyShift action_249 action_521 (272) = happyShift action_49 action_521 (273) = happyShift action_50 action_521 (274) = happyShift action_51 action_521 (275) = happyShift action_221 action_521 (276) = happyShift action_222 action_521 (277) = happyShift action_223 action_521 (280) = happyShift action_57 action_521 (281) = happyShift action_58 action_521 (282) = happyShift action_59 action_521 (283) = happyShift action_60 action_521 (286) = happyShift action_62 action_521 (299) = happyShift action_225 action_521 (300) = happyShift action_226 action_521 (321) = happyShift action_227 action_521 (328) = happyShift action_228 action_521 (332) = happyShift action_229 action_521 (334) = happyShift action_230 action_521 (336) = happyShift action_231 action_521 (338) = happyShift action_232 action_521 (345) = happyShift action_233 action_521 (346) = happyShift action_234 action_521 (347) = happyShift action_235 action_521 (351) = happyShift action_236 action_521 (355) = happyShift action_237 action_521 (356) = happyShift action_84 action_521 (358) = happyShift action_238 action_521 (359) = happyShift action_239 action_521 (376) = happyShift action_240 action_521 (377) = happyShift action_241 action_521 (379) = happyShift action_102 action_521 (380) = happyShift action_103 action_521 (100) = happyGoto action_208 action_521 (101) = happyGoto action_668 action_521 (103) = happyGoto action_244 action_521 (104) = happyGoto action_245 action_521 (106) = happyGoto action_246 action_521 (107) = happyGoto action_211 action_521 (142) = happyGoto action_212 action_521 (192) = happyGoto action_248 action_521 (202) = happyGoto action_213 action_521 (203) = happyGoto action_214 action_521 (205) = happyGoto action_215 action_521 (206) = happyGoto action_216 action_521 (215) = happyGoto action_217 action_521 (217) = happyGoto action_218 action_521 (227) = happyGoto action_219 action_521 _ = happyFail action_522 (245) = happyShift action_37 action_522 (253) = happyShift action_40 action_522 (265) = happyShift action_46 action_522 (272) = happyShift action_49 action_522 (273) = happyShift action_50 action_522 (274) = happyShift action_51 action_522 (275) = happyShift action_221 action_522 (276) = happyShift action_222 action_522 (277) = happyShift action_223 action_522 (280) = happyShift action_57 action_522 (281) = happyShift action_58 action_522 (282) = happyShift action_59 action_522 (283) = happyShift action_60 action_522 (286) = happyShift action_62 action_522 (299) = happyShift action_225 action_522 (300) = happyShift action_226 action_522 (321) = happyShift action_227 action_522 (328) = happyShift action_228 action_522 (332) = happyShift action_229 action_522 (334) = happyShift action_230 action_522 (336) = happyShift action_231 action_522 (338) = happyShift action_232 action_522 (345) = happyShift action_233 action_522 (346) = happyShift action_234 action_522 (347) = happyShift action_235 action_522 (351) = happyShift action_236 action_522 (355) = happyShift action_237 action_522 (358) = happyShift action_238 action_522 (359) = happyShift action_239 action_522 (376) = happyShift action_240 action_522 (377) = happyShift action_241 action_522 (379) = happyShift action_102 action_522 (380) = happyShift action_103 action_522 (100) = happyGoto action_208 action_522 (106) = happyGoto action_667 action_522 (107) = happyGoto action_211 action_522 (142) = happyGoto action_212 action_522 (202) = happyGoto action_213 action_522 (203) = happyGoto action_214 action_522 (205) = happyGoto action_215 action_522 (206) = happyGoto action_216 action_522 (215) = happyGoto action_217 action_522 (217) = happyGoto action_218 action_522 (227) = happyGoto action_219 action_522 _ = happyFail action_523 _ = happyReduce_575 action_524 (245) = happyShift action_37 action_524 (253) = happyShift action_40 action_524 (265) = happyShift action_46 action_524 (272) = happyShift action_49 action_524 (273) = happyShift action_50 action_524 (274) = happyShift action_51 action_524 (275) = happyShift action_221 action_524 (276) = happyShift action_222 action_524 (277) = happyShift action_223 action_524 (280) = happyShift action_57 action_524 (281) = happyShift action_58 action_524 (282) = happyShift action_59 action_524 (283) = happyShift action_60 action_524 (286) = happyShift action_62 action_524 (346) = happyShift action_234 action_524 (347) = happyShift action_235 action_524 (351) = happyShift action_236 action_524 (355) = happyShift action_237 action_524 (205) = happyGoto action_665 action_524 (206) = happyGoto action_216 action_524 (217) = happyGoto action_666 action_524 (227) = happyGoto action_219 action_524 _ = happyFail action_525 (308) = happyShift action_267 action_525 (320) = happyShift action_269 action_525 (321) = happyShift action_270 action_525 (322) = happyShift action_271 action_525 (327) = happyShift action_272 action_525 (332) = happyShift action_529 action_525 (336) = happyShift action_530 action_525 (344) = happyShift action_664 action_525 (347) = happyShift action_79 action_525 (348) = happyShift action_274 action_525 (349) = happyShift action_275 action_525 (351) = happyShift action_81 action_525 (353) = happyShift action_277 action_525 (355) = happyShift action_83 action_525 (200) = happyGoto action_662 action_525 (210) = happyGoto action_663 action_525 (225) = happyGoto action_376 action_525 (226) = happyGoto action_263 action_525 (228) = happyGoto action_264 action_525 (229) = happyGoto action_528 action_525 (230) = happyGoto action_34 action_525 (231) = happyGoto action_265 action_525 (232) = happyGoto action_266 action_525 _ = happyFail action_526 (245) = happyShift action_37 action_526 (253) = happyShift action_40 action_526 (265) = happyShift action_46 action_526 (270) = happyShift action_249 action_526 (272) = happyShift action_49 action_526 (273) = happyShift action_50 action_526 (274) = happyShift action_51 action_526 (275) = happyShift action_221 action_526 (276) = happyShift action_222 action_526 (277) = happyShift action_223 action_526 (280) = happyShift action_57 action_526 (281) = happyShift action_58 action_526 (282) = happyShift action_59 action_526 (283) = happyShift action_60 action_526 (286) = happyShift action_62 action_526 (299) = happyShift action_225 action_526 (300) = happyShift action_226 action_526 (321) = happyShift action_227 action_526 (328) = happyShift action_228 action_526 (332) = happyShift action_229 action_526 (334) = happyShift action_230 action_526 (336) = happyShift action_231 action_526 (338) = happyShift action_232 action_526 (345) = happyShift action_233 action_526 (346) = happyShift action_234 action_526 (347) = happyShift action_235 action_526 (351) = happyShift action_236 action_526 (355) = happyShift action_237 action_526 (356) = happyShift action_84 action_526 (358) = happyShift action_238 action_526 (359) = happyShift action_239 action_526 (376) = happyShift action_240 action_526 (377) = happyShift action_241 action_526 (379) = happyShift action_102 action_526 (380) = happyShift action_103 action_526 (100) = happyGoto action_208 action_526 (101) = happyGoto action_661 action_526 (103) = happyGoto action_244 action_526 (104) = happyGoto action_245 action_526 (106) = happyGoto action_246 action_526 (107) = happyGoto action_211 action_526 (142) = happyGoto action_212 action_526 (192) = happyGoto action_248 action_526 (202) = happyGoto action_213 action_526 (203) = happyGoto action_214 action_526 (205) = happyGoto action_215 action_526 (206) = happyGoto action_216 action_526 (215) = happyGoto action_217 action_526 (217) = happyGoto action_218 action_526 (227) = happyGoto action_219 action_526 _ = happyFail action_527 (337) = happyShift action_660 action_527 _ = happyFail action_528 _ = happyReduce_276 action_529 (245) = happyShift action_37 action_529 (253) = happyShift action_40 action_529 (265) = happyShift action_46 action_529 (270) = happyShift action_249 action_529 (272) = happyShift action_49 action_529 (273) = happyShift action_50 action_529 (274) = happyShift action_51 action_529 (275) = happyShift action_221 action_529 (276) = happyShift action_222 action_529 (277) = happyShift action_223 action_529 (280) = happyShift action_57 action_529 (281) = happyShift action_58 action_529 (282) = happyShift action_59 action_529 (283) = happyShift action_60 action_529 (286) = happyShift action_62 action_529 (299) = happyShift action_225 action_529 (300) = happyShift action_226 action_529 (321) = happyShift action_227 action_529 (328) = happyShift action_228 action_529 (332) = happyShift action_229 action_529 (334) = happyShift action_230 action_529 (336) = happyShift action_231 action_529 (338) = happyShift action_232 action_529 (345) = happyShift action_233 action_529 (346) = happyShift action_234 action_529 (347) = happyShift action_235 action_529 (351) = happyShift action_236 action_529 (355) = happyShift action_237 action_529 (356) = happyShift action_84 action_529 (358) = happyShift action_238 action_529 (359) = happyShift action_239 action_529 (376) = happyShift action_240 action_529 (377) = happyShift action_241 action_529 (379) = happyShift action_102 action_529 (380) = happyShift action_103 action_529 (100) = happyGoto action_208 action_529 (101) = happyGoto action_506 action_529 (103) = happyGoto action_244 action_529 (104) = happyGoto action_245 action_529 (106) = happyGoto action_246 action_529 (107) = happyGoto action_211 action_529 (110) = happyGoto action_659 action_529 (111) = happyGoto action_508 action_529 (142) = happyGoto action_212 action_529 (192) = happyGoto action_248 action_529 (202) = happyGoto action_213 action_529 (203) = happyGoto action_214 action_529 (205) = happyGoto action_215 action_529 (206) = happyGoto action_216 action_529 (215) = happyGoto action_217 action_529 (217) = happyGoto action_218 action_529 (227) = happyGoto action_219 action_529 _ = happyReduce_287 action_530 (245) = happyShift action_37 action_530 (253) = happyShift action_40 action_530 (265) = happyShift action_46 action_530 (270) = happyShift action_249 action_530 (272) = happyShift action_49 action_530 (273) = happyShift action_50 action_530 (274) = happyShift action_51 action_530 (275) = happyShift action_221 action_530 (276) = happyShift action_222 action_530 (277) = happyShift action_223 action_530 (280) = happyShift action_57 action_530 (281) = happyShift action_58 action_530 (282) = happyShift action_59 action_530 (283) = happyShift action_60 action_530 (286) = happyShift action_62 action_530 (299) = happyShift action_225 action_530 (300) = happyShift action_226 action_530 (321) = happyShift action_227 action_530 (328) = happyShift action_228 action_530 (332) = happyShift action_229 action_530 (334) = happyShift action_230 action_530 (336) = happyShift action_231 action_530 (337) = happyShift action_658 action_530 (338) = happyShift action_232 action_530 (345) = happyShift action_233 action_530 (346) = happyShift action_234 action_530 (347) = happyShift action_235 action_530 (351) = happyShift action_236 action_530 (355) = happyShift action_237 action_530 (356) = happyShift action_84 action_530 (358) = happyShift action_238 action_530 (359) = happyShift action_239 action_530 (376) = happyShift action_240 action_530 (377) = happyShift action_241 action_530 (379) = happyShift action_102 action_530 (380) = happyShift action_103 action_530 (100) = happyGoto action_208 action_530 (101) = happyGoto action_657 action_530 (103) = happyGoto action_244 action_530 (104) = happyGoto action_245 action_530 (106) = happyGoto action_246 action_530 (107) = happyGoto action_211 action_530 (142) = happyGoto action_212 action_530 (192) = happyGoto action_248 action_530 (202) = happyGoto action_213 action_530 (203) = happyGoto action_214 action_530 (205) = happyGoto action_215 action_530 (206) = happyGoto action_216 action_530 (215) = happyGoto action_217 action_530 (217) = happyGoto action_218 action_530 (227) = happyGoto action_219 action_530 _ = happyFail action_531 (339) = happyShift action_656 action_531 _ = happyFail action_532 _ = happyReduce_267 action_533 (309) = happyShift action_653 action_533 (337) = happyShift action_654 action_533 (343) = happyShift action_655 action_533 _ = happyFail action_534 _ = happyReduce_265 action_535 (335) = happyShift action_652 action_535 _ = happyFail action_536 (333) = happyShift action_650 action_536 (343) = happyShift action_651 action_536 _ = happyFail action_537 (329) = happyShift action_649 action_537 _ = happyFail action_538 _ = happyReduce_333 action_539 (343) = happyReduce_649 action_539 (367) = happyShift action_145 action_539 (237) = happyGoto action_540 action_539 (243) = happyGoto action_648 action_539 _ = happyReduce_335 action_540 _ = happyReduce_648 action_541 (245) = happyShift action_37 action_541 (253) = happyShift action_40 action_541 (265) = happyShift action_46 action_541 (270) = happyShift action_48 action_541 (272) = happyShift action_49 action_541 (273) = happyShift action_50 action_541 (274) = happyShift action_51 action_541 (275) = happyShift action_52 action_541 (276) = happyShift action_53 action_541 (277) = happyShift action_54 action_541 (279) = happyShift action_56 action_541 (280) = happyShift action_57 action_541 (281) = happyShift action_58 action_541 (282) = happyShift action_59 action_541 (283) = happyShift action_60 action_541 (286) = happyShift action_62 action_541 (336) = happyShift action_393 action_541 (346) = happyShift action_78 action_541 (97) = happyGoto action_647 action_541 (218) = happyGoto action_392 action_541 (221) = happyGoto action_188 action_541 (227) = happyGoto action_32 action_541 _ = happyFail action_542 (321) = happyShift action_646 action_542 _ = happyFail action_543 (321) = happyShift action_645 action_543 _ = happyFail action_544 (309) = happyShift action_644 action_544 (59) = happyGoto action_643 action_544 _ = happyReduce_132 action_545 (310) = happyShift action_642 action_545 _ = happyFail action_546 (245) = happyShift action_37 action_546 (253) = happyShift action_40 action_546 (265) = happyShift action_46 action_546 (272) = happyShift action_49 action_546 (273) = happyShift action_50 action_546 (274) = happyShift action_51 action_546 (275) = happyShift action_221 action_546 (276) = happyShift action_222 action_546 (277) = happyShift action_223 action_546 (280) = happyShift action_57 action_546 (281) = happyShift action_58 action_546 (282) = happyShift action_59 action_546 (283) = happyShift action_60 action_546 (286) = happyShift action_62 action_546 (299) = happyShift action_225 action_546 (300) = happyShift action_226 action_546 (321) = happyShift action_227 action_546 (328) = happyShift action_228 action_546 (332) = happyShift action_229 action_546 (334) = happyShift action_230 action_546 (336) = happyShift action_231 action_546 (338) = happyShift action_232 action_546 (345) = happyShift action_233 action_546 (346) = happyShift action_234 action_546 (347) = happyShift action_235 action_546 (351) = happyShift action_236 action_546 (355) = happyShift action_237 action_546 (358) = happyShift action_238 action_546 (359) = happyShift action_239 action_546 (376) = happyShift action_240 action_546 (377) = happyShift action_241 action_546 (379) = happyShift action_102 action_546 (380) = happyShift action_103 action_546 (100) = happyGoto action_208 action_546 (106) = happyGoto action_641 action_546 (107) = happyGoto action_211 action_546 (142) = happyGoto action_212 action_546 (202) = happyGoto action_213 action_546 (203) = happyGoto action_214 action_546 (205) = happyGoto action_215 action_546 (206) = happyGoto action_216 action_546 (215) = happyGoto action_217 action_546 (217) = happyGoto action_218 action_546 (227) = happyGoto action_219 action_546 _ = happyFail action_547 (245) = happyShift action_37 action_547 (253) = happyShift action_40 action_547 (265) = happyShift action_46 action_547 (270) = happyShift action_385 action_547 (272) = happyShift action_49 action_547 (273) = happyShift action_50 action_547 (274) = happyShift action_51 action_547 (275) = happyShift action_221 action_547 (276) = happyShift action_222 action_547 (277) = happyShift action_223 action_547 (280) = happyShift action_57 action_547 (281) = happyShift action_58 action_547 (282) = happyShift action_59 action_547 (283) = happyShift action_60 action_547 (286) = happyShift action_62 action_547 (299) = happyShift action_225 action_547 (300) = happyShift action_226 action_547 (321) = happyShift action_227 action_547 (328) = happyShift action_228 action_547 (332) = happyShift action_229 action_547 (334) = happyShift action_230 action_547 (336) = happyShift action_231 action_547 (338) = happyShift action_232 action_547 (345) = happyShift action_233 action_547 (346) = happyShift action_234 action_547 (347) = happyShift action_235 action_547 (351) = happyShift action_236 action_547 (355) = happyShift action_237 action_547 (356) = happyShift action_84 action_547 (358) = happyShift action_238 action_547 (359) = happyShift action_239 action_547 (376) = happyShift action_240 action_547 (377) = happyShift action_241 action_547 (379) = happyShift action_102 action_547 (380) = happyShift action_103 action_547 (100) = happyGoto action_208 action_547 (102) = happyGoto action_640 action_547 (103) = happyGoto action_381 action_547 (105) = happyGoto action_382 action_547 (106) = happyGoto action_383 action_547 (107) = happyGoto action_211 action_547 (142) = happyGoto action_212 action_547 (192) = happyGoto action_384 action_547 (202) = happyGoto action_213 action_547 (203) = happyGoto action_214 action_547 (205) = happyGoto action_215 action_547 (206) = happyGoto action_216 action_547 (215) = happyGoto action_217 action_547 (217) = happyGoto action_218 action_547 (227) = happyGoto action_219 action_547 _ = happyFail action_548 _ = happyReduce_263 action_549 (245) = happyShift action_37 action_549 (253) = happyShift action_40 action_549 (265) = happyShift action_46 action_549 (270) = happyShift action_48 action_549 (272) = happyShift action_49 action_549 (273) = happyShift action_50 action_549 (274) = happyShift action_51 action_549 (275) = happyShift action_52 action_549 (276) = happyShift action_53 action_549 (277) = happyShift action_54 action_549 (279) = happyShift action_56 action_549 (280) = happyShift action_57 action_549 (281) = happyShift action_58 action_549 (282) = happyShift action_59 action_549 (283) = happyShift action_60 action_549 (286) = happyShift action_62 action_549 (336) = happyShift action_393 action_549 (346) = happyShift action_78 action_549 (358) = happyShift action_638 action_549 (92) = happyGoto action_639 action_549 (218) = happyGoto action_634 action_549 (221) = happyGoto action_188 action_549 (227) = happyGoto action_32 action_549 _ = happyFail action_550 _ = happyReduce_207 action_551 _ = happyReduce_208 action_552 _ = happyReduce_209 action_553 _ = happyReduce_210 action_554 (245) = happyShift action_37 action_554 (253) = happyShift action_40 action_554 (265) = happyShift action_46 action_554 (270) = happyShift action_48 action_554 (272) = happyShift action_49 action_554 (273) = happyShift action_50 action_554 (274) = happyShift action_51 action_554 (275) = happyShift action_635 action_554 (276) = happyShift action_636 action_554 (277) = happyShift action_637 action_554 (279) = happyShift action_56 action_554 (280) = happyShift action_57 action_554 (281) = happyShift action_58 action_554 (282) = happyShift action_59 action_554 (283) = happyShift action_60 action_554 (286) = happyShift action_62 action_554 (336) = happyShift action_393 action_554 (346) = happyShift action_78 action_554 (358) = happyShift action_638 action_554 (91) = happyGoto action_632 action_554 (92) = happyGoto action_633 action_554 (218) = happyGoto action_634 action_554 (221) = happyGoto action_188 action_554 (227) = happyGoto action_32 action_554 _ = happyFail action_555 (270) = happyShift action_631 action_555 (79) = happyGoto action_630 action_555 _ = happyReduce_182 action_556 _ = happyReduce_102 action_557 (358) = happyShift action_204 action_557 (76) = happyGoto action_629 action_557 _ = happyReduce_173 action_558 _ = happyReduce_196 action_559 (358) = happyShift action_628 action_559 (87) = happyGoto action_627 action_559 _ = happyFail action_560 _ = happyReduce_197 action_561 _ = happyReduce_100 action_562 (245) = happyShift action_37 action_562 (253) = happyShift action_40 action_562 (265) = happyShift action_46 action_562 (270) = happyShift action_48 action_562 (272) = happyShift action_49 action_562 (273) = happyShift action_50 action_562 (274) = happyShift action_51 action_562 (275) = happyShift action_52 action_562 (276) = happyShift action_53 action_562 (277) = happyShift action_54 action_562 (279) = happyShift action_56 action_562 (280) = happyShift action_57 action_562 (281) = happyShift action_58 action_562 (282) = happyShift action_59 action_562 (283) = happyShift action_60 action_562 (286) = happyShift action_62 action_562 (332) = happyShift action_192 action_562 (336) = happyShift action_193 action_562 (338) = happyShift action_194 action_562 (346) = happyShift action_78 action_562 (347) = happyShift action_79 action_562 (85) = happyGoto action_626 action_562 (193) = happyGoto action_201 action_562 (194) = happyGoto action_198 action_562 (196) = happyGoto action_185 action_562 (198) = happyGoto action_186 action_562 (218) = happyGoto action_187 action_562 (221) = happyGoto action_188 action_562 (227) = happyGoto action_32 action_562 (230) = happyGoto action_189 action_562 _ = happyReduce_193 action_563 (245) = happyShift action_37 action_563 (253) = happyShift action_40 action_563 (265) = happyShift action_46 action_563 (270) = happyShift action_48 action_563 (272) = happyShift action_49 action_563 (273) = happyShift action_50 action_563 (274) = happyShift action_51 action_563 (275) = happyShift action_52 action_563 (276) = happyShift action_53 action_563 (277) = happyShift action_54 action_563 (279) = happyShift action_56 action_563 (280) = happyShift action_57 action_563 (281) = happyShift action_58 action_563 (282) = happyShift action_59 action_563 (283) = happyShift action_60 action_563 (286) = happyShift action_62 action_563 (332) = happyShift action_192 action_563 (336) = happyShift action_193 action_563 (338) = happyShift action_194 action_563 (346) = happyShift action_78 action_563 (347) = happyShift action_79 action_563 (193) = happyGoto action_625 action_563 (194) = happyGoto action_198 action_563 (196) = happyGoto action_185 action_563 (198) = happyGoto action_186 action_563 (218) = happyGoto action_187 action_563 (221) = happyGoto action_188 action_563 (227) = happyGoto action_32 action_563 (230) = happyGoto action_189 action_563 _ = happyFail action_564 _ = happyReduce_191 action_565 _ = happyReduce_101 action_566 (245) = happyShift action_37 action_566 (253) = happyShift action_40 action_566 (265) = happyShift action_46 action_566 (270) = happyShift action_48 action_566 (272) = happyShift action_49 action_566 (273) = happyShift action_50 action_566 (274) = happyShift action_51 action_566 (275) = happyShift action_52 action_566 (276) = happyShift action_53 action_566 (277) = happyShift action_54 action_566 (279) = happyShift action_56 action_566 (280) = happyShift action_57 action_566 (281) = happyShift action_58 action_566 (282) = happyShift action_59 action_566 (283) = happyShift action_60 action_566 (286) = happyShift action_62 action_566 (332) = happyShift action_192 action_566 (336) = happyShift action_193 action_566 (338) = happyShift action_194 action_566 (346) = happyShift action_78 action_566 (347) = happyShift action_79 action_566 (83) = happyGoto action_624 action_566 (193) = happyGoto action_197 action_566 (194) = happyGoto action_198 action_566 (196) = happyGoto action_185 action_566 (198) = happyGoto action_186 action_566 (218) = happyGoto action_187 action_566 (221) = happyGoto action_188 action_566 (227) = happyGoto action_32 action_566 (230) = happyGoto action_189 action_566 _ = happyReduce_188 action_567 (339) = happyShift action_432 action_567 (343) = happyShift action_433 action_567 _ = happyFail action_568 (337) = happyShift action_623 action_568 _ = happyFail action_569 (337) = happyShift action_622 action_569 _ = happyFail action_570 (244) = happyShift action_36 action_570 (245) = happyShift action_37 action_570 (253) = happyShift action_40 action_570 (265) = happyShift action_46 action_570 (270) = happyShift action_48 action_570 (272) = happyShift action_49 action_570 (273) = happyShift action_50 action_570 (274) = happyShift action_51 action_570 (275) = happyShift action_52 action_570 (276) = happyShift action_53 action_570 (277) = happyShift action_54 action_570 (279) = happyShift action_56 action_570 (280) = happyShift action_57 action_570 (281) = happyShift action_58 action_570 (282) = happyShift action_59 action_570 (283) = happyShift action_60 action_570 (286) = happyShift action_62 action_570 (317) = happyShift action_70 action_570 (332) = happyShift action_72 action_570 (334) = happyShift action_73 action_570 (336) = happyShift action_112 action_570 (338) = happyShift action_75 action_570 (340) = happyShift action_76 action_570 (345) = happyShift action_77 action_570 (346) = happyShift action_78 action_570 (347) = happyShift action_79 action_570 (350) = happyShift action_80 action_570 (351) = happyShift action_81 action_570 (354) = happyShift action_82 action_570 (355) = happyShift action_83 action_570 (356) = happyShift action_84 action_570 (357) = happyShift action_85 action_570 (358) = happyShift action_86 action_570 (359) = happyShift action_87 action_570 (360) = happyShift action_88 action_570 (361) = happyShift action_89 action_570 (362) = happyShift action_90 action_570 (363) = happyShift action_91 action_570 (364) = happyShift action_92 action_570 (365) = happyShift action_93 action_570 (366) = happyShift action_94 action_570 (371) = happyShift action_95 action_570 (372) = happyShift action_96 action_570 (373) = happyShift action_97 action_570 (374) = happyShift action_98 action_570 (376) = happyShift action_99 action_570 (377) = happyShift action_100 action_570 (378) = happyShift action_101 action_570 (379) = happyShift action_102 action_570 (380) = happyShift action_103 action_570 (38) = happyGoto action_13 action_570 (142) = happyGoto action_16 action_570 (150) = happyGoto action_621 action_570 (151) = happyGoto action_23 action_570 (152) = happyGoto action_24 action_570 (192) = happyGoto action_25 action_570 (195) = happyGoto action_26 action_570 (198) = happyGoto action_27 action_570 (219) = happyGoto action_29 action_570 (220) = happyGoto action_30 action_570 (221) = happyGoto action_111 action_570 (227) = happyGoto action_32 action_570 (229) = happyGoto action_33 action_570 (230) = happyGoto action_34 action_570 (233) = happyGoto action_35 action_570 _ = happyFail action_571 (306) = happyShift action_620 action_571 _ = happyFail action_572 (306) = happyShift action_619 action_572 _ = happyFail action_573 (306) = happyShift action_617 action_573 (310) = happyShift action_618 action_573 _ = happyFail action_574 (306) = happyShift action_616 action_574 _ = happyFail action_575 (244) = happyShift action_36 action_575 (245) = happyShift action_37 action_575 (246) = happyShift action_38 action_575 (251) = happyShift action_39 action_575 (253) = happyShift action_40 action_575 (254) = happyShift action_41 action_575 (261) = happyShift action_45 action_575 (265) = happyShift action_46 action_575 (269) = happyShift action_47 action_575 (270) = happyShift action_48 action_575 (272) = happyShift action_49 action_575 (273) = happyShift action_50 action_575 (274) = happyShift action_51 action_575 (275) = happyShift action_52 action_575 (276) = happyShift action_53 action_575 (277) = happyShift action_54 action_575 (278) = happyShift action_55 action_575 (279) = happyShift action_56 action_575 (280) = happyShift action_57 action_575 (281) = happyShift action_58 action_575 (282) = happyShift action_59 action_575 (283) = happyShift action_60 action_575 (284) = happyShift action_61 action_575 (286) = happyShift action_62 action_575 (294) = happyShift action_66 action_575 (295) = happyShift action_67 action_575 (296) = happyShift action_68 action_575 (311) = happyShift action_69 action_575 (317) = happyShift action_70 action_575 (320) = happyShift action_71 action_575 (332) = happyShift action_72 action_575 (334) = happyShift action_73 action_575 (336) = happyShift action_112 action_575 (338) = happyShift action_75 action_575 (340) = happyShift action_76 action_575 (345) = happyShift action_77 action_575 (346) = happyShift action_78 action_575 (347) = happyShift action_79 action_575 (350) = happyShift action_80 action_575 (351) = happyShift action_81 action_575 (354) = happyShift action_82 action_575 (355) = happyShift action_83 action_575 (356) = happyShift action_84 action_575 (357) = happyShift action_85 action_575 (358) = happyShift action_86 action_575 (359) = happyShift action_87 action_575 (360) = happyShift action_88 action_575 (361) = happyShift action_89 action_575 (362) = happyShift action_90 action_575 (363) = happyShift action_91 action_575 (364) = happyShift action_92 action_575 (365) = happyShift action_93 action_575 (366) = happyShift action_94 action_575 (371) = happyShift action_95 action_575 (372) = happyShift action_96 action_575 (373) = happyShift action_97 action_575 (374) = happyShift action_98 action_575 (376) = happyShift action_99 action_575 (377) = happyShift action_100 action_575 (378) = happyShift action_101 action_575 (379) = happyShift action_102 action_575 (380) = happyShift action_103 action_575 (38) = happyGoto action_13 action_575 (142) = happyGoto action_16 action_575 (143) = happyGoto action_615 action_575 (144) = happyGoto action_110 action_575 (145) = happyGoto action_18 action_575 (147) = happyGoto action_19 action_575 (148) = happyGoto action_20 action_575 (149) = happyGoto action_21 action_575 (150) = happyGoto action_22 action_575 (151) = happyGoto action_23 action_575 (152) = happyGoto action_24 action_575 (192) = happyGoto action_25 action_575 (195) = happyGoto action_26 action_575 (198) = happyGoto action_27 action_575 (219) = happyGoto action_29 action_575 (220) = happyGoto action_30 action_575 (221) = happyGoto action_111 action_575 (227) = happyGoto action_32 action_575 (229) = happyGoto action_33 action_575 (230) = happyGoto action_34 action_575 (233) = happyGoto action_35 action_575 _ = happyFail action_576 (306) = happyShift action_613 action_576 (310) = happyShift action_614 action_576 _ = happyFail action_577 (306) = happyShift action_612 action_577 _ = happyFail action_578 _ = happyReduce_103 action_579 _ = happyReduce_105 action_580 _ = happyReduce_347 action_581 _ = happyReduce_70 action_582 (265) = happyShift action_611 action_582 (44) = happyGoto action_610 action_582 _ = happyReduce_77 action_583 _ = happyReduce_72 action_584 _ = happyReduce_500 action_585 (1) = happyShift action_601 action_585 (331) = happyShift action_602 action_585 (342) = happyShift action_606 action_585 (234) = happyGoto action_609 action_585 _ = happyFail action_586 _ = happyReduce_163 action_587 (1) = happyShift action_601 action_587 (331) = happyShift action_602 action_587 (342) = happyShift action_604 action_587 (234) = happyGoto action_608 action_587 _ = happyFail action_588 _ = happyReduce_512 action_589 (310) = happyShift action_607 action_589 _ = happyReduce_399 action_590 (329) = happyShift action_605 action_590 (342) = happyShift action_606 action_590 _ = happyFail action_591 (329) = happyShift action_603 action_591 (342) = happyShift action_604 action_591 _ = happyFail action_592 (1) = happyShift action_601 action_592 (331) = happyShift action_602 action_592 (234) = happyGoto action_600 action_592 _ = happyFail action_593 (342) = happyShift action_599 action_593 (183) = happyGoto action_598 action_593 _ = happyReduce_495 action_594 (244) = happyShift action_36 action_594 (245) = happyShift action_37 action_594 (246) = happyShift action_38 action_594 (251) = happyShift action_39 action_594 (253) = happyShift action_40 action_594 (254) = happyShift action_41 action_594 (261) = happyShift action_155 action_594 (265) = happyShift action_46 action_594 (269) = happyShift action_47 action_594 (270) = happyShift action_48 action_594 (272) = happyShift action_49 action_594 (273) = happyShift action_50 action_594 (274) = happyShift action_51 action_594 (275) = happyShift action_52 action_594 (276) = happyShift action_53 action_594 (277) = happyShift action_54 action_594 (278) = happyShift action_55 action_594 (279) = happyShift action_56 action_594 (280) = happyShift action_57 action_594 (281) = happyShift action_58 action_594 (282) = happyShift action_59 action_594 (283) = happyShift action_60 action_594 (284) = happyShift action_61 action_594 (285) = happyShift action_156 action_594 (286) = happyShift action_62 action_594 (294) = happyShift action_66 action_594 (295) = happyShift action_67 action_594 (296) = happyShift action_68 action_594 (311) = happyShift action_69 action_594 (317) = happyShift action_70 action_594 (320) = happyShift action_71 action_594 (321) = happyShift action_157 action_594 (332) = happyShift action_72 action_594 (334) = happyShift action_73 action_594 (336) = happyShift action_112 action_594 (338) = happyShift action_75 action_594 (340) = happyShift action_76 action_594 (342) = happyShift action_594 action_594 (345) = happyShift action_77 action_594 (346) = happyShift action_78 action_594 (347) = happyShift action_79 action_594 (350) = happyShift action_80 action_594 (351) = happyShift action_81 action_594 (354) = happyShift action_82 action_594 (355) = happyShift action_83 action_594 (356) = happyShift action_84 action_594 (357) = happyShift action_85 action_594 (358) = happyShift action_86 action_594 (359) = happyShift action_87 action_594 (360) = happyShift action_88 action_594 (361) = happyShift action_89 action_594 (362) = happyShift action_90 action_594 (363) = happyShift action_91 action_594 (364) = happyShift action_92 action_594 (365) = happyShift action_93 action_594 (366) = happyShift action_94 action_594 (371) = happyShift action_95 action_594 (372) = happyShift action_96 action_594 (373) = happyShift action_97 action_594 (374) = happyShift action_98 action_594 (376) = happyShift action_99 action_594 (377) = happyShift action_100 action_594 (378) = happyShift action_101 action_594 (379) = happyShift action_102 action_594 (380) = happyShift action_103 action_594 (38) = happyGoto action_13 action_594 (142) = happyGoto action_16 action_594 (143) = happyGoto action_151 action_594 (144) = happyGoto action_110 action_594 (145) = happyGoto action_18 action_594 (147) = happyGoto action_19 action_594 (148) = happyGoto action_20 action_594 (149) = happyGoto action_21 action_594 (150) = happyGoto action_22 action_594 (151) = happyGoto action_23 action_594 (152) = happyGoto action_24 action_594 (178) = happyGoto action_152 action_594 (182) = happyGoto action_597 action_594 (185) = happyGoto action_593 action_594 (186) = happyGoto action_154 action_594 (192) = happyGoto action_25 action_594 (195) = happyGoto action_26 action_594 (198) = happyGoto action_27 action_594 (219) = happyGoto action_29 action_594 (220) = happyGoto action_30 action_594 (221) = happyGoto action_111 action_594 (227) = happyGoto action_32 action_594 (229) = happyGoto action_33 action_594 (230) = happyGoto action_34 action_594 (233) = happyGoto action_35 action_594 _ = happyReduce_493 action_595 (329) = happyShift action_596 action_595 _ = happyFail action_596 _ = happyReduce_489 action_597 _ = happyReduce_492 action_598 _ = happyReduce_491 action_599 (244) = happyShift action_36 action_599 (245) = happyShift action_37 action_599 (246) = happyShift action_38 action_599 (251) = happyShift action_39 action_599 (253) = happyShift action_40 action_599 (254) = happyShift action_41 action_599 (261) = happyShift action_155 action_599 (265) = happyShift action_46 action_599 (269) = happyShift action_47 action_599 (270) = happyShift action_48 action_599 (272) = happyShift action_49 action_599 (273) = happyShift action_50 action_599 (274) = happyShift action_51 action_599 (275) = happyShift action_52 action_599 (276) = happyShift action_53 action_599 (277) = happyShift action_54 action_599 (278) = happyShift action_55 action_599 (279) = happyShift action_56 action_599 (280) = happyShift action_57 action_599 (281) = happyShift action_58 action_599 (282) = happyShift action_59 action_599 (283) = happyShift action_60 action_599 (284) = happyShift action_61 action_599 (285) = happyShift action_156 action_599 (286) = happyShift action_62 action_599 (294) = happyShift action_66 action_599 (295) = happyShift action_67 action_599 (296) = happyShift action_68 action_599 (311) = happyShift action_69 action_599 (317) = happyShift action_70 action_599 (320) = happyShift action_71 action_599 (321) = happyShift action_157 action_599 (332) = happyShift action_72 action_599 (334) = happyShift action_73 action_599 (336) = happyShift action_112 action_599 (338) = happyShift action_75 action_599 (340) = happyShift action_76 action_599 (342) = happyShift action_594 action_599 (345) = happyShift action_77 action_599 (346) = happyShift action_78 action_599 (347) = happyShift action_79 action_599 (350) = happyShift action_80 action_599 (351) = happyShift action_81 action_599 (354) = happyShift action_82 action_599 (355) = happyShift action_83 action_599 (356) = happyShift action_84 action_599 (357) = happyShift action_85 action_599 (358) = happyShift action_86 action_599 (359) = happyShift action_87 action_599 (360) = happyShift action_88 action_599 (361) = happyShift action_89 action_599 (362) = happyShift action_90 action_599 (363) = happyShift action_91 action_599 (364) = happyShift action_92 action_599 (365) = happyShift action_93 action_599 (366) = happyShift action_94 action_599 (371) = happyShift action_95 action_599 (372) = happyShift action_96 action_599 (373) = happyShift action_97 action_599 (374) = happyShift action_98 action_599 (376) = happyShift action_99 action_599 (377) = happyShift action_100 action_599 (378) = happyShift action_101 action_599 (379) = happyShift action_102 action_599 (380) = happyShift action_103 action_599 (38) = happyGoto action_13 action_599 (142) = happyGoto action_16 action_599 (143) = happyGoto action_151 action_599 (144) = happyGoto action_110 action_599 (145) = happyGoto action_18 action_599 (147) = happyGoto action_19 action_599 (148) = happyGoto action_20 action_599 (149) = happyGoto action_21 action_599 (150) = happyGoto action_22 action_599 (151) = happyGoto action_23 action_599 (152) = happyGoto action_24 action_599 (178) = happyGoto action_152 action_599 (182) = happyGoto action_902 action_599 (185) = happyGoto action_593 action_599 (186) = happyGoto action_154 action_599 (192) = happyGoto action_25 action_599 (195) = happyGoto action_26 action_599 (198) = happyGoto action_27 action_599 (219) = happyGoto action_29 action_599 (220) = happyGoto action_30 action_599 (221) = happyGoto action_111 action_599 (227) = happyGoto action_32 action_599 (229) = happyGoto action_33 action_599 (230) = happyGoto action_34 action_599 (233) = happyGoto action_35 action_599 _ = happyReduce_493 action_600 _ = happyReduce_490 action_601 _ = happyReduce_636 action_602 _ = happyReduce_635 action_603 _ = happyReduce_168 action_604 (356) = happyShift action_84 action_604 (191) = happyGoto action_900 action_604 (192) = happyGoto action_901 action_604 _ = happyReduce_511 action_605 _ = happyReduce_165 action_606 (244) = happyShift action_36 action_606 (245) = happyShift action_37 action_606 (246) = happyShift action_38 action_606 (251) = happyShift action_39 action_606 (253) = happyShift action_40 action_606 (254) = happyShift action_41 action_606 (257) = happyShift action_42 action_606 (258) = happyShift action_43 action_606 (259) = happyShift action_44 action_606 (261) = happyShift action_45 action_606 (265) = happyShift action_46 action_606 (269) = happyShift action_47 action_606 (270) = happyShift action_48 action_606 (272) = happyShift action_49 action_606 (273) = happyShift action_50 action_606 (274) = happyShift action_51 action_606 (275) = happyShift action_52 action_606 (276) = happyShift action_53 action_606 (277) = happyShift action_54 action_606 (278) = happyShift action_55 action_606 (279) = happyShift action_56 action_606 (280) = happyShift action_57 action_606 (281) = happyShift action_58 action_606 (282) = happyShift action_59 action_606 (283) = happyShift action_60 action_606 (284) = happyShift action_61 action_606 (286) = happyShift action_62 action_606 (289) = happyShift action_63 action_606 (290) = happyShift action_64 action_606 (291) = happyShift action_65 action_606 (294) = happyShift action_66 action_606 (295) = happyShift action_67 action_606 (296) = happyShift action_68 action_606 (311) = happyShift action_69 action_606 (317) = happyShift action_70 action_606 (320) = happyShift action_71 action_606 (321) = happyShift action_144 action_606 (332) = happyShift action_72 action_606 (334) = happyShift action_73 action_606 (336) = happyShift action_74 action_606 (338) = happyShift action_75 action_606 (340) = happyShift action_76 action_606 (345) = happyShift action_77 action_606 (346) = happyShift action_78 action_606 (347) = happyShift action_79 action_606 (350) = happyShift action_80 action_606 (351) = happyShift action_81 action_606 (354) = happyShift action_82 action_606 (355) = happyShift action_83 action_606 (356) = happyShift action_84 action_606 (357) = happyShift action_85 action_606 (358) = happyShift action_86 action_606 (359) = happyShift action_87 action_606 (360) = happyShift action_88 action_606 (361) = happyShift action_89 action_606 (362) = happyShift action_90 action_606 (363) = happyShift action_91 action_606 (364) = happyShift action_92 action_606 (365) = happyShift action_93 action_606 (366) = happyShift action_94 action_606 (367) = happyShift action_145 action_606 (368) = happyShift action_146 action_606 (369) = happyShift action_147 action_606 (370) = happyShift action_148 action_606 (371) = happyShift action_95 action_606 (372) = happyShift action_96 action_606 (373) = happyShift action_97 action_606 (374) = happyShift action_98 action_606 (376) = happyShift action_99 action_606 (377) = happyShift action_100 action_606 (378) = happyShift action_101 action_606 (379) = happyShift action_102 action_606 (380) = happyShift action_103 action_606 (38) = happyGoto action_13 action_606 (49) = happyGoto action_14 action_606 (135) = happyGoto action_120 action_606 (136) = happyGoto action_121 action_606 (137) = happyGoto action_899 action_606 (141) = happyGoto action_123 action_606 (142) = happyGoto action_16 action_606 (144) = happyGoto action_124 action_606 (145) = happyGoto action_18 action_606 (147) = happyGoto action_19 action_606 (148) = happyGoto action_20 action_606 (149) = happyGoto action_21 action_606 (150) = happyGoto action_22 action_606 (151) = happyGoto action_23 action_606 (152) = happyGoto action_24 action_606 (192) = happyGoto action_25 action_606 (195) = happyGoto action_26 action_606 (198) = happyGoto action_27 action_606 (218) = happyGoto action_28 action_606 (219) = happyGoto action_29 action_606 (220) = happyGoto action_30 action_606 (221) = happyGoto action_31 action_606 (227) = happyGoto action_32 action_606 (229) = happyGoto action_33 action_606 (230) = happyGoto action_34 action_606 (233) = happyGoto action_35 action_606 (237) = happyGoto action_125 action_606 (238) = happyGoto action_126 action_606 (239) = happyGoto action_127 action_606 (240) = happyGoto action_128 action_606 _ = happyReduce_162 action_607 (244) = happyShift action_36 action_607 (245) = happyShift action_37 action_607 (246) = happyShift action_38 action_607 (251) = happyShift action_39 action_607 (253) = happyShift action_40 action_607 (254) = happyShift action_41 action_607 (261) = happyShift action_45 action_607 (265) = happyShift action_46 action_607 (269) = happyShift action_47 action_607 (270) = happyShift action_48 action_607 (272) = happyShift action_49 action_607 (273) = happyShift action_50 action_607 (274) = happyShift action_51 action_607 (275) = happyShift action_52 action_607 (276) = happyShift action_53 action_607 (277) = happyShift action_54 action_607 (278) = happyShift action_55 action_607 (279) = happyShift action_56 action_607 (280) = happyShift action_57 action_607 (281) = happyShift action_58 action_607 (282) = happyShift action_59 action_607 (283) = happyShift action_60 action_607 (284) = happyShift action_61 action_607 (286) = happyShift action_62 action_607 (294) = happyShift action_66 action_607 (295) = happyShift action_67 action_607 (296) = happyShift action_68 action_607 (311) = happyShift action_69 action_607 (317) = happyShift action_70 action_607 (320) = happyShift action_71 action_607 (332) = happyShift action_72 action_607 (334) = happyShift action_73 action_607 (336) = happyShift action_112 action_607 (338) = happyShift action_75 action_607 (340) = happyShift action_76 action_607 (345) = happyShift action_77 action_607 (346) = happyShift action_78 action_607 (347) = happyShift action_79 action_607 (350) = happyShift action_80 action_607 (351) = happyShift action_81 action_607 (354) = happyShift action_82 action_607 (355) = happyShift action_83 action_607 (356) = happyShift action_84 action_607 (357) = happyShift action_85 action_607 (358) = happyShift action_86 action_607 (359) = happyShift action_87 action_607 (360) = happyShift action_88 action_607 (361) = happyShift action_89 action_607 (362) = happyShift action_90 action_607 (363) = happyShift action_91 action_607 (364) = happyShift action_92 action_607 (365) = happyShift action_93 action_607 (366) = happyShift action_94 action_607 (371) = happyShift action_95 action_607 (372) = happyShift action_96 action_607 (373) = happyShift action_97 action_607 (374) = happyShift action_98 action_607 (376) = happyShift action_99 action_607 (377) = happyShift action_100 action_607 (378) = happyShift action_101 action_607 (379) = happyShift action_102 action_607 (380) = happyShift action_103 action_607 (38) = happyGoto action_13 action_607 (142) = happyGoto action_16 action_607 (143) = happyGoto action_898 action_607 (144) = happyGoto action_110 action_607 (145) = happyGoto action_18 action_607 (147) = happyGoto action_19 action_607 (148) = happyGoto action_20 action_607 (149) = happyGoto action_21 action_607 (150) = happyGoto action_22 action_607 (151) = happyGoto action_23 action_607 (152) = happyGoto action_24 action_607 (192) = happyGoto action_25 action_607 (195) = happyGoto action_26 action_607 (198) = happyGoto action_27 action_607 (219) = happyGoto action_29 action_607 (220) = happyGoto action_30 action_607 (221) = happyGoto action_111 action_607 (227) = happyGoto action_32 action_607 (229) = happyGoto action_33 action_607 (230) = happyGoto action_34 action_607 (233) = happyGoto action_35 action_607 _ = happyFail action_608 _ = happyReduce_169 action_609 _ = happyReduce_166 action_610 (358) = happyShift action_897 action_610 (43) = happyGoto action_896 action_610 _ = happyReduce_75 action_611 _ = happyReduce_76 action_612 _ = happyReduce_111 action_613 _ = happyReduce_107 action_614 (332) = happyShift action_307 action_614 (334) = happyShift action_308 action_614 (336) = happyShift action_309 action_614 (338) = happyShift action_310 action_614 (347) = happyShift action_235 action_614 (351) = happyShift action_236 action_614 (355) = happyShift action_237 action_614 (201) = happyGoto action_895 action_614 (202) = happyGoto action_305 action_614 (203) = happyGoto action_214 action_614 (205) = happyGoto action_215 action_614 (206) = happyGoto action_216 action_614 _ = happyFail action_615 (306) = happyShift action_894 action_615 _ = happyFail action_616 _ = happyReduce_110 action_617 _ = happyReduce_106 action_618 (332) = happyShift action_307 action_618 (334) = happyShift action_308 action_618 (336) = happyShift action_309 action_618 (338) = happyShift action_310 action_618 (347) = happyShift action_235 action_618 (351) = happyShift action_236 action_618 (355) = happyShift action_237 action_618 (201) = happyGoto action_893 action_618 (202) = happyGoto action_305 action_618 (203) = happyGoto action_214 action_618 (205) = happyGoto action_215 action_618 (206) = happyGoto action_216 action_618 _ = happyFail action_619 _ = happyReduce_201 action_620 _ = happyReduce_203 action_621 (306) = happyShift action_892 action_621 _ = happyFail action_622 _ = happyReduce_523 action_623 _ = happyReduce_582 action_624 _ = happyReduce_187 action_625 _ = happyReduce_516 action_626 _ = happyReduce_192 action_627 (333) = happyShift action_890 action_627 (343) = happyShift action_891 action_627 _ = happyFail action_628 _ = happyReduce_200 action_629 _ = happyReduce_172 action_630 (244) = happyShift action_36 action_630 (245) = happyShift action_37 action_630 (246) = happyShift action_38 action_630 (251) = happyShift action_39 action_630 (253) = happyShift action_40 action_630 (254) = happyShift action_41 action_630 (261) = happyShift action_45 action_630 (265) = happyShift action_46 action_630 (269) = happyShift action_47 action_630 (270) = happyShift action_48 action_630 (272) = happyShift action_49 action_630 (273) = happyShift action_50 action_630 (274) = happyShift action_51 action_630 (275) = happyShift action_52 action_630 (276) = happyShift action_53 action_630 (277) = happyShift action_54 action_630 (278) = happyShift action_55 action_630 (279) = happyShift action_56 action_630 (280) = happyShift action_57 action_630 (281) = happyShift action_58 action_630 (282) = happyShift action_59 action_630 (283) = happyShift action_60 action_630 (284) = happyShift action_61 action_630 (286) = happyShift action_62 action_630 (294) = happyShift action_66 action_630 (295) = happyShift action_67 action_630 (296) = happyShift action_68 action_630 (311) = happyShift action_69 action_630 (317) = happyShift action_70 action_630 (320) = happyShift action_71 action_630 (332) = happyShift action_72 action_630 (334) = happyShift action_73 action_630 (336) = happyShift action_112 action_630 (338) = happyShift action_75 action_630 (340) = happyShift action_76 action_630 (345) = happyShift action_77 action_630 (346) = happyShift action_78 action_630 (347) = happyShift action_79 action_630 (350) = happyShift action_80 action_630 (351) = happyShift action_81 action_630 (354) = happyShift action_82 action_630 (355) = happyShift action_83 action_630 (356) = happyShift action_84 action_630 (357) = happyShift action_85 action_630 (358) = happyShift action_86 action_630 (359) = happyShift action_87 action_630 (360) = happyShift action_88 action_630 (361) = happyShift action_89 action_630 (362) = happyShift action_90 action_630 (363) = happyShift action_91 action_630 (364) = happyShift action_92 action_630 (365) = happyShift action_93 action_630 (366) = happyShift action_94 action_630 (371) = happyShift action_95 action_630 (372) = happyShift action_96 action_630 (373) = happyShift action_97 action_630 (374) = happyShift action_98 action_630 (376) = happyShift action_99 action_630 (377) = happyShift action_100 action_630 (378) = happyShift action_101 action_630 (379) = happyShift action_102 action_630 (380) = happyShift action_103 action_630 (38) = happyGoto action_13 action_630 (142) = happyGoto action_16 action_630 (144) = happyGoto action_889 action_630 (145) = happyGoto action_18 action_630 (147) = happyGoto action_19 action_630 (148) = happyGoto action_20 action_630 (149) = happyGoto action_21 action_630 (150) = happyGoto action_22 action_630 (151) = happyGoto action_23 action_630 (152) = happyGoto action_24 action_630 (192) = happyGoto action_25 action_630 (195) = happyGoto action_26 action_630 (198) = happyGoto action_27 action_630 (219) = happyGoto action_29 action_630 (220) = happyGoto action_30 action_630 (221) = happyGoto action_111 action_630 (227) = happyGoto action_32 action_630 (229) = happyGoto action_33 action_630 (230) = happyGoto action_34 action_630 (233) = happyGoto action_35 action_630 _ = happyFail action_631 (245) = happyShift action_37 action_631 (253) = happyShift action_40 action_631 (265) = happyShift action_46 action_631 (270) = happyShift action_48 action_631 (272) = happyShift action_49 action_631 (273) = happyShift action_50 action_631 (274) = happyShift action_51 action_631 (275) = happyShift action_52 action_631 (276) = happyShift action_53 action_631 (277) = happyShift action_54 action_631 (279) = happyShift action_56 action_631 (280) = happyShift action_57 action_631 (281) = happyShift action_58 action_631 (282) = happyShift action_59 action_631 (283) = happyShift action_60 action_631 (286) = happyShift action_62 action_631 (336) = happyShift action_888 action_631 (346) = happyShift action_78 action_631 (80) = happyGoto action_885 action_631 (81) = happyGoto action_886 action_631 (221) = happyGoto action_887 action_631 (227) = happyGoto action_32 action_631 _ = happyFail action_632 (245) = happyShift action_37 action_632 (253) = happyShift action_40 action_632 (265) = happyShift action_46 action_632 (270) = happyShift action_48 action_632 (272) = happyShift action_49 action_632 (273) = happyShift action_50 action_632 (274) = happyShift action_51 action_632 (275) = happyShift action_52 action_632 (276) = happyShift action_53 action_632 (277) = happyShift action_54 action_632 (279) = happyShift action_56 action_632 (280) = happyShift action_57 action_632 (281) = happyShift action_58 action_632 (282) = happyShift action_59 action_632 (283) = happyShift action_60 action_632 (286) = happyShift action_62 action_632 (336) = happyShift action_393 action_632 (346) = happyShift action_78 action_632 (358) = happyShift action_638 action_632 (92) = happyGoto action_884 action_632 (218) = happyGoto action_634 action_632 (221) = happyGoto action_188 action_632 (227) = happyGoto action_32 action_632 _ = happyFail action_633 _ = happyReduce_205 action_634 (309) = happyShift action_883 action_634 _ = happyFail action_635 (309) = happyReduce_592 action_635 _ = happyReduce_212 action_636 (309) = happyReduce_593 action_636 _ = happyReduce_213 action_637 (309) = happyReduce_591 action_637 _ = happyReduce_211 action_638 (245) = happyShift action_37 action_638 (253) = happyShift action_40 action_638 (265) = happyShift action_46 action_638 (270) = happyShift action_48 action_638 (272) = happyShift action_49 action_638 (273) = happyShift action_50 action_638 (274) = happyShift action_51 action_638 (275) = happyShift action_52 action_638 (276) = happyShift action_53 action_638 (277) = happyShift action_54 action_638 (279) = happyShift action_56 action_638 (280) = happyShift action_57 action_638 (281) = happyShift action_58 action_638 (282) = happyShift action_59 action_638 (283) = happyShift action_60 action_638 (286) = happyShift action_62 action_638 (336) = happyShift action_393 action_638 (346) = happyShift action_78 action_638 (218) = happyGoto action_882 action_638 (221) = happyGoto action_188 action_638 (227) = happyGoto action_32 action_638 _ = happyFail action_639 _ = happyReduce_206 action_640 _ = happyReduce_115 action_641 (245) = happyShift action_37 action_641 (253) = happyShift action_40 action_641 (265) = happyShift action_46 action_641 (272) = happyShift action_49 action_641 (273) = happyShift action_50 action_641 (274) = happyShift action_51 action_641 (275) = happyShift action_221 action_641 (276) = happyShift action_222 action_641 (277) = happyShift action_223 action_641 (280) = happyShift action_57 action_641 (281) = happyShift action_58 action_641 (282) = happyShift action_59 action_641 (283) = happyShift action_60 action_641 (286) = happyShift action_62 action_641 (299) = happyShift action_225 action_641 (300) = happyShift action_226 action_641 (321) = happyShift action_227 action_641 (328) = happyShift action_228 action_641 (332) = happyShift action_229 action_641 (334) = happyShift action_230 action_641 (336) = happyShift action_231 action_641 (338) = happyShift action_232 action_641 (345) = happyShift action_233 action_641 (346) = happyShift action_234 action_641 (347) = happyShift action_235 action_641 (351) = happyShift action_236 action_641 (355) = happyShift action_237 action_641 (358) = happyShift action_238 action_641 (359) = happyShift action_239 action_641 (376) = happyShift action_240 action_641 (377) = happyShift action_241 action_641 (379) = happyShift action_102 action_641 (380) = happyShift action_103 action_641 (100) = happyGoto action_208 action_641 (107) = happyGoto action_517 action_641 (142) = happyGoto action_212 action_641 (202) = happyGoto action_213 action_641 (203) = happyGoto action_214 action_641 (205) = happyGoto action_215 action_641 (206) = happyGoto action_216 action_641 (215) = happyGoto action_217 action_641 (217) = happyGoto action_218 action_641 (227) = happyGoto action_219 action_641 _ = happyReduce_245 action_642 (245) = happyShift action_37 action_642 (253) = happyShift action_40 action_642 (265) = happyShift action_46 action_642 (270) = happyShift action_249 action_642 (272) = happyShift action_49 action_642 (273) = happyShift action_50 action_642 (274) = happyShift action_51 action_642 (275) = happyShift action_221 action_642 (276) = happyShift action_222 action_642 (277) = happyShift action_223 action_642 (280) = happyShift action_57 action_642 (281) = happyShift action_58 action_642 (282) = happyShift action_59 action_642 (283) = happyShift action_60 action_642 (286) = happyShift action_62 action_642 (299) = happyShift action_225 action_642 (300) = happyShift action_226 action_642 (321) = happyShift action_227 action_642 (328) = happyShift action_228 action_642 (332) = happyShift action_229 action_642 (334) = happyShift action_230 action_642 (336) = happyShift action_231 action_642 (338) = happyShift action_232 action_642 (345) = happyShift action_233 action_642 (346) = happyShift action_234 action_642 (347) = happyShift action_235 action_642 (351) = happyShift action_236 action_642 (355) = happyShift action_237 action_642 (356) = happyShift action_84 action_642 (358) = happyShift action_238 action_642 (359) = happyShift action_239 action_642 (376) = happyShift action_240 action_642 (377) = happyShift action_241 action_642 (379) = happyShift action_102 action_642 (380) = happyShift action_103 action_642 (100) = happyGoto action_208 action_642 (101) = happyGoto action_881 action_642 (103) = happyGoto action_244 action_642 (104) = happyGoto action_245 action_642 (106) = happyGoto action_246 action_642 (107) = happyGoto action_211 action_642 (142) = happyGoto action_212 action_642 (192) = happyGoto action_248 action_642 (202) = happyGoto action_213 action_642 (203) = happyGoto action_214 action_642 (205) = happyGoto action_215 action_642 (206) = happyGoto action_216 action_642 (215) = happyGoto action_217 action_642 (217) = happyGoto action_218 action_642 (227) = happyGoto action_219 action_642 _ = happyFail action_643 _ = happyReduce_116 action_644 (245) = happyShift action_37 action_644 (253) = happyShift action_40 action_644 (265) = happyShift action_46 action_644 (272) = happyShift action_49 action_644 (273) = happyShift action_50 action_644 (274) = happyShift action_51 action_644 (275) = happyShift action_221 action_644 (276) = happyShift action_222 action_644 (277) = happyShift action_223 action_644 (280) = happyShift action_57 action_644 (281) = happyShift action_58 action_644 (282) = happyShift action_59 action_644 (283) = happyShift action_60 action_644 (286) = happyShift action_62 action_644 (322) = happyShift action_874 action_644 (332) = happyShift action_875 action_644 (336) = happyShift action_876 action_644 (346) = happyShift action_234 action_644 (347) = happyShift action_235 action_644 (351) = happyShift action_236 action_644 (355) = happyShift action_237 action_644 (118) = happyGoto action_880 action_644 (119) = happyGoto action_869 action_644 (120) = happyGoto action_870 action_644 (121) = happyGoto action_871 action_644 (205) = happyGoto action_872 action_644 (206) = happyGoto action_216 action_644 (215) = happyGoto action_873 action_644 (217) = happyGoto action_218 action_644 (227) = happyGoto action_219 action_644 _ = happyFail action_645 _ = happyReduce_229 action_646 _ = happyReduce_230 action_647 (309) = happyShift action_879 action_647 (343) = happyShift action_767 action_647 _ = happyFail action_648 (343) = happyShift action_878 action_648 _ = happyFail action_649 _ = happyReduce_264 action_650 _ = happyReduce_269 action_651 (245) = happyShift action_37 action_651 (253) = happyShift action_40 action_651 (265) = happyShift action_46 action_651 (270) = happyShift action_249 action_651 (272) = happyShift action_49 action_651 (273) = happyShift action_50 action_651 (274) = happyShift action_51 action_651 (275) = happyShift action_221 action_651 (276) = happyShift action_222 action_651 (277) = happyShift action_223 action_651 (280) = happyShift action_57 action_651 (281) = happyShift action_58 action_651 (282) = happyShift action_59 action_651 (283) = happyShift action_60 action_651 (286) = happyShift action_62 action_651 (299) = happyShift action_225 action_651 (300) = happyShift action_226 action_651 (321) = happyShift action_227 action_651 (328) = happyShift action_228 action_651 (332) = happyShift action_229 action_651 (334) = happyShift action_230 action_651 (336) = happyShift action_231 action_651 (338) = happyShift action_232 action_651 (345) = happyShift action_233 action_651 (346) = happyShift action_234 action_651 (347) = happyShift action_235 action_651 (351) = happyShift action_236 action_651 (355) = happyShift action_237 action_651 (356) = happyShift action_84 action_651 (358) = happyShift action_238 action_651 (359) = happyShift action_239 action_651 (376) = happyShift action_240 action_651 (377) = happyShift action_241 action_651 (379) = happyShift action_102 action_651 (380) = happyShift action_103 action_651 (100) = happyGoto action_208 action_651 (101) = happyGoto action_506 action_651 (103) = happyGoto action_244 action_651 (104) = happyGoto action_245 action_651 (106) = happyGoto action_246 action_651 (107) = happyGoto action_211 action_651 (111) = happyGoto action_877 action_651 (142) = happyGoto action_212 action_651 (192) = happyGoto action_248 action_651 (202) = happyGoto action_213 action_651 (203) = happyGoto action_214 action_651 (205) = happyGoto action_215 action_651 (206) = happyGoto action_216 action_651 (215) = happyGoto action_217 action_651 (217) = happyGoto action_218 action_651 (227) = happyGoto action_219 action_651 _ = happyFail action_652 _ = happyReduce_270 action_653 (245) = happyShift action_37 action_653 (253) = happyShift action_40 action_653 (265) = happyShift action_46 action_653 (272) = happyShift action_49 action_653 (273) = happyShift action_50 action_653 (274) = happyShift action_51 action_653 (275) = happyShift action_221 action_653 (276) = happyShift action_222 action_653 (277) = happyShift action_223 action_653 (280) = happyShift action_57 action_653 (281) = happyShift action_58 action_653 (282) = happyShift action_59 action_653 (283) = happyShift action_60 action_653 (286) = happyShift action_62 action_653 (322) = happyShift action_874 action_653 (332) = happyShift action_875 action_653 (336) = happyShift action_876 action_653 (346) = happyShift action_234 action_653 (347) = happyShift action_235 action_653 (351) = happyShift action_236 action_653 (355) = happyShift action_237 action_653 (118) = happyGoto action_868 action_653 (119) = happyGoto action_869 action_653 (120) = happyGoto action_870 action_653 (121) = happyGoto action_871 action_653 (205) = happyGoto action_872 action_653 (206) = happyGoto action_216 action_653 (215) = happyGoto action_873 action_653 (217) = happyGoto action_218 action_653 (227) = happyGoto action_219 action_653 _ = happyFail action_654 _ = happyReduce_271 action_655 (245) = happyShift action_37 action_655 (253) = happyShift action_40 action_655 (265) = happyShift action_46 action_655 (270) = happyShift action_249 action_655 (272) = happyShift action_49 action_655 (273) = happyShift action_50 action_655 (274) = happyShift action_51 action_655 (275) = happyShift action_221 action_655 (276) = happyShift action_222 action_655 (277) = happyShift action_223 action_655 (280) = happyShift action_57 action_655 (281) = happyShift action_58 action_655 (282) = happyShift action_59 action_655 (283) = happyShift action_60 action_655 (286) = happyShift action_62 action_655 (299) = happyShift action_225 action_655 (300) = happyShift action_226 action_655 (321) = happyShift action_227 action_655 (328) = happyShift action_228 action_655 (332) = happyShift action_229 action_655 (334) = happyShift action_230 action_655 (336) = happyShift action_231 action_655 (338) = happyShift action_232 action_655 (345) = happyShift action_233 action_655 (346) = happyShift action_234 action_655 (347) = happyShift action_235 action_655 (351) = happyShift action_236 action_655 (355) = happyShift action_237 action_655 (356) = happyShift action_84 action_655 (358) = happyShift action_238 action_655 (359) = happyShift action_239 action_655 (376) = happyShift action_240 action_655 (377) = happyShift action_241 action_655 (379) = happyShift action_102 action_655 (380) = happyShift action_103 action_655 (100) = happyGoto action_208 action_655 (101) = happyGoto action_506 action_655 (103) = happyGoto action_244 action_655 (104) = happyGoto action_245 action_655 (106) = happyGoto action_246 action_655 (107) = happyGoto action_211 action_655 (111) = happyGoto action_867 action_655 (142) = happyGoto action_212 action_655 (192) = happyGoto action_248 action_655 (202) = happyGoto action_213 action_655 (203) = happyGoto action_214 action_655 (205) = happyGoto action_215 action_655 (206) = happyGoto action_216 action_655 (215) = happyGoto action_217 action_655 (217) = happyGoto action_218 action_655 (227) = happyGoto action_219 action_655 _ = happyFail action_656 _ = happyReduce_268 action_657 (343) = happyShift action_866 action_657 _ = happyFail action_658 _ = happyReduce_277 action_659 (333) = happyShift action_865 action_659 _ = happyFail action_660 _ = happyReduce_274 action_661 _ = happyReduce_232 action_662 (245) = happyShift action_37 action_662 (253) = happyShift action_40 action_662 (265) = happyShift action_46 action_662 (272) = happyShift action_49 action_662 (273) = happyShift action_50 action_662 (274) = happyShift action_51 action_662 (275) = happyShift action_221 action_662 (276) = happyShift action_222 action_662 (277) = happyShift action_223 action_662 (280) = happyShift action_57 action_662 (281) = happyShift action_58 action_662 (282) = happyShift action_59 action_662 (283) = happyShift action_60 action_662 (286) = happyShift action_62 action_662 (299) = happyShift action_225 action_662 (300) = happyShift action_226 action_662 (321) = happyShift action_227 action_662 (328) = happyShift action_228 action_662 (332) = happyShift action_229 action_662 (334) = happyShift action_230 action_662 (336) = happyShift action_231 action_662 (338) = happyShift action_232 action_662 (345) = happyShift action_233 action_662 (346) = happyShift action_234 action_662 (347) = happyShift action_235 action_662 (351) = happyShift action_236 action_662 (355) = happyShift action_237 action_662 (358) = happyShift action_238 action_662 (359) = happyShift action_239 action_662 (376) = happyShift action_240 action_662 (377) = happyShift action_241 action_662 (379) = happyShift action_102 action_662 (380) = happyShift action_103 action_662 (100) = happyGoto action_208 action_662 (104) = happyGoto action_864 action_662 (106) = happyGoto action_210 action_662 (107) = happyGoto action_211 action_662 (142) = happyGoto action_212 action_662 (202) = happyGoto action_213 action_662 (203) = happyGoto action_214 action_662 (205) = happyGoto action_215 action_662 (206) = happyGoto action_216 action_662 (215) = happyGoto action_217 action_662 (217) = happyGoto action_218 action_662 (227) = happyGoto action_219 action_662 _ = happyFail action_663 (245) = happyShift action_37 action_663 (253) = happyShift action_40 action_663 (265) = happyShift action_46 action_663 (272) = happyShift action_49 action_663 (273) = happyShift action_50 action_663 (274) = happyShift action_51 action_663 (275) = happyShift action_221 action_663 (276) = happyShift action_222 action_663 (277) = happyShift action_223 action_663 (280) = happyShift action_57 action_663 (281) = happyShift action_58 action_663 (282) = happyShift action_59 action_663 (283) = happyShift action_60 action_663 (286) = happyShift action_62 action_663 (299) = happyShift action_225 action_663 (300) = happyShift action_226 action_663 (321) = happyShift action_227 action_663 (328) = happyShift action_228 action_663 (332) = happyShift action_229 action_663 (334) = happyShift action_230 action_663 (336) = happyShift action_231 action_663 (338) = happyShift action_232 action_663 (345) = happyShift action_233 action_663 (346) = happyShift action_234 action_663 (347) = happyShift action_235 action_663 (351) = happyShift action_236 action_663 (355) = happyShift action_237 action_663 (358) = happyShift action_238 action_663 (359) = happyShift action_239 action_663 (376) = happyShift action_240 action_663 (377) = happyShift action_241 action_663 (379) = happyShift action_102 action_663 (380) = happyShift action_103 action_663 (100) = happyGoto action_208 action_663 (104) = happyGoto action_863 action_663 (106) = happyGoto action_210 action_663 (107) = happyGoto action_211 action_663 (142) = happyGoto action_212 action_663 (202) = happyGoto action_213 action_663 (203) = happyGoto action_214 action_663 (205) = happyGoto action_215 action_663 (206) = happyGoto action_216 action_663 (215) = happyGoto action_217 action_663 (217) = happyGoto action_218 action_663 (227) = happyGoto action_219 action_663 _ = happyFail action_664 (245) = happyShift action_37 action_664 (253) = happyShift action_40 action_664 (265) = happyShift action_46 action_664 (270) = happyShift action_48 action_664 (272) = happyShift action_49 action_664 (273) = happyShift action_50 action_664 (274) = happyShift action_51 action_664 (275) = happyShift action_52 action_664 (276) = happyShift action_53 action_664 (277) = happyShift action_54 action_664 (279) = happyShift action_56 action_664 (280) = happyShift action_57 action_664 (281) = happyShift action_58 action_664 (282) = happyShift action_59 action_664 (283) = happyShift action_60 action_664 (286) = happyShift action_62 action_664 (346) = happyShift action_78 action_664 (347) = happyShift action_79 action_664 (351) = happyShift action_81 action_664 (355) = happyShift action_83 action_664 (221) = happyGoto action_779 action_664 (227) = happyGoto action_32 action_664 (229) = happyGoto action_477 action_664 (230) = happyGoto action_34 action_664 _ = happyFail action_665 (344) = happyShift action_862 action_665 _ = happyFail action_666 (344) = happyShift action_861 action_666 _ = happyFail action_667 (245) = happyShift action_37 action_667 (253) = happyShift action_40 action_667 (265) = happyShift action_46 action_667 (272) = happyShift action_49 action_667 (273) = happyShift action_50 action_667 (274) = happyShift action_51 action_667 (275) = happyShift action_221 action_667 (276) = happyShift action_222 action_667 (277) = happyShift action_223 action_667 (280) = happyShift action_57 action_667 (281) = happyShift action_58 action_667 (282) = happyShift action_59 action_667 (283) = happyShift action_60 action_667 (286) = happyShift action_62 action_667 (299) = happyShift action_225 action_667 (300) = happyShift action_226 action_667 (319) = happyReduce_239 action_667 (321) = happyShift action_227 action_667 (328) = happyShift action_228 action_667 (332) = happyShift action_229 action_667 (334) = happyShift action_230 action_667 (336) = happyShift action_231 action_667 (338) = happyShift action_232 action_667 (345) = happyShift action_233 action_667 (346) = happyShift action_234 action_667 (347) = happyShift action_235 action_667 (351) = happyShift action_236 action_667 (355) = happyShift action_237 action_667 (358) = happyShift action_238 action_667 (359) = happyShift action_239 action_667 (376) = happyShift action_240 action_667 (377) = happyShift action_241 action_667 (379) = happyShift action_102 action_667 (380) = happyShift action_103 action_667 (100) = happyGoto action_208 action_667 (107) = happyGoto action_517 action_667 (142) = happyGoto action_212 action_667 (202) = happyGoto action_213 action_667 (203) = happyGoto action_214 action_667 (205) = happyGoto action_215 action_667 (206) = happyGoto action_216 action_667 (215) = happyGoto action_217 action_667 (217) = happyGoto action_218 action_667 (227) = happyGoto action_219 action_667 _ = happyReduce_245 action_668 _ = happyReduce_244 action_669 _ = happyReduce_243 action_670 _ = happyReduce_242 action_671 _ = happyReduce_159 action_672 (244) = happyShift action_36 action_672 (245) = happyShift action_37 action_672 (246) = happyShift action_38 action_672 (248) = happyShift action_858 action_672 (251) = happyShift action_39 action_672 (253) = happyShift action_40 action_672 (254) = happyShift action_41 action_672 (257) = happyShift action_42 action_672 (258) = happyShift action_43 action_672 (259) = happyShift action_44 action_672 (261) = happyShift action_45 action_672 (263) = happyShift action_134 action_672 (265) = happyShift action_46 action_672 (267) = happyShift action_859 action_672 (269) = happyShift action_47 action_672 (270) = happyShift action_48 action_672 (272) = happyShift action_49 action_672 (273) = happyShift action_50 action_672 (274) = happyShift action_51 action_672 (275) = happyShift action_52 action_672 (276) = happyShift action_53 action_672 (277) = happyShift action_54 action_672 (278) = happyShift action_55 action_672 (279) = happyShift action_56 action_672 (280) = happyShift action_57 action_672 (281) = happyShift action_58 action_672 (282) = happyShift action_59 action_672 (283) = happyShift action_60 action_672 (284) = happyShift action_61 action_672 (286) = happyShift action_62 action_672 (289) = happyShift action_63 action_672 (290) = happyShift action_64 action_672 (291) = happyShift action_65 action_672 (294) = happyShift action_66 action_672 (295) = happyShift action_67 action_672 (296) = happyShift action_68 action_672 (311) = happyShift action_69 action_672 (317) = happyShift action_70 action_672 (320) = happyShift action_71 action_672 (321) = happyShift action_144 action_672 (332) = happyShift action_72 action_672 (334) = happyShift action_73 action_672 (336) = happyShift action_74 action_672 (338) = happyShift action_75 action_672 (340) = happyShift action_76 action_672 (345) = happyShift action_77 action_672 (346) = happyShift action_78 action_672 (347) = happyShift action_79 action_672 (350) = happyShift action_80 action_672 (351) = happyShift action_81 action_672 (354) = happyShift action_82 action_672 (355) = happyShift action_83 action_672 (356) = happyShift action_84 action_672 (357) = happyShift action_85 action_672 (358) = happyShift action_86 action_672 (359) = happyShift action_87 action_672 (360) = happyShift action_88 action_672 (361) = happyShift action_89 action_672 (362) = happyShift action_90 action_672 (363) = happyShift action_91 action_672 (364) = happyShift action_92 action_672 (365) = happyShift action_93 action_672 (366) = happyShift action_94 action_672 (367) = happyShift action_145 action_672 (368) = happyShift action_146 action_672 (369) = happyShift action_147 action_672 (370) = happyShift action_148 action_672 (371) = happyShift action_95 action_672 (372) = happyShift action_96 action_672 (373) = happyShift action_97 action_672 (374) = happyShift action_98 action_672 (376) = happyShift action_99 action_672 (377) = happyShift action_100 action_672 (378) = happyShift action_101 action_672 (379) = happyShift action_102 action_672 (380) = happyShift action_103 action_672 (38) = happyGoto action_13 action_672 (49) = happyGoto action_14 action_672 (57) = happyGoto action_853 action_672 (58) = happyGoto action_854 action_672 (67) = happyGoto action_855 action_672 (68) = happyGoto action_860 action_672 (135) = happyGoto action_120 action_672 (136) = happyGoto action_121 action_672 (137) = happyGoto action_857 action_672 (141) = happyGoto action_123 action_672 (142) = happyGoto action_16 action_672 (144) = happyGoto action_124 action_672 (145) = happyGoto action_18 action_672 (147) = happyGoto action_19 action_672 (148) = happyGoto action_20 action_672 (149) = happyGoto action_21 action_672 (150) = happyGoto action_22 action_672 (151) = happyGoto action_23 action_672 (152) = happyGoto action_24 action_672 (192) = happyGoto action_25 action_672 (195) = happyGoto action_26 action_672 (198) = happyGoto action_27 action_672 (218) = happyGoto action_28 action_672 (219) = happyGoto action_29 action_672 (220) = happyGoto action_30 action_672 (221) = happyGoto action_31 action_672 (227) = happyGoto action_32 action_672 (229) = happyGoto action_33 action_672 (230) = happyGoto action_34 action_672 (233) = happyGoto action_35 action_672 (237) = happyGoto action_125 action_672 (238) = happyGoto action_126 action_672 (239) = happyGoto action_127 action_672 (240) = happyGoto action_128 action_672 _ = happyReduce_156 action_673 (244) = happyShift action_36 action_673 (245) = happyShift action_37 action_673 (246) = happyShift action_38 action_673 (248) = happyShift action_858 action_673 (251) = happyShift action_39 action_673 (253) = happyShift action_40 action_673 (254) = happyShift action_41 action_673 (257) = happyShift action_42 action_673 (258) = happyShift action_43 action_673 (259) = happyShift action_44 action_673 (261) = happyShift action_45 action_673 (263) = happyShift action_134 action_673 (265) = happyShift action_46 action_673 (267) = happyShift action_859 action_673 (269) = happyShift action_47 action_673 (270) = happyShift action_48 action_673 (272) = happyShift action_49 action_673 (273) = happyShift action_50 action_673 (274) = happyShift action_51 action_673 (275) = happyShift action_52 action_673 (276) = happyShift action_53 action_673 (277) = happyShift action_54 action_673 (278) = happyShift action_55 action_673 (279) = happyShift action_56 action_673 (280) = happyShift action_57 action_673 (281) = happyShift action_58 action_673 (282) = happyShift action_59 action_673 (283) = happyShift action_60 action_673 (284) = happyShift action_61 action_673 (286) = happyShift action_62 action_673 (289) = happyShift action_63 action_673 (290) = happyShift action_64 action_673 (291) = happyShift action_65 action_673 (294) = happyShift action_66 action_673 (295) = happyShift action_67 action_673 (296) = happyShift action_68 action_673 (311) = happyShift action_69 action_673 (317) = happyShift action_70 action_673 (320) = happyShift action_71 action_673 (321) = happyShift action_144 action_673 (332) = happyShift action_72 action_673 (334) = happyShift action_73 action_673 (336) = happyShift action_74 action_673 (338) = happyShift action_75 action_673 (340) = happyShift action_76 action_673 (345) = happyShift action_77 action_673 (346) = happyShift action_78 action_673 (347) = happyShift action_79 action_673 (350) = happyShift action_80 action_673 (351) = happyShift action_81 action_673 (354) = happyShift action_82 action_673 (355) = happyShift action_83 action_673 (356) = happyShift action_84 action_673 (357) = happyShift action_85 action_673 (358) = happyShift action_86 action_673 (359) = happyShift action_87 action_673 (360) = happyShift action_88 action_673 (361) = happyShift action_89 action_673 (362) = happyShift action_90 action_673 (363) = happyShift action_91 action_673 (364) = happyShift action_92 action_673 (365) = happyShift action_93 action_673 (366) = happyShift action_94 action_673 (367) = happyShift action_145 action_673 (368) = happyShift action_146 action_673 (369) = happyShift action_147 action_673 (370) = happyShift action_148 action_673 (371) = happyShift action_95 action_673 (372) = happyShift action_96 action_673 (373) = happyShift action_97 action_673 (374) = happyShift action_98 action_673 (376) = happyShift action_99 action_673 (377) = happyShift action_100 action_673 (378) = happyShift action_101 action_673 (379) = happyShift action_102 action_673 (380) = happyShift action_103 action_673 (38) = happyGoto action_13 action_673 (49) = happyGoto action_14 action_673 (57) = happyGoto action_853 action_673 (58) = happyGoto action_854 action_673 (67) = happyGoto action_855 action_673 (68) = happyGoto action_856 action_673 (135) = happyGoto action_120 action_673 (136) = happyGoto action_121 action_673 (137) = happyGoto action_857 action_673 (141) = happyGoto action_123 action_673 (142) = happyGoto action_16 action_673 (144) = happyGoto action_124 action_673 (145) = happyGoto action_18 action_673 (147) = happyGoto action_19 action_673 (148) = happyGoto action_20 action_673 (149) = happyGoto action_21 action_673 (150) = happyGoto action_22 action_673 (151) = happyGoto action_23 action_673 (152) = happyGoto action_24 action_673 (192) = happyGoto action_25 action_673 (195) = happyGoto action_26 action_673 (198) = happyGoto action_27 action_673 (218) = happyGoto action_28 action_673 (219) = happyGoto action_29 action_673 (220) = happyGoto action_30 action_673 (221) = happyGoto action_31 action_673 (227) = happyGoto action_32 action_673 (229) = happyGoto action_33 action_673 (230) = happyGoto action_34 action_673 (233) = happyGoto action_35 action_673 (237) = happyGoto action_125 action_673 (238) = happyGoto action_126 action_673 (239) = happyGoto action_127 action_673 (240) = happyGoto action_128 action_673 _ = happyReduce_156 action_674 _ = happyReduce_233 action_675 (309) = happyShift action_852 action_675 _ = happyFail action_676 _ = happyReduce_290 action_677 (245) = happyShift action_37 action_677 (253) = happyShift action_40 action_677 (265) = happyShift action_46 action_677 (270) = happyShift action_249 action_677 (272) = happyShift action_49 action_677 (273) = happyShift action_50 action_677 (274) = happyShift action_51 action_677 (275) = happyShift action_221 action_677 (276) = happyShift action_222 action_677 (277) = happyShift action_223 action_677 (280) = happyShift action_57 action_677 (281) = happyShift action_58 action_677 (282) = happyShift action_59 action_677 (283) = happyShift action_60 action_677 (286) = happyShift action_62 action_677 (299) = happyShift action_225 action_677 (300) = happyShift action_226 action_677 (321) = happyShift action_227 action_677 (328) = happyShift action_228 action_677 (332) = happyShift action_229 action_677 (334) = happyShift action_230 action_677 (336) = happyShift action_231 action_677 (338) = happyShift action_232 action_677 (345) = happyShift action_233 action_677 (346) = happyShift action_234 action_677 (347) = happyShift action_235 action_677 (351) = happyShift action_236 action_677 (355) = happyShift action_237 action_677 (356) = happyShift action_84 action_677 (358) = happyShift action_238 action_677 (359) = happyShift action_239 action_677 (376) = happyShift action_240 action_677 (377) = happyShift action_241 action_677 (379) = happyShift action_102 action_677 (380) = happyShift action_103 action_677 (100) = happyGoto action_208 action_677 (101) = happyGoto action_851 action_677 (103) = happyGoto action_244 action_677 (104) = happyGoto action_245 action_677 (106) = happyGoto action_246 action_677 (107) = happyGoto action_211 action_677 (142) = happyGoto action_212 action_677 (192) = happyGoto action_248 action_677 (202) = happyGoto action_213 action_677 (203) = happyGoto action_214 action_677 (205) = happyGoto action_215 action_677 (206) = happyGoto action_216 action_677 (215) = happyGoto action_217 action_677 (217) = happyGoto action_218 action_677 (227) = happyGoto action_219 action_677 _ = happyFail action_678 _ = happyReduce_98 action_679 (245) = happyShift action_37 action_679 (253) = happyShift action_40 action_679 (265) = happyShift action_46 action_679 (270) = happyShift action_249 action_679 (272) = happyShift action_49 action_679 (273) = happyShift action_50 action_679 (274) = happyShift action_51 action_679 (275) = happyShift action_221 action_679 (276) = happyShift action_222 action_679 (277) = happyShift action_223 action_679 (280) = happyShift action_57 action_679 (281) = happyShift action_58 action_679 (282) = happyShift action_59 action_679 (283) = happyShift action_60 action_679 (286) = happyShift action_62 action_679 (299) = happyShift action_225 action_679 (300) = happyShift action_226 action_679 (321) = happyShift action_227 action_679 (328) = happyShift action_228 action_679 (332) = happyShift action_229 action_679 (334) = happyShift action_230 action_679 (336) = happyShift action_231 action_679 (338) = happyShift action_232 action_679 (345) = happyShift action_233 action_679 (346) = happyShift action_234 action_679 (347) = happyShift action_235 action_679 (351) = happyShift action_236 action_679 (355) = happyShift action_237 action_679 (356) = happyShift action_84 action_679 (358) = happyShift action_238 action_679 (359) = happyShift action_239 action_679 (376) = happyShift action_240 action_679 (377) = happyShift action_241 action_679 (379) = happyShift action_102 action_679 (380) = happyShift action_103 action_679 (100) = happyGoto action_208 action_679 (101) = happyGoto action_506 action_679 (103) = happyGoto action_244 action_679 (104) = happyGoto action_245 action_679 (106) = happyGoto action_246 action_679 (107) = happyGoto action_211 action_679 (111) = happyGoto action_850 action_679 (142) = happyGoto action_212 action_679 (192) = happyGoto action_248 action_679 (202) = happyGoto action_213 action_679 (203) = happyGoto action_214 action_679 (205) = happyGoto action_215 action_679 (206) = happyGoto action_216 action_679 (215) = happyGoto action_217 action_679 (217) = happyGoto action_218 action_679 (227) = happyGoto action_219 action_679 _ = happyFail action_680 _ = happyReduce_119 action_681 (343) = happyShift action_849 action_681 _ = happyReduce_295 action_682 _ = happyReduce_297 action_683 (245) = happyShift action_37 action_683 (253) = happyShift action_40 action_683 (265) = happyShift action_46 action_683 (272) = happyShift action_49 action_683 (273) = happyShift action_50 action_683 (274) = happyShift action_51 action_683 (275) = happyShift action_221 action_683 (276) = happyShift action_222 action_683 (277) = happyShift action_223 action_683 (280) = happyShift action_57 action_683 (281) = happyShift action_58 action_683 (282) = happyShift action_59 action_683 (283) = happyShift action_60 action_683 (286) = happyShift action_62 action_683 (315) = happyShift action_848 action_683 (346) = happyShift action_234 action_683 (215) = happyGoto action_847 action_683 (217) = happyGoto action_218 action_683 (227) = happyGoto action_219 action_683 _ = happyFail action_684 _ = happyReduce_114 action_685 (328) = happyShift action_845 action_685 (330) = happyShift action_846 action_685 (65) = happyGoto action_844 action_685 _ = happyFail action_686 _ = happyReduce_134 action_687 (310) = happyShift action_843 action_687 _ = happyFail action_688 (268) = happyShift action_691 action_688 (74) = happyGoto action_842 action_688 _ = happyReduce_171 action_689 _ = happyReduce_351 action_690 _ = happyReduce_352 action_691 (328) = happyShift action_170 action_691 (330) = happyShift action_171 action_691 (72) = happyGoto action_168 action_691 (73) = happyGoto action_841 action_691 _ = happyFail action_692 (327) = happyShift action_840 action_692 _ = happyFail action_693 (245) = happyShift action_37 action_693 (253) = happyShift action_40 action_693 (265) = happyShift action_46 action_693 (272) = happyShift action_49 action_693 (273) = happyShift action_50 action_693 (274) = happyShift action_51 action_693 (275) = happyShift action_221 action_693 (276) = happyShift action_222 action_693 (277) = happyShift action_223 action_693 (280) = happyShift action_57 action_693 (281) = happyShift action_58 action_693 (282) = happyShift action_59 action_693 (283) = happyShift action_60 action_693 (286) = happyShift action_62 action_693 (299) = happyShift action_225 action_693 (300) = happyShift action_226 action_693 (321) = happyShift action_227 action_693 (328) = happyShift action_228 action_693 (332) = happyShift action_229 action_693 (334) = happyShift action_230 action_693 (336) = happyShift action_231 action_693 (338) = happyShift action_232 action_693 (345) = happyShift action_233 action_693 (346) = happyShift action_234 action_693 (347) = happyShift action_235 action_693 (351) = happyShift action_236 action_693 (355) = happyShift action_237 action_693 (358) = happyShift action_238 action_693 (359) = happyShift action_239 action_693 (376) = happyShift action_240 action_693 (377) = happyShift action_241 action_693 (379) = happyShift action_102 action_693 (380) = happyShift action_103 action_693 (100) = happyGoto action_208 action_693 (104) = happyGoto action_839 action_693 (106) = happyGoto action_210 action_693 (107) = happyGoto action_211 action_693 (142) = happyGoto action_212 action_693 (202) = happyGoto action_213 action_693 (203) = happyGoto action_214 action_693 (205) = happyGoto action_215 action_693 (206) = happyGoto action_216 action_693 (215) = happyGoto action_217 action_693 (217) = happyGoto action_218 action_693 (227) = happyGoto action_219 action_693 _ = happyFail action_694 (245) = happyShift action_37 action_694 (253) = happyShift action_40 action_694 (265) = happyShift action_46 action_694 (272) = happyShift action_49 action_694 (273) = happyShift action_50 action_694 (274) = happyShift action_51 action_694 (275) = happyShift action_221 action_694 (276) = happyShift action_222 action_694 (277) = happyShift action_223 action_694 (280) = happyShift action_57 action_694 (281) = happyShift action_58 action_694 (282) = happyShift action_59 action_694 (283) = happyShift action_60 action_694 (286) = happyShift action_62 action_694 (299) = happyShift action_225 action_694 (300) = happyShift action_226 action_694 (321) = happyShift action_227 action_694 (328) = happyShift action_228 action_694 (332) = happyShift action_229 action_694 (334) = happyShift action_230 action_694 (336) = happyShift action_231 action_694 (338) = happyShift action_232 action_694 (345) = happyShift action_233 action_694 (346) = happyShift action_234 action_694 (347) = happyShift action_235 action_694 (351) = happyShift action_236 action_694 (355) = happyShift action_237 action_694 (358) = happyShift action_238 action_694 (359) = happyShift action_239 action_694 (376) = happyShift action_240 action_694 (377) = happyShift action_241 action_694 (379) = happyShift action_102 action_694 (380) = happyShift action_103 action_694 (100) = happyGoto action_208 action_694 (104) = happyGoto action_838 action_694 (106) = happyGoto action_210 action_694 (107) = happyGoto action_211 action_694 (142) = happyGoto action_212 action_694 (202) = happyGoto action_213 action_694 (203) = happyGoto action_214 action_694 (205) = happyGoto action_215 action_694 (206) = happyGoto action_216 action_694 (215) = happyGoto action_217 action_694 (217) = happyGoto action_218 action_694 (227) = happyGoto action_219 action_694 _ = happyFail action_695 (245) = happyShift action_37 action_695 (253) = happyShift action_40 action_695 (265) = happyShift action_46 action_695 (272) = happyShift action_49 action_695 (273) = happyShift action_50 action_695 (274) = happyShift action_51 action_695 (275) = happyShift action_221 action_695 (276) = happyShift action_222 action_695 (277) = happyShift action_223 action_695 (280) = happyShift action_57 action_695 (281) = happyShift action_58 action_695 (282) = happyShift action_59 action_695 (283) = happyShift action_60 action_695 (286) = happyShift action_62 action_695 (299) = happyShift action_225 action_695 (300) = happyShift action_226 action_695 (321) = happyShift action_227 action_695 (328) = happyShift action_228 action_695 (332) = happyShift action_229 action_695 (334) = happyShift action_230 action_695 (336) = happyShift action_231 action_695 (338) = happyShift action_232 action_695 (345) = happyShift action_233 action_695 (346) = happyShift action_234 action_695 (347) = happyShift action_235 action_695 (351) = happyShift action_236 action_695 (355) = happyShift action_237 action_695 (358) = happyShift action_238 action_695 (359) = happyShift action_239 action_695 (376) = happyShift action_240 action_695 (377) = happyShift action_241 action_695 (379) = happyShift action_102 action_695 (380) = happyShift action_103 action_695 (100) = happyGoto action_208 action_695 (104) = happyGoto action_837 action_695 (106) = happyGoto action_210 action_695 (107) = happyGoto action_211 action_695 (142) = happyGoto action_212 action_695 (202) = happyGoto action_213 action_695 (203) = happyGoto action_214 action_695 (205) = happyGoto action_215 action_695 (206) = happyGoto action_216 action_695 (215) = happyGoto action_217 action_695 (217) = happyGoto action_218 action_695 (227) = happyGoto action_219 action_695 _ = happyFail action_696 (315) = happyShift action_836 action_696 _ = happyReduce_249 action_697 (245) = happyShift action_37 action_697 (253) = happyShift action_40 action_697 (265) = happyShift action_46 action_697 (270) = happyShift action_495 action_697 (272) = happyShift action_49 action_697 (273) = happyShift action_50 action_697 (274) = happyShift action_51 action_697 (275) = happyShift action_221 action_697 (276) = happyShift action_222 action_697 (277) = happyShift action_223 action_697 (280) = happyShift action_57 action_697 (281) = happyShift action_58 action_697 (282) = happyShift action_59 action_697 (283) = happyShift action_60 action_697 (286) = happyShift action_62 action_697 (299) = happyShift action_225 action_697 (300) = happyShift action_226 action_697 (321) = happyShift action_227 action_697 (328) = happyShift action_228 action_697 (332) = happyShift action_229 action_697 (334) = happyShift action_230 action_697 (336) = happyShift action_231 action_697 (338) = happyShift action_232 action_697 (345) = happyShift action_233 action_697 (346) = happyShift action_234 action_697 (347) = happyShift action_235 action_697 (351) = happyShift action_236 action_697 (355) = happyShift action_237 action_697 (356) = happyShift action_84 action_697 (358) = happyShift action_238 action_697 (359) = happyShift action_239 action_697 (376) = happyShift action_240 action_697 (377) = happyShift action_241 action_697 (379) = happyShift action_102 action_697 (380) = happyShift action_103 action_697 (100) = happyGoto action_208 action_697 (101) = happyGoto action_668 action_697 (102) = happyGoto action_789 action_697 (103) = happyGoto action_492 action_697 (104) = happyGoto action_245 action_697 (105) = happyGoto action_382 action_697 (106) = happyGoto action_493 action_697 (107) = happyGoto action_211 action_697 (142) = happyGoto action_212 action_697 (192) = happyGoto action_494 action_697 (202) = happyGoto action_213 action_697 (203) = happyGoto action_214 action_697 (205) = happyGoto action_215 action_697 (206) = happyGoto action_216 action_697 (215) = happyGoto action_217 action_697 (217) = happyGoto action_218 action_697 (227) = happyGoto action_219 action_697 _ = happyFail action_698 (245) = happyShift action_37 action_698 (253) = happyShift action_40 action_698 (265) = happyShift action_46 action_698 (272) = happyShift action_49 action_698 (273) = happyShift action_50 action_698 (274) = happyShift action_51 action_698 (275) = happyShift action_221 action_698 (276) = happyShift action_222 action_698 (277) = happyShift action_223 action_698 (280) = happyShift action_57 action_698 (281) = happyShift action_58 action_698 (282) = happyShift action_59 action_698 (283) = happyShift action_60 action_698 (286) = happyShift action_62 action_698 (299) = happyShift action_225 action_698 (300) = happyShift action_226 action_698 (321) = happyShift action_227 action_698 (328) = happyShift action_228 action_698 (332) = happyShift action_229 action_698 (334) = happyShift action_230 action_698 (336) = happyShift action_231 action_698 (338) = happyShift action_232 action_698 (345) = happyShift action_233 action_698 (346) = happyShift action_234 action_698 (347) = happyShift action_235 action_698 (351) = happyShift action_236 action_698 (355) = happyShift action_237 action_698 (358) = happyShift action_238 action_698 (359) = happyShift action_239 action_698 (376) = happyShift action_240 action_698 (377) = happyShift action_241 action_698 (379) = happyShift action_102 action_698 (380) = happyShift action_103 action_698 (100) = happyGoto action_208 action_698 (106) = happyGoto action_835 action_698 (107) = happyGoto action_211 action_698 (142) = happyGoto action_212 action_698 (202) = happyGoto action_213 action_698 (203) = happyGoto action_214 action_698 (205) = happyGoto action_215 action_698 (206) = happyGoto action_216 action_698 (215) = happyGoto action_217 action_698 (217) = happyGoto action_218 action_698 (227) = happyGoto action_219 action_698 _ = happyFail action_699 (308) = happyShift action_267 action_699 (320) = happyShift action_269 action_699 (321) = happyShift action_270 action_699 (322) = happyShift action_271 action_699 (327) = happyShift action_272 action_699 (332) = happyShift action_529 action_699 (336) = happyShift action_530 action_699 (344) = happyShift action_664 action_699 (347) = happyShift action_79 action_699 (348) = happyShift action_274 action_699 (349) = happyShift action_275 action_699 (351) = happyShift action_81 action_699 (353) = happyShift action_277 action_699 (355) = happyShift action_83 action_699 (200) = happyGoto action_833 action_699 (210) = happyGoto action_834 action_699 (225) = happyGoto action_376 action_699 (226) = happyGoto action_263 action_699 (228) = happyGoto action_264 action_699 (229) = happyGoto action_528 action_699 (230) = happyGoto action_34 action_699 (231) = happyGoto action_265 action_699 (232) = happyGoto action_266 action_699 _ = happyFail action_700 (245) = happyShift action_37 action_700 (253) = happyShift action_40 action_700 (265) = happyShift action_46 action_700 (270) = happyShift action_495 action_700 (272) = happyShift action_49 action_700 (273) = happyShift action_50 action_700 (274) = happyShift action_51 action_700 (275) = happyShift action_221 action_700 (276) = happyShift action_222 action_700 (277) = happyShift action_223 action_700 (280) = happyShift action_57 action_700 (281) = happyShift action_58 action_700 (282) = happyShift action_59 action_700 (283) = happyShift action_60 action_700 (286) = happyShift action_62 action_700 (299) = happyShift action_225 action_700 (300) = happyShift action_226 action_700 (321) = happyShift action_227 action_700 (328) = happyShift action_228 action_700 (332) = happyShift action_229 action_700 (334) = happyShift action_230 action_700 (336) = happyShift action_231 action_700 (338) = happyShift action_232 action_700 (345) = happyShift action_233 action_700 (346) = happyShift action_234 action_700 (347) = happyShift action_235 action_700 (351) = happyShift action_236 action_700 (355) = happyShift action_237 action_700 (356) = happyShift action_84 action_700 (358) = happyShift action_238 action_700 (359) = happyShift action_239 action_700 (376) = happyShift action_240 action_700 (377) = happyShift action_241 action_700 (379) = happyShift action_102 action_700 (380) = happyShift action_103 action_700 (100) = happyGoto action_208 action_700 (101) = happyGoto action_661 action_700 (102) = happyGoto action_785 action_700 (103) = happyGoto action_492 action_700 (104) = happyGoto action_245 action_700 (105) = happyGoto action_382 action_700 (106) = happyGoto action_493 action_700 (107) = happyGoto action_211 action_700 (142) = happyGoto action_212 action_700 (192) = happyGoto action_494 action_700 (202) = happyGoto action_213 action_700 (203) = happyGoto action_214 action_700 (205) = happyGoto action_215 action_700 (206) = happyGoto action_216 action_700 (215) = happyGoto action_217 action_700 (217) = happyGoto action_218 action_700 (227) = happyGoto action_219 action_700 _ = happyFail action_701 _ = happyReduce_570 action_702 (268) = happyShift action_829 action_702 (123) = happyGoto action_832 action_702 _ = happyReduce_317 action_703 (250) = happyShift action_827 action_703 (134) = happyGoto action_831 action_703 _ = happyReduce_337 action_704 (310) = happyShift action_830 action_704 _ = happyFail action_705 (268) = happyShift action_829 action_705 (123) = happyGoto action_828 action_705 _ = happyReduce_317 action_706 (250) = happyShift action_827 action_706 (134) = happyGoto action_826 action_706 _ = happyReduce_337 action_707 _ = happyReduce_137 action_708 (306) = happyShift action_825 action_708 _ = happyFail action_709 _ = happyReduce_433 action_710 _ = happyReduce_535 action_711 _ = happyReduce_572 action_712 (336) = happyShift action_824 action_712 (29) = happyGoto action_823 action_712 _ = happyReduce_42 action_713 (332) = happyShift action_559 action_713 (358) = happyShift action_560 action_713 (86) = happyGoto action_822 action_713 _ = happyFail action_714 (332) = happyShift action_559 action_714 (358) = happyShift action_560 action_714 (86) = happyGoto action_821 action_714 _ = happyFail action_715 _ = happyReduce_545 action_716 _ = happyReduce_548 action_717 _ = happyReduce_542 action_718 _ = happyReduce_540 action_719 _ = happyReduce_547 action_720 _ = happyReduce_541 action_721 _ = happyReduce_426 action_722 _ = happyReduce_427 action_723 (244) = happyShift action_36 action_723 (245) = happyShift action_37 action_723 (246) = happyShift action_38 action_723 (247) = happyShift action_129 action_723 (248) = happyShift action_130 action_723 (249) = happyShift action_131 action_723 (250) = happyShift action_132 action_723 (251) = happyShift action_39 action_723 (253) = happyShift action_40 action_723 (254) = happyShift action_41 action_723 (257) = happyShift action_42 action_723 (258) = happyShift action_43 action_723 (259) = happyShift action_44 action_723 (260) = happyShift action_133 action_723 (261) = happyShift action_45 action_723 (263) = happyShift action_134 action_723 (265) = happyShift action_46 action_723 (267) = happyShift action_135 action_723 (269) = happyShift action_47 action_723 (270) = happyShift action_48 action_723 (271) = happyShift action_136 action_723 (272) = happyShift action_49 action_723 (273) = happyShift action_50 action_723 (274) = happyShift action_51 action_723 (275) = happyShift action_52 action_723 (276) = happyShift action_53 action_723 (277) = happyShift action_54 action_723 (278) = happyShift action_55 action_723 (279) = happyShift action_56 action_723 (280) = happyShift action_57 action_723 (281) = happyShift action_58 action_723 (282) = happyShift action_59 action_723 (283) = happyShift action_60 action_723 (284) = happyShift action_61 action_723 (286) = happyShift action_62 action_723 (289) = happyShift action_63 action_723 (290) = happyShift action_64 action_723 (291) = happyShift action_65 action_723 (293) = happyShift action_137 action_723 (294) = happyShift action_66 action_723 (295) = happyShift action_67 action_723 (296) = happyShift action_68 action_723 (297) = happyShift action_138 action_723 (298) = happyShift action_139 action_723 (301) = happyShift action_140 action_723 (302) = happyShift action_141 action_723 (303) = happyShift action_142 action_723 (304) = happyShift action_143 action_723 (311) = happyShift action_69 action_723 (317) = happyShift action_70 action_723 (320) = happyShift action_71 action_723 (321) = happyShift action_144 action_723 (332) = happyShift action_72 action_723 (334) = happyShift action_73 action_723 (336) = happyShift action_74 action_723 (338) = happyShift action_75 action_723 (340) = happyShift action_76 action_723 (345) = happyShift action_77 action_723 (346) = happyShift action_78 action_723 (347) = happyShift action_79 action_723 (350) = happyShift action_80 action_723 (351) = happyShift action_81 action_723 (354) = happyShift action_82 action_723 (355) = happyShift action_83 action_723 (356) = happyShift action_84 action_723 (357) = happyShift action_85 action_723 (358) = happyShift action_86 action_723 (359) = happyShift action_87 action_723 (360) = happyShift action_88 action_723 (361) = happyShift action_89 action_723 (362) = happyShift action_90 action_723 (363) = happyShift action_91 action_723 (364) = happyShift action_92 action_723 (365) = happyShift action_93 action_723 (366) = happyShift action_94 action_723 (367) = happyShift action_145 action_723 (368) = happyShift action_146 action_723 (369) = happyShift action_147 action_723 (370) = happyShift action_148 action_723 (371) = happyShift action_95 action_723 (372) = happyShift action_96 action_723 (373) = happyShift action_97 action_723 (374) = happyShift action_98 action_723 (376) = happyShift action_99 action_723 (377) = happyShift action_100 action_723 (378) = happyShift action_101 action_723 (379) = happyShift action_102 action_723 (380) = happyShift action_103 action_723 (38) = happyGoto action_13 action_723 (49) = happyGoto action_14 action_723 (52) = happyGoto action_820 action_723 (53) = happyGoto action_114 action_723 (54) = happyGoto action_115 action_723 (55) = happyGoto action_116 action_723 (58) = happyGoto action_117 action_723 (62) = happyGoto action_118 action_723 (88) = happyGoto action_119 action_723 (135) = happyGoto action_120 action_723 (136) = happyGoto action_121 action_723 (137) = happyGoto action_122 action_723 (141) = happyGoto action_123 action_723 (142) = happyGoto action_16 action_723 (144) = happyGoto action_124 action_723 (145) = happyGoto action_18 action_723 (147) = happyGoto action_19 action_723 (148) = happyGoto action_20 action_723 (149) = happyGoto action_21 action_723 (150) = happyGoto action_22 action_723 (151) = happyGoto action_23 action_723 (152) = happyGoto action_24 action_723 (192) = happyGoto action_25 action_723 (195) = happyGoto action_26 action_723 (198) = happyGoto action_27 action_723 (218) = happyGoto action_28 action_723 (219) = happyGoto action_29 action_723 (220) = happyGoto action_30 action_723 (221) = happyGoto action_31 action_723 (227) = happyGoto action_32 action_723 (229) = happyGoto action_33 action_723 (230) = happyGoto action_34 action_723 (233) = happyGoto action_35 action_723 (237) = happyGoto action_125 action_723 (238) = happyGoto action_126 action_723 (239) = happyGoto action_127 action_723 (240) = happyGoto action_128 action_723 _ = happyReduce_92 action_724 _ = happyReduce_425 action_725 _ = happyReduce_423 action_726 _ = happyReduce_422 action_727 _ = happyReduce_436 action_728 _ = happyReduce_437 action_729 (307) = happyShift action_819 action_729 (315) = happyShift action_486 action_729 _ = happyReduce_430 action_730 _ = happyReduce_448 action_731 _ = happyReduce_465 action_732 _ = happyReduce_449 action_733 (313) = happyShift action_817 action_733 (343) = happyShift action_818 action_733 _ = happyReduce_451 action_734 _ = happyReduce_454 action_735 _ = happyReduce_455 action_736 (244) = happyShift action_36 action_736 (245) = happyShift action_37 action_736 (246) = happyShift action_38 action_736 (251) = happyShift action_39 action_736 (253) = happyShift action_40 action_736 (254) = happyShift action_41 action_736 (261) = happyShift action_45 action_736 (265) = happyShift action_46 action_736 (269) = happyShift action_47 action_736 (270) = happyShift action_48 action_736 (272) = happyShift action_49 action_736 (273) = happyShift action_50 action_736 (274) = happyShift action_51 action_736 (275) = happyShift action_52 action_736 (276) = happyShift action_53 action_736 (277) = happyShift action_54 action_736 (278) = happyShift action_55 action_736 (279) = happyShift action_56 action_736 (280) = happyShift action_57 action_736 (281) = happyShift action_58 action_736 (282) = happyShift action_59 action_736 (283) = happyShift action_60 action_736 (284) = happyShift action_61 action_736 (286) = happyShift action_816 action_736 (294) = happyShift action_66 action_736 (295) = happyShift action_67 action_736 (296) = happyShift action_68 action_736 (311) = happyShift action_69 action_736 (317) = happyShift action_70 action_736 (320) = happyShift action_71 action_736 (332) = happyShift action_72 action_736 (334) = happyShift action_73 action_736 (336) = happyShift action_112 action_736 (338) = happyShift action_75 action_736 (340) = happyShift action_76 action_736 (345) = happyShift action_77 action_736 (346) = happyShift action_78 action_736 (347) = happyShift action_79 action_736 (350) = happyShift action_80 action_736 (351) = happyShift action_81 action_736 (354) = happyShift action_82 action_736 (355) = happyShift action_83 action_736 (356) = happyShift action_84 action_736 (357) = happyShift action_85 action_736 (358) = happyShift action_86 action_736 (359) = happyShift action_87 action_736 (360) = happyShift action_88 action_736 (361) = happyShift action_89 action_736 (362) = happyShift action_90 action_736 (363) = happyShift action_91 action_736 (364) = happyShift action_92 action_736 (365) = happyShift action_93 action_736 (366) = happyShift action_94 action_736 (371) = happyShift action_95 action_736 (372) = happyShift action_96 action_736 (373) = happyShift action_97 action_736 (374) = happyShift action_98 action_736 (376) = happyShift action_99 action_736 (377) = happyShift action_100 action_736 (378) = happyShift action_101 action_736 (379) = happyShift action_102 action_736 (380) = happyShift action_103 action_736 (38) = happyGoto action_13 action_736 (142) = happyGoto action_16 action_736 (143) = happyGoto action_815 action_736 (144) = happyGoto action_110 action_736 (145) = happyGoto action_18 action_736 (147) = happyGoto action_19 action_736 (148) = happyGoto action_20 action_736 (149) = happyGoto action_21 action_736 (150) = happyGoto action_22 action_736 (151) = happyGoto action_23 action_736 (152) = happyGoto action_24 action_736 (192) = happyGoto action_25 action_736 (195) = happyGoto action_26 action_736 (198) = happyGoto action_27 action_736 (219) = happyGoto action_29 action_736 (220) = happyGoto action_30 action_736 (221) = happyGoto action_111 action_736 (227) = happyGoto action_32 action_736 (229) = happyGoto action_33 action_736 (230) = happyGoto action_34 action_736 (233) = happyGoto action_35 action_736 _ = happyFail action_737 _ = happyReduce_463 action_738 (307) = happyShift action_814 action_738 (315) = happyShift action_486 action_738 _ = happyReduce_430 action_739 _ = happyReduce_446 action_740 _ = happyReduce_444 action_741 _ = happyReduce_447 action_742 (315) = happyShift action_813 action_742 _ = happyFail action_743 (245) = happyShift action_37 action_743 (253) = happyShift action_40 action_743 (265) = happyShift action_46 action_743 (272) = happyShift action_49 action_743 (273) = happyShift action_50 action_743 (274) = happyShift action_51 action_743 (275) = happyShift action_221 action_743 (276) = happyShift action_222 action_743 (277) = happyShift action_223 action_743 (280) = happyShift action_57 action_743 (281) = happyShift action_58 action_743 (282) = happyShift action_59 action_743 (283) = happyShift action_60 action_743 (286) = happyShift action_62 action_743 (299) = happyShift action_225 action_743 (300) = happyShift action_226 action_743 (321) = happyShift action_227 action_743 (328) = happyShift action_228 action_743 (332) = happyShift action_229 action_743 (334) = happyShift action_230 action_743 (336) = happyShift action_231 action_743 (338) = happyShift action_232 action_743 (345) = happyShift action_233 action_743 (346) = happyShift action_234 action_743 (347) = happyShift action_235 action_743 (351) = happyShift action_236 action_743 (355) = happyShift action_237 action_743 (358) = happyShift action_238 action_743 (359) = happyShift action_239 action_743 (376) = happyShift action_240 action_743 (377) = happyShift action_241 action_743 (379) = happyShift action_102 action_743 (380) = happyShift action_103 action_743 (100) = happyGoto action_208 action_743 (107) = happyGoto action_812 action_743 (142) = happyGoto action_212 action_743 (202) = happyGoto action_213 action_743 (203) = happyGoto action_214 action_743 (205) = happyGoto action_215 action_743 (206) = happyGoto action_216 action_743 (215) = happyGoto action_217 action_743 (217) = happyGoto action_218 action_743 (227) = happyGoto action_219 action_743 _ = happyFail action_744 _ = happyReduce_487 action_745 _ = happyReduce_483 action_746 (1) = happyShift action_601 action_746 (331) = happyShift action_602 action_746 (234) = happyGoto action_811 action_746 _ = happyFail action_747 (342) = happyShift action_810 action_747 _ = happyReduce_471 action_748 _ = happyReduce_475 action_749 (309) = happyShift action_809 action_749 (93) = happyGoto action_808 action_749 _ = happyReduce_216 action_750 (244) = happyShift action_36 action_750 (245) = happyShift action_37 action_750 (246) = happyShift action_38 action_750 (251) = happyShift action_39 action_750 (253) = happyShift action_40 action_750 (254) = happyShift action_41 action_750 (261) = happyShift action_45 action_750 (265) = happyShift action_46 action_750 (269) = happyShift action_47 action_750 (270) = happyShift action_48 action_750 (272) = happyShift action_49 action_750 (273) = happyShift action_50 action_750 (274) = happyShift action_51 action_750 (275) = happyShift action_52 action_750 (276) = happyShift action_53 action_750 (277) = happyShift action_54 action_750 (278) = happyShift action_55 action_750 (279) = happyShift action_56 action_750 (280) = happyShift action_57 action_750 (281) = happyShift action_58 action_750 (282) = happyShift action_59 action_750 (283) = happyShift action_60 action_750 (284) = happyShift action_61 action_750 (286) = happyShift action_62 action_750 (294) = happyShift action_66 action_750 (295) = happyShift action_67 action_750 (296) = happyShift action_68 action_750 (311) = happyShift action_69 action_750 (317) = happyShift action_70 action_750 (320) = happyShift action_71 action_750 (321) = happyShift action_157 action_750 (332) = happyShift action_72 action_750 (334) = happyShift action_73 action_750 (336) = happyShift action_112 action_750 (338) = happyShift action_75 action_750 (340) = happyShift action_76 action_750 (342) = happyShift action_750 action_750 (345) = happyShift action_77 action_750 (346) = happyShift action_78 action_750 (347) = happyShift action_79 action_750 (350) = happyShift action_80 action_750 (351) = happyShift action_81 action_750 (354) = happyShift action_82 action_750 (355) = happyShift action_83 action_750 (356) = happyShift action_84 action_750 (357) = happyShift action_85 action_750 (358) = happyShift action_86 action_750 (359) = happyShift action_87 action_750 (360) = happyShift action_88 action_750 (361) = happyShift action_89 action_750 (362) = happyShift action_90 action_750 (363) = happyShift action_91 action_750 (364) = happyShift action_92 action_750 (365) = happyShift action_93 action_750 (366) = happyShift action_94 action_750 (371) = happyShift action_95 action_750 (372) = happyShift action_96 action_750 (373) = happyShift action_97 action_750 (374) = happyShift action_98 action_750 (376) = happyShift action_99 action_750 (377) = happyShift action_100 action_750 (378) = happyShift action_101 action_750 (379) = happyShift action_102 action_750 (380) = happyShift action_103 action_750 (38) = happyGoto action_13 action_750 (142) = happyGoto action_16 action_750 (143) = happyGoto action_745 action_750 (144) = happyGoto action_110 action_750 (145) = happyGoto action_18 action_750 (147) = happyGoto action_19 action_750 (148) = happyGoto action_20 action_750 (149) = happyGoto action_21 action_750 (150) = happyGoto action_22 action_750 (151) = happyGoto action_23 action_750 (152) = happyGoto action_24 action_750 (171) = happyGoto action_807 action_750 (172) = happyGoto action_747 action_750 (173) = happyGoto action_748 action_750 (178) = happyGoto action_749 action_750 (192) = happyGoto action_25 action_750 (195) = happyGoto action_26 action_750 (198) = happyGoto action_27 action_750 (219) = happyGoto action_29 action_750 (220) = happyGoto action_30 action_750 (221) = happyGoto action_111 action_750 (227) = happyGoto action_32 action_750 (229) = happyGoto action_33 action_750 (230) = happyGoto action_34 action_750 (233) = happyGoto action_35 action_750 _ = happyFail action_751 (329) = happyShift action_806 action_751 _ = happyFail action_752 (359) = happyShift action_805 action_752 _ = happyFail action_753 _ = happyReduce_384 action_754 (245) = happyShift action_37 action_754 (253) = happyShift action_40 action_754 (265) = happyShift action_46 action_754 (270) = happyShift action_249 action_754 (272) = happyShift action_49 action_754 (273) = happyShift action_50 action_754 (274) = happyShift action_51 action_754 (275) = happyShift action_221 action_754 (276) = happyShift action_222 action_754 (277) = happyShift action_223 action_754 (280) = happyShift action_57 action_754 (281) = happyShift action_58 action_754 (282) = happyShift action_59 action_754 (283) = happyShift action_60 action_754 (286) = happyShift action_62 action_754 (299) = happyShift action_225 action_754 (300) = happyShift action_226 action_754 (321) = happyShift action_227 action_754 (328) = happyShift action_228 action_754 (332) = happyShift action_229 action_754 (334) = happyShift action_230 action_754 (336) = happyShift action_231 action_754 (338) = happyShift action_232 action_754 (345) = happyShift action_233 action_754 (346) = happyShift action_234 action_754 (347) = happyShift action_235 action_754 (351) = happyShift action_236 action_754 (355) = happyShift action_237 action_754 (356) = happyShift action_84 action_754 (358) = happyShift action_238 action_754 (359) = happyShift action_239 action_754 (376) = happyShift action_240 action_754 (377) = happyShift action_241 action_754 (379) = happyShift action_102 action_754 (380) = happyShift action_103 action_754 (95) = happyGoto action_801 action_754 (98) = happyGoto action_804 action_754 (100) = happyGoto action_208 action_754 (101) = happyGoto action_243 action_754 (103) = happyGoto action_244 action_754 (104) = happyGoto action_245 action_754 (106) = happyGoto action_246 action_754 (107) = happyGoto action_211 action_754 (142) = happyGoto action_212 action_754 (192) = happyGoto action_248 action_754 (202) = happyGoto action_213 action_754 (203) = happyGoto action_214 action_754 (205) = happyGoto action_215 action_754 (206) = happyGoto action_216 action_754 (215) = happyGoto action_217 action_754 (217) = happyGoto action_218 action_754 (227) = happyGoto action_219 action_754 _ = happyFail action_755 _ = happyReduce_179 action_756 (333) = happyShift action_803 action_756 _ = happyFail action_757 (245) = happyShift action_37 action_757 (253) = happyShift action_40 action_757 (265) = happyShift action_46 action_757 (270) = happyShift action_249 action_757 (272) = happyShift action_49 action_757 (273) = happyShift action_50 action_757 (274) = happyShift action_51 action_757 (275) = happyShift action_221 action_757 (276) = happyShift action_222 action_757 (277) = happyShift action_223 action_757 (280) = happyShift action_57 action_757 (281) = happyShift action_58 action_757 (282) = happyShift action_59 action_757 (283) = happyShift action_60 action_757 (286) = happyShift action_62 action_757 (299) = happyShift action_225 action_757 (300) = happyShift action_226 action_757 (321) = happyShift action_227 action_757 (328) = happyShift action_228 action_757 (332) = happyShift action_229 action_757 (334) = happyShift action_230 action_757 (336) = happyShift action_231 action_757 (338) = happyShift action_232 action_757 (345) = happyShift action_233 action_757 (346) = happyShift action_234 action_757 (347) = happyShift action_235 action_757 (351) = happyShift action_236 action_757 (355) = happyShift action_237 action_757 (356) = happyShift action_84 action_757 (358) = happyShift action_238 action_757 (359) = happyShift action_239 action_757 (376) = happyShift action_240 action_757 (377) = happyShift action_241 action_757 (379) = happyShift action_102 action_757 (380) = happyShift action_103 action_757 (95) = happyGoto action_801 action_757 (98) = happyGoto action_802 action_757 (100) = happyGoto action_208 action_757 (101) = happyGoto action_243 action_757 (103) = happyGoto action_244 action_757 (104) = happyGoto action_245 action_757 (106) = happyGoto action_246 action_757 (107) = happyGoto action_211 action_757 (142) = happyGoto action_212 action_757 (192) = happyGoto action_248 action_757 (202) = happyGoto action_213 action_757 (203) = happyGoto action_214 action_757 (205) = happyGoto action_215 action_757 (206) = happyGoto action_216 action_757 (215) = happyGoto action_217 action_757 (217) = happyGoto action_218 action_757 (227) = happyGoto action_219 action_757 _ = happyFail action_758 _ = happyReduce_361 action_759 _ = happyReduce_358 action_760 _ = happyReduce_383 action_761 _ = happyReduce_373 action_762 (244) = happyShift action_36 action_762 (245) = happyShift action_37 action_762 (246) = happyShift action_38 action_762 (251) = happyShift action_39 action_762 (253) = happyShift action_40 action_762 (254) = happyShift action_41 action_762 (261) = happyShift action_45 action_762 (265) = happyShift action_46 action_762 (269) = happyShift action_47 action_762 (270) = happyShift action_48 action_762 (272) = happyShift action_49 action_762 (273) = happyShift action_50 action_762 (274) = happyShift action_51 action_762 (275) = happyShift action_52 action_762 (276) = happyShift action_53 action_762 (277) = happyShift action_54 action_762 (278) = happyShift action_55 action_762 (279) = happyShift action_56 action_762 (280) = happyShift action_57 action_762 (281) = happyShift action_58 action_762 (282) = happyShift action_59 action_762 (283) = happyShift action_60 action_762 (284) = happyShift action_61 action_762 (286) = happyShift action_62 action_762 (294) = happyShift action_66 action_762 (295) = happyShift action_67 action_762 (296) = happyShift action_68 action_762 (311) = happyShift action_69 action_762 (317) = happyShift action_70 action_762 (320) = happyShift action_71 action_762 (332) = happyShift action_72 action_762 (334) = happyShift action_73 action_762 (336) = happyShift action_112 action_762 (338) = happyShift action_75 action_762 (340) = happyShift action_76 action_762 (345) = happyShift action_77 action_762 (346) = happyShift action_78 action_762 (347) = happyShift action_79 action_762 (350) = happyShift action_80 action_762 (351) = happyShift action_81 action_762 (354) = happyShift action_82 action_762 (355) = happyShift action_83 action_762 (356) = happyShift action_84 action_762 (357) = happyShift action_85 action_762 (358) = happyShift action_86 action_762 (359) = happyShift action_87 action_762 (360) = happyShift action_88 action_762 (361) = happyShift action_89 action_762 (362) = happyShift action_90 action_762 (363) = happyShift action_91 action_762 (364) = happyShift action_92 action_762 (365) = happyShift action_93 action_762 (366) = happyShift action_94 action_762 (371) = happyShift action_95 action_762 (372) = happyShift action_96 action_762 (373) = happyShift action_97 action_762 (374) = happyShift action_98 action_762 (376) = happyShift action_99 action_762 (377) = happyShift action_100 action_762 (378) = happyShift action_101 action_762 (379) = happyShift action_102 action_762 (380) = happyShift action_103 action_762 (38) = happyGoto action_13 action_762 (142) = happyGoto action_16 action_762 (143) = happyGoto action_800 action_762 (144) = happyGoto action_110 action_762 (145) = happyGoto action_18 action_762 (147) = happyGoto action_19 action_762 (148) = happyGoto action_20 action_762 (149) = happyGoto action_21 action_762 (150) = happyGoto action_22 action_762 (151) = happyGoto action_23 action_762 (152) = happyGoto action_24 action_762 (192) = happyGoto action_25 action_762 (195) = happyGoto action_26 action_762 (198) = happyGoto action_27 action_762 (219) = happyGoto action_29 action_762 (220) = happyGoto action_30 action_762 (221) = happyGoto action_111 action_762 (227) = happyGoto action_32 action_762 (229) = happyGoto action_33 action_762 (230) = happyGoto action_34 action_762 (233) = happyGoto action_35 action_762 _ = happyFail action_763 (244) = happyShift action_36 action_763 (245) = happyShift action_37 action_763 (246) = happyShift action_38 action_763 (251) = happyShift action_39 action_763 (253) = happyShift action_40 action_763 (254) = happyShift action_41 action_763 (261) = happyShift action_155 action_763 (265) = happyShift action_46 action_763 (269) = happyShift action_47 action_763 (270) = happyShift action_48 action_763 (272) = happyShift action_49 action_763 (273) = happyShift action_50 action_763 (274) = happyShift action_51 action_763 (275) = happyShift action_52 action_763 (276) = happyShift action_53 action_763 (277) = happyShift action_54 action_763 (278) = happyShift action_55 action_763 (279) = happyShift action_56 action_763 (280) = happyShift action_57 action_763 (281) = happyShift action_58 action_763 (282) = happyShift action_59 action_763 (283) = happyShift action_60 action_763 (284) = happyShift action_61 action_763 (286) = happyShift action_62 action_763 (294) = happyShift action_66 action_763 (295) = happyShift action_67 action_763 (296) = happyShift action_68 action_763 (311) = happyShift action_69 action_763 (317) = happyShift action_70 action_763 (320) = happyShift action_71 action_763 (321) = happyShift action_157 action_763 (332) = happyShift action_72 action_763 (334) = happyShift action_73 action_763 (336) = happyShift action_112 action_763 (338) = happyShift action_75 action_763 (340) = happyShift action_76 action_763 (345) = happyShift action_77 action_763 (346) = happyShift action_78 action_763 (347) = happyShift action_79 action_763 (350) = happyShift action_80 action_763 (351) = happyShift action_81 action_763 (354) = happyShift action_82 action_763 (355) = happyShift action_83 action_763 (356) = happyShift action_84 action_763 (357) = happyShift action_85 action_763 (358) = happyShift action_86 action_763 (359) = happyShift action_87 action_763 (360) = happyShift action_88 action_763 (361) = happyShift action_89 action_763 (362) = happyShift action_90 action_763 (363) = happyShift action_91 action_763 (364) = happyShift action_92 action_763 (365) = happyShift action_93 action_763 (366) = happyShift action_94 action_763 (371) = happyShift action_95 action_763 (372) = happyShift action_96 action_763 (373) = happyShift action_97 action_763 (374) = happyShift action_98 action_763 (376) = happyShift action_99 action_763 (377) = happyShift action_100 action_763 (378) = happyShift action_101 action_763 (379) = happyShift action_102 action_763 (380) = happyShift action_103 action_763 (38) = happyGoto action_13 action_763 (142) = happyGoto action_16 action_763 (143) = happyGoto action_151 action_763 (144) = happyGoto action_110 action_763 (145) = happyGoto action_18 action_763 (147) = happyGoto action_19 action_763 (148) = happyGoto action_20 action_763 (149) = happyGoto action_21 action_763 (150) = happyGoto action_22 action_763 (151) = happyGoto action_23 action_763 (152) = happyGoto action_24 action_763 (178) = happyGoto action_152 action_763 (186) = happyGoto action_799 action_763 (192) = happyGoto action_25 action_763 (195) = happyGoto action_26 action_763 (198) = happyGoto action_27 action_763 (219) = happyGoto action_29 action_763 (220) = happyGoto action_30 action_763 (221) = happyGoto action_111 action_763 (227) = happyGoto action_32 action_763 (229) = happyGoto action_33 action_763 (230) = happyGoto action_34 action_763 (233) = happyGoto action_35 action_763 _ = happyFail action_764 (244) = happyShift action_36 action_764 (245) = happyShift action_37 action_764 (246) = happyShift action_38 action_764 (251) = happyShift action_39 action_764 (253) = happyShift action_40 action_764 (254) = happyShift action_41 action_764 (261) = happyShift action_45 action_764 (265) = happyShift action_46 action_764 (269) = happyShift action_47 action_764 (270) = happyShift action_48 action_764 (272) = happyShift action_49 action_764 (273) = happyShift action_50 action_764 (274) = happyShift action_51 action_764 (275) = happyShift action_52 action_764 (276) = happyShift action_53 action_764 (277) = happyShift action_54 action_764 (278) = happyShift action_55 action_764 (279) = happyShift action_56 action_764 (280) = happyShift action_57 action_764 (281) = happyShift action_58 action_764 (282) = happyShift action_59 action_764 (283) = happyShift action_60 action_764 (284) = happyShift action_61 action_764 (286) = happyShift action_62 action_764 (294) = happyShift action_66 action_764 (295) = happyShift action_67 action_764 (296) = happyShift action_68 action_764 (311) = happyShift action_69 action_764 (317) = happyShift action_70 action_764 (320) = happyShift action_71 action_764 (332) = happyShift action_72 action_764 (334) = happyShift action_73 action_764 (336) = happyShift action_112 action_764 (338) = happyShift action_75 action_764 (340) = happyShift action_76 action_764 (345) = happyShift action_77 action_764 (346) = happyShift action_78 action_764 (347) = happyShift action_79 action_764 (350) = happyShift action_80 action_764 (351) = happyShift action_81 action_764 (354) = happyShift action_82 action_764 (355) = happyShift action_83 action_764 (356) = happyShift action_84 action_764 (357) = happyShift action_85 action_764 (358) = happyShift action_86 action_764 (359) = happyShift action_87 action_764 (360) = happyShift action_88 action_764 (361) = happyShift action_89 action_764 (362) = happyShift action_90 action_764 (363) = happyShift action_91 action_764 (364) = happyShift action_92 action_764 (365) = happyShift action_93 action_764 (366) = happyShift action_94 action_764 (371) = happyShift action_95 action_764 (372) = happyShift action_96 action_764 (373) = happyShift action_97 action_764 (374) = happyShift action_98 action_764 (376) = happyShift action_99 action_764 (377) = happyShift action_100 action_764 (378) = happyShift action_101 action_764 (379) = happyShift action_102 action_764 (380) = happyShift action_103 action_764 (38) = happyGoto action_13 action_764 (142) = happyGoto action_16 action_764 (143) = happyGoto action_798 action_764 (144) = happyGoto action_110 action_764 (145) = happyGoto action_18 action_764 (147) = happyGoto action_19 action_764 (148) = happyGoto action_20 action_764 (149) = happyGoto action_21 action_764 (150) = happyGoto action_22 action_764 (151) = happyGoto action_23 action_764 (152) = happyGoto action_24 action_764 (192) = happyGoto action_25 action_764 (195) = happyGoto action_26 action_764 (198) = happyGoto action_27 action_764 (219) = happyGoto action_29 action_764 (220) = happyGoto action_30 action_764 (221) = happyGoto action_111 action_764 (227) = happyGoto action_32 action_764 (229) = happyGoto action_33 action_764 (230) = happyGoto action_34 action_764 (233) = happyGoto action_35 action_764 _ = happyFail action_765 _ = happyReduce_377 action_766 (245) = happyShift action_37 action_766 (253) = happyShift action_40 action_766 (265) = happyShift action_46 action_766 (270) = happyShift action_385 action_766 (272) = happyShift action_49 action_766 (273) = happyShift action_50 action_766 (274) = happyShift action_51 action_766 (275) = happyShift action_221 action_766 (276) = happyShift action_222 action_766 (277) = happyShift action_223 action_766 (280) = happyShift action_57 action_766 (281) = happyShift action_58 action_766 (282) = happyShift action_59 action_766 (283) = happyShift action_60 action_766 (286) = happyShift action_62 action_766 (299) = happyShift action_225 action_766 (300) = happyShift action_226 action_766 (321) = happyShift action_227 action_766 (328) = happyShift action_228 action_766 (332) = happyShift action_229 action_766 (334) = happyShift action_230 action_766 (336) = happyShift action_231 action_766 (338) = happyShift action_232 action_766 (345) = happyShift action_233 action_766 (346) = happyShift action_234 action_766 (347) = happyShift action_235 action_766 (351) = happyShift action_236 action_766 (355) = happyShift action_237 action_766 (356) = happyShift action_84 action_766 (358) = happyShift action_238 action_766 (359) = happyShift action_239 action_766 (376) = happyShift action_240 action_766 (377) = happyShift action_241 action_766 (379) = happyShift action_102 action_766 (380) = happyShift action_103 action_766 (96) = happyGoto action_797 action_766 (100) = happyGoto action_208 action_766 (102) = happyGoto action_380 action_766 (103) = happyGoto action_381 action_766 (105) = happyGoto action_382 action_766 (106) = happyGoto action_383 action_766 (107) = happyGoto action_211 action_766 (142) = happyGoto action_212 action_766 (192) = happyGoto action_384 action_766 (202) = happyGoto action_213 action_766 (203) = happyGoto action_214 action_766 (205) = happyGoto action_215 action_766 (206) = happyGoto action_216 action_766 (215) = happyGoto action_217 action_766 (217) = happyGoto action_218 action_766 (227) = happyGoto action_219 action_766 _ = happyFail action_767 (245) = happyShift action_37 action_767 (253) = happyShift action_40 action_767 (265) = happyShift action_46 action_767 (270) = happyShift action_48 action_767 (272) = happyShift action_49 action_767 (273) = happyShift action_50 action_767 (274) = happyShift action_51 action_767 (275) = happyShift action_52 action_767 (276) = happyShift action_53 action_767 (277) = happyShift action_54 action_767 (279) = happyShift action_56 action_767 (280) = happyShift action_57 action_767 (281) = happyShift action_58 action_767 (282) = happyShift action_59 action_767 (283) = happyShift action_60 action_767 (286) = happyShift action_62 action_767 (336) = happyShift action_393 action_767 (346) = happyShift action_78 action_767 (218) = happyGoto action_796 action_767 (221) = happyGoto action_188 action_767 (227) = happyGoto action_32 action_767 _ = happyFail action_768 (244) = happyShift action_36 action_768 (245) = happyShift action_37 action_768 (246) = happyShift action_38 action_768 (251) = happyShift action_39 action_768 (253) = happyShift action_40 action_768 (254) = happyShift action_41 action_768 (261) = happyShift action_45 action_768 (265) = happyShift action_46 action_768 (269) = happyShift action_47 action_768 (270) = happyShift action_48 action_768 (272) = happyShift action_49 action_768 (273) = happyShift action_50 action_768 (274) = happyShift action_51 action_768 (275) = happyShift action_52 action_768 (276) = happyShift action_53 action_768 (277) = happyShift action_54 action_768 (278) = happyShift action_55 action_768 (279) = happyShift action_56 action_768 (280) = happyShift action_57 action_768 (281) = happyShift action_58 action_768 (282) = happyShift action_59 action_768 (283) = happyShift action_60 action_768 (284) = happyShift action_61 action_768 (286) = happyShift action_62 action_768 (294) = happyShift action_66 action_768 (295) = happyShift action_67 action_768 (296) = happyShift action_68 action_768 (308) = happyShift action_267 action_768 (311) = happyShift action_69 action_768 (317) = happyShift action_70 action_768 (320) = happyShift action_71 action_768 (321) = happyShift action_270 action_768 (322) = happyShift action_271 action_768 (327) = happyShift action_272 action_768 (332) = happyShift action_72 action_768 (334) = happyShift action_73 action_768 (336) = happyShift action_112 action_768 (338) = happyShift action_75 action_768 (340) = happyShift action_76 action_768 (344) = happyShift action_297 action_768 (345) = happyShift action_77 action_768 (346) = happyShift action_78 action_768 (347) = happyShift action_79 action_768 (348) = happyShift action_274 action_768 (349) = happyShift action_275 action_768 (350) = happyShift action_80 action_768 (351) = happyShift action_81 action_768 (352) = happyShift action_276 action_768 (353) = happyShift action_277 action_768 (354) = happyShift action_82 action_768 (355) = happyShift action_83 action_768 (356) = happyShift action_84 action_768 (357) = happyShift action_85 action_768 (358) = happyShift action_86 action_768 (359) = happyShift action_87 action_768 (360) = happyShift action_88 action_768 (361) = happyShift action_89 action_768 (362) = happyShift action_90 action_768 (363) = happyShift action_91 action_768 (364) = happyShift action_92 action_768 (365) = happyShift action_93 action_768 (366) = happyShift action_94 action_768 (371) = happyShift action_95 action_768 (372) = happyShift action_96 action_768 (373) = happyShift action_97 action_768 (374) = happyShift action_98 action_768 (376) = happyShift action_99 action_768 (377) = happyShift action_100 action_768 (378) = happyShift action_101 action_768 (379) = happyShift action_102 action_768 (380) = happyShift action_103 action_768 (38) = happyGoto action_13 action_768 (142) = happyGoto action_16 action_768 (143) = happyGoto action_281 action_768 (144) = happyGoto action_282 action_768 (145) = happyGoto action_18 action_768 (147) = happyGoto action_19 action_768 (148) = happyGoto action_20 action_768 (149) = happyGoto action_21 action_768 (150) = happyGoto action_22 action_768 (151) = happyGoto action_23 action_768 (152) = happyGoto action_24 action_768 (157) = happyGoto action_795 action_768 (192) = happyGoto action_25 action_768 (195) = happyGoto action_26 action_768 (198) = happyGoto action_27 action_768 (200) = happyGoto action_285 action_768 (212) = happyGoto action_286 action_768 (214) = happyGoto action_287 action_768 (219) = happyGoto action_29 action_768 (220) = happyGoto action_30 action_768 (221) = happyGoto action_111 action_768 (223) = happyGoto action_288 action_768 (224) = happyGoto action_325 action_768 (226) = happyGoto action_326 action_768 (227) = happyGoto action_32 action_768 (228) = happyGoto action_264 action_768 (229) = happyGoto action_33 action_768 (230) = happyGoto action_34 action_768 (231) = happyGoto action_265 action_768 (232) = happyGoto action_266 action_768 (233) = happyGoto action_35 action_768 _ = happyFail action_769 (245) = happyShift action_37 action_769 (253) = happyShift action_40 action_769 (265) = happyShift action_46 action_769 (270) = happyShift action_48 action_769 (272) = happyShift action_49 action_769 (273) = happyShift action_50 action_769 (274) = happyShift action_51 action_769 (275) = happyShift action_52 action_769 (276) = happyShift action_53 action_769 (277) = happyShift action_54 action_769 (279) = happyShift action_56 action_769 (280) = happyShift action_57 action_769 (281) = happyShift action_58 action_769 (282) = happyShift action_59 action_769 (283) = happyShift action_60 action_769 (286) = happyShift action_62 action_769 (307) = happyShift action_390 action_769 (336) = happyShift action_177 action_769 (346) = happyShift action_78 action_769 (350) = happyShift action_80 action_769 (354) = happyShift action_82 action_769 (188) = happyGoto action_794 action_769 (189) = happyGoto action_388 action_769 (219) = happyGoto action_389 action_769 (220) = happyGoto action_30 action_769 (221) = happyGoto action_111 action_769 (227) = happyGoto action_32 action_769 _ = happyFail action_770 _ = happyReduce_397 action_771 (327) = happyShift action_793 action_771 _ = happyFail action_772 (245) = happyShift action_37 action_772 (253) = happyShift action_40 action_772 (265) = happyShift action_46 action_772 (272) = happyShift action_49 action_772 (273) = happyShift action_50 action_772 (274) = happyShift action_51 action_772 (275) = happyShift action_221 action_772 (276) = happyShift action_222 action_772 (277) = happyShift action_223 action_772 (280) = happyShift action_57 action_772 (281) = happyShift action_58 action_772 (282) = happyShift action_59 action_772 (283) = happyShift action_60 action_772 (286) = happyShift action_62 action_772 (299) = happyShift action_225 action_772 (300) = happyShift action_226 action_772 (321) = happyShift action_227 action_772 (328) = happyShift action_228 action_772 (332) = happyShift action_229 action_772 (334) = happyShift action_230 action_772 (336) = happyShift action_231 action_772 (338) = happyShift action_232 action_772 (345) = happyShift action_233 action_772 (346) = happyShift action_234 action_772 (347) = happyShift action_235 action_772 (351) = happyShift action_236 action_772 (355) = happyShift action_237 action_772 (358) = happyShift action_238 action_772 (359) = happyShift action_239 action_772 (376) = happyShift action_240 action_772 (377) = happyShift action_241 action_772 (379) = happyShift action_102 action_772 (380) = happyShift action_103 action_772 (100) = happyGoto action_208 action_772 (104) = happyGoto action_792 action_772 (106) = happyGoto action_210 action_772 (107) = happyGoto action_211 action_772 (142) = happyGoto action_212 action_772 (202) = happyGoto action_213 action_772 (203) = happyGoto action_214 action_772 (205) = happyGoto action_215 action_772 (206) = happyGoto action_216 action_772 (215) = happyGoto action_217 action_772 (217) = happyGoto action_218 action_772 (227) = happyGoto action_219 action_772 _ = happyFail action_773 (245) = happyShift action_37 action_773 (253) = happyShift action_40 action_773 (265) = happyShift action_46 action_773 (272) = happyShift action_49 action_773 (273) = happyShift action_50 action_773 (274) = happyShift action_51 action_773 (275) = happyShift action_221 action_773 (276) = happyShift action_222 action_773 (277) = happyShift action_223 action_773 (280) = happyShift action_57 action_773 (281) = happyShift action_58 action_773 (282) = happyShift action_59 action_773 (283) = happyShift action_60 action_773 (286) = happyShift action_62 action_773 (299) = happyShift action_225 action_773 (300) = happyShift action_226 action_773 (321) = happyShift action_227 action_773 (328) = happyShift action_228 action_773 (332) = happyShift action_229 action_773 (334) = happyShift action_230 action_773 (336) = happyShift action_231 action_773 (338) = happyShift action_232 action_773 (345) = happyShift action_233 action_773 (346) = happyShift action_234 action_773 (347) = happyShift action_235 action_773 (351) = happyShift action_236 action_773 (355) = happyShift action_237 action_773 (358) = happyShift action_238 action_773 (359) = happyShift action_239 action_773 (376) = happyShift action_240 action_773 (377) = happyShift action_241 action_773 (379) = happyShift action_102 action_773 (380) = happyShift action_103 action_773 (100) = happyGoto action_208 action_773 (104) = happyGoto action_791 action_773 (106) = happyGoto action_210 action_773 (107) = happyGoto action_211 action_773 (142) = happyGoto action_212 action_773 (202) = happyGoto action_213 action_773 (203) = happyGoto action_214 action_773 (205) = happyGoto action_215 action_773 (206) = happyGoto action_216 action_773 (215) = happyGoto action_217 action_773 (217) = happyGoto action_218 action_773 (227) = happyGoto action_219 action_773 _ = happyFail action_774 (245) = happyShift action_37 action_774 (253) = happyShift action_40 action_774 (265) = happyShift action_46 action_774 (272) = happyShift action_49 action_774 (273) = happyShift action_50 action_774 (274) = happyShift action_51 action_774 (275) = happyShift action_221 action_774 (276) = happyShift action_222 action_774 (277) = happyShift action_223 action_774 (280) = happyShift action_57 action_774 (281) = happyShift action_58 action_774 (282) = happyShift action_59 action_774 (283) = happyShift action_60 action_774 (286) = happyShift action_62 action_774 (299) = happyShift action_225 action_774 (300) = happyShift action_226 action_774 (321) = happyShift action_227 action_774 (328) = happyShift action_228 action_774 (332) = happyShift action_229 action_774 (334) = happyShift action_230 action_774 (336) = happyShift action_231 action_774 (338) = happyShift action_232 action_774 (345) = happyShift action_233 action_774 (346) = happyShift action_234 action_774 (347) = happyShift action_235 action_774 (351) = happyShift action_236 action_774 (355) = happyShift action_237 action_774 (358) = happyShift action_238 action_774 (359) = happyShift action_239 action_774 (376) = happyShift action_240 action_774 (377) = happyShift action_241 action_774 (379) = happyShift action_102 action_774 (380) = happyShift action_103 action_774 (100) = happyGoto action_208 action_774 (104) = happyGoto action_790 action_774 (106) = happyGoto action_210 action_774 (107) = happyGoto action_211 action_774 (142) = happyGoto action_212 action_774 (202) = happyGoto action_213 action_774 (203) = happyGoto action_214 action_774 (205) = happyGoto action_215 action_774 (206) = happyGoto action_216 action_774 (215) = happyGoto action_217 action_774 (217) = happyGoto action_218 action_774 (227) = happyGoto action_219 action_774 _ = happyFail action_775 (245) = happyShift action_37 action_775 (253) = happyShift action_40 action_775 (265) = happyShift action_46 action_775 (270) = happyShift action_385 action_775 (272) = happyShift action_49 action_775 (273) = happyShift action_50 action_775 (274) = happyShift action_51 action_775 (275) = happyShift action_221 action_775 (276) = happyShift action_222 action_775 (277) = happyShift action_223 action_775 (280) = happyShift action_57 action_775 (281) = happyShift action_58 action_775 (282) = happyShift action_59 action_775 (283) = happyShift action_60 action_775 (286) = happyShift action_62 action_775 (299) = happyShift action_225 action_775 (300) = happyShift action_226 action_775 (321) = happyShift action_227 action_775 (328) = happyShift action_228 action_775 (332) = happyShift action_229 action_775 (334) = happyShift action_230 action_775 (336) = happyShift action_231 action_775 (338) = happyShift action_232 action_775 (345) = happyShift action_233 action_775 (346) = happyShift action_234 action_775 (347) = happyShift action_235 action_775 (351) = happyShift action_236 action_775 (355) = happyShift action_237 action_775 (356) = happyShift action_84 action_775 (358) = happyShift action_238 action_775 (359) = happyShift action_239 action_775 (376) = happyShift action_240 action_775 (377) = happyShift action_241 action_775 (379) = happyShift action_102 action_775 (380) = happyShift action_103 action_775 (100) = happyGoto action_208 action_775 (102) = happyGoto action_789 action_775 (103) = happyGoto action_381 action_775 (105) = happyGoto action_382 action_775 (106) = happyGoto action_383 action_775 (107) = happyGoto action_211 action_775 (142) = happyGoto action_212 action_775 (192) = happyGoto action_384 action_775 (202) = happyGoto action_213 action_775 (203) = happyGoto action_214 action_775 (205) = happyGoto action_215 action_775 (206) = happyGoto action_216 action_775 (215) = happyGoto action_217 action_775 (217) = happyGoto action_218 action_775 (227) = happyGoto action_219 action_775 _ = happyFail action_776 (245) = happyShift action_37 action_776 (253) = happyShift action_40 action_776 (265) = happyShift action_46 action_776 (272) = happyShift action_49 action_776 (273) = happyShift action_50 action_776 (274) = happyShift action_51 action_776 (275) = happyShift action_221 action_776 (276) = happyShift action_222 action_776 (277) = happyShift action_223 action_776 (280) = happyShift action_57 action_776 (281) = happyShift action_58 action_776 (282) = happyShift action_59 action_776 (283) = happyShift action_60 action_776 (286) = happyShift action_62 action_776 (299) = happyShift action_225 action_776 (300) = happyShift action_226 action_776 (321) = happyShift action_227 action_776 (328) = happyShift action_228 action_776 (332) = happyShift action_229 action_776 (334) = happyShift action_230 action_776 (336) = happyShift action_231 action_776 (338) = happyShift action_232 action_776 (345) = happyShift action_233 action_776 (346) = happyShift action_234 action_776 (347) = happyShift action_235 action_776 (351) = happyShift action_236 action_776 (355) = happyShift action_237 action_776 (358) = happyShift action_238 action_776 (359) = happyShift action_239 action_776 (376) = happyShift action_240 action_776 (377) = happyShift action_241 action_776 (379) = happyShift action_102 action_776 (380) = happyShift action_103 action_776 (100) = happyGoto action_208 action_776 (106) = happyGoto action_788 action_776 (107) = happyGoto action_211 action_776 (142) = happyGoto action_212 action_776 (202) = happyGoto action_213 action_776 (203) = happyGoto action_214 action_776 (205) = happyGoto action_215 action_776 (206) = happyGoto action_216 action_776 (215) = happyGoto action_217 action_776 (217) = happyGoto action_218 action_776 (227) = happyGoto action_219 action_776 _ = happyFail action_777 (308) = happyShift action_267 action_777 (320) = happyShift action_269 action_777 (321) = happyShift action_270 action_777 (322) = happyShift action_271 action_777 (327) = happyShift action_272 action_777 (332) = happyShift action_529 action_777 (336) = happyShift action_530 action_777 (344) = happyShift action_664 action_777 (347) = happyShift action_79 action_777 (348) = happyShift action_274 action_777 (349) = happyShift action_275 action_777 (351) = happyShift action_81 action_777 (353) = happyShift action_277 action_777 (355) = happyShift action_83 action_777 (200) = happyGoto action_786 action_777 (210) = happyGoto action_787 action_777 (225) = happyGoto action_376 action_777 (226) = happyGoto action_263 action_777 (228) = happyGoto action_264 action_777 (229) = happyGoto action_528 action_777 (230) = happyGoto action_34 action_777 (231) = happyGoto action_265 action_777 (232) = happyGoto action_266 action_777 _ = happyFail action_778 (245) = happyShift action_37 action_778 (253) = happyShift action_40 action_778 (265) = happyShift action_46 action_778 (270) = happyShift action_385 action_778 (272) = happyShift action_49 action_778 (273) = happyShift action_50 action_778 (274) = happyShift action_51 action_778 (275) = happyShift action_221 action_778 (276) = happyShift action_222 action_778 (277) = happyShift action_223 action_778 (280) = happyShift action_57 action_778 (281) = happyShift action_58 action_778 (282) = happyShift action_59 action_778 (283) = happyShift action_60 action_778 (286) = happyShift action_62 action_778 (299) = happyShift action_225 action_778 (300) = happyShift action_226 action_778 (321) = happyShift action_227 action_778 (328) = happyShift action_228 action_778 (332) = happyShift action_229 action_778 (334) = happyShift action_230 action_778 (336) = happyShift action_231 action_778 (338) = happyShift action_232 action_778 (345) = happyShift action_233 action_778 (346) = happyShift action_234 action_778 (347) = happyShift action_235 action_778 (351) = happyShift action_236 action_778 (355) = happyShift action_237 action_778 (356) = happyShift action_84 action_778 (358) = happyShift action_238 action_778 (359) = happyShift action_239 action_778 (376) = happyShift action_240 action_778 (377) = happyShift action_241 action_778 (379) = happyShift action_102 action_778 (380) = happyShift action_103 action_778 (100) = happyGoto action_208 action_778 (102) = happyGoto action_785 action_778 (103) = happyGoto action_381 action_778 (105) = happyGoto action_382 action_778 (106) = happyGoto action_383 action_778 (107) = happyGoto action_211 action_778 (142) = happyGoto action_212 action_778 (192) = happyGoto action_384 action_778 (202) = happyGoto action_213 action_778 (203) = happyGoto action_214 action_778 (205) = happyGoto action_215 action_778 (206) = happyGoto action_216 action_778 (215) = happyGoto action_217 action_778 (217) = happyGoto action_218 action_778 (227) = happyGoto action_219 action_778 _ = happyFail action_779 (344) = happyShift action_784 action_779 _ = happyFail action_780 (344) = happyShift action_783 action_780 _ = happyFail action_781 (308) = happyShift action_267 action_781 (320) = happyShift action_269 action_781 (321) = happyShift action_270 action_781 (322) = happyShift action_271 action_781 (327) = happyShift action_272 action_781 (344) = happyShift action_378 action_781 (348) = happyShift action_274 action_781 (349) = happyShift action_275 action_781 (199) = happyGoto action_373 action_781 (209) = happyGoto action_782 action_781 (210) = happyGoto action_375 action_781 (225) = happyGoto action_376 action_781 (226) = happyGoto action_263 action_781 (228) = happyGoto action_264 action_781 (232) = happyGoto action_377 action_781 _ = happyFail action_782 _ = happyReduce_89 action_783 _ = happyReduce_533 action_784 _ = happyReduce_564 action_785 _ = happyReduce_236 action_786 (245) = happyShift action_37 action_786 (253) = happyShift action_40 action_786 (265) = happyShift action_46 action_786 (272) = happyShift action_49 action_786 (273) = happyShift action_50 action_786 (274) = happyShift action_51 action_786 (275) = happyShift action_221 action_786 (276) = happyShift action_222 action_786 (277) = happyShift action_223 action_786 (280) = happyShift action_57 action_786 (281) = happyShift action_58 action_786 (282) = happyShift action_59 action_786 (283) = happyShift action_60 action_786 (286) = happyShift action_62 action_786 (299) = happyShift action_225 action_786 (300) = happyShift action_226 action_786 (321) = happyShift action_227 action_786 (328) = happyShift action_228 action_786 (332) = happyShift action_229 action_786 (334) = happyShift action_230 action_786 (336) = happyShift action_231 action_786 (338) = happyShift action_232 action_786 (345) = happyShift action_233 action_786 (346) = happyShift action_234 action_786 (347) = happyShift action_235 action_786 (351) = happyShift action_236 action_786 (355) = happyShift action_237 action_786 (358) = happyShift action_238 action_786 (359) = happyShift action_239 action_786 (376) = happyShift action_240 action_786 (377) = happyShift action_241 action_786 (379) = happyShift action_102 action_786 (380) = happyShift action_103 action_786 (100) = happyGoto action_208 action_786 (104) = happyGoto action_987 action_786 (106) = happyGoto action_210 action_786 (107) = happyGoto action_211 action_786 (142) = happyGoto action_212 action_786 (202) = happyGoto action_213 action_786 (203) = happyGoto action_214 action_786 (205) = happyGoto action_215 action_786 (206) = happyGoto action_216 action_786 (215) = happyGoto action_217 action_786 (217) = happyGoto action_218 action_786 (227) = happyGoto action_219 action_786 _ = happyFail action_787 (245) = happyShift action_37 action_787 (253) = happyShift action_40 action_787 (265) = happyShift action_46 action_787 (272) = happyShift action_49 action_787 (273) = happyShift action_50 action_787 (274) = happyShift action_51 action_787 (275) = happyShift action_221 action_787 (276) = happyShift action_222 action_787 (277) = happyShift action_223 action_787 (280) = happyShift action_57 action_787 (281) = happyShift action_58 action_787 (282) = happyShift action_59 action_787 (283) = happyShift action_60 action_787 (286) = happyShift action_62 action_787 (299) = happyShift action_225 action_787 (300) = happyShift action_226 action_787 (321) = happyShift action_227 action_787 (328) = happyShift action_228 action_787 (332) = happyShift action_229 action_787 (334) = happyShift action_230 action_787 (336) = happyShift action_231 action_787 (338) = happyShift action_232 action_787 (345) = happyShift action_233 action_787 (346) = happyShift action_234 action_787 (347) = happyShift action_235 action_787 (351) = happyShift action_236 action_787 (355) = happyShift action_237 action_787 (358) = happyShift action_238 action_787 (359) = happyShift action_239 action_787 (376) = happyShift action_240 action_787 (377) = happyShift action_241 action_787 (379) = happyShift action_102 action_787 (380) = happyShift action_103 action_787 (100) = happyGoto action_208 action_787 (104) = happyGoto action_986 action_787 (106) = happyGoto action_210 action_787 (107) = happyGoto action_211 action_787 (142) = happyGoto action_212 action_787 (202) = happyGoto action_213 action_787 (203) = happyGoto action_214 action_787 (205) = happyGoto action_215 action_787 (206) = happyGoto action_216 action_787 (215) = happyGoto action_217 action_787 (217) = happyGoto action_218 action_787 (227) = happyGoto action_219 action_787 _ = happyFail action_788 (245) = happyShift action_37 action_788 (253) = happyShift action_40 action_788 (265) = happyShift action_46 action_788 (272) = happyShift action_49 action_788 (273) = happyShift action_50 action_788 (274) = happyShift action_51 action_788 (275) = happyShift action_221 action_788 (276) = happyShift action_222 action_788 (277) = happyShift action_223 action_788 (280) = happyShift action_57 action_788 (281) = happyShift action_58 action_788 (282) = happyShift action_59 action_788 (283) = happyShift action_60 action_788 (286) = happyShift action_62 action_788 (299) = happyShift action_225 action_788 (300) = happyShift action_226 action_788 (319) = happyReduce_239 action_788 (321) = happyShift action_227 action_788 (328) = happyShift action_228 action_788 (332) = happyShift action_229 action_788 (334) = happyShift action_230 action_788 (336) = happyShift action_231 action_788 (338) = happyShift action_232 action_788 (345) = happyShift action_233 action_788 (346) = happyShift action_234 action_788 (347) = happyShift action_235 action_788 (351) = happyShift action_236 action_788 (355) = happyShift action_237 action_788 (358) = happyShift action_238 action_788 (359) = happyShift action_239 action_788 (376) = happyShift action_240 action_788 (377) = happyShift action_241 action_788 (379) = happyShift action_102 action_788 (380) = happyShift action_103 action_788 (100) = happyGoto action_208 action_788 (107) = happyGoto action_517 action_788 (142) = happyGoto action_212 action_788 (202) = happyGoto action_213 action_788 (203) = happyGoto action_214 action_788 (205) = happyGoto action_215 action_788 (206) = happyGoto action_216 action_788 (215) = happyGoto action_217 action_788 (217) = happyGoto action_218 action_788 (227) = happyGoto action_219 action_788 _ = happyReduce_256 action_789 _ = happyReduce_254 action_790 (368) = happyShift action_146 action_790 (238) = happyGoto action_944 action_790 _ = happyReduce_252 action_791 (368) = happyShift action_146 action_791 (238) = happyGoto action_943 action_791 _ = happyReduce_250 action_792 _ = happyReduce_237 action_793 (245) = happyShift action_37 action_793 (253) = happyShift action_40 action_793 (265) = happyShift action_46 action_793 (270) = happyShift action_385 action_793 (272) = happyShift action_49 action_793 (273) = happyShift action_50 action_793 (274) = happyShift action_51 action_793 (275) = happyShift action_221 action_793 (276) = happyShift action_222 action_793 (277) = happyShift action_223 action_793 (280) = happyShift action_57 action_793 (281) = happyShift action_58 action_793 (282) = happyShift action_59 action_793 (283) = happyShift action_60 action_793 (286) = happyShift action_62 action_793 (299) = happyShift action_225 action_793 (300) = happyShift action_226 action_793 (321) = happyShift action_227 action_793 (328) = happyShift action_228 action_793 (332) = happyShift action_229 action_793 (334) = happyShift action_230 action_793 (336) = happyShift action_231 action_793 (338) = happyShift action_232 action_793 (345) = happyShift action_233 action_793 (346) = happyShift action_234 action_793 (347) = happyShift action_235 action_793 (351) = happyShift action_236 action_793 (355) = happyShift action_237 action_793 (356) = happyShift action_84 action_793 (358) = happyShift action_238 action_793 (359) = happyShift action_239 action_793 (376) = happyShift action_240 action_793 (377) = happyShift action_241 action_793 (379) = happyShift action_102 action_793 (380) = happyShift action_103 action_793 (100) = happyGoto action_208 action_793 (102) = happyGoto action_942 action_793 (103) = happyGoto action_381 action_793 (105) = happyGoto action_382 action_793 (106) = happyGoto action_383 action_793 (107) = happyGoto action_211 action_793 (142) = happyGoto action_212 action_793 (192) = happyGoto action_384 action_793 (202) = happyGoto action_213 action_793 (203) = happyGoto action_214 action_793 (205) = happyGoto action_215 action_793 (206) = happyGoto action_216 action_793 (215) = happyGoto action_217 action_793 (217) = happyGoto action_218 action_793 (227) = happyGoto action_219 action_793 _ = happyFail action_794 _ = happyReduce_505 action_795 _ = happyReduce_508 action_796 _ = happyReduce_222 action_797 _ = happyReduce_356 action_798 _ = happyReduce_482 action_799 _ = happyReduce_467 action_800 (342) = happyShift action_401 action_800 (146) = happyGoto action_985 action_800 _ = happyReduce_387 action_801 (343) = happyShift action_984 action_801 _ = happyReduce_224 action_802 (306) = happyShift action_983 action_802 _ = happyFail action_803 _ = happyReduce_180 action_804 (306) = happyShift action_982 action_804 _ = happyFail action_805 (320) = happyShift action_981 action_805 _ = happyFail action_806 _ = happyReduce_469 action_807 _ = happyReduce_472 action_808 (313) = happyShift action_360 action_808 (315) = happyShift action_980 action_808 (174) = happyGoto action_977 action_808 (175) = happyGoto action_978 action_808 (176) = happyGoto action_979 action_808 (177) = happyGoto action_359 action_808 _ = happyFail action_809 (245) = happyShift action_37 action_809 (253) = happyShift action_40 action_809 (265) = happyShift action_46 action_809 (270) = happyShift action_249 action_809 (272) = happyShift action_49 action_809 (273) = happyShift action_50 action_809 (274) = happyShift action_51 action_809 (275) = happyShift action_221 action_809 (276) = happyShift action_222 action_809 (277) = happyShift action_223 action_809 (280) = happyShift action_57 action_809 (281) = happyShift action_58 action_809 (282) = happyShift action_59 action_809 (283) = happyShift action_60 action_809 (286) = happyShift action_62 action_809 (299) = happyShift action_225 action_809 (300) = happyShift action_226 action_809 (321) = happyShift action_227 action_809 (328) = happyShift action_228 action_809 (332) = happyShift action_229 action_809 (334) = happyShift action_230 action_809 (336) = happyShift action_231 action_809 (338) = happyShift action_232 action_809 (345) = happyShift action_233 action_809 (346) = happyShift action_234 action_809 (347) = happyShift action_235 action_809 (351) = happyShift action_236 action_809 (355) = happyShift action_237 action_809 (356) = happyShift action_84 action_809 (358) = happyShift action_238 action_809 (359) = happyShift action_239 action_809 (376) = happyShift action_240 action_809 (377) = happyShift action_241 action_809 (379) = happyShift action_102 action_809 (380) = happyShift action_103 action_809 (95) = happyGoto action_491 action_809 (100) = happyGoto action_208 action_809 (101) = happyGoto action_243 action_809 (103) = happyGoto action_244 action_809 (104) = happyGoto action_245 action_809 (106) = happyGoto action_246 action_809 (107) = happyGoto action_211 action_809 (142) = happyGoto action_212 action_809 (192) = happyGoto action_248 action_809 (202) = happyGoto action_213 action_809 (203) = happyGoto action_214 action_809 (205) = happyGoto action_215 action_809 (206) = happyGoto action_216 action_809 (215) = happyGoto action_217 action_809 (217) = happyGoto action_218 action_809 (227) = happyGoto action_219 action_809 _ = happyFail action_810 (244) = happyShift action_36 action_810 (245) = happyShift action_37 action_810 (246) = happyShift action_38 action_810 (251) = happyShift action_39 action_810 (253) = happyShift action_40 action_810 (254) = happyShift action_41 action_810 (261) = happyShift action_45 action_810 (265) = happyShift action_46 action_810 (269) = happyShift action_47 action_810 (270) = happyShift action_48 action_810 (272) = happyShift action_49 action_810 (273) = happyShift action_50 action_810 (274) = happyShift action_51 action_810 (275) = happyShift action_52 action_810 (276) = happyShift action_53 action_810 (277) = happyShift action_54 action_810 (278) = happyShift action_55 action_810 (279) = happyShift action_56 action_810 (280) = happyShift action_57 action_810 (281) = happyShift action_58 action_810 (282) = happyShift action_59 action_810 (283) = happyShift action_60 action_810 (284) = happyShift action_61 action_810 (286) = happyShift action_62 action_810 (294) = happyShift action_66 action_810 (295) = happyShift action_67 action_810 (296) = happyShift action_68 action_810 (311) = happyShift action_69 action_810 (317) = happyShift action_70 action_810 (320) = happyShift action_71 action_810 (321) = happyShift action_157 action_810 (332) = happyShift action_72 action_810 (334) = happyShift action_73 action_810 (336) = happyShift action_112 action_810 (338) = happyShift action_75 action_810 (340) = happyShift action_76 action_810 (345) = happyShift action_77 action_810 (346) = happyShift action_78 action_810 (347) = happyShift action_79 action_810 (350) = happyShift action_80 action_810 (351) = happyShift action_81 action_810 (354) = happyShift action_82 action_810 (355) = happyShift action_83 action_810 (356) = happyShift action_84 action_810 (357) = happyShift action_85 action_810 (358) = happyShift action_86 action_810 (359) = happyShift action_87 action_810 (360) = happyShift action_88 action_810 (361) = happyShift action_89 action_810 (362) = happyShift action_90 action_810 (363) = happyShift action_91 action_810 (364) = happyShift action_92 action_810 (365) = happyShift action_93 action_810 (366) = happyShift action_94 action_810 (371) = happyShift action_95 action_810 (372) = happyShift action_96 action_810 (373) = happyShift action_97 action_810 (374) = happyShift action_98 action_810 (376) = happyShift action_99 action_810 (377) = happyShift action_100 action_810 (378) = happyShift action_101 action_810 (379) = happyShift action_102 action_810 (380) = happyShift action_103 action_810 (38) = happyGoto action_13 action_810 (142) = happyGoto action_16 action_810 (143) = happyGoto action_745 action_810 (144) = happyGoto action_110 action_810 (145) = happyGoto action_18 action_810 (147) = happyGoto action_19 action_810 (148) = happyGoto action_20 action_810 (149) = happyGoto action_21 action_810 (150) = happyGoto action_22 action_810 (151) = happyGoto action_23 action_810 (152) = happyGoto action_24 action_810 (173) = happyGoto action_976 action_810 (178) = happyGoto action_749 action_810 (192) = happyGoto action_25 action_810 (195) = happyGoto action_26 action_810 (198) = happyGoto action_27 action_810 (219) = happyGoto action_29 action_810 (220) = happyGoto action_30 action_810 (221) = happyGoto action_111 action_810 (227) = happyGoto action_32 action_810 (229) = happyGoto action_33 action_810 (230) = happyGoto action_34 action_810 (233) = happyGoto action_35 action_810 _ = happyReduce_474 action_811 _ = happyReduce_470 action_812 _ = happyReduce_219 action_813 (244) = happyShift action_36 action_813 (245) = happyShift action_37 action_813 (246) = happyShift action_38 action_813 (251) = happyShift action_39 action_813 (253) = happyShift action_40 action_813 (254) = happyShift action_41 action_813 (261) = happyShift action_45 action_813 (265) = happyShift action_46 action_813 (269) = happyShift action_47 action_813 (270) = happyShift action_48 action_813 (272) = happyShift action_49 action_813 (273) = happyShift action_50 action_813 (274) = happyShift action_51 action_813 (275) = happyShift action_52 action_813 (276) = happyShift action_53 action_813 (277) = happyShift action_54 action_813 (278) = happyShift action_55 action_813 (279) = happyShift action_56 action_813 (280) = happyShift action_57 action_813 (281) = happyShift action_58 action_813 (282) = happyShift action_59 action_813 (283) = happyShift action_60 action_813 (284) = happyShift action_61 action_813 (286) = happyShift action_62 action_813 (294) = happyShift action_66 action_813 (295) = happyShift action_67 action_813 (296) = happyShift action_68 action_813 (311) = happyShift action_69 action_813 (317) = happyShift action_70 action_813 (320) = happyShift action_71 action_813 (332) = happyShift action_72 action_813 (334) = happyShift action_73 action_813 (336) = happyShift action_112 action_813 (338) = happyShift action_75 action_813 (340) = happyShift action_76 action_813 (345) = happyShift action_77 action_813 (346) = happyShift action_78 action_813 (347) = happyShift action_79 action_813 (350) = happyShift action_80 action_813 (351) = happyShift action_81 action_813 (354) = happyShift action_82 action_813 (355) = happyShift action_83 action_813 (356) = happyShift action_84 action_813 (357) = happyShift action_85 action_813 (358) = happyShift action_86 action_813 (359) = happyShift action_87 action_813 (360) = happyShift action_88 action_813 (361) = happyShift action_89 action_813 (362) = happyShift action_90 action_813 (363) = happyShift action_91 action_813 (364) = happyShift action_92 action_813 (365) = happyShift action_93 action_813 (366) = happyShift action_94 action_813 (371) = happyShift action_95 action_813 (372) = happyShift action_96 action_813 (373) = happyShift action_97 action_813 (374) = happyShift action_98 action_813 (376) = happyShift action_99 action_813 (377) = happyShift action_100 action_813 (378) = happyShift action_101 action_813 (379) = happyShift action_102 action_813 (380) = happyShift action_103 action_813 (38) = happyGoto action_13 action_813 (142) = happyGoto action_16 action_813 (143) = happyGoto action_975 action_813 (144) = happyGoto action_110 action_813 (145) = happyGoto action_18 action_813 (147) = happyGoto action_19 action_813 (148) = happyGoto action_20 action_813 (149) = happyGoto action_21 action_813 (150) = happyGoto action_22 action_813 (151) = happyGoto action_23 action_813 (152) = happyGoto action_24 action_813 (192) = happyGoto action_25 action_813 (195) = happyGoto action_26 action_813 (198) = happyGoto action_27 action_813 (219) = happyGoto action_29 action_813 (220) = happyGoto action_30 action_813 (221) = happyGoto action_111 action_813 (227) = happyGoto action_32 action_813 (229) = happyGoto action_33 action_813 (230) = happyGoto action_34 action_813 (233) = happyGoto action_35 action_813 _ = happyFail action_814 (244) = happyShift action_36 action_814 (245) = happyShift action_37 action_814 (246) = happyShift action_38 action_814 (251) = happyShift action_39 action_814 (253) = happyShift action_40 action_814 (254) = happyShift action_41 action_814 (261) = happyShift action_45 action_814 (265) = happyShift action_46 action_814 (269) = happyShift action_47 action_814 (270) = happyShift action_48 action_814 (272) = happyShift action_49 action_814 (273) = happyShift action_50 action_814 (274) = happyShift action_51 action_814 (275) = happyShift action_52 action_814 (276) = happyShift action_53 action_814 (277) = happyShift action_54 action_814 (278) = happyShift action_55 action_814 (279) = happyShift action_56 action_814 (280) = happyShift action_57 action_814 (281) = happyShift action_58 action_814 (282) = happyShift action_59 action_814 (283) = happyShift action_60 action_814 (284) = happyShift action_61 action_814 (286) = happyShift action_62 action_814 (294) = happyShift action_66 action_814 (295) = happyShift action_67 action_814 (296) = happyShift action_68 action_814 (311) = happyShift action_69 action_814 (317) = happyShift action_70 action_814 (320) = happyShift action_71 action_814 (332) = happyShift action_72 action_814 (334) = happyShift action_73 action_814 (336) = happyShift action_112 action_814 (338) = happyShift action_75 action_814 (340) = happyShift action_76 action_814 (345) = happyShift action_77 action_814 (346) = happyShift action_78 action_814 (347) = happyShift action_79 action_814 (350) = happyShift action_80 action_814 (351) = happyShift action_81 action_814 (354) = happyShift action_82 action_814 (355) = happyShift action_83 action_814 (356) = happyShift action_84 action_814 (357) = happyShift action_85 action_814 (358) = happyShift action_86 action_814 (359) = happyShift action_87 action_814 (360) = happyShift action_88 action_814 (361) = happyShift action_89 action_814 (362) = happyShift action_90 action_814 (363) = happyShift action_91 action_814 (364) = happyShift action_92 action_814 (365) = happyShift action_93 action_814 (366) = happyShift action_94 action_814 (371) = happyShift action_95 action_814 (372) = happyShift action_96 action_814 (373) = happyShift action_97 action_814 (374) = happyShift action_98 action_814 (376) = happyShift action_99 action_814 (377) = happyShift action_100 action_814 (378) = happyShift action_101 action_814 (379) = happyShift action_102 action_814 (380) = happyShift action_103 action_814 (38) = happyGoto action_13 action_814 (142) = happyGoto action_16 action_814 (143) = happyGoto action_974 action_814 (144) = happyGoto action_110 action_814 (145) = happyGoto action_18 action_814 (147) = happyGoto action_19 action_814 (148) = happyGoto action_20 action_814 (149) = happyGoto action_21 action_814 (150) = happyGoto action_22 action_814 (151) = happyGoto action_23 action_814 (152) = happyGoto action_24 action_814 (192) = happyGoto action_25 action_814 (195) = happyGoto action_26 action_814 (198) = happyGoto action_27 action_814 (219) = happyGoto action_29 action_814 (220) = happyGoto action_30 action_814 (221) = happyGoto action_111 action_814 (227) = happyGoto action_32 action_814 (229) = happyGoto action_33 action_814 (230) = happyGoto action_34 action_814 (233) = happyGoto action_35 action_814 _ = happyReduce_443 action_815 (287) = happyShift action_973 action_815 _ = happyReduce_456 action_816 (287) = happyShift action_971 action_816 (288) = happyShift action_972 action_816 _ = happyReduce_615 action_817 (244) = happyShift action_36 action_817 (245) = happyShift action_37 action_817 (246) = happyShift action_38 action_817 (251) = happyShift action_39 action_817 (253) = happyShift action_40 action_817 (254) = happyShift action_41 action_817 (261) = happyShift action_155 action_817 (265) = happyShift action_46 action_817 (266) = happyShift action_736 action_817 (269) = happyShift action_47 action_817 (270) = happyShift action_48 action_817 (272) = happyShift action_49 action_817 (273) = happyShift action_50 action_817 (274) = happyShift action_51 action_817 (275) = happyShift action_52 action_817 (276) = happyShift action_53 action_817 (277) = happyShift action_54 action_817 (278) = happyShift action_55 action_817 (279) = happyShift action_56 action_817 (280) = happyShift action_57 action_817 (281) = happyShift action_58 action_817 (282) = happyShift action_59 action_817 (283) = happyShift action_60 action_817 (284) = happyShift action_61 action_817 (286) = happyShift action_62 action_817 (294) = happyShift action_66 action_817 (295) = happyShift action_67 action_817 (296) = happyShift action_68 action_817 (311) = happyShift action_69 action_817 (317) = happyShift action_70 action_817 (320) = happyShift action_71 action_817 (321) = happyShift action_157 action_817 (332) = happyShift action_72 action_817 (334) = happyShift action_73 action_817 (336) = happyShift action_112 action_817 (338) = happyShift action_75 action_817 (340) = happyShift action_76 action_817 (345) = happyShift action_77 action_817 (346) = happyShift action_78 action_817 (347) = happyShift action_79 action_817 (350) = happyShift action_80 action_817 (351) = happyShift action_81 action_817 (354) = happyShift action_82 action_817 (355) = happyShift action_83 action_817 (356) = happyShift action_84 action_817 (357) = happyShift action_85 action_817 (358) = happyShift action_86 action_817 (359) = happyShift action_87 action_817 (360) = happyShift action_88 action_817 (361) = happyShift action_89 action_817 (362) = happyShift action_90 action_817 (363) = happyShift action_91 action_817 (364) = happyShift action_92 action_817 (365) = happyShift action_93 action_817 (366) = happyShift action_94 action_817 (371) = happyShift action_95 action_817 (372) = happyShift action_96 action_817 (373) = happyShift action_97 action_817 (374) = happyShift action_98 action_817 (376) = happyShift action_99 action_817 (377) = happyShift action_100 action_817 (378) = happyShift action_101 action_817 (379) = happyShift action_102 action_817 (380) = happyShift action_103 action_817 (38) = happyGoto action_13 action_817 (142) = happyGoto action_16 action_817 (143) = happyGoto action_151 action_817 (144) = happyGoto action_110 action_817 (145) = happyGoto action_18 action_817 (147) = happyGoto action_19 action_817 (148) = happyGoto action_20 action_817 (149) = happyGoto action_21 action_817 (150) = happyGoto action_22 action_817 (151) = happyGoto action_23 action_817 (152) = happyGoto action_24 action_817 (164) = happyGoto action_970 action_817 (165) = happyGoto action_733 action_817 (166) = happyGoto action_734 action_817 (178) = happyGoto action_152 action_817 (186) = happyGoto action_735 action_817 (192) = happyGoto action_25 action_817 (195) = happyGoto action_26 action_817 (198) = happyGoto action_27 action_817 (219) = happyGoto action_29 action_817 (220) = happyGoto action_30 action_817 (221) = happyGoto action_111 action_817 (227) = happyGoto action_32 action_817 (229) = happyGoto action_33 action_817 (230) = happyGoto action_34 action_817 (233) = happyGoto action_35 action_817 _ = happyFail action_818 (244) = happyShift action_36 action_818 (245) = happyShift action_37 action_818 (246) = happyShift action_38 action_818 (251) = happyShift action_39 action_818 (253) = happyShift action_40 action_818 (254) = happyShift action_41 action_818 (261) = happyShift action_155 action_818 (265) = happyShift action_46 action_818 (266) = happyShift action_736 action_818 (269) = happyShift action_47 action_818 (270) = happyShift action_48 action_818 (272) = happyShift action_49 action_818 (273) = happyShift action_50 action_818 (274) = happyShift action_51 action_818 (275) = happyShift action_52 action_818 (276) = happyShift action_53 action_818 (277) = happyShift action_54 action_818 (278) = happyShift action_55 action_818 (279) = happyShift action_56 action_818 (280) = happyShift action_57 action_818 (281) = happyShift action_58 action_818 (282) = happyShift action_59 action_818 (283) = happyShift action_60 action_818 (284) = happyShift action_61 action_818 (286) = happyShift action_62 action_818 (294) = happyShift action_66 action_818 (295) = happyShift action_67 action_818 (296) = happyShift action_68 action_818 (311) = happyShift action_69 action_818 (317) = happyShift action_70 action_818 (320) = happyShift action_71 action_818 (321) = happyShift action_157 action_818 (332) = happyShift action_72 action_818 (334) = happyShift action_73 action_818 (336) = happyShift action_112 action_818 (338) = happyShift action_75 action_818 (340) = happyShift action_76 action_818 (345) = happyShift action_77 action_818 (346) = happyShift action_78 action_818 (347) = happyShift action_79 action_818 (350) = happyShift action_80 action_818 (351) = happyShift action_81 action_818 (354) = happyShift action_82 action_818 (355) = happyShift action_83 action_818 (356) = happyShift action_84 action_818 (357) = happyShift action_85 action_818 (358) = happyShift action_86 action_818 (359) = happyShift action_87 action_818 (360) = happyShift action_88 action_818 (361) = happyShift action_89 action_818 (362) = happyShift action_90 action_818 (363) = happyShift action_91 action_818 (364) = happyShift action_92 action_818 (365) = happyShift action_93 action_818 (366) = happyShift action_94 action_818 (371) = happyShift action_95 action_818 (372) = happyShift action_96 action_818 (373) = happyShift action_97 action_818 (374) = happyShift action_98 action_818 (376) = happyShift action_99 action_818 (377) = happyShift action_100 action_818 (378) = happyShift action_101 action_818 (379) = happyShift action_102 action_818 (380) = happyShift action_103 action_818 (38) = happyGoto action_13 action_818 (142) = happyGoto action_16 action_818 (143) = happyGoto action_151 action_818 (144) = happyGoto action_110 action_818 (145) = happyGoto action_18 action_818 (147) = happyGoto action_19 action_818 (148) = happyGoto action_20 action_818 (149) = happyGoto action_21 action_818 (150) = happyGoto action_22 action_818 (151) = happyGoto action_23 action_818 (152) = happyGoto action_24 action_818 (166) = happyGoto action_968 action_818 (178) = happyGoto action_152 action_818 (186) = happyGoto action_969 action_818 (192) = happyGoto action_25 action_818 (195) = happyGoto action_26 action_818 (198) = happyGoto action_27 action_818 (219) = happyGoto action_29 action_818 (220) = happyGoto action_30 action_818 (221) = happyGoto action_111 action_818 (227) = happyGoto action_32 action_818 (229) = happyGoto action_33 action_818 (230) = happyGoto action_34 action_818 (233) = happyGoto action_35 action_818 _ = happyFail action_819 (244) = happyShift action_36 action_819 (245) = happyShift action_37 action_819 (246) = happyShift action_38 action_819 (251) = happyShift action_39 action_819 (253) = happyShift action_40 action_819 (254) = happyShift action_41 action_819 (261) = happyShift action_45 action_819 (265) = happyShift action_46 action_819 (269) = happyShift action_47 action_819 (270) = happyShift action_48 action_819 (272) = happyShift action_49 action_819 (273) = happyShift action_50 action_819 (274) = happyShift action_51 action_819 (275) = happyShift action_52 action_819 (276) = happyShift action_53 action_819 (277) = happyShift action_54 action_819 (278) = happyShift action_55 action_819 (279) = happyShift action_56 action_819 (280) = happyShift action_57 action_819 (281) = happyShift action_58 action_819 (282) = happyShift action_59 action_819 (283) = happyShift action_60 action_819 (284) = happyShift action_61 action_819 (286) = happyShift action_62 action_819 (294) = happyShift action_66 action_819 (295) = happyShift action_67 action_819 (296) = happyShift action_68 action_819 (311) = happyShift action_69 action_819 (317) = happyShift action_70 action_819 (320) = happyShift action_71 action_819 (332) = happyShift action_72 action_819 (334) = happyShift action_73 action_819 (336) = happyShift action_112 action_819 (338) = happyShift action_75 action_819 (340) = happyShift action_76 action_819 (345) = happyShift action_77 action_819 (346) = happyShift action_78 action_819 (347) = happyShift action_79 action_819 (350) = happyShift action_80 action_819 (351) = happyShift action_81 action_819 (354) = happyShift action_82 action_819 (355) = happyShift action_83 action_819 (356) = happyShift action_84 action_819 (357) = happyShift action_85 action_819 (358) = happyShift action_86 action_819 (359) = happyShift action_87 action_819 (360) = happyShift action_88 action_819 (361) = happyShift action_89 action_819 (362) = happyShift action_90 action_819 (363) = happyShift action_91 action_819 (364) = happyShift action_92 action_819 (365) = happyShift action_93 action_819 (366) = happyShift action_94 action_819 (371) = happyShift action_95 action_819 (372) = happyShift action_96 action_819 (373) = happyShift action_97 action_819 (374) = happyShift action_98 action_819 (376) = happyShift action_99 action_819 (377) = happyShift action_100 action_819 (378) = happyShift action_101 action_819 (379) = happyShift action_102 action_819 (380) = happyShift action_103 action_819 (38) = happyGoto action_13 action_819 (142) = happyGoto action_16 action_819 (143) = happyGoto action_967 action_819 (144) = happyGoto action_110 action_819 (145) = happyGoto action_18 action_819 (147) = happyGoto action_19 action_819 (148) = happyGoto action_20 action_819 (149) = happyGoto action_21 action_819 (150) = happyGoto action_22 action_819 (151) = happyGoto action_23 action_819 (152) = happyGoto action_24 action_819 (192) = happyGoto action_25 action_819 (195) = happyGoto action_26 action_819 (198) = happyGoto action_27 action_819 (219) = happyGoto action_29 action_819 (220) = happyGoto action_30 action_819 (221) = happyGoto action_111 action_819 (227) = happyGoto action_32 action_819 (229) = happyGoto action_33 action_819 (230) = happyGoto action_34 action_819 (233) = happyGoto action_35 action_819 _ = happyFail action_820 _ = happyReduce_91 action_821 (306) = happyShift action_966 action_821 _ = happyFail action_822 (306) = happyShift action_965 action_822 _ = happyFail action_823 (268) = happyShift action_964 action_823 _ = happyFail action_824 (367) = happyShift action_145 action_824 (369) = happyShift action_147 action_824 (370) = happyShift action_148 action_824 (30) = happyGoto action_957 action_824 (31) = happyGoto action_958 action_824 (32) = happyGoto action_959 action_824 (33) = happyGoto action_960 action_824 (237) = happyGoto action_961 action_824 (239) = happyGoto action_962 action_824 (240) = happyGoto action_963 action_824 _ = happyReduce_49 action_825 _ = happyReduce_136 action_826 _ = happyReduce_122 action_827 (336) = happyShift action_956 action_827 (347) = happyShift action_235 action_827 (351) = happyShift action_236 action_827 (355) = happyShift action_237 action_827 (205) = happyGoto action_955 action_827 (206) = happyGoto action_216 action_827 _ = happyFail action_828 (250) = happyShift action_827 action_828 (134) = happyGoto action_954 action_828 _ = happyReduce_337 action_829 (328) = happyShift action_952 action_829 (330) = happyShift action_953 action_829 _ = happyFail action_830 (367) = happyShift action_145 action_830 (127) = happyGoto action_949 action_830 (128) = happyGoto action_950 action_830 (237) = happyGoto action_540 action_830 (243) = happyGoto action_951 action_830 _ = happyReduce_649 action_831 _ = happyReduce_117 action_832 (250) = happyShift action_827 action_832 (134) = happyGoto action_948 action_832 _ = happyReduce_337 action_833 (245) = happyShift action_37 action_833 (253) = happyShift action_40 action_833 (265) = happyShift action_46 action_833 (272) = happyShift action_49 action_833 (273) = happyShift action_50 action_833 (274) = happyShift action_51 action_833 (275) = happyShift action_221 action_833 (276) = happyShift action_222 action_833 (277) = happyShift action_223 action_833 (280) = happyShift action_57 action_833 (281) = happyShift action_58 action_833 (282) = happyShift action_59 action_833 (283) = happyShift action_60 action_833 (286) = happyShift action_62 action_833 (299) = happyShift action_225 action_833 (300) = happyShift action_226 action_833 (321) = happyShift action_227 action_833 (328) = happyShift action_228 action_833 (332) = happyShift action_229 action_833 (334) = happyShift action_230 action_833 (336) = happyShift action_231 action_833 (338) = happyShift action_232 action_833 (345) = happyShift action_233 action_833 (346) = happyShift action_234 action_833 (347) = happyShift action_235 action_833 (351) = happyShift action_236 action_833 (355) = happyShift action_237 action_833 (358) = happyShift action_238 action_833 (359) = happyShift action_239 action_833 (376) = happyShift action_240 action_833 (377) = happyShift action_241 action_833 (379) = happyShift action_102 action_833 (380) = happyShift action_103 action_833 (100) = happyGoto action_208 action_833 (104) = happyGoto action_947 action_833 (106) = happyGoto action_210 action_833 (107) = happyGoto action_211 action_833 (142) = happyGoto action_212 action_833 (202) = happyGoto action_213 action_833 (203) = happyGoto action_214 action_833 (205) = happyGoto action_215 action_833 (206) = happyGoto action_216 action_833 (215) = happyGoto action_217 action_833 (217) = happyGoto action_218 action_833 (227) = happyGoto action_219 action_833 _ = happyFail action_834 (245) = happyShift action_37 action_834 (253) = happyShift action_40 action_834 (265) = happyShift action_46 action_834 (272) = happyShift action_49 action_834 (273) = happyShift action_50 action_834 (274) = happyShift action_51 action_834 (275) = happyShift action_221 action_834 (276) = happyShift action_222 action_834 (277) = happyShift action_223 action_834 (280) = happyShift action_57 action_834 (281) = happyShift action_58 action_834 (282) = happyShift action_59 action_834 (283) = happyShift action_60 action_834 (286) = happyShift action_62 action_834 (299) = happyShift action_225 action_834 (300) = happyShift action_226 action_834 (321) = happyShift action_227 action_834 (328) = happyShift action_228 action_834 (332) = happyShift action_229 action_834 (334) = happyShift action_230 action_834 (336) = happyShift action_231 action_834 (338) = happyShift action_232 action_834 (345) = happyShift action_233 action_834 (346) = happyShift action_234 action_834 (347) = happyShift action_235 action_834 (351) = happyShift action_236 action_834 (355) = happyShift action_237 action_834 (358) = happyShift action_238 action_834 (359) = happyShift action_239 action_834 (376) = happyShift action_240 action_834 (377) = happyShift action_241 action_834 (379) = happyShift action_102 action_834 (380) = happyShift action_103 action_834 (100) = happyGoto action_208 action_834 (104) = happyGoto action_946 action_834 (106) = happyGoto action_210 action_834 (107) = happyGoto action_211 action_834 (142) = happyGoto action_212 action_834 (202) = happyGoto action_213 action_834 (203) = happyGoto action_214 action_834 (205) = happyGoto action_215 action_834 (206) = happyGoto action_216 action_834 (215) = happyGoto action_217 action_834 (217) = happyGoto action_218 action_834 (227) = happyGoto action_219 action_834 _ = happyFail action_835 (245) = happyShift action_37 action_835 (253) = happyShift action_40 action_835 (265) = happyShift action_46 action_835 (272) = happyShift action_49 action_835 (273) = happyShift action_50 action_835 (274) = happyShift action_51 action_835 (275) = happyShift action_221 action_835 (276) = happyShift action_222 action_835 (277) = happyShift action_223 action_835 (280) = happyShift action_57 action_835 (281) = happyShift action_58 action_835 (282) = happyShift action_59 action_835 (283) = happyShift action_60 action_835 (286) = happyShift action_62 action_835 (299) = happyShift action_225 action_835 (300) = happyShift action_226 action_835 (310) = happyReduce_245 action_835 (313) = happyReduce_245 action_835 (319) = happyReduce_239 action_835 (321) = happyShift action_227 action_835 (328) = happyShift action_228 action_835 (332) = happyShift action_229 action_835 (334) = happyShift action_230 action_835 (336) = happyShift action_231 action_835 (338) = happyShift action_232 action_835 (345) = happyShift action_233 action_835 (346) = happyShift action_234 action_835 (347) = happyShift action_235 action_835 (351) = happyShift action_236 action_835 (355) = happyShift action_237 action_835 (358) = happyShift action_238 action_835 (359) = happyShift action_239 action_835 (376) = happyShift action_240 action_835 (377) = happyShift action_241 action_835 (379) = happyShift action_102 action_835 (380) = happyShift action_103 action_835 (100) = happyGoto action_208 action_835 (107) = happyGoto action_517 action_835 (142) = happyGoto action_212 action_835 (202) = happyGoto action_213 action_835 (203) = happyGoto action_214 action_835 (205) = happyGoto action_215 action_835 (206) = happyGoto action_216 action_835 (215) = happyGoto action_217 action_835 (217) = happyGoto action_218 action_835 (227) = happyGoto action_219 action_835 _ = happyReduce_256 action_836 (245) = happyShift action_37 action_836 (253) = happyShift action_40 action_836 (265) = happyShift action_46 action_836 (270) = happyShift action_385 action_836 (272) = happyShift action_49 action_836 (273) = happyShift action_50 action_836 (274) = happyShift action_51 action_836 (275) = happyShift action_221 action_836 (276) = happyShift action_222 action_836 (277) = happyShift action_223 action_836 (280) = happyShift action_57 action_836 (281) = happyShift action_58 action_836 (282) = happyShift action_59 action_836 (283) = happyShift action_60 action_836 (286) = happyShift action_62 action_836 (299) = happyShift action_225 action_836 (300) = happyShift action_226 action_836 (321) = happyShift action_227 action_836 (328) = happyShift action_228 action_836 (332) = happyShift action_229 action_836 (334) = happyShift action_230 action_836 (336) = happyShift action_231 action_836 (338) = happyShift action_232 action_836 (345) = happyShift action_233 action_836 (346) = happyShift action_234 action_836 (347) = happyShift action_235 action_836 (351) = happyShift action_236 action_836 (355) = happyShift action_237 action_836 (356) = happyShift action_84 action_836 (358) = happyShift action_238 action_836 (359) = happyShift action_239 action_836 (376) = happyShift action_240 action_836 (377) = happyShift action_241 action_836 (379) = happyShift action_102 action_836 (380) = happyShift action_103 action_836 (100) = happyGoto action_208 action_836 (102) = happyGoto action_945 action_836 (103) = happyGoto action_381 action_836 (105) = happyGoto action_382 action_836 (106) = happyGoto action_383 action_836 (107) = happyGoto action_211 action_836 (142) = happyGoto action_212 action_836 (192) = happyGoto action_384 action_836 (202) = happyGoto action_213 action_836 (203) = happyGoto action_214 action_836 (205) = happyGoto action_215 action_836 (206) = happyGoto action_216 action_836 (215) = happyGoto action_217 action_836 (217) = happyGoto action_218 action_836 (227) = happyGoto action_219 action_836 _ = happyFail action_837 (310) = happyReduce_243 action_837 (313) = happyReduce_243 action_837 (368) = happyShift action_146 action_837 (238) = happyGoto action_944 action_837 _ = happyReduce_252 action_838 (310) = happyReduce_242 action_838 (313) = happyReduce_242 action_838 (368) = happyShift action_146 action_838 (238) = happyGoto action_943 action_838 _ = happyReduce_250 action_839 (310) = happyReduce_233 action_839 (313) = happyReduce_233 action_839 _ = happyReduce_237 action_840 (245) = happyShift action_37 action_840 (253) = happyShift action_40 action_840 (265) = happyShift action_46 action_840 (270) = happyShift action_495 action_840 (272) = happyShift action_49 action_840 (273) = happyShift action_50 action_840 (274) = happyShift action_51 action_840 (275) = happyShift action_221 action_840 (276) = happyShift action_222 action_840 (277) = happyShift action_223 action_840 (280) = happyShift action_57 action_840 (281) = happyShift action_58 action_840 (282) = happyShift action_59 action_840 (283) = happyShift action_60 action_840 (286) = happyShift action_62 action_840 (299) = happyShift action_225 action_840 (300) = happyShift action_226 action_840 (321) = happyShift action_227 action_840 (328) = happyShift action_228 action_840 (332) = happyShift action_229 action_840 (334) = happyShift action_230 action_840 (336) = happyShift action_231 action_840 (338) = happyShift action_232 action_840 (345) = happyShift action_233 action_840 (346) = happyShift action_234 action_840 (347) = happyShift action_235 action_840 (351) = happyShift action_236 action_840 (355) = happyShift action_237 action_840 (356) = happyShift action_84 action_840 (358) = happyShift action_238 action_840 (359) = happyShift action_239 action_840 (376) = happyShift action_240 action_840 (377) = happyShift action_241 action_840 (379) = happyShift action_102 action_840 (380) = happyShift action_103 action_840 (100) = happyGoto action_208 action_840 (101) = happyGoto action_851 action_840 (102) = happyGoto action_942 action_840 (103) = happyGoto action_492 action_840 (104) = happyGoto action_245 action_840 (105) = happyGoto action_382 action_840 (106) = happyGoto action_493 action_840 (107) = happyGoto action_211 action_840 (142) = happyGoto action_212 action_840 (192) = happyGoto action_494 action_840 (202) = happyGoto action_213 action_840 (203) = happyGoto action_214 action_840 (205) = happyGoto action_215 action_840 (206) = happyGoto action_216 action_840 (215) = happyGoto action_217 action_840 (217) = happyGoto action_218 action_840 (227) = happyGoto action_219 action_840 _ = happyFail action_841 _ = happyReduce_170 action_842 _ = happyReduce_350 action_843 (244) = happyShift action_36 action_843 (245) = happyShift action_37 action_843 (246) = happyShift action_38 action_843 (251) = happyShift action_39 action_843 (253) = happyShift action_40 action_843 (254) = happyShift action_41 action_843 (261) = happyShift action_45 action_843 (265) = happyShift action_46 action_843 (269) = happyShift action_47 action_843 (270) = happyShift action_48 action_843 (272) = happyShift action_49 action_843 (273) = happyShift action_50 action_843 (274) = happyShift action_51 action_843 (275) = happyShift action_52 action_843 (276) = happyShift action_53 action_843 (277) = happyShift action_54 action_843 (278) = happyShift action_55 action_843 (279) = happyShift action_56 action_843 (280) = happyShift action_57 action_843 (281) = happyShift action_58 action_843 (282) = happyShift action_59 action_843 (283) = happyShift action_60 action_843 (284) = happyShift action_61 action_843 (286) = happyShift action_62 action_843 (294) = happyShift action_66 action_843 (295) = happyShift action_67 action_843 (296) = happyShift action_68 action_843 (311) = happyShift action_69 action_843 (317) = happyShift action_70 action_843 (320) = happyShift action_71 action_843 (332) = happyShift action_72 action_843 (334) = happyShift action_73 action_843 (336) = happyShift action_112 action_843 (338) = happyShift action_75 action_843 (340) = happyShift action_76 action_843 (345) = happyShift action_77 action_843 (346) = happyShift action_78 action_843 (347) = happyShift action_79 action_843 (350) = happyShift action_80 action_843 (351) = happyShift action_81 action_843 (354) = happyShift action_82 action_843 (355) = happyShift action_83 action_843 (356) = happyShift action_84 action_843 (357) = happyShift action_85 action_843 (358) = happyShift action_86 action_843 (359) = happyShift action_87 action_843 (360) = happyShift action_88 action_843 (361) = happyShift action_89 action_843 (362) = happyShift action_90 action_843 (363) = happyShift action_91 action_843 (364) = happyShift action_92 action_843 (365) = happyShift action_93 action_843 (366) = happyShift action_94 action_843 (371) = happyShift action_95 action_843 (372) = happyShift action_96 action_843 (373) = happyShift action_97 action_843 (374) = happyShift action_98 action_843 (376) = happyShift action_99 action_843 (377) = happyShift action_100 action_843 (378) = happyShift action_101 action_843 (379) = happyShift action_102 action_843 (380) = happyShift action_103 action_843 (38) = happyGoto action_13 action_843 (142) = happyGoto action_16 action_843 (143) = happyGoto action_941 action_843 (144) = happyGoto action_110 action_843 (145) = happyGoto action_18 action_843 (147) = happyGoto action_19 action_843 (148) = happyGoto action_20 action_843 (149) = happyGoto action_21 action_843 (150) = happyGoto action_22 action_843 (151) = happyGoto action_23 action_843 (152) = happyGoto action_24 action_843 (192) = happyGoto action_25 action_843 (195) = happyGoto action_26 action_843 (198) = happyGoto action_27 action_843 (219) = happyGoto action_29 action_843 (220) = happyGoto action_30 action_843 (221) = happyGoto action_111 action_843 (227) = happyGoto action_32 action_843 (229) = happyGoto action_33 action_843 (230) = happyGoto action_34 action_843 (233) = happyGoto action_35 action_843 _ = happyFail action_844 _ = happyReduce_149 action_845 (244) = happyShift action_36 action_845 (245) = happyShift action_37 action_845 (246) = happyShift action_38 action_845 (248) = happyShift action_937 action_845 (249) = happyShift action_938 action_845 (251) = happyShift action_39 action_845 (253) = happyShift action_40 action_845 (254) = happyShift action_41 action_845 (257) = happyShift action_42 action_845 (258) = happyShift action_43 action_845 (259) = happyShift action_44 action_845 (261) = happyShift action_45 action_845 (265) = happyShift action_46 action_845 (267) = happyShift action_939 action_845 (269) = happyShift action_47 action_845 (270) = happyShift action_48 action_845 (272) = happyShift action_49 action_845 (273) = happyShift action_50 action_845 (274) = happyShift action_51 action_845 (275) = happyShift action_52 action_845 (276) = happyShift action_53 action_845 (277) = happyShift action_54 action_845 (278) = happyShift action_55 action_845 (279) = happyShift action_56 action_845 (280) = happyShift action_57 action_845 (281) = happyShift action_58 action_845 (282) = happyShift action_59 action_845 (283) = happyShift action_60 action_845 (284) = happyShift action_61 action_845 (286) = happyShift action_62 action_845 (289) = happyShift action_63 action_845 (290) = happyShift action_64 action_845 (291) = happyShift action_65 action_845 (294) = happyShift action_66 action_845 (295) = happyShift action_67 action_845 (296) = happyShift action_68 action_845 (311) = happyShift action_69 action_845 (317) = happyShift action_70 action_845 (320) = happyShift action_71 action_845 (321) = happyShift action_144 action_845 (332) = happyShift action_72 action_845 (334) = happyShift action_73 action_845 (336) = happyShift action_74 action_845 (338) = happyShift action_75 action_845 (340) = happyShift action_76 action_845 (345) = happyShift action_77 action_845 (346) = happyShift action_78 action_845 (347) = happyShift action_79 action_845 (350) = happyShift action_80 action_845 (351) = happyShift action_81 action_845 (354) = happyShift action_82 action_845 (355) = happyShift action_83 action_845 (356) = happyShift action_84 action_845 (357) = happyShift action_85 action_845 (358) = happyShift action_86 action_845 (359) = happyShift action_87 action_845 (360) = happyShift action_88 action_845 (361) = happyShift action_89 action_845 (362) = happyShift action_90 action_845 (363) = happyShift action_91 action_845 (364) = happyShift action_92 action_845 (365) = happyShift action_93 action_845 (366) = happyShift action_94 action_845 (367) = happyShift action_145 action_845 (368) = happyShift action_146 action_845 (369) = happyShift action_147 action_845 (370) = happyShift action_148 action_845 (371) = happyShift action_95 action_845 (372) = happyShift action_96 action_845 (373) = happyShift action_97 action_845 (374) = happyShift action_98 action_845 (376) = happyShift action_99 action_845 (377) = happyShift action_100 action_845 (378) = happyShift action_101 action_845 (379) = happyShift action_102 action_845 (380) = happyShift action_103 action_845 (38) = happyGoto action_13 action_845 (49) = happyGoto action_14 action_845 (56) = happyGoto action_933 action_845 (63) = happyGoto action_934 action_845 (64) = happyGoto action_940 action_845 (135) = happyGoto action_120 action_845 (136) = happyGoto action_121 action_845 (137) = happyGoto action_936 action_845 (141) = happyGoto action_123 action_845 (142) = happyGoto action_16 action_845 (144) = happyGoto action_124 action_845 (145) = happyGoto action_18 action_845 (147) = happyGoto action_19 action_845 (148) = happyGoto action_20 action_845 (149) = happyGoto action_21 action_845 (150) = happyGoto action_22 action_845 (151) = happyGoto action_23 action_845 (152) = happyGoto action_24 action_845 (192) = happyGoto action_25 action_845 (195) = happyGoto action_26 action_845 (198) = happyGoto action_27 action_845 (218) = happyGoto action_28 action_845 (219) = happyGoto action_29 action_845 (220) = happyGoto action_30 action_845 (221) = happyGoto action_31 action_845 (227) = happyGoto action_32 action_845 (229) = happyGoto action_33 action_845 (230) = happyGoto action_34 action_845 (233) = happyGoto action_35 action_845 (237) = happyGoto action_125 action_845 (238) = happyGoto action_126 action_845 (239) = happyGoto action_127 action_845 (240) = happyGoto action_128 action_845 _ = happyReduce_146 action_846 (244) = happyShift action_36 action_846 (245) = happyShift action_37 action_846 (246) = happyShift action_38 action_846 (248) = happyShift action_937 action_846 (249) = happyShift action_938 action_846 (251) = happyShift action_39 action_846 (253) = happyShift action_40 action_846 (254) = happyShift action_41 action_846 (257) = happyShift action_42 action_846 (258) = happyShift action_43 action_846 (259) = happyShift action_44 action_846 (261) = happyShift action_45 action_846 (265) = happyShift action_46 action_846 (267) = happyShift action_939 action_846 (269) = happyShift action_47 action_846 (270) = happyShift action_48 action_846 (272) = happyShift action_49 action_846 (273) = happyShift action_50 action_846 (274) = happyShift action_51 action_846 (275) = happyShift action_52 action_846 (276) = happyShift action_53 action_846 (277) = happyShift action_54 action_846 (278) = happyShift action_55 action_846 (279) = happyShift action_56 action_846 (280) = happyShift action_57 action_846 (281) = happyShift action_58 action_846 (282) = happyShift action_59 action_846 (283) = happyShift action_60 action_846 (284) = happyShift action_61 action_846 (286) = happyShift action_62 action_846 (289) = happyShift action_63 action_846 (290) = happyShift action_64 action_846 (291) = happyShift action_65 action_846 (294) = happyShift action_66 action_846 (295) = happyShift action_67 action_846 (296) = happyShift action_68 action_846 (311) = happyShift action_69 action_846 (317) = happyShift action_70 action_846 (320) = happyShift action_71 action_846 (321) = happyShift action_144 action_846 (332) = happyShift action_72 action_846 (334) = happyShift action_73 action_846 (336) = happyShift action_74 action_846 (338) = happyShift action_75 action_846 (340) = happyShift action_76 action_846 (345) = happyShift action_77 action_846 (346) = happyShift action_78 action_846 (347) = happyShift action_79 action_846 (350) = happyShift action_80 action_846 (351) = happyShift action_81 action_846 (354) = happyShift action_82 action_846 (355) = happyShift action_83 action_846 (356) = happyShift action_84 action_846 (357) = happyShift action_85 action_846 (358) = happyShift action_86 action_846 (359) = happyShift action_87 action_846 (360) = happyShift action_88 action_846 (361) = happyShift action_89 action_846 (362) = happyShift action_90 action_846 (363) = happyShift action_91 action_846 (364) = happyShift action_92 action_846 (365) = happyShift action_93 action_846 (366) = happyShift action_94 action_846 (367) = happyShift action_145 action_846 (368) = happyShift action_146 action_846 (369) = happyShift action_147 action_846 (370) = happyShift action_148 action_846 (371) = happyShift action_95 action_846 (372) = happyShift action_96 action_846 (373) = happyShift action_97 action_846 (374) = happyShift action_98 action_846 (376) = happyShift action_99 action_846 (377) = happyShift action_100 action_846 (378) = happyShift action_101 action_846 (379) = happyShift action_102 action_846 (380) = happyShift action_103 action_846 (38) = happyGoto action_13 action_846 (49) = happyGoto action_14 action_846 (56) = happyGoto action_933 action_846 (63) = happyGoto action_934 action_846 (64) = happyGoto action_935 action_846 (135) = happyGoto action_120 action_846 (136) = happyGoto action_121 action_846 (137) = happyGoto action_936 action_846 (141) = happyGoto action_123 action_846 (142) = happyGoto action_16 action_846 (144) = happyGoto action_124 action_846 (145) = happyGoto action_18 action_846 (147) = happyGoto action_19 action_846 (148) = happyGoto action_20 action_846 (149) = happyGoto action_21 action_846 (150) = happyGoto action_22 action_846 (151) = happyGoto action_23 action_846 (152) = happyGoto action_24 action_846 (192) = happyGoto action_25 action_846 (195) = happyGoto action_26 action_846 (198) = happyGoto action_27 action_846 (218) = happyGoto action_28 action_846 (219) = happyGoto action_29 action_846 (220) = happyGoto action_30 action_846 (221) = happyGoto action_31 action_846 (227) = happyGoto action_32 action_846 (229) = happyGoto action_33 action_846 (230) = happyGoto action_34 action_846 (233) = happyGoto action_35 action_846 (237) = happyGoto action_125 action_846 (238) = happyGoto action_126 action_846 (239) = happyGoto action_127 action_846 (240) = happyGoto action_128 action_846 _ = happyReduce_146 action_847 _ = happyReduce_300 action_848 (117) = happyGoto action_932 action_848 _ = happyReduce_299 action_849 (116) = happyGoto action_931 action_849 (117) = happyGoto action_683 action_849 _ = happyReduce_299 action_850 _ = happyReduce_289 action_851 _ = happyReduce_231 action_852 (245) = happyShift action_37 action_852 (253) = happyShift action_40 action_852 (265) = happyShift action_46 action_852 (272) = happyShift action_49 action_852 (273) = happyShift action_50 action_852 (274) = happyShift action_51 action_852 (275) = happyShift action_221 action_852 (276) = happyShift action_222 action_852 (277) = happyShift action_223 action_852 (280) = happyShift action_57 action_852 (281) = happyShift action_58 action_852 (282) = happyShift action_59 action_852 (283) = happyShift action_60 action_852 (286) = happyShift action_62 action_852 (322) = happyShift action_874 action_852 (332) = happyShift action_875 action_852 (336) = happyShift action_876 action_852 (346) = happyShift action_234 action_852 (347) = happyShift action_235 action_852 (351) = happyShift action_236 action_852 (355) = happyShift action_237 action_852 (118) = happyGoto action_930 action_852 (119) = happyGoto action_869 action_852 (120) = happyGoto action_870 action_852 (121) = happyGoto action_871 action_852 (205) = happyGoto action_872 action_852 (206) = happyGoto action_216 action_852 (215) = happyGoto action_873 action_852 (217) = happyGoto action_218 action_852 (227) = happyGoto action_219 action_852 _ = happyFail action_853 _ = happyReduce_151 action_854 (305) = happyShift action_280 action_854 (61) = happyGoto action_929 action_854 _ = happyReduce_138 action_855 _ = happyReduce_155 action_856 (1) = happyShift action_601 action_856 (331) = happyShift action_602 action_856 (342) = happyShift action_926 action_856 (234) = happyGoto action_928 action_856 _ = happyFail action_857 _ = happyReduce_152 action_858 _ = happyReduce_130 action_859 (245) = happyShift action_37 action_859 (253) = happyShift action_40 action_859 (265) = happyShift action_46 action_859 (272) = happyShift action_49 action_859 (273) = happyShift action_50 action_859 (274) = happyShift action_51 action_859 (275) = happyShift action_221 action_859 (276) = happyShift action_222 action_859 (277) = happyShift action_223 action_859 (280) = happyShift action_57 action_859 (281) = happyShift action_58 action_859 (282) = happyShift action_59 action_859 (283) = happyShift action_60 action_859 (286) = happyShift action_62 action_859 (299) = happyShift action_225 action_859 (300) = happyShift action_226 action_859 (321) = happyShift action_227 action_859 (328) = happyShift action_228 action_859 (332) = happyShift action_229 action_859 (334) = happyShift action_230 action_859 (336) = happyShift action_231 action_859 (338) = happyShift action_232 action_859 (345) = happyShift action_233 action_859 (346) = happyShift action_234 action_859 (347) = happyShift action_235 action_859 (351) = happyShift action_236 action_859 (355) = happyShift action_237 action_859 (358) = happyShift action_238 action_859 (359) = happyShift action_239 action_859 (376) = happyShift action_240 action_859 (377) = happyShift action_241 action_859 (379) = happyShift action_102 action_859 (380) = happyShift action_103 action_859 (100) = happyGoto action_208 action_859 (104) = happyGoto action_927 action_859 (106) = happyGoto action_210 action_859 (107) = happyGoto action_211 action_859 (142) = happyGoto action_212 action_859 (202) = happyGoto action_213 action_859 (203) = happyGoto action_214 action_859 (205) = happyGoto action_215 action_859 (206) = happyGoto action_216 action_859 (215) = happyGoto action_217 action_859 (217) = happyGoto action_218 action_859 (227) = happyGoto action_219 action_859 _ = happyFail action_860 (329) = happyShift action_925 action_860 (342) = happyShift action_926 action_860 _ = happyFail action_861 _ = happyReduce_574 action_862 _ = happyReduce_550 action_863 _ = happyReduce_247 action_864 _ = happyReduce_246 action_865 _ = happyReduce_279 action_866 (245) = happyShift action_37 action_866 (253) = happyShift action_40 action_866 (265) = happyShift action_46 action_866 (270) = happyShift action_249 action_866 (272) = happyShift action_49 action_866 (273) = happyShift action_50 action_866 (274) = happyShift action_51 action_866 (275) = happyShift action_221 action_866 (276) = happyShift action_222 action_866 (277) = happyShift action_223 action_866 (280) = happyShift action_57 action_866 (281) = happyShift action_58 action_866 (282) = happyShift action_59 action_866 (283) = happyShift action_60 action_866 (286) = happyShift action_62 action_866 (299) = happyShift action_225 action_866 (300) = happyShift action_226 action_866 (321) = happyShift action_227 action_866 (328) = happyShift action_228 action_866 (332) = happyShift action_229 action_866 (334) = happyShift action_230 action_866 (336) = happyShift action_231 action_866 (338) = happyShift action_232 action_866 (345) = happyShift action_233 action_866 (346) = happyShift action_234 action_866 (347) = happyShift action_235 action_866 (351) = happyShift action_236 action_866 (355) = happyShift action_237 action_866 (356) = happyShift action_84 action_866 (358) = happyShift action_238 action_866 (359) = happyShift action_239 action_866 (376) = happyShift action_240 action_866 (377) = happyShift action_241 action_866 (379) = happyShift action_102 action_866 (380) = happyShift action_103 action_866 (100) = happyGoto action_208 action_866 (101) = happyGoto action_506 action_866 (103) = happyGoto action_244 action_866 (104) = happyGoto action_245 action_866 (106) = happyGoto action_246 action_866 (107) = happyGoto action_211 action_866 (111) = happyGoto action_924 action_866 (142) = happyGoto action_212 action_866 (192) = happyGoto action_248 action_866 (202) = happyGoto action_213 action_866 (203) = happyGoto action_214 action_866 (205) = happyGoto action_215 action_866 (206) = happyGoto action_216 action_866 (215) = happyGoto action_217 action_866 (217) = happyGoto action_218 action_866 (227) = happyGoto action_219 action_866 _ = happyFail action_867 (337) = happyShift action_923 action_867 _ = happyFail action_868 (337) = happyShift action_922 action_868 _ = happyFail action_869 (245) = happyShift action_37 action_869 (253) = happyShift action_40 action_869 (265) = happyShift action_46 action_869 (272) = happyShift action_49 action_869 (273) = happyShift action_50 action_869 (274) = happyShift action_51 action_869 (275) = happyShift action_221 action_869 (276) = happyShift action_222 action_869 (277) = happyShift action_223 action_869 (280) = happyShift action_57 action_869 (281) = happyShift action_58 action_869 (282) = happyShift action_59 action_869 (283) = happyShift action_60 action_869 (286) = happyShift action_62 action_869 (315) = happyShift action_921 action_869 (322) = happyShift action_874 action_869 (332) = happyShift action_875 action_869 (336) = happyShift action_876 action_869 (346) = happyShift action_234 action_869 (347) = happyShift action_235 action_869 (351) = happyShift action_236 action_869 (355) = happyShift action_237 action_869 (120) = happyGoto action_920 action_869 (121) = happyGoto action_871 action_869 (205) = happyGoto action_872 action_869 (206) = happyGoto action_216 action_869 (215) = happyGoto action_873 action_869 (217) = happyGoto action_218 action_869 (227) = happyGoto action_219 action_869 _ = happyReduce_301 action_870 _ = happyReduce_303 action_871 _ = happyReduce_307 action_872 _ = happyReduce_309 action_873 _ = happyReduce_308 action_874 _ = happyReduce_305 action_875 (245) = happyShift action_37 action_875 (253) = happyShift action_40 action_875 (265) = happyShift action_46 action_875 (272) = happyShift action_49 action_875 (273) = happyShift action_50 action_875 (274) = happyShift action_51 action_875 (275) = happyShift action_221 action_875 (276) = happyShift action_222 action_875 (277) = happyShift action_223 action_875 (280) = happyShift action_57 action_875 (281) = happyShift action_58 action_875 (282) = happyShift action_59 action_875 (283) = happyShift action_60 action_875 (286) = happyShift action_62 action_875 (322) = happyShift action_874 action_875 (332) = happyShift action_875 action_875 (336) = happyShift action_876 action_875 (346) = happyShift action_234 action_875 (347) = happyShift action_235 action_875 (351) = happyShift action_236 action_875 (355) = happyShift action_237 action_875 (118) = happyGoto action_919 action_875 (119) = happyGoto action_869 action_875 (120) = happyGoto action_870 action_875 (121) = happyGoto action_871 action_875 (205) = happyGoto action_872 action_875 (206) = happyGoto action_216 action_875 (215) = happyGoto action_873 action_875 (217) = happyGoto action_218 action_875 (227) = happyGoto action_219 action_875 _ = happyFail action_876 (245) = happyShift action_37 action_876 (253) = happyShift action_40 action_876 (265) = happyShift action_46 action_876 (272) = happyShift action_49 action_876 (273) = happyShift action_50 action_876 (274) = happyShift action_51 action_876 (275) = happyShift action_221 action_876 (276) = happyShift action_222 action_876 (277) = happyShift action_223 action_876 (280) = happyShift action_57 action_876 (281) = happyShift action_58 action_876 (282) = happyShift action_59 action_876 (283) = happyShift action_60 action_876 (286) = happyShift action_62 action_876 (322) = happyShift action_874 action_876 (332) = happyShift action_875 action_876 (336) = happyShift action_876 action_876 (337) = happyShift action_918 action_876 (346) = happyShift action_234 action_876 (347) = happyShift action_235 action_876 (351) = happyShift action_236 action_876 (355) = happyShift action_237 action_876 (118) = happyGoto action_917 action_876 (119) = happyGoto action_869 action_876 (120) = happyGoto action_870 action_876 (121) = happyGoto action_871 action_876 (205) = happyGoto action_872 action_876 (206) = happyGoto action_216 action_876 (215) = happyGoto action_873 action_876 (217) = happyGoto action_218 action_876 (227) = happyGoto action_219 action_876 _ = happyFail action_877 (333) = happyShift action_916 action_877 _ = happyFail action_878 (368) = happyShift action_146 action_878 (238) = happyGoto action_914 action_878 (242) = happyGoto action_915 action_878 _ = happyReduce_647 action_879 (245) = happyShift action_37 action_879 (253) = happyShift action_40 action_879 (265) = happyShift action_46 action_879 (270) = happyShift action_249 action_879 (272) = happyShift action_49 action_879 (273) = happyShift action_50 action_879 (274) = happyShift action_51 action_879 (275) = happyShift action_221 action_879 (276) = happyShift action_222 action_879 (277) = happyShift action_223 action_879 (280) = happyShift action_57 action_879 (281) = happyShift action_58 action_879 (282) = happyShift action_59 action_879 (283) = happyShift action_60 action_879 (286) = happyShift action_62 action_879 (299) = happyShift action_225 action_879 (300) = happyShift action_226 action_879 (321) = happyShift action_227 action_879 (328) = happyShift action_228 action_879 (332) = happyShift action_229 action_879 (334) = happyShift action_230 action_879 (336) = happyShift action_231 action_879 (338) = happyShift action_232 action_879 (345) = happyShift action_233 action_879 (346) = happyShift action_234 action_879 (347) = happyShift action_235 action_879 (351) = happyShift action_236 action_879 (355) = happyShift action_237 action_879 (356) = happyShift action_84 action_879 (358) = happyShift action_238 action_879 (359) = happyShift action_239 action_879 (376) = happyShift action_240 action_879 (377) = happyShift action_241 action_879 (379) = happyShift action_102 action_879 (380) = happyShift action_103 action_879 (100) = happyGoto action_208 action_879 (101) = happyGoto action_913 action_879 (103) = happyGoto action_244 action_879 (104) = happyGoto action_245 action_879 (106) = happyGoto action_246 action_879 (107) = happyGoto action_211 action_879 (142) = happyGoto action_212 action_879 (192) = happyGoto action_248 action_879 (202) = happyGoto action_213 action_879 (203) = happyGoto action_214 action_879 (205) = happyGoto action_215 action_879 (206) = happyGoto action_216 action_879 (215) = happyGoto action_217 action_879 (217) = happyGoto action_218 action_879 (227) = happyGoto action_219 action_879 _ = happyFail action_880 _ = happyReduce_133 action_881 _ = happyReduce_121 action_882 (309) = happyShift action_912 action_882 _ = happyFail action_883 (245) = happyShift action_37 action_883 (253) = happyShift action_40 action_883 (265) = happyShift action_46 action_883 (270) = happyShift action_385 action_883 (272) = happyShift action_49 action_883 (273) = happyShift action_50 action_883 (274) = happyShift action_51 action_883 (275) = happyShift action_221 action_883 (276) = happyShift action_222 action_883 (277) = happyShift action_223 action_883 (280) = happyShift action_57 action_883 (281) = happyShift action_58 action_883 (282) = happyShift action_59 action_883 (283) = happyShift action_60 action_883 (286) = happyShift action_62 action_883 (299) = happyShift action_225 action_883 (300) = happyShift action_226 action_883 (321) = happyShift action_227 action_883 (328) = happyShift action_228 action_883 (332) = happyShift action_229 action_883 (334) = happyShift action_230 action_883 (336) = happyShift action_231 action_883 (338) = happyShift action_232 action_883 (345) = happyShift action_233 action_883 (346) = happyShift action_234 action_883 (347) = happyShift action_235 action_883 (351) = happyShift action_236 action_883 (355) = happyShift action_237 action_883 (356) = happyShift action_84 action_883 (358) = happyShift action_238 action_883 (359) = happyShift action_239 action_883 (376) = happyShift action_240 action_883 (377) = happyShift action_241 action_883 (379) = happyShift action_102 action_883 (380) = happyShift action_103 action_883 (96) = happyGoto action_911 action_883 (100) = happyGoto action_208 action_883 (102) = happyGoto action_380 action_883 (103) = happyGoto action_381 action_883 (105) = happyGoto action_382 action_883 (106) = happyGoto action_383 action_883 (107) = happyGoto action_211 action_883 (142) = happyGoto action_212 action_883 (192) = happyGoto action_384 action_883 (202) = happyGoto action_213 action_883 (203) = happyGoto action_214 action_883 (205) = happyGoto action_215 action_883 (206) = happyGoto action_216 action_883 (215) = happyGoto action_217 action_883 (217) = happyGoto action_218 action_883 (227) = happyGoto action_219 action_883 _ = happyFail action_884 _ = happyReduce_204 action_885 (327) = happyShift action_910 action_885 _ = happyFail action_886 (245) = happyShift action_37 action_886 (253) = happyShift action_40 action_886 (265) = happyShift action_46 action_886 (270) = happyShift action_48 action_886 (272) = happyShift action_49 action_886 (273) = happyShift action_50 action_886 (274) = happyShift action_51 action_886 (275) = happyShift action_52 action_886 (276) = happyShift action_53 action_886 (277) = happyShift action_54 action_886 (279) = happyShift action_56 action_886 (280) = happyShift action_57 action_886 (281) = happyShift action_58 action_886 (282) = happyShift action_59 action_886 (283) = happyShift action_60 action_886 (286) = happyShift action_62 action_886 (336) = happyShift action_888 action_886 (346) = happyShift action_78 action_886 (80) = happyGoto action_909 action_886 (81) = happyGoto action_886 action_886 (221) = happyGoto action_887 action_886 (227) = happyGoto action_32 action_886 _ = happyReduce_183 action_887 _ = happyReduce_185 action_888 (245) = happyShift action_37 action_888 (253) = happyShift action_40 action_888 (265) = happyShift action_46 action_888 (270) = happyShift action_48 action_888 (272) = happyShift action_49 action_888 (273) = happyShift action_50 action_888 (274) = happyShift action_51 action_888 (275) = happyShift action_52 action_888 (276) = happyShift action_53 action_888 (277) = happyShift action_54 action_888 (279) = happyShift action_56 action_888 (280) = happyShift action_57 action_888 (281) = happyShift action_58 action_888 (282) = happyShift action_59 action_888 (283) = happyShift action_60 action_888 (286) = happyShift action_62 action_888 (346) = happyShift action_78 action_888 (221) = happyGoto action_908 action_888 (227) = happyGoto action_32 action_888 _ = happyFail action_889 (308) = happyShift action_267 action_889 (310) = happyShift action_907 action_889 (320) = happyShift action_269 action_889 (321) = happyShift action_270 action_889 (322) = happyShift action_271 action_889 (327) = happyShift action_272 action_889 (344) = happyShift action_273 action_889 (348) = happyShift action_274 action_889 (349) = happyShift action_275 action_889 (352) = happyShift action_276 action_889 (353) = happyShift action_277 action_889 (200) = happyGoto action_257 action_889 (211) = happyGoto action_258 action_889 (213) = happyGoto action_259 action_889 (222) = happyGoto action_260 action_889 (224) = happyGoto action_261 action_889 (225) = happyGoto action_262 action_889 (226) = happyGoto action_263 action_889 (228) = happyGoto action_264 action_889 (231) = happyGoto action_265 action_889 (232) = happyGoto action_266 action_889 _ = happyFail action_890 _ = happyReduce_198 action_891 (358) = happyShift action_906 action_891 _ = happyFail action_892 _ = happyReduce_202 action_893 (306) = happyShift action_905 action_893 _ = happyFail action_894 _ = happyReduce_104 action_895 (306) = happyShift action_904 action_895 _ = happyFail action_896 (347) = happyShift action_469 action_896 (351) = happyShift action_470 action_896 (235) = happyGoto action_903 action_896 _ = happyFail action_897 _ = happyReduce_74 action_898 _ = happyReduce_513 action_899 _ = happyReduce_161 action_900 _ = happyReduce_510 action_901 (310) = happyShift action_607 action_901 _ = happyFail action_902 _ = happyReduce_494 action_903 (245) = happyShift action_1042 action_903 (45) = happyGoto action_1041 action_903 _ = happyReduce_79 action_904 _ = happyReduce_109 action_905 _ = happyReduce_108 action_906 _ = happyReduce_199 action_907 (244) = happyShift action_36 action_907 (245) = happyShift action_37 action_907 (246) = happyShift action_38 action_907 (251) = happyShift action_39 action_907 (253) = happyShift action_40 action_907 (254) = happyShift action_41 action_907 (261) = happyShift action_45 action_907 (265) = happyShift action_46 action_907 (269) = happyShift action_47 action_907 (270) = happyShift action_48 action_907 (272) = happyShift action_49 action_907 (273) = happyShift action_50 action_907 (274) = happyShift action_51 action_907 (275) = happyShift action_52 action_907 (276) = happyShift action_53 action_907 (277) = happyShift action_54 action_907 (278) = happyShift action_55 action_907 (279) = happyShift action_56 action_907 (280) = happyShift action_57 action_907 (281) = happyShift action_58 action_907 (282) = happyShift action_59 action_907 (283) = happyShift action_60 action_907 (284) = happyShift action_61 action_907 (286) = happyShift action_62 action_907 (294) = happyShift action_66 action_907 (295) = happyShift action_67 action_907 (296) = happyShift action_68 action_907 (311) = happyShift action_69 action_907 (317) = happyShift action_70 action_907 (320) = happyShift action_71 action_907 (332) = happyShift action_72 action_907 (334) = happyShift action_73 action_907 (336) = happyShift action_112 action_907 (338) = happyShift action_75 action_907 (340) = happyShift action_76 action_907 (345) = happyShift action_77 action_907 (346) = happyShift action_78 action_907 (347) = happyShift action_79 action_907 (350) = happyShift action_80 action_907 (351) = happyShift action_81 action_907 (354) = happyShift action_82 action_907 (355) = happyShift action_83 action_907 (356) = happyShift action_84 action_907 (357) = happyShift action_85 action_907 (358) = happyShift action_86 action_907 (359) = happyShift action_87 action_907 (360) = happyShift action_88 action_907 (361) = happyShift action_89 action_907 (362) = happyShift action_90 action_907 (363) = happyShift action_91 action_907 (364) = happyShift action_92 action_907 (365) = happyShift action_93 action_907 (366) = happyShift action_94 action_907 (371) = happyShift action_95 action_907 (372) = happyShift action_96 action_907 (373) = happyShift action_97 action_907 (374) = happyShift action_98 action_907 (376) = happyShift action_99 action_907 (377) = happyShift action_100 action_907 (378) = happyShift action_101 action_907 (379) = happyShift action_102 action_907 (380) = happyShift action_103 action_907 (38) = happyGoto action_13 action_907 (142) = happyGoto action_16 action_907 (143) = happyGoto action_1040 action_907 (144) = happyGoto action_110 action_907 (145) = happyGoto action_18 action_907 (147) = happyGoto action_19 action_907 (148) = happyGoto action_20 action_907 (149) = happyGoto action_21 action_907 (150) = happyGoto action_22 action_907 (151) = happyGoto action_23 action_907 (152) = happyGoto action_24 action_907 (192) = happyGoto action_25 action_907 (195) = happyGoto action_26 action_907 (198) = happyGoto action_27 action_907 (219) = happyGoto action_29 action_907 (220) = happyGoto action_30 action_907 (221) = happyGoto action_111 action_907 (227) = happyGoto action_32 action_907 (229) = happyGoto action_33 action_907 (230) = happyGoto action_34 action_907 (233) = happyGoto action_35 action_907 _ = happyFail action_908 (309) = happyShift action_1039 action_908 _ = happyFail action_909 _ = happyReduce_184 action_910 _ = happyReduce_181 action_911 _ = happyReduce_215 action_912 (245) = happyShift action_37 action_912 (253) = happyShift action_40 action_912 (265) = happyShift action_46 action_912 (270) = happyShift action_385 action_912 (272) = happyShift action_49 action_912 (273) = happyShift action_50 action_912 (274) = happyShift action_51 action_912 (275) = happyShift action_221 action_912 (276) = happyShift action_222 action_912 (277) = happyShift action_223 action_912 (280) = happyShift action_57 action_912 (281) = happyShift action_58 action_912 (282) = happyShift action_59 action_912 (283) = happyShift action_60 action_912 (286) = happyShift action_62 action_912 (299) = happyShift action_225 action_912 (300) = happyShift action_226 action_912 (321) = happyShift action_227 action_912 (328) = happyShift action_228 action_912 (332) = happyShift action_229 action_912 (334) = happyShift action_230 action_912 (336) = happyShift action_231 action_912 (338) = happyShift action_232 action_912 (345) = happyShift action_233 action_912 (346) = happyShift action_234 action_912 (347) = happyShift action_235 action_912 (351) = happyShift action_236 action_912 (355) = happyShift action_237 action_912 (356) = happyShift action_84 action_912 (358) = happyShift action_238 action_912 (359) = happyShift action_239 action_912 (376) = happyShift action_240 action_912 (377) = happyShift action_241 action_912 (379) = happyShift action_102 action_912 (380) = happyShift action_103 action_912 (96) = happyGoto action_1038 action_912 (100) = happyGoto action_208 action_912 (102) = happyGoto action_380 action_912 (103) = happyGoto action_381 action_912 (105) = happyGoto action_382 action_912 (106) = happyGoto action_383 action_912 (107) = happyGoto action_211 action_912 (142) = happyGoto action_212 action_912 (192) = happyGoto action_384 action_912 (202) = happyGoto action_213 action_912 (203) = happyGoto action_214 action_912 (205) = happyGoto action_215 action_912 (206) = happyGoto action_216 action_912 (215) = happyGoto action_217 action_912 (217) = happyGoto action_218 action_912 (227) = happyGoto action_219 action_912 _ = happyFail action_913 (368) = happyShift action_146 action_913 (238) = happyGoto action_914 action_913 (242) = happyGoto action_1037 action_913 _ = happyReduce_647 action_914 _ = happyReduce_646 action_915 (367) = happyShift action_145 action_915 (132) = happyGoto action_1036 action_915 (133) = happyGoto action_539 action_915 (237) = happyGoto action_540 action_915 (243) = happyGoto action_541 action_915 _ = happyReduce_649 action_916 _ = happyReduce_280 action_917 (337) = happyShift action_1034 action_917 (343) = happyShift action_1035 action_917 _ = happyFail action_918 _ = happyReduce_310 action_919 (333) = happyShift action_1033 action_919 _ = happyFail action_920 _ = happyReduce_304 action_921 (245) = happyShift action_37 action_921 (253) = happyShift action_40 action_921 (265) = happyShift action_46 action_921 (272) = happyShift action_49 action_921 (273) = happyShift action_50 action_921 (274) = happyShift action_51 action_921 (275) = happyShift action_221 action_921 (276) = happyShift action_222 action_921 (277) = happyShift action_223 action_921 (280) = happyShift action_57 action_921 (281) = happyShift action_58 action_921 (282) = happyShift action_59 action_921 (283) = happyShift action_60 action_921 (286) = happyShift action_62 action_921 (322) = happyShift action_874 action_921 (332) = happyShift action_875 action_921 (336) = happyShift action_876 action_921 (346) = happyShift action_234 action_921 (347) = happyShift action_235 action_921 (351) = happyShift action_236 action_921 (355) = happyShift action_237 action_921 (118) = happyGoto action_1032 action_921 (119) = happyGoto action_869 action_921 (120) = happyGoto action_870 action_921 (121) = happyGoto action_871 action_921 (205) = happyGoto action_872 action_921 (206) = happyGoto action_216 action_921 (215) = happyGoto action_873 action_921 (217) = happyGoto action_218 action_921 (227) = happyGoto action_219 action_921 _ = happyFail action_922 _ = happyReduce_272 action_923 _ = happyReduce_266 action_924 (337) = happyShift action_1031 action_924 _ = happyFail action_925 _ = happyReduce_157 action_926 (244) = happyShift action_36 action_926 (245) = happyShift action_37 action_926 (246) = happyShift action_38 action_926 (248) = happyShift action_858 action_926 (251) = happyShift action_39 action_926 (253) = happyShift action_40 action_926 (254) = happyShift action_41 action_926 (257) = happyShift action_42 action_926 (258) = happyShift action_43 action_926 (259) = happyShift action_44 action_926 (261) = happyShift action_45 action_926 (263) = happyShift action_134 action_926 (265) = happyShift action_46 action_926 (267) = happyShift action_859 action_926 (269) = happyShift action_47 action_926 (270) = happyShift action_48 action_926 (272) = happyShift action_49 action_926 (273) = happyShift action_50 action_926 (274) = happyShift action_51 action_926 (275) = happyShift action_52 action_926 (276) = happyShift action_53 action_926 (277) = happyShift action_54 action_926 (278) = happyShift action_55 action_926 (279) = happyShift action_56 action_926 (280) = happyShift action_57 action_926 (281) = happyShift action_58 action_926 (282) = happyShift action_59 action_926 (283) = happyShift action_60 action_926 (284) = happyShift action_61 action_926 (286) = happyShift action_62 action_926 (289) = happyShift action_63 action_926 (290) = happyShift action_64 action_926 (291) = happyShift action_65 action_926 (294) = happyShift action_66 action_926 (295) = happyShift action_67 action_926 (296) = happyShift action_68 action_926 (311) = happyShift action_69 action_926 (317) = happyShift action_70 action_926 (320) = happyShift action_71 action_926 (321) = happyShift action_144 action_926 (332) = happyShift action_72 action_926 (334) = happyShift action_73 action_926 (336) = happyShift action_74 action_926 (338) = happyShift action_75 action_926 (340) = happyShift action_76 action_926 (345) = happyShift action_77 action_926 (346) = happyShift action_78 action_926 (347) = happyShift action_79 action_926 (350) = happyShift action_80 action_926 (351) = happyShift action_81 action_926 (354) = happyShift action_82 action_926 (355) = happyShift action_83 action_926 (356) = happyShift action_84 action_926 (357) = happyShift action_85 action_926 (358) = happyShift action_86 action_926 (359) = happyShift action_87 action_926 (360) = happyShift action_88 action_926 (361) = happyShift action_89 action_926 (362) = happyShift action_90 action_926 (363) = happyShift action_91 action_926 (364) = happyShift action_92 action_926 (365) = happyShift action_93 action_926 (366) = happyShift action_94 action_926 (367) = happyShift action_145 action_926 (368) = happyShift action_146 action_926 (369) = happyShift action_147 action_926 (370) = happyShift action_148 action_926 (371) = happyShift action_95 action_926 (372) = happyShift action_96 action_926 (373) = happyShift action_97 action_926 (374) = happyShift action_98 action_926 (376) = happyShift action_99 action_926 (377) = happyShift action_100 action_926 (378) = happyShift action_101 action_926 (379) = happyShift action_102 action_926 (380) = happyShift action_103 action_926 (38) = happyGoto action_13 action_926 (49) = happyGoto action_14 action_926 (57) = happyGoto action_853 action_926 (58) = happyGoto action_854 action_926 (67) = happyGoto action_1030 action_926 (135) = happyGoto action_120 action_926 (136) = happyGoto action_121 action_926 (137) = happyGoto action_857 action_926 (141) = happyGoto action_123 action_926 (142) = happyGoto action_16 action_926 (144) = happyGoto action_124 action_926 (145) = happyGoto action_18 action_926 (147) = happyGoto action_19 action_926 (148) = happyGoto action_20 action_926 (149) = happyGoto action_21 action_926 (150) = happyGoto action_22 action_926 (151) = happyGoto action_23 action_926 (152) = happyGoto action_24 action_926 (192) = happyGoto action_25 action_926 (195) = happyGoto action_26 action_926 (198) = happyGoto action_27 action_926 (218) = happyGoto action_28 action_926 (219) = happyGoto action_29 action_926 (220) = happyGoto action_30 action_926 (221) = happyGoto action_31 action_926 (227) = happyGoto action_32 action_926 (229) = happyGoto action_33 action_926 (230) = happyGoto action_34 action_926 (233) = happyGoto action_35 action_926 (237) = happyGoto action_125 action_926 (238) = happyGoto action_126 action_926 (239) = happyGoto action_127 action_926 (240) = happyGoto action_128 action_926 _ = happyReduce_154 action_927 (310) = happyShift action_1029 action_927 _ = happyFail action_928 _ = happyReduce_158 action_929 (245) = happyShift action_37 action_929 (253) = happyShift action_40 action_929 (265) = happyShift action_46 action_929 (272) = happyShift action_49 action_929 (273) = happyShift action_50 action_929 (274) = happyShift action_51 action_929 (275) = happyShift action_221 action_929 (276) = happyShift action_222 action_929 (277) = happyShift action_223 action_929 (280) = happyShift action_57 action_929 (281) = happyShift action_58 action_929 (282) = happyShift action_59 action_929 (283) = happyShift action_60 action_929 (286) = happyShift action_62 action_929 (299) = happyShift action_225 action_929 (300) = happyShift action_226 action_929 (321) = happyShift action_227 action_929 (328) = happyShift action_228 action_929 (332) = happyShift action_229 action_929 (334) = happyShift action_230 action_929 (336) = happyShift action_231 action_929 (338) = happyShift action_232 action_929 (345) = happyShift action_233 action_929 (346) = happyShift action_234 action_929 (347) = happyShift action_235 action_929 (351) = happyShift action_236 action_929 (355) = happyShift action_237 action_929 (358) = happyShift action_238 action_929 (359) = happyShift action_239 action_929 (376) = happyShift action_240 action_929 (377) = happyShift action_241 action_929 (379) = happyShift action_102 action_929 (380) = happyShift action_103 action_929 (60) = happyGoto action_1028 action_929 (100) = happyGoto action_208 action_929 (103) = happyGoto action_254 action_929 (104) = happyGoto action_255 action_929 (106) = happyGoto action_246 action_929 (107) = happyGoto action_211 action_929 (142) = happyGoto action_212 action_929 (202) = happyGoto action_213 action_929 (203) = happyGoto action_214 action_929 (205) = happyGoto action_215 action_929 (206) = happyGoto action_216 action_929 (215) = happyGoto action_217 action_929 (217) = happyGoto action_218 action_929 (227) = happyGoto action_219 action_929 _ = happyFail action_930 (337) = happyShift action_1027 action_930 _ = happyFail action_931 _ = happyReduce_296 action_932 (245) = happyShift action_37 action_932 (253) = happyShift action_40 action_932 (265) = happyShift action_46 action_932 (272) = happyShift action_49 action_932 (273) = happyShift action_50 action_932 (274) = happyShift action_51 action_932 (275) = happyShift action_221 action_932 (276) = happyShift action_222 action_932 (277) = happyShift action_223 action_932 (280) = happyShift action_57 action_932 (281) = happyShift action_58 action_932 (282) = happyShift action_59 action_932 (283) = happyShift action_60 action_932 (286) = happyShift action_62 action_932 (346) = happyShift action_234 action_932 (215) = happyGoto action_847 action_932 (217) = happyGoto action_218 action_932 (227) = happyGoto action_219 action_932 _ = happyReduce_298 action_933 _ = happyReduce_140 action_934 _ = happyReduce_145 action_935 (1) = happyShift action_601 action_935 (331) = happyShift action_602 action_935 (342) = happyShift action_1022 action_935 (234) = happyGoto action_1026 action_935 _ = happyFail action_936 _ = happyReduce_141 action_937 (245) = happyShift action_37 action_937 (253) = happyShift action_40 action_937 (265) = happyShift action_46 action_937 (272) = happyShift action_49 action_937 (273) = happyShift action_50 action_937 (274) = happyShift action_51 action_937 (275) = happyShift action_221 action_937 (276) = happyShift action_222 action_937 (277) = happyShift action_223 action_937 (280) = happyShift action_57 action_937 (281) = happyShift action_58 action_937 (282) = happyShift action_59 action_937 (283) = happyShift action_60 action_937 (286) = happyShift action_62 action_937 (299) = happyShift action_225 action_937 (300) = happyShift action_226 action_937 (321) = happyShift action_227 action_937 (328) = happyShift action_228 action_937 (332) = happyShift action_229 action_937 (334) = happyShift action_230 action_937 (336) = happyShift action_231 action_937 (338) = happyShift action_232 action_937 (345) = happyShift action_233 action_937 (346) = happyShift action_234 action_937 (347) = happyShift action_235 action_937 (351) = happyShift action_236 action_937 (355) = happyShift action_237 action_937 (358) = happyShift action_238 action_937 (359) = happyShift action_239 action_937 (376) = happyShift action_240 action_937 (377) = happyShift action_241 action_937 (379) = happyShift action_102 action_937 (380) = happyShift action_103 action_937 (100) = happyGoto action_208 action_937 (104) = happyGoto action_1025 action_937 (106) = happyGoto action_210 action_937 (107) = happyGoto action_211 action_937 (142) = happyGoto action_212 action_937 (202) = happyGoto action_213 action_937 (203) = happyGoto action_214 action_937 (205) = happyGoto action_215 action_937 (206) = happyGoto action_216 action_937 (215) = happyGoto action_217 action_937 (217) = happyGoto action_218 action_937 (227) = happyGoto action_219 action_937 _ = happyFail action_938 (244) = happyShift action_36 action_938 (245) = happyShift action_37 action_938 (246) = happyShift action_38 action_938 (251) = happyShift action_39 action_938 (253) = happyShift action_40 action_938 (254) = happyShift action_41 action_938 (261) = happyShift action_45 action_938 (265) = happyShift action_46 action_938 (269) = happyShift action_47 action_938 (270) = happyShift action_48 action_938 (272) = happyShift action_49 action_938 (273) = happyShift action_50 action_938 (274) = happyShift action_51 action_938 (275) = happyShift action_52 action_938 (276) = happyShift action_53 action_938 (277) = happyShift action_54 action_938 (278) = happyShift action_55 action_938 (279) = happyShift action_56 action_938 (280) = happyShift action_57 action_938 (281) = happyShift action_58 action_938 (282) = happyShift action_59 action_938 (283) = happyShift action_60 action_938 (284) = happyShift action_61 action_938 (286) = happyShift action_62 action_938 (294) = happyShift action_66 action_938 (295) = happyShift action_67 action_938 (296) = happyShift action_68 action_938 (311) = happyShift action_69 action_938 (317) = happyShift action_70 action_938 (320) = happyShift action_71 action_938 (332) = happyShift action_72 action_938 (334) = happyShift action_73 action_938 (336) = happyShift action_112 action_938 (338) = happyShift action_75 action_938 (340) = happyShift action_76 action_938 (345) = happyShift action_77 action_938 (346) = happyShift action_78 action_938 (347) = happyShift action_79 action_938 (350) = happyShift action_80 action_938 (351) = happyShift action_81 action_938 (354) = happyShift action_82 action_938 (355) = happyShift action_83 action_938 (356) = happyShift action_84 action_938 (357) = happyShift action_85 action_938 (358) = happyShift action_86 action_938 (359) = happyShift action_87 action_938 (360) = happyShift action_88 action_938 (361) = happyShift action_89 action_938 (362) = happyShift action_90 action_938 (363) = happyShift action_91 action_938 (364) = happyShift action_92 action_938 (365) = happyShift action_93 action_938 (366) = happyShift action_94 action_938 (371) = happyShift action_95 action_938 (372) = happyShift action_96 action_938 (373) = happyShift action_97 action_938 (374) = happyShift action_98 action_938 (376) = happyShift action_99 action_938 (377) = happyShift action_100 action_938 (378) = happyShift action_101 action_938 (379) = happyShift action_102 action_938 (380) = happyShift action_103 action_938 (38) = happyGoto action_13 action_938 (142) = happyGoto action_16 action_938 (144) = happyGoto action_1024 action_938 (145) = happyGoto action_18 action_938 (147) = happyGoto action_19 action_938 (148) = happyGoto action_20 action_938 (149) = happyGoto action_21 action_938 (150) = happyGoto action_22 action_938 (151) = happyGoto action_23 action_938 (152) = happyGoto action_24 action_938 (192) = happyGoto action_25 action_938 (195) = happyGoto action_26 action_938 (198) = happyGoto action_27 action_938 (219) = happyGoto action_29 action_938 (220) = happyGoto action_30 action_938 (221) = happyGoto action_111 action_938 (227) = happyGoto action_32 action_938 (229) = happyGoto action_33 action_938 (230) = happyGoto action_34 action_938 (233) = happyGoto action_35 action_938 _ = happyFail action_939 (245) = happyShift action_37 action_939 (253) = happyShift action_40 action_939 (265) = happyShift action_46 action_939 (272) = happyShift action_49 action_939 (273) = happyShift action_50 action_939 (274) = happyShift action_51 action_939 (275) = happyShift action_221 action_939 (276) = happyShift action_222 action_939 (277) = happyShift action_223 action_939 (280) = happyShift action_57 action_939 (281) = happyShift action_58 action_939 (282) = happyShift action_59 action_939 (283) = happyShift action_60 action_939 (286) = happyShift action_62 action_939 (299) = happyShift action_225 action_939 (300) = happyShift action_226 action_939 (321) = happyShift action_227 action_939 (328) = happyShift action_228 action_939 (332) = happyShift action_229 action_939 (334) = happyShift action_230 action_939 (336) = happyShift action_231 action_939 (338) = happyShift action_232 action_939 (345) = happyShift action_233 action_939 (346) = happyShift action_234 action_939 (347) = happyShift action_235 action_939 (351) = happyShift action_236 action_939 (355) = happyShift action_237 action_939 (358) = happyShift action_238 action_939 (359) = happyShift action_239 action_939 (376) = happyShift action_240 action_939 (377) = happyShift action_241 action_939 (379) = happyShift action_102 action_939 (380) = happyShift action_103 action_939 (100) = happyGoto action_208 action_939 (104) = happyGoto action_1023 action_939 (106) = happyGoto action_210 action_939 (107) = happyGoto action_211 action_939 (142) = happyGoto action_212 action_939 (202) = happyGoto action_213 action_939 (203) = happyGoto action_214 action_939 (205) = happyGoto action_215 action_939 (206) = happyGoto action_216 action_939 (215) = happyGoto action_217 action_939 (217) = happyGoto action_218 action_939 (227) = happyGoto action_219 action_939 _ = happyFail action_940 (329) = happyShift action_1021 action_940 (342) = happyShift action_1022 action_940 _ = happyFail action_941 _ = happyReduce_354 action_942 _ = happyReduce_235 action_943 _ = happyReduce_251 action_944 _ = happyReduce_253 action_945 _ = happyReduce_255 action_946 (310) = happyReduce_247 action_946 (313) = happyReduce_247 action_946 _ = happyReduce_258 action_947 (310) = happyReduce_246 action_947 (313) = happyReduce_246 action_947 _ = happyReduce_257 action_948 _ = happyReduce_118 action_949 (313) = happyReduce_649 action_949 (367) = happyShift action_145 action_949 (237) = happyGoto action_540 action_949 (243) = happyGoto action_1020 action_949 _ = happyReduce_323 action_950 _ = happyReduce_325 action_951 (270) = happyShift action_1019 action_951 (129) = happyGoto action_1018 action_951 _ = happyReduce_329 action_952 (332) = happyShift action_192 action_952 (336) = happyShift action_1015 action_952 (338) = happyShift action_194 action_952 (347) = happyShift action_1016 action_952 (351) = happyShift action_236 action_952 (355) = happyShift action_237 action_952 (124) = happyGoto action_1017 action_952 (125) = happyGoto action_1011 action_952 (196) = happyGoto action_1012 action_952 (197) = happyGoto action_1013 action_952 (198) = happyGoto action_186 action_952 (203) = happyGoto action_1014 action_952 (205) = happyGoto action_215 action_952 (206) = happyGoto action_216 action_952 (230) = happyGoto action_189 action_952 _ = happyReduce_320 action_953 (332) = happyShift action_192 action_953 (336) = happyShift action_1015 action_953 (338) = happyShift action_194 action_953 (347) = happyShift action_1016 action_953 (351) = happyShift action_236 action_953 (355) = happyShift action_237 action_953 (124) = happyGoto action_1010 action_953 (125) = happyGoto action_1011 action_953 (196) = happyGoto action_1012 action_953 (197) = happyGoto action_1013 action_953 (198) = happyGoto action_186 action_953 (203) = happyGoto action_1014 action_953 (205) = happyGoto action_215 action_953 (206) = happyGoto action_216 action_953 (230) = happyGoto action_189 action_953 _ = happyReduce_320 action_954 _ = happyReduce_123 action_955 _ = happyReduce_338 action_956 (245) = happyShift action_37 action_956 (253) = happyShift action_40 action_956 (265) = happyShift action_46 action_956 (270) = happyShift action_249 action_956 (272) = happyShift action_49 action_956 (273) = happyShift action_50 action_956 (274) = happyShift action_51 action_956 (275) = happyShift action_221 action_956 (276) = happyShift action_222 action_956 (277) = happyShift action_223 action_956 (280) = happyShift action_57 action_956 (281) = happyShift action_58 action_956 (282) = happyShift action_59 action_956 (283) = happyShift action_60 action_956 (286) = happyShift action_62 action_956 (299) = happyShift action_225 action_956 (300) = happyShift action_226 action_956 (321) = happyShift action_227 action_956 (328) = happyShift action_228 action_956 (332) = happyShift action_229 action_956 (334) = happyShift action_230 action_956 (336) = happyShift action_231 action_956 (337) = happyShift action_1009 action_956 (338) = happyShift action_232 action_956 (345) = happyShift action_233 action_956 (346) = happyShift action_234 action_956 (347) = happyShift action_235 action_956 (351) = happyShift action_236 action_956 (355) = happyShift action_237 action_956 (356) = happyShift action_84 action_956 (358) = happyShift action_238 action_956 (359) = happyShift action_239 action_956 (376) = happyShift action_240 action_956 (377) = happyShift action_241 action_956 (379) = happyShift action_102 action_956 (380) = happyShift action_103 action_956 (95) = happyGoto action_242 action_956 (100) = happyGoto action_208 action_956 (101) = happyGoto action_243 action_956 (103) = happyGoto action_244 action_956 (104) = happyGoto action_245 action_956 (106) = happyGoto action_246 action_956 (107) = happyGoto action_211 action_956 (108) = happyGoto action_1007 action_956 (109) = happyGoto action_1008 action_956 (142) = happyGoto action_212 action_956 (192) = happyGoto action_248 action_956 (202) = happyGoto action_213 action_956 (203) = happyGoto action_214 action_956 (205) = happyGoto action_215 action_956 (206) = happyGoto action_216 action_956 (215) = happyGoto action_217 action_956 (217) = happyGoto action_218 action_956 (227) = happyGoto action_219 action_956 _ = happyFail action_957 (337) = happyShift action_1006 action_957 _ = happyFail action_958 _ = happyReduce_44 action_959 (245) = happyShift action_37 action_959 (253) = happyShift action_40 action_959 (262) = happyShift action_1003 action_959 (265) = happyShift action_46 action_959 (267) = happyShift action_1004 action_959 (270) = happyShift action_48 action_959 (272) = happyShift action_49 action_959 (273) = happyShift action_50 action_959 (274) = happyShift action_51 action_959 (275) = happyShift action_52 action_959 (276) = happyShift action_53 action_959 (277) = happyShift action_54 action_959 (279) = happyShift action_56 action_959 (280) = happyShift action_57 action_959 (281) = happyShift action_58 action_959 (282) = happyShift action_59 action_959 (283) = happyShift action_60 action_959 (286) = happyShift action_62 action_959 (332) = happyShift action_192 action_959 (336) = happyShift action_320 action_959 (338) = happyShift action_194 action_959 (343) = happyShift action_1005 action_959 (346) = happyShift action_78 action_959 (347) = happyShift action_79 action_959 (350) = happyShift action_80 action_959 (351) = happyShift action_81 action_959 (354) = happyShift action_82 action_959 (355) = happyShift action_83 action_959 (34) = happyGoto action_1000 action_959 (37) = happyGoto action_1001 action_959 (38) = happyGoto action_1002 action_959 (195) = happyGoto action_26 action_959 (198) = happyGoto action_27 action_959 (219) = happyGoto action_322 action_959 (220) = happyGoto action_30 action_959 (221) = happyGoto action_111 action_959 (227) = happyGoto action_32 action_959 (229) = happyGoto action_33 action_959 (230) = happyGoto action_34 action_959 _ = happyReduce_47 action_960 (367) = happyShift action_145 action_960 (369) = happyShift action_147 action_960 (370) = happyShift action_148 action_960 (32) = happyGoto action_999 action_960 (33) = happyGoto action_960 action_960 (237) = happyGoto action_961 action_960 (239) = happyGoto action_962 action_960 (240) = happyGoto action_963 action_960 _ = happyReduce_49 action_961 _ = happyReduce_52 action_962 _ = happyReduce_51 action_963 _ = happyReduce_50 action_964 (328) = happyShift action_997 action_964 (330) = happyShift action_998 action_964 (22) = happyGoto action_996 action_964 _ = happyFail action_965 _ = happyReduce_24 action_966 _ = happyReduce_25 action_967 _ = happyReduce_464 action_968 _ = happyReduce_452 action_969 _ = happyReduce_453 action_970 _ = happyReduce_450 action_971 (244) = happyShift action_36 action_971 (245) = happyShift action_37 action_971 (246) = happyShift action_38 action_971 (251) = happyShift action_39 action_971 (253) = happyShift action_40 action_971 (254) = happyShift action_41 action_971 (261) = happyShift action_45 action_971 (265) = happyShift action_46 action_971 (269) = happyShift action_47 action_971 (270) = happyShift action_48 action_971 (272) = happyShift action_49 action_971 (273) = happyShift action_50 action_971 (274) = happyShift action_51 action_971 (275) = happyShift action_52 action_971 (276) = happyShift action_53 action_971 (277) = happyShift action_54 action_971 (278) = happyShift action_55 action_971 (279) = happyShift action_56 action_971 (280) = happyShift action_57 action_971 (281) = happyShift action_58 action_971 (282) = happyShift action_59 action_971 (283) = happyShift action_60 action_971 (284) = happyShift action_61 action_971 (286) = happyShift action_62 action_971 (294) = happyShift action_66 action_971 (295) = happyShift action_67 action_971 (296) = happyShift action_68 action_971 (311) = happyShift action_69 action_971 (317) = happyShift action_70 action_971 (320) = happyShift action_71 action_971 (332) = happyShift action_72 action_971 (334) = happyShift action_73 action_971 (336) = happyShift action_112 action_971 (338) = happyShift action_75 action_971 (340) = happyShift action_76 action_971 (345) = happyShift action_77 action_971 (346) = happyShift action_78 action_971 (347) = happyShift action_79 action_971 (350) = happyShift action_80 action_971 (351) = happyShift action_81 action_971 (354) = happyShift action_82 action_971 (355) = happyShift action_83 action_971 (356) = happyShift action_84 action_971 (357) = happyShift action_85 action_971 (358) = happyShift action_86 action_971 (359) = happyShift action_87 action_971 (360) = happyShift action_88 action_971 (361) = happyShift action_89 action_971 (362) = happyShift action_90 action_971 (363) = happyShift action_91 action_971 (364) = happyShift action_92 action_971 (365) = happyShift action_93 action_971 (366) = happyShift action_94 action_971 (371) = happyShift action_95 action_971 (372) = happyShift action_96 action_971 (373) = happyShift action_97 action_971 (374) = happyShift action_98 action_971 (376) = happyShift action_99 action_971 (377) = happyShift action_100 action_971 (378) = happyShift action_101 action_971 (379) = happyShift action_102 action_971 (380) = happyShift action_103 action_971 (38) = happyGoto action_13 action_971 (142) = happyGoto action_16 action_971 (143) = happyGoto action_995 action_971 (144) = happyGoto action_110 action_971 (145) = happyGoto action_18 action_971 (147) = happyGoto action_19 action_971 (148) = happyGoto action_20 action_971 (149) = happyGoto action_21 action_971 (150) = happyGoto action_22 action_971 (151) = happyGoto action_23 action_971 (152) = happyGoto action_24 action_971 (192) = happyGoto action_25 action_971 (195) = happyGoto action_26 action_971 (198) = happyGoto action_27 action_971 (219) = happyGoto action_29 action_971 (220) = happyGoto action_30 action_971 (221) = happyGoto action_111 action_971 (227) = happyGoto action_32 action_971 (229) = happyGoto action_33 action_971 (230) = happyGoto action_34 action_971 (233) = happyGoto action_35 action_971 _ = happyFail action_972 (244) = happyShift action_36 action_972 (245) = happyShift action_37 action_972 (246) = happyShift action_38 action_972 (251) = happyShift action_39 action_972 (253) = happyShift action_40 action_972 (254) = happyShift action_41 action_972 (261) = happyShift action_45 action_972 (265) = happyShift action_46 action_972 (269) = happyShift action_47 action_972 (270) = happyShift action_48 action_972 (272) = happyShift action_49 action_972 (273) = happyShift action_50 action_972 (274) = happyShift action_51 action_972 (275) = happyShift action_52 action_972 (276) = happyShift action_53 action_972 (277) = happyShift action_54 action_972 (278) = happyShift action_55 action_972 (279) = happyShift action_56 action_972 (280) = happyShift action_57 action_972 (281) = happyShift action_58 action_972 (282) = happyShift action_59 action_972 (283) = happyShift action_60 action_972 (284) = happyShift action_61 action_972 (286) = happyShift action_62 action_972 (294) = happyShift action_66 action_972 (295) = happyShift action_67 action_972 (296) = happyShift action_68 action_972 (311) = happyShift action_69 action_972 (317) = happyShift action_70 action_972 (320) = happyShift action_71 action_972 (332) = happyShift action_72 action_972 (334) = happyShift action_73 action_972 (336) = happyShift action_112 action_972 (338) = happyShift action_75 action_972 (340) = happyShift action_76 action_972 (345) = happyShift action_77 action_972 (346) = happyShift action_78 action_972 (347) = happyShift action_79 action_972 (350) = happyShift action_80 action_972 (351) = happyShift action_81 action_972 (354) = happyShift action_82 action_972 (355) = happyShift action_83 action_972 (356) = happyShift action_84 action_972 (357) = happyShift action_85 action_972 (358) = happyShift action_86 action_972 (359) = happyShift action_87 action_972 (360) = happyShift action_88 action_972 (361) = happyShift action_89 action_972 (362) = happyShift action_90 action_972 (363) = happyShift action_91 action_972 (364) = happyShift action_92 action_972 (365) = happyShift action_93 action_972 (366) = happyShift action_94 action_972 (371) = happyShift action_95 action_972 (372) = happyShift action_96 action_972 (373) = happyShift action_97 action_972 (374) = happyShift action_98 action_972 (376) = happyShift action_99 action_972 (377) = happyShift action_100 action_972 (378) = happyShift action_101 action_972 (379) = happyShift action_102 action_972 (380) = happyShift action_103 action_972 (38) = happyGoto action_13 action_972 (142) = happyGoto action_16 action_972 (143) = happyGoto action_994 action_972 (144) = happyGoto action_110 action_972 (145) = happyGoto action_18 action_972 (147) = happyGoto action_19 action_972 (148) = happyGoto action_20 action_972 (149) = happyGoto action_21 action_972 (150) = happyGoto action_22 action_972 (151) = happyGoto action_23 action_972 (152) = happyGoto action_24 action_972 (192) = happyGoto action_25 action_972 (195) = happyGoto action_26 action_972 (198) = happyGoto action_27 action_972 (219) = happyGoto action_29 action_972 (220) = happyGoto action_30 action_972 (221) = happyGoto action_111 action_972 (227) = happyGoto action_32 action_972 (229) = happyGoto action_33 action_972 (230) = happyGoto action_34 action_972 (233) = happyGoto action_35 action_972 _ = happyFail action_973 (244) = happyShift action_36 action_973 (245) = happyShift action_37 action_973 (246) = happyShift action_38 action_973 (251) = happyShift action_39 action_973 (253) = happyShift action_40 action_973 (254) = happyShift action_41 action_973 (261) = happyShift action_45 action_973 (265) = happyShift action_46 action_973 (269) = happyShift action_47 action_973 (270) = happyShift action_48 action_973 (272) = happyShift action_49 action_973 (273) = happyShift action_50 action_973 (274) = happyShift action_51 action_973 (275) = happyShift action_52 action_973 (276) = happyShift action_53 action_973 (277) = happyShift action_54 action_973 (278) = happyShift action_55 action_973 (279) = happyShift action_56 action_973 (280) = happyShift action_57 action_973 (281) = happyShift action_58 action_973 (282) = happyShift action_59 action_973 (283) = happyShift action_60 action_973 (284) = happyShift action_61 action_973 (286) = happyShift action_62 action_973 (294) = happyShift action_66 action_973 (295) = happyShift action_67 action_973 (296) = happyShift action_68 action_973 (311) = happyShift action_69 action_973 (317) = happyShift action_70 action_973 (320) = happyShift action_71 action_973 (332) = happyShift action_72 action_973 (334) = happyShift action_73 action_973 (336) = happyShift action_112 action_973 (338) = happyShift action_75 action_973 (340) = happyShift action_76 action_973 (345) = happyShift action_77 action_973 (346) = happyShift action_78 action_973 (347) = happyShift action_79 action_973 (350) = happyShift action_80 action_973 (351) = happyShift action_81 action_973 (354) = happyShift action_82 action_973 (355) = happyShift action_83 action_973 (356) = happyShift action_84 action_973 (357) = happyShift action_85 action_973 (358) = happyShift action_86 action_973 (359) = happyShift action_87 action_973 (360) = happyShift action_88 action_973 (361) = happyShift action_89 action_973 (362) = happyShift action_90 action_973 (363) = happyShift action_91 action_973 (364) = happyShift action_92 action_973 (365) = happyShift action_93 action_973 (366) = happyShift action_94 action_973 (371) = happyShift action_95 action_973 (372) = happyShift action_96 action_973 (373) = happyShift action_97 action_973 (374) = happyShift action_98 action_973 (376) = happyShift action_99 action_973 (377) = happyShift action_100 action_973 (378) = happyShift action_101 action_973 (379) = happyShift action_102 action_973 (380) = happyShift action_103 action_973 (38) = happyGoto action_13 action_973 (142) = happyGoto action_16 action_973 (143) = happyGoto action_993 action_973 (144) = happyGoto action_110 action_973 (145) = happyGoto action_18 action_973 (147) = happyGoto action_19 action_973 (148) = happyGoto action_20 action_973 (149) = happyGoto action_21 action_973 (150) = happyGoto action_22 action_973 (151) = happyGoto action_23 action_973 (152) = happyGoto action_24 action_973 (192) = happyGoto action_25 action_973 (195) = happyGoto action_26 action_973 (198) = happyGoto action_27 action_973 (219) = happyGoto action_29 action_973 (220) = happyGoto action_30 action_973 (221) = happyGoto action_111 action_973 (227) = happyGoto action_32 action_973 (229) = happyGoto action_33 action_973 (230) = happyGoto action_34 action_973 (233) = happyGoto action_35 action_973 _ = happyFail action_974 _ = happyReduce_445 action_975 _ = happyReduce_372 action_976 _ = happyReduce_473 action_977 _ = happyReduce_476 action_978 (268) = happyShift action_691 action_978 (74) = happyGoto action_992 action_978 _ = happyReduce_171 action_979 (313) = happyShift action_360 action_979 (177) = happyGoto action_399 action_979 _ = happyReduce_479 action_980 (244) = happyShift action_36 action_980 (245) = happyShift action_37 action_980 (246) = happyShift action_38 action_980 (251) = happyShift action_39 action_980 (253) = happyShift action_40 action_980 (254) = happyShift action_41 action_980 (261) = happyShift action_45 action_980 (265) = happyShift action_46 action_980 (269) = happyShift action_47 action_980 (270) = happyShift action_48 action_980 (272) = happyShift action_49 action_980 (273) = happyShift action_50 action_980 (274) = happyShift action_51 action_980 (275) = happyShift action_52 action_980 (276) = happyShift action_53 action_980 (277) = happyShift action_54 action_980 (278) = happyShift action_55 action_980 (279) = happyShift action_56 action_980 (280) = happyShift action_57 action_980 (281) = happyShift action_58 action_980 (282) = happyShift action_59 action_980 (283) = happyShift action_60 action_980 (284) = happyShift action_61 action_980 (286) = happyShift action_62 action_980 (294) = happyShift action_66 action_980 (295) = happyShift action_67 action_980 (296) = happyShift action_68 action_980 (311) = happyShift action_69 action_980 (317) = happyShift action_70 action_980 (320) = happyShift action_71 action_980 (332) = happyShift action_72 action_980 (334) = happyShift action_73 action_980 (336) = happyShift action_112 action_980 (338) = happyShift action_75 action_980 (340) = happyShift action_76 action_980 (345) = happyShift action_77 action_980 (346) = happyShift action_78 action_980 (347) = happyShift action_79 action_980 (350) = happyShift action_80 action_980 (351) = happyShift action_81 action_980 (354) = happyShift action_82 action_980 (355) = happyShift action_83 action_980 (356) = happyShift action_84 action_980 (357) = happyShift action_85 action_980 (358) = happyShift action_86 action_980 (359) = happyShift action_87 action_980 (360) = happyShift action_88 action_980 (361) = happyShift action_89 action_980 (362) = happyShift action_90 action_980 (363) = happyShift action_91 action_980 (364) = happyShift action_92 action_980 (365) = happyShift action_93 action_980 (366) = happyShift action_94 action_980 (371) = happyShift action_95 action_980 (372) = happyShift action_96 action_980 (373) = happyShift action_97 action_980 (374) = happyShift action_98 action_980 (376) = happyShift action_99 action_980 (377) = happyShift action_100 action_980 (378) = happyShift action_101 action_980 (379) = happyShift action_102 action_980 (380) = happyShift action_103 action_980 (38) = happyGoto action_13 action_980 (142) = happyGoto action_16 action_980 (143) = happyGoto action_991 action_980 (144) = happyGoto action_110 action_980 (145) = happyGoto action_18 action_980 (147) = happyGoto action_19 action_980 (148) = happyGoto action_20 action_980 (149) = happyGoto action_21 action_980 (150) = happyGoto action_22 action_980 (151) = happyGoto action_23 action_980 (152) = happyGoto action_24 action_980 (192) = happyGoto action_25 action_980 (195) = happyGoto action_26 action_980 (198) = happyGoto action_27 action_980 (219) = happyGoto action_29 action_980 (220) = happyGoto action_30 action_980 (221) = happyGoto action_111 action_980 (227) = happyGoto action_32 action_980 (229) = happyGoto action_33 action_980 (230) = happyGoto action_34 action_980 (233) = happyGoto action_35 action_980 _ = happyFail action_981 (359) = happyShift action_990 action_981 _ = happyFail action_982 _ = happyReduce_360 action_983 _ = happyReduce_359 action_984 (245) = happyShift action_37 action_984 (253) = happyShift action_40 action_984 (265) = happyShift action_46 action_984 (270) = happyShift action_249 action_984 (272) = happyShift action_49 action_984 (273) = happyShift action_50 action_984 (274) = happyShift action_51 action_984 (275) = happyShift action_221 action_984 (276) = happyShift action_222 action_984 (277) = happyShift action_223 action_984 (280) = happyShift action_57 action_984 (281) = happyShift action_58 action_984 (282) = happyShift action_59 action_984 (283) = happyShift action_60 action_984 (286) = happyShift action_62 action_984 (299) = happyShift action_225 action_984 (300) = happyShift action_226 action_984 (321) = happyShift action_227 action_984 (328) = happyShift action_228 action_984 (332) = happyShift action_229 action_984 (334) = happyShift action_230 action_984 (336) = happyShift action_231 action_984 (338) = happyShift action_232 action_984 (345) = happyShift action_233 action_984 (346) = happyShift action_234 action_984 (347) = happyShift action_235 action_984 (351) = happyShift action_236 action_984 (355) = happyShift action_237 action_984 (356) = happyShift action_84 action_984 (358) = happyShift action_238 action_984 (359) = happyShift action_239 action_984 (376) = happyShift action_240 action_984 (377) = happyShift action_241 action_984 (379) = happyShift action_102 action_984 (380) = happyShift action_103 action_984 (95) = happyGoto action_801 action_984 (98) = happyGoto action_989 action_984 (100) = happyGoto action_208 action_984 (101) = happyGoto action_243 action_984 (103) = happyGoto action_244 action_984 (104) = happyGoto action_245 action_984 (106) = happyGoto action_246 action_984 (107) = happyGoto action_211 action_984 (142) = happyGoto action_212 action_984 (192) = happyGoto action_248 action_984 (202) = happyGoto action_213 action_984 (203) = happyGoto action_214 action_984 (205) = happyGoto action_215 action_984 (206) = happyGoto action_216 action_984 (215) = happyGoto action_217 action_984 (217) = happyGoto action_218 action_984 (227) = happyGoto action_219 action_984 _ = happyFail action_985 (252) = happyShift action_988 action_985 _ = happyFail action_986 _ = happyReduce_258 action_987 _ = happyReduce_257 action_988 (244) = happyShift action_36 action_988 (245) = happyShift action_37 action_988 (246) = happyShift action_38 action_988 (251) = happyShift action_39 action_988 (253) = happyShift action_40 action_988 (254) = happyShift action_41 action_988 (261) = happyShift action_45 action_988 (265) = happyShift action_46 action_988 (269) = happyShift action_47 action_988 (270) = happyShift action_48 action_988 (272) = happyShift action_49 action_988 (273) = happyShift action_50 action_988 (274) = happyShift action_51 action_988 (275) = happyShift action_52 action_988 (276) = happyShift action_53 action_988 (277) = happyShift action_54 action_988 (278) = happyShift action_55 action_988 (279) = happyShift action_56 action_988 (280) = happyShift action_57 action_988 (281) = happyShift action_58 action_988 (282) = happyShift action_59 action_988 (283) = happyShift action_60 action_988 (284) = happyShift action_61 action_988 (286) = happyShift action_62 action_988 (294) = happyShift action_66 action_988 (295) = happyShift action_67 action_988 (296) = happyShift action_68 action_988 (311) = happyShift action_69 action_988 (317) = happyShift action_70 action_988 (320) = happyShift action_71 action_988 (332) = happyShift action_72 action_988 (334) = happyShift action_73 action_988 (336) = happyShift action_112 action_988 (338) = happyShift action_75 action_988 (340) = happyShift action_76 action_988 (345) = happyShift action_77 action_988 (346) = happyShift action_78 action_988 (347) = happyShift action_79 action_988 (350) = happyShift action_80 action_988 (351) = happyShift action_81 action_988 (354) = happyShift action_82 action_988 (355) = happyShift action_83 action_988 (356) = happyShift action_84 action_988 (357) = happyShift action_85 action_988 (358) = happyShift action_86 action_988 (359) = happyShift action_87 action_988 (360) = happyShift action_88 action_988 (361) = happyShift action_89 action_988 (362) = happyShift action_90 action_988 (363) = happyShift action_91 action_988 (364) = happyShift action_92 action_988 (365) = happyShift action_93 action_988 (366) = happyShift action_94 action_988 (371) = happyShift action_95 action_988 (372) = happyShift action_96 action_988 (373) = happyShift action_97 action_988 (374) = happyShift action_98 action_988 (376) = happyShift action_99 action_988 (377) = happyShift action_100 action_988 (378) = happyShift action_101 action_988 (379) = happyShift action_102 action_988 (380) = happyShift action_103 action_988 (38) = happyGoto action_13 action_988 (142) = happyGoto action_16 action_988 (143) = happyGoto action_1086 action_988 (144) = happyGoto action_110 action_988 (145) = happyGoto action_18 action_988 (147) = happyGoto action_19 action_988 (148) = happyGoto action_20 action_988 (149) = happyGoto action_21 action_988 (150) = happyGoto action_22 action_988 (151) = happyGoto action_23 action_988 (152) = happyGoto action_24 action_988 (192) = happyGoto action_25 action_988 (195) = happyGoto action_26 action_988 (198) = happyGoto action_27 action_988 (219) = happyGoto action_29 action_988 (220) = happyGoto action_30 action_988 (221) = happyGoto action_111 action_988 (227) = happyGoto action_32 action_988 (229) = happyGoto action_33 action_988 (230) = happyGoto action_34 action_988 (233) = happyGoto action_35 action_988 _ = happyFail action_989 _ = happyReduce_225 action_990 (308) = happyShift action_1085 action_990 _ = happyFail action_991 _ = happyReduce_478 action_992 _ = happyReduce_477 action_993 _ = happyReduce_457 action_994 _ = happyReduce_458 action_995 (288) = happyShift action_1084 action_995 _ = happyFail action_996 _ = happyReduce_13 action_997 (244) = happyShift action_36 action_997 (245) = happyShift action_37 action_997 (246) = happyShift action_38 action_997 (247) = happyShift action_129 action_997 (248) = happyShift action_130 action_997 (249) = happyShift action_131 action_997 (250) = happyShift action_132 action_997 (251) = happyShift action_39 action_997 (253) = happyShift action_40 action_997 (254) = happyShift action_41 action_997 (255) = happyShift action_150 action_997 (257) = happyShift action_42 action_997 (258) = happyShift action_43 action_997 (259) = happyShift action_44 action_997 (260) = happyShift action_133 action_997 (261) = happyShift action_45 action_997 (263) = happyShift action_134 action_997 (265) = happyShift action_46 action_997 (267) = happyShift action_135 action_997 (269) = happyShift action_47 action_997 (270) = happyShift action_48 action_997 (271) = happyShift action_136 action_997 (272) = happyShift action_49 action_997 (273) = happyShift action_50 action_997 (274) = happyShift action_51 action_997 (275) = happyShift action_52 action_997 (276) = happyShift action_53 action_997 (277) = happyShift action_54 action_997 (278) = happyShift action_55 action_997 (279) = happyShift action_56 action_997 (280) = happyShift action_57 action_997 (281) = happyShift action_58 action_997 (282) = happyShift action_59 action_997 (283) = happyShift action_60 action_997 (284) = happyShift action_61 action_997 (286) = happyShift action_62 action_997 (289) = happyShift action_63 action_997 (290) = happyShift action_64 action_997 (291) = happyShift action_65 action_997 (293) = happyShift action_137 action_997 (294) = happyShift action_66 action_997 (295) = happyShift action_67 action_997 (296) = happyShift action_68 action_997 (297) = happyShift action_138 action_997 (298) = happyShift action_139 action_997 (301) = happyShift action_140 action_997 (302) = happyShift action_141 action_997 (303) = happyShift action_142 action_997 (304) = happyShift action_143 action_997 (311) = happyShift action_69 action_997 (317) = happyShift action_70 action_997 (320) = happyShift action_71 action_997 (321) = happyShift action_144 action_997 (332) = happyShift action_72 action_997 (334) = happyShift action_73 action_997 (336) = happyShift action_74 action_997 (338) = happyShift action_75 action_997 (340) = happyShift action_76 action_997 (345) = happyShift action_77 action_997 (346) = happyShift action_78 action_997 (347) = happyShift action_79 action_997 (350) = happyShift action_80 action_997 (351) = happyShift action_81 action_997 (354) = happyShift action_82 action_997 (355) = happyShift action_83 action_997 (356) = happyShift action_84 action_997 (357) = happyShift action_85 action_997 (358) = happyShift action_86 action_997 (359) = happyShift action_87 action_997 (360) = happyShift action_88 action_997 (361) = happyShift action_89 action_997 (362) = happyShift action_90 action_997 (363) = happyShift action_91 action_997 (364) = happyShift action_92 action_997 (365) = happyShift action_93 action_997 (366) = happyShift action_94 action_997 (367) = happyShift action_145 action_997 (368) = happyShift action_146 action_997 (369) = happyShift action_147 action_997 (370) = happyShift action_148 action_997 (371) = happyShift action_95 action_997 (372) = happyShift action_96 action_997 (373) = happyShift action_97 action_997 (374) = happyShift action_98 action_997 (376) = happyShift action_99 action_997 (377) = happyShift action_100 action_997 (378) = happyShift action_101 action_997 (379) = happyShift action_102 action_997 (380) = happyShift action_103 action_997 (24) = happyGoto action_1083 action_997 (25) = happyGoto action_1080 action_997 (38) = happyGoto action_13 action_997 (39) = happyGoto action_1081 action_997 (40) = happyGoto action_1082 action_997 (49) = happyGoto action_14 action_997 (51) = happyGoto action_446 action_997 (52) = happyGoto action_447 action_997 (53) = happyGoto action_114 action_997 (54) = happyGoto action_115 action_997 (55) = happyGoto action_116 action_997 (58) = happyGoto action_117 action_997 (62) = happyGoto action_118 action_997 (88) = happyGoto action_119 action_997 (135) = happyGoto action_120 action_997 (136) = happyGoto action_121 action_997 (137) = happyGoto action_122 action_997 (141) = happyGoto action_123 action_997 (142) = happyGoto action_16 action_997 (144) = happyGoto action_124 action_997 (145) = happyGoto action_18 action_997 (147) = happyGoto action_19 action_997 (148) = happyGoto action_20 action_997 (149) = happyGoto action_21 action_997 (150) = happyGoto action_22 action_997 (151) = happyGoto action_23 action_997 (152) = happyGoto action_24 action_997 (192) = happyGoto action_25 action_997 (195) = happyGoto action_26 action_997 (198) = happyGoto action_27 action_997 (218) = happyGoto action_28 action_997 (219) = happyGoto action_29 action_997 (220) = happyGoto action_30 action_997 (221) = happyGoto action_31 action_997 (227) = happyGoto action_32 action_997 (229) = happyGoto action_33 action_997 (230) = happyGoto action_34 action_997 (233) = happyGoto action_35 action_997 (237) = happyGoto action_125 action_997 (238) = happyGoto action_126 action_997 (239) = happyGoto action_127 action_997 (240) = happyGoto action_128 action_997 _ = happyReduce_68 action_998 (244) = happyShift action_36 action_998 (245) = happyShift action_37 action_998 (246) = happyShift action_38 action_998 (247) = happyShift action_129 action_998 (248) = happyShift action_130 action_998 (249) = happyShift action_131 action_998 (250) = happyShift action_132 action_998 (251) = happyShift action_39 action_998 (253) = happyShift action_40 action_998 (254) = happyShift action_41 action_998 (255) = happyShift action_150 action_998 (257) = happyShift action_42 action_998 (258) = happyShift action_43 action_998 (259) = happyShift action_44 action_998 (260) = happyShift action_133 action_998 (261) = happyShift action_45 action_998 (263) = happyShift action_134 action_998 (265) = happyShift action_46 action_998 (267) = happyShift action_135 action_998 (269) = happyShift action_47 action_998 (270) = happyShift action_48 action_998 (271) = happyShift action_136 action_998 (272) = happyShift action_49 action_998 (273) = happyShift action_50 action_998 (274) = happyShift action_51 action_998 (275) = happyShift action_52 action_998 (276) = happyShift action_53 action_998 (277) = happyShift action_54 action_998 (278) = happyShift action_55 action_998 (279) = happyShift action_56 action_998 (280) = happyShift action_57 action_998 (281) = happyShift action_58 action_998 (282) = happyShift action_59 action_998 (283) = happyShift action_60 action_998 (284) = happyShift action_61 action_998 (286) = happyShift action_62 action_998 (289) = happyShift action_63 action_998 (290) = happyShift action_64 action_998 (291) = happyShift action_65 action_998 (293) = happyShift action_137 action_998 (294) = happyShift action_66 action_998 (295) = happyShift action_67 action_998 (296) = happyShift action_68 action_998 (297) = happyShift action_138 action_998 (298) = happyShift action_139 action_998 (301) = happyShift action_140 action_998 (302) = happyShift action_141 action_998 (303) = happyShift action_142 action_998 (304) = happyShift action_143 action_998 (311) = happyShift action_69 action_998 (317) = happyShift action_70 action_998 (320) = happyShift action_71 action_998 (321) = happyShift action_144 action_998 (332) = happyShift action_72 action_998 (334) = happyShift action_73 action_998 (336) = happyShift action_74 action_998 (338) = happyShift action_75 action_998 (340) = happyShift action_76 action_998 (345) = happyShift action_77 action_998 (346) = happyShift action_78 action_998 (347) = happyShift action_79 action_998 (350) = happyShift action_80 action_998 (351) = happyShift action_81 action_998 (354) = happyShift action_82 action_998 (355) = happyShift action_83 action_998 (356) = happyShift action_84 action_998 (357) = happyShift action_85 action_998 (358) = happyShift action_86 action_998 (359) = happyShift action_87 action_998 (360) = happyShift action_88 action_998 (361) = happyShift action_89 action_998 (362) = happyShift action_90 action_998 (363) = happyShift action_91 action_998 (364) = happyShift action_92 action_998 (365) = happyShift action_93 action_998 (366) = happyShift action_94 action_998 (367) = happyShift action_145 action_998 (368) = happyShift action_146 action_998 (369) = happyShift action_147 action_998 (370) = happyShift action_148 action_998 (371) = happyShift action_95 action_998 (372) = happyShift action_96 action_998 (373) = happyShift action_97 action_998 (374) = happyShift action_98 action_998 (376) = happyShift action_99 action_998 (377) = happyShift action_100 action_998 (378) = happyShift action_101 action_998 (379) = happyShift action_102 action_998 (380) = happyShift action_103 action_998 (24) = happyGoto action_1079 action_998 (25) = happyGoto action_1080 action_998 (38) = happyGoto action_13 action_998 (39) = happyGoto action_1081 action_998 (40) = happyGoto action_1082 action_998 (49) = happyGoto action_14 action_998 (51) = happyGoto action_446 action_998 (52) = happyGoto action_447 action_998 (53) = happyGoto action_114 action_998 (54) = happyGoto action_115 action_998 (55) = happyGoto action_116 action_998 (58) = happyGoto action_117 action_998 (62) = happyGoto action_118 action_998 (88) = happyGoto action_119 action_998 (135) = happyGoto action_120 action_998 (136) = happyGoto action_121 action_998 (137) = happyGoto action_122 action_998 (141) = happyGoto action_123 action_998 (142) = happyGoto action_16 action_998 (144) = happyGoto action_124 action_998 (145) = happyGoto action_18 action_998 (147) = happyGoto action_19 action_998 (148) = happyGoto action_20 action_998 (149) = happyGoto action_21 action_998 (150) = happyGoto action_22 action_998 (151) = happyGoto action_23 action_998 (152) = happyGoto action_24 action_998 (192) = happyGoto action_25 action_998 (195) = happyGoto action_26 action_998 (198) = happyGoto action_27 action_998 (218) = happyGoto action_28 action_998 (219) = happyGoto action_29 action_998 (220) = happyGoto action_30 action_998 (221) = happyGoto action_31 action_998 (227) = happyGoto action_32 action_998 (229) = happyGoto action_33 action_998 (230) = happyGoto action_34 action_998 (233) = happyGoto action_35 action_998 (237) = happyGoto action_125 action_998 (238) = happyGoto action_126 action_998 (239) = happyGoto action_127 action_998 (240) = happyGoto action_128 action_998 _ = happyReduce_68 action_999 _ = happyReduce_48 action_1000 (367) = happyShift action_145 action_1000 (369) = happyShift action_147 action_1000 (370) = happyShift action_148 action_1000 (32) = happyGoto action_1078 action_1000 (33) = happyGoto action_960 action_1000 (237) = happyGoto action_961 action_1000 (239) = happyGoto action_962 action_1000 (240) = happyGoto action_963 action_1000 _ = happyReduce_49 action_1001 (336) = happyShift action_1077 action_1001 (35) = happyGoto action_1076 action_1001 _ = happyReduce_55 action_1002 _ = happyReduce_61 action_1003 (347) = happyShift action_469 action_1003 (351) = happyShift action_470 action_1003 (235) = happyGoto action_1075 action_1003 _ = happyFail action_1004 (245) = happyShift action_37 action_1004 (253) = happyShift action_40 action_1004 (265) = happyShift action_46 action_1004 (270) = happyShift action_48 action_1004 (272) = happyShift action_49 action_1004 (273) = happyShift action_50 action_1004 (274) = happyShift action_51 action_1004 (275) = happyShift action_52 action_1004 (276) = happyShift action_53 action_1004 (277) = happyShift action_54 action_1004 (279) = happyShift action_56 action_1004 (280) = happyShift action_57 action_1004 (281) = happyShift action_58 action_1004 (282) = happyShift action_59 action_1004 (283) = happyShift action_60 action_1004 (286) = happyShift action_62 action_1004 (332) = happyShift action_192 action_1004 (336) = happyShift action_320 action_1004 (338) = happyShift action_194 action_1004 (346) = happyShift action_78 action_1004 (347) = happyShift action_79 action_1004 (350) = happyShift action_80 action_1004 (351) = happyShift action_81 action_1004 (354) = happyShift action_82 action_1004 (355) = happyShift action_83 action_1004 (38) = happyGoto action_1074 action_1004 (195) = happyGoto action_26 action_1004 (198) = happyGoto action_27 action_1004 (219) = happyGoto action_322 action_1004 (220) = happyGoto action_30 action_1004 (221) = happyGoto action_111 action_1004 (227) = happyGoto action_32 action_1004 (229) = happyGoto action_33 action_1004 (230) = happyGoto action_34 action_1004 _ = happyFail action_1005 (367) = happyShift action_145 action_1005 (369) = happyShift action_147 action_1005 (370) = happyShift action_148 action_1005 (32) = happyGoto action_1073 action_1005 (33) = happyGoto action_960 action_1005 (237) = happyGoto action_961 action_1005 (239) = happyGoto action_962 action_1005 (240) = happyGoto action_963 action_1005 _ = happyReduce_49 action_1006 _ = happyReduce_41 action_1007 (343) = happyShift action_1072 action_1007 _ = happyReduce_284 action_1008 (337) = happyShift action_1071 action_1008 _ = happyFail action_1009 _ = happyReduce_339 action_1010 (1) = happyShift action_601 action_1010 (331) = happyShift action_602 action_1010 (234) = happyGoto action_1070 action_1010 _ = happyFail action_1011 (342) = happyShift action_1069 action_1011 _ = happyReduce_319 action_1012 (343) = happyShift action_1068 action_1012 _ = happyReduce_525 action_1013 (309) = happyShift action_1067 action_1013 _ = happyFail action_1014 (328) = happyShift action_1066 action_1014 _ = happyFail action_1015 (308) = happyShift action_267 action_1015 (317) = happyShift action_458 action_1015 (322) = happyShift action_460 action_1015 (337) = happyShift action_295 action_1015 (343) = happyShift action_296 action_1015 (348) = happyShift action_462 action_1015 (349) = happyShift action_1065 action_1015 (352) = happyShift action_464 action_1015 (353) = happyShift action_465 action_1015 (207) = happyGoto action_454 action_1015 (208) = happyGoto action_455 action_1015 (232) = happyGoto action_569 action_1015 (236) = happyGoto action_441 action_1015 _ = happyFail action_1016 (328) = happyReduce_554 action_1016 _ = happyReduce_622 action_1017 (329) = happyShift action_1064 action_1017 _ = happyFail action_1018 (245) = happyShift action_37 action_1018 (253) = happyShift action_40 action_1018 (265) = happyShift action_46 action_1018 (272) = happyShift action_49 action_1018 (273) = happyShift action_50 action_1018 (274) = happyShift action_51 action_1018 (275) = happyShift action_221 action_1018 (276) = happyShift action_222 action_1018 (277) = happyShift action_223 action_1018 (280) = happyShift action_57 action_1018 (281) = happyShift action_58 action_1018 (282) = happyShift action_59 action_1018 (283) = happyShift action_60 action_1018 (286) = happyShift action_62 action_1018 (299) = happyShift action_225 action_1018 (300) = happyShift action_226 action_1018 (321) = happyShift action_227 action_1018 (328) = happyShift action_228 action_1018 (332) = happyShift action_229 action_1018 (334) = happyShift action_230 action_1018 (336) = happyShift action_231 action_1018 (338) = happyShift action_232 action_1018 (345) = happyShift action_233 action_1018 (346) = happyShift action_234 action_1018 (347) = happyShift action_235 action_1018 (351) = happyShift action_236 action_1018 (355) = happyShift action_237 action_1018 (358) = happyShift action_238 action_1018 (359) = happyShift action_239 action_1018 (376) = happyShift action_240 action_1018 (377) = happyShift action_241 action_1018 (379) = happyShift action_102 action_1018 (380) = happyShift action_103 action_1018 (100) = happyGoto action_208 action_1018 (103) = happyGoto action_1061 action_1018 (106) = happyGoto action_1062 action_1018 (107) = happyGoto action_211 action_1018 (130) = happyGoto action_1063 action_1018 (142) = happyGoto action_212 action_1018 (202) = happyGoto action_213 action_1018 (203) = happyGoto action_214 action_1018 (205) = happyGoto action_215 action_1018 (206) = happyGoto action_216 action_1018 (215) = happyGoto action_217 action_1018 (217) = happyGoto action_218 action_1018 (227) = happyGoto action_219 action_1018 _ = happyFail action_1019 (245) = happyShift action_37 action_1019 (253) = happyShift action_40 action_1019 (265) = happyShift action_46 action_1019 (272) = happyShift action_49 action_1019 (273) = happyShift action_50 action_1019 (274) = happyShift action_51 action_1019 (275) = happyShift action_221 action_1019 (276) = happyShift action_222 action_1019 (277) = happyShift action_223 action_1019 (280) = happyShift action_57 action_1019 (281) = happyShift action_58 action_1019 (282) = happyShift action_59 action_1019 (283) = happyShift action_60 action_1019 (286) = happyShift action_62 action_1019 (336) = happyShift action_513 action_1019 (346) = happyShift action_234 action_1019 (112) = happyGoto action_1060 action_1019 (113) = happyGoto action_511 action_1019 (215) = happyGoto action_512 action_1019 (217) = happyGoto action_218 action_1019 (227) = happyGoto action_219 action_1019 _ = happyReduce_291 action_1020 (313) = happyShift action_1059 action_1020 _ = happyFail action_1021 _ = happyReduce_147 action_1022 (244) = happyShift action_36 action_1022 (245) = happyShift action_37 action_1022 (246) = happyShift action_38 action_1022 (248) = happyShift action_937 action_1022 (249) = happyShift action_938 action_1022 (251) = happyShift action_39 action_1022 (253) = happyShift action_40 action_1022 (254) = happyShift action_41 action_1022 (257) = happyShift action_42 action_1022 (258) = happyShift action_43 action_1022 (259) = happyShift action_44 action_1022 (261) = happyShift action_45 action_1022 (265) = happyShift action_46 action_1022 (267) = happyShift action_939 action_1022 (269) = happyShift action_47 action_1022 (270) = happyShift action_48 action_1022 (272) = happyShift action_49 action_1022 (273) = happyShift action_50 action_1022 (274) = happyShift action_51 action_1022 (275) = happyShift action_52 action_1022 (276) = happyShift action_53 action_1022 (277) = happyShift action_54 action_1022 (278) = happyShift action_55 action_1022 (279) = happyShift action_56 action_1022 (280) = happyShift action_57 action_1022 (281) = happyShift action_58 action_1022 (282) = happyShift action_59 action_1022 (283) = happyShift action_60 action_1022 (284) = happyShift action_61 action_1022 (286) = happyShift action_62 action_1022 (289) = happyShift action_63 action_1022 (290) = happyShift action_64 action_1022 (291) = happyShift action_65 action_1022 (294) = happyShift action_66 action_1022 (295) = happyShift action_67 action_1022 (296) = happyShift action_68 action_1022 (311) = happyShift action_69 action_1022 (317) = happyShift action_70 action_1022 (320) = happyShift action_71 action_1022 (321) = happyShift action_144 action_1022 (332) = happyShift action_72 action_1022 (334) = happyShift action_73 action_1022 (336) = happyShift action_74 action_1022 (338) = happyShift action_75 action_1022 (340) = happyShift action_76 action_1022 (345) = happyShift action_77 action_1022 (346) = happyShift action_78 action_1022 (347) = happyShift action_79 action_1022 (350) = happyShift action_80 action_1022 (351) = happyShift action_81 action_1022 (354) = happyShift action_82 action_1022 (355) = happyShift action_83 action_1022 (356) = happyShift action_84 action_1022 (357) = happyShift action_85 action_1022 (358) = happyShift action_86 action_1022 (359) = happyShift action_87 action_1022 (360) = happyShift action_88 action_1022 (361) = happyShift action_89 action_1022 (362) = happyShift action_90 action_1022 (363) = happyShift action_91 action_1022 (364) = happyShift action_92 action_1022 (365) = happyShift action_93 action_1022 (366) = happyShift action_94 action_1022 (367) = happyShift action_145 action_1022 (368) = happyShift action_146 action_1022 (369) = happyShift action_147 action_1022 (370) = happyShift action_148 action_1022 (371) = happyShift action_95 action_1022 (372) = happyShift action_96 action_1022 (373) = happyShift action_97 action_1022 (374) = happyShift action_98 action_1022 (376) = happyShift action_99 action_1022 (377) = happyShift action_100 action_1022 (378) = happyShift action_101 action_1022 (379) = happyShift action_102 action_1022 (380) = happyShift action_103 action_1022 (38) = happyGoto action_13 action_1022 (49) = happyGoto action_14 action_1022 (56) = happyGoto action_933 action_1022 (63) = happyGoto action_1058 action_1022 (135) = happyGoto action_120 action_1022 (136) = happyGoto action_121 action_1022 (137) = happyGoto action_936 action_1022 (141) = happyGoto action_123 action_1022 (142) = happyGoto action_16 action_1022 (144) = happyGoto action_124 action_1022 (145) = happyGoto action_18 action_1022 (147) = happyGoto action_19 action_1022 (148) = happyGoto action_20 action_1022 (149) = happyGoto action_21 action_1022 (150) = happyGoto action_22 action_1022 (151) = happyGoto action_23 action_1022 (152) = happyGoto action_24 action_1022 (192) = happyGoto action_25 action_1022 (195) = happyGoto action_26 action_1022 (198) = happyGoto action_27 action_1022 (218) = happyGoto action_28 action_1022 (219) = happyGoto action_29 action_1022 (220) = happyGoto action_30 action_1022 (221) = happyGoto action_31 action_1022 (227) = happyGoto action_32 action_1022 (229) = happyGoto action_33 action_1022 (230) = happyGoto action_34 action_1022 (233) = happyGoto action_35 action_1022 (237) = happyGoto action_125 action_1022 (238) = happyGoto action_126 action_1022 (239) = happyGoto action_127 action_1022 (240) = happyGoto action_128 action_1022 _ = happyReduce_144 action_1023 (309) = happyShift action_644 action_1023 (310) = happyShift action_1057 action_1023 (59) = happyGoto action_1056 action_1023 _ = happyReduce_132 action_1024 (308) = happyShift action_267 action_1024 (309) = happyShift action_1055 action_1024 (320) = happyShift action_269 action_1024 (321) = happyShift action_270 action_1024 (322) = happyShift action_271 action_1024 (327) = happyShift action_272 action_1024 (344) = happyShift action_273 action_1024 (348) = happyShift action_274 action_1024 (349) = happyShift action_275 action_1024 (352) = happyShift action_276 action_1024 (353) = happyShift action_277 action_1024 (200) = happyGoto action_257 action_1024 (211) = happyGoto action_258 action_1024 (213) = happyGoto action_259 action_1024 (222) = happyGoto action_260 action_1024 (224) = happyGoto action_261 action_1024 (225) = happyGoto action_262 action_1024 (226) = happyGoto action_263 action_1024 (228) = happyGoto action_264 action_1024 (231) = happyGoto action_265 action_1024 (232) = happyGoto action_266 action_1024 _ = happyFail action_1025 (309) = happyShift action_644 action_1025 (59) = happyGoto action_1054 action_1025 _ = happyReduce_132 action_1026 _ = happyReduce_148 action_1027 _ = happyReduce_293 action_1028 (309) = happyShift action_644 action_1028 (310) = happyReduce_649 action_1028 (367) = happyShift action_145 action_1028 (59) = happyGoto action_1052 action_1028 (126) = happyGoto action_1053 action_1028 (237) = happyGoto action_540 action_1028 (243) = happyGoto action_704 action_1028 _ = happyReduce_132 action_1029 (245) = happyShift action_37 action_1029 (253) = happyShift action_40 action_1029 (265) = happyShift action_46 action_1029 (270) = happyShift action_249 action_1029 (272) = happyShift action_49 action_1029 (273) = happyShift action_50 action_1029 (274) = happyShift action_51 action_1029 (275) = happyShift action_221 action_1029 (276) = happyShift action_222 action_1029 (277) = happyShift action_223 action_1029 (280) = happyShift action_57 action_1029 (281) = happyShift action_58 action_1029 (282) = happyShift action_59 action_1029 (283) = happyShift action_60 action_1029 (286) = happyShift action_62 action_1029 (299) = happyShift action_225 action_1029 (300) = happyShift action_226 action_1029 (321) = happyShift action_227 action_1029 (328) = happyShift action_228 action_1029 (332) = happyShift action_229 action_1029 (334) = happyShift action_230 action_1029 (336) = happyShift action_231 action_1029 (338) = happyShift action_232 action_1029 (345) = happyShift action_233 action_1029 (346) = happyShift action_234 action_1029 (347) = happyShift action_235 action_1029 (351) = happyShift action_236 action_1029 (355) = happyShift action_237 action_1029 (356) = happyShift action_84 action_1029 (358) = happyShift action_238 action_1029 (359) = happyShift action_239 action_1029 (376) = happyShift action_240 action_1029 (377) = happyShift action_241 action_1029 (379) = happyShift action_102 action_1029 (380) = happyShift action_103 action_1029 (100) = happyGoto action_208 action_1029 (101) = happyGoto action_1051 action_1029 (103) = happyGoto action_244 action_1029 (104) = happyGoto action_245 action_1029 (106) = happyGoto action_246 action_1029 (107) = happyGoto action_211 action_1029 (142) = happyGoto action_212 action_1029 (192) = happyGoto action_248 action_1029 (202) = happyGoto action_213 action_1029 (203) = happyGoto action_214 action_1029 (205) = happyGoto action_215 action_1029 (206) = happyGoto action_216 action_1029 (215) = happyGoto action_217 action_1029 (217) = happyGoto action_218 action_1029 (227) = happyGoto action_219 action_1029 _ = happyFail action_1030 _ = happyReduce_153 action_1031 _ = happyReduce_278 action_1032 _ = happyReduce_302 action_1033 _ = happyReduce_312 action_1034 _ = happyReduce_306 action_1035 (245) = happyShift action_37 action_1035 (253) = happyShift action_40 action_1035 (265) = happyShift action_46 action_1035 (272) = happyShift action_49 action_1035 (273) = happyShift action_50 action_1035 (274) = happyShift action_51 action_1035 (275) = happyShift action_221 action_1035 (276) = happyShift action_222 action_1035 (277) = happyShift action_223 action_1035 (280) = happyShift action_57 action_1035 (281) = happyShift action_58 action_1035 (282) = happyShift action_59 action_1035 (283) = happyShift action_60 action_1035 (286) = happyShift action_62 action_1035 (322) = happyShift action_874 action_1035 (332) = happyShift action_875 action_1035 (336) = happyShift action_876 action_1035 (346) = happyShift action_234 action_1035 (347) = happyShift action_235 action_1035 (351) = happyShift action_236 action_1035 (355) = happyShift action_237 action_1035 (118) = happyGoto action_1049 action_1035 (119) = happyGoto action_869 action_1035 (120) = happyGoto action_870 action_1035 (121) = happyGoto action_871 action_1035 (122) = happyGoto action_1050 action_1035 (205) = happyGoto action_872 action_1035 (206) = happyGoto action_216 action_1035 (215) = happyGoto action_873 action_1035 (217) = happyGoto action_218 action_1035 (227) = happyGoto action_219 action_1035 _ = happyFail action_1036 _ = happyReduce_334 action_1037 _ = happyReduce_336 action_1038 _ = happyReduce_214 action_1039 (245) = happyShift action_37 action_1039 (253) = happyShift action_40 action_1039 (265) = happyShift action_46 action_1039 (270) = happyShift action_249 action_1039 (272) = happyShift action_49 action_1039 (273) = happyShift action_50 action_1039 (274) = happyShift action_51 action_1039 (275) = happyShift action_221 action_1039 (276) = happyShift action_222 action_1039 (277) = happyShift action_223 action_1039 (280) = happyShift action_57 action_1039 (281) = happyShift action_58 action_1039 (282) = happyShift action_59 action_1039 (283) = happyShift action_60 action_1039 (286) = happyShift action_62 action_1039 (299) = happyShift action_225 action_1039 (300) = happyShift action_226 action_1039 (321) = happyShift action_227 action_1039 (328) = happyShift action_228 action_1039 (332) = happyShift action_229 action_1039 (334) = happyShift action_230 action_1039 (336) = happyShift action_231 action_1039 (338) = happyShift action_232 action_1039 (345) = happyShift action_233 action_1039 (346) = happyShift action_234 action_1039 (347) = happyShift action_235 action_1039 (351) = happyShift action_236 action_1039 (355) = happyShift action_237 action_1039 (356) = happyShift action_84 action_1039 (358) = happyShift action_238 action_1039 (359) = happyShift action_239 action_1039 (376) = happyShift action_240 action_1039 (377) = happyShift action_241 action_1039 (379) = happyShift action_102 action_1039 (380) = happyShift action_103 action_1039 (100) = happyGoto action_208 action_1039 (101) = happyGoto action_1048 action_1039 (103) = happyGoto action_244 action_1039 (104) = happyGoto action_245 action_1039 (106) = happyGoto action_246 action_1039 (107) = happyGoto action_211 action_1039 (142) = happyGoto action_212 action_1039 (192) = happyGoto action_248 action_1039 (202) = happyGoto action_213 action_1039 (203) = happyGoto action_214 action_1039 (205) = happyGoto action_215 action_1039 (206) = happyGoto action_216 action_1039 (215) = happyGoto action_217 action_1039 (217) = happyGoto action_218 action_1039 (227) = happyGoto action_219 action_1039 _ = happyFail action_1040 _ = happyReduce_176 action_1041 (253) = happyShift action_1046 action_1041 (336) = happyShift action_1047 action_1041 (46) = happyGoto action_1044 action_1041 (47) = happyGoto action_1045 action_1041 _ = happyReduce_81 action_1042 (347) = happyShift action_469 action_1042 (351) = happyShift action_470 action_1042 (235) = happyGoto action_1043 action_1042 _ = happyFail action_1043 _ = happyReduce_78 action_1044 _ = happyReduce_69 action_1045 _ = happyReduce_80 action_1046 (336) = happyShift action_1118 action_1046 _ = happyFail action_1047 (367) = happyShift action_145 action_1047 (369) = happyShift action_147 action_1047 (370) = happyShift action_148 action_1047 (30) = happyGoto action_1117 action_1047 (31) = happyGoto action_958 action_1047 (32) = happyGoto action_959 action_1047 (33) = happyGoto action_960 action_1047 (237) = happyGoto action_961 action_1047 (239) = happyGoto action_962 action_1047 (240) = happyGoto action_963 action_1047 _ = happyReduce_49 action_1048 (337) = happyShift action_1116 action_1048 _ = happyFail action_1049 (343) = happyShift action_1115 action_1049 _ = happyReduce_313 action_1050 (337) = happyShift action_1114 action_1050 _ = happyFail action_1051 _ = happyReduce_127 action_1052 (268) = happyShift action_829 action_1052 (123) = happyGoto action_1113 action_1052 _ = happyReduce_317 action_1053 (250) = happyShift action_827 action_1053 (134) = happyGoto action_1112 action_1053 _ = happyReduce_337 action_1054 _ = happyReduce_125 action_1055 (245) = happyShift action_37 action_1055 (253) = happyShift action_40 action_1055 (265) = happyShift action_46 action_1055 (270) = happyShift action_385 action_1055 (272) = happyShift action_49 action_1055 (273) = happyShift action_50 action_1055 (274) = happyShift action_51 action_1055 (275) = happyShift action_221 action_1055 (276) = happyShift action_222 action_1055 (277) = happyShift action_223 action_1055 (280) = happyShift action_57 action_1055 (281) = happyShift action_58 action_1055 (282) = happyShift action_59 action_1055 (283) = happyShift action_60 action_1055 (286) = happyShift action_62 action_1055 (299) = happyShift action_225 action_1055 (300) = happyShift action_226 action_1055 (321) = happyShift action_227 action_1055 (328) = happyShift action_228 action_1055 (332) = happyShift action_229 action_1055 (334) = happyShift action_230 action_1055 (336) = happyShift action_231 action_1055 (338) = happyShift action_232 action_1055 (345) = happyShift action_233 action_1055 (346) = happyShift action_234 action_1055 (347) = happyShift action_235 action_1055 (351) = happyShift action_236 action_1055 (355) = happyShift action_237 action_1055 (356) = happyShift action_84 action_1055 (358) = happyShift action_238 action_1055 (359) = happyShift action_239 action_1055 (376) = happyShift action_240 action_1055 (377) = happyShift action_241 action_1055 (379) = happyShift action_102 action_1055 (380) = happyShift action_103 action_1055 (96) = happyGoto action_1111 action_1055 (100) = happyGoto action_208 action_1055 (102) = happyGoto action_380 action_1055 (103) = happyGoto action_381 action_1055 (105) = happyGoto action_382 action_1055 (106) = happyGoto action_383 action_1055 (107) = happyGoto action_211 action_1055 (142) = happyGoto action_212 action_1055 (192) = happyGoto action_384 action_1055 (202) = happyGoto action_213 action_1055 (203) = happyGoto action_214 action_1055 (205) = happyGoto action_215 action_1055 (206) = happyGoto action_216 action_1055 (215) = happyGoto action_217 action_1055 (217) = happyGoto action_218 action_1055 (227) = happyGoto action_219 action_1055 _ = happyFail action_1056 _ = happyReduce_124 action_1057 (245) = happyShift action_37 action_1057 (253) = happyShift action_40 action_1057 (265) = happyShift action_46 action_1057 (270) = happyShift action_249 action_1057 (272) = happyShift action_49 action_1057 (273) = happyShift action_50 action_1057 (274) = happyShift action_51 action_1057 (275) = happyShift action_221 action_1057 (276) = happyShift action_222 action_1057 (277) = happyShift action_223 action_1057 (280) = happyShift action_57 action_1057 (281) = happyShift action_58 action_1057 (282) = happyShift action_59 action_1057 (283) = happyShift action_60 action_1057 (286) = happyShift action_62 action_1057 (299) = happyShift action_225 action_1057 (300) = happyShift action_226 action_1057 (321) = happyShift action_227 action_1057 (328) = happyShift action_228 action_1057 (332) = happyShift action_229 action_1057 (334) = happyShift action_230 action_1057 (336) = happyShift action_231 action_1057 (338) = happyShift action_232 action_1057 (345) = happyShift action_233 action_1057 (346) = happyShift action_234 action_1057 (347) = happyShift action_235 action_1057 (351) = happyShift action_236 action_1057 (355) = happyShift action_237 action_1057 (356) = happyShift action_84 action_1057 (358) = happyShift action_238 action_1057 (359) = happyShift action_239 action_1057 (376) = happyShift action_240 action_1057 (377) = happyShift action_241 action_1057 (379) = happyShift action_102 action_1057 (380) = happyShift action_103 action_1057 (100) = happyGoto action_208 action_1057 (101) = happyGoto action_1110 action_1057 (103) = happyGoto action_244 action_1057 (104) = happyGoto action_245 action_1057 (106) = happyGoto action_246 action_1057 (107) = happyGoto action_211 action_1057 (142) = happyGoto action_212 action_1057 (192) = happyGoto action_248 action_1057 (202) = happyGoto action_213 action_1057 (203) = happyGoto action_214 action_1057 (205) = happyGoto action_215 action_1057 (206) = happyGoto action_216 action_1057 (215) = happyGoto action_217 action_1057 (217) = happyGoto action_218 action_1057 (227) = happyGoto action_219 action_1057 _ = happyFail action_1058 _ = happyReduce_143 action_1059 (368) = happyShift action_146 action_1059 (238) = happyGoto action_914 action_1059 (242) = happyGoto action_1109 action_1059 _ = happyReduce_647 action_1060 (327) = happyShift action_1108 action_1060 _ = happyFail action_1061 (319) = happyShift action_1107 action_1061 _ = happyFail action_1062 (245) = happyShift action_37 action_1062 (253) = happyShift action_40 action_1062 (265) = happyShift action_46 action_1062 (272) = happyShift action_49 action_1062 (273) = happyShift action_50 action_1062 (274) = happyShift action_51 action_1062 (275) = happyShift action_221 action_1062 (276) = happyShift action_222 action_1062 (277) = happyShift action_223 action_1062 (280) = happyShift action_57 action_1062 (281) = happyShift action_58 action_1062 (282) = happyShift action_59 action_1062 (283) = happyShift action_60 action_1062 (286) = happyShift action_62 action_1062 (299) = happyShift action_225 action_1062 (300) = happyShift action_226 action_1062 (308) = happyShift action_267 action_1062 (317) = happyShift action_1105 action_1062 (319) = happyReduce_240 action_1062 (321) = happyShift action_227 action_1062 (328) = happyShift action_228 action_1062 (332) = happyShift action_229 action_1062 (334) = happyShift action_230 action_1062 (336) = happyShift action_231 action_1062 (338) = happyShift action_232 action_1062 (344) = happyShift action_1106 action_1062 (345) = happyShift action_233 action_1062 (346) = happyShift action_234 action_1062 (347) = happyShift action_235 action_1062 (349) = happyShift action_275 action_1062 (351) = happyShift action_236 action_1062 (355) = happyShift action_237 action_1062 (358) = happyShift action_238 action_1062 (359) = happyShift action_239 action_1062 (376) = happyShift action_240 action_1062 (377) = happyShift action_241 action_1062 (379) = happyShift action_102 action_1062 (380) = happyShift action_103 action_1062 (100) = happyGoto action_208 action_1062 (107) = happyGoto action_517 action_1062 (142) = happyGoto action_212 action_1062 (199) = happyGoto action_1104 action_1062 (202) = happyGoto action_213 action_1062 (203) = happyGoto action_214 action_1062 (205) = happyGoto action_215 action_1062 (206) = happyGoto action_216 action_1062 (215) = happyGoto action_217 action_1062 (217) = happyGoto action_218 action_1062 (227) = happyGoto action_219 action_1062 (232) = happyGoto action_377 action_1062 _ = happyReduce_330 action_1063 (368) = happyShift action_146 action_1063 (238) = happyGoto action_914 action_1063 (242) = happyGoto action_1103 action_1063 _ = happyReduce_647 action_1064 _ = happyReduce_315 action_1065 (337) = happyReduce_625 action_1065 _ = happyReduce_625 action_1066 (329) = happyReduce_332 action_1066 (367) = happyShift action_145 action_1066 (131) = happyGoto action_1102 action_1066 (132) = happyGoto action_538 action_1066 (133) = happyGoto action_539 action_1066 (237) = happyGoto action_540 action_1066 (243) = happyGoto action_541 action_1066 _ = happyReduce_649 action_1067 (245) = happyShift action_37 action_1067 (253) = happyShift action_40 action_1067 (265) = happyShift action_46 action_1067 (270) = happyShift action_249 action_1067 (272) = happyShift action_49 action_1067 (273) = happyShift action_50 action_1067 (274) = happyShift action_51 action_1067 (275) = happyShift action_221 action_1067 (276) = happyShift action_222 action_1067 (277) = happyShift action_223 action_1067 (280) = happyShift action_57 action_1067 (281) = happyShift action_58 action_1067 (282) = happyShift action_59 action_1067 (283) = happyShift action_60 action_1067 (286) = happyShift action_62 action_1067 (299) = happyShift action_225 action_1067 (300) = happyShift action_226 action_1067 (321) = happyShift action_227 action_1067 (328) = happyShift action_228 action_1067 (332) = happyShift action_229 action_1067 (334) = happyShift action_230 action_1067 (336) = happyShift action_231 action_1067 (338) = happyShift action_232 action_1067 (345) = happyShift action_233 action_1067 (346) = happyShift action_234 action_1067 (347) = happyShift action_235 action_1067 (351) = happyShift action_236 action_1067 (355) = happyShift action_237 action_1067 (356) = happyShift action_84 action_1067 (358) = happyShift action_238 action_1067 (359) = happyShift action_239 action_1067 (376) = happyShift action_240 action_1067 (377) = happyShift action_241 action_1067 (379) = happyShift action_102 action_1067 (380) = happyShift action_103 action_1067 (95) = happyGoto action_1101 action_1067 (100) = happyGoto action_208 action_1067 (101) = happyGoto action_243 action_1067 (103) = happyGoto action_244 action_1067 (104) = happyGoto action_245 action_1067 (106) = happyGoto action_246 action_1067 (107) = happyGoto action_211 action_1067 (142) = happyGoto action_212 action_1067 (192) = happyGoto action_248 action_1067 (202) = happyGoto action_213 action_1067 (203) = happyGoto action_214 action_1067 (205) = happyGoto action_215 action_1067 (206) = happyGoto action_216 action_1067 (215) = happyGoto action_217 action_1067 (217) = happyGoto action_218 action_1067 (227) = happyGoto action_219 action_1067 _ = happyFail action_1068 (332) = happyShift action_192 action_1068 (336) = happyShift action_1100 action_1068 (338) = happyShift action_194 action_1068 (347) = happyShift action_79 action_1068 (196) = happyGoto action_1012 action_1068 (197) = happyGoto action_1099 action_1068 (198) = happyGoto action_186 action_1068 (230) = happyGoto action_189 action_1068 _ = happyFail action_1069 (332) = happyShift action_192 action_1069 (336) = happyShift action_1015 action_1069 (338) = happyShift action_194 action_1069 (347) = happyShift action_1016 action_1069 (351) = happyShift action_236 action_1069 (355) = happyShift action_237 action_1069 (124) = happyGoto action_1098 action_1069 (125) = happyGoto action_1011 action_1069 (196) = happyGoto action_1012 action_1069 (197) = happyGoto action_1013 action_1069 (198) = happyGoto action_186 action_1069 (203) = happyGoto action_1014 action_1069 (205) = happyGoto action_215 action_1069 (206) = happyGoto action_216 action_1069 (230) = happyGoto action_189 action_1069 _ = happyReduce_320 action_1070 _ = happyReduce_316 action_1071 _ = happyReduce_340 action_1072 (245) = happyShift action_37 action_1072 (253) = happyShift action_40 action_1072 (265) = happyShift action_46 action_1072 (270) = happyShift action_249 action_1072 (272) = happyShift action_49 action_1072 (273) = happyShift action_50 action_1072 (274) = happyShift action_51 action_1072 (275) = happyShift action_221 action_1072 (276) = happyShift action_222 action_1072 (277) = happyShift action_223 action_1072 (280) = happyShift action_57 action_1072 (281) = happyShift action_58 action_1072 (282) = happyShift action_59 action_1072 (283) = happyShift action_60 action_1072 (286) = happyShift action_62 action_1072 (299) = happyShift action_225 action_1072 (300) = happyShift action_226 action_1072 (321) = happyShift action_227 action_1072 (328) = happyShift action_228 action_1072 (332) = happyShift action_229 action_1072 (334) = happyShift action_230 action_1072 (336) = happyShift action_231 action_1072 (338) = happyShift action_232 action_1072 (345) = happyShift action_233 action_1072 (346) = happyShift action_234 action_1072 (347) = happyShift action_235 action_1072 (351) = happyShift action_236 action_1072 (355) = happyShift action_237 action_1072 (356) = happyShift action_84 action_1072 (358) = happyShift action_238 action_1072 (359) = happyShift action_239 action_1072 (376) = happyShift action_240 action_1072 (377) = happyShift action_241 action_1072 (379) = happyShift action_102 action_1072 (380) = happyShift action_103 action_1072 (95) = happyGoto action_242 action_1072 (100) = happyGoto action_208 action_1072 (101) = happyGoto action_243 action_1072 (103) = happyGoto action_244 action_1072 (104) = happyGoto action_245 action_1072 (106) = happyGoto action_246 action_1072 (107) = happyGoto action_211 action_1072 (108) = happyGoto action_1007 action_1072 (109) = happyGoto action_1097 action_1072 (142) = happyGoto action_212 action_1072 (192) = happyGoto action_248 action_1072 (202) = happyGoto action_213 action_1072 (203) = happyGoto action_214 action_1072 (205) = happyGoto action_215 action_1072 (206) = happyGoto action_216 action_1072 (215) = happyGoto action_217 action_1072 (217) = happyGoto action_218 action_1072 (227) = happyGoto action_219 action_1072 _ = happyFail action_1073 _ = happyReduce_43 action_1074 _ = happyReduce_62 action_1075 _ = happyReduce_54 action_1076 _ = happyReduce_53 action_1077 (245) = happyShift action_37 action_1077 (253) = happyShift action_40 action_1077 (265) = happyShift action_46 action_1077 (267) = happyShift action_1004 action_1077 (270) = happyShift action_48 action_1077 (272) = happyShift action_49 action_1077 (273) = happyShift action_50 action_1077 (274) = happyShift action_51 action_1077 (275) = happyShift action_52 action_1077 (276) = happyShift action_53 action_1077 (277) = happyShift action_54 action_1077 (279) = happyShift action_56 action_1077 (280) = happyShift action_57 action_1077 (281) = happyShift action_58 action_1077 (282) = happyShift action_59 action_1077 (283) = happyShift action_60 action_1077 (286) = happyShift action_62 action_1077 (307) = happyShift action_1095 action_1077 (332) = happyShift action_192 action_1077 (336) = happyShift action_320 action_1077 (337) = happyShift action_1096 action_1077 (338) = happyShift action_194 action_1077 (346) = happyShift action_78 action_1077 (347) = happyShift action_79 action_1077 (350) = happyShift action_80 action_1077 (351) = happyShift action_81 action_1077 (354) = happyShift action_82 action_1077 (355) = happyShift action_83 action_1077 (36) = happyGoto action_1093 action_1077 (37) = happyGoto action_1094 action_1077 (38) = happyGoto action_1002 action_1077 (195) = happyGoto action_26 action_1077 (198) = happyGoto action_27 action_1077 (219) = happyGoto action_322 action_1077 (220) = happyGoto action_30 action_1077 (221) = happyGoto action_111 action_1077 (227) = happyGoto action_32 action_1077 (229) = happyGoto action_33 action_1077 (230) = happyGoto action_34 action_1077 _ = happyFail action_1078 (343) = happyShift action_1092 action_1078 _ = happyReduce_46 action_1079 (1) = happyShift action_601 action_1079 (331) = happyShift action_602 action_1079 (234) = happyGoto action_1091 action_1079 _ = happyFail action_1080 _ = happyReduce_33 action_1081 (342) = happyShift action_1090 action_1081 _ = happyReduce_31 action_1082 _ = happyReduce_67 action_1083 (329) = happyShift action_1089 action_1083 _ = happyFail action_1084 (244) = happyShift action_36 action_1084 (245) = happyShift action_37 action_1084 (246) = happyShift action_38 action_1084 (251) = happyShift action_39 action_1084 (253) = happyShift action_40 action_1084 (254) = happyShift action_41 action_1084 (261) = happyShift action_45 action_1084 (265) = happyShift action_46 action_1084 (269) = happyShift action_47 action_1084 (270) = happyShift action_48 action_1084 (272) = happyShift action_49 action_1084 (273) = happyShift action_50 action_1084 (274) = happyShift action_51 action_1084 (275) = happyShift action_52 action_1084 (276) = happyShift action_53 action_1084 (277) = happyShift action_54 action_1084 (278) = happyShift action_55 action_1084 (279) = happyShift action_56 action_1084 (280) = happyShift action_57 action_1084 (281) = happyShift action_58 action_1084 (282) = happyShift action_59 action_1084 (283) = happyShift action_60 action_1084 (284) = happyShift action_61 action_1084 (286) = happyShift action_62 action_1084 (294) = happyShift action_66 action_1084 (295) = happyShift action_67 action_1084 (296) = happyShift action_68 action_1084 (311) = happyShift action_69 action_1084 (317) = happyShift action_70 action_1084 (320) = happyShift action_71 action_1084 (332) = happyShift action_72 action_1084 (334) = happyShift action_73 action_1084 (336) = happyShift action_112 action_1084 (338) = happyShift action_75 action_1084 (340) = happyShift action_76 action_1084 (345) = happyShift action_77 action_1084 (346) = happyShift action_78 action_1084 (347) = happyShift action_79 action_1084 (350) = happyShift action_80 action_1084 (351) = happyShift action_81 action_1084 (354) = happyShift action_82 action_1084 (355) = happyShift action_83 action_1084 (356) = happyShift action_84 action_1084 (357) = happyShift action_85 action_1084 (358) = happyShift action_86 action_1084 (359) = happyShift action_87 action_1084 (360) = happyShift action_88 action_1084 (361) = happyShift action_89 action_1084 (362) = happyShift action_90 action_1084 (363) = happyShift action_91 action_1084 (364) = happyShift action_92 action_1084 (365) = happyShift action_93 action_1084 (366) = happyShift action_94 action_1084 (371) = happyShift action_95 action_1084 (372) = happyShift action_96 action_1084 (373) = happyShift action_97 action_1084 (374) = happyShift action_98 action_1084 (376) = happyShift action_99 action_1084 (377) = happyShift action_100 action_1084 (378) = happyShift action_101 action_1084 (379) = happyShift action_102 action_1084 (380) = happyShift action_103 action_1084 (38) = happyGoto action_13 action_1084 (142) = happyGoto action_16 action_1084 (143) = happyGoto action_1088 action_1084 (144) = happyGoto action_110 action_1084 (145) = happyGoto action_18 action_1084 (147) = happyGoto action_19 action_1084 (148) = happyGoto action_20 action_1084 (149) = happyGoto action_21 action_1084 (150) = happyGoto action_22 action_1084 (151) = happyGoto action_23 action_1084 (152) = happyGoto action_24 action_1084 (192) = happyGoto action_25 action_1084 (195) = happyGoto action_26 action_1084 (198) = happyGoto action_27 action_1084 (219) = happyGoto action_29 action_1084 (220) = happyGoto action_30 action_1084 (221) = happyGoto action_111 action_1084 (227) = happyGoto action_32 action_1084 (229) = happyGoto action_33 action_1084 (230) = happyGoto action_34 action_1084 (233) = happyGoto action_35 action_1084 _ = happyFail action_1085 (359) = happyShift action_1087 action_1085 _ = happyFail action_1086 _ = happyReduce_375 action_1087 (306) = happyShift action_1135 action_1087 _ = happyFail action_1088 _ = happyReduce_459 action_1089 _ = happyReduce_27 action_1090 (244) = happyShift action_36 action_1090 (245) = happyShift action_37 action_1090 (246) = happyShift action_38 action_1090 (247) = happyShift action_129 action_1090 (248) = happyShift action_130 action_1090 (249) = happyShift action_131 action_1090 (250) = happyShift action_132 action_1090 (251) = happyShift action_39 action_1090 (253) = happyShift action_40 action_1090 (254) = happyShift action_41 action_1090 (255) = happyShift action_150 action_1090 (257) = happyShift action_42 action_1090 (258) = happyShift action_43 action_1090 (259) = happyShift action_44 action_1090 (260) = happyShift action_133 action_1090 (261) = happyShift action_45 action_1090 (263) = happyShift action_134 action_1090 (265) = happyShift action_46 action_1090 (267) = happyShift action_135 action_1090 (269) = happyShift action_47 action_1090 (270) = happyShift action_48 action_1090 (271) = happyShift action_136 action_1090 (272) = happyShift action_49 action_1090 (273) = happyShift action_50 action_1090 (274) = happyShift action_51 action_1090 (275) = happyShift action_52 action_1090 (276) = happyShift action_53 action_1090 (277) = happyShift action_54 action_1090 (278) = happyShift action_55 action_1090 (279) = happyShift action_56 action_1090 (280) = happyShift action_57 action_1090 (281) = happyShift action_58 action_1090 (282) = happyShift action_59 action_1090 (283) = happyShift action_60 action_1090 (284) = happyShift action_61 action_1090 (286) = happyShift action_62 action_1090 (289) = happyShift action_63 action_1090 (290) = happyShift action_64 action_1090 (291) = happyShift action_65 action_1090 (293) = happyShift action_137 action_1090 (294) = happyShift action_66 action_1090 (295) = happyShift action_67 action_1090 (296) = happyShift action_68 action_1090 (297) = happyShift action_138 action_1090 (298) = happyShift action_139 action_1090 (301) = happyShift action_140 action_1090 (302) = happyShift action_141 action_1090 (303) = happyShift action_142 action_1090 (304) = happyShift action_143 action_1090 (311) = happyShift action_69 action_1090 (317) = happyShift action_70 action_1090 (320) = happyShift action_71 action_1090 (321) = happyShift action_144 action_1090 (332) = happyShift action_72 action_1090 (334) = happyShift action_73 action_1090 (336) = happyShift action_74 action_1090 (338) = happyShift action_75 action_1090 (340) = happyShift action_76 action_1090 (345) = happyShift action_77 action_1090 (346) = happyShift action_78 action_1090 (347) = happyShift action_79 action_1090 (350) = happyShift action_80 action_1090 (351) = happyShift action_81 action_1090 (354) = happyShift action_82 action_1090 (355) = happyShift action_83 action_1090 (356) = happyShift action_84 action_1090 (357) = happyShift action_85 action_1090 (358) = happyShift action_86 action_1090 (359) = happyShift action_87 action_1090 (360) = happyShift action_88 action_1090 (361) = happyShift action_89 action_1090 (362) = happyShift action_90 action_1090 (363) = happyShift action_91 action_1090 (364) = happyShift action_92 action_1090 (365) = happyShift action_93 action_1090 (366) = happyShift action_94 action_1090 (367) = happyShift action_145 action_1090 (368) = happyShift action_146 action_1090 (369) = happyShift action_147 action_1090 (370) = happyShift action_148 action_1090 (371) = happyShift action_95 action_1090 (372) = happyShift action_96 action_1090 (373) = happyShift action_97 action_1090 (374) = happyShift action_98 action_1090 (376) = happyShift action_99 action_1090 (377) = happyShift action_100 action_1090 (378) = happyShift action_101 action_1090 (379) = happyShift action_102 action_1090 (380) = happyShift action_103 action_1090 (25) = happyGoto action_1133 action_1090 (38) = happyGoto action_13 action_1090 (40) = happyGoto action_1134 action_1090 (49) = happyGoto action_14 action_1090 (51) = happyGoto action_446 action_1090 (52) = happyGoto action_447 action_1090 (53) = happyGoto action_114 action_1090 (54) = happyGoto action_115 action_1090 (55) = happyGoto action_116 action_1090 (58) = happyGoto action_117 action_1090 (62) = happyGoto action_118 action_1090 (88) = happyGoto action_119 action_1090 (135) = happyGoto action_120 action_1090 (136) = happyGoto action_121 action_1090 (137) = happyGoto action_122 action_1090 (141) = happyGoto action_123 action_1090 (142) = happyGoto action_16 action_1090 (144) = happyGoto action_124 action_1090 (145) = happyGoto action_18 action_1090 (147) = happyGoto action_19 action_1090 (148) = happyGoto action_20 action_1090 (149) = happyGoto action_21 action_1090 (150) = happyGoto action_22 action_1090 (151) = happyGoto action_23 action_1090 (152) = happyGoto action_24 action_1090 (192) = happyGoto action_25 action_1090 (195) = happyGoto action_26 action_1090 (198) = happyGoto action_27 action_1090 (218) = happyGoto action_28 action_1090 (219) = happyGoto action_29 action_1090 (220) = happyGoto action_30 action_1090 (221) = happyGoto action_31 action_1090 (227) = happyGoto action_32 action_1090 (229) = happyGoto action_33 action_1090 (230) = happyGoto action_34 action_1090 (233) = happyGoto action_35 action_1090 (237) = happyGoto action_125 action_1090 (238) = happyGoto action_126 action_1090 (239) = happyGoto action_127 action_1090 (240) = happyGoto action_128 action_1090 _ = happyReduce_66 action_1091 _ = happyReduce_28 action_1092 (367) = happyShift action_145 action_1092 (369) = happyShift action_147 action_1092 (370) = happyShift action_148 action_1092 (30) = happyGoto action_1132 action_1092 (31) = happyGoto action_958 action_1092 (32) = happyGoto action_959 action_1092 (33) = happyGoto action_960 action_1092 (237) = happyGoto action_961 action_1092 (239) = happyGoto action_962 action_1092 (240) = happyGoto action_963 action_1092 _ = happyReduce_49 action_1093 (337) = happyShift action_1130 action_1093 (343) = happyShift action_1131 action_1093 _ = happyFail action_1094 _ = happyReduce_60 action_1095 (337) = happyShift action_1129 action_1095 _ = happyFail action_1096 _ = happyReduce_57 action_1097 _ = happyReduce_285 action_1098 _ = happyReduce_318 action_1099 _ = happyReduce_526 action_1100 (308) = happyShift action_267 action_1100 (337) = happyShift action_295 action_1100 (343) = happyShift action_296 action_1100 (349) = happyShift action_275 action_1100 (232) = happyGoto action_569 action_1100 (236) = happyGoto action_441 action_1100 _ = happyFail action_1101 _ = happyReduce_321 action_1102 (329) = happyShift action_1128 action_1102 _ = happyFail action_1103 _ = happyReduce_327 action_1104 (245) = happyShift action_37 action_1104 (253) = happyShift action_40 action_1104 (265) = happyShift action_46 action_1104 (272) = happyShift action_49 action_1104 (273) = happyShift action_50 action_1104 (274) = happyShift action_51 action_1104 (275) = happyShift action_221 action_1104 (276) = happyShift action_222 action_1104 (277) = happyShift action_223 action_1104 (280) = happyShift action_57 action_1104 (281) = happyShift action_58 action_1104 (282) = happyShift action_59 action_1104 (283) = happyShift action_60 action_1104 (286) = happyShift action_62 action_1104 (299) = happyShift action_225 action_1104 (300) = happyShift action_226 action_1104 (321) = happyShift action_227 action_1104 (328) = happyShift action_228 action_1104 (332) = happyShift action_229 action_1104 (334) = happyShift action_230 action_1104 (336) = happyShift action_231 action_1104 (338) = happyShift action_232 action_1104 (345) = happyShift action_233 action_1104 (346) = happyShift action_234 action_1104 (347) = happyShift action_235 action_1104 (351) = happyShift action_236 action_1104 (355) = happyShift action_237 action_1104 (358) = happyShift action_238 action_1104 (359) = happyShift action_239 action_1104 (376) = happyShift action_240 action_1104 (377) = happyShift action_241 action_1104 (379) = happyShift action_102 action_1104 (380) = happyShift action_103 action_1104 (100) = happyGoto action_208 action_1104 (106) = happyGoto action_1127 action_1104 (107) = happyGoto action_211 action_1104 (142) = happyGoto action_212 action_1104 (202) = happyGoto action_213 action_1104 (203) = happyGoto action_214 action_1104 (205) = happyGoto action_215 action_1104 (206) = happyGoto action_216 action_1104 (215) = happyGoto action_217 action_1104 (217) = happyGoto action_218 action_1104 (227) = happyGoto action_219 action_1104 _ = happyFail action_1105 (245) = happyShift action_37 action_1105 (253) = happyShift action_40 action_1105 (265) = happyShift action_46 action_1105 (272) = happyShift action_49 action_1105 (273) = happyShift action_50 action_1105 (274) = happyShift action_51 action_1105 (275) = happyShift action_221 action_1105 (276) = happyShift action_222 action_1105 (277) = happyShift action_223 action_1105 (280) = happyShift action_57 action_1105 (281) = happyShift action_58 action_1105 (282) = happyShift action_59 action_1105 (283) = happyShift action_60 action_1105 (286) = happyShift action_62 action_1105 (299) = happyShift action_225 action_1105 (300) = happyShift action_226 action_1105 (321) = happyShift action_227 action_1105 (328) = happyShift action_228 action_1105 (332) = happyShift action_229 action_1105 (334) = happyShift action_230 action_1105 (336) = happyShift action_231 action_1105 (338) = happyShift action_232 action_1105 (345) = happyShift action_233 action_1105 (346) = happyShift action_234 action_1105 (347) = happyShift action_235 action_1105 (351) = happyShift action_236 action_1105 (355) = happyShift action_237 action_1105 (358) = happyShift action_238 action_1105 (359) = happyShift action_239 action_1105 (376) = happyShift action_240 action_1105 (377) = happyShift action_241 action_1105 (379) = happyShift action_102 action_1105 (380) = happyShift action_103 action_1105 (100) = happyGoto action_208 action_1105 (106) = happyGoto action_1126 action_1105 (107) = happyGoto action_211 action_1105 (142) = happyGoto action_212 action_1105 (202) = happyGoto action_213 action_1105 (203) = happyGoto action_214 action_1105 (205) = happyGoto action_215 action_1105 (206) = happyGoto action_216 action_1105 (215) = happyGoto action_217 action_1105 (217) = happyGoto action_218 action_1105 (227) = happyGoto action_219 action_1105 _ = happyFail action_1106 (347) = happyShift action_79 action_1106 (230) = happyGoto action_780 action_1106 _ = happyFail action_1107 (245) = happyShift action_37 action_1107 (253) = happyShift action_40 action_1107 (265) = happyShift action_46 action_1107 (272) = happyShift action_49 action_1107 (273) = happyShift action_50 action_1107 (274) = happyShift action_51 action_1107 (275) = happyShift action_221 action_1107 (276) = happyShift action_222 action_1107 (277) = happyShift action_223 action_1107 (280) = happyShift action_57 action_1107 (281) = happyShift action_58 action_1107 (282) = happyShift action_59 action_1107 (283) = happyShift action_60 action_1107 (286) = happyShift action_62 action_1107 (299) = happyShift action_225 action_1107 (300) = happyShift action_226 action_1107 (321) = happyShift action_227 action_1107 (328) = happyShift action_228 action_1107 (332) = happyShift action_229 action_1107 (334) = happyShift action_230 action_1107 (336) = happyShift action_231 action_1107 (338) = happyShift action_232 action_1107 (345) = happyShift action_233 action_1107 (346) = happyShift action_234 action_1107 (347) = happyShift action_235 action_1107 (351) = happyShift action_236 action_1107 (355) = happyShift action_237 action_1107 (358) = happyShift action_238 action_1107 (359) = happyShift action_239 action_1107 (376) = happyShift action_240 action_1107 (377) = happyShift action_241 action_1107 (379) = happyShift action_102 action_1107 (380) = happyShift action_103 action_1107 (100) = happyGoto action_208 action_1107 (106) = happyGoto action_1124 action_1107 (107) = happyGoto action_211 action_1107 (130) = happyGoto action_1125 action_1107 (142) = happyGoto action_212 action_1107 (202) = happyGoto action_213 action_1107 (203) = happyGoto action_214 action_1107 (205) = happyGoto action_215 action_1107 (206) = happyGoto action_216 action_1107 (215) = happyGoto action_217 action_1107 (217) = happyGoto action_218 action_1107 (227) = happyGoto action_219 action_1107 _ = happyFail action_1108 _ = happyReduce_328 action_1109 (367) = happyShift action_145 action_1109 (128) = happyGoto action_1123 action_1109 (237) = happyGoto action_540 action_1109 (243) = happyGoto action_951 action_1109 _ = happyReduce_649 action_1110 _ = happyReduce_126 action_1111 _ = happyReduce_142 action_1112 _ = happyReduce_128 action_1113 (250) = happyShift action_827 action_1113 (134) = happyGoto action_1122 action_1113 _ = happyReduce_337 action_1114 _ = happyReduce_311 action_1115 (245) = happyShift action_37 action_1115 (253) = happyShift action_40 action_1115 (265) = happyShift action_46 action_1115 (272) = happyShift action_49 action_1115 (273) = happyShift action_50 action_1115 (274) = happyShift action_51 action_1115 (275) = happyShift action_221 action_1115 (276) = happyShift action_222 action_1115 (277) = happyShift action_223 action_1115 (280) = happyShift action_57 action_1115 (281) = happyShift action_58 action_1115 (282) = happyShift action_59 action_1115 (283) = happyShift action_60 action_1115 (286) = happyShift action_62 action_1115 (322) = happyShift action_874 action_1115 (332) = happyShift action_875 action_1115 (336) = happyShift action_876 action_1115 (346) = happyShift action_234 action_1115 (347) = happyShift action_235 action_1115 (351) = happyShift action_236 action_1115 (355) = happyShift action_237 action_1115 (118) = happyGoto action_1049 action_1115 (119) = happyGoto action_869 action_1115 (120) = happyGoto action_870 action_1115 (121) = happyGoto action_871 action_1115 (122) = happyGoto action_1121 action_1115 (205) = happyGoto action_872 action_1115 (206) = happyGoto action_216 action_1115 (215) = happyGoto action_873 action_1115 (217) = happyGoto action_218 action_1115 (227) = happyGoto action_219 action_1115 _ = happyFail action_1116 _ = happyReduce_186 action_1117 (337) = happyShift action_1120 action_1117 _ = happyFail action_1118 (367) = happyShift action_145 action_1118 (369) = happyShift action_147 action_1118 (370) = happyShift action_148 action_1118 (30) = happyGoto action_1119 action_1118 (31) = happyGoto action_958 action_1118 (32) = happyGoto action_959 action_1118 (33) = happyGoto action_960 action_1118 (237) = happyGoto action_961 action_1118 (239) = happyGoto action_962 action_1118 (240) = happyGoto action_963 action_1118 _ = happyReduce_49 action_1119 (337) = happyShift action_1139 action_1119 _ = happyFail action_1120 _ = happyReduce_82 action_1121 _ = happyReduce_314 action_1122 _ = happyReduce_129 action_1123 _ = happyReduce_324 action_1124 (245) = happyShift action_37 action_1124 (253) = happyShift action_40 action_1124 (265) = happyShift action_46 action_1124 (272) = happyShift action_49 action_1124 (273) = happyShift action_50 action_1124 (274) = happyShift action_51 action_1124 (275) = happyShift action_221 action_1124 (276) = happyShift action_222 action_1124 (277) = happyShift action_223 action_1124 (280) = happyShift action_57 action_1124 (281) = happyShift action_58 action_1124 (282) = happyShift action_59 action_1124 (283) = happyShift action_60 action_1124 (286) = happyShift action_62 action_1124 (299) = happyShift action_225 action_1124 (300) = happyShift action_226 action_1124 (308) = happyShift action_267 action_1124 (321) = happyShift action_227 action_1124 (328) = happyShift action_228 action_1124 (332) = happyShift action_229 action_1124 (334) = happyShift action_230 action_1124 (336) = happyShift action_231 action_1124 (338) = happyShift action_232 action_1124 (344) = happyShift action_1106 action_1124 (345) = happyShift action_233 action_1124 (346) = happyShift action_234 action_1124 (347) = happyShift action_235 action_1124 (349) = happyShift action_275 action_1124 (351) = happyShift action_236 action_1124 (355) = happyShift action_237 action_1124 (358) = happyShift action_238 action_1124 (359) = happyShift action_239 action_1124 (376) = happyShift action_240 action_1124 (377) = happyShift action_241 action_1124 (379) = happyShift action_102 action_1124 (380) = happyShift action_103 action_1124 (100) = happyGoto action_208 action_1124 (107) = happyGoto action_517 action_1124 (142) = happyGoto action_212 action_1124 (199) = happyGoto action_1104 action_1124 (202) = happyGoto action_213 action_1124 (203) = happyGoto action_214 action_1124 (205) = happyGoto action_215 action_1124 (206) = happyGoto action_216 action_1124 (215) = happyGoto action_217 action_1124 (217) = happyGoto action_218 action_1124 (227) = happyGoto action_219 action_1124 (232) = happyGoto action_377 action_1124 _ = happyReduce_330 action_1125 (368) = happyShift action_146 action_1125 (238) = happyGoto action_914 action_1125 (242) = happyGoto action_1138 action_1125 _ = happyReduce_647 action_1126 (245) = happyShift action_37 action_1126 (253) = happyShift action_40 action_1126 (265) = happyShift action_46 action_1126 (272) = happyShift action_49 action_1126 (273) = happyShift action_50 action_1126 (274) = happyShift action_51 action_1126 (275) = happyShift action_221 action_1126 (276) = happyShift action_222 action_1126 (277) = happyShift action_223 action_1126 (280) = happyShift action_57 action_1126 (281) = happyShift action_58 action_1126 (282) = happyShift action_59 action_1126 (283) = happyShift action_60 action_1126 (286) = happyShift action_62 action_1126 (299) = happyShift action_225 action_1126 (300) = happyShift action_226 action_1126 (321) = happyShift action_227 action_1126 (328) = happyShift action_228 action_1126 (332) = happyShift action_229 action_1126 (334) = happyShift action_230 action_1126 (336) = happyShift action_231 action_1126 (338) = happyShift action_232 action_1126 (345) = happyShift action_233 action_1126 (346) = happyShift action_234 action_1126 (347) = happyShift action_235 action_1126 (351) = happyShift action_236 action_1126 (355) = happyShift action_237 action_1126 (358) = happyShift action_238 action_1126 (359) = happyShift action_239 action_1126 (376) = happyShift action_240 action_1126 (377) = happyShift action_241 action_1126 (379) = happyShift action_102 action_1126 (380) = happyShift action_103 action_1126 (100) = happyGoto action_208 action_1126 (107) = happyGoto action_517 action_1126 (142) = happyGoto action_212 action_1126 (202) = happyGoto action_213 action_1126 (203) = happyGoto action_214 action_1126 (205) = happyGoto action_215 action_1126 (206) = happyGoto action_216 action_1126 (215) = happyGoto action_217 action_1126 (217) = happyGoto action_218 action_1126 (227) = happyGoto action_219 action_1126 _ = happyReduce_239 action_1127 (245) = happyShift action_37 action_1127 (253) = happyShift action_40 action_1127 (265) = happyShift action_46 action_1127 (272) = happyShift action_49 action_1127 (273) = happyShift action_50 action_1127 (274) = happyShift action_51 action_1127 (275) = happyShift action_221 action_1127 (276) = happyShift action_222 action_1127 (277) = happyShift action_223 action_1127 (280) = happyShift action_57 action_1127 (281) = happyShift action_58 action_1127 (282) = happyShift action_59 action_1127 (283) = happyShift action_60 action_1127 (286) = happyShift action_62 action_1127 (299) = happyShift action_225 action_1127 (300) = happyShift action_226 action_1127 (321) = happyShift action_227 action_1127 (328) = happyShift action_228 action_1127 (332) = happyShift action_229 action_1127 (334) = happyShift action_230 action_1127 (336) = happyShift action_231 action_1127 (338) = happyShift action_232 action_1127 (345) = happyShift action_233 action_1127 (346) = happyShift action_234 action_1127 (347) = happyShift action_235 action_1127 (351) = happyShift action_236 action_1127 (355) = happyShift action_237 action_1127 (358) = happyShift action_238 action_1127 (359) = happyShift action_239 action_1127 (376) = happyShift action_240 action_1127 (377) = happyShift action_241 action_1127 (379) = happyShift action_102 action_1127 (380) = happyShift action_103 action_1127 (100) = happyGoto action_208 action_1127 (107) = happyGoto action_517 action_1127 (142) = happyGoto action_212 action_1127 (202) = happyGoto action_213 action_1127 (203) = happyGoto action_214 action_1127 (205) = happyGoto action_215 action_1127 (206) = happyGoto action_216 action_1127 (215) = happyGoto action_217 action_1127 (217) = happyGoto action_218 action_1127 (227) = happyGoto action_219 action_1127 _ = happyReduce_331 action_1128 (309) = happyShift action_1137 action_1128 _ = happyFail action_1129 _ = happyReduce_56 action_1130 _ = happyReduce_58 action_1131 (245) = happyShift action_37 action_1131 (253) = happyShift action_40 action_1131 (265) = happyShift action_46 action_1131 (267) = happyShift action_1004 action_1131 (270) = happyShift action_48 action_1131 (272) = happyShift action_49 action_1131 (273) = happyShift action_50 action_1131 (274) = happyShift action_51 action_1131 (275) = happyShift action_52 action_1131 (276) = happyShift action_53 action_1131 (277) = happyShift action_54 action_1131 (279) = happyShift action_56 action_1131 (280) = happyShift action_57 action_1131 (281) = happyShift action_58 action_1131 (282) = happyShift action_59 action_1131 (283) = happyShift action_60 action_1131 (286) = happyShift action_62 action_1131 (332) = happyShift action_192 action_1131 (336) = happyShift action_320 action_1131 (338) = happyShift action_194 action_1131 (346) = happyShift action_78 action_1131 (347) = happyShift action_79 action_1131 (350) = happyShift action_80 action_1131 (351) = happyShift action_81 action_1131 (354) = happyShift action_82 action_1131 (355) = happyShift action_83 action_1131 (37) = happyGoto action_1136 action_1131 (38) = happyGoto action_1002 action_1131 (195) = happyGoto action_26 action_1131 (198) = happyGoto action_27 action_1131 (219) = happyGoto action_322 action_1131 (220) = happyGoto action_30 action_1131 (221) = happyGoto action_111 action_1131 (227) = happyGoto action_32 action_1131 (229) = happyGoto action_33 action_1131 (230) = happyGoto action_34 action_1131 _ = happyFail action_1132 _ = happyReduce_45 action_1133 _ = happyReduce_32 action_1134 _ = happyReduce_65 action_1135 _ = happyReduce_391 action_1136 _ = happyReduce_59 action_1137 (245) = happyShift action_37 action_1137 (253) = happyShift action_40 action_1137 (265) = happyShift action_46 action_1137 (270) = happyShift action_249 action_1137 (272) = happyShift action_49 action_1137 (273) = happyShift action_50 action_1137 (274) = happyShift action_51 action_1137 (275) = happyShift action_221 action_1137 (276) = happyShift action_222 action_1137 (277) = happyShift action_223 action_1137 (280) = happyShift action_57 action_1137 (281) = happyShift action_58 action_1137 (282) = happyShift action_59 action_1137 (283) = happyShift action_60 action_1137 (286) = happyShift action_62 action_1137 (299) = happyShift action_225 action_1137 (300) = happyShift action_226 action_1137 (321) = happyShift action_227 action_1137 (328) = happyShift action_228 action_1137 (332) = happyShift action_229 action_1137 (334) = happyShift action_230 action_1137 (336) = happyShift action_231 action_1137 (338) = happyShift action_232 action_1137 (345) = happyShift action_233 action_1137 (346) = happyShift action_234 action_1137 (347) = happyShift action_235 action_1137 (351) = happyShift action_236 action_1137 (355) = happyShift action_237 action_1137 (356) = happyShift action_84 action_1137 (358) = happyShift action_238 action_1137 (359) = happyShift action_239 action_1137 (376) = happyShift action_240 action_1137 (377) = happyShift action_241 action_1137 (379) = happyShift action_102 action_1137 (380) = happyShift action_103 action_1137 (95) = happyGoto action_1140 action_1137 (100) = happyGoto action_208 action_1137 (101) = happyGoto action_243 action_1137 (103) = happyGoto action_244 action_1137 (104) = happyGoto action_245 action_1137 (106) = happyGoto action_246 action_1137 (107) = happyGoto action_211 action_1137 (142) = happyGoto action_212 action_1137 (192) = happyGoto action_248 action_1137 (202) = happyGoto action_213 action_1137 (203) = happyGoto action_214 action_1137 (205) = happyGoto action_215 action_1137 (206) = happyGoto action_216 action_1137 (215) = happyGoto action_217 action_1137 (217) = happyGoto action_218 action_1137 (227) = happyGoto action_219 action_1137 _ = happyFail action_1138 _ = happyReduce_326 action_1139 _ = happyReduce_83 action_1140 _ = happyReduce_322 happyReduce_12 = happySpecReduce_1 15 happyReduction_12 happyReduction_12 (HappyAbsSyn63 happy_var_1) = HappyAbsSyn15 (head (fromOL (unLoc happy_var_1)) ) happyReduction_12 _ = notHappyAtAll happyReduce_13 = happyMonadReduce 7 16 happyReduction_13 happyReduction_13 ((HappyAbsSyn22 happy_var_7) `HappyStk` _ `HappyStk` (HappyAbsSyn29 happy_var_5) `HappyStk` (HappyAbsSyn21 happy_var_4) `HappyStk` (HappyAbsSyn235 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn19 happy_var_1) `HappyStk` happyRest) tk = happyThen (( fileSrcSpan >>= \ loc -> return (L loc (HsModule (Just happy_var_3) happy_var_5 (fst happy_var_7) (snd happy_var_7) happy_var_4 happy_var_1 ) )) ) (\r -> happyReturn (HappyAbsSyn16 r)) happyReduce_14 = happySpecReduce_1 17 happyReduction_14 happyReduction_14 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_14 _ = notHappyAtAll happyReduce_15 = happySpecReduce_1 17 happyReduction_15 happyReduction_15 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_15 _ = notHappyAtAll happyReduce_16 = happySpecReduce_1 17 happyReduction_16 happyReduction_16 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_16 _ = notHappyAtAll happyReduce_17 = happySpecReduce_1 17 happyReduction_17 happyReduction_17 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_17 _ = notHappyAtAll happyReduce_18 = happySpecReduce_3 17 happyReduction_18 happyReduction_18 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) $ getRdrName funTyCon ) happyReduction_18 _ _ _ = notHappyAtAll happyReduce_19 = happyMonadReduce 7 18 happyReduction_19 happyReduction_19 ((HappyAbsSyn22 happy_var_7) `HappyStk` _ `HappyStk` (HappyAbsSyn29 happy_var_5) `HappyStk` (HappyAbsSyn21 happy_var_4) `HappyStk` (HappyAbsSyn235 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn19 happy_var_1) `HappyStk` happyRest) tk = happyThen (( fileSrcSpan >>= \ loc -> return (L loc (HsModule (Just happy_var_3) happy_var_5 (fst happy_var_7) (snd happy_var_7) happy_var_4 happy_var_1 ) )) ) (\r -> happyReturn (HappyAbsSyn16 r)) happyReduce_20 = happyMonadReduce 1 18 happyReduction_20 happyReduction_20 ((HappyAbsSyn22 happy_var_1) `HappyStk` happyRest) tk = happyThen (( fileSrcSpan >>= \ loc -> return (L loc (HsModule Nothing Nothing (fst happy_var_1) (snd happy_var_1) Nothing Nothing ))) ) (\r -> happyReturn (HappyAbsSyn16 r)) happyReduce_21 = happySpecReduce_1 19 happyReduction_21 happyReduction_21 (HappyAbsSyn19 happy_var_1) = HappyAbsSyn19 (happy_var_1 ) happyReduction_21 _ = notHappyAtAll happyReduce_22 = happySpecReduce_0 19 happyReduction_22 happyReduction_22 = HappyAbsSyn19 (Nothing ) happyReduce_23 = happyMonadReduce 0 20 happyReduction_23 happyReduction_23 (happyRest) tk = happyThen (( pushCurrentContext) ) (\r -> happyReturn (HappyAbsSyn20 r)) happyReduce_24 = happySpecReduce_3 21 happyReduction_24 happyReduction_24 _ (HappyAbsSyn86 happy_var_2) _ = HappyAbsSyn21 (Just (DeprecatedTxt $ unLoc happy_var_2) ) happyReduction_24 _ _ _ = notHappyAtAll happyReduce_25 = happySpecReduce_3 21 happyReduction_25 happyReduction_25 _ (HappyAbsSyn86 happy_var_2) _ = HappyAbsSyn21 (Just (WarningTxt $ unLoc happy_var_2) ) happyReduction_25 _ _ _ = notHappyAtAll happyReduce_26 = happySpecReduce_0 21 happyReduction_26 happyReduction_26 = HappyAbsSyn21 (Nothing ) happyReduce_27 = happySpecReduce_3 22 happyReduction_27 happyReduction_27 _ (HappyAbsSyn22 happy_var_2) _ = HappyAbsSyn22 (happy_var_2 ) happyReduction_27 _ _ _ = notHappyAtAll happyReduce_28 = happySpecReduce_3 22 happyReduction_28 happyReduction_28 _ (HappyAbsSyn22 happy_var_2) _ = HappyAbsSyn22 (happy_var_2 ) happyReduction_28 _ _ _ = notHappyAtAll happyReduce_29 = happySpecReduce_3 23 happyReduction_29 happyReduction_29 _ (HappyAbsSyn22 happy_var_2) _ = HappyAbsSyn22 (happy_var_2 ) happyReduction_29 _ _ _ = notHappyAtAll happyReduce_30 = happySpecReduce_3 23 happyReduction_30 happyReduction_30 _ (HappyAbsSyn22 happy_var_2) _ = HappyAbsSyn22 (happy_var_2 ) happyReduction_30 _ _ _ = notHappyAtAll happyReduce_31 = happySpecReduce_1 24 happyReduction_31 happyReduction_31 (HappyAbsSyn27 happy_var_1) = HappyAbsSyn22 ((reverse happy_var_1,[]) ) happyReduction_31 _ = notHappyAtAll happyReduce_32 = happySpecReduce_3 24 happyReduction_32 happyReduction_32 (HappyAbsSyn25 happy_var_3) _ (HappyAbsSyn27 happy_var_1) = HappyAbsSyn22 ((reverse happy_var_1,happy_var_3) ) happyReduction_32 _ _ _ = notHappyAtAll happyReduce_33 = happySpecReduce_1 24 happyReduction_33 happyReduction_33 (HappyAbsSyn25 happy_var_1) = HappyAbsSyn22 (([],happy_var_1) ) happyReduction_33 _ = notHappyAtAll happyReduce_34 = happySpecReduce_1 25 happyReduction_34 happyReduction_34 (HappyAbsSyn51 happy_var_1) = HappyAbsSyn25 (cvTopDecls happy_var_1 ) happyReduction_34 _ = notHappyAtAll happyReduce_35 = happyMonadReduce 7 26 happyReduction_35 happyReduction_35 ((HappyAbsSyn27 happy_var_7) `HappyStk` _ `HappyStk` (HappyAbsSyn29 happy_var_5) `HappyStk` (HappyAbsSyn21 happy_var_4) `HappyStk` (HappyAbsSyn235 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn19 happy_var_1) `HappyStk` happyRest) tk = happyThen (( fileSrcSpan >>= \ loc -> return (L loc (HsModule (Just happy_var_3) happy_var_5 happy_var_7 [] happy_var_4 happy_var_1 ))) ) (\r -> happyReturn (HappyAbsSyn16 r)) happyReduce_36 = happyMonadReduce 1 26 happyReduction_36 happyReduction_36 ((HappyAbsSyn27 happy_var_1) `HappyStk` happyRest) tk = happyThen (( fileSrcSpan >>= \ loc -> return (L loc (HsModule Nothing Nothing happy_var_1 [] Nothing Nothing))) ) (\r -> happyReturn (HappyAbsSyn16 r)) happyReduce_37 = happySpecReduce_2 27 happyReduction_37 happyReduction_37 (HappyAbsSyn27 happy_var_2) _ = HappyAbsSyn27 (happy_var_2 ) happyReduction_37 _ _ = notHappyAtAll happyReduce_38 = happySpecReduce_2 27 happyReduction_38 happyReduction_38 (HappyAbsSyn27 happy_var_2) _ = HappyAbsSyn27 (happy_var_2 ) happyReduction_38 _ _ = notHappyAtAll happyReduce_39 = happySpecReduce_2 28 happyReduction_39 happyReduction_39 (HappyAbsSyn27 happy_var_2) _ = HappyAbsSyn27 (happy_var_2 ) happyReduction_39 _ _ = notHappyAtAll happyReduce_40 = happySpecReduce_2 28 happyReduction_40 happyReduction_40 (HappyAbsSyn27 happy_var_2) _ = HappyAbsSyn27 (happy_var_2 ) happyReduction_40 _ _ = notHappyAtAll happyReduce_41 = happySpecReduce_3 29 happyReduction_41 happyReduction_41 _ (HappyAbsSyn30 happy_var_2) _ = HappyAbsSyn29 (Just happy_var_2 ) happyReduction_41 _ _ _ = notHappyAtAll happyReduce_42 = happySpecReduce_0 29 happyReduction_42 happyReduction_42 = HappyAbsSyn29 (Nothing ) happyReduce_43 = happySpecReduce_3 30 happyReduction_43 happyReduction_43 (HappyAbsSyn30 happy_var_3) _ (HappyAbsSyn30 happy_var_1) = HappyAbsSyn30 (happy_var_1 ++ happy_var_3 ) happyReduction_43 _ _ _ = notHappyAtAll happyReduce_44 = happySpecReduce_1 30 happyReduction_44 happyReduction_44 (HappyAbsSyn30 happy_var_1) = HappyAbsSyn30 (happy_var_1 ) happyReduction_44 _ = notHappyAtAll happyReduce_45 = happyReduce 5 31 happyReduction_45 happyReduction_45 ((HappyAbsSyn30 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn30 happy_var_3) `HappyStk` (HappyAbsSyn33 happy_var_2) `HappyStk` (HappyAbsSyn30 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn30 (happy_var_1 ++ (happy_var_2 : happy_var_3) ++ happy_var_5 ) `HappyStk` happyRest happyReduce_46 = happySpecReduce_3 31 happyReduction_46 happyReduction_46 (HappyAbsSyn30 happy_var_3) (HappyAbsSyn33 happy_var_2) (HappyAbsSyn30 happy_var_1) = HappyAbsSyn30 (happy_var_1 ++ (happy_var_2 : happy_var_3) ) happyReduction_46 _ _ _ = notHappyAtAll happyReduce_47 = happySpecReduce_1 31 happyReduction_47 happyReduction_47 (HappyAbsSyn30 happy_var_1) = HappyAbsSyn30 (happy_var_1 ) happyReduction_47 _ = notHappyAtAll happyReduce_48 = happySpecReduce_2 32 happyReduction_48 happyReduction_48 (HappyAbsSyn30 happy_var_2) (HappyAbsSyn33 happy_var_1) = HappyAbsSyn30 (happy_var_1 : happy_var_2 ) happyReduction_48 _ _ = notHappyAtAll happyReduce_49 = happySpecReduce_0 32 happyReduction_49 happyReduction_49 = HappyAbsSyn30 ([] ) happyReduce_50 = happySpecReduce_1 33 happyReduction_50 happyReduction_50 (HappyAbsSyn240 happy_var_1) = HappyAbsSyn33 (sL (getLoc happy_var_1) (case (unLoc happy_var_1) of (n, doc) -> IEGroup n doc) ) happyReduction_50 _ = notHappyAtAll happyReduce_51 = happySpecReduce_1 33 happyReduction_51 happyReduction_51 (HappyAbsSyn239 happy_var_1) = HappyAbsSyn33 (sL (getLoc happy_var_1) (IEDocNamed ((fst . unLoc) happy_var_1)) ) happyReduction_51 _ = notHappyAtAll happyReduce_52 = happySpecReduce_1 33 happyReduction_52 happyReduction_52 (HappyAbsSyn237 happy_var_1) = HappyAbsSyn33 (sL (getLoc happy_var_1) (IEDoc (unLoc happy_var_1)) ) happyReduction_52 _ = notHappyAtAll happyReduce_53 = happySpecReduce_2 34 happyReduction_53 happyReduction_53 (HappyAbsSyn35 happy_var_2) (HappyAbsSyn17 happy_var_1) = HappyAbsSyn33 (sL (comb2 happy_var_1 happy_var_2) (mkModuleImpExp (unLoc happy_var_1) (unLoc happy_var_2)) ) happyReduction_53 _ _ = notHappyAtAll happyReduce_54 = happySpecReduce_2 34 happyReduction_54 happyReduction_54 (HappyAbsSyn235 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn33 (sL (comb2 happy_var_1 happy_var_2) (IEModuleContents (unLoc happy_var_2)) ) happyReduction_54 _ _ = notHappyAtAll happyReduce_55 = happySpecReduce_0 35 happyReduction_55 happyReduction_55 = HappyAbsSyn35 (L noSrcSpan ImpExpAbs ) happyReduce_56 = happySpecReduce_3 35 happyReduction_56 happyReduction_56 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn35 (sL (comb2 happy_var_1 happy_var_3) ImpExpAll ) happyReduction_56 _ _ _ = notHappyAtAll happyReduce_57 = happySpecReduce_2 35 happyReduction_57 happyReduction_57 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn35 (sL (comb2 happy_var_1 happy_var_2) (ImpExpList []) ) happyReduction_57 _ _ = notHappyAtAll happyReduce_58 = happySpecReduce_3 35 happyReduction_58 happyReduction_58 (HappyTerminal happy_var_3) (HappyAbsSyn36 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn35 (sL (comb2 happy_var_1 happy_var_3) (ImpExpList (reverse happy_var_2)) ) happyReduction_58 _ _ _ = notHappyAtAll happyReduce_59 = happySpecReduce_3 36 happyReduction_59 happyReduction_59 (HappyAbsSyn17 happy_var_3) _ (HappyAbsSyn36 happy_var_1) = HappyAbsSyn36 (unLoc happy_var_3 : happy_var_1 ) happyReduction_59 _ _ _ = notHappyAtAll happyReduce_60 = happySpecReduce_1 36 happyReduction_60 happyReduction_60 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn36 ([unLoc happy_var_1] ) happyReduction_60 _ = notHappyAtAll happyReduce_61 = happySpecReduce_1 37 happyReduction_61 happyReduction_61 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_61 _ = notHappyAtAll happyReduce_62 = happyMonadReduce 2 37 happyReduction_62 happyReduction_62 ((HappyAbsSyn17 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkTypeImpExp (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_2))) ) (\r -> happyReturn (HappyAbsSyn17 r)) happyReduce_63 = happySpecReduce_1 38 happyReduction_63 happyReduction_63 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_63 _ = notHappyAtAll happyReduce_64 = happySpecReduce_1 38 happyReduction_64 happyReduction_64 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_64 _ = notHappyAtAll happyReduce_65 = happySpecReduce_3 39 happyReduction_65 happyReduction_65 (HappyAbsSyn40 happy_var_3) _ (HappyAbsSyn27 happy_var_1) = HappyAbsSyn27 (happy_var_3 : happy_var_1 ) happyReduction_65 _ _ _ = notHappyAtAll happyReduce_66 = happySpecReduce_2 39 happyReduction_66 happyReduction_66 _ (HappyAbsSyn27 happy_var_1) = HappyAbsSyn27 (happy_var_1 ) happyReduction_66 _ _ = notHappyAtAll happyReduce_67 = happySpecReduce_1 39 happyReduction_67 happyReduction_67 (HappyAbsSyn40 happy_var_1) = HappyAbsSyn27 ([ happy_var_1 ] ) happyReduction_67 _ = notHappyAtAll happyReduce_68 = happySpecReduce_0 39 happyReduction_68 happyReduction_68 = HappyAbsSyn27 ([] ) happyReduce_69 = happyReduce 8 40 happyReduction_69 happyReduction_69 ((HappyAbsSyn46 happy_var_8) `HappyStk` (HappyAbsSyn45 happy_var_7) `HappyStk` (HappyAbsSyn235 happy_var_6) `HappyStk` (HappyAbsSyn43 happy_var_5) `HappyStk` (HappyAbsSyn42 happy_var_4) `HappyStk` (HappyAbsSyn42 happy_var_3) `HappyStk` (HappyAbsSyn41 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn40 (L (comb4 happy_var_1 happy_var_6 happy_var_7 happy_var_8) $ ImportDecl { ideclName = happy_var_6, ideclPkgQual = happy_var_5 , ideclSource = happy_var_2, ideclSafe = happy_var_3 , ideclQualified = happy_var_4, ideclImplicit = False , ideclAs = unLoc happy_var_7, ideclHiding = unLoc happy_var_8 } ) `HappyStk` happyRest happyReduce_70 = happySpecReduce_2 41 happyReduction_70 happyReduction_70 _ _ = HappyAbsSyn41 (True ) happyReduce_71 = happySpecReduce_0 41 happyReduction_71 happyReduction_71 = HappyAbsSyn41 (False ) happyReduce_72 = happySpecReduce_1 42 happyReduction_72 happyReduction_72 _ = HappyAbsSyn42 (True ) happyReduce_73 = happySpecReduce_0 42 happyReduction_73 happyReduction_73 = HappyAbsSyn42 (False ) happyReduce_74 = happySpecReduce_1 43 happyReduction_74 happyReduction_74 (HappyTerminal happy_var_1) = HappyAbsSyn43 (Just (getSTRING happy_var_1) ) happyReduction_74 _ = notHappyAtAll happyReduce_75 = happySpecReduce_0 43 happyReduction_75 happyReduction_75 = HappyAbsSyn43 (Nothing ) happyReduce_76 = happySpecReduce_1 44 happyReduction_76 happyReduction_76 _ = HappyAbsSyn42 (True ) happyReduce_77 = happySpecReduce_0 44 happyReduction_77 happyReduction_77 = HappyAbsSyn42 (False ) happyReduce_78 = happySpecReduce_2 45 happyReduction_78 happyReduction_78 (HappyAbsSyn235 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn45 (sL (comb2 happy_var_1 happy_var_2) (Just (unLoc happy_var_2)) ) happyReduction_78 _ _ = notHappyAtAll happyReduce_79 = happySpecReduce_0 45 happyReduction_79 happyReduction_79 = HappyAbsSyn45 (noLoc Nothing ) happyReduce_80 = happySpecReduce_1 46 happyReduction_80 happyReduction_80 (HappyAbsSyn47 happy_var_1) = HappyAbsSyn46 (sL (getLoc happy_var_1) (Just (unLoc happy_var_1)) ) happyReduction_80 _ = notHappyAtAll happyReduce_81 = happySpecReduce_0 46 happyReduction_81 happyReduction_81 = HappyAbsSyn46 (noLoc Nothing ) happyReduce_82 = happySpecReduce_3 47 happyReduction_82 happyReduction_82 (HappyTerminal happy_var_3) (HappyAbsSyn30 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn47 (sL (comb2 happy_var_1 happy_var_3) (False, happy_var_2) ) happyReduction_82 _ _ _ = notHappyAtAll happyReduce_83 = happyReduce 4 47 happyReduction_83 happyReduction_83 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn30 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn47 (sL (comb2 happy_var_1 happy_var_4) (True, happy_var_3) ) `HappyStk` happyRest happyReduce_84 = happySpecReduce_0 48 happyReduction_84 happyReduction_84 = HappyAbsSyn48 (9 ) happyReduce_85 = happyMonadReduce 1 48 happyReduction_85 happyReduction_85 ((HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkPrecP (sL (getLoc happy_var_1) (fromInteger (getINTEGER happy_var_1)))) ) (\r -> happyReturn (HappyAbsSyn48 r)) happyReduce_86 = happySpecReduce_1 49 happyReduction_86 happyReduction_86 (HappyTerminal happy_var_1) = HappyAbsSyn49 (sL (getLoc happy_var_1) InfixN ) happyReduction_86 _ = notHappyAtAll happyReduce_87 = happySpecReduce_1 49 happyReduction_87 happyReduction_87 (HappyTerminal happy_var_1) = HappyAbsSyn49 (sL (getLoc happy_var_1) InfixL ) happyReduction_87 _ = notHappyAtAll happyReduce_88 = happySpecReduce_1 49 happyReduction_88 happyReduction_88 (HappyTerminal happy_var_1) = HappyAbsSyn49 (sL (getLoc happy_var_1) InfixR ) happyReduction_88 _ = notHappyAtAll happyReduce_89 = happySpecReduce_3 50 happyReduction_89 happyReduction_89 (HappyAbsSyn17 happy_var_3) _ (HappyAbsSyn50 happy_var_1) = HappyAbsSyn50 (sL (comb2 happy_var_1 happy_var_3) (happy_var_3 : unLoc happy_var_1) ) happyReduction_89 _ _ _ = notHappyAtAll happyReduce_90 = happySpecReduce_1 50 happyReduction_90 happyReduction_90 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn50 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_90 _ = notHappyAtAll happyReduce_91 = happySpecReduce_3 51 happyReduction_91 happyReduction_91 (HappyAbsSyn51 happy_var_3) _ (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 `appOL` happy_var_3 ) happyReduction_91 _ _ _ = notHappyAtAll happyReduce_92 = happySpecReduce_2 51 happyReduction_92 happyReduction_92 _ (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 ) happyReduction_92 _ _ = notHappyAtAll happyReduce_93 = happySpecReduce_1 51 happyReduction_93 happyReduction_93 (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 ) happyReduction_93 _ = notHappyAtAll happyReduce_94 = happySpecReduce_1 52 happyReduction_94 happyReduction_94 (HappyAbsSyn53 happy_var_1) = HappyAbsSyn51 (unitOL (sL (getLoc happy_var_1) (TyClD (unLoc happy_var_1))) ) happyReduction_94 _ = notHappyAtAll happyReduce_95 = happySpecReduce_1 52 happyReduction_95 happyReduction_95 (HappyAbsSyn53 happy_var_1) = HappyAbsSyn51 (unitOL (sL (getLoc happy_var_1) (TyClD (unLoc happy_var_1))) ) happyReduction_95 _ = notHappyAtAll happyReduce_96 = happySpecReduce_1 52 happyReduction_96 happyReduction_96 (HappyAbsSyn55 happy_var_1) = HappyAbsSyn51 (unitOL (sL (getLoc happy_var_1) (InstD (unLoc happy_var_1))) ) happyReduction_96 _ = notHappyAtAll happyReduce_97 = happySpecReduce_1 52 happyReduction_97 happyReduction_97 (HappyAbsSyn62 happy_var_1) = HappyAbsSyn51 (unitOL (sL (comb2 happy_var_1 happy_var_1) (DerivD (unLoc happy_var_1))) ) happyReduction_97 _ = notHappyAtAll happyReduce_98 = happyReduce 4 52 happyReduction_98 happyReduction_98 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn98 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn51 (unitOL (sL (comb2 happy_var_1 happy_var_4) $ DefD (DefaultDecl happy_var_3)) ) `HappyStk` happyRest happyReduce_99 = happySpecReduce_2 52 happyReduction_99 happyReduction_99 (HappyAbsSyn15 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn51 (unitOL (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_2)) ) happyReduction_99 _ _ = notHappyAtAll happyReduce_100 = happySpecReduce_3 52 happyReduction_100 happyReduction_100 _ (HappyAbsSyn51 happy_var_2) _ = HappyAbsSyn51 (happy_var_2 ) happyReduction_100 _ _ _ = notHappyAtAll happyReduce_101 = happySpecReduce_3 52 happyReduction_101 happyReduction_101 _ (HappyAbsSyn51 happy_var_2) _ = HappyAbsSyn51 (happy_var_2 ) happyReduction_101 _ _ _ = notHappyAtAll happyReduce_102 = happySpecReduce_3 52 happyReduction_102 happyReduction_102 _ (HappyAbsSyn51 happy_var_2) _ = HappyAbsSyn51 (happy_var_2 ) happyReduction_102 _ _ _ = notHappyAtAll happyReduce_103 = happySpecReduce_3 52 happyReduction_103 happyReduction_103 (HappyTerminal happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn51 (unitOL $ sL (comb2 happy_var_1 happy_var_3) $ VectD (HsVect happy_var_2 Nothing) ) happyReduction_103 _ _ _ = notHappyAtAll happyReduce_104 = happyReduce 5 52 happyReduction_104 happyReduction_104 ((HappyTerminal happy_var_5) `HappyStk` (HappyAbsSyn143 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn17 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn51 (unitOL $ sL (comb2 happy_var_1 happy_var_5) $ VectD (HsVect happy_var_2 (Just happy_var_4)) ) `HappyStk` happyRest happyReduce_105 = happySpecReduce_3 52 happyReduction_105 happyReduction_105 (HappyTerminal happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn51 (unitOL $ sL (comb2 happy_var_1 happy_var_3) $ VectD (HsNoVect happy_var_2) ) happyReduction_105 _ _ _ = notHappyAtAll happyReduce_106 = happyReduce 4 52 happyReduction_106 happyReduction_106 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn51 (unitOL $ sL (comb2 happy_var_1 happy_var_4) $ VectD (HsVectTypeIn False happy_var_3 Nothing) ) `HappyStk` happyRest happyReduce_107 = happyReduce 4 52 happyReduction_107 happyReduction_107 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn51 (unitOL $ sL (comb2 happy_var_1 happy_var_4) $ VectD (HsVectTypeIn True happy_var_3 Nothing) ) `HappyStk` happyRest happyReduce_108 = happyReduce 6 52 happyReduction_108 happyReduction_108 ((HappyTerminal happy_var_6) `HappyStk` (HappyAbsSyn17 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn51 (unitOL $ sL (comb2 happy_var_1 happy_var_6) $ VectD (HsVectTypeIn False happy_var_3 (Just happy_var_5)) ) `HappyStk` happyRest happyReduce_109 = happyReduce 6 52 happyReduction_109 happyReduction_109 ((HappyTerminal happy_var_6) `HappyStk` (HappyAbsSyn17 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn51 (unitOL $ sL (comb2 happy_var_1 happy_var_6) $ VectD (HsVectTypeIn True happy_var_3 (Just happy_var_5)) ) `HappyStk` happyRest happyReduce_110 = happyReduce 4 52 happyReduction_110 happyReduction_110 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn51 (unitOL $ sL (comb2 happy_var_1 happy_var_4) $ VectD (HsVectClassIn happy_var_3) ) `HappyStk` happyRest happyReduce_111 = happyReduce 4 52 happyReduction_111 happyReduction_111 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn95 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn51 (unitOL $ sL (comb2 happy_var_1 happy_var_4) $ VectD (HsVectInstIn happy_var_3) ) `HappyStk` happyRest happyReduce_112 = happySpecReduce_1 52 happyReduction_112 happyReduction_112 (HappyAbsSyn15 happy_var_1) = HappyAbsSyn51 (unitOL happy_var_1 ) happyReduction_112 _ = notHappyAtAll happyReduce_113 = happySpecReduce_1 52 happyReduction_113 happyReduction_113 (HappyAbsSyn63 happy_var_1) = HappyAbsSyn51 (unLoc happy_var_1 ) happyReduction_113 _ = notHappyAtAll happyReduce_114 = happyMonadReduce 4 53 happyReduction_114 happyReduction_114 ((HappyAbsSyn63 happy_var_4) `HappyStk` (HappyAbsSyn114 happy_var_3) `HappyStk` (HappyAbsSyn60 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkClassDecl (comb4 happy_var_1 happy_var_2 happy_var_3 happy_var_4) happy_var_2 happy_var_3 happy_var_4) ) (\r -> happyReturn (HappyAbsSyn53 r)) happyReduce_115 = happyMonadReduce 4 54 happyReduction_115 happyReduction_115 ((HappyAbsSyn95 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn95 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkTySynonym (comb2 happy_var_1 happy_var_4) happy_var_2 happy_var_4) ) (\r -> happyReturn (HappyAbsSyn53 r)) happyReduce_116 = happyMonadReduce 4 54 happyReduction_116 happyReduction_116 ((HappyAbsSyn59 happy_var_4) `HappyStk` (HappyAbsSyn95 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkTyFamily (comb3 happy_var_1 happy_var_3 happy_var_4) TypeFamily happy_var_3 (unLoc happy_var_4)) ) (\r -> happyReturn (HappyAbsSyn53 r)) happyReduce_117 = happyMonadReduce 5 54 happyReduction_117 happyReduction_117 ((HappyAbsSyn134 happy_var_5) `HappyStk` (HappyAbsSyn123 happy_var_4) `HappyStk` (HappyAbsSyn60 happy_var_3) `HappyStk` (HappyAbsSyn61 happy_var_2) `HappyStk` (HappyAbsSyn58 happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkTyData (comb4 happy_var_1 happy_var_3 happy_var_4 happy_var_5) (unLoc happy_var_1) happy_var_2 happy_var_3 Nothing (reverse (unLoc happy_var_4)) (unLoc happy_var_5)) ) (\r -> happyReturn (HappyAbsSyn53 r)) happyReduce_118 = happyMonadReduce 6 54 happyReduction_118 happyReduction_118 ((HappyAbsSyn134 happy_var_6) `HappyStk` (HappyAbsSyn123 happy_var_5) `HappyStk` (HappyAbsSyn59 happy_var_4) `HappyStk` (HappyAbsSyn60 happy_var_3) `HappyStk` (HappyAbsSyn61 happy_var_2) `HappyStk` (HappyAbsSyn58 happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkTyData (comb4 happy_var_1 happy_var_3 happy_var_5 happy_var_6) (unLoc happy_var_1) happy_var_2 happy_var_3 (unLoc happy_var_4) (unLoc happy_var_5) (unLoc happy_var_6)) ) (\r -> happyReturn (HappyAbsSyn53 r)) happyReduce_119 = happyMonadReduce 4 54 happyReduction_119 happyReduction_119 ((HappyAbsSyn59 happy_var_4) `HappyStk` (HappyAbsSyn95 happy_var_3) `HappyStk` (HappyTerminal happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkTyFamily (comb3 happy_var_1 happy_var_2 happy_var_4) DataFamily happy_var_3 (unLoc happy_var_4)) ) (\r -> happyReturn (HappyAbsSyn53 r)) happyReduce_120 = happySpecReduce_3 55 happyReduction_120 happyReduction_120 (HappyAbsSyn63 happy_var_3) (HappyAbsSyn95 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn55 (let (binds, sigs, _, ats, _) = cvBindsAndSigs (unLoc happy_var_3) in L (comb3 happy_var_1 happy_var_2 happy_var_3) (ClsInstD { cid_poly_ty = happy_var_2, cid_binds = binds , cid_sigs = sigs, cid_fam_insts = ats }) ) happyReduction_120 _ _ _ = notHappyAtAll happyReduce_121 = happyMonadReduce 5 55 happyReduction_121 happyReduction_121 ((HappyAbsSyn95 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn95 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( do { L loc d <- mkFamInstSynonym (comb2 happy_var_1 happy_var_5) happy_var_3 happy_var_5 ; return (L loc (FamInstD { lid_inst = d })) }) ) (\r -> happyReturn (HappyAbsSyn55 r)) happyReduce_122 = happyMonadReduce 5 55 happyReduction_122 happyReduction_122 ((HappyAbsSyn134 happy_var_5) `HappyStk` (HappyAbsSyn123 happy_var_4) `HappyStk` (HappyAbsSyn60 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn58 happy_var_1) `HappyStk` happyRest) tk = happyThen (( do { L loc d <- mkFamInstData (comb4 happy_var_1 happy_var_3 happy_var_4 happy_var_5) (unLoc happy_var_1) Nothing happy_var_3 Nothing (reverse (unLoc happy_var_4)) (unLoc happy_var_5) ; return (L loc (FamInstD { lid_inst = d })) }) ) (\r -> happyReturn (HappyAbsSyn55 r)) happyReduce_123 = happyMonadReduce 6 55 happyReduction_123 happyReduction_123 ((HappyAbsSyn134 happy_var_6) `HappyStk` (HappyAbsSyn123 happy_var_5) `HappyStk` (HappyAbsSyn59 happy_var_4) `HappyStk` (HappyAbsSyn60 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn58 happy_var_1) `HappyStk` happyRest) tk = happyThen (( do { L loc d <- mkFamInstData (comb4 happy_var_1 happy_var_3 happy_var_5 happy_var_6) (unLoc happy_var_1) Nothing happy_var_3 (unLoc happy_var_4) (unLoc happy_var_5) (unLoc happy_var_6) ; return (L loc (FamInstD { lid_inst = d })) }) ) (\r -> happyReturn (HappyAbsSyn55 r)) happyReduce_124 = happyMonadReduce 3 56 happyReduction_124 happyReduction_124 ((HappyAbsSyn59 happy_var_3) `HappyStk` (HappyAbsSyn95 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( do { L loc decl <- mkTyFamily (comb3 happy_var_1 happy_var_2 happy_var_3) TypeFamily happy_var_2 (unLoc happy_var_3) ; return (L loc (TyClD decl)) }) ) (\r -> happyReturn (HappyAbsSyn15 r)) happyReduce_125 = happyMonadReduce 3 56 happyReduction_125 happyReduction_125 ((HappyAbsSyn59 happy_var_3) `HappyStk` (HappyAbsSyn95 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( do { L loc decl <- mkTyFamily (comb3 happy_var_1 happy_var_2 happy_var_3) DataFamily happy_var_2 (unLoc happy_var_3) ; return (L loc (TyClD decl)) }) ) (\r -> happyReturn (HappyAbsSyn15 r)) happyReduce_126 = happyMonadReduce 4 56 happyReduction_126 happyReduction_126 ((HappyAbsSyn95 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn95 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( do { L loc fid <- mkFamInstSynonym (comb2 happy_var_1 happy_var_4) happy_var_2 happy_var_4 ; return (L loc (InstD (FamInstD { lid_inst = fid }))) }) ) (\r -> happyReturn (HappyAbsSyn15 r)) happyReduce_127 = happyMonadReduce 4 57 happyReduction_127 happyReduction_127 ((HappyAbsSyn95 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn95 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkFamInstSynonym (comb2 happy_var_1 happy_var_4) happy_var_2 happy_var_4) ) (\r -> happyReturn (HappyAbsSyn57 r)) happyReduce_128 = happyMonadReduce 5 57 happyReduction_128 happyReduction_128 ((HappyAbsSyn134 happy_var_5) `HappyStk` (HappyAbsSyn123 happy_var_4) `HappyStk` (HappyAbsSyn60 happy_var_3) `HappyStk` (HappyAbsSyn61 happy_var_2) `HappyStk` (HappyAbsSyn58 happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkFamInstData (comb4 happy_var_1 happy_var_3 happy_var_4 happy_var_5) (unLoc happy_var_1) happy_var_2 happy_var_3 Nothing (reverse (unLoc happy_var_4)) (unLoc happy_var_5)) ) (\r -> happyReturn (HappyAbsSyn57 r)) happyReduce_129 = happyMonadReduce 6 57 happyReduction_129 happyReduction_129 ((HappyAbsSyn134 happy_var_6) `HappyStk` (HappyAbsSyn123 happy_var_5) `HappyStk` (HappyAbsSyn59 happy_var_4) `HappyStk` (HappyAbsSyn60 happy_var_3) `HappyStk` (HappyAbsSyn61 happy_var_2) `HappyStk` (HappyAbsSyn58 happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkFamInstData (comb4 happy_var_1 happy_var_3 happy_var_5 happy_var_6) (unLoc happy_var_1) happy_var_2 happy_var_3 (unLoc happy_var_4) (unLoc happy_var_5) (unLoc happy_var_6)) ) (\r -> happyReturn (HappyAbsSyn57 r)) happyReduce_130 = happySpecReduce_1 58 happyReduction_130 happyReduction_130 (HappyTerminal happy_var_1) = HappyAbsSyn58 (sL (getLoc happy_var_1) DataType ) happyReduction_130 _ = notHappyAtAll happyReduce_131 = happySpecReduce_1 58 happyReduction_131 happyReduction_131 (HappyTerminal happy_var_1) = HappyAbsSyn58 (sL (getLoc happy_var_1) NewType ) happyReduction_131 _ = notHappyAtAll happyReduce_132 = happySpecReduce_0 59 happyReduction_132 happyReduction_132 = HappyAbsSyn59 (noLoc Nothing ) happyReduce_133 = happySpecReduce_2 59 happyReduction_133 happyReduction_133 (HappyAbsSyn118 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn59 (sL (comb2 happy_var_1 happy_var_2) (Just happy_var_2) ) happyReduction_133 _ _ = notHappyAtAll happyReduce_134 = happySpecReduce_3 60 happyReduction_134 happyReduction_134 (HappyAbsSyn95 happy_var_3) _ (HappyAbsSyn103 happy_var_1) = HappyAbsSyn60 (sL (comb2 happy_var_1 happy_var_3) (Just happy_var_1, happy_var_3) ) happyReduction_134 _ _ _ = notHappyAtAll happyReduce_135 = happySpecReduce_1 60 happyReduction_135 happyReduction_135 (HappyAbsSyn95 happy_var_1) = HappyAbsSyn60 (sL (getLoc happy_var_1) (Nothing, happy_var_1) ) happyReduction_135 _ = notHappyAtAll happyReduce_136 = happyReduce 4 61 happyReduction_136 happyReduction_136 (_ `HappyStk` (HappyTerminal happy_var_3) `HappyStk` (HappyTerminal happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn61 (Just (CType (Just (Header (getSTRING happy_var_2))) (getSTRING happy_var_3)) ) `HappyStk` happyRest happyReduce_137 = happySpecReduce_3 61 happyReduction_137 happyReduction_137 _ (HappyTerminal happy_var_2) _ = HappyAbsSyn61 (Just (CType Nothing (getSTRING happy_var_2)) ) happyReduction_137 _ _ _ = notHappyAtAll happyReduce_138 = happySpecReduce_0 61 happyReduction_138 happyReduction_138 = HappyAbsSyn61 (Nothing ) happyReduce_139 = happySpecReduce_3 62 happyReduction_139 happyReduction_139 (HappyAbsSyn95 happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn62 (sL (comb2 happy_var_1 happy_var_3) (DerivDecl happy_var_3) ) happyReduction_139 _ _ _ = notHappyAtAll happyReduce_140 = happySpecReduce_1 63 happyReduction_140 happyReduction_140 (HappyAbsSyn15 happy_var_1) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_1) (unitOL happy_var_1) ) happyReduction_140 _ = notHappyAtAll happyReduce_141 = happySpecReduce_1 63 happyReduction_141 happyReduction_141 (HappyAbsSyn63 happy_var_1) = HappyAbsSyn63 (happy_var_1 ) happyReduction_141 _ = notHappyAtAll happyReduce_142 = happyMonadReduce 4 63 happyReduction_142 happyReduction_142 ((HappyAbsSyn95 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn143 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( do { (TypeSig l ty) <- checkValSig happy_var_2 happy_var_4 ; return (sL (comb2 happy_var_1 happy_var_4) $ unitOL (sL (comb2 happy_var_1 happy_var_4) $ SigD (GenericSig l ty))) }) ) (\r -> happyReturn (HappyAbsSyn63 r)) happyReduce_143 = happySpecReduce_3 64 happyReduction_143 happyReduction_143 (HappyAbsSyn63 happy_var_3) _ (HappyAbsSyn63 happy_var_1) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_1 `appOL` unLoc happy_var_3) ) happyReduction_143 _ _ _ = notHappyAtAll happyReduce_144 = happySpecReduce_2 64 happyReduction_144 happyReduction_144 (HappyTerminal happy_var_2) (HappyAbsSyn63 happy_var_1) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_1) ) happyReduction_144 _ _ = notHappyAtAll happyReduce_145 = happySpecReduce_1 64 happyReduction_145 happyReduction_145 (HappyAbsSyn63 happy_var_1) = HappyAbsSyn63 (happy_var_1 ) happyReduction_145 _ = notHappyAtAll happyReduce_146 = happySpecReduce_0 64 happyReduction_146 happyReduction_146 = HappyAbsSyn63 (noLoc nilOL ) happyReduce_147 = happySpecReduce_3 65 happyReduction_147 happyReduction_147 (HappyTerminal happy_var_3) (HappyAbsSyn63 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_147 _ _ _ = notHappyAtAll happyReduce_148 = happySpecReduce_3 65 happyReduction_148 happyReduction_148 _ (HappyAbsSyn63 happy_var_2) _ = HappyAbsSyn63 (happy_var_2 ) happyReduction_148 _ _ _ = notHappyAtAll happyReduce_149 = happySpecReduce_2 66 happyReduction_149 happyReduction_149 (HappyAbsSyn63 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_2) ) happyReduction_149 _ _ = notHappyAtAll happyReduce_150 = happySpecReduce_0 66 happyReduction_150 happyReduction_150 = HappyAbsSyn63 (noLoc nilOL ) happyReduce_151 = happySpecReduce_1 67 happyReduction_151 happyReduction_151 (HappyAbsSyn57 happy_var_1) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_1) (unitOL (sL (getLoc happy_var_1) (InstD (FamInstD { lid_inst = unLoc happy_var_1 })))) ) happyReduction_151 _ = notHappyAtAll happyReduce_152 = happySpecReduce_1 67 happyReduction_152 happyReduction_152 (HappyAbsSyn63 happy_var_1) = HappyAbsSyn63 (happy_var_1 ) happyReduction_152 _ = notHappyAtAll happyReduce_153 = happySpecReduce_3 68 happyReduction_153 happyReduction_153 (HappyAbsSyn63 happy_var_3) _ (HappyAbsSyn63 happy_var_1) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_1 `appOL` unLoc happy_var_3) ) happyReduction_153 _ _ _ = notHappyAtAll happyReduce_154 = happySpecReduce_2 68 happyReduction_154 happyReduction_154 (HappyTerminal happy_var_2) (HappyAbsSyn63 happy_var_1) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_1) ) happyReduction_154 _ _ = notHappyAtAll happyReduce_155 = happySpecReduce_1 68 happyReduction_155 happyReduction_155 (HappyAbsSyn63 happy_var_1) = HappyAbsSyn63 (happy_var_1 ) happyReduction_155 _ = notHappyAtAll happyReduce_156 = happySpecReduce_0 68 happyReduction_156 happyReduction_156 = HappyAbsSyn63 (noLoc nilOL ) happyReduce_157 = happySpecReduce_3 69 happyReduction_157 happyReduction_157 (HappyTerminal happy_var_3) (HappyAbsSyn63 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_157 _ _ _ = notHappyAtAll happyReduce_158 = happySpecReduce_3 69 happyReduction_158 happyReduction_158 _ (HappyAbsSyn63 happy_var_2) _ = HappyAbsSyn63 (happy_var_2 ) happyReduction_158 _ _ _ = notHappyAtAll happyReduce_159 = happySpecReduce_2 70 happyReduction_159 happyReduction_159 (HappyAbsSyn63 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_2) ) happyReduction_159 _ _ = notHappyAtAll happyReduce_160 = happySpecReduce_0 70 happyReduction_160 happyReduction_160 = HappyAbsSyn63 (noLoc nilOL ) happyReduce_161 = happySpecReduce_3 71 happyReduction_161 happyReduction_161 (HappyAbsSyn63 happy_var_3) _ (HappyAbsSyn63 happy_var_1) = HappyAbsSyn63 (let { this = unLoc happy_var_3; rest = unLoc happy_var_1; these = rest `appOL` this } in rest `seq` this `seq` these `seq` sL (comb2 happy_var_1 happy_var_3) these ) happyReduction_161 _ _ _ = notHappyAtAll happyReduce_162 = happySpecReduce_2 71 happyReduction_162 happyReduction_162 (HappyTerminal happy_var_2) (HappyAbsSyn63 happy_var_1) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_1) ) happyReduction_162 _ _ = notHappyAtAll happyReduce_163 = happySpecReduce_1 71 happyReduction_163 happyReduction_163 (HappyAbsSyn63 happy_var_1) = HappyAbsSyn63 (happy_var_1 ) happyReduction_163 _ = notHappyAtAll happyReduce_164 = happySpecReduce_0 71 happyReduction_164 happyReduction_164 = HappyAbsSyn63 (noLoc nilOL ) happyReduce_165 = happySpecReduce_3 72 happyReduction_165 happyReduction_165 (HappyTerminal happy_var_3) (HappyAbsSyn63 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_165 _ _ _ = notHappyAtAll happyReduce_166 = happySpecReduce_3 72 happyReduction_166 happyReduction_166 _ (HappyAbsSyn63 happy_var_2) _ = HappyAbsSyn63 (happy_var_2 ) happyReduction_166 _ _ _ = notHappyAtAll happyReduce_167 = happySpecReduce_1 73 happyReduction_167 happyReduction_167 (HappyAbsSyn63 happy_var_1) = HappyAbsSyn73 (sL (getLoc happy_var_1) (HsValBinds (cvBindGroup (unLoc happy_var_1))) ) happyReduction_167 _ = notHappyAtAll happyReduce_168 = happySpecReduce_3 73 happyReduction_168 happyReduction_168 (HappyTerminal happy_var_3) (HappyAbsSyn190 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn73 (sL (comb2 happy_var_1 happy_var_3) (HsIPBinds (IPBinds (unLoc happy_var_2) emptyTcEvBinds)) ) happyReduction_168 _ _ _ = notHappyAtAll happyReduce_169 = happySpecReduce_3 73 happyReduction_169 happyReduction_169 _ (HappyAbsSyn190 happy_var_2) _ = HappyAbsSyn73 (L (getLoc happy_var_2) (HsIPBinds (IPBinds (unLoc happy_var_2) emptyTcEvBinds)) ) happyReduction_169 _ _ _ = notHappyAtAll happyReduce_170 = happySpecReduce_2 74 happyReduction_170 happyReduction_170 (HappyAbsSyn73 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn73 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_2) ) happyReduction_170 _ _ = notHappyAtAll happyReduce_171 = happySpecReduce_0 74 happyReduction_171 happyReduction_171 = HappyAbsSyn73 (noLoc emptyLocalBinds ) happyReduce_172 = happySpecReduce_3 75 happyReduction_172 happyReduction_172 (HappyAbsSyn15 happy_var_3) _ (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 `snocOL` happy_var_3 ) happyReduction_172 _ _ _ = notHappyAtAll happyReduce_173 = happySpecReduce_2 75 happyReduction_173 happyReduction_173 _ (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 ) happyReduction_173 _ _ = notHappyAtAll happyReduce_174 = happySpecReduce_1 75 happyReduction_174 happyReduction_174 (HappyAbsSyn15 happy_var_1) = HappyAbsSyn51 (unitOL happy_var_1 ) happyReduction_174 _ = notHappyAtAll happyReduce_175 = happySpecReduce_0 75 happyReduction_175 happyReduction_175 = HappyAbsSyn51 (nilOL ) happyReduce_176 = happyReduce 6 76 happyReduction_176 happyReduction_176 ((HappyAbsSyn143 happy_var_6) `HappyStk` _ `HappyStk` (HappyAbsSyn143 happy_var_4) `HappyStk` (HappyAbsSyn79 happy_var_3) `HappyStk` (HappyAbsSyn77 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn15 (sL (comb2 happy_var_1 happy_var_6) $ RuleD (HsRule (getSTRING happy_var_1) (happy_var_2 `orElse` AlwaysActive) happy_var_3 happy_var_4 placeHolderNames happy_var_6 placeHolderNames) ) `HappyStk` happyRest happyReduce_177 = happySpecReduce_0 77 happyReduction_177 happyReduction_177 = HappyAbsSyn77 (Nothing ) happyReduce_178 = happySpecReduce_1 77 happyReduction_178 happyReduction_178 (HappyAbsSyn78 happy_var_1) = HappyAbsSyn77 (Just happy_var_1 ) happyReduction_178 _ = notHappyAtAll happyReduce_179 = happySpecReduce_3 78 happyReduction_179 happyReduction_179 _ (HappyTerminal happy_var_2) _ = HappyAbsSyn78 (ActiveAfter (fromInteger (getINTEGER happy_var_2)) ) happyReduction_179 _ _ _ = notHappyAtAll happyReduce_180 = happyReduce 4 78 happyReduction_180 happyReduction_180 (_ `HappyStk` (HappyTerminal happy_var_3) `HappyStk` _ `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn78 (ActiveBefore (fromInteger (getINTEGER happy_var_3)) ) `HappyStk` happyRest happyReduce_181 = happySpecReduce_3 79 happyReduction_181 happyReduction_181 _ (HappyAbsSyn79 happy_var_2) _ = HappyAbsSyn79 (happy_var_2 ) happyReduction_181 _ _ _ = notHappyAtAll happyReduce_182 = happySpecReduce_0 79 happyReduction_182 happyReduction_182 = HappyAbsSyn79 ([] ) happyReduce_183 = happySpecReduce_1 80 happyReduction_183 happyReduction_183 (HappyAbsSyn81 happy_var_1) = HappyAbsSyn79 ([happy_var_1] ) happyReduction_183 _ = notHappyAtAll happyReduce_184 = happySpecReduce_2 80 happyReduction_184 happyReduction_184 (HappyAbsSyn79 happy_var_2) (HappyAbsSyn81 happy_var_1) = HappyAbsSyn79 (happy_var_1 : happy_var_2 ) happyReduction_184 _ _ = notHappyAtAll happyReduce_185 = happySpecReduce_1 81 happyReduction_185 happyReduction_185 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn81 (RuleBndr happy_var_1 ) happyReduction_185 _ = notHappyAtAll happyReduce_186 = happyReduce 5 81 happyReduction_186 happyReduction_186 (_ `HappyStk` (HappyAbsSyn95 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn17 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn81 (RuleBndrSig happy_var_2 (mkHsWithBndrs happy_var_4) ) `HappyStk` happyRest happyReduce_187 = happySpecReduce_3 82 happyReduction_187 happyReduction_187 (HappyAbsSyn51 happy_var_3) _ (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 `appOL` happy_var_3 ) happyReduction_187 _ _ _ = notHappyAtAll happyReduce_188 = happySpecReduce_2 82 happyReduction_188 happyReduction_188 _ (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 ) happyReduction_188 _ _ = notHappyAtAll happyReduce_189 = happySpecReduce_1 82 happyReduction_189 happyReduction_189 (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 ) happyReduction_189 _ = notHappyAtAll happyReduce_190 = happySpecReduce_0 82 happyReduction_190 happyReduction_190 = HappyAbsSyn51 (nilOL ) happyReduce_191 = happySpecReduce_2 83 happyReduction_191 happyReduction_191 (HappyAbsSyn86 happy_var_2) (HappyAbsSyn117 happy_var_1) = HappyAbsSyn51 (toOL [ sL (comb2 happy_var_1 happy_var_2) $ WarningD (Warning n (WarningTxt $ unLoc happy_var_2)) | n <- unLoc happy_var_1 ] ) happyReduction_191 _ _ = notHappyAtAll happyReduce_192 = happySpecReduce_3 84 happyReduction_192 happyReduction_192 (HappyAbsSyn51 happy_var_3) _ (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 `appOL` happy_var_3 ) happyReduction_192 _ _ _ = notHappyAtAll happyReduce_193 = happySpecReduce_2 84 happyReduction_193 happyReduction_193 _ (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 ) happyReduction_193 _ _ = notHappyAtAll happyReduce_194 = happySpecReduce_1 84 happyReduction_194 happyReduction_194 (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 ) happyReduction_194 _ = notHappyAtAll happyReduce_195 = happySpecReduce_0 84 happyReduction_195 happyReduction_195 = HappyAbsSyn51 (nilOL ) happyReduce_196 = happySpecReduce_2 85 happyReduction_196 happyReduction_196 (HappyAbsSyn86 happy_var_2) (HappyAbsSyn117 happy_var_1) = HappyAbsSyn51 (toOL [ sL (comb2 happy_var_1 happy_var_2) $ WarningD (Warning n (DeprecatedTxt $ unLoc happy_var_2)) | n <- unLoc happy_var_1 ] ) happyReduction_196 _ _ = notHappyAtAll happyReduce_197 = happySpecReduce_1 86 happyReduction_197 happyReduction_197 (HappyTerminal happy_var_1) = HappyAbsSyn86 (sL (getLoc happy_var_1) [getSTRING happy_var_1] ) happyReduction_197 _ = notHappyAtAll happyReduce_198 = happySpecReduce_3 86 happyReduction_198 happyReduction_198 (HappyTerminal happy_var_3) (HappyAbsSyn87 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn86 (sL (comb2 happy_var_1 happy_var_3) $ fromOL (unLoc happy_var_2) ) happyReduction_198 _ _ _ = notHappyAtAll happyReduce_199 = happySpecReduce_3 87 happyReduction_199 happyReduction_199 (HappyTerminal happy_var_3) _ (HappyAbsSyn87 happy_var_1) = HappyAbsSyn87 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_1 `snocOL` getSTRING happy_var_3) ) happyReduction_199 _ _ _ = notHappyAtAll happyReduce_200 = happySpecReduce_1 87 happyReduction_200 happyReduction_200 (HappyTerminal happy_var_1) = HappyAbsSyn87 (sL (comb2 happy_var_1 happy_var_1) (unitOL (getSTRING happy_var_1)) ) happyReduction_200 _ = notHappyAtAll happyReduce_201 = happyReduce 4 88 happyReduction_201 happyReduction_201 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn143 happy_var_3) `HappyStk` (HappyAbsSyn17 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn15 (sL (comb2 happy_var_1 happy_var_4) (AnnD $ HsAnnotation (ValueAnnProvenance (unLoc happy_var_2)) happy_var_3) ) `HappyStk` happyRest happyReduce_202 = happyReduce 5 88 happyReduction_202 happyReduction_202 ((HappyTerminal happy_var_5) `HappyStk` (HappyAbsSyn143 happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn15 (sL (comb2 happy_var_1 happy_var_5) (AnnD $ HsAnnotation (TypeAnnProvenance (unLoc happy_var_3)) happy_var_4) ) `HappyStk` happyRest happyReduce_203 = happyReduce 4 88 happyReduction_203 happyReduction_203 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn143 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn15 (sL (comb2 happy_var_1 happy_var_4) (AnnD $ HsAnnotation ModuleAnnProvenance happy_var_3) ) `HappyStk` happyRest happyReduce_204 = happyMonadReduce 4 89 happyReduction_204 happyReduction_204 ((HappyAbsSyn92 happy_var_4) `HappyStk` (HappyAbsSyn91 happy_var_3) `HappyStk` (HappyAbsSyn90 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkImport happy_var_2 happy_var_3 (unLoc happy_var_4) >>= return.sL (comb2 happy_var_1 happy_var_4)) ) (\r -> happyReturn (HappyAbsSyn15 r)) happyReduce_205 = happyMonadReduce 3 89 happyReduction_205 happyReduction_205 ((HappyAbsSyn92 happy_var_3) `HappyStk` (HappyAbsSyn90 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( do { d <- mkImport happy_var_2 PlaySafe (unLoc happy_var_3); return (sL (comb2 happy_var_1 happy_var_3) d) }) ) (\r -> happyReturn (HappyAbsSyn15 r)) happyReduce_206 = happyMonadReduce 3 89 happyReduction_206 happyReduction_206 ((HappyAbsSyn92 happy_var_3) `HappyStk` (HappyAbsSyn90 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkExport happy_var_2 (unLoc happy_var_3) >>= return.sL (comb2 happy_var_1 happy_var_3)) ) (\r -> happyReturn (HappyAbsSyn15 r)) happyReduce_207 = happySpecReduce_1 90 happyReduction_207 happyReduction_207 _ = HappyAbsSyn90 (StdCallConv ) happyReduce_208 = happySpecReduce_1 90 happyReduction_208 happyReduction_208 _ = HappyAbsSyn90 (CCallConv ) happyReduce_209 = happySpecReduce_1 90 happyReduction_209 happyReduction_209 _ = HappyAbsSyn90 (CApiConv ) happyReduce_210 = happySpecReduce_1 90 happyReduction_210 happyReduction_210 _ = HappyAbsSyn90 (PrimCallConv ) happyReduce_211 = happySpecReduce_1 91 happyReduction_211 happyReduction_211 _ = HappyAbsSyn91 (PlayRisky ) happyReduce_212 = happySpecReduce_1 91 happyReduction_212 happyReduction_212 _ = HappyAbsSyn91 (PlaySafe ) happyReduce_213 = happySpecReduce_1 91 happyReduction_213 happyReduction_213 _ = HappyAbsSyn91 (PlayInterruptible ) happyReduce_214 = happyReduce 4 92 happyReduction_214 happyReduction_214 ((HappyAbsSyn95 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn17 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn92 (sL (comb2 happy_var_1 happy_var_4) (L (getLoc happy_var_1) (getSTRING happy_var_1), happy_var_2, happy_var_4) ) `HappyStk` happyRest happyReduce_215 = happySpecReduce_3 92 happyReduction_215 happyReduction_215 (HappyAbsSyn95 happy_var_3) _ (HappyAbsSyn17 happy_var_1) = HappyAbsSyn92 (sL (comb2 happy_var_1 happy_var_3) (noLoc nilFS, happy_var_1, happy_var_3) ) happyReduction_215 _ _ _ = notHappyAtAll happyReduce_216 = happySpecReduce_0 93 happyReduction_216 happyReduction_216 = HappyAbsSyn93 (Nothing ) happyReduce_217 = happySpecReduce_2 93 happyReduction_217 happyReduction_217 (HappyAbsSyn95 happy_var_2) _ = HappyAbsSyn93 (Just happy_var_2 ) happyReduction_217 _ _ = notHappyAtAll happyReduce_218 = happySpecReduce_0 94 happyReduction_218 happyReduction_218 = HappyAbsSyn93 (Nothing ) happyReduce_219 = happySpecReduce_2 94 happyReduction_219 happyReduction_219 (HappyAbsSyn95 happy_var_2) _ = HappyAbsSyn93 (Just happy_var_2 ) happyReduction_219 _ _ = notHappyAtAll happyReduce_220 = happySpecReduce_1 95 happyReduction_220 happyReduction_220 (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (sL (getLoc happy_var_1) (mkImplicitHsForAllTy (noLoc []) happy_var_1) ) happyReduction_220 _ = notHappyAtAll happyReduce_221 = happySpecReduce_1 96 happyReduction_221 happyReduction_221 (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (sL (getLoc happy_var_1) (mkImplicitHsForAllTy (noLoc []) happy_var_1) ) happyReduction_221 _ = notHappyAtAll happyReduce_222 = happySpecReduce_3 97 happyReduction_222 happyReduction_222 (HappyAbsSyn17 happy_var_3) _ (HappyAbsSyn50 happy_var_1) = HappyAbsSyn50 (sL (comb2 happy_var_1 happy_var_3) (happy_var_3 : unLoc happy_var_1) ) happyReduction_222 _ _ _ = notHappyAtAll happyReduce_223 = happySpecReduce_1 97 happyReduction_223 happyReduction_223 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn50 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_223 _ = notHappyAtAll happyReduce_224 = happySpecReduce_1 98 happyReduction_224 happyReduction_224 (HappyAbsSyn95 happy_var_1) = HappyAbsSyn98 ([ happy_var_1 ] ) happyReduction_224 _ = notHappyAtAll happyReduce_225 = happySpecReduce_3 98 happyReduction_225 happyReduction_225 (HappyAbsSyn98 happy_var_3) _ (HappyAbsSyn95 happy_var_1) = HappyAbsSyn98 (happy_var_1 : happy_var_3 ) happyReduction_225 _ _ _ = notHappyAtAll happyReduce_226 = happySpecReduce_3 99 happyReduction_226 happyReduction_226 (HappyAbsSyn95 happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ mkHsOpTy happy_var_1 happy_var_2 happy_var_3 ) happyReduction_226 _ _ _ = notHappyAtAll happyReduce_227 = happySpecReduce_3 99 happyReduction_227 happyReduction_227 (HappyAbsSyn95 happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ mkHsOpTy happy_var_1 happy_var_2 happy_var_3 ) happyReduction_227 _ _ _ = notHappyAtAll happyReduce_228 = happySpecReduce_1 100 happyReduction_228 happyReduction_228 (HappyTerminal happy_var_1) = HappyAbsSyn100 (sL (getLoc happy_var_1) HsStrict ) happyReduction_228 _ = notHappyAtAll happyReduce_229 = happySpecReduce_3 100 happyReduction_229 happyReduction_229 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn100 (sL (comb2 happy_var_1 happy_var_3) HsUnpack ) happyReduction_229 _ _ _ = notHappyAtAll happyReduce_230 = happySpecReduce_3 100 happyReduction_230 happyReduction_230 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn100 (sL (comb2 happy_var_1 happy_var_3) HsNoUnpack ) happyReduction_230 _ _ _ = notHappyAtAll happyReduce_231 = happyReduce 4 101 happyReduction_231 happyReduction_231 ((HappyAbsSyn95 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn112 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_4) $ mkExplicitHsForAllTy happy_var_2 (noLoc []) happy_var_4 ) `HappyStk` happyRest happyReduce_232 = happySpecReduce_3 101 happyReduction_232 happyReduction_232 (HappyAbsSyn95 happy_var_3) _ (HappyAbsSyn103 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ mkImplicitHsForAllTy happy_var_1 happy_var_3 ) happyReduction_232 _ _ _ = notHappyAtAll happyReduce_233 = happySpecReduce_3 101 happyReduction_233 happyReduction_233 (HappyAbsSyn95 happy_var_3) _ (HappyAbsSyn192 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) (HsIParamTy (unLoc happy_var_1) happy_var_3) ) happyReduction_233 _ _ _ = notHappyAtAll happyReduce_234 = happySpecReduce_1 101 happyReduction_234 happyReduction_234 (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (happy_var_1 ) happyReduction_234 _ = notHappyAtAll happyReduce_235 = happyReduce 4 102 happyReduction_235 happyReduction_235 ((HappyAbsSyn95 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn112 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_4) $ mkExplicitHsForAllTy happy_var_2 (noLoc []) happy_var_4 ) `HappyStk` happyRest happyReduce_236 = happySpecReduce_3 102 happyReduction_236 happyReduction_236 (HappyAbsSyn95 happy_var_3) _ (HappyAbsSyn103 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ mkImplicitHsForAllTy happy_var_1 happy_var_3 ) happyReduction_236 _ _ _ = notHappyAtAll happyReduce_237 = happySpecReduce_3 102 happyReduction_237 happyReduction_237 (HappyAbsSyn95 happy_var_3) _ (HappyAbsSyn192 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) (HsIParamTy (unLoc happy_var_1) happy_var_3) ) happyReduction_237 _ _ _ = notHappyAtAll happyReduce_238 = happySpecReduce_1 102 happyReduction_238 happyReduction_238 (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (happy_var_1 ) happyReduction_238 _ = notHappyAtAll happyReduce_239 = happyMonadReduce 3 103 happyReduction_239 happyReduction_239 ((HappyAbsSyn95 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn95 happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkContext (sL (comb2 happy_var_1 happy_var_3) $ HsEqTy happy_var_1 happy_var_3)) ) (\r -> happyReturn (HappyAbsSyn103 r)) happyReduce_240 = happyMonadReduce 1 103 happyReduction_240 happyReduction_240 ((HappyAbsSyn95 happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkContext happy_var_1) ) (\r -> happyReturn (HappyAbsSyn103 r)) happyReduce_241 = happySpecReduce_1 104 happyReduction_241 happyReduction_241 (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (happy_var_1 ) happyReduction_241 _ = notHappyAtAll happyReduce_242 = happySpecReduce_3 104 happyReduction_242 happyReduction_242 (HappyAbsSyn95 happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ mkHsOpTy happy_var_1 happy_var_2 happy_var_3 ) happyReduction_242 _ _ _ = notHappyAtAll happyReduce_243 = happySpecReduce_3 104 happyReduction_243 happyReduction_243 (HappyAbsSyn95 happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ mkHsOpTy happy_var_1 happy_var_2 happy_var_3 ) happyReduction_243 _ _ _ = notHappyAtAll happyReduce_244 = happySpecReduce_3 104 happyReduction_244 happyReduction_244 (HappyAbsSyn95 happy_var_3) _ (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ HsFunTy happy_var_1 happy_var_3 ) happyReduction_244 _ _ _ = notHappyAtAll happyReduce_245 = happySpecReduce_3 104 happyReduction_245 happyReduction_245 (HappyAbsSyn95 happy_var_3) _ (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ HsEqTy happy_var_1 happy_var_3 ) happyReduction_245 _ _ _ = notHappyAtAll happyReduce_246 = happyReduce 4 104 happyReduction_246 happyReduction_246 ((HappyAbsSyn95 happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn95 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_4) $ mkHsOpTy happy_var_1 happy_var_3 happy_var_4 ) `HappyStk` happyRest happyReduce_247 = happyReduce 4 104 happyReduction_247 happyReduction_247 ((HappyAbsSyn95 happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn95 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_4) $ mkHsOpTy happy_var_1 happy_var_3 happy_var_4 ) `HappyStk` happyRest happyReduce_248 = happySpecReduce_1 105 happyReduction_248 happyReduction_248 (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (happy_var_1 ) happyReduction_248 _ = notHappyAtAll happyReduce_249 = happySpecReduce_2 105 happyReduction_249 happyReduction_249 (HappyAbsSyn237 happy_var_2) (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_2) $ HsDocTy happy_var_1 happy_var_2 ) happyReduction_249 _ _ = notHappyAtAll happyReduce_250 = happySpecReduce_3 105 happyReduction_250 happyReduction_250 (HappyAbsSyn95 happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ mkHsOpTy happy_var_1 happy_var_2 happy_var_3 ) happyReduction_250 _ _ _ = notHappyAtAll happyReduce_251 = happyReduce 4 105 happyReduction_251 happyReduction_251 ((HappyAbsSyn237 happy_var_4) `HappyStk` (HappyAbsSyn95 happy_var_3) `HappyStk` (HappyAbsSyn17 happy_var_2) `HappyStk` (HappyAbsSyn95 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_4) $ HsDocTy (L (comb3 happy_var_1 happy_var_2 happy_var_3) (mkHsOpTy happy_var_1 happy_var_2 happy_var_3)) happy_var_4 ) `HappyStk` happyRest happyReduce_252 = happySpecReduce_3 105 happyReduction_252 happyReduction_252 (HappyAbsSyn95 happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ mkHsOpTy happy_var_1 happy_var_2 happy_var_3 ) happyReduction_252 _ _ _ = notHappyAtAll happyReduce_253 = happyReduce 4 105 happyReduction_253 happyReduction_253 ((HappyAbsSyn237 happy_var_4) `HappyStk` (HappyAbsSyn95 happy_var_3) `HappyStk` (HappyAbsSyn17 happy_var_2) `HappyStk` (HappyAbsSyn95 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_4) $ HsDocTy (L (comb3 happy_var_1 happy_var_2 happy_var_3) (mkHsOpTy happy_var_1 happy_var_2 happy_var_3)) happy_var_4 ) `HappyStk` happyRest happyReduce_254 = happySpecReduce_3 105 happyReduction_254 happyReduction_254 (HappyAbsSyn95 happy_var_3) _ (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ HsFunTy happy_var_1 happy_var_3 ) happyReduction_254 _ _ _ = notHappyAtAll happyReduce_255 = happyReduce 4 105 happyReduction_255 happyReduction_255 ((HappyAbsSyn95 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn237 happy_var_2) `HappyStk` (HappyAbsSyn95 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_4) $ HsFunTy (L (comb2 happy_var_1 happy_var_2) (HsDocTy happy_var_1 happy_var_2)) happy_var_4 ) `HappyStk` happyRest happyReduce_256 = happySpecReduce_3 105 happyReduction_256 happyReduction_256 (HappyAbsSyn95 happy_var_3) _ (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ HsEqTy happy_var_1 happy_var_3 ) happyReduction_256 _ _ _ = notHappyAtAll happyReduce_257 = happyReduce 4 105 happyReduction_257 happyReduction_257 ((HappyAbsSyn95 happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn95 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_4) $ mkHsOpTy happy_var_1 happy_var_3 happy_var_4 ) `HappyStk` happyRest happyReduce_258 = happyReduce 4 105 happyReduction_258 happyReduction_258 ((HappyAbsSyn95 happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn95 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_4) $ mkHsOpTy happy_var_1 happy_var_3 happy_var_4 ) `HappyStk` happyRest happyReduce_259 = happySpecReduce_2 106 happyReduction_259 happyReduction_259 (HappyAbsSyn95 happy_var_2) (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_2) $ HsAppTy happy_var_1 happy_var_2 ) happyReduction_259 _ _ = notHappyAtAll happyReduce_260 = happySpecReduce_1 106 happyReduction_260 happyReduction_260 (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (happy_var_1 ) happyReduction_260 _ = notHappyAtAll happyReduce_261 = happySpecReduce_1 107 happyReduction_261 happyReduction_261 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn95 (sL (getLoc happy_var_1) (HsTyVar (unLoc happy_var_1)) ) happyReduction_261 _ = notHappyAtAll happyReduce_262 = happySpecReduce_1 107 happyReduction_262 happyReduction_262 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn95 (sL (getLoc happy_var_1) (HsTyVar (unLoc happy_var_1)) ) happyReduction_262 _ = notHappyAtAll happyReduce_263 = happySpecReduce_2 107 happyReduction_263 happyReduction_263 (HappyAbsSyn95 happy_var_2) (HappyAbsSyn100 happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_2) (HsBangTy (unLoc happy_var_1) happy_var_2) ) happyReduction_263 _ _ = notHappyAtAll happyReduce_264 = happyMonadReduce 3 107 happyReduction_264 happyReduction_264 ((HappyTerminal happy_var_3) `HappyStk` (HappyAbsSyn131 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkRecordSyntax (sL (comb2 happy_var_1 happy_var_3) $ HsRecTy happy_var_2)) ) (\r -> happyReturn (HappyAbsSyn95 r)) happyReduce_265 = happySpecReduce_2 107 happyReduction_265 happyReduction_265 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_2) $ HsTupleTy HsBoxedOrConstraintTuple [] ) happyReduction_265 _ _ = notHappyAtAll happyReduce_266 = happyReduce 5 107 happyReduction_266 happyReduction_266 ((HappyTerminal happy_var_5) `HappyStk` (HappyAbsSyn98 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn95 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_5) $ HsTupleTy HsBoxedOrConstraintTuple (happy_var_2:happy_var_4) ) `HappyStk` happyRest happyReduce_267 = happySpecReduce_2 107 happyReduction_267 happyReduction_267 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_2) $ HsTupleTy HsUnboxedTuple [] ) happyReduction_267 _ _ = notHappyAtAll happyReduce_268 = happySpecReduce_3 107 happyReduction_268 happyReduction_268 (HappyTerminal happy_var_3) (HappyAbsSyn98 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ HsTupleTy HsUnboxedTuple happy_var_2 ) happyReduction_268 _ _ _ = notHappyAtAll happyReduce_269 = happySpecReduce_3 107 happyReduction_269 happyReduction_269 (HappyTerminal happy_var_3) (HappyAbsSyn95 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ HsListTy happy_var_2 ) happyReduction_269 _ _ _ = notHappyAtAll happyReduce_270 = happySpecReduce_3 107 happyReduction_270 happyReduction_270 (HappyTerminal happy_var_3) (HappyAbsSyn95 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ HsPArrTy happy_var_2 ) happyReduction_270 _ _ _ = notHappyAtAll happyReduce_271 = happySpecReduce_3 107 happyReduction_271 happyReduction_271 (HappyTerminal happy_var_3) (HappyAbsSyn95 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ HsParTy happy_var_2 ) happyReduction_271 _ _ _ = notHappyAtAll happyReduce_272 = happyReduce 5 107 happyReduction_272 happyReduction_272 ((HappyTerminal happy_var_5) `HappyStk` (HappyAbsSyn118 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn95 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_5) $ HsKindSig happy_var_2 happy_var_4 ) `HappyStk` happyRest happyReduce_273 = happySpecReduce_1 107 happyReduction_273 happyReduction_273 (HappyAbsSyn142 happy_var_1) = HappyAbsSyn95 (sL (getLoc happy_var_1) (HsQuasiQuoteTy (unLoc happy_var_1)) ) happyReduction_273 _ = notHappyAtAll happyReduce_274 = happySpecReduce_3 107 happyReduction_274 happyReduction_274 (HappyTerminal happy_var_3) (HappyAbsSyn143 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ mkHsSpliceTy happy_var_2 ) happyReduction_274 _ _ _ = notHappyAtAll happyReduce_275 = happySpecReduce_1 107 happyReduction_275 happyReduction_275 (HappyTerminal happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_1) $ mkHsSpliceTy $ sL (getLoc happy_var_1) $ HsVar $ mkUnqual varName (getTH_ID_SPLICE happy_var_1) ) happyReduction_275 _ = notHappyAtAll happyReduce_276 = happySpecReduce_2 107 happyReduction_276 happyReduction_276 (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_2) $ HsTyVar $ unLoc happy_var_2 ) happyReduction_276 _ _ = notHappyAtAll happyReduce_277 = happySpecReduce_3 107 happyReduction_277 happyReduction_277 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_3) $ HsTyVar $ getRdrName unitDataCon ) happyReduction_277 _ _ _ = notHappyAtAll happyReduce_278 = happyReduce 6 107 happyReduction_278 happyReduction_278 ((HappyTerminal happy_var_6) `HappyStk` (HappyAbsSyn98 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn95 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_6) $ HsExplicitTupleTy [] (happy_var_3 : happy_var_5) ) `HappyStk` happyRest happyReduce_279 = happyReduce 4 107 happyReduction_279 happyReduction_279 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn98 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_4) $ HsExplicitListTy placeHolderKind happy_var_3 ) `HappyStk` happyRest happyReduce_280 = happyReduce 5 107 happyReduction_280 happyReduction_280 ((HappyTerminal happy_var_5) `HappyStk` (HappyAbsSyn98 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn95 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn95 (sL (comb2 happy_var_1 happy_var_5) $ HsExplicitListTy placeHolderKind (happy_var_2 : happy_var_4) ) `HappyStk` happyRest happyReduce_281 = happyMonadReduce 1 107 happyReduction_281 happyReduction_281 ((HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkTyLit $ sL (comb2 happy_var_1 happy_var_1) $ HsNumTy $ getINTEGER happy_var_1) ) (\r -> happyReturn (HappyAbsSyn95 r)) happyReduce_282 = happyMonadReduce 1 107 happyReduction_282 happyReduction_282 ((HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkTyLit $ sL (comb2 happy_var_1 happy_var_1) $ HsStrTy $ getSTRING happy_var_1) ) (\r -> happyReturn (HappyAbsSyn95 r)) happyReduce_283 = happySpecReduce_1 108 happyReduction_283 happyReduction_283 (HappyAbsSyn95 happy_var_1) = HappyAbsSyn95 (happy_var_1 ) happyReduction_283 _ = notHappyAtAll happyReduce_284 = happySpecReduce_1 109 happyReduction_284 happyReduction_284 (HappyAbsSyn95 happy_var_1) = HappyAbsSyn98 ([happy_var_1] ) happyReduction_284 _ = notHappyAtAll happyReduce_285 = happySpecReduce_3 109 happyReduction_285 happyReduction_285 (HappyAbsSyn98 happy_var_3) _ (HappyAbsSyn95 happy_var_1) = HappyAbsSyn98 (happy_var_1 : happy_var_3 ) happyReduction_285 _ _ _ = notHappyAtAll happyReduce_286 = happySpecReduce_1 110 happyReduction_286 happyReduction_286 (HappyAbsSyn98 happy_var_1) = HappyAbsSyn98 (happy_var_1 ) happyReduction_286 _ = notHappyAtAll happyReduce_287 = happySpecReduce_0 110 happyReduction_287 happyReduction_287 = HappyAbsSyn98 ([] ) happyReduce_288 = happySpecReduce_1 111 happyReduction_288 happyReduction_288 (HappyAbsSyn95 happy_var_1) = HappyAbsSyn98 ([happy_var_1] ) happyReduction_288 _ = notHappyAtAll happyReduce_289 = happySpecReduce_3 111 happyReduction_289 happyReduction_289 (HappyAbsSyn98 happy_var_3) _ (HappyAbsSyn95 happy_var_1) = HappyAbsSyn98 (happy_var_1 : happy_var_3 ) happyReduction_289 _ _ _ = notHappyAtAll happyReduce_290 = happySpecReduce_2 112 happyReduction_290 happyReduction_290 (HappyAbsSyn112 happy_var_2) (HappyAbsSyn113 happy_var_1) = HappyAbsSyn112 (happy_var_1 : happy_var_2 ) happyReduction_290 _ _ = notHappyAtAll happyReduce_291 = happySpecReduce_0 112 happyReduction_291 happyReduction_291 = HappyAbsSyn112 ([] ) happyReduce_292 = happySpecReduce_1 113 happyReduction_292 happyReduction_292 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn113 (sL (getLoc happy_var_1) (UserTyVar (unLoc happy_var_1)) ) happyReduction_292 _ = notHappyAtAll happyReduce_293 = happyReduce 5 113 happyReduction_293 happyReduction_293 ((HappyTerminal happy_var_5) `HappyStk` (HappyAbsSyn118 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn17 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn113 (sL (comb2 happy_var_1 happy_var_5) (KindedTyVar (unLoc happy_var_2) happy_var_4) ) `HappyStk` happyRest happyReduce_294 = happySpecReduce_0 114 happyReduction_294 happyReduction_294 = HappyAbsSyn114 (noLoc [] ) happyReduce_295 = happySpecReduce_2 114 happyReduction_295 happyReduction_295 (HappyAbsSyn114 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn114 (sL (comb2 happy_var_1 happy_var_2) (reverse (unLoc happy_var_2)) ) happyReduction_295 _ _ = notHappyAtAll happyReduce_296 = happySpecReduce_3 115 happyReduction_296 happyReduction_296 (HappyAbsSyn116 happy_var_3) _ (HappyAbsSyn114 happy_var_1) = HappyAbsSyn114 (sL (comb2 happy_var_1 happy_var_3) (happy_var_3 : unLoc happy_var_1) ) happyReduction_296 _ _ _ = notHappyAtAll happyReduce_297 = happySpecReduce_1 115 happyReduction_297 happyReduction_297 (HappyAbsSyn116 happy_var_1) = HappyAbsSyn114 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_297 _ = notHappyAtAll happyReduce_298 = happySpecReduce_3 116 happyReduction_298 happyReduction_298 (HappyAbsSyn117 happy_var_3) (HappyTerminal happy_var_2) (HappyAbsSyn117 happy_var_1) = HappyAbsSyn116 (L (comb3 happy_var_1 happy_var_2 happy_var_3) (reverse (unLoc happy_var_1), reverse (unLoc happy_var_3)) ) happyReduction_298 _ _ _ = notHappyAtAll happyReduce_299 = happySpecReduce_0 117 happyReduction_299 happyReduction_299 = HappyAbsSyn117 (noLoc [] ) happyReduce_300 = happySpecReduce_2 117 happyReduction_300 happyReduction_300 (HappyAbsSyn17 happy_var_2) (HappyAbsSyn117 happy_var_1) = HappyAbsSyn117 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_2 : unLoc happy_var_1) ) happyReduction_300 _ _ = notHappyAtAll happyReduce_301 = happySpecReduce_1 118 happyReduction_301 happyReduction_301 (HappyAbsSyn118 happy_var_1) = HappyAbsSyn118 (happy_var_1 ) happyReduction_301 _ = notHappyAtAll happyReduce_302 = happySpecReduce_3 118 happyReduction_302 happyReduction_302 (HappyAbsSyn118 happy_var_3) _ (HappyAbsSyn118 happy_var_1) = HappyAbsSyn118 (sL (comb2 happy_var_1 happy_var_3) $ HsFunTy happy_var_1 happy_var_3 ) happyReduction_302 _ _ _ = notHappyAtAll happyReduce_303 = happySpecReduce_1 119 happyReduction_303 happyReduction_303 (HappyAbsSyn118 happy_var_1) = HappyAbsSyn118 (happy_var_1 ) happyReduction_303 _ = notHappyAtAll happyReduce_304 = happySpecReduce_2 119 happyReduction_304 happyReduction_304 (HappyAbsSyn118 happy_var_2) (HappyAbsSyn118 happy_var_1) = HappyAbsSyn118 (sL (comb2 happy_var_1 happy_var_2) $ HsAppTy happy_var_1 happy_var_2 ) happyReduction_304 _ _ = notHappyAtAll happyReduce_305 = happySpecReduce_1 120 happyReduction_305 happyReduction_305 (HappyTerminal happy_var_1) = HappyAbsSyn118 (sL (getLoc happy_var_1) $ HsTyVar (nameRdrName liftedTypeKindTyConName) ) happyReduction_305 _ = notHappyAtAll happyReduce_306 = happySpecReduce_3 120 happyReduction_306 happyReduction_306 (HappyTerminal happy_var_3) (HappyAbsSyn118 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn118 (sL (comb2 happy_var_1 happy_var_3) $ HsParTy happy_var_2 ) happyReduction_306 _ _ _ = notHappyAtAll happyReduce_307 = happySpecReduce_1 120 happyReduction_307 happyReduction_307 (HappyAbsSyn118 happy_var_1) = HappyAbsSyn118 (happy_var_1 ) happyReduction_307 _ = notHappyAtAll happyReduce_308 = happySpecReduce_1 120 happyReduction_308 happyReduction_308 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn118 (sL (getLoc happy_var_1) $ HsTyVar (unLoc happy_var_1) ) happyReduction_308 _ = notHappyAtAll happyReduce_309 = happySpecReduce_1 121 happyReduction_309 happyReduction_309 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn118 (sL (getLoc happy_var_1) $ HsTyVar $ unLoc happy_var_1 ) happyReduction_309 _ = notHappyAtAll happyReduce_310 = happySpecReduce_2 121 happyReduction_310 happyReduction_310 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn118 (sL (comb2 happy_var_1 happy_var_2) $ HsTyVar $ getRdrName unitTyCon ) happyReduction_310 _ _ = notHappyAtAll happyReduce_311 = happyReduce 5 121 happyReduction_311 happyReduction_311 ((HappyTerminal happy_var_5) `HappyStk` (HappyAbsSyn122 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn118 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn118 (sL (comb2 happy_var_1 happy_var_5) $ HsTupleTy HsBoxedTuple (happy_var_2 : happy_var_4) ) `HappyStk` happyRest happyReduce_312 = happySpecReduce_3 121 happyReduction_312 happyReduction_312 (HappyTerminal happy_var_3) (HappyAbsSyn118 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn118 (sL (comb2 happy_var_1 happy_var_3) $ HsListTy happy_var_2 ) happyReduction_312 _ _ _ = notHappyAtAll happyReduce_313 = happySpecReduce_1 122 happyReduction_313 happyReduction_313 (HappyAbsSyn118 happy_var_1) = HappyAbsSyn122 ([happy_var_1] ) happyReduction_313 _ = notHappyAtAll happyReduce_314 = happySpecReduce_3 122 happyReduction_314 happyReduction_314 (HappyAbsSyn122 happy_var_3) _ (HappyAbsSyn118 happy_var_1) = HappyAbsSyn122 (happy_var_1 : happy_var_3 ) happyReduction_314 _ _ _ = notHappyAtAll happyReduce_315 = happyReduce 4 123 happyReduction_315 happyReduction_315 (_ `HappyStk` (HappyAbsSyn123 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn123 (L (comb2 happy_var_1 happy_var_3) (unLoc happy_var_3) ) `HappyStk` happyRest happyReduce_316 = happyReduce 4 123 happyReduction_316 happyReduction_316 (_ `HappyStk` (HappyAbsSyn123 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn123 (L (comb2 happy_var_1 happy_var_3) (unLoc happy_var_3) ) `HappyStk` happyRest happyReduce_317 = happySpecReduce_0 123 happyReduction_317 happyReduction_317 = HappyAbsSyn123 (noLoc [] ) happyReduce_318 = happySpecReduce_3 124 happyReduction_318 happyReduction_318 (HappyAbsSyn123 happy_var_3) _ (HappyAbsSyn125 happy_var_1) = HappyAbsSyn123 (L (comb2 (head happy_var_1) happy_var_3) (happy_var_1 ++ unLoc happy_var_3) ) happyReduction_318 _ _ _ = notHappyAtAll happyReduce_319 = happySpecReduce_1 124 happyReduction_319 happyReduction_319 (HappyAbsSyn125 happy_var_1) = HappyAbsSyn123 (L (getLoc (head happy_var_1)) happy_var_1 ) happyReduction_319 _ = notHappyAtAll happyReduce_320 = happySpecReduce_0 124 happyReduction_320 happyReduction_320 = HappyAbsSyn123 (noLoc [] ) happyReduce_321 = happySpecReduce_3 125 happyReduction_321 happyReduction_321 (HappyAbsSyn95 happy_var_3) _ (HappyAbsSyn50 happy_var_1) = HappyAbsSyn125 (map (sL (comb2 happy_var_1 happy_var_3)) (mkGadtDecl (unLoc happy_var_1) happy_var_3) ) happyReduction_321 _ _ _ = notHappyAtAll happyReduce_322 = happyMonadReduce 6 125 happyReduction_322 happyReduction_322 ((HappyAbsSyn95 happy_var_6) `HappyStk` _ `HappyStk` _ `HappyStk` (HappyAbsSyn131 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn17 happy_var_1) `HappyStk` happyRest) tk = happyThen (( do { cd <- mkDeprecatedGadtRecordDecl (comb2 happy_var_1 happy_var_6) happy_var_1 happy_var_3 happy_var_6 ; cd' <- checkRecordSyntax cd ; return [cd'] }) ) (\r -> happyReturn (HappyAbsSyn125 r)) happyReduce_323 = happySpecReduce_3 126 happyReduction_323 happyReduction_323 (HappyAbsSyn123 happy_var_3) (HappyTerminal happy_var_2) (HappyAbsSyn19 happy_var_1) = HappyAbsSyn123 (L (comb2 happy_var_2 happy_var_3) (addConDocs (unLoc happy_var_3) happy_var_1) ) happyReduction_323 _ _ _ = notHappyAtAll happyReduce_324 = happyReduce 5 127 happyReduction_324 happyReduction_324 ((HappyAbsSyn128 happy_var_5) `HappyStk` (HappyAbsSyn19 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn19 happy_var_2) `HappyStk` (HappyAbsSyn123 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn123 (sL (comb2 happy_var_1 happy_var_5) (addConDoc happy_var_5 happy_var_2 : addConDocFirst (unLoc happy_var_1) happy_var_4) ) `HappyStk` happyRest happyReduce_325 = happySpecReduce_1 127 happyReduction_325 happyReduction_325 (HappyAbsSyn128 happy_var_1) = HappyAbsSyn123 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_325 _ = notHappyAtAll happyReduce_326 = happyReduce 6 128 happyReduction_326 happyReduction_326 ((HappyAbsSyn19 happy_var_6) `HappyStk` (HappyAbsSyn130 happy_var_5) `HappyStk` (HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn103 happy_var_3) `HappyStk` (HappyAbsSyn129 happy_var_2) `HappyStk` (HappyAbsSyn19 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn128 (let (con,details) = unLoc happy_var_5 in addConDoc (L (comb4 happy_var_2 happy_var_3 happy_var_4 happy_var_5) (mkSimpleConDecl con (unLoc happy_var_2) happy_var_3 details)) (happy_var_1 `mplus` happy_var_6) ) `HappyStk` happyRest happyReduce_327 = happyReduce 4 128 happyReduction_327 happyReduction_327 ((HappyAbsSyn19 happy_var_4) `HappyStk` (HappyAbsSyn130 happy_var_3) `HappyStk` (HappyAbsSyn129 happy_var_2) `HappyStk` (HappyAbsSyn19 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn128 (let (con,details) = unLoc happy_var_3 in addConDoc (L (comb2 happy_var_2 happy_var_3) (mkSimpleConDecl con (unLoc happy_var_2) (noLoc []) details)) (happy_var_1 `mplus` happy_var_4) ) `HappyStk` happyRest happyReduce_328 = happySpecReduce_3 129 happyReduction_328 happyReduction_328 (HappyTerminal happy_var_3) (HappyAbsSyn112 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn129 (sL (comb2 happy_var_1 happy_var_3) happy_var_2 ) happyReduction_328 _ _ _ = notHappyAtAll happyReduce_329 = happySpecReduce_0 129 happyReduction_329 happyReduction_329 = HappyAbsSyn129 (noLoc [] ) happyReduce_330 = happyMonadReduce 1 130 happyReduction_330 happyReduction_330 ((HappyAbsSyn95 happy_var_1) `HappyStk` happyRest) tk = happyThen (( splitCon happy_var_1 >>= return.sL (comb2 happy_var_1 happy_var_1)) ) (\r -> happyReturn (HappyAbsSyn130 r)) happyReduce_331 = happySpecReduce_3 130 happyReduction_331 happyReduction_331 (HappyAbsSyn95 happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyAbsSyn95 happy_var_1) = HappyAbsSyn130 (sL (comb2 happy_var_1 happy_var_3) (happy_var_2, InfixCon happy_var_1 happy_var_3) ) happyReduction_331 _ _ _ = notHappyAtAll happyReduce_332 = happySpecReduce_0 131 happyReduction_332 happyReduction_332 = HappyAbsSyn131 ([] ) happyReduce_333 = happySpecReduce_1 131 happyReduction_333 happyReduction_333 (HappyAbsSyn131 happy_var_1) = HappyAbsSyn131 (happy_var_1 ) happyReduction_333 _ = notHappyAtAll happyReduce_334 = happyReduce 5 132 happyReduction_334 happyReduction_334 ((HappyAbsSyn131 happy_var_5) `HappyStk` (HappyAbsSyn19 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn19 happy_var_2) `HappyStk` (HappyAbsSyn131 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn131 ([ addFieldDoc f happy_var_4 | f <- happy_var_1 ] ++ addFieldDocs happy_var_5 happy_var_2 ) `HappyStk` happyRest happyReduce_335 = happySpecReduce_1 132 happyReduction_335 happyReduction_335 (HappyAbsSyn131 happy_var_1) = HappyAbsSyn131 (happy_var_1 ) happyReduction_335 _ = notHappyAtAll happyReduce_336 = happyReduce 5 133 happyReduction_336 happyReduction_336 ((HappyAbsSyn19 happy_var_5) `HappyStk` (HappyAbsSyn95 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn50 happy_var_2) `HappyStk` (HappyAbsSyn19 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn131 ([ ConDeclField fld happy_var_4 (happy_var_1 `mplus` happy_var_5) | fld <- reverse (unLoc happy_var_2) ] ) `HappyStk` happyRest happyReduce_337 = happySpecReduce_0 134 happyReduction_337 happyReduction_337 = HappyAbsSyn134 (noLoc Nothing ) happyReduce_338 = happySpecReduce_2 134 happyReduction_338 happyReduction_338 (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn134 (let { L loc tv = happy_var_2 } in sL (comb2 happy_var_1 happy_var_2) (Just [L loc (HsTyVar tv)]) ) happyReduction_338 _ _ = notHappyAtAll happyReduce_339 = happySpecReduce_3 134 happyReduction_339 happyReduction_339 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn134 (sL (comb2 happy_var_1 happy_var_3) (Just []) ) happyReduction_339 _ _ _ = notHappyAtAll happyReduce_340 = happyReduce 4 134 happyReduction_340 happyReduction_340 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn98 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn134 (sL (comb2 happy_var_1 happy_var_4) (Just happy_var_3) ) `HappyStk` happyRest happyReduce_341 = happySpecReduce_1 135 happyReduction_341 happyReduction_341 (HappyAbsSyn136 happy_var_1) = HappyAbsSyn15 (sL (getLoc happy_var_1) (DocD (unLoc happy_var_1)) ) happyReduction_341 _ = notHappyAtAll happyReduce_342 = happySpecReduce_1 136 happyReduction_342 happyReduction_342 (HappyAbsSyn237 happy_var_1) = HappyAbsSyn136 (sL (getLoc happy_var_1) (DocCommentNext (unLoc happy_var_1)) ) happyReduction_342 _ = notHappyAtAll happyReduce_343 = happySpecReduce_1 136 happyReduction_343 happyReduction_343 (HappyAbsSyn237 happy_var_1) = HappyAbsSyn136 (sL (getLoc happy_var_1) (DocCommentPrev (unLoc happy_var_1)) ) happyReduction_343 _ = notHappyAtAll happyReduce_344 = happySpecReduce_1 136 happyReduction_344 happyReduction_344 (HappyAbsSyn239 happy_var_1) = HappyAbsSyn136 (sL (getLoc happy_var_1) (case (unLoc happy_var_1) of (n, doc) -> DocCommentNamed n doc) ) happyReduction_344 _ = notHappyAtAll happyReduce_345 = happySpecReduce_1 136 happyReduction_345 happyReduction_345 (HappyAbsSyn240 happy_var_1) = HappyAbsSyn136 (sL (getLoc happy_var_1) (case (unLoc happy_var_1) of (n, doc) -> DocGroup n doc) ) happyReduction_345 _ = notHappyAtAll happyReduce_346 = happySpecReduce_1 137 happyReduction_346 happyReduction_346 (HappyAbsSyn63 happy_var_1) = HappyAbsSyn63 (happy_var_1 ) happyReduction_346 _ = notHappyAtAll happyReduce_347 = happyMonadReduce 3 137 happyReduction_347 happyReduction_347 ((HappyAbsSyn138 happy_var_3) `HappyStk` (HappyAbsSyn143 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( do { let { e = sL (comb2 happy_var_1 happy_var_3) (SectionR (sL (comb2 happy_var_1 happy_var_3) (HsVar bang_RDR)) happy_var_2) }; pat <- checkPattern e; return $ sL (comb2 happy_var_1 happy_var_3) $ unitOL $ sL (comb2 happy_var_1 happy_var_3) $ ValD $ PatBind pat (unLoc happy_var_3) placeHolderType placeHolderNames (Nothing,[]) }) ) (\r -> happyReturn (HappyAbsSyn63 r)) happyReduce_348 = happyMonadReduce 3 137 happyReduction_348 happyReduction_348 ((HappyAbsSyn138 happy_var_3) `HappyStk` (HappyAbsSyn93 happy_var_2) `HappyStk` (HappyAbsSyn143 happy_var_1) `HappyStk` happyRest) tk = happyThen (( do { r <- checkValDef happy_var_1 happy_var_2 happy_var_3; let { l = comb2 happy_var_1 happy_var_3 }; return $! (sL l (unitOL $! (sL l $ ValD r))) }) ) (\r -> happyReturn (HappyAbsSyn63 r)) happyReduce_349 = happySpecReduce_1 137 happyReduction_349 happyReduction_349 (HappyAbsSyn15 happy_var_1) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_1) $ unitOL happy_var_1 ) happyReduction_349 _ = notHappyAtAll happyReduce_350 = happySpecReduce_3 138 happyReduction_350 happyReduction_350 (HappyAbsSyn73 happy_var_3) (HappyAbsSyn143 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn138 (sL (comb3 happy_var_1 happy_var_2 happy_var_3) $ GRHSs (unguardedRHS happy_var_2) (unLoc happy_var_3) ) happyReduction_350 _ _ _ = notHappyAtAll happyReduce_351 = happySpecReduce_2 138 happyReduction_351 happyReduction_351 (HappyAbsSyn73 happy_var_2) (HappyAbsSyn139 happy_var_1) = HappyAbsSyn138 (sL (comb2 happy_var_1 happy_var_2) $ GRHSs (reverse (unLoc happy_var_1)) (unLoc happy_var_2) ) happyReduction_351 _ _ = notHappyAtAll happyReduce_352 = happySpecReduce_2 139 happyReduction_352 happyReduction_352 (HappyAbsSyn140 happy_var_2) (HappyAbsSyn139 happy_var_1) = HappyAbsSyn139 (sL (comb2 happy_var_1 happy_var_2) (happy_var_2 : unLoc happy_var_1) ) happyReduction_352 _ _ = notHappyAtAll happyReduce_353 = happySpecReduce_1 139 happyReduction_353 happyReduction_353 (HappyAbsSyn140 happy_var_1) = HappyAbsSyn139 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_353 _ = notHappyAtAll happyReduce_354 = happyReduce 4 140 happyReduction_354 happyReduction_354 ((HappyAbsSyn143 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn163 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn140 (sL (comb2 happy_var_1 happy_var_4) $ GRHS (unLoc happy_var_2) happy_var_4 ) `HappyStk` happyRest happyReduce_355 = happyMonadReduce 3 141 happyReduction_355 happyReduction_355 ((HappyAbsSyn95 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn143 happy_var_1) `HappyStk` happyRest) tk = happyThen (( do s <- checkValSig happy_var_1 happy_var_3 ; return (sL (comb2 happy_var_1 happy_var_3) $ unitOL (sL (comb2 happy_var_1 happy_var_3) $ SigD s))) ) (\r -> happyReturn (HappyAbsSyn63 r)) happyReduce_356 = happyReduce 5 141 happyReduction_356 happyReduction_356 ((HappyAbsSyn95 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn50 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn17 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_5) $ toOL [ sL (comb2 happy_var_1 happy_var_5) $ SigD (TypeSig (happy_var_1 : unLoc happy_var_3) happy_var_5) ] ) `HappyStk` happyRest happyReduce_357 = happySpecReduce_3 141 happyReduction_357 happyReduction_357 (HappyAbsSyn50 happy_var_3) (HappyAbsSyn48 happy_var_2) (HappyAbsSyn49 happy_var_1) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_3) $ toOL [ sL (comb2 happy_var_1 happy_var_3) $ SigD (FixSig (FixitySig n (Fixity happy_var_2 (unLoc happy_var_1)))) | n <- unLoc happy_var_3 ] ) happyReduction_357 _ _ _ = notHappyAtAll happyReduce_358 = happyReduce 4 141 happyReduction_358 happyReduction_358 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` (HappyAbsSyn77 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_4) $ unitOL (sL (comb2 happy_var_1 happy_var_4) $ SigD (InlineSig happy_var_3 (mkInlinePragma (getINLINE happy_var_1) happy_var_2))) ) `HappyStk` happyRest happyReduce_359 = happyReduce 6 141 happyReduction_359 happyReduction_359 ((HappyTerminal happy_var_6) `HappyStk` (HappyAbsSyn98 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` (HappyAbsSyn77 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn63 (let inl_prag = mkInlinePragma (EmptyInlineSpec, FunLike) happy_var_2 in sL (comb2 happy_var_1 happy_var_6) $ toOL [ sL (comb2 happy_var_1 happy_var_6) $ SigD (SpecSig happy_var_3 t inl_prag) | t <- happy_var_5] ) `HappyStk` happyRest happyReduce_360 = happyReduce 6 141 happyReduction_360 happyReduction_360 ((HappyTerminal happy_var_6) `HappyStk` (HappyAbsSyn98 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` (HappyAbsSyn77 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_6) $ toOL [ sL (comb2 happy_var_1 happy_var_6) $ SigD (SpecSig happy_var_3 t (mkInlinePragma (getSPEC_INLINE happy_var_1) happy_var_2)) | t <- happy_var_5] ) `HappyStk` happyRest happyReduce_361 = happyReduce 4 141 happyReduction_361 happyReduction_361 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn95 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn63 (sL (comb2 happy_var_1 happy_var_4) $ unitOL (sL (comb2 happy_var_1 happy_var_4) $ SigD (SpecInstSig happy_var_3)) ) `HappyStk` happyRest happyReduce_362 = happySpecReduce_1 142 happyReduction_362 happyReduction_362 (HappyTerminal happy_var_1) = HappyAbsSyn142 (let { loc = getLoc happy_var_1 ; ITquasiQuote (quoter, quote, quoteSpan) = unLoc happy_var_1 ; quoterId = mkUnqual varName quoter } in sL (getLoc happy_var_1) (mkHsQuasiQuote quoterId (RealSrcSpan quoteSpan) quote) ) happyReduction_362 _ = notHappyAtAll happyReduce_363 = happySpecReduce_1 142 happyReduction_363 happyReduction_363 (HappyTerminal happy_var_1) = HappyAbsSyn142 (let { loc = getLoc happy_var_1 ; ITqQuasiQuote (qual, quoter, quote, quoteSpan) = unLoc happy_var_1 ; quoterId = mkQual varName (qual, quoter) } in sL (getLoc happy_var_1) (mkHsQuasiQuote quoterId (RealSrcSpan quoteSpan) quote) ) happyReduction_363 _ = notHappyAtAll happyReduce_364 = happySpecReduce_3 143 happyReduction_364 happyReduction_364 (HappyAbsSyn95 happy_var_3) _ (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) $ ExprWithTySig happy_var_1 happy_var_3 ) happyReduction_364 _ _ _ = notHappyAtAll happyReduce_365 = happySpecReduce_3 143 happyReduction_365 happyReduction_365 (HappyAbsSyn143 happy_var_3) _ (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) $ HsArrApp happy_var_1 happy_var_3 placeHolderType HsFirstOrderApp True ) happyReduction_365 _ _ _ = notHappyAtAll happyReduce_366 = happySpecReduce_3 143 happyReduction_366 happyReduction_366 (HappyAbsSyn143 happy_var_3) _ (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) $ HsArrApp happy_var_3 happy_var_1 placeHolderType HsFirstOrderApp False ) happyReduction_366 _ _ _ = notHappyAtAll happyReduce_367 = happySpecReduce_3 143 happyReduction_367 happyReduction_367 (HappyAbsSyn143 happy_var_3) _ (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) $ HsArrApp happy_var_1 happy_var_3 placeHolderType HsHigherOrderApp True ) happyReduction_367 _ _ _ = notHappyAtAll happyReduce_368 = happySpecReduce_3 143 happyReduction_368 happyReduction_368 (HappyAbsSyn143 happy_var_3) _ (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) $ HsArrApp happy_var_3 happy_var_1 placeHolderType HsHigherOrderApp False ) happyReduction_368 _ _ _ = notHappyAtAll happyReduce_369 = happySpecReduce_1 143 happyReduction_369 happyReduction_369 (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (happy_var_1 ) happyReduction_369 _ = notHappyAtAll happyReduce_370 = happySpecReduce_1 144 happyReduction_370 happyReduction_370 (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (happy_var_1 ) happyReduction_370 _ = notHappyAtAll happyReduce_371 = happySpecReduce_3 144 happyReduction_371 happyReduction_371 (HappyAbsSyn143 happy_var_3) (HappyAbsSyn143 happy_var_2) (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) (OpApp happy_var_1 happy_var_2 (panic "fixity") happy_var_3) ) happyReduction_371 _ _ _ = notHappyAtAll happyReduce_372 = happyReduce 6 145 happyReduction_372 happyReduction_372 ((HappyAbsSyn143 happy_var_6) `HappyStk` _ `HappyStk` (HappyAbsSyn93 happy_var_4) `HappyStk` (HappyAbsSyn180 happy_var_3) `HappyStk` (HappyAbsSyn178 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_6) $ HsLam (mkMatchGroup [sL (comb2 happy_var_1 happy_var_6) $ Match (happy_var_2:happy_var_3) happy_var_4 (unguardedGRHSs happy_var_6) ]) ) `HappyStk` happyRest happyReduce_373 = happyReduce 4 145 happyReduction_373 happyReduction_373 ((HappyAbsSyn143 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn73 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_4) $ HsLet (unLoc happy_var_2) happy_var_4 ) `HappyStk` happyRest happyReduce_374 = happySpecReduce_3 145 happyReduction_374 happyReduction_374 (HappyAbsSyn170 happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) $ HsLamCase placeHolderType (mkMatchGroup (unLoc happy_var_3)) ) happyReduction_374 _ _ _ = notHappyAtAll happyReduce_375 = happyMonadReduce 8 145 happyReduction_375 happyReduction_375 ((HappyAbsSyn143 happy_var_8) `HappyStk` _ `HappyStk` (HappyAbsSyn42 happy_var_6) `HappyStk` (HappyAbsSyn143 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn42 happy_var_3) `HappyStk` (HappyAbsSyn143 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkDoAndIfThenElse happy_var_2 happy_var_3 happy_var_5 happy_var_6 happy_var_8 >> return (sL (comb2 happy_var_1 happy_var_8) $ mkHsIf happy_var_2 happy_var_5 happy_var_8)) ) (\r -> happyReturn (HappyAbsSyn143 r)) happyReduce_376 = happyMonadReduce 2 145 happyReduction_376 happyReduction_376 ((HappyAbsSyn139 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( hintMultiWayIf (getLoc happy_var_1) >> return (sL (comb2 happy_var_1 happy_var_2) $ HsMultiIf placeHolderType (reverse $ unLoc happy_var_2))) ) (\r -> happyReturn (HappyAbsSyn143 r)) happyReduce_377 = happyReduce 4 145 happyReduction_377 happyReduction_377 ((HappyAbsSyn170 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn143 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_4) $ HsCase happy_var_2 (mkMatchGroup (unLoc happy_var_4)) ) `HappyStk` happyRest happyReduce_378 = happySpecReduce_2 145 happyReduction_378 happyReduction_378 (HappyAbsSyn143 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_2) $ NegApp happy_var_2 noSyntaxExpr ) happyReduction_378 _ _ = notHappyAtAll happyReduce_379 = happySpecReduce_2 145 happyReduction_379 happyReduction_379 (HappyAbsSyn163 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (L (comb2 happy_var_1 happy_var_2) (mkHsDo DoExpr (unLoc happy_var_2)) ) happyReduction_379 _ _ = notHappyAtAll happyReduce_380 = happySpecReduce_2 145 happyReduction_380 happyReduction_380 (HappyAbsSyn163 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (L (comb2 happy_var_1 happy_var_2) (mkHsDo MDoExpr (unLoc happy_var_2)) ) happyReduction_380 _ _ = notHappyAtAll happyReduce_381 = happySpecReduce_2 145 happyReduction_381 happyReduction_381 (HappyAbsSyn143 happy_var_2) (HappyAbsSyn147 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_2) $ if opt_SccProfilingOn then HsSCC (unLoc happy_var_1) happy_var_2 else HsPar happy_var_2 ) happyReduction_381 _ _ = notHappyAtAll happyReduce_382 = happySpecReduce_2 145 happyReduction_382 happyReduction_382 (HappyAbsSyn143 happy_var_2) (HappyAbsSyn148 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_2) $ if opt_Hpc then HsTickPragma (unLoc happy_var_1) happy_var_2 else HsPar happy_var_2 ) happyReduction_382 _ _ = notHappyAtAll happyReduce_383 = happyMonadReduce 4 145 happyReduction_383 happyReduction_383 ((HappyAbsSyn143 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn143 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkPattern happy_var_2 >>= \ p -> return (sL (comb2 happy_var_1 happy_var_4) $ HsProc p (sL (comb2 happy_var_1 happy_var_4) $ HsCmdTop happy_var_4 [] placeHolderType undefined))) ) (\r -> happyReturn (HappyAbsSyn143 r)) happyReduce_384 = happyReduce 4 145 happyReduction_384 happyReduction_384 ((HappyAbsSyn143 happy_var_4) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_4) $ HsCoreAnn (getSTRING happy_var_2) happy_var_4 ) `HappyStk` happyRest happyReduce_385 = happySpecReduce_1 145 happyReduction_385 happyReduction_385 (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (happy_var_1 ) happyReduction_385 _ = notHappyAtAll happyReduce_386 = happySpecReduce_1 146 happyReduction_386 happyReduction_386 _ = HappyAbsSyn42 (True ) happyReduce_387 = happySpecReduce_0 146 happyReduction_387 happyReduction_387 = HappyAbsSyn42 (False ) happyReduce_388 = happyMonadReduce 2 147 happyReduction_388 happyReduction_388 ((HappyTerminal happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( (addWarning Opt_WarnWarningsDeprecations (getLoc happy_var_1) (text "_scc_ is deprecated; use an SCC pragma instead")) >>= \_ -> ( do scc <- getSCC happy_var_2; return $ sL (comb2 happy_var_1 happy_var_2) scc )) ) (\r -> happyReturn (HappyAbsSyn147 r)) happyReduce_389 = happyMonadReduce 3 147 happyReduction_389 happyReduction_389 ((HappyTerminal happy_var_3) `HappyStk` (HappyTerminal happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( do scc <- getSCC happy_var_2; return $ sL (comb2 happy_var_1 happy_var_3) scc) ) (\r -> happyReturn (HappyAbsSyn147 r)) happyReduce_390 = happySpecReduce_3 147 happyReduction_390 happyReduction_390 (HappyTerminal happy_var_3) (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn147 (sL (comb2 happy_var_1 happy_var_3) (getVARID happy_var_2) ) happyReduction_390 _ _ _ = notHappyAtAll happyReduce_391 = happyReduce 10 148 happyReduction_391 happyReduction_391 ((HappyTerminal happy_var_10) `HappyStk` (HappyTerminal happy_var_9) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_7) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_5) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_3) `HappyStk` (HappyTerminal happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn148 (sL (comb2 happy_var_1 happy_var_10) $ (getSTRING happy_var_2 ,( fromInteger $ getINTEGER happy_var_3 , fromInteger $ getINTEGER happy_var_5 ) ,( fromInteger $ getINTEGER happy_var_7 , fromInteger $ getINTEGER happy_var_9 ) ) ) `HappyStk` happyRest happyReduce_392 = happySpecReduce_2 149 happyReduction_392 happyReduction_392 (HappyAbsSyn143 happy_var_2) (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_2) $ HsApp happy_var_1 happy_var_2 ) happyReduction_392 _ _ = notHappyAtAll happyReduce_393 = happySpecReduce_1 149 happyReduction_393 happyReduction_393 (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (happy_var_1 ) happyReduction_393 _ = notHappyAtAll happyReduce_394 = happySpecReduce_3 150 happyReduction_394 happyReduction_394 (HappyAbsSyn143 happy_var_3) _ (HappyAbsSyn17 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) $ EAsPat happy_var_1 happy_var_3 ) happyReduction_394 _ _ _ = notHappyAtAll happyReduce_395 = happySpecReduce_2 150 happyReduction_395 happyReduction_395 (HappyAbsSyn143 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_2) $ ELazyPat happy_var_2 ) happyReduction_395 _ _ = notHappyAtAll happyReduce_396 = happySpecReduce_1 150 happyReduction_396 happyReduction_396 (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (happy_var_1 ) happyReduction_396 _ = notHappyAtAll happyReduce_397 = happyMonadReduce 4 151 happyReduction_397 happyReduction_397 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn187 happy_var_3) `HappyStk` (HappyTerminal happy_var_2) `HappyStk` (HappyAbsSyn143 happy_var_1) `HappyStk` happyRest) tk = happyThen (( do { r <- mkRecConstrOrUpdate happy_var_1 (comb2 happy_var_2 happy_var_4) happy_var_3 ; checkRecordSyntax (sL (comb2 happy_var_1 happy_var_4) r) }) ) (\r -> happyReturn (HappyAbsSyn143 r)) happyReduce_398 = happySpecReduce_1 151 happyReduction_398 happyReduction_398 (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (happy_var_1 ) happyReduction_398 _ = notHappyAtAll happyReduce_399 = happySpecReduce_1 152 happyReduction_399 happyReduction_399 (HappyAbsSyn192 happy_var_1) = HappyAbsSyn143 (sL (getLoc happy_var_1) (HsIPVar $! unLoc happy_var_1) ) happyReduction_399 _ = notHappyAtAll happyReduce_400 = happySpecReduce_1 152 happyReduction_400 happyReduction_400 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn143 (sL (getLoc happy_var_1) (HsVar $! unLoc happy_var_1) ) happyReduction_400 _ = notHappyAtAll happyReduce_401 = happySpecReduce_1 152 happyReduction_401 happyReduction_401 (HappyAbsSyn233 happy_var_1) = HappyAbsSyn143 (sL (getLoc happy_var_1) (HsLit $! unLoc happy_var_1) ) happyReduction_401 _ = notHappyAtAll happyReduce_402 = happySpecReduce_1 152 happyReduction_402 happyReduction_402 (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (getLoc happy_var_1) (HsOverLit $! mkHsIntegral (getINTEGER happy_var_1) placeHolderType) ) happyReduction_402 _ = notHappyAtAll happyReduce_403 = happySpecReduce_1 152 happyReduction_403 happyReduction_403 (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (getLoc happy_var_1) (HsOverLit $! mkHsFractional (getRATIONAL happy_var_1) placeHolderType) ) happyReduction_403 _ = notHappyAtAll happyReduce_404 = happySpecReduce_3 152 happyReduction_404 happyReduction_404 (HappyTerminal happy_var_3) (HappyAbsSyn143 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) (HsPar happy_var_2) ) happyReduction_404 _ _ _ = notHappyAtAll happyReduce_405 = happySpecReduce_3 152 happyReduction_405 happyReduction_405 (HappyTerminal happy_var_3) (HappyAbsSyn158 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) (ExplicitTuple happy_var_2 Boxed) ) happyReduction_405 _ _ _ = notHappyAtAll happyReduce_406 = happySpecReduce_3 152 happyReduction_406 happyReduction_406 (HappyTerminal happy_var_3) (HappyAbsSyn143 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) (ExplicitTuple [Present happy_var_2] Unboxed) ) happyReduction_406 _ _ _ = notHappyAtAll happyReduce_407 = happySpecReduce_3 152 happyReduction_407 happyReduction_407 (HappyTerminal happy_var_3) (HappyAbsSyn158 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) (ExplicitTuple happy_var_2 Unboxed) ) happyReduction_407 _ _ _ = notHappyAtAll happyReduce_408 = happySpecReduce_3 152 happyReduction_408 happyReduction_408 (HappyTerminal happy_var_3) (HappyAbsSyn143 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_408 _ _ _ = notHappyAtAll happyReduce_409 = happySpecReduce_3 152 happyReduction_409 happyReduction_409 (HappyTerminal happy_var_3) (HappyAbsSyn143 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_409 _ _ _ = notHappyAtAll happyReduce_410 = happySpecReduce_1 152 happyReduction_410 happyReduction_410 (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (getLoc happy_var_1) EWildPat ) happyReduction_410 _ = notHappyAtAll happyReduce_411 = happySpecReduce_1 152 happyReduction_411 happyReduction_411 (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (getLoc happy_var_1) $ HsSpliceE (mkHsSplice (sL (getLoc happy_var_1) $ HsVar (mkUnqual varName (getTH_ID_SPLICE happy_var_1)))) ) happyReduction_411 _ = notHappyAtAll happyReduce_412 = happySpecReduce_3 152 happyReduction_412 happyReduction_412 (HappyTerminal happy_var_3) (HappyAbsSyn143 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) $ HsSpliceE (mkHsSplice happy_var_2) ) happyReduction_412 _ _ _ = notHappyAtAll happyReduce_413 = happySpecReduce_2 152 happyReduction_413 happyReduction_413 (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_2) $ HsBracket (VarBr True (unLoc happy_var_2)) ) happyReduction_413 _ _ = notHappyAtAll happyReduce_414 = happySpecReduce_2 152 happyReduction_414 happyReduction_414 (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_2) $ HsBracket (VarBr True (unLoc happy_var_2)) ) happyReduction_414 _ _ = notHappyAtAll happyReduce_415 = happySpecReduce_2 152 happyReduction_415 happyReduction_415 (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_2) $ HsBracket (VarBr False (unLoc happy_var_2)) ) happyReduction_415 _ _ = notHappyAtAll happyReduce_416 = happySpecReduce_2 152 happyReduction_416 happyReduction_416 (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_2) $ HsBracket (VarBr False (unLoc happy_var_2)) ) happyReduction_416 _ _ = notHappyAtAll happyReduce_417 = happySpecReduce_3 152 happyReduction_417 happyReduction_417 (HappyTerminal happy_var_3) (HappyAbsSyn143 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) $ HsBracket (ExpBr happy_var_2) ) happyReduction_417 _ _ _ = notHappyAtAll happyReduce_418 = happySpecReduce_3 152 happyReduction_418 happyReduction_418 (HappyTerminal happy_var_3) (HappyAbsSyn95 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) $ HsBracket (TypBr happy_var_2) ) happyReduction_418 _ _ _ = notHappyAtAll happyReduce_419 = happyMonadReduce 3 152 happyReduction_419 happyReduction_419 ((HappyTerminal happy_var_3) `HappyStk` (HappyAbsSyn143 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkPattern happy_var_2 >>= \p -> return (sL (comb2 happy_var_1 happy_var_3) $ HsBracket (PatBr p))) ) (\r -> happyReturn (HappyAbsSyn143 r)) happyReduce_420 = happySpecReduce_3 152 happyReduction_420 happyReduction_420 (HappyTerminal happy_var_3) (HappyAbsSyn25 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) $ HsBracket (DecBrL happy_var_2) ) happyReduction_420 _ _ _ = notHappyAtAll happyReduce_421 = happySpecReduce_1 152 happyReduction_421 happyReduction_421 (HappyAbsSyn142 happy_var_1) = HappyAbsSyn143 (sL (getLoc happy_var_1) (HsQuasiQuoteE (unLoc happy_var_1)) ) happyReduction_421 _ = notHappyAtAll happyReduce_422 = happyReduce 4 152 happyReduction_422 happyReduction_422 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn153 happy_var_3) `HappyStk` (HappyAbsSyn143 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_4) $ HsArrForm happy_var_2 Nothing (reverse happy_var_3) ) `HappyStk` happyRest happyReduce_423 = happySpecReduce_2 153 happyReduction_423 happyReduction_423 (HappyAbsSyn154 happy_var_2) (HappyAbsSyn153 happy_var_1) = HappyAbsSyn153 (happy_var_2 : happy_var_1 ) happyReduction_423 _ _ = notHappyAtAll happyReduce_424 = happySpecReduce_0 153 happyReduction_424 happyReduction_424 = HappyAbsSyn153 ([] ) happyReduce_425 = happySpecReduce_1 154 happyReduction_425 happyReduction_425 (HappyAbsSyn143 happy_var_1) = HappyAbsSyn154 (sL (getLoc happy_var_1) $ HsCmdTop happy_var_1 [] placeHolderType undefined ) happyReduction_425 _ = notHappyAtAll happyReduce_426 = happySpecReduce_3 155 happyReduction_426 happyReduction_426 _ (HappyAbsSyn25 happy_var_2) _ = HappyAbsSyn25 (happy_var_2 ) happyReduction_426 _ _ _ = notHappyAtAll happyReduce_427 = happySpecReduce_3 155 happyReduction_427 happyReduction_427 _ (HappyAbsSyn25 happy_var_2) _ = HappyAbsSyn25 (happy_var_2 ) happyReduction_427 _ _ _ = notHappyAtAll happyReduce_428 = happySpecReduce_0 156 happyReduction_428 happyReduction_428 = HappyAbsSyn25 ([] ) happyReduce_429 = happySpecReduce_1 156 happyReduction_429 happyReduction_429 (HappyAbsSyn25 happy_var_1) = HappyAbsSyn25 (happy_var_1 ) happyReduction_429 _ = notHappyAtAll happyReduce_430 = happySpecReduce_1 157 happyReduction_430 happyReduction_430 (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (happy_var_1 ) happyReduction_430 _ = notHappyAtAll happyReduce_431 = happySpecReduce_2 157 happyReduction_431 happyReduction_431 (HappyAbsSyn143 happy_var_2) (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_2) $ SectionL happy_var_1 happy_var_2 ) happyReduction_431 _ _ = notHappyAtAll happyReduce_432 = happySpecReduce_2 157 happyReduction_432 happyReduction_432 (HappyAbsSyn143 happy_var_2) (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_2) $ SectionR happy_var_1 happy_var_2 ) happyReduction_432 _ _ = notHappyAtAll happyReduce_433 = happySpecReduce_3 157 happyReduction_433 happyReduction_433 (HappyAbsSyn143 happy_var_3) _ (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) $ EViewPat happy_var_1 happy_var_3 ) happyReduction_433 _ _ _ = notHappyAtAll happyReduce_434 = happySpecReduce_2 158 happyReduction_434 happyReduction_434 (HappyAbsSyn158 happy_var_2) (HappyAbsSyn143 happy_var_1) = HappyAbsSyn158 (Present happy_var_1 : happy_var_2 ) happyReduction_434 _ _ = notHappyAtAll happyReduce_435 = happySpecReduce_2 158 happyReduction_435 happyReduction_435 (HappyAbsSyn158 happy_var_2) (HappyAbsSyn48 happy_var_1) = HappyAbsSyn158 (replicate happy_var_1 missingTupArg ++ happy_var_2 ) happyReduction_435 _ _ = notHappyAtAll happyReduce_436 = happySpecReduce_2 159 happyReduction_436 happyReduction_436 (HappyAbsSyn158 happy_var_2) (HappyAbsSyn48 happy_var_1) = HappyAbsSyn158 (replicate (happy_var_1-1) missingTupArg ++ happy_var_2 ) happyReduction_436 _ _ = notHappyAtAll happyReduce_437 = happySpecReduce_2 160 happyReduction_437 happyReduction_437 (HappyAbsSyn158 happy_var_2) (HappyAbsSyn143 happy_var_1) = HappyAbsSyn158 (Present happy_var_1 : happy_var_2 ) happyReduction_437 _ _ = notHappyAtAll happyReduce_438 = happySpecReduce_1 160 happyReduction_438 happyReduction_438 (HappyAbsSyn143 happy_var_1) = HappyAbsSyn158 ([Present happy_var_1] ) happyReduction_438 _ = notHappyAtAll happyReduce_439 = happySpecReduce_0 160 happyReduction_439 happyReduction_439 = HappyAbsSyn158 ([missingTupArg] ) happyReduce_440 = happySpecReduce_1 161 happyReduction_440 happyReduction_440 (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (sL (getLoc happy_var_1) $ ExplicitList placeHolderType [happy_var_1] ) happyReduction_440 _ = notHappyAtAll happyReduce_441 = happySpecReduce_1 161 happyReduction_441 happyReduction_441 (HappyAbsSyn162 happy_var_1) = HappyAbsSyn143 (sL (getLoc happy_var_1) $ ExplicitList placeHolderType (reverse (unLoc happy_var_1)) ) happyReduction_441 _ = notHappyAtAll happyReduce_442 = happySpecReduce_2 161 happyReduction_442 happyReduction_442 (HappyTerminal happy_var_2) (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_2) $ ArithSeq noPostTcExpr (From happy_var_1) ) happyReduction_442 _ _ = notHappyAtAll happyReduce_443 = happyReduce 4 161 happyReduction_443 happyReduction_443 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn143 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn143 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_4) $ ArithSeq noPostTcExpr (FromThen happy_var_1 happy_var_3) ) `HappyStk` happyRest happyReduce_444 = happySpecReduce_3 161 happyReduction_444 happyReduction_444 (HappyAbsSyn143 happy_var_3) _ (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) $ ArithSeq noPostTcExpr (FromTo happy_var_1 happy_var_3) ) happyReduction_444 _ _ _ = notHappyAtAll happyReduce_445 = happyReduce 5 161 happyReduction_445 happyReduction_445 ((HappyAbsSyn143 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn143 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn143 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_5) $ ArithSeq noPostTcExpr (FromThenTo happy_var_1 happy_var_3 happy_var_5) ) `HappyStk` happyRest happyReduce_446 = happyMonadReduce 3 161 happyReduction_446 happyReduction_446 ((HappyAbsSyn163 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn143 happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkMonadComp >>= \ ctxt -> return (sL (comb2 happy_var_1 happy_var_3) $ mkHsComp ctxt (unLoc happy_var_3) happy_var_1)) ) (\r -> happyReturn (HappyAbsSyn143 r)) happyReduce_447 = happySpecReduce_3 162 happyReduction_447 happyReduction_447 (HappyAbsSyn143 happy_var_3) _ (HappyAbsSyn162 happy_var_1) = HappyAbsSyn162 (sL (comb2 happy_var_1 happy_var_3) (((:) $! happy_var_3) $! unLoc happy_var_1) ) happyReduction_447 _ _ _ = notHappyAtAll happyReduce_448 = happySpecReduce_3 162 happyReduction_448 happyReduction_448 (HappyAbsSyn143 happy_var_3) _ (HappyAbsSyn143 happy_var_1) = HappyAbsSyn162 (sL (comb2 happy_var_1 happy_var_3) [happy_var_3,happy_var_1] ) happyReduction_448 _ _ _ = notHappyAtAll happyReduce_449 = happySpecReduce_1 163 happyReduction_449 happyReduction_449 (HappyAbsSyn164 happy_var_1) = HappyAbsSyn163 (case (unLoc happy_var_1) of [qs] -> sL (getLoc happy_var_1) qs -- We just had one thing in our "parallel" list so -- we simply return that thing directly qss -> sL (getLoc happy_var_1) [sL (getLoc happy_var_1) $ ParStmt [ParStmtBlock qs undefined noSyntaxExpr | qs <- qss] noSyntaxExpr noSyntaxExpr] -- We actually found some actual parallel lists so -- we wrap them into as a ParStmt ) happyReduction_449 _ = notHappyAtAll happyReduce_450 = happySpecReduce_3 164 happyReduction_450 happyReduction_450 (HappyAbsSyn164 happy_var_3) (HappyTerminal happy_var_2) (HappyAbsSyn163 happy_var_1) = HappyAbsSyn164 (L (getLoc happy_var_2) (reverse (unLoc happy_var_1) : unLoc happy_var_3) ) happyReduction_450 _ _ _ = notHappyAtAll happyReduce_451 = happySpecReduce_1 164 happyReduction_451 happyReduction_451 (HappyAbsSyn163 happy_var_1) = HappyAbsSyn164 (L (getLoc happy_var_1) [reverse (unLoc happy_var_1)] ) happyReduction_451 _ = notHappyAtAll happyReduce_452 = happySpecReduce_3 165 happyReduction_452 happyReduction_452 (HappyAbsSyn166 happy_var_3) _ (HappyAbsSyn163 happy_var_1) = HappyAbsSyn163 (sL (comb2 happy_var_1 happy_var_3) [L (getLoc happy_var_3) ((unLoc happy_var_3) (reverse (unLoc happy_var_1)))] ) happyReduction_452 _ _ _ = notHappyAtAll happyReduce_453 = happySpecReduce_3 165 happyReduction_453 happyReduction_453 (HappyAbsSyn185 happy_var_3) _ (HappyAbsSyn163 happy_var_1) = HappyAbsSyn163 (sL (comb2 happy_var_1 happy_var_3) (happy_var_3 : unLoc happy_var_1) ) happyReduction_453 _ _ _ = notHappyAtAll happyReduce_454 = happySpecReduce_1 165 happyReduction_454 happyReduction_454 (HappyAbsSyn166 happy_var_1) = HappyAbsSyn163 (sL (comb2 happy_var_1 happy_var_1) [L (getLoc happy_var_1) ((unLoc happy_var_1) [])] ) happyReduction_454 _ = notHappyAtAll happyReduce_455 = happySpecReduce_1 165 happyReduction_455 happyReduction_455 (HappyAbsSyn185 happy_var_1) = HappyAbsSyn163 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_455 _ = notHappyAtAll happyReduce_456 = happySpecReduce_2 166 happyReduction_456 happyReduction_456 (HappyAbsSyn143 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn166 (sL (comb2 happy_var_1 happy_var_2) $ \ss -> (mkTransformStmt ss happy_var_2) ) happyReduction_456 _ _ = notHappyAtAll happyReduce_457 = happyReduce 4 166 happyReduction_457 happyReduction_457 ((HappyAbsSyn143 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn143 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn166 (sL (comb2 happy_var_1 happy_var_4) $ \ss -> (mkTransformByStmt ss happy_var_2 happy_var_4) ) `HappyStk` happyRest happyReduce_458 = happyReduce 4 166 happyReduction_458 happyReduction_458 ((HappyAbsSyn143 happy_var_4) `HappyStk` _ `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn166 (sL (comb2 happy_var_1 happy_var_4) $ \ss -> (mkGroupUsingStmt ss happy_var_4) ) `HappyStk` happyRest happyReduce_459 = happyReduce 6 166 happyReduction_459 happyReduction_459 ((HappyAbsSyn143 happy_var_6) `HappyStk` _ `HappyStk` (HappyAbsSyn143 happy_var_4) `HappyStk` _ `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn166 (sL (comb2 happy_var_1 happy_var_6) $ \ss -> (mkGroupByUsingStmt ss happy_var_4 happy_var_6) ) `HappyStk` happyRest happyReduce_460 = happySpecReduce_0 167 happyReduction_460 happyReduction_460 = HappyAbsSyn143 (noLoc (ExplicitPArr placeHolderType []) ) happyReduce_461 = happySpecReduce_1 167 happyReduction_461 happyReduction_461 (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (sL (getLoc happy_var_1) $ ExplicitPArr placeHolderType [happy_var_1] ) happyReduction_461 _ = notHappyAtAll happyReduce_462 = happySpecReduce_1 167 happyReduction_462 happyReduction_462 (HappyAbsSyn162 happy_var_1) = HappyAbsSyn143 (sL (getLoc happy_var_1) $ ExplicitPArr placeHolderType (reverse (unLoc happy_var_1)) ) happyReduction_462 _ = notHappyAtAll happyReduce_463 = happySpecReduce_3 167 happyReduction_463 happyReduction_463 (HappyAbsSyn143 happy_var_3) _ (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) $ PArrSeq noPostTcExpr (FromTo happy_var_1 happy_var_3) ) happyReduction_463 _ _ _ = notHappyAtAll happyReduce_464 = happyReduce 5 167 happyReduction_464 happyReduction_464 ((HappyAbsSyn143 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn143 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn143 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_5) $ PArrSeq noPostTcExpr (FromThenTo happy_var_1 happy_var_3 happy_var_5) ) `HappyStk` happyRest happyReduce_465 = happySpecReduce_3 167 happyReduction_465 happyReduction_465 (HappyAbsSyn163 happy_var_3) _ (HappyAbsSyn143 happy_var_1) = HappyAbsSyn143 (sL (comb2 happy_var_1 happy_var_3) $ mkHsComp PArrComp (unLoc happy_var_3) happy_var_1 ) happyReduction_465 _ _ _ = notHappyAtAll happyReduce_466 = happySpecReduce_1 168 happyReduction_466 happyReduction_466 (HappyAbsSyn163 happy_var_1) = HappyAbsSyn163 (L (getLoc happy_var_1) (reverse (unLoc happy_var_1)) ) happyReduction_466 _ = notHappyAtAll happyReduce_467 = happySpecReduce_3 169 happyReduction_467 happyReduction_467 (HappyAbsSyn185 happy_var_3) _ (HappyAbsSyn163 happy_var_1) = HappyAbsSyn163 (sL (comb2 happy_var_1 happy_var_3) (happy_var_3 : unLoc happy_var_1) ) happyReduction_467 _ _ _ = notHappyAtAll happyReduce_468 = happySpecReduce_1 169 happyReduction_468 happyReduction_468 (HappyAbsSyn185 happy_var_1) = HappyAbsSyn163 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_468 _ = notHappyAtAll happyReduce_469 = happySpecReduce_3 170 happyReduction_469 happyReduction_469 (HappyTerminal happy_var_3) (HappyAbsSyn170 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn170 (sL (comb2 happy_var_1 happy_var_3) (reverse (unLoc happy_var_2)) ) happyReduction_469 _ _ _ = notHappyAtAll happyReduce_470 = happySpecReduce_3 170 happyReduction_470 happyReduction_470 _ (HappyAbsSyn170 happy_var_2) _ = HappyAbsSyn170 (L (getLoc happy_var_2) (reverse (unLoc happy_var_2)) ) happyReduction_470 _ _ _ = notHappyAtAll happyReduce_471 = happySpecReduce_1 171 happyReduction_471 happyReduction_471 (HappyAbsSyn170 happy_var_1) = HappyAbsSyn170 (sL (getLoc happy_var_1) (unLoc happy_var_1) ) happyReduction_471 _ = notHappyAtAll happyReduce_472 = happySpecReduce_2 171 happyReduction_472 happyReduction_472 (HappyAbsSyn170 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn170 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_2) ) happyReduction_472 _ _ = notHappyAtAll happyReduce_473 = happySpecReduce_3 172 happyReduction_473 happyReduction_473 (HappyAbsSyn173 happy_var_3) _ (HappyAbsSyn170 happy_var_1) = HappyAbsSyn170 (sL (comb2 happy_var_1 happy_var_3) (happy_var_3 : unLoc happy_var_1) ) happyReduction_473 _ _ _ = notHappyAtAll happyReduce_474 = happySpecReduce_2 172 happyReduction_474 happyReduction_474 (HappyTerminal happy_var_2) (HappyAbsSyn170 happy_var_1) = HappyAbsSyn170 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_1) ) happyReduction_474 _ _ = notHappyAtAll happyReduce_475 = happySpecReduce_1 172 happyReduction_475 happyReduction_475 (HappyAbsSyn173 happy_var_1) = HappyAbsSyn170 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_475 _ = notHappyAtAll happyReduce_476 = happySpecReduce_3 173 happyReduction_476 happyReduction_476 (HappyAbsSyn138 happy_var_3) (HappyAbsSyn93 happy_var_2) (HappyAbsSyn178 happy_var_1) = HappyAbsSyn173 (sL (comb2 happy_var_1 happy_var_3) (Match [happy_var_1] happy_var_2 (unLoc happy_var_3)) ) happyReduction_476 _ _ _ = notHappyAtAll happyReduce_477 = happySpecReduce_2 174 happyReduction_477 happyReduction_477 (HappyAbsSyn73 happy_var_2) (HappyAbsSyn139 happy_var_1) = HappyAbsSyn138 (sL (comb2 happy_var_1 happy_var_2) (GRHSs (unLoc happy_var_1) (unLoc happy_var_2)) ) happyReduction_477 _ _ = notHappyAtAll happyReduce_478 = happySpecReduce_2 175 happyReduction_478 happyReduction_478 (HappyAbsSyn143 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn139 (sL (comb2 happy_var_1 happy_var_2) (unguardedRHS happy_var_2) ) happyReduction_478 _ _ = notHappyAtAll happyReduce_479 = happySpecReduce_1 175 happyReduction_479 happyReduction_479 (HappyAbsSyn139 happy_var_1) = HappyAbsSyn139 (sL (getLoc happy_var_1) (reverse (unLoc happy_var_1)) ) happyReduction_479 _ = notHappyAtAll happyReduce_480 = happySpecReduce_2 176 happyReduction_480 happyReduction_480 (HappyAbsSyn140 happy_var_2) (HappyAbsSyn139 happy_var_1) = HappyAbsSyn139 (sL (comb2 happy_var_1 happy_var_2) (happy_var_2 : unLoc happy_var_1) ) happyReduction_480 _ _ = notHappyAtAll happyReduce_481 = happySpecReduce_1 176 happyReduction_481 happyReduction_481 (HappyAbsSyn140 happy_var_1) = HappyAbsSyn139 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_481 _ = notHappyAtAll happyReduce_482 = happyReduce 4 177 happyReduction_482 happyReduction_482 ((HappyAbsSyn143 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn163 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn140 (sL (comb2 happy_var_1 happy_var_4) $ GRHS (unLoc happy_var_2) happy_var_4 ) `HappyStk` happyRest happyReduce_483 = happyMonadReduce 1 178 happyReduction_483 happyReduction_483 ((HappyAbsSyn143 happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkPattern happy_var_1) ) (\r -> happyReturn (HappyAbsSyn178 r)) happyReduce_484 = happyMonadReduce 2 178 happyReduction_484 happyReduction_484 ((HappyAbsSyn143 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkPattern (sL (comb2 happy_var_1 happy_var_2) (SectionR (sL (getLoc happy_var_1) (HsVar bang_RDR)) happy_var_2))) ) (\r -> happyReturn (HappyAbsSyn178 r)) happyReduce_485 = happyMonadReduce 1 179 happyReduction_485 happyReduction_485 ((HappyAbsSyn143 happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkPattern happy_var_1) ) (\r -> happyReturn (HappyAbsSyn178 r)) happyReduce_486 = happyMonadReduce 2 179 happyReduction_486 happyReduction_486 ((HappyAbsSyn143 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkPattern (sL (comb2 happy_var_1 happy_var_2) (SectionR (sL (getLoc happy_var_1) (HsVar bang_RDR)) happy_var_2))) ) (\r -> happyReturn (HappyAbsSyn178 r)) happyReduce_487 = happySpecReduce_2 180 happyReduction_487 happyReduction_487 (HappyAbsSyn180 happy_var_2) (HappyAbsSyn178 happy_var_1) = HappyAbsSyn180 (happy_var_1 : happy_var_2 ) happyReduction_487 _ _ = notHappyAtAll happyReduce_488 = happySpecReduce_0 180 happyReduction_488 happyReduction_488 = HappyAbsSyn180 ([] ) happyReduce_489 = happySpecReduce_3 181 happyReduction_489 happyReduction_489 (HappyTerminal happy_var_3) (HappyAbsSyn163 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn163 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_489 _ _ _ = notHappyAtAll happyReduce_490 = happySpecReduce_3 181 happyReduction_490 happyReduction_490 _ (HappyAbsSyn163 happy_var_2) _ = HappyAbsSyn163 (happy_var_2 ) happyReduction_490 _ _ _ = notHappyAtAll happyReduce_491 = happySpecReduce_2 182 happyReduction_491 happyReduction_491 (HappyAbsSyn163 happy_var_2) (HappyAbsSyn185 happy_var_1) = HappyAbsSyn163 (sL (comb2 happy_var_1 happy_var_2) (happy_var_1 : unLoc happy_var_2) ) happyReduction_491 _ _ = notHappyAtAll happyReduce_492 = happySpecReduce_2 182 happyReduction_492 happyReduction_492 (HappyAbsSyn163 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn163 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_2) ) happyReduction_492 _ _ = notHappyAtAll happyReduce_493 = happySpecReduce_0 182 happyReduction_493 happyReduction_493 = HappyAbsSyn163 (noLoc [] ) happyReduce_494 = happySpecReduce_2 183 happyReduction_494 happyReduction_494 (HappyAbsSyn163 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn163 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_2) ) happyReduction_494 _ _ = notHappyAtAll happyReduce_495 = happySpecReduce_0 183 happyReduction_495 happyReduction_495 = HappyAbsSyn163 (noLoc [] ) happyReduce_496 = happySpecReduce_1 184 happyReduction_496 happyReduction_496 (HappyAbsSyn185 happy_var_1) = HappyAbsSyn184 (Just happy_var_1 ) happyReduction_496 _ = notHappyAtAll happyReduce_497 = happySpecReduce_0 184 happyReduction_497 happyReduction_497 = HappyAbsSyn184 (Nothing ) happyReduce_498 = happySpecReduce_1 185 happyReduction_498 happyReduction_498 (HappyAbsSyn185 happy_var_1) = HappyAbsSyn185 (happy_var_1 ) happyReduction_498 _ = notHappyAtAll happyReduce_499 = happySpecReduce_2 185 happyReduction_499 happyReduction_499 (HappyAbsSyn163 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn185 (sL (comb2 happy_var_1 happy_var_2) $ mkRecStmt (unLoc happy_var_2) ) happyReduction_499 _ _ = notHappyAtAll happyReduce_500 = happySpecReduce_3 186 happyReduction_500 happyReduction_500 (HappyAbsSyn143 happy_var_3) _ (HappyAbsSyn178 happy_var_1) = HappyAbsSyn185 (sL (comb2 happy_var_1 happy_var_3) $ mkBindStmt happy_var_1 happy_var_3 ) happyReduction_500 _ _ _ = notHappyAtAll happyReduce_501 = happySpecReduce_1 186 happyReduction_501 happyReduction_501 (HappyAbsSyn143 happy_var_1) = HappyAbsSyn185 (sL (getLoc happy_var_1) $ mkExprStmt happy_var_1 ) happyReduction_501 _ = notHappyAtAll happyReduce_502 = happySpecReduce_2 186 happyReduction_502 happyReduction_502 (HappyAbsSyn73 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn185 (sL (comb2 happy_var_1 happy_var_2) $ LetStmt (unLoc happy_var_2) ) happyReduction_502 _ _ = notHappyAtAll happyReduce_503 = happySpecReduce_1 187 happyReduction_503 happyReduction_503 (HappyAbsSyn187 happy_var_1) = HappyAbsSyn187 (happy_var_1 ) happyReduction_503 _ = notHappyAtAll happyReduce_504 = happySpecReduce_0 187 happyReduction_504 happyReduction_504 = HappyAbsSyn187 (([], False) ) happyReduce_505 = happySpecReduce_3 188 happyReduction_505 happyReduction_505 (HappyAbsSyn187 happy_var_3) _ (HappyAbsSyn189 happy_var_1) = HappyAbsSyn187 (case happy_var_3 of (flds, dd) -> (happy_var_1 : flds, dd) ) happyReduction_505 _ _ _ = notHappyAtAll happyReduce_506 = happySpecReduce_1 188 happyReduction_506 happyReduction_506 (HappyAbsSyn189 happy_var_1) = HappyAbsSyn187 (([happy_var_1], False) ) happyReduction_506 _ = notHappyAtAll happyReduce_507 = happySpecReduce_1 188 happyReduction_507 happyReduction_507 _ = HappyAbsSyn187 (([], True) ) happyReduce_508 = happySpecReduce_3 189 happyReduction_508 happyReduction_508 (HappyAbsSyn143 happy_var_3) _ (HappyAbsSyn17 happy_var_1) = HappyAbsSyn189 (HsRecField happy_var_1 happy_var_3 False ) happyReduction_508 _ _ _ = notHappyAtAll happyReduce_509 = happySpecReduce_1 189 happyReduction_509 happyReduction_509 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn189 (HsRecField happy_var_1 placeHolderPunRhs True ) happyReduction_509 _ = notHappyAtAll happyReduce_510 = happySpecReduce_3 190 happyReduction_510 happyReduction_510 (HappyAbsSyn191 happy_var_3) _ (HappyAbsSyn190 happy_var_1) = HappyAbsSyn190 (let { this = happy_var_3; rest = unLoc happy_var_1 } in rest `seq` this `seq` sL (comb2 happy_var_1 happy_var_3) (this : rest) ) happyReduction_510 _ _ _ = notHappyAtAll happyReduce_511 = happySpecReduce_2 190 happyReduction_511 happyReduction_511 (HappyTerminal happy_var_2) (HappyAbsSyn190 happy_var_1) = HappyAbsSyn190 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_1) ) happyReduction_511 _ _ = notHappyAtAll happyReduce_512 = happySpecReduce_1 190 happyReduction_512 happyReduction_512 (HappyAbsSyn191 happy_var_1) = HappyAbsSyn190 (let this = happy_var_1 in this `seq` sL (getLoc happy_var_1) [this] ) happyReduction_512 _ = notHappyAtAll happyReduce_513 = happySpecReduce_3 191 happyReduction_513 happyReduction_513 (HappyAbsSyn143 happy_var_3) _ (HappyAbsSyn192 happy_var_1) = HappyAbsSyn191 (sL (comb2 happy_var_1 happy_var_3) (IPBind (Left (unLoc happy_var_1)) happy_var_3) ) happyReduction_513 _ _ _ = notHappyAtAll happyReduce_514 = happySpecReduce_1 192 happyReduction_514 happyReduction_514 (HappyTerminal happy_var_1) = HappyAbsSyn192 (sL (getLoc happy_var_1) (HsIPName (getIPDUPVARID happy_var_1)) ) happyReduction_514 _ = notHappyAtAll happyReduce_515 = happySpecReduce_1 193 happyReduction_515 happyReduction_515 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn117 (sL (getLoc happy_var_1) [unLoc happy_var_1] ) happyReduction_515 _ = notHappyAtAll happyReduce_516 = happySpecReduce_3 193 happyReduction_516 happyReduction_516 (HappyAbsSyn117 happy_var_3) _ (HappyAbsSyn17 happy_var_1) = HappyAbsSyn117 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_1 : unLoc happy_var_3) ) happyReduction_516 _ _ _ = notHappyAtAll happyReduce_517 = happySpecReduce_1 194 happyReduction_517 happyReduction_517 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_517 _ = notHappyAtAll happyReduce_518 = happySpecReduce_1 194 happyReduction_518 happyReduction_518 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_518 _ = notHappyAtAll happyReduce_519 = happySpecReduce_1 195 happyReduction_519 happyReduction_519 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_519 _ = notHappyAtAll happyReduce_520 = happySpecReduce_3 195 happyReduction_520 happyReduction_520 (HappyTerminal happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_520 _ _ _ = notHappyAtAll happyReduce_521 = happySpecReduce_1 195 happyReduction_521 happyReduction_521 (HappyAbsSyn198 happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ nameRdrName (dataConName (unLoc happy_var_1)) ) happyReduction_521 _ = notHappyAtAll happyReduce_522 = happySpecReduce_1 196 happyReduction_522 happyReduction_522 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_522 _ = notHappyAtAll happyReduce_523 = happySpecReduce_3 196 happyReduction_523 happyReduction_523 (HappyTerminal happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_523 _ _ _ = notHappyAtAll happyReduce_524 = happySpecReduce_1 196 happyReduction_524 happyReduction_524 (HappyAbsSyn198 happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ nameRdrName (dataConName (unLoc happy_var_1)) ) happyReduction_524 _ = notHappyAtAll happyReduce_525 = happySpecReduce_1 197 happyReduction_525 happyReduction_525 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn50 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_525 _ = notHappyAtAll happyReduce_526 = happySpecReduce_3 197 happyReduction_526 happyReduction_526 (HappyAbsSyn50 happy_var_3) _ (HappyAbsSyn17 happy_var_1) = HappyAbsSyn50 (sL (comb2 happy_var_1 happy_var_3) (happy_var_1 : unLoc happy_var_3) ) happyReduction_526 _ _ _ = notHappyAtAll happyReduce_527 = happySpecReduce_2 198 happyReduction_527 happyReduction_527 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn198 (sL (comb2 happy_var_1 happy_var_2) unitDataCon ) happyReduction_527 _ _ = notHappyAtAll happyReduce_528 = happySpecReduce_3 198 happyReduction_528 happyReduction_528 (HappyTerminal happy_var_3) (HappyAbsSyn48 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn198 (sL (comb2 happy_var_1 happy_var_3) $ tupleCon BoxedTuple (happy_var_2 + 1) ) happyReduction_528 _ _ _ = notHappyAtAll happyReduce_529 = happySpecReduce_2 198 happyReduction_529 happyReduction_529 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn198 (sL (comb2 happy_var_1 happy_var_2) $ unboxedUnitDataCon ) happyReduction_529 _ _ = notHappyAtAll happyReduce_530 = happySpecReduce_3 198 happyReduction_530 happyReduction_530 (HappyTerminal happy_var_3) (HappyAbsSyn48 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn198 (sL (comb2 happy_var_1 happy_var_3) $ tupleCon UnboxedTuple (happy_var_2 + 1) ) happyReduction_530 _ _ _ = notHappyAtAll happyReduce_531 = happySpecReduce_2 198 happyReduction_531 happyReduction_531 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn198 (sL (comb2 happy_var_1 happy_var_2) nilDataCon ) happyReduction_531 _ _ = notHappyAtAll happyReduce_532 = happySpecReduce_1 199 happyReduction_532 happyReduction_532 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_532 _ = notHappyAtAll happyReduce_533 = happySpecReduce_3 199 happyReduction_533 happyReduction_533 (HappyTerminal happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_533 _ _ _ = notHappyAtAll happyReduce_534 = happySpecReduce_1 200 happyReduction_534 happyReduction_534 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_534 _ = notHappyAtAll happyReduce_535 = happySpecReduce_3 200 happyReduction_535 happyReduction_535 (HappyTerminal happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_535 _ _ _ = notHappyAtAll happyReduce_536 = happySpecReduce_1 201 happyReduction_536 happyReduction_536 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_536 _ = notHappyAtAll happyReduce_537 = happySpecReduce_2 201 happyReduction_537 happyReduction_537 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_2) $ getRdrName unitTyCon ) happyReduction_537 _ _ = notHappyAtAll happyReduce_538 = happySpecReduce_2 201 happyReduction_538 happyReduction_538 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_2) $ getRdrName unboxedUnitTyCon ) happyReduction_538 _ _ = notHappyAtAll happyReduce_539 = happySpecReduce_1 202 happyReduction_539 happyReduction_539 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_539 _ = notHappyAtAll happyReduce_540 = happySpecReduce_3 202 happyReduction_540 happyReduction_540 (HappyTerminal happy_var_3) (HappyAbsSyn48 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) $ getRdrName (tupleTyCon BoxedTuple (happy_var_2 + 1)) ) happyReduction_540 _ _ _ = notHappyAtAll happyReduce_541 = happySpecReduce_3 202 happyReduction_541 happyReduction_541 (HappyTerminal happy_var_3) (HappyAbsSyn48 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) $ getRdrName (tupleTyCon UnboxedTuple (happy_var_2 + 1)) ) happyReduction_541 _ _ _ = notHappyAtAll happyReduce_542 = happySpecReduce_3 202 happyReduction_542 happyReduction_542 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) $ getRdrName funTyCon ) happyReduction_542 _ _ _ = notHappyAtAll happyReduce_543 = happySpecReduce_2 202 happyReduction_543 happyReduction_543 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_2) $ listTyCon_RDR ) happyReduction_543 _ _ = notHappyAtAll happyReduce_544 = happySpecReduce_2 202 happyReduction_544 happyReduction_544 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_2) $ parrTyCon_RDR ) happyReduction_544 _ _ = notHappyAtAll happyReduce_545 = happySpecReduce_3 202 happyReduction_545 happyReduction_545 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) $ getRdrName eqPrimTyCon ) happyReduction_545 _ _ _ = notHappyAtAll happyReduce_546 = happySpecReduce_1 203 happyReduction_546 happyReduction_546 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_546 _ = notHappyAtAll happyReduce_547 = happySpecReduce_3 203 happyReduction_547 happyReduction_547 (HappyTerminal happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_547 _ _ _ = notHappyAtAll happyReduce_548 = happySpecReduce_3 203 happyReduction_548 happyReduction_548 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) $ eqTyCon_RDR ) happyReduction_548 _ _ _ = notHappyAtAll happyReduce_549 = happySpecReduce_1 204 happyReduction_549 happyReduction_549 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_549 _ = notHappyAtAll happyReduce_550 = happySpecReduce_3 204 happyReduction_550 happyReduction_550 (HappyTerminal happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_550 _ _ _ = notHappyAtAll happyReduce_551 = happySpecReduce_1 205 happyReduction_551 happyReduction_551 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkQual tcClsName (getQCONID happy_var_1) ) happyReduction_551 _ = notHappyAtAll happyReduce_552 = happySpecReduce_1 205 happyReduction_552 happyReduction_552 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkQual tcClsName (getPREFIXQCONSYM happy_var_1) ) happyReduction_552 _ = notHappyAtAll happyReduce_553 = happySpecReduce_1 205 happyReduction_553 happyReduction_553 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_553 _ = notHappyAtAll happyReduce_554 = happySpecReduce_1 206 happyReduction_554 happyReduction_554 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tcClsName (getCONID happy_var_1) ) happyReduction_554 _ = notHappyAtAll happyReduce_555 = happySpecReduce_1 207 happyReduction_555 happyReduction_555 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkQual tcClsName (getQCONSYM happy_var_1) ) happyReduction_555 _ = notHappyAtAll happyReduce_556 = happySpecReduce_1 207 happyReduction_556 happyReduction_556 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkQual tcClsName (getQVARSYM happy_var_1) ) happyReduction_556 _ = notHappyAtAll happyReduce_557 = happySpecReduce_1 207 happyReduction_557 happyReduction_557 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_557 _ = notHappyAtAll happyReduce_558 = happySpecReduce_1 208 happyReduction_558 happyReduction_558 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tcClsName (getCONSYM happy_var_1) ) happyReduction_558 _ = notHappyAtAll happyReduce_559 = happySpecReduce_1 208 happyReduction_559 happyReduction_559 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tcClsName (getVARSYM happy_var_1) ) happyReduction_559 _ = notHappyAtAll happyReduce_560 = happySpecReduce_1 208 happyReduction_560 happyReduction_560 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tcClsName (fsLit "*") ) happyReduction_560 _ = notHappyAtAll happyReduce_561 = happySpecReduce_1 209 happyReduction_561 happyReduction_561 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_561 _ = notHappyAtAll happyReduce_562 = happySpecReduce_1 209 happyReduction_562 happyReduction_562 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_562 _ = notHappyAtAll happyReduce_563 = happySpecReduce_1 210 happyReduction_563 happyReduction_563 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_563 _ = notHappyAtAll happyReduce_564 = happySpecReduce_3 210 happyReduction_564 happyReduction_564 (HappyTerminal happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_564 _ _ _ = notHappyAtAll happyReduce_565 = happySpecReduce_1 211 happyReduction_565 happyReduction_565 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn143 (sL (getLoc happy_var_1) $ HsVar (unLoc happy_var_1) ) happyReduction_565 _ = notHappyAtAll happyReduce_566 = happySpecReduce_1 211 happyReduction_566 happyReduction_566 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn143 (sL (getLoc happy_var_1) $ HsVar (unLoc happy_var_1) ) happyReduction_566 _ = notHappyAtAll happyReduce_567 = happySpecReduce_1 212 happyReduction_567 happyReduction_567 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn143 (sL (getLoc happy_var_1) $ HsVar (unLoc happy_var_1) ) happyReduction_567 _ = notHappyAtAll happyReduce_568 = happySpecReduce_1 212 happyReduction_568 happyReduction_568 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn143 (sL (getLoc happy_var_1) $ HsVar (unLoc happy_var_1) ) happyReduction_568 _ = notHappyAtAll happyReduce_569 = happySpecReduce_1 213 happyReduction_569 happyReduction_569 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_569 _ = notHappyAtAll happyReduce_570 = happySpecReduce_3 213 happyReduction_570 happyReduction_570 (HappyTerminal happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_570 _ _ _ = notHappyAtAll happyReduce_571 = happySpecReduce_1 214 happyReduction_571 happyReduction_571 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_571 _ = notHappyAtAll happyReduce_572 = happySpecReduce_3 214 happyReduction_572 happyReduction_572 (HappyTerminal happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_572 _ _ _ = notHappyAtAll happyReduce_573 = happySpecReduce_1 215 happyReduction_573 happyReduction_573 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_573 _ = notHappyAtAll happyReduce_574 = happySpecReduce_3 216 happyReduction_574 happyReduction_574 (HappyTerminal happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_574 _ _ _ = notHappyAtAll happyReduce_575 = happyMonadReduce 1 216 happyReduction_575 happyReduction_575 ((HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( parseErrorSDoc (getLoc happy_var_1) (vcat [ptext (sLit "Illegal symbol '.' in type"), ptext (sLit "Perhaps you intended -XRankNTypes or similar flag"), ptext (sLit "to enable explicit-forall syntax: forall <tvs>. <type>")])) ) (\r -> happyReturn (HappyAbsSyn17 r)) happyReduce_576 = happySpecReduce_1 217 happyReduction_576 happyReduction_576 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tvName (getVARID happy_var_1) ) happyReduction_576 _ = notHappyAtAll happyReduce_577 = happySpecReduce_1 217 happyReduction_577 happyReduction_577 (HappyAbsSyn147 happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tvName (unLoc happy_var_1) ) happyReduction_577 _ = notHappyAtAll happyReduce_578 = happySpecReduce_1 217 happyReduction_578 happyReduction_578 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tvName (fsLit "unsafe") ) happyReduction_578 _ = notHappyAtAll happyReduce_579 = happySpecReduce_1 217 happyReduction_579 happyReduction_579 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tvName (fsLit "safe") ) happyReduction_579 _ = notHappyAtAll happyReduce_580 = happySpecReduce_1 217 happyReduction_580 happyReduction_580 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tvName (fsLit "interruptible") ) happyReduction_580 _ = notHappyAtAll happyReduce_581 = happySpecReduce_1 218 happyReduction_581 happyReduction_581 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_581 _ = notHappyAtAll happyReduce_582 = happySpecReduce_3 218 happyReduction_582 happyReduction_582 (HappyTerminal happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_582 _ _ _ = notHappyAtAll happyReduce_583 = happySpecReduce_1 219 happyReduction_583 happyReduction_583 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_583 _ = notHappyAtAll happyReduce_584 = happySpecReduce_3 219 happyReduction_584 happyReduction_584 (HappyTerminal happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_584 _ _ _ = notHappyAtAll happyReduce_585 = happySpecReduce_3 219 happyReduction_585 happyReduction_585 (HappyTerminal happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_585 _ _ _ = notHappyAtAll happyReduce_586 = happySpecReduce_1 220 happyReduction_586 happyReduction_586 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_586 _ = notHappyAtAll happyReduce_587 = happySpecReduce_1 220 happyReduction_587 happyReduction_587 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkQual varName (getQVARID happy_var_1) ) happyReduction_587 _ = notHappyAtAll happyReduce_588 = happySpecReduce_1 220 happyReduction_588 happyReduction_588 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkQual varName (getPREFIXQVARSYM happy_var_1) ) happyReduction_588 _ = notHappyAtAll happyReduce_589 = happySpecReduce_1 221 happyReduction_589 happyReduction_589 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual varName (getVARID happy_var_1) ) happyReduction_589 _ = notHappyAtAll happyReduce_590 = happySpecReduce_1 221 happyReduction_590 happyReduction_590 (HappyAbsSyn147 happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual varName (unLoc happy_var_1) ) happyReduction_590 _ = notHappyAtAll happyReduce_591 = happySpecReduce_1 221 happyReduction_591 happyReduction_591 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual varName (fsLit "unsafe") ) happyReduction_591 _ = notHappyAtAll happyReduce_592 = happySpecReduce_1 221 happyReduction_592 happyReduction_592 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual varName (fsLit "safe") ) happyReduction_592 _ = notHappyAtAll happyReduce_593 = happySpecReduce_1 221 happyReduction_593 happyReduction_593 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual varName (fsLit "interruptible") ) happyReduction_593 _ = notHappyAtAll happyReduce_594 = happySpecReduce_1 221 happyReduction_594 happyReduction_594 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual varName (fsLit "forall") ) happyReduction_594 _ = notHappyAtAll happyReduce_595 = happySpecReduce_1 221 happyReduction_595 happyReduction_595 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual varName (fsLit "family") ) happyReduction_595 _ = notHappyAtAll happyReduce_596 = happySpecReduce_1 222 happyReduction_596 happyReduction_596 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_596 _ = notHappyAtAll happyReduce_597 = happySpecReduce_1 222 happyReduction_597 happyReduction_597 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_597 _ = notHappyAtAll happyReduce_598 = happySpecReduce_1 223 happyReduction_598 happyReduction_598 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_598 _ = notHappyAtAll happyReduce_599 = happySpecReduce_1 223 happyReduction_599 happyReduction_599 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_599 _ = notHappyAtAll happyReduce_600 = happySpecReduce_1 224 happyReduction_600 happyReduction_600 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ mkQual varName (getQVARSYM happy_var_1) ) happyReduction_600 _ = notHappyAtAll happyReduce_601 = happySpecReduce_1 225 happyReduction_601 happyReduction_601 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_601 _ = notHappyAtAll happyReduce_602 = happySpecReduce_1 225 happyReduction_602 happyReduction_602 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ mkUnqual varName (fsLit "-") ) happyReduction_602 _ = notHappyAtAll happyReduce_603 = happySpecReduce_1 226 happyReduction_603 happyReduction_603 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ mkUnqual varName (getVARSYM happy_var_1) ) happyReduction_603 _ = notHappyAtAll happyReduce_604 = happySpecReduce_1 226 happyReduction_604 happyReduction_604 (HappyAbsSyn147 happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ mkUnqual varName (unLoc happy_var_1) ) happyReduction_604 _ = notHappyAtAll happyReduce_605 = happySpecReduce_1 227 happyReduction_605 happyReduction_605 (HappyTerminal happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (fsLit "as") ) happyReduction_605 _ = notHappyAtAll happyReduce_606 = happySpecReduce_1 227 happyReduction_606 happyReduction_606 (HappyTerminal happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (fsLit "qualified") ) happyReduction_606 _ = notHappyAtAll happyReduce_607 = happySpecReduce_1 227 happyReduction_607 happyReduction_607 (HappyTerminal happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (fsLit "hiding") ) happyReduction_607 _ = notHappyAtAll happyReduce_608 = happySpecReduce_1 227 happyReduction_608 happyReduction_608 (HappyTerminal happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (fsLit "export") ) happyReduction_608 _ = notHappyAtAll happyReduce_609 = happySpecReduce_1 227 happyReduction_609 happyReduction_609 (HappyTerminal happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (fsLit "label") ) happyReduction_609 _ = notHappyAtAll happyReduce_610 = happySpecReduce_1 227 happyReduction_610 happyReduction_610 (HappyTerminal happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (fsLit "dynamic") ) happyReduction_610 _ = notHappyAtAll happyReduce_611 = happySpecReduce_1 227 happyReduction_611 happyReduction_611 (HappyTerminal happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (fsLit "stdcall") ) happyReduction_611 _ = notHappyAtAll happyReduce_612 = happySpecReduce_1 227 happyReduction_612 happyReduction_612 (HappyTerminal happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (fsLit "ccall") ) happyReduction_612 _ = notHappyAtAll happyReduce_613 = happySpecReduce_1 227 happyReduction_613 happyReduction_613 (HappyTerminal happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (fsLit "capi") ) happyReduction_613 _ = notHappyAtAll happyReduce_614 = happySpecReduce_1 227 happyReduction_614 happyReduction_614 (HappyTerminal happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (fsLit "prim") ) happyReduction_614 _ = notHappyAtAll happyReduce_615 = happySpecReduce_1 227 happyReduction_615 happyReduction_615 (HappyTerminal happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (fsLit "group") ) happyReduction_615 _ = notHappyAtAll happyReduce_616 = happySpecReduce_1 228 happyReduction_616 happyReduction_616 (HappyTerminal happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (fsLit "!") ) happyReduction_616 _ = notHappyAtAll happyReduce_617 = happySpecReduce_1 228 happyReduction_617 happyReduction_617 (HappyTerminal happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (fsLit ".") ) happyReduction_617 _ = notHappyAtAll happyReduce_618 = happySpecReduce_1 228 happyReduction_618 happyReduction_618 (HappyTerminal happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (fsLit "*") ) happyReduction_618 _ = notHappyAtAll happyReduce_619 = happySpecReduce_1 229 happyReduction_619 happyReduction_619 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_619 _ = notHappyAtAll happyReduce_620 = happySpecReduce_1 229 happyReduction_620 happyReduction_620 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkQual dataName (getQCONID happy_var_1) ) happyReduction_620 _ = notHappyAtAll happyReduce_621 = happySpecReduce_1 229 happyReduction_621 happyReduction_621 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkQual dataName (getPREFIXQCONSYM happy_var_1) ) happyReduction_621 _ = notHappyAtAll happyReduce_622 = happySpecReduce_1 230 happyReduction_622 happyReduction_622 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ mkUnqual dataName (getCONID happy_var_1) ) happyReduction_622 _ = notHappyAtAll happyReduce_623 = happySpecReduce_1 231 happyReduction_623 happyReduction_623 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_623 _ = notHappyAtAll happyReduce_624 = happySpecReduce_1 231 happyReduction_624 happyReduction_624 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ mkQual dataName (getQCONSYM happy_var_1) ) happyReduction_624 _ = notHappyAtAll happyReduce_625 = happySpecReduce_1 232 happyReduction_625 happyReduction_625 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ mkUnqual dataName (getCONSYM happy_var_1) ) happyReduction_625 _ = notHappyAtAll happyReduce_626 = happySpecReduce_1 232 happyReduction_626 happyReduction_626 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ consDataCon_RDR ) happyReduction_626 _ = notHappyAtAll happyReduce_627 = happySpecReduce_1 233 happyReduction_627 happyReduction_627 (HappyTerminal happy_var_1) = HappyAbsSyn233 (sL (getLoc happy_var_1) $ HsChar $ getCHAR happy_var_1 ) happyReduction_627 _ = notHappyAtAll happyReduce_628 = happySpecReduce_1 233 happyReduction_628 happyReduction_628 (HappyTerminal happy_var_1) = HappyAbsSyn233 (sL (getLoc happy_var_1) $ HsString $ getSTRING happy_var_1 ) happyReduction_628 _ = notHappyAtAll happyReduce_629 = happySpecReduce_1 233 happyReduction_629 happyReduction_629 (HappyTerminal happy_var_1) = HappyAbsSyn233 (sL (getLoc happy_var_1) $ HsIntPrim $ getPRIMINTEGER happy_var_1 ) happyReduction_629 _ = notHappyAtAll happyReduce_630 = happySpecReduce_1 233 happyReduction_630 happyReduction_630 (HappyTerminal happy_var_1) = HappyAbsSyn233 (sL (getLoc happy_var_1) $ HsWordPrim $ getPRIMWORD happy_var_1 ) happyReduction_630 _ = notHappyAtAll happyReduce_631 = happySpecReduce_1 233 happyReduction_631 happyReduction_631 (HappyTerminal happy_var_1) = HappyAbsSyn233 (sL (getLoc happy_var_1) $ HsCharPrim $ getPRIMCHAR happy_var_1 ) happyReduction_631 _ = notHappyAtAll happyReduce_632 = happySpecReduce_1 233 happyReduction_632 happyReduction_632 (HappyTerminal happy_var_1) = HappyAbsSyn233 (sL (getLoc happy_var_1) $ HsStringPrim $ getPRIMSTRING happy_var_1 ) happyReduction_632 _ = notHappyAtAll happyReduce_633 = happySpecReduce_1 233 happyReduction_633 happyReduction_633 (HappyTerminal happy_var_1) = HappyAbsSyn233 (sL (getLoc happy_var_1) $ HsFloatPrim $ getPRIMFLOAT happy_var_1 ) happyReduction_633 _ = notHappyAtAll happyReduce_634 = happySpecReduce_1 233 happyReduction_634 happyReduction_634 (HappyTerminal happy_var_1) = HappyAbsSyn233 (sL (getLoc happy_var_1) $ HsDoublePrim $ getPRIMDOUBLE happy_var_1 ) happyReduction_634 _ = notHappyAtAll happyReduce_635 = happySpecReduce_1 234 happyReduction_635 happyReduction_635 _ = HappyAbsSyn20 (() ) happyReduce_636 = happyMonadReduce 1 234 happyReduction_636 happyReduction_636 (_ `HappyStk` happyRest) tk = happyThen (( popContext) ) (\r -> happyReturn (HappyAbsSyn20 r)) happyReduce_637 = happySpecReduce_1 235 happyReduction_637 happyReduction_637 (HappyTerminal happy_var_1) = HappyAbsSyn235 (sL (getLoc happy_var_1) $ mkModuleNameFS (getCONID happy_var_1) ) happyReduction_637 _ = notHappyAtAll happyReduce_638 = happySpecReduce_1 235 happyReduction_638 happyReduction_638 (HappyTerminal happy_var_1) = HappyAbsSyn235 (sL (getLoc happy_var_1) $ let (mod,c) = getQCONID happy_var_1 in mkModuleNameFS (mkFastString (unpackFS mod ++ '.':unpackFS c)) ) happyReduction_638 _ = notHappyAtAll happyReduce_639 = happySpecReduce_2 236 happyReduction_639 happyReduction_639 _ (HappyAbsSyn48 happy_var_1) = HappyAbsSyn48 (happy_var_1 + 1 ) happyReduction_639 _ _ = notHappyAtAll happyReduce_640 = happySpecReduce_1 236 happyReduction_640 happyReduction_640 _ = HappyAbsSyn48 (1 ) happyReduce_641 = happyMonadReduce 1 237 happyReduction_641 happyReduction_641 ((HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( return (sL (getLoc happy_var_1) (HsDocString (mkFastString (getDOCNEXT happy_var_1))))) ) (\r -> happyReturn (HappyAbsSyn237 r)) happyReduce_642 = happyMonadReduce 1 238 happyReduction_642 happyReduction_642 ((HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( return (sL (getLoc happy_var_1) (HsDocString (mkFastString (getDOCPREV happy_var_1))))) ) (\r -> happyReturn (HappyAbsSyn237 r)) happyReduce_643 = happyMonadReduce 1 239 happyReduction_643 happyReduction_643 ((HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( let string = getDOCNAMED happy_var_1 (name, rest) = break isSpace string in return (sL (getLoc happy_var_1) (name, HsDocString (mkFastString rest)))) ) (\r -> happyReturn (HappyAbsSyn239 r)) happyReduce_644 = happyMonadReduce 1 240 happyReduction_644 happyReduction_644 ((HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( let (n, doc) = getDOCSECTION happy_var_1 in return (sL (getLoc happy_var_1) (n, HsDocString (mkFastString doc)))) ) (\r -> happyReturn (HappyAbsSyn240 r)) happyReduce_645 = happyMonadReduce 1 241 happyReduction_645 happyReduction_645 ((HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( let string = getDOCNEXT happy_var_1 in return (Just (sL (getLoc happy_var_1) (HsDocString (mkFastString string))))) ) (\r -> happyReturn (HappyAbsSyn19 r)) happyReduce_646 = happySpecReduce_1 242 happyReduction_646 happyReduction_646 (HappyAbsSyn237 happy_var_1) = HappyAbsSyn19 (Just happy_var_1 ) happyReduction_646 _ = notHappyAtAll happyReduce_647 = happySpecReduce_0 242 happyReduction_647 happyReduction_647 = HappyAbsSyn19 (Nothing ) happyReduce_648 = happySpecReduce_1 243 happyReduction_648 happyReduction_648 (HappyAbsSyn237 happy_var_1) = HappyAbsSyn19 (Just happy_var_1 ) happyReduction_648 _ = notHappyAtAll happyReduce_649 = happySpecReduce_0 243 happyReduction_649 happyReduction_649 = HappyAbsSyn19 (Nothing ) happyNewToken action sts stk = lexer(\tk -> let cont i = action i i tk (HappyState action) sts stk in case tk of { L _ ITeof -> action 381 381 tk (HappyState action) sts stk; L _ ITunderscore -> cont 244; L _ ITas -> cont 245; L _ ITcase -> cont 246; L _ ITclass -> cont 247; L _ ITdata -> cont 248; L _ ITdefault -> cont 249; L _ ITderiving -> cont 250; L _ ITdo -> cont 251; L _ ITelse -> cont 252; L _ IThiding -> cont 253; L _ ITif -> cont 254; L _ ITimport -> cont 255; L _ ITin -> cont 256; L _ ITinfix -> cont 257; L _ ITinfixl -> cont 258; L _ ITinfixr -> cont 259; L _ ITinstance -> cont 260; L _ ITlet -> cont 261; L _ ITmodule -> cont 262; L _ ITnewtype -> cont 263; L _ ITof -> cont 264; L _ ITqualified -> cont 265; L _ ITthen -> cont 266; L _ ITtype -> cont 267; L _ ITwhere -> cont 268; L _ ITscc -> cont 269; L _ ITforall -> cont 270; L _ ITforeign -> cont 271; L _ ITexport -> cont 272; L _ ITlabel -> cont 273; L _ ITdynamic -> cont 274; L _ ITsafe -> cont 275; L _ ITinterruptible -> cont 276; L _ ITunsafe -> cont 277; L _ ITmdo -> cont 278; L _ ITfamily -> cont 279; L _ ITstdcallconv -> cont 280; L _ ITccallconv -> cont 281; L _ ITcapiconv -> cont 282; L _ ITprimcallconv -> cont 283; L _ ITproc -> cont 284; L _ ITrec -> cont 285; L _ ITgroup -> cont 286; L _ ITby -> cont 287; L _ ITusing -> cont 288; L _ (ITinline_prag _ _) -> cont 289; L _ ITspec_prag -> cont 290; L _ (ITspec_inline_prag _) -> cont 291; L _ ITsource_prag -> cont 292; L _ ITrules_prag -> cont 293; L _ ITcore_prag -> cont 294; L _ ITscc_prag -> cont 295; L _ ITgenerated_prag -> cont 296; L _ ITdeprecated_prag -> cont 297; L _ ITwarning_prag -> cont 298; L _ ITunpack_prag -> cont 299; L _ ITnounpack_prag -> cont 300; L _ ITann_prag -> cont 301; L _ ITvect_prag -> cont 302; L _ ITvect_scalar_prag -> cont 303; L _ ITnovect_prag -> cont 304; L _ ITctype -> cont 305; L _ ITclose_prag -> cont 306; L _ ITdotdot -> cont 307; L _ ITcolon -> cont 308; L _ ITdcolon -> cont 309; L _ ITequal -> cont 310; L _ ITlam -> cont 311; L _ ITlcase -> cont 312; L _ ITvbar -> cont 313; L _ ITlarrow -> cont 314; L _ ITrarrow -> cont 315; L _ ITat -> cont 316; L _ ITtilde -> cont 317; L _ ITtildehsh -> cont 318; L _ ITdarrow -> cont 319; L _ ITminus -> cont 320; L _ ITbang -> cont 321; L _ ITstar -> cont 322; L _ ITlarrowtail -> cont 323; L _ ITrarrowtail -> cont 324; L _ ITLarrowtail -> cont 325; L _ ITRarrowtail -> cont 326; L _ ITdot -> cont 327; L _ ITocurly -> cont 328; L _ ITccurly -> cont 329; L _ ITvocurly -> cont 330; L _ ITvccurly -> cont 331; L _ ITobrack -> cont 332; L _ ITcbrack -> cont 333; L _ ITopabrack -> cont 334; L _ ITcpabrack -> cont 335; L _ IToparen -> cont 336; L _ ITcparen -> cont 337; L _ IToubxparen -> cont 338; L _ ITcubxparen -> cont 339; L _ IToparenbar -> cont 340; L _ ITcparenbar -> cont 341; L _ ITsemi -> cont 342; L _ ITcomma -> cont 343; L _ ITbackquote -> cont 344; L _ ITsimpleQuote -> cont 345; L _ (ITvarid _) -> cont 346; L _ (ITconid _) -> cont 347; L _ (ITvarsym _) -> cont 348; L _ (ITconsym _) -> cont 349; L _ (ITqvarid _) -> cont 350; L _ (ITqconid _) -> cont 351; L _ (ITqvarsym _) -> cont 352; L _ (ITqconsym _) -> cont 353; L _ (ITprefixqvarsym _) -> cont 354; L _ (ITprefixqconsym _) -> cont 355; L _ (ITdupipvarid _) -> cont 356; L _ (ITchar _) -> cont 357; L _ (ITstring _) -> cont 358; L _ (ITinteger _) -> cont 359; L _ (ITrational _) -> cont 360; L _ (ITprimchar _) -> cont 361; L _ (ITprimstring _) -> cont 362; L _ (ITprimint _) -> cont 363; L _ (ITprimword _) -> cont 364; L _ (ITprimfloat _) -> cont 365; L _ (ITprimdouble _) -> cont 366; L _ (ITdocCommentNext _) -> cont 367; L _ (ITdocCommentPrev _) -> cont 368; L _ (ITdocCommentNamed _) -> cont 369; L _ (ITdocSection _ _) -> cont 370; L _ ITopenExpQuote -> cont 371; L _ ITopenPatQuote -> cont 372; L _ ITopenTypQuote -> cont 373; L _ ITopenDecQuote -> cont 374; L _ ITcloseQuote -> cont 375; L _ (ITidEscape _) -> cont 376; L _ ITparenEscape -> cont 377; L _ ITtyQuote -> cont 378; L _ (ITquasiQuote _) -> cont 379; L _ (ITqQuasiQuote _) -> cont 380; _ -> happyError' tk }) happyError_ 381 tk = happyError' tk happyError_ _ tk = happyError' tk happyThen :: () => P a -> (a -> P b) -> P b happyThen = (>>=) happyReturn :: () => a -> P a happyReturn = (return) happyThen1 = happyThen happyReturn1 :: () => a -> P a happyReturn1 = happyReturn happyError' :: () => ((Located Token)) -> P a happyError' tk = (\token -> happyError) tk partialStatement = happySomeParser where happySomeParser = happyThen (happyParse action_0) (\x -> case x of {HappyAbsSyn185 z -> happyReturn z; _other -> notHappyAtAll }) partialImport = happySomeParser where happySomeParser = happyThen (happyParse action_1) (\x -> case x of {HappyAbsSyn40 z -> happyReturn z; _other -> notHappyAtAll }) partialDeclaration = happySomeParser where happySomeParser = happyThen (happyParse action_2) (\x -> case x of {HappyAbsSyn51 z -> happyReturn z; _other -> notHappyAtAll }) partialTypeSignature = happySomeParser where happySomeParser = happyThen (happyParse action_3) (\x -> case x of {HappyAbsSyn15 z -> happyReturn z; _other -> notHappyAtAll }) partialModule = happySomeParser where happySomeParser = happyThen (happyParse action_4) (\x -> case x of {HappyAbsSyn16 z -> happyReturn z; _other -> notHappyAtAll }) partialExpression = happySomeParser where happySomeParser = happyThen (happyParse action_5) (\x -> case x of {HappyAbsSyn143 z -> happyReturn z; _other -> notHappyAtAll }) fullStatement = happySomeParser where happySomeParser = happyThen (happyParse action_6) (\x -> case x of {HappyAbsSyn185 z -> happyReturn z; _other -> notHappyAtAll }) fullImport = happySomeParser where happySomeParser = happyThen (happyParse action_7) (\x -> case x of {HappyAbsSyn40 z -> happyReturn z; _other -> notHappyAtAll }) fullDeclaration = happySomeParser where happySomeParser = happyThen (happyParse action_8) (\x -> case x of {HappyAbsSyn51 z -> happyReturn z; _other -> notHappyAtAll }) fullExpression = happySomeParser where happySomeParser = happyThen (happyParse action_9) (\x -> case x of {HappyAbsSyn143 z -> happyReturn z; _other -> notHappyAtAll }) fullTypeSignature = happySomeParser where happySomeParser = happyThen (happyParse action_10) (\x -> case x of {HappyAbsSyn15 z -> happyReturn z; _other -> notHappyAtAll }) fullModule = happySomeParser where happySomeParser = happyThen (happyParse action_11) (\x -> case x of {HappyAbsSyn16 z -> happyReturn z; _other -> notHappyAtAll }) happySeq = happyDontSeq happyError :: P a happyError = srcParseFail getVARID (L _ (ITvarid x)) = x getCONID (L _ (ITconid x)) = x getVARSYM (L _ (ITvarsym x)) = x getCONSYM (L _ (ITconsym x)) = x getQVARID (L _ (ITqvarid x)) = x getQCONID (L _ (ITqconid x)) = x getQVARSYM (L _ (ITqvarsym x)) = x getQCONSYM (L _ (ITqconsym x)) = x getPREFIXQVARSYM (L _ (ITprefixqvarsym x)) = x getPREFIXQCONSYM (L _ (ITprefixqconsym x)) = x getIPDUPVARID (L _ (ITdupipvarid x)) = x getCHAR (L _ (ITchar x)) = x getSTRING (L _ (ITstring x)) = x getINTEGER (L _ (ITinteger x)) = x getRATIONAL (L _ (ITrational x)) = x getPRIMCHAR (L _ (ITprimchar x)) = x getPRIMSTRING (L _ (ITprimstring x)) = x getPRIMINTEGER (L _ (ITprimint x)) = x getPRIMWORD (L _ (ITprimword x)) = x getPRIMFLOAT (L _ (ITprimfloat x)) = x getPRIMDOUBLE (L _ (ITprimdouble x)) = x getTH_ID_SPLICE (L _ (ITidEscape x)) = x getINLINE (L _ (ITinline_prag inl conl)) = (inl,conl) getSPEC_INLINE (L _ (ITspec_inline_prag True)) = (Inline, FunLike) getSPEC_INLINE (L _ (ITspec_inline_prag False)) = (NoInline,FunLike) getDOCNEXT (L _ (ITdocCommentNext x)) = x getDOCPREV (L _ (ITdocCommentPrev x)) = x getDOCNAMED (L _ (ITdocCommentNamed x)) = x getDOCSECTION (L _ (ITdocSection n x)) = (n, x) getSCC :: Located Token -> P FastString getSCC lt = do let s = getSTRING lt err = "Spaces are not allowed in SCCs" -- We probably actually want to be more restrictive than this if ' ' `elem` unpackFS s then failSpanMsgP (getLoc lt) (text err) else return s -- Utilities for combining source spans comb2 :: Located a -> Located b -> SrcSpan comb2 a b = a `seq` b `seq` combineLocs a b comb3 :: Located a -> Located b -> Located c -> SrcSpan comb3 a b c = a `seq` b `seq` c `seq` combineSrcSpans (getLoc a) (combineSrcSpans (getLoc b) (getLoc c)) comb4 :: Located a -> Located b -> Located c -> Located d -> SrcSpan comb4 a b c d = a `seq` b `seq` c `seq` d `seq` (combineSrcSpans (getLoc a) $ combineSrcSpans (getLoc b) $ combineSrcSpans (getLoc c) (getLoc d)) -- strict constructor version: {-# INLINE sL #-} sL :: SrcSpan -> a -> Located a sL span a = span `seq` a `seq` L span a -- Make a source location for the file. We're a bit lazy here and just -- make a point SrcSpan at line 1, column 0. Strictly speaking we should -- try to find the span of the whole file (ToDo). fileSrcSpan :: P SrcSpan fileSrcSpan = do l <- getSrcLoc; let loc = mkSrcLoc (srcLocFile l) 1 1; return (mkSrcSpan loc loc) -- Hint about the MultiWayIf extension hintMultiWayIf :: SrcSpan -> P () hintMultiWayIf span = do mwiEnabled <- liftM ((Opt_MultiWayIf `xopt`) . dflags) getPState unless mwiEnabled $ parseErrorSDoc span $ text "Multi-way if-expressions need -XMultiWayIf turned on" {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "<built-in>" #-} {-# LINE 1 "<command-line>" #-} {-# LINE 8 "<command-line>" #-} # 1 "/usr/include/stdc-predef.h" 1 3 4 # 17 "/usr/include/stdc-predef.h" 3 4 {-# LINE 8 "<command-line>" #-} {-# LINE 1 "/home/andrei/.stack/programs/x86_64-linux/ghc-8.0.2/lib/ghc-8.0.2/include/ghcversion.h" #-} {-# LINE 8 "<command-line>" #-} {-# LINE 1 "/tmp/ghc2743_0/ghc_2.h" #-} {-# LINE 8 "<command-line>" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} -- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp {-# LINE 13 "templates/GenericTemplate.hs" #-} {-# LINE 46 "templates/GenericTemplate.hs" #-} {-# LINE 67 "templates/GenericTemplate.hs" #-} {-# LINE 77 "templates/GenericTemplate.hs" #-} {-# LINE 86 "templates/GenericTemplate.hs" #-} infixr 9 `HappyStk` data HappyStk a = HappyStk a (HappyStk a) ----------------------------------------------------------------------------- -- starting the parse happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll ----------------------------------------------------------------------------- -- Accepting the parse -- If the current token is (1), it means we've just accepted a partial -- parse (a %partial parser). We must ignore the saved token on the top of -- the stack in this case. happyAccept (1) tk st sts (_ `HappyStk` ans `HappyStk` _) = happyReturn1 ans happyAccept j tk st sts (HappyStk ans _) = (happyReturn1 ans) ----------------------------------------------------------------------------- -- Arrays only: do the next action {-# LINE 155 "templates/GenericTemplate.hs" #-} ----------------------------------------------------------------------------- -- HappyState data type (not arrays) newtype HappyState b c = HappyState (Int -> -- token number Int -> -- token number (yes, again) b -> -- token semantic value HappyState b c -> -- current state [HappyState b c] -> -- state stack c) ----------------------------------------------------------------------------- -- Shifting a token happyShift new_state (1) tk st sts stk@(x `HappyStk` _) = let i = (case x of { HappyErrorToken (i) -> i }) in -- trace "shifting the error token" $ new_state i i tk (HappyState (new_state)) ((st):(sts)) (stk) happyShift new_state i tk st sts stk = happyNewToken new_state ((st):(sts)) ((HappyTerminal (tk))`HappyStk`stk) -- happyReduce is specialised for the common cases. happySpecReduce_0 i fn (1) tk st sts stk = happyFail (1) tk st sts stk happySpecReduce_0 nt fn j tk st@((HappyState (action))) sts stk = action nt j tk st ((st):(sts)) (fn `HappyStk` stk) happySpecReduce_1 i fn (1) tk st sts stk = happyFail (1) tk st sts stk happySpecReduce_1 nt fn j tk _ sts@(((st@(HappyState (action))):(_))) (v1`HappyStk`stk') = let r = fn v1 in happySeq r (action nt j tk st sts (r `HappyStk` stk')) happySpecReduce_2 i fn (1) tk st sts stk = happyFail (1) tk st sts stk happySpecReduce_2 nt fn j tk _ ((_):(sts@(((st@(HappyState (action))):(_))))) (v1`HappyStk`v2`HappyStk`stk') = let r = fn v1 v2 in happySeq r (action nt j tk st sts (r `HappyStk` stk')) happySpecReduce_3 i fn (1) tk st sts stk = happyFail (1) tk st sts stk happySpecReduce_3 nt fn j tk _ ((_):(((_):(sts@(((st@(HappyState (action))):(_))))))) (v1`HappyStk`v2`HappyStk`v3`HappyStk`stk') = let r = fn v1 v2 v3 in happySeq r (action nt j tk st sts (r `HappyStk` stk')) happyReduce k i fn (1) tk st sts stk = happyFail (1) tk st sts stk happyReduce k nt fn j tk st sts stk = case happyDrop (k - ((1) :: Int)) sts of sts1@(((st1@(HappyState (action))):(_))) -> let r = fn stk in -- it doesn't hurt to always seq here... happyDoSeq r (action nt j tk st1 sts1 r) happyMonadReduce k nt fn (1) tk st sts stk = happyFail (1) tk st sts stk happyMonadReduce k nt fn j tk st sts stk = case happyDrop k ((st):(sts)) of sts1@(((st1@(HappyState (action))):(_))) -> let drop_stk = happyDropStk k stk in happyThen1 (fn stk tk) (\r -> action nt j tk st1 sts1 (r `HappyStk` drop_stk)) happyMonad2Reduce k nt fn (1) tk st sts stk = happyFail (1) tk st sts stk happyMonad2Reduce k nt fn j tk st sts stk = case happyDrop k ((st):(sts)) of sts1@(((st1@(HappyState (action))):(_))) -> let drop_stk = happyDropStk k stk new_state = action in happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk)) happyDrop (0) l = l happyDrop n ((_):(t)) = happyDrop (n - ((1) :: Int)) t happyDropStk (0) l = l happyDropStk n (x `HappyStk` xs) = happyDropStk (n - ((1)::Int)) xs ----------------------------------------------------------------------------- -- Moving to a new state after a reduction {-# LINE 256 "templates/GenericTemplate.hs" #-} happyGoto action j tk st = action j j tk (HappyState action) ----------------------------------------------------------------------------- -- Error recovery ((1) is the error token) -- parse error if we are in recovery and we fail again happyFail (1) tk old_st _ stk@(x `HappyStk` _) = let i = (case x of { HappyErrorToken (i) -> i }) in -- trace "failing" $ happyError_ i tk {- We don't need state discarding for our restricted implementation of "error". In fact, it can cause some bogus parses, so I've disabled it for now --SDM -- discard a state happyFail (1) tk old_st (((HappyState (action))):(sts)) (saved_tok `HappyStk` _ `HappyStk` stk) = -- trace ("discarding state, depth " ++ show (length stk)) $ action (1) (1) tk (HappyState (action)) sts ((saved_tok`HappyStk`stk)) -} -- Enter error recovery: generate an error token, -- save the old token and carry on. happyFail i tk (HappyState (action)) sts stk = -- trace "entering error recovery" $ action (1) (1) tk (HappyState (action)) sts ( (HappyErrorToken (i)) `HappyStk` stk) -- Internal happy errors: notHappyAtAll :: a notHappyAtAll = error "Internal Happy error\n" ----------------------------------------------------------------------------- -- Hack to get the typechecker to accept our action functions ----------------------------------------------------------------------------- -- Seq-ing. If the --strict flag is given, then Happy emits -- happySeq = happyDoSeq -- otherwise it emits -- happySeq = happyDontSeq happyDoSeq, happyDontSeq :: a -> b -> b happyDoSeq a b = a `seq` b happyDontSeq a b = b ----------------------------------------------------------------------------- -- Don't inline any functions from the template. GHC has a nasty habit -- of deciding to inline happyGoto everywhere, which increases the size of -- the generated parser quite a bit. {-# LINE 322 "templates/GenericTemplate.hs" #-} {-# NOINLINE happyShift #-} {-# NOINLINE happySpecReduce_0 #-} {-# NOINLINE happySpecReduce_1 #-} {-# NOINLINE happySpecReduce_2 #-} {-# NOINLINE happySpecReduce_3 #-} {-# NOINLINE happyReduce #-} {-# NOINLINE happyMonadReduce #-} {-# NOINLINE happyGoto #-} {-# NOINLINE happyFail #-} -- end of Happy Template.
sumitsahrawat/IHaskell
ghc-parser/src-7.6/Language/Haskell/GHC/HappyParser.hs
mit
934,547
26,060
145
127,374
287,093
155,308
131,785
24,366
139
module WMonad.Util ( whenM , unlessM , logp , logs ) where import Control.Monad import Control.Monad.Logger import Data.Text (pack) whenM :: Monad m => m Bool -> m () -> m () whenM cond m = cond >>= flip when m unlessM :: Monad m => m Bool -> m () -> m () unlessM cond m = cond >>= flip unless m logp :: (Show a, MonadLogger m) => a -> m () logp = logDebugN . pack . show logs :: MonadLogger m => String -> m () logs = logDebugN . pack . show
nickspinale/wmonad
src/WMonad/Util.hs
mit
472
0
9
126
221
113
108
16
1
module University ( Professor(..) , Student(..) , Class(..)) where data Professor = Professor { profFirstName :: String, profLastName :: String, almaMaters:: [String], degrees:: [String], yearsAtUniversity:: Int, tenured:: Bool, classesCurrentlyTeaching:: [String], profDepartment :: String, college :: String } deriving (Eq, Show) data Student = Student { studentFirstName :: String, studentLastName :: String, year:: String, degreesPursuing :: [String], gpa :: Float, classesCurrentlyTaking :: [String], colleges :: [String] } deriving (Eq, Show) data Class = Class { courseNumber :: Int, courseName :: String, numberOfStudentsEnrolled :: Int, studentsEnrolledByUniversityId :: [Int], department :: String, professor :: String, semester :: String } deriving (Eq, Show)
rtoal/ple
haskell/University.hs
mit
880
0
9
208
246
158
88
33
0
{-# LANGUAGE OverloadedStrings #-} module Y2017.M12.D18.Solution where {-- Yesterday, we created the links for requesting an oembed component, today we will receive an oembed request and then respond. Reminder, the request looks something like http://127.0.0.1:8080/services/oembed/?format=json&url=http%3A//127.0.0.1%3A8080/Y2017/M12/D13/goatz.jpg And today, we will provide the response, that will look something like: { "version": "1.0", "type": "photo", "width": 240, "height": 160, "title": "goatz", "url": "http://127.0.0.1:8080/Y2017/M12/D13/goatz.jpg" "author_name": "geophf", "author_url": "http://logicaltypes.blogspot.com" } Okay, let's get to it! --} import Data.Aeson import Data.Aeson.Types import Data.Aeson.Encode.Pretty import qualified Data.ByteString.Lazy.Char8 as BL -- below import available via 1HaskellADay git repository import Y2017.M12.D15.Solution hiding (main') -- let's say we magically receive the GET values as arguments to main, so let's -- not worry about parsing the request URL at this time. -- We do need a structure that captures the above response JSON however data OEmbedResponse = OEResp { kind, title :: String, oeurl :: FilePath, width, height :: Int } deriving (Eq, Show) instance ToJSON OEmbedResponse where toJSON resp = object [("version", "1.0"), "type" .= kind resp, "width" .= width resp, "height" .= height resp, "title" .= title resp, "url" .= oeurl resp, ("author_name", "geophf"), ("author_url", "http://logicaltypes.blogspot.com")] {-- >>> BL.putStrLn (encodePretty (OEResp "photo" "goatz" "url" 123 345)) { "height": 345, "author_name": "geophf", "url": "url", "width": 123, "version": "1.0", "title": "goatz", "type": "photo", "author_url": "http://logicaltypes.blogspot.com" } --} -- So now we generate a response from the values we received from the request: data OEmbedRequest = OEReq { format :: Maybe Format, requrl :: FilePath } deriving (Eq, Show) -- today we are only responding in JSON. We'll look at XML response tomorrow respondJSON :: OEmbedRequest -> OEmbedResponse respondJSON (OEReq _form req) = OEResp "photo" "goat pic" req wid hei where wid = 512 -- width of the photo, somehow hei = 256 -- height of the photo, somehow {-- >>> respondJSON (OEReq (Just JSON) "http://goats.com") OEResp {kind = "photo", title = "goat pic", oeurl = "http://goats.com", width = 512, height = 256} --} -- but how do we create the request value? strs2Req :: [String] -> OEmbedRequest strs2Req [justurl] = OEReq Nothing justurl strs2Req [_json, url] = OEReq (Just JSON) url {-- The argument are arranged by the caller and are, by convention oeResp [format] <goat-url> If format is there, it will be "json"; if not, then just the goat-url is present. Either way, you can construct the OEmbedRequest object from that. >>> strs2Req ["http://goats.com"] OEReq {format = Nothing, requrl = "http://goats.com"} >>> strs2Req ["json", "http://goats.com"] OEReq {format = Just json, requrl = "http://goats.com"} --} {-- BONUS ----------------------------------------------------------------- Build an application that, given the arguments of the optional formatting type and the url of the asset, returns the OEmbedResponse as JSON. --} main' :: [String] -> IO () main' args = if len < 1 || len > 2 then usage else BL.putStrLn (encodePretty (respondJSON (strs2Req args))) where len = length args usage :: IO () usage = putStrLn (unlines ["","oeResp [json] <url>", "", "\twhere json indicates that the response will be in json", "\t url is the url of the asset to be embed",""]) {-- BONUS-BONUS ----------------------------------------------------------- May not be your your cuppa tea, but give this a go. Create a REST server that takes the oembed request (as formatted yesterda) and returns the oembed response. You can go full-Haskell with this, if you'd like, by creating a Haskell servlet, or you can use whatever webby-resty language you prefer. --}
geophf/1HaskellADay
exercises/HAD/Y2017/M12/D18/Solution.hs
mit
4,131
0
12
793
459
267
192
34
2
{-# LANGUAGE ParallelListComp, ViewPatterns, DeriveDataTypeable, ImplicitParams, TemplateHaskell #-} import Positioned hiding (ord) import World import Node import Stepping import Seq import Timed import List import Data.Char import Control.Concurrent.STM import Control.Concurrent hiding (Chan) import Prelude hiding (mapM, concat, foldr, concatMap, elem, sum) import Graphics.Gloss import Data.Maybe import System.Random import Graphics.Gloss.Interface.IO.Game hiding (Key) import Data.Foldable import Data.Traversable import qualified Data.Set as S import Data.List (sortBy, sort) import Data.Ord (comparing) import Control.Arrow import Control.Monad import Data.Typeable import System.Console.CmdArgs import Control.Lens import Control.Lens.TH {- -- | NodeConfiguration of a node. data NodeConfiguration = NodeConfiguration { txfrequency :: Int, -- ^ transmissions frequency pufrequency :: Int, -- ^ pubblicity frequency rodfrequency :: Int, -- ^ node self message frequency droplevel :: Int, -- ^ max number of consecutive missed listenings before dropping alertlevel :: Int, -- ^ minimum number of listeners to stop using sync listening window on common channel neighborlevel :: Int, -- ^ minimum number of neighbors to stop listening on common channel memory :: Int, -- ^ number of remembered messages numchannels :: Int, -- ^ channel spectrum lmessagettl :: Int -- ^ message duration in memory } deriving (Show)-- , Typeable, Data) sample = Configuration { frames = def &= help "number of frames per second" &= opt (25 :: Int) , radiorange = def &= help "radio range in video units" &= opt (0.3::Double) , txfrequency = def &= help "mean delta in frames between node transmission events" &= opt (10 :: Int) , pufrequency = def &= help "mean delta in frames between node self publicity events" &= opt (20 :: Int) , rodfrequency = def &= help "mean delta in frames between node fact production event" &= opt (20 :: Int) , memory = def &= help "node fact memory capcacity" &= opt (5 :: Int) , numchannels = def &= help "channel diversity" &= opt (30 :: Int) , lmessagettl = def &= help "message time to live" &= opt (50::Int) , droplevel = def &= help "max number of consecutive missed listenings before dropping" &= opt (3 :: Int) , alertlevel = def &= help "minimum number of listeners to stop using sync listening window on common channel" &= opt (3::Float) , neighborlevel = def &= help "minimum number of neighbors to stop listening on common channel" &= opt (5::Float) } &= summary "Simulation of touchnet protocol" -} nodeConf = NodeConfiguration { txfrequency = 20, -- ^ transmissions frequency pufrequency = 100, -- ^ pubblicity frequency rodfrequency = 50, -- ^ node self message frequency droplevel = 5, -- ^ max number of consecutive missed listenings before dropping alertlevel = 1, -- ^ minimum number of listeners to stop using sync listening window on common channel neighborlevel = 1, -- ^ minimum number of neighbors to stop listening on common channel neighbormemory = 5, -- ^ minimum number of neighbors to stop listening on common channel memory = 10, -- ^ number of remembered messages numchannels = 10, -- ^ channel spectrum lmessagettl = 200, -- ^ message duration in memory dropaneigbor = 20 -- ^ anticlustering } data Graphics = Graphics { _world :: World Future Char, _selected :: Maybe Key, _radiorange :: Float, _curname :: Char } makeLenses ''Graphics main :: IO () main = -- args <- cmdArgs sample let ?nconf = nodeConf in playIO (InWindow "Zen" (800, 600) (5, 5)) 0 -- color 30 -- frames (Graphics (World [] 0) Nothing 100 'a') -- starting world render -- render world handle -- handle events (\_ w -> return $ over world (stepWorld (view radiorange w)) w) -- stepworld handle :: (?nconf :: NodeConfiguration) => Event -> Graphics -> IO Graphics -- map the movement if a node is selected handle (EventMotion p@(x',y')) g@(view selected &&& view (world . nodes) -> (Just k, xs)) = let Just (view value -> z, f) = select ((== k) . view (value . node . transmit . key)) $ xs in return $ set (world . nodes) (f $ Positioned z x' y') g -- add a new node in mouse position handle (EventKey (MouseButton RightButton) Down (Modifiers Up Up Up) (x',y')) g = do return $ over curname succ $ over world (add x' y' $ view curname g) g handle (EventKey (MouseButton LeftButton) Down (Modifiers Up Up Up) (x',y')) g = do let n = fmap head $ nearest x' y' $ view (world . nodes) g m = fmap (view (value . node . transmit . key)) n print (view (value . node) $ fromJust n) return $ set selected m g handle (EventKey (MouseButton LeftButton) Up (Modifiers Up Up Up) _) g = do return $ set selected Nothing g handle _ x = return x {- handle (EventKey (Char c) Down (Modifiers Up Up Up) (zot -> p)) (World i xs,_,jf) = do let Close n f : xs' = sortBy (comparing $ distance p . view (node . load)) xs n' = over roduction (fmap (fmap (const $ Letter c))) n return (World i $ Close n' f : xs',Nothing,jf) regular :: Int -> [(Float,Float)] regular n = take (n + 1) $ map (\a -> (cos a,sin a)) [0,2*pi/fromIntegral n..] -} renderText rr c x x0 y0 = translate x0 y0 $ Pictures $ [color (greyN 0.05) $ circle rr, color c $ scale 0.2 0.2 $ text $ sort x] nodePicture :: Float -> Positioned (String, State Char) -> Picture nodePicture rr (Positioned (ms,Sleep _) x0 y0) = renderText rr (greyN 0.1) ms x0 y0 nodePicture rr (Positioned (ms, ReceiveFree _ _) x0 y0) = renderText rr cyan ms x0 y0 nodePicture rr (Positioned (ms, ReceiveCommon _ _) x0 y0) = renderText rr blue ms x0 y0 nodePicture rr (Positioned (ms, TransmitFree _ _ _) x0 y0) = renderText rr yellow ms x0 y0 nodePicture rr (Positioned (ms, TransmitCommon _ _ _) x0 y0) = renderText rr red ms x0 y0 render :: Graphics -> IO Picture render (Graphics (World xs _) _ rr _) = return $ let rs = over (traverse . value) (map (view message) . view (node . messages) &&& applyFuture) xs in Pictures $ map (nodePicture rr) rs {- triangolo p q = [p' `summa` scala 0.05 (dpq' `summa` per1) , p' `summa` scala 0.8 dpq' , p' `summa` scala 0.03 (dpq' `summa` per2) ,p' `summa` scala 0.03 (dpq' `summa` per1) ] where (per1,per2) = perp dpq' d = distance p q r = sqrt (800 ** 2 + 600 ** 2) dpq = diffa q p p' = p `summa` scala (11/r/d) dpq q' = q `diffa` scala (11/r/d) dpq dpq' = diffa q' p' perp (x,y) = ((-y,x),(y,-x)) scala k (x,y) = (k*x,k*y) summa (x1,y1) (x2,y2) = (x1 + x2,y1 + y2) diffa (x1,y1) (x2,y2) = (x1 - x2,y1 - y2) -}
paolino/touchnet
Render.hs
mit
7,285
4
17
2,025
1,360
730
630
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} -- ---------------------------------------------------------------------------- {- | Module : Holumbus.Index.Common.DocIdMap Copyright : Copyright (C) 2013 Sebastian M. Schlatt, Timo B. Huebel, Uwe Schmidt License : MIT Maintainer : Timo B. Huebel ([email protected]) Stability : experimental Portability: none portable DocId maps -} -- ---------------------------------------------------------------------------- module Holumbus.Index.Common.DocIdMap ( DocIdMap , emptyDocIdMap , singletonDocIdMap , nullDocIdMap , memberDocIdMap , lookupDocIdMap , insertDocIdMap , deleteDocIdMap , insertWithDocIdMap , sizeDocIdMap , minKeyDocIdMap , maxKeyDocIdMap , isIntervallDocIdMap , unionDocIdMap , intersectionDocIdMap , differenceDocIdMap , unionWithDocIdMap , intersectionWithDocIdMap , differenceWithDocIdMap , unionsWithDocIdMap , mapDocIdMap , filterDocIdMap , filterWithKeyDocIdMap , mapWithKeyDocIdMap , foldDocIdMap , foldWithKeyDocIdMap , fromListDocIdMap , toListDocIdMap , keysDocIdMap , elemsDocIdMap ) where import Control.Arrow import Control.DeepSeq import Data.Binary (Binary (..)) import qualified Data.Binary as B import Data.Foldable import qualified Data.IntMap.Strict as IM import Data.Typeable import Holumbus.Index.Common.DocId #if sizeable == 1 import Data.Size #endif -- ------------------------------------------------------------ newtype DocIdMap v = DIM { unDIM :: IM.IntMap v } deriving (Eq, Show, Foldable, NFData, Typeable) liftDIM :: (IM.IntMap v -> IM.IntMap r) -> (DocIdMap v -> DocIdMap r) liftDIM f = DIM . f . unDIM liftDIM2 :: (IM.IntMap v -> IM.IntMap v -> IM.IntMap v) -> (DocIdMap v -> DocIdMap v -> DocIdMap v) liftDIM2 f x y = DIM $ f (unDIM x) (unDIM y) emptyDocIdMap :: DocIdMap v emptyDocIdMap = DIM $ IM.empty singletonDocIdMap :: DocId -> v -> DocIdMap v singletonDocIdMap d v = insertDocIdMap d v emptyDocIdMap nullDocIdMap :: DocIdMap v -> Bool nullDocIdMap = IM.null . unDIM memberDocIdMap :: DocId -> DocIdMap v -> Bool memberDocIdMap x = IM.member (theDocId x) . unDIM lookupDocIdMap :: DocId -> DocIdMap v -> Maybe v lookupDocIdMap x = IM.lookup (theDocId x) . unDIM insertDocIdMap :: DocId -> v -> DocIdMap v -> DocIdMap v insertDocIdMap x y = liftDIM $ IM.insert (theDocId x) y deleteDocIdMap :: DocId -> DocIdMap v -> DocIdMap v deleteDocIdMap x = liftDIM $ IM.delete (theDocId x) insertWithDocIdMap :: (v -> v -> v) -> DocId -> v -> DocIdMap v -> DocIdMap v insertWithDocIdMap f x y = liftDIM $ IM.insertWith f (theDocId x) y sizeDocIdMap :: DocIdMap v -> Int sizeDocIdMap = IM.size . unDIM minKeyDocIdMap :: DocIdMap v -> DocId minKeyDocIdMap = maybe nullDocId (DocId . fst . fst) . IM.minViewWithKey . unDIM maxKeyDocIdMap :: DocIdMap v -> DocId maxKeyDocIdMap = maybe nullDocId (DocId . fst . fst) . IM.maxViewWithKey . unDIM isIntervallDocIdMap :: DocIdMap v -> Bool isIntervallDocIdMap m = nullDocIdMap m || ( fromEnum (theDocId (maxKeyDocIdMap m)) - fromEnum (theDocId (minKeyDocIdMap m)) == sizeDocIdMap m - 1 ) unionDocIdMap :: DocIdMap v -> DocIdMap v -> DocIdMap v unionDocIdMap = liftDIM2 $ IM.union intersectionDocIdMap :: DocIdMap v -> DocIdMap v -> DocIdMap v intersectionDocIdMap = liftDIM2 $ IM.intersection differenceDocIdMap :: DocIdMap v -> DocIdMap v -> DocIdMap v differenceDocIdMap = liftDIM2 $ IM.difference unionWithDocIdMap :: (v -> v -> v) -> DocIdMap v -> DocIdMap v -> DocIdMap v unionWithDocIdMap f = liftDIM2 $ IM.unionWith f intersectionWithDocIdMap :: (v -> v -> v) -> DocIdMap v -> DocIdMap v -> DocIdMap v intersectionWithDocIdMap f = liftDIM2 $ IM.intersectionWith f differenceWithDocIdMap :: (v -> v -> Maybe v) -> DocIdMap v -> DocIdMap v -> DocIdMap v differenceWithDocIdMap f = liftDIM2 $ IM.differenceWith f unionsWithDocIdMap :: (v -> v -> v) -> [DocIdMap v] -> DocIdMap v unionsWithDocIdMap f = DIM . IM.unionsWith f . map unDIM mapDocIdMap :: (v -> r) -> DocIdMap v -> DocIdMap r mapDocIdMap f = liftDIM $ IM.map f filterDocIdMap :: (v -> Bool) -> DocIdMap v -> DocIdMap v filterDocIdMap p = liftDIM $ IM.filter p filterWithKeyDocIdMap :: (DocId -> v -> Bool) -> DocIdMap v -> DocIdMap v filterWithKeyDocIdMap p = liftDIM $ IM.filterWithKey (p . DocId) mapWithKeyDocIdMap :: (DocId -> v -> r) -> DocIdMap v -> DocIdMap r mapWithKeyDocIdMap f = liftDIM $ IM.mapWithKey (f . DocId) foldDocIdMap :: (v -> b -> b) -> b -> DocIdMap v -> b foldDocIdMap f u = IM.foldr f u . unDIM foldWithKeyDocIdMap :: (DocId -> v -> b -> b) -> b -> DocIdMap v -> b foldWithKeyDocIdMap f u = IM.foldrWithKey (f . DocId) u . unDIM fromListDocIdMap :: [(DocId, v)] -> DocIdMap v fromListDocIdMap = DIM . IM.fromList . map (first theDocId) toListDocIdMap :: DocIdMap v -> [(DocId, v)] toListDocIdMap = map (first DocId) . IM.toList . unDIM keysDocIdMap :: DocIdMap v -> [DocId] keysDocIdMap = map DocId . IM.keys . unDIM elemsDocIdMap :: DocIdMap v -> [v] elemsDocIdMap = IM.elems . unDIM instance Binary v => Binary (DocIdMap v) where put = B.put . toListDocIdMap get = B.get >>= return . fromListDocIdMap -- ------------------------------------------------------------ #if sizeable == 1 instance (Typeable v, Sizeable v) => Sizeable (DocIdMap v) where dataOf = dataOf . unDIM bytesOf = bytesOf . unDIM statsOf = statsOf . unDIM #endif -- ------------------------------------------------------------ {-# INLINE liftDIM #-} {-# INLINE liftDIM2 #-} {-# INLINE emptyDocIdMap #-} {-# INLINE singletonDocIdMap #-} {-# INLINE nullDocIdMap #-} {-# INLINE memberDocIdMap #-} {-# INLINE lookupDocIdMap #-} {-# INLINE insertDocIdMap #-} {-# INLINE deleteDocIdMap #-} {-# INLINE insertWithDocIdMap #-} {-# INLINE sizeDocIdMap #-} {-# INLINE minKeyDocIdMap #-} {-# INLINE maxKeyDocIdMap #-} {-# INLINE isIntervallDocIdMap #-} {-# INLINE unionDocIdMap #-} {-# INLINE differenceDocIdMap #-} {-# INLINE unionWithDocIdMap #-} {-# INLINE intersectionWithDocIdMap #-} {-# INLINE differenceWithDocIdMap #-} {-# INLINE unionsWithDocIdMap #-} {-# INLINE mapDocIdMap #-} {-# INLINE filterDocIdMap #-} {-# INLINE filterWithKeyDocIdMap #-} {-# INLINE mapWithKeyDocIdMap #-} {-# INLINE foldDocIdMap #-} {-# INLINE foldWithKeyDocIdMap #-} {-# INLINE fromListDocIdMap #-} {-# INLINE toListDocIdMap #-} {-# INLINE keysDocIdMap #-} {-# INLINE elemsDocIdMap #-} -- ------------------------------------------------------------
ichistmeinname/holumbus
src/Holumbus/Index/Common/DocIdMap.hs
mit
8,014
0
14
2,579
1,775
935
840
144
1
module CoreSpec where import Core import Test.Hspec import Control.Monad.Trans.State import Control.Monad.Trans.Class import Prelude hiding (take, drop) fold :: Monad m => (r -> i -> r) -> r -> Pipe i o d m r fold f = loop where loop r = await >>= maybe (return r) (\i -> loop $! f r i) yieldMany :: Monad m => [o] -> Pipe i o d m () yieldMany [] = return () yieldMany (o:os) = check >>= maybe (yield o >> yieldMany os) (const $ return ()) (>->) :: Monad m => Pipe i j b m a -> Pipe j k c m b -> Pipe i k c m a (>->) = fuse take :: Monad m => Int -> Pipe i i d m d take 0 = empty take count = await >>= maybe empty (\i -> yield i >> take (count - 1)) drop :: Monad m => Int -> Pipe i o d m () drop count = take count >-> return () main :: IO () main = hspec $ do describe "summing" $ do let src = yieldMany [1..10 :: Int] >> empty sink = fold (+) 0 expected = sum [1..10] test name pipe = it name $ do res <- runPipe pipe res `shouldBe` expected test "no identity" $ src >-> sink test "idPipe front" $ idPipe >-> src >-> sink test "idPipe' front" $ idPipe' >-> src >-> sink test "idPipe middle" $ src >-> idPipe >-> sink test "idPipe' middle" $ src >-> idPipe' >-> sink test "idPipe end" $ src >-> sink >-> idPipe test "idPipe' end" $ src >-> sink >-> idPipe' describe "finalizer" $ do let src = yieldMany [1 :: Int ..] >> lift (put 1) >> empty sink = do drop 5 take 5 >-> fold (+) 0 expected = (sum [6..10], 1 :: Int) it "finalizer is run" $ do let res = flip runState 0 $ runPipe (src >-> sink) res `shouldBe` expected
snoyberg/nonterminating-pipes
src/CoreSpec.hs
mit
1,788
0
20
600
793
393
400
48
1
{-# LANGUAGE CPP, TemplateHaskell #-} module Main where #if __GLASGOW_HASKELL__ >= 610 import Control.Category import Prelude hiding ((.), init, exp) #else import Prelude hiding (init, exp) #endif import Control.Arrow import Control.CCA import Control.CCA.CCNF import Control.CCA.Types import System.IO import System.CPUTime import Sample import qualified Sample1 as S newtype SF a b = SF { runSF :: (a -> (b, SF a b)) } #if __GLASGOW_HASKELL__ >= 610 instance Category SF where id = SF h where h x = (x, SF h) g . f = SF (h f g) where h f g x = let (y, f') = runSF f x (z, g') = runSF g y in (z, SF (h f' g')) #endif instance Arrow SF where arr f = g where g = SF (\x -> (f x, g)) #if __GLASGOW_HASKELL__ < 610 f >>> g = SF (h f g) where h f g x = let (y, f') = runSF f x (z, g') = runSF g y in (z, SF (h f' g')) #endif first f = SF (g f) where g f (x, z) = ((y, z), SF (g f')) where (y, f') = runSF f x second f = SF (g f) where g f (z, x) = ((z, y), SF (g f')) where (y, f') = runSF f x f &&& g = SF (h f g) where h f g x = let (y, f') = runSF f x (z, g') = runSF g x in ((y, z), SF (h f' g')) f *** g = SF (h f g) where h f g x = let (y, f') = runSF f (fst x) (z, g') = runSF g (snd x) in ((y, z), SF (h f' g')) instance ArrowLoop SF where loop sf = SF (g sf) where g f x = (y, SF (g f')) where ((y, z), f') = runSF f (x, z) instance ArrowInit SF where init i = SF (f i) where f i x = (i, SF (f x)) loopD i g = SF (f i) where f i x = let (y, i') = g (x, i) in (y, SF (f i')) run :: SF a b -> [a] -> [b] run (SF f) (x:xs) = let (y, f') = f x in y `seq` (y : run f' xs) unfold :: SF () a -> [a] unfold = flip run inp where inp = () : inp nth :: Int -> SF () a -> a nth n (SF f) = x `seq` if n == 0 then x else nth (n - 1) f' where (x, f') = f () nth' :: Int -> (b, ((), b) -> (a, b)) -> a nth' n (i, f) = aux n i where aux n i = x `seq` if n == 0 then x else aux (n-1) i' where (x, i') = f ((), i) timer i = do t0 <- getCPUTime i `seq` (do t1 <- getCPUTime let d = t1 - t0 putStrLn $ show d ++ "\t" ++ show i return d) gnuplot f l = do h <- openFile f WriteMode mapM_ (\(x, y) -> hPutStrLn h (show x ++ "\t" ++ show y)) (zip [0, dt..] l) hClose h plot3sec fn = gnuplot fn . take (sr * 3) . unfold testcase list = do ts <- mapM timer list let ts' = map (\x -> 1 / fromIntegral x) ts let x = minimum ts' let ns = map (/x) ts' sequence_ [ putStr (show (fromIntegral (floor (x * 100)) / 100) ++ "\t") | x <- ns ] putStrLn "\n" main = do let n = 1000000 putStrLn "Compare exp singal function" testcase [nth n S.exp, nth n exp, expNorm n, expOpt n] putStrLn "Compare sine singal function" testcase [nth n (S.sine 2), nth n (sine 2), sineNorm n, sineOpt n] putStrLn "Compare oscSine singal function" testcase [nth n (S.testOsc S.oscSine), nth n (testOsc oscSine), oscNorm n, oscOpt n] putStrLn "Compare sciFi singal function" testcase [nth n S.sciFi, nth n sciFi, sciFiNorm n, sciFiOpt n] putStrLn "Compare robot singal function" testcase [nth n (S.testRobot S.robot), nth n (testRobot robot), robotNorm n, robotOpt n] expNorm n = nth n $(norm exp) expOpt n = nth' n $(normOpt exp) sineNorm n = nth n $(norm $ sine 2) sineOpt n = nth' n $(normOpt $ sine 2) oscNorm n = nth n $(norm $ testOsc oscSine) oscOpt n = nth' n $(normOpt $ testOsc oscSine) sciFiNorm n = nth n $(norm sciFi) sciFiOpt n = nth' n $(normOpt sciFi) robotNorm n = nth n $(norm $ testRobot robot) robotOpt n = nth' n $(normOpt $ testRobot robot)
santolucito/Euterpea_Projects
CCA_main_tests.hs
mit
3,856
2
22
1,227
2,087
1,061
1,026
102
2
module Data.String.Utils where rtrim :: String -> String -> String rtrim chars inp = rtrim' inp where rtrim' "" = [] rtrim' [x] = if x `elem` chars then [] else [x] rtrim' (x:xs) = let tail = rtrim' xs in case tail of [] -> if x `elem` chars then [] else [x] xs -> x : tail ltrim :: String -> String -> String ltrim chars = ltrim' where ltrim' s = case s of [] -> [] (x:xs) -> if x `elem` chars then ltrim' xs else s
spockz/lhs2texhl
src/Data/String/Utils.hs
mit
658
0
13
332
220
119
101
16
6
{-# LANGUAGE CPP, GADTs, ScopedTypeVariables, ImpredicativeTypes, OverloadedStrings #-} module Compiler.GhcjsHooks where import Prelude import CorePrep (corePrepPgm) import CoreToStg (coreToStg) import DriverPipeline import DriverPhases import DynFlags import Outputable import GHC import GhcMonad import Hooks import Panic import qualified SysTools import SimplStg (stg2stg) import HeaderInfo import HscTypes import Maybes (expectJust) import MkIface import PipelineMonad import HscMain import Control.Concurrent.MVar import Control.Monad import qualified Data.ByteString as B import qualified Data.Map as M import qualified Data.Set as S import System.Directory (copyFile, createDirectoryIfMissing) import System.FilePath import Compiler.Settings import qualified Compiler.Utils as Utils import Compiler.Variants import qualified Compiler.Plugins as Plugins import qualified Gen2.DynamicLinking as Gen2 import qualified Gen2.Foreign as Gen2 import qualified Gen2.TH as Gen2TH import System.IO.Error import qualified GHC.LanguageExtensions as Ext installGhcjsHooks :: GhcjsEnv -> GhcjsSettings -> [FilePath] -- ^ JS objects -> DynFlags -> DynFlags installGhcjsHooks env settings js_objs dflags = Gen2.installForeignHooks True $ dflags { hooks = addHooks (hooks dflags) } where addHooks h = h { linkHook = Just (Gen2.ghcjsLink env settings js_objs True) , getValueSafelyHook = Just (Plugins.getValueSafely dflags env) , runMetaHook = Just (Gen2TH.ghcjsRunMeta env settings) } installNativeHooks :: GhcjsEnv -> GhcjsSettings -> DynFlags -> DynFlags installNativeHooks env settings dflags = Gen2.installForeignHooks False $ dflags { hooks = addHooks (hooks dflags) } where addHooks h = h { linkHook = Just (Gen2.ghcjsLink env settings [] False) } -------------------------------------------------- -- One shot replacement (the oneShot in DriverPipeline -- always uses the unhooked linker) ghcjsOneShot :: GhcjsEnv -> GhcjsSettings -> Bool -> HscEnv -> Phase -> [(String, Maybe Phase)] -> IO () ghcjsOneShot env settings native hsc_env stop_phase srcs = do o_files <- mapM (compileFile hsc_env stop_phase) srcs Gen2.ghcjsDoLink env settings native (hsc_dflags hsc_env) stop_phase o_files -------------------------------------------------- -- Driver hooks installDriverHooks :: GhcjsSettings -> GhcjsEnv -> DynFlags -> DynFlags installDriverHooks settings env df = df { hooks = hooks' } where hooks' = (hooks df) { runPhaseHook = Just (runGhcjsPhase settings env) } haveCpp :: DynFlags -> Bool haveCpp dflags = xopt Ext.Cpp dflags runGhcjsPhase :: GhcjsSettings -> GhcjsEnv -> PhasePlus -> FilePath -> DynFlags -> CompPipeline (PhasePlus, FilePath) runGhcjsPhase _settings _env (RealPhase (Cpp sf)) input_fn dflags0 = do src_opts <- liftIO $ getOptionsFromFile dflags0 input_fn (dflags1, unhandled_flags, warns) <- liftIO $ parseDynamicFilePragma dflags0 src_opts setDynFlags dflags1 liftIO $ checkProcessArgsResult dflags1 unhandled_flags if not (haveCpp dflags1) then do -- we have to be careful to emit warnings only once. unless (gopt Opt_Pp dflags1) $ liftIO $ handleFlagWarnings dflags1 warns -- no need to preprocess CPP, just pass input file along -- to the next phase of the pipeline. return (RealPhase (HsPp sf), input_fn) else do output_fn <- phaseOutputFilename (HsPp sf) liftIO $ Utils.doCpp dflags1 True{-raw-} {-True-} input_fn output_fn -- re-read the pragmas now that we've preprocessed the file -- See #2464,#3457 src_opts <- liftIO $ getOptionsFromFile dflags0 output_fn (dflags2, unhandled_flags, warns) <- liftIO $ parseDynamicFilePragma dflags0 src_opts liftIO $ checkProcessArgsResult dflags2 unhandled_flags unless (gopt Opt_Pp dflags2) $ liftIO $ handleFlagWarnings dflags2 warns -- the HsPp pass below will emit warnings setDynFlags dflags2 return (RealPhase (HsPp sf), output_fn) runGhcjsPhase settings env (HscOut src_flavour mod_name result) _ dflags = do location <- getLocation src_flavour mod_name setModLocation location let o_file = ml_obj_file location -- The real object file hsc_lang = hscTarget dflags next_phase = hscPostBackendPhase {-dflags-} src_flavour hsc_lang case result of HscNotGeneratingCode _ -> return (RealPhase next_phase, panic "No output filename from Hsc when no-code") HscUpToDate _ -> do liftIO $ touchObjectFile dflags o_file -- The .o file must have a later modification date -- than the source file (else we wouldn't get Nothing) -- but we touch it anyway, to keep 'make' happy (we think). return (RealPhase StopLn, o_file) HscUpdateBoot _ -> do -- In the case of hs-boot files, generate a dummy .o-boot -- stamp file for the benefit of Make liftIO $ touchObjectFile dflags o_file return (RealPhase next_phase, o_file) HscUpdateSig _ -> do -- We need to create a REAL but empty .o file -- because we are going to attempt to put it in a library {- PipeState{hsc_env=hsc_env'} <- getPipeState let input_fn = expectJust "runPhase" (ml_hs_file location) basename = dropExtension input_fn -} -- fixme do we need to create a js_o file here? -- liftIO $ compileEmptyStub dflags hsc_env' basename location return (RealPhase next_phase, o_file) HscRecomp { hscs_guts = cgguts, hscs_mod_location = mod_location, hscs_partial_iface = partial_iface, hscs_old_iface_hash = mb_old_iface_hash, hscs_iface_dflags = iface_dflags } -> do output_fn <- phaseOutputFilename next_phase PipeState{hsc_env=hsc_env'} <- getPipeState outputFilename <- liftIO $ ghcjsWriteModule settings env hsc_env' cgguts (mi_module partial_iface) mod_location output_fn final_iface <- liftIO (mkFullIface hsc_env'{hsc_dflags=iface_dflags} partial_iface) setIface final_iface -- See Note [Writing interface files] let if_dflags = dflags `gopt_unset` Opt_BuildDynamicToo liftIO $ hscMaybeWriteIface if_dflags final_iface mb_old_iface_hash mod_location {- stub_o <- liftIO (mapM (compileStub hsc_env') mStub) foreign_os <- liftIO $ mapM (uncurry (compileForeign hsc_env')) foreign_files setForeignOs (maybe [] return stub_o ++ foreign_os) -} return (RealPhase next_phase, outputFilename) -- skip these, but copy the result runGhcjsPhase _ _ (RealPhase ph) input _dflags | Just next <- lookup ph skipPhases = do output <- phaseOutputFilename next liftIO $ (createDirectoryIfMissing True (takeDirectory output) >> copyFile input output) `catchIOError` \_ -> return () return (RealPhase next, output) where skipPhases = [ (HCc, As False) , (CmmCpp, Cmm) , (Cmm, As False) , (Cmm, As True) , (As False, StopLn) , (As True, StopLn) ] -- otherwise use default runGhcjsPhase _ _ p input dflags = runPhase p input dflags touchObjectFile :: DynFlags -> FilePath -> IO () touchObjectFile dflags path = do createDirectoryIfMissing True $ takeDirectory path SysTools.touch dflags "Touching object file" path ghcjsWriteModule :: GhcjsSettings -> GhcjsEnv -> HscEnv -- ^ Environment in which to compile the module -> CgGuts -> Module -> ModLocation -> FilePath -- ^ Output path -> IO FilePath ghcjsWriteModule settings jsEnv env core mod mod_location output = do b <- ghcjsCompileModule settings jsEnv env core mod mod_location createDirectoryIfMissing True (takeDirectory output) Utils.writeBinaryFile output b return output ghcjsCompileModule :: GhcjsSettings -> GhcjsEnv -> HscEnv -- ^ Environment in which to compile the module -> CgGuts -> Module -> ModLocation -> IO B.ByteString -- dynamic-too will invoke this twice, cache results in GhcjsEnv ghcjsCompileModule settings jsEnv env core mod' mod_location = ifGeneratingDynamicToo dflags genDynToo genOther where genDynToo = do result <- compile modifyMVar_ cms (return . M.insert mod' result) return result genOther = join $ modifyMVar cms $ \m -> case M.lookup mod' m of Nothing -> return (m, compile) Just r -> return (M.delete mod' m, return r) cms = compiledModules jsEnv dflags = hsc_dflags env compile = do (prepd_binds, local_ccs) <- corePrepPgm env mod' mod_location (cg_binds core) (cg_tycons core) let (stg, (caf_ccs, caf_cc_stacks)) = coreToStg dflags mod' prepd_binds stg' <- stg2stg env mod' stg let cost_centre_info = (S.toList local_ccs ++ caf_ccs, caf_cc_stacks) return $ variantRender gen2Variant settings dflags mod' stg' (cg_spt_entries core) (cg_foreign core) cost_centre_info
ghcjs/ghcjs
src/Compiler/GhcjsHooks.hs
mit
11,124
0
17
4,079
2,077
1,071
1,006
201
6
{-# LANGUAGE CPP #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE RecordWildCards #-} module Eurocode5.Wood.WoodCommon where data WoodCat = SoftWood | HardWood | PVeneer deriving (Eq,Show) data Wood = Wood { t :: Double, -- ^ Thickness [mm] rho :: Double, -- ^ Karakteristisk densitet [kg/m3] wcat :: WoodCat } deriving Show woodOf :: String -> Double -> Wood woodOf "gran" tx = Wood tx 430 SoftWood woodOf "furu" tx = Wood tx 490 SoftWood woodOf "bjork" tx = Wood tx 580 SoftWood woodOf "eik" tx = Wood tx 650 HardWood woodOf "lind" tx = Wood tx 350 SoftWood
baalbek/eurocode5
src/Eurocode5/Wood/WoodCommon.hs
gpl-2.0
606
0
8
144
164
90
74
17
1
{-# LANGUAGE TemplateHaskell #-} module Machine.Acceptor.Type2 where -- $Id$ import Language.Sampler import Autolib.Informed import Autolib.ToDoc import Autolib.Reader import qualified Autolib.Reporter.Checker as C import Autolib.Reporter hiding ( output ) import Machine.Class import Inter.Types ( ScoringOrder (..) , OrderScore (..) ) import Data.Typeable data Acceptor = Acceptor String -- include machine type ?? deriving Typeable instance OrderScore Acceptor where scoringOrder _ = Increasing instance ToDoc Acceptor where toDoc ( Acceptor kind ) = text $ "Acceptor-" ++ kind instance Reader Acceptor where reader = do my_reserved "Acceptor" Autolib.Reader.char '-' cs <- many alphaNum return $ Acceptor cs class ( Reader [dat], ToDoc [dat], Reader [prop], ToDoc [prop] ) => Class dat prop instance ( Reader [dat], ToDoc [dat], Reader [prop] , ToDoc [prop] ) => Class dat prop data Class dat prop => Type m dat prop = Make { machine_desc :: String , source :: Sampler , cut :: Int -- ^ höchstens soviele schritte , properties :: [ prop ] -- ^ sonstige Bedingungen an Maschine , start :: m -- ^ damit soll der student anfangen } deriving ( Typeable ) $(derives [makeReader, makeToDoc] [''Type]) -- local variables: -- mode: haskell -- end:
florianpilz/autotool
src/Machine/Acceptor/Type2.hs
gpl-2.0
1,375
2
9
324
375
214
161
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_HADDOCK show-extensions #-} -- | -- Module : Yi.Mode.Interactive -- License : GPL-2 -- Maintainer : [email protected] -- Stability : experimental -- Portability : portable -- -- Collection of 'Mode's for working with Haskell. module Yi.Mode.Interactive where import Control.Applicative import Control.Concurrent (threadDelay) import Control.Lens import Data.Monoid import qualified Data.Text as T import Yi.Buffer import Yi.Core (sendToProcess, startSubprocess, withSyntax) import Yi.Editor import Yi.History import Yi.Keymap import Yi.Keymap.Keys import Yi.Lexer.Alex (Tok) import Yi.Lexer.Compilation (Token) import qualified Yi.Mode.Compilation as Compilation import Yi.Modes import Yi.Monad import qualified Yi.Rope as R import qualified Yi.Syntax.OnlineTree as OnlineTree import Yi.Utils mode :: Mode (OnlineTree.Tree (Tok Token)) mode = Compilation.mode { modeApplies = modeNeverApplies, modeName = "interactive", modeKeymap = topKeymapA %~ (<||) (choice [spec KHome ?>>! moveToSol, spec KEnter ?>>! do eof <- withCurrentBuffer atLastLine if eof then feedCommand else withSyntax modeFollow, meta (char 'p') ?>>! interactHistoryMove 1, meta (char 'n') ?>>! interactHistoryMove (-1) ]) } interactId :: T.Text interactId = "Interact" -- | TODO: we're just converting back and forth here, 'historyMoveGen' -- and friends need to migrate to YiString it seems. interactHistoryMove :: Int -> EditorM () interactHistoryMove delta = historyMoveGen interactId delta (R.toText <$> withCurrentBuffer getInput) >>= inp where inp = withCurrentBuffer . setInput . R.fromText interactHistoryFinish :: EditorM () interactHistoryFinish = historyFinishGen interactId (R.toText <$> withCurrentBuffer getInput) interactHistoryStart :: EditorM () interactHistoryStart = historyStartGen interactId getInputRegion :: BufferM Region getInputRegion = do mo <- getMarkB (Just "StdOUT") p <- pointAt botB q <- use $ markPointA mo return $ mkRegion p q getInput :: BufferM R.YiString getInput = readRegionB =<< getInputRegion setInput :: R.YiString -> BufferM () setInput val = flip replaceRegionB val =<< getInputRegion -- | Open a new buffer for interaction with a process. spawnProcess :: String -> [String] -> YiM BufferRef spawnProcess = spawnProcessMode mode -- | open a new buffer for interaction with a process, using any -- interactive-derived mode spawnProcessMode :: Mode syntax -> FilePath -> [String] -> YiM BufferRef spawnProcessMode interMode cmd args = do b <- startSubprocess cmd args (const $ return ()) withEditor interactHistoryStart mode' <- lookupMode $ AnyMode interMode withCurrentBuffer $ do m1 <- getMarkB (Just "StdERR") m2 <- getMarkB (Just "StdOUT") modifyMarkB m1 (\v -> v {markGravity = Backward}) modifyMarkB m2 (\v -> v {markGravity = Backward}) setAnyMode mode' return b -- | Send the type command to the process feedCommand :: YiM () feedCommand = do b <- gets currentBuffer withEditor interactHistoryFinish cmd <- withCurrentBuffer $ do botB newlineB me <- getMarkB (Just "StdERR") mo <- getMarkB (Just "StdOUT") p <- pointB q <- use $ markPointA mo cmd <- readRegionB $ mkRegion p q markPointA me .= p markPointA mo .= p return $ R.toString cmd withEditor interactHistoryStart sendToProcess b cmd -- | Send command, recieve reply queryReply :: BufferRef -> String -> YiM R.YiString queryReply buf cmd = do start <- withGivenBuffer buf (botB >> pointB) sendToProcess buf (cmd <> "\n") io $ threadDelay 50000 -- Hack to let ghci finish writing its output. withGivenBuffer buf $ do botB moveToSol leftB -- There is probably a much better way to do this moving around, but it works end <- pointB result <- readRegionB (mkRegion start end) botB return result
atsukotakahashi/wi
src/library/Yi/Mode/Interactive.hs
gpl-2.0
4,261
0
16
1,071
1,054
534
520
100
2
{-# LANGUAGE BangPatterns #-} module CN2D where import Data.Array.Base import CNTypes import CNBase import Coupling import ValueMatrix import Tridiag -- import Vector import Data.Complex import Control.Applicative import Control.Arrow import Control.DeepSeq.Generics sndDiffKarthDx,sndDiffKarthDy :: (RealFloat a) => a -> Wave2D a -> Wave2D a sndDiffKarthDy dy wave = fmap (/(dy:+0)**2) $ fromRows $! (diff' -*) <$> rows wave where diff' = diffMtx $ snd $ ValueMatrix.dim wave -- sndDiffKarthDx dx = transpose . sndDiffKarthDx dx . transpose sndDiffKarthDx dx wave = fmap (/(dx:+0)**2) $ fromCols $! (diff' -*) <$> cols wave where diff' = diffMtx $ fst $ ValueMatrix.dim wave cn2DkinStepX,cn2DkinStepY :: (RealFloat a) => System2D a -> a -> a -> Wave2D a -> Wave2D a cn2DkinStepY sys dy dt wave = fromRows $ applKin <$> rows wave where i = 0:+1 hbar_c = hbar :+ 0 m_c = sys2DMass sys :+ 0 dy_c = dy :+ 0 dt_c = dt :+ 0 ((x0,_),(xe,_)) = sys2DInterval sys int = (x0,xe) n = waveEntries int dy dmtx = diffMtx n mmtx = idMx n + ((1/12) .** dmtx) applKin !w' = solve lmx b where b = (mmtx -* w') + (lmx' -* w') lmx' = (i*dt_c*hbar_c/(4*m_c*dy_c**2)) .** dmtx lmx = mmtx - lmx' cn2DkinStepX sys dx dt = transpose . cn2DkinStepY sys dx dt . transpose cn2D' :: (RealFloat a,NFData a) => Int -> System2D a -> (a,a) -> a -> Coupling2D a -> Wave2D a -> Waveset2D a cn2D' subdiv sys dr@(dx,dy) dt' coupl wave0 = Waveset2D (iterate nts wave0) dr dt' r0 where n = 2^subdiv dt = dt'/fromIntegral n (r0,_) = sys2DInterval sys timestep' p' = applyHPot p' . applyKin . applyHPot p' nts w = iterate timestep w !! n -- -- predictor CN avg -- timestep w = timestep' p' w -- where p' = 0.5 .* (timestep' w w + w) -- no predictor timestep w = deepseq w (timestep' w w) applyKin = cn2DkinStepY sys dy dt . cn2DkinStepX sys dx dt applyHPot = cn2DhpotStep sys dr dt coupl effPot2D :: (RealFloat a) => System2D a -> ( (a,a) -> Wavepoint a -> a ) -> (a,a) -> Wavepoint a -> a effPot2D system coupl r phi = sys2DPotential system r + sys2DCoupling system * coupl r phi cn2DhpotStep :: (RealFloat a) => System2D a -> (a,a) -> a -> Coupling2D a -> Wave2D a -> Wave2D a -> Wave2D a cn2DhpotStep sys (dx,dy) dt coupl wave_p wave = VM $ array (bounds $ vmat wave) res where vals = assocs $ vmat wave_p pot = effPot2D sys coupl drain = sys2DDrain sys vals' = map (uncurry (cn2DapplyHalfPot drain pot dt) . first mkR) vals ((x0,y0),_) = sys2DInterval sys mkR (i,j) = (x0+fromIntegral i*dx,y0+fromIntegral j*dy) res = zipWith (\x (i,y) -> (i,x*y)) vals' $ assocs $ vmat wave cn2DapplyHalfPot :: (RealFloat a) => a -> ((a,a) -> Wavepoint a -> a) -> a -> (a,a) -> Wavepoint a -> Wavepoint a cn2DapplyHalfPot drain pot dt r phi = exp(-dt_c/2 * (i * v / hbar_c + 1/(drain:+0))) where v = pot r phi :+ 0 i = 0:+1 hbar_c = hbar :+ 0 dt_c = dt :+ 0 renderWave2D :: (RealFloat a) => Interval2D a -> (a,a) -> ((a,a) -> Wavepoint a) -> Wave2D a renderWave2D (r0,re) (dx,dy) wave0 = VM $ array ((1,1),(nx,ny)) vals where xint = (fst r0,fst re) yint = (snd r0,snd re) nx = waveEntries xint dx ny = waveEntries yint dy ns = [(mx',my') | mx' <- [1..nx],my' <- [1..ny]] vals = map (\i@(mx',my') -> (i,wave0 (fst r0 + fromIntegral (mx'-1)*dx,snd r0 + fromIntegral (my'-1)*dy))) ns cn2D :: (RealFloat a,NFData a) => Int -> System2D a -> (a,a) -> a -> ((a,a) -> Wavepoint a) -> Waveset2D a cn2D subdiv system dr dt wave0 = cn2D' subdiv system dr dt coupl2DKarth wave0' where int = sys2DInterval system wave0' = renderWave2D int dr wave0
KiNaudiz/bachelor
CN/CN2D.hs
gpl-3.0
4,482
0
17
1,644
1,715
905
810
97
1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE TemplateHaskell #-} module RenderGL where import qualified Language.Haskell.TH.Lift as THL import Instances.TH.Lift () import Foreign.C.Types (CFloat, CDouble) import Prelude hiding (sequence) import Data.Word import Control.Arrow import Control.Monad (replicateM) import Data.List import Data.Map (Map, (!)) import qualified Data.Map as Map import Linear import Linear.V3 phi :: Floating a => a phi = (1 + sqrt 5) / 2 silverRatio :: Floating a => a silverRatio = recip phi icosahedronTriangleArea :: Floating a => a icosahedronTriangleArea = sqrt 3 THL.deriveLiftMany [''CFloat, ''CDouble, ''Linear.V3.V3] {- (0, ±1, ±φ) (±1, ±φ, 0) (±φ, 0, ±1) -} icosahedron :: (Eq a, Floating a) => [V3 a] icosahedron = $( [| let b i = [ i, negate i ]; pm (V3 x y z) = sequenceA $ V3 (b x) (b y) (b z) in nub . concatMap pm $ [ V3 0 1 phi, V3 1 phi 0, V3 phi 0 1 ] |] ) triangleArea :: (Floating a) => [V3 a] -> a triangleArea (a:b:c:_) = let ab = b - a ac = c - a in 0.5 * norm (ab `cross` ac) triangleArea _ = undefined primitiveEquals :: Eq a => [a] -> [a] -> Bool a `primitiveEquals` b = $( [| a `elem` permutations b |] ) -- 'Golden Values': 1.902113032590307 1.7320508075688772 4.534567884457024 icosahedronTriangles :: (Eq a, Floating a) => [V3 a] icosahedronTriangles = $( [| concat . filter (\x -> triangleArea x == icosahedronTriangleArea) . nubBy primitiveEquals . replicateM 3 $ icosahedron |] ) makeIndices :: forall a i. (Ord a, Bounded i, Enum i) => [a] -> ([i], [a]) makeIndices = second (map fst . Map.toList) . discard3 . foldl reduce ([], Map.empty, minBound) where discard3 (a, b, _) = (a, b) reduce :: ([i], Map a i, i) -> a -> ([i], Map a i, i) reduce (indices, m, nextidx) v = if v `Map.member` m then let i = m ! v in (i : indices, m, nextidx) else (nextidx : indices, Map.insert v nextidx m, succ nextidx) icosahedronIndices :: (Eq a, Floating a, Ord a) => ([Word32], [V3 a]) icosahedronIndices = $( [| makeIndices icosahedronTriangles |] )
hesiod/xenocrat
src/exec/RenderGL.hs
gpl-3.0
2,226
0
12
571
730
418
312
-1
-1
{-# LANGUAGE FlexibleContexts #-} module Homework where import Control.Monad.Except data ListIndexError = ErrTooLargeIndex Int | ErrNegativeIndex | OtherErr String deriving (Eq, Show) infixl 9 !!! (!!!) :: (MonadError ListIndexError m) => [a] -> Int -> m a xs !!! n | n < 0 = throwError ErrNegativeIndex | otherwise = helper xs n n where helper [] idx orig = throwError $ ErrTooLargeIndex orig helper (x:xs) idx orig | idx == 0 = return x | otherwise = helper xs (idx - 1) orig
ItsLastDay/academic_university_2016-2018
subjects/Haskell/11/homework.hs
gpl-3.0
537
0
10
143
194
99
95
15
2
{- CC_Clones - Classic games reimplemented © Callum Lowcay 2006-2011 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. -} module Common.Util where import Control.Monad.State import Data.Array import Data.Char import System.Random -- Run a function several times times :: Int -> (a -> a) -> (a -> a) times 0 _ = undefined times 1 f = f times i f = f.(times (i - 1) f) -- Trim whitespace from a string trim :: String -> String trim = reverse.dropWhile isSpace.reverse.dropWhile isSpace -- Concatenate two arrays arrayCat :: Array Int a -> Array Int a -> Array Int a arrayCat x y = array (0, cx + cy) (xl ++ map (\(i, e) -> (i + cx, e)) yl) where xl = assocs x yl = assocs y cx = length xl cy = length yl -- Select the odd elements of a list oddElems :: [a] -> [a] oddElems [] = [] oddElems [x] = [x] oddElems (x:_:rest) = x : oddElems rest -- Select the even elements of a list evenElems :: [a] -> [a] evenElems [] = [] evenElems [_] = [] evenElems (_:y:rest) = y : evenElems rest -- Return a sliding window of length n over a list slidingWindow :: Int -> [a] -> [[a]] slidingWindow n xs | length window < n = [] | otherwise = window : slidingWindow n (tail xs) where window = take n xs -- Compute a random permutation of a list permutation :: RandomGen r => [a] -> State r [a] permutation [] = return [] permutation [x] = return [x] permutation xs = do gen <- get let (i, gen1) = randomR (0, length xs - 1) gen let (x, xs') = pickOut i xs put gen1 rest <- permutation xs' return (x:rest) where pickOut i xs = let (l1, l2h:l2t) = splitAt i xs in (l2h, l1 ++ l2t)
CLowcay/CC_Clones
src/Common/Util.hs
gpl-3.0
2,158
3
13
442
684
356
328
42
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Resource.Classroom.Courses.Teachers.Get -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <[email protected]> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Returns a teacher of a course. This method returns the following error -- codes: * \`PERMISSION_DENIED\` if the requesting user is not permitted -- to view teachers of this course or for access errors. * \`NOT_FOUND\` if -- no teacher of this course has the requested ID or if the course does not -- exist. -- -- /See:/ <https://developers.google.com/classroom/ Google Classroom API Reference> for @classroom.courses.teachers.get@. module Network.Google.Resource.Classroom.Courses.Teachers.Get ( -- * REST Resource CoursesTeachersGetResource -- * Creating a Request , coursesTeachersGet , CoursesTeachersGet -- * Request Lenses , ctgXgafv , ctgUploadProtocol , ctgPp , ctgCourseId , ctgAccessToken , ctgUploadType , ctgUserId , ctgBearerToken , ctgCallback ) where import Network.Google.Classroom.Types import Network.Google.Prelude -- | A resource alias for @classroom.courses.teachers.get@ method which the -- 'CoursesTeachersGet' request conforms to. type CoursesTeachersGetResource = "v1" :> "courses" :> Capture "courseId" Text :> "teachers" :> Capture "userId" Text :> QueryParam "$.xgafv" Text :> QueryParam "upload_protocol" Text :> QueryParam "pp" Bool :> QueryParam "access_token" Text :> QueryParam "uploadType" Text :> QueryParam "bearer_token" Text :> QueryParam "callback" Text :> QueryParam "alt" AltJSON :> Get '[JSON] Teacher -- | Returns a teacher of a course. This method returns the following error -- codes: * \`PERMISSION_DENIED\` if the requesting user is not permitted -- to view teachers of this course or for access errors. * \`NOT_FOUND\` if -- no teacher of this course has the requested ID or if the course does not -- exist. -- -- /See:/ 'coursesTeachersGet' smart constructor. data CoursesTeachersGet = CoursesTeachersGet' { _ctgXgafv :: !(Maybe Text) , _ctgUploadProtocol :: !(Maybe Text) , _ctgPp :: !Bool , _ctgCourseId :: !Text , _ctgAccessToken :: !(Maybe Text) , _ctgUploadType :: !(Maybe Text) , _ctgUserId :: !Text , _ctgBearerToken :: !(Maybe Text) , _ctgCallback :: !(Maybe Text) } deriving (Eq,Show,Data,Typeable,Generic) -- | Creates a value of 'CoursesTeachersGet' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'ctgXgafv' -- -- * 'ctgUploadProtocol' -- -- * 'ctgPp' -- -- * 'ctgCourseId' -- -- * 'ctgAccessToken' -- -- * 'ctgUploadType' -- -- * 'ctgUserId' -- -- * 'ctgBearerToken' -- -- * 'ctgCallback' coursesTeachersGet :: Text -- ^ 'ctgCourseId' -> Text -- ^ 'ctgUserId' -> CoursesTeachersGet coursesTeachersGet pCtgCourseId_ pCtgUserId_ = CoursesTeachersGet' { _ctgXgafv = Nothing , _ctgUploadProtocol = Nothing , _ctgPp = True , _ctgCourseId = pCtgCourseId_ , _ctgAccessToken = Nothing , _ctgUploadType = Nothing , _ctgUserId = pCtgUserId_ , _ctgBearerToken = Nothing , _ctgCallback = Nothing } -- | V1 error format. ctgXgafv :: Lens' CoursesTeachersGet (Maybe Text) ctgXgafv = lens _ctgXgafv (\ s a -> s{_ctgXgafv = a}) -- | Upload protocol for media (e.g. \"raw\", \"multipart\"). ctgUploadProtocol :: Lens' CoursesTeachersGet (Maybe Text) ctgUploadProtocol = lens _ctgUploadProtocol (\ s a -> s{_ctgUploadProtocol = a}) -- | Pretty-print response. ctgPp :: Lens' CoursesTeachersGet Bool ctgPp = lens _ctgPp (\ s a -> s{_ctgPp = a}) -- | Identifier of the course. This identifier can be either the -- Classroom-assigned identifier or an alias. ctgCourseId :: Lens' CoursesTeachersGet Text ctgCourseId = lens _ctgCourseId (\ s a -> s{_ctgCourseId = a}) -- | OAuth access token. ctgAccessToken :: Lens' CoursesTeachersGet (Maybe Text) ctgAccessToken = lens _ctgAccessToken (\ s a -> s{_ctgAccessToken = a}) -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). ctgUploadType :: Lens' CoursesTeachersGet (Maybe Text) ctgUploadType = lens _ctgUploadType (\ s a -> s{_ctgUploadType = a}) -- | Identifier of the teacher to return. The identifier can be one of the -- following: * the numeric identifier for the user * the email address of -- the user * the string literal \`\"me\"\`, indicating the requesting user ctgUserId :: Lens' CoursesTeachersGet Text ctgUserId = lens _ctgUserId (\ s a -> s{_ctgUserId = a}) -- | OAuth bearer token. ctgBearerToken :: Lens' CoursesTeachersGet (Maybe Text) ctgBearerToken = lens _ctgBearerToken (\ s a -> s{_ctgBearerToken = a}) -- | JSONP ctgCallback :: Lens' CoursesTeachersGet (Maybe Text) ctgCallback = lens _ctgCallback (\ s a -> s{_ctgCallback = a}) instance GoogleRequest CoursesTeachersGet where type Rs CoursesTeachersGet = Teacher type Scopes CoursesTeachersGet = '["https://www.googleapis.com/auth/classroom.profile.emails", "https://www.googleapis.com/auth/classroom.profile.photos", "https://www.googleapis.com/auth/classroom.rosters", "https://www.googleapis.com/auth/classroom.rosters.readonly"] requestClient CoursesTeachersGet'{..} = go _ctgCourseId _ctgUserId _ctgXgafv _ctgUploadProtocol (Just _ctgPp) _ctgAccessToken _ctgUploadType _ctgBearerToken _ctgCallback (Just AltJSON) classroomService where go = buildClient (Proxy :: Proxy CoursesTeachersGetResource) mempty
rueshyna/gogol
gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/Teachers/Get.hs
mpl-2.0
6,643
0
20
1,633
952
557
395
136
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Resource.DFAReporting.AdvertiserGroups.Delete -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <[email protected]> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Deletes an existing advertiser group. -- -- /See:/ <https://developers.google.com/doubleclick-advertisers/ DCM/DFA Reporting And Trafficking API Reference> for @dfareporting.advertiserGroups.delete@. module Network.Google.Resource.DFAReporting.AdvertiserGroups.Delete ( -- * REST Resource AdvertiserGroupsDeleteResource -- * Creating a Request , advertiserGroupsDelete , AdvertiserGroupsDelete -- * Request Lenses , agdProFileId , agdId ) where import Network.Google.DFAReporting.Types import Network.Google.Prelude -- | A resource alias for @dfareporting.advertiserGroups.delete@ method which the -- 'AdvertiserGroupsDelete' request conforms to. type AdvertiserGroupsDeleteResource = "dfareporting" :> "v2.7" :> "userprofiles" :> Capture "profileId" (Textual Int64) :> "advertiserGroups" :> Capture "id" (Textual Int64) :> QueryParam "alt" AltJSON :> Delete '[JSON] () -- | Deletes an existing advertiser group. -- -- /See:/ 'advertiserGroupsDelete' smart constructor. data AdvertiserGroupsDelete = AdvertiserGroupsDelete' { _agdProFileId :: !(Textual Int64) , _agdId :: !(Textual Int64) } deriving (Eq,Show,Data,Typeable,Generic) -- | Creates a value of 'AdvertiserGroupsDelete' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'agdProFileId' -- -- * 'agdId' advertiserGroupsDelete :: Int64 -- ^ 'agdProFileId' -> Int64 -- ^ 'agdId' -> AdvertiserGroupsDelete advertiserGroupsDelete pAgdProFileId_ pAgdId_ = AdvertiserGroupsDelete' { _agdProFileId = _Coerce # pAgdProFileId_ , _agdId = _Coerce # pAgdId_ } -- | User profile ID associated with this request. agdProFileId :: Lens' AdvertiserGroupsDelete Int64 agdProFileId = lens _agdProFileId (\ s a -> s{_agdProFileId = a}) . _Coerce -- | Advertiser group ID. agdId :: Lens' AdvertiserGroupsDelete Int64 agdId = lens _agdId (\ s a -> s{_agdId = a}) . _Coerce instance GoogleRequest AdvertiserGroupsDelete where type Rs AdvertiserGroupsDelete = () type Scopes AdvertiserGroupsDelete = '["https://www.googleapis.com/auth/dfatrafficking"] requestClient AdvertiserGroupsDelete'{..} = go _agdProFileId _agdId (Just AltJSON) dFAReportingService where go = buildClient (Proxy :: Proxy AdvertiserGroupsDeleteResource) mempty
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/AdvertiserGroups/Delete.hs
mpl-2.0
3,375
0
14
752
425
251
174
63
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Network.AWS.IAM.DeleteUserPolicy -- Copyright : (c) 2013-2015 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <[email protected]> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Deletes the specified inline policy that is embedded in the specified -- user. -- -- A user can also have managed policies attached to it. To detach a -- managed policy from a user, use DetachUserPolicy. For more information -- about policies, refer to -- <http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html Managed Policies and Inline Policies> -- in the /Using IAM/ guide. -- -- /See:/ <http://docs.aws.amazon.com/IAM/latest/APIReference/API_DeleteUserPolicy.html AWS API Reference> for DeleteUserPolicy. module Network.AWS.IAM.DeleteUserPolicy ( -- * Creating a Request deleteUserPolicy , DeleteUserPolicy -- * Request Lenses , dupUserName , dupPolicyName -- * Destructuring the Response , deleteUserPolicyResponse , DeleteUserPolicyResponse ) where import Network.AWS.IAM.Types import Network.AWS.IAM.Types.Product import Network.AWS.Prelude import Network.AWS.Request import Network.AWS.Response -- | /See:/ 'deleteUserPolicy' smart constructor. data DeleteUserPolicy = DeleteUserPolicy' { _dupUserName :: !Text , _dupPolicyName :: !Text } deriving (Eq,Read,Show,Data,Typeable,Generic) -- | Creates a value of 'DeleteUserPolicy' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'dupUserName' -- -- * 'dupPolicyName' deleteUserPolicy :: Text -- ^ 'dupUserName' -> Text -- ^ 'dupPolicyName' -> DeleteUserPolicy deleteUserPolicy pUserName_ pPolicyName_ = DeleteUserPolicy' { _dupUserName = pUserName_ , _dupPolicyName = pPolicyName_ } -- | The name (friendly name, not ARN) identifying the user that the policy -- is embedded in. dupUserName :: Lens' DeleteUserPolicy Text dupUserName = lens _dupUserName (\ s a -> s{_dupUserName = a}); -- | The name identifying the policy document to delete. dupPolicyName :: Lens' DeleteUserPolicy Text dupPolicyName = lens _dupPolicyName (\ s a -> s{_dupPolicyName = a}); instance AWSRequest DeleteUserPolicy where type Rs DeleteUserPolicy = DeleteUserPolicyResponse request = postQuery iAM response = receiveNull DeleteUserPolicyResponse' instance ToHeaders DeleteUserPolicy where toHeaders = const mempty instance ToPath DeleteUserPolicy where toPath = const "/" instance ToQuery DeleteUserPolicy where toQuery DeleteUserPolicy'{..} = mconcat ["Action" =: ("DeleteUserPolicy" :: ByteString), "Version" =: ("2010-05-08" :: ByteString), "UserName" =: _dupUserName, "PolicyName" =: _dupPolicyName] -- | /See:/ 'deleteUserPolicyResponse' smart constructor. data DeleteUserPolicyResponse = DeleteUserPolicyResponse' deriving (Eq,Read,Show,Data,Typeable,Generic) -- | Creates a value of 'DeleteUserPolicyResponse' with the minimum fields required to make a request. -- deleteUserPolicyResponse :: DeleteUserPolicyResponse deleteUserPolicyResponse = DeleteUserPolicyResponse'
fmapfmapfmap/amazonka
amazonka-iam/gen/Network/AWS/IAM/DeleteUserPolicy.hs
mpl-2.0
3,776
0
9
738
446
273
173
62
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} -- | -- Module : Network.Google.AndroidEnterprise -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <[email protected]> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Manages the deployment of apps to Android for Work users. -- -- /See:/ <https://developers.google.com/android/work/play/emm-api Google Play EMM API Reference> module Network.Google.AndroidEnterprise ( -- * Service Configuration androidEnterpriseService -- * OAuth Scopes , androidEnterpriseScope -- * API Declaration , AndroidEnterpriseAPI -- * Resources -- ** androidenterprise.devices.get , module Network.Google.Resource.AndroidEnterprise.Devices.Get -- ** androidenterprise.devices.getState , module Network.Google.Resource.AndroidEnterprise.Devices.GetState -- ** androidenterprise.devices.list , module Network.Google.Resource.AndroidEnterprise.Devices.List -- ** androidenterprise.devices.setState , module Network.Google.Resource.AndroidEnterprise.Devices.SetState -- ** androidenterprise.enterprises.acknowledgeNotificationSet , module Network.Google.Resource.AndroidEnterprise.Enterprises.AcknowledgeNotificationSet -- ** androidenterprise.enterprises.completeSignup , module Network.Google.Resource.AndroidEnterprise.Enterprises.CompleteSignup -- ** androidenterprise.enterprises.createWebToken , module Network.Google.Resource.AndroidEnterprise.Enterprises.CreateWebToken -- ** androidenterprise.enterprises.delete , module Network.Google.Resource.AndroidEnterprise.Enterprises.Delete -- ** androidenterprise.enterprises.enroll , module Network.Google.Resource.AndroidEnterprise.Enterprises.Enroll -- ** androidenterprise.enterprises.generateSignupUrl , module Network.Google.Resource.AndroidEnterprise.Enterprises.GenerateSignupURL -- ** androidenterprise.enterprises.get , module Network.Google.Resource.AndroidEnterprise.Enterprises.Get -- ** androidenterprise.enterprises.getServiceAccount , module Network.Google.Resource.AndroidEnterprise.Enterprises.GetServiceAccount -- ** androidenterprise.enterprises.getStoreLayout , module Network.Google.Resource.AndroidEnterprise.Enterprises.GetStoreLayout -- ** androidenterprise.enterprises.insert , module Network.Google.Resource.AndroidEnterprise.Enterprises.Insert -- ** androidenterprise.enterprises.list , module Network.Google.Resource.AndroidEnterprise.Enterprises.List -- ** androidenterprise.enterprises.pullNotificationSet , module Network.Google.Resource.AndroidEnterprise.Enterprises.PullNotificationSet -- ** androidenterprise.enterprises.sendTestPushNotification , module Network.Google.Resource.AndroidEnterprise.Enterprises.SendTestPushNotification -- ** androidenterprise.enterprises.setAccount , module Network.Google.Resource.AndroidEnterprise.Enterprises.SetAccount -- ** androidenterprise.enterprises.setStoreLayout , module Network.Google.Resource.AndroidEnterprise.Enterprises.SetStoreLayout -- ** androidenterprise.enterprises.unenroll , module Network.Google.Resource.AndroidEnterprise.Enterprises.Unenroll -- ** androidenterprise.entitlements.delete , module Network.Google.Resource.AndroidEnterprise.Entitlements.Delete -- ** androidenterprise.entitlements.get , module Network.Google.Resource.AndroidEnterprise.Entitlements.Get -- ** androidenterprise.entitlements.list , module Network.Google.Resource.AndroidEnterprise.Entitlements.List -- ** androidenterprise.entitlements.patch , module Network.Google.Resource.AndroidEnterprise.Entitlements.Patch -- ** androidenterprise.entitlements.update , module Network.Google.Resource.AndroidEnterprise.Entitlements.Update -- ** androidenterprise.grouplicenses.get , module Network.Google.Resource.AndroidEnterprise.Grouplicenses.Get -- ** androidenterprise.grouplicenses.list , module Network.Google.Resource.AndroidEnterprise.Grouplicenses.List -- ** androidenterprise.grouplicenseusers.list , module Network.Google.Resource.AndroidEnterprise.GrouplicenseUsers.List -- ** androidenterprise.installs.delete , module Network.Google.Resource.AndroidEnterprise.Installs.Delete -- ** androidenterprise.installs.get , module Network.Google.Resource.AndroidEnterprise.Installs.Get -- ** androidenterprise.installs.list , module Network.Google.Resource.AndroidEnterprise.Installs.List -- ** androidenterprise.installs.patch , module Network.Google.Resource.AndroidEnterprise.Installs.Patch -- ** androidenterprise.installs.update , module Network.Google.Resource.AndroidEnterprise.Installs.Update -- ** androidenterprise.managedconfigurationsfordevice.delete , module Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforDevice.Delete -- ** androidenterprise.managedconfigurationsfordevice.get , module Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforDevice.Get -- ** androidenterprise.managedconfigurationsfordevice.list , module Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforDevice.List -- ** androidenterprise.managedconfigurationsfordevice.patch , module Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforDevice.Patch -- ** androidenterprise.managedconfigurationsfordevice.update , module Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforDevice.Update -- ** androidenterprise.managedconfigurationsforuser.delete , module Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforUser.Delete -- ** androidenterprise.managedconfigurationsforuser.get , module Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforUser.Get -- ** androidenterprise.managedconfigurationsforuser.list , module Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforUser.List -- ** androidenterprise.managedconfigurationsforuser.patch , module Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforUser.Patch -- ** androidenterprise.managedconfigurationsforuser.update , module Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforUser.Update -- ** androidenterprise.permissions.get , module Network.Google.Resource.AndroidEnterprise.Permissions.Get -- ** androidenterprise.products.approve , module Network.Google.Resource.AndroidEnterprise.Products.Approve -- ** androidenterprise.products.generateApprovalUrl , module Network.Google.Resource.AndroidEnterprise.Products.GenerateApprovalURL -- ** androidenterprise.products.get , module Network.Google.Resource.AndroidEnterprise.Products.Get -- ** androidenterprise.products.getAppRestrictionsSchema , module Network.Google.Resource.AndroidEnterprise.Products.GetAppRestrictionsSchema -- ** androidenterprise.products.getPermissions , module Network.Google.Resource.AndroidEnterprise.Products.GetPermissions -- ** androidenterprise.products.list , module Network.Google.Resource.AndroidEnterprise.Products.List -- ** androidenterprise.products.unapprove , module Network.Google.Resource.AndroidEnterprise.Products.UnApprove -- ** androidenterprise.serviceaccountkeys.delete , module Network.Google.Resource.AndroidEnterprise.ServiceAccountkeys.Delete -- ** androidenterprise.serviceaccountkeys.insert , module Network.Google.Resource.AndroidEnterprise.ServiceAccountkeys.Insert -- ** androidenterprise.serviceaccountkeys.list , module Network.Google.Resource.AndroidEnterprise.ServiceAccountkeys.List -- ** androidenterprise.storelayoutclusters.delete , module Network.Google.Resource.AndroidEnterprise.Storelayoutclusters.Delete -- ** androidenterprise.storelayoutclusters.get , module Network.Google.Resource.AndroidEnterprise.Storelayoutclusters.Get -- ** androidenterprise.storelayoutclusters.insert , module Network.Google.Resource.AndroidEnterprise.Storelayoutclusters.Insert -- ** androidenterprise.storelayoutclusters.list , module Network.Google.Resource.AndroidEnterprise.Storelayoutclusters.List -- ** androidenterprise.storelayoutclusters.patch , module Network.Google.Resource.AndroidEnterprise.Storelayoutclusters.Patch -- ** androidenterprise.storelayoutclusters.update , module Network.Google.Resource.AndroidEnterprise.Storelayoutclusters.Update -- ** androidenterprise.storelayoutpages.delete , module Network.Google.Resource.AndroidEnterprise.Storelayoutpages.Delete -- ** androidenterprise.storelayoutpages.get , module Network.Google.Resource.AndroidEnterprise.Storelayoutpages.Get -- ** androidenterprise.storelayoutpages.insert , module Network.Google.Resource.AndroidEnterprise.Storelayoutpages.Insert -- ** androidenterprise.storelayoutpages.list , module Network.Google.Resource.AndroidEnterprise.Storelayoutpages.List -- ** androidenterprise.storelayoutpages.patch , module Network.Google.Resource.AndroidEnterprise.Storelayoutpages.Patch -- ** androidenterprise.storelayoutpages.update , module Network.Google.Resource.AndroidEnterprise.Storelayoutpages.Update -- ** androidenterprise.users.delete , module Network.Google.Resource.AndroidEnterprise.Users.Delete -- ** androidenterprise.users.generateAuthenticationToken , module Network.Google.Resource.AndroidEnterprise.Users.GenerateAuthenticationToken -- ** androidenterprise.users.generateToken , module Network.Google.Resource.AndroidEnterprise.Users.GenerateToken -- ** androidenterprise.users.get , module Network.Google.Resource.AndroidEnterprise.Users.Get -- ** androidenterprise.users.getAvailableProductSet , module Network.Google.Resource.AndroidEnterprise.Users.GetAvailableProductSet -- ** androidenterprise.users.insert , module Network.Google.Resource.AndroidEnterprise.Users.Insert -- ** androidenterprise.users.list , module Network.Google.Resource.AndroidEnterprise.Users.List -- ** androidenterprise.users.patch , module Network.Google.Resource.AndroidEnterprise.Users.Patch -- ** androidenterprise.users.revokeToken , module Network.Google.Resource.AndroidEnterprise.Users.RevokeToken -- ** androidenterprise.users.setAvailableProductSet , module Network.Google.Resource.AndroidEnterprise.Users.SetAvailableProductSet -- ** androidenterprise.users.update , module Network.Google.Resource.AndroidEnterprise.Users.Update -- * Types -- ** GroupLicense , GroupLicense , groupLicense , glKind , glNumProvisioned , glNumPurchased , glApproval , glProductId , glAcquisitionKind -- ** StoreLayoutPagesListResponse , StoreLayoutPagesListResponse , storeLayoutPagesListResponse , slplrKind , slplrPage -- ** EnterpriseAccount , EnterpriseAccount , enterpriseAccount , eaKind , eaAccountEmail -- ** AppRestrictionsSchemaRestrictionRestrictionValue , AppRestrictionsSchemaRestrictionRestrictionValue , appRestrictionsSchemaRestrictionRestrictionValue , arsrrvValueMultiselect , arsrrvValueBool , arsrrvValueInteger , arsrrvType , arsrrvValueString -- ** DeviceState , DeviceState , deviceState , dsKind , dsAccountState -- ** GroupLicenseUsersListResponse , GroupLicenseUsersListResponse , groupLicenseUsersListResponse , glulrKind , glulrUser -- ** TokenPagination , TokenPagination , tokenPagination , tpNextPageToken , tpPreviousPageToken -- ** ApprovalURLInfo , ApprovalURLInfo , approvalURLInfo , auiApprovalURL , auiKind -- ** ManagedProperty , ManagedProperty , managedProperty , mpValueStringArray , mpValueBool , mpKey , mpValueBundle , mpValueInteger , mpValueBundleArray , mpValueString -- ** StoreLayoutClustersListResponse , StoreLayoutClustersListResponse , storeLayoutClustersListResponse , slclrCluster , slclrKind -- ** ManagedConfiguration , ManagedConfiguration , managedConfiguration , mcManagedProperty , mcKind , mcProductId -- ** StoreCluster , StoreCluster , storeCluster , scKind , scName , scOrderInPage , scId , scProductId -- ** AdministratorWebTokenSpec , AdministratorWebTokenSpec , administratorWebTokenSpec , awtsParent , awtsKind , awtsPermission -- ** Notification , Notification , notification , nEnterpriseId , nNewPermissionsEvent , nProductApprovalEvent , nProductAvailabilityChangeEvent , nAppUpdateEvent , nInstallFailureEvent , nAppRestrictionsSchemaChangeEvent , nNewDeviceEvent , nTimestampMillis -- ** PageInfo , PageInfo , pageInfo , piResultPerPage , piTotalResults , piStartIndex -- ** ProductPermission , ProductPermission , productPermission , ppState , ppPermissionId -- ** NewPermissionsEvent , NewPermissionsEvent , newPermissionsEvent , npeRequestedPermissions , npeApprovedPermissions , npeProductId -- ** ProductAvailabilityChangeEvent , ProductAvailabilityChangeEvent , productAvailabilityChangeEvent , paceAvailabilityStatus , paceProductId -- ** ProductApprovalEvent , ProductApprovalEvent , productApprovalEvent , paeApproved , paeProductId -- ** Device , Device , device , dKind , dManagementType , dAndroidId -- ** ServiceAccountKey , ServiceAccountKey , serviceAccountKey , sakKind , sakData , sakId , sakType , sakPublicData -- ** InstallsListResponse , InstallsListResponse , installsListResponse , ilrKind , ilrInstall -- ** AppRestrictionsSchemaRestriction , AppRestrictionsSchemaRestriction , appRestrictionsSchemaRestriction , arsrRestrictionType , arsrEntry , arsrKey , arsrEntryValue , arsrDefaultValue , arsrTitle , arsrDescription , arsrNestedRestriction -- ** Administrator , Administrator , administrator , aEmail -- ** UsersListResponse , UsersListResponse , usersListResponse , ulrKind , ulrUser -- ** AuthenticationToken , AuthenticationToken , authenticationToken , atKind , atToken -- ** AppVersion , AppVersion , appVersion , avVersionCode , avVersionString -- ** EnterprisesPullNotificationSetRequestMode , EnterprisesPullNotificationSetRequestMode (..) -- ** ManagedPropertyBundle , ManagedPropertyBundle , managedPropertyBundle , mpbManagedProperty -- ** GroupLicensesListResponse , GroupLicensesListResponse , groupLicensesListResponse , gllrGroupLicense , gllrKind -- ** ProductSet , ProductSet , productSet , psKind , psProductSetBehavior , psProductId -- ** Install , Install , install , iVersionCode , iKind , iInstallState , iProductId -- ** ServiceAccountKeysListResponse , ServiceAccountKeysListResponse , serviceAccountKeysListResponse , saklrServiceAccountKey -- ** User , User , user , uAccountIdentifier , uKind , uDisplayName , uId , uPrimaryEmail , uManagementType , uAccountType -- ** ManagedConfigurationsForDeviceListResponse , ManagedConfigurationsForDeviceListResponse , managedConfigurationsForDeviceListResponse , mcfdlrKind , mcfdlrManagedConfigurationForDevice -- ** ProductsGenerateApprovalURLResponse , ProductsGenerateApprovalURLResponse , productsGenerateApprovalURLResponse , pgaurURL -- ** StorePage , StorePage , storePage , spKind , spLink , spName , spId -- ** EnterprisesSendTestPushNotificationResponse , EnterprisesSendTestPushNotificationResponse , enterprisesSendTestPushNotificationResponse , estpnrTopicName , estpnrMessageId -- ** ServiceAccount , ServiceAccount , serviceAccount , saKind , saKey , saName -- ** AppUpdateEvent , AppUpdateEvent , appUpdateEvent , aueProductId -- ** EnterprisesListResponse , EnterprisesListResponse , enterprisesListResponse , elrKind , elrEnterprise -- ** NotificationSet , NotificationSet , notificationSet , nsNotificationSetId , nsNotification , nsKind -- ** AppRestrictionsSchema , AppRestrictionsSchema , appRestrictionsSchema , arsKind , arsRestrictions -- ** LocalizedText , LocalizedText , localizedText , ltText , ltLocale -- ** UserToken , UserToken , userToken , utKind , utToken , utUserId -- ** DevicesListResponse , DevicesListResponse , devicesListResponse , dlrKind , dlrDevice -- ** Enterprise , Enterprise , enterprise , eKind , eAdministrator , ePrimaryDomain , eName , eId -- ** InstallFailureEvent , InstallFailureEvent , installFailureEvent , ifeFailureReason , ifeFailureDetails , ifeUserId , ifeDeviceId , ifeProductId -- ** ManagedConfigurationsForUserListResponse , ManagedConfigurationsForUserListResponse , managedConfigurationsForUserListResponse , mcfulrManagedConfigurationForUser , mcfulrKind -- ** StoreLayout , StoreLayout , storeLayout , slStoreLayoutType , slKind , slHomepageId -- ** AppRestrictionsSchemaChangeEvent , AppRestrictionsSchemaChangeEvent , appRestrictionsSchemaChangeEvent , arsceProductId -- ** NewDeviceEvent , NewDeviceEvent , newDeviceEvent , ndeUserId , ndeDeviceId , ndeManagementType -- ** AdministratorWebToken , AdministratorWebToken , administratorWebToken , awtKind , awtToken -- ** SignupInfo , SignupInfo , signupInfo , siCompletionToken , siKind , siURL -- ** Product , Product , product , pSmallIconURL , pAuthorName , pKind , pWorkDetailsURL , pRequiresContainerApp , pAppVersion , pProductPricing , pDistributionChannel , pIconURL , pTitle , pProductId , pDetailsURL -- ** EntitlementsListResponse , EntitlementsListResponse , entitlementsListResponse , entKind , entEntitlement -- ** EnterprisesGetServiceAccountKeyType , EnterprisesGetServiceAccountKeyType (..) -- ** ProductPermissions , ProductPermissions , productPermissions , ppKind , ppPermission , ppProductId -- ** Permission , Permission , permission , perKind , perName , perDescription , perPermissionId -- ** ProductsApproveRequest , ProductsApproveRequest , productsApproveRequest , parApprovalURLInfo -- ** Entitlement , Entitlement , entitlement , eeKind , eeReason , eeProductId -- ** ProductsListResponse , ProductsListResponse , productsListResponse , plrTokenPagination , plrPageInfo , plrKind , plrProduct ) where import Network.Google.AndroidEnterprise.Types import Network.Google.Prelude import Network.Google.Resource.AndroidEnterprise.Devices.Get import Network.Google.Resource.AndroidEnterprise.Devices.GetState import Network.Google.Resource.AndroidEnterprise.Devices.List import Network.Google.Resource.AndroidEnterprise.Devices.SetState import Network.Google.Resource.AndroidEnterprise.Enterprises.AcknowledgeNotificationSet import Network.Google.Resource.AndroidEnterprise.Enterprises.CompleteSignup import Network.Google.Resource.AndroidEnterprise.Enterprises.CreateWebToken import Network.Google.Resource.AndroidEnterprise.Enterprises.Delete import Network.Google.Resource.AndroidEnterprise.Enterprises.Enroll import Network.Google.Resource.AndroidEnterprise.Enterprises.GenerateSignupURL import Network.Google.Resource.AndroidEnterprise.Enterprises.Get import Network.Google.Resource.AndroidEnterprise.Enterprises.GetServiceAccount import Network.Google.Resource.AndroidEnterprise.Enterprises.GetStoreLayout import Network.Google.Resource.AndroidEnterprise.Enterprises.Insert import Network.Google.Resource.AndroidEnterprise.Enterprises.List import Network.Google.Resource.AndroidEnterprise.Enterprises.PullNotificationSet import Network.Google.Resource.AndroidEnterprise.Enterprises.SendTestPushNotification import Network.Google.Resource.AndroidEnterprise.Enterprises.SetAccount import Network.Google.Resource.AndroidEnterprise.Enterprises.SetStoreLayout import Network.Google.Resource.AndroidEnterprise.Enterprises.Unenroll import Network.Google.Resource.AndroidEnterprise.Entitlements.Delete import Network.Google.Resource.AndroidEnterprise.Entitlements.Get import Network.Google.Resource.AndroidEnterprise.Entitlements.List import Network.Google.Resource.AndroidEnterprise.Entitlements.Patch import Network.Google.Resource.AndroidEnterprise.Entitlements.Update import Network.Google.Resource.AndroidEnterprise.Grouplicenses.Get import Network.Google.Resource.AndroidEnterprise.Grouplicenses.List import Network.Google.Resource.AndroidEnterprise.GrouplicenseUsers.List import Network.Google.Resource.AndroidEnterprise.Installs.Delete import Network.Google.Resource.AndroidEnterprise.Installs.Get import Network.Google.Resource.AndroidEnterprise.Installs.List import Network.Google.Resource.AndroidEnterprise.Installs.Patch import Network.Google.Resource.AndroidEnterprise.Installs.Update import Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforDevice.Delete import Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforDevice.Get import Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforDevice.List import Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforDevice.Patch import Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforDevice.Update import Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforUser.Delete import Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforUser.Get import Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforUser.List import Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforUser.Patch import Network.Google.Resource.AndroidEnterprise.ManagedConfigurationsforUser.Update import Network.Google.Resource.AndroidEnterprise.Permissions.Get import Network.Google.Resource.AndroidEnterprise.Products.Approve import Network.Google.Resource.AndroidEnterprise.Products.GenerateApprovalURL import Network.Google.Resource.AndroidEnterprise.Products.Get import Network.Google.Resource.AndroidEnterprise.Products.GetAppRestrictionsSchema import Network.Google.Resource.AndroidEnterprise.Products.GetPermissions import Network.Google.Resource.AndroidEnterprise.Products.List import Network.Google.Resource.AndroidEnterprise.Products.UnApprove import Network.Google.Resource.AndroidEnterprise.ServiceAccountkeys.Delete import Network.Google.Resource.AndroidEnterprise.ServiceAccountkeys.Insert import Network.Google.Resource.AndroidEnterprise.ServiceAccountkeys.List import Network.Google.Resource.AndroidEnterprise.Storelayoutclusters.Delete import Network.Google.Resource.AndroidEnterprise.Storelayoutclusters.Get import Network.Google.Resource.AndroidEnterprise.Storelayoutclusters.Insert import Network.Google.Resource.AndroidEnterprise.Storelayoutclusters.List import Network.Google.Resource.AndroidEnterprise.Storelayoutclusters.Patch import Network.Google.Resource.AndroidEnterprise.Storelayoutclusters.Update import Network.Google.Resource.AndroidEnterprise.Storelayoutpages.Delete import Network.Google.Resource.AndroidEnterprise.Storelayoutpages.Get import Network.Google.Resource.AndroidEnterprise.Storelayoutpages.Insert import Network.Google.Resource.AndroidEnterprise.Storelayoutpages.List import Network.Google.Resource.AndroidEnterprise.Storelayoutpages.Patch import Network.Google.Resource.AndroidEnterprise.Storelayoutpages.Update import Network.Google.Resource.AndroidEnterprise.Users.Delete import Network.Google.Resource.AndroidEnterprise.Users.GenerateAuthenticationToken import Network.Google.Resource.AndroidEnterprise.Users.GenerateToken import Network.Google.Resource.AndroidEnterprise.Users.Get import Network.Google.Resource.AndroidEnterprise.Users.GetAvailableProductSet import Network.Google.Resource.AndroidEnterprise.Users.Insert import Network.Google.Resource.AndroidEnterprise.Users.List import Network.Google.Resource.AndroidEnterprise.Users.Patch import Network.Google.Resource.AndroidEnterprise.Users.RevokeToken import Network.Google.Resource.AndroidEnterprise.Users.SetAvailableProductSet import Network.Google.Resource.AndroidEnterprise.Users.Update {- $resources TODO -} -- | Represents the entirety of the methods and resources available for the Google Play EMM API service. type AndroidEnterpriseAPI = StorelayoutclustersInsertResource :<|> StorelayoutclustersListResource :<|> StorelayoutclustersPatchResource :<|> StorelayoutclustersGetResource :<|> StorelayoutclustersDeleteResource :<|> StorelayoutclustersUpdateResource :<|> UsersInsertResource :<|> UsersListResource :<|> UsersGenerateTokenResource :<|> UsersGenerateAuthenticationTokenResource :<|> UsersPatchResource :<|> UsersGetResource :<|> UsersSetAvailableProductSetResource :<|> UsersRevokeTokenResource :<|> UsersGetAvailableProductSetResource :<|> UsersDeleteResource :<|> UsersUpdateResource :<|> InstallsListResource :<|> InstallsPatchResource :<|> InstallsGetResource :<|> InstallsDeleteResource :<|> InstallsUpdateResource :<|> StorelayoutpagesInsertResource :<|> StorelayoutpagesListResource :<|> StorelayoutpagesPatchResource :<|> StorelayoutpagesGetResource :<|> StorelayoutpagesDeleteResource :<|> StorelayoutpagesUpdateResource :<|> ServiceAccountkeysInsertResource :<|> ServiceAccountkeysListResource :<|> ServiceAccountkeysDeleteResource :<|> EnterprisesCompleteSignupResource :<|> EnterprisesCreateWebTokenResource :<|> EnterprisesInsertResource :<|> EnterprisesGetServiceAccountResource :<|> EnterprisesListResource :<|> EnterprisesUnenrollResource :<|> EnterprisesGetStoreLayoutResource :<|> EnterprisesSetAccountResource :<|> EnterprisesEnrollResource :<|> EnterprisesGetResource :<|> EnterprisesGenerateSignupURLResource :<|> EnterprisesSendTestPushNotificationResource :<|> EnterprisesSetStoreLayoutResource :<|> EnterprisesAcknowledgeNotificationSetResource :<|> EnterprisesPullNotificationSetResource :<|> EnterprisesDeleteResource :<|> ManagedConfigurationsforUserListResource :<|> ManagedConfigurationsforUserPatchResource :<|> ManagedConfigurationsforUserGetResource :<|> ManagedConfigurationsforUserDeleteResource :<|> ManagedConfigurationsforUserUpdateResource :<|> GrouplicensesListResource :<|> GrouplicensesGetResource :<|> EntitlementsListResource :<|> EntitlementsPatchResource :<|> EntitlementsGetResource :<|> EntitlementsDeleteResource :<|> EntitlementsUpdateResource :<|> ManagedConfigurationsforDeviceListResource :<|> ManagedConfigurationsforDevicePatchResource :<|> ManagedConfigurationsforDeviceGetResource :<|> ManagedConfigurationsforDeviceDeleteResource :<|> ManagedConfigurationsforDeviceUpdateResource :<|> PermissionsGetResource :<|> ProductsGenerateApprovalURLResource :<|> ProductsListResource :<|> ProductsGetResource :<|> ProductsGetAppRestrictionsSchemaResource :<|> ProductsUnApproveResource :<|> ProductsApproveResource :<|> ProductsGetPermissionsResource :<|> DevicesListResource :<|> DevicesSetStateResource :<|> DevicesGetResource :<|> DevicesGetStateResource :<|> GrouplicenseUsersListResource
rueshyna/gogol
gogol-android-enterprise/gen/Network/Google/AndroidEnterprise.hs
mpl-2.0
29,510
0
80
5,356
2,901
2,118
783
553
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} -- Module : Text.EDE.Internal.AST -- Copyright : (c) 2013-2015 Brendan Hay <[email protected]> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or -- you can obtain it at http://mozilla.org/MPL/2.0/. -- Maintainer : Brendan Hay <[email protected]> -- Stability : experimental -- Portability : non-portable (GHC extensions) -- | AST smart constructors. module Text.EDE.Internal.AST where import Control.Comonad import Control.Comonad.Cofree import Data.Aeson.Types import Data.Foldable import Data.List.NonEmpty (NonEmpty(..)) import Data.Maybe import Text.EDE.Internal.Types newtype Mu f = Mu (f (Mu f)) cofree :: Functor f => a -> Mu f -> Cofree f a cofree x = go where go (Mu f) = x :< fmap go f var :: Id -> Var var = Var . (:| []) eapp :: a -> [Exp a] -> Exp a eapp x [] = cofree x blank eapp _ [e] = e eapp _ (e:es) = foldl' (\x y -> extract x :< EApp x y) e es efun :: Id -> Exp a -> Exp a efun i e = let x = extract e in x :< EApp (x :< EFun i) e efilter :: Exp a -> (Id, [Exp a]) -> Exp a efilter e (i, ps) = let x = extract e in eapp x ((x :< EFun i) : e : ps) elet :: Maybe (Id, Exp a) -> Exp a -> Exp a elet m e = maybe e (\(i, b) -> extract b :< ELet i b e) m ecase :: Exp a -> [Alt (Exp a)] -> Maybe (Exp a) -> Exp a ecase p ws f = extract p :< ECase p (ws ++ maybe [] ((:[]) . wild) f) eif :: (Exp a, Exp a) -> [(Exp a, Exp a)] -> Maybe (Exp a) -> Exp a eif t ts f = foldr' c (fromMaybe (extract (fst t) `cofree` blank) f) (t:ts) where c (p, w) e = extract p :< ECase p [true w, false e] eempty :: Exp a -> Exp a -> Maybe (Exp a) -> Exp a eempty v e = maybe e (eif (efun "!" (efun "empty" v), e) [] . Just) true, false, wild :: Exp a -> Alt (Exp a) true = (PLit (Bool True),) false = (PLit (Bool False),) wild = (PWild,) blank :: Mu ExpF blank = Mu (ELit (String mempty))
brendanhay/ede
src/Text/EDE/Internal/AST.hs
mpl-2.0
2,101
0
13
546
926
483
443
45
1
-- | -- Copyright : (c) 2008 Mathieu Boespflug -- License : LGPL -- Maintainer : [email protected] -- Stability : experimental -- Portability : non-portable -- -- This module reexports most of the modules in the vCard library in -- additionto the mime-directory library, with the exception of -- |Text.VCard.Query|, since that library should be imported qualified, as -- many of the names clash with standard |Prelude| names. -- -- To use this library, you probably want to import one of the modules in -- |Text.VCard.Format| only, to parse and serialize vcards in specific formats. module Text.VCard ( module D , module Text.VCard.Types , module Text.VCard.Selectors ) where import Codec.MIME.ContentType.Text.Directory as D import Text.VCard.Types import Text.VCard.Selectors
mboes/vCard
Text/VCard.hs
lgpl-3.0
786
0
5
126
62
48
14
5
0
-- | Module for discrete fuzzy sets. module Akarui.MVL.FuzzySet ( FuzzySet(..) , fromSet , subsetOf , elementOf , size , cardinality , support , supportSize , singleton , union , intersection , complement , remove0s ) where import qualified Data.Map.Strict as Map import Data.Map (Map) import qualified Data.Set as Set import Data.Set (Set) import qualified Data.Text as T import Akarui.ShowTxt import Akarui.Utils import Akarui.FOL.PrettyPrint import Akarui.MVL.Fuzzy -- | A discrete fuzzy set. data FuzzySet a = MapFS (Map a Fuzzy) instance (ShowTxt a) => Show (FuzzySet a) where show = T.unpack . showByElem instance (ShowTxt a) => ShowTxt (FuzzySet a) where showTxt = showByElem instance (ShowTxt a) => PrettyPrint (FuzzySet a) where prettyPrint _ = showByElem elementOf :: (Ord a) => a -> FuzzySet a -> Fuzzy elementOf e (MapFS m) = case Map.lookup e m of Just d -> d; _ -> mkFuzzy 0 -- | Number of elements in the fuzzyset. size :: (Ord a) => FuzzySet a -> Int size (MapFS m) = Map.size m cardinality :: (Ord a) => FuzzySet a -> Double cardinality (MapFS m) = Map.foldr (\f acc -> acc + toDouble f) 0 m -- | Converts a normal set into a fuzzyset with degree 1.0 for all elements. fromSet :: (Ord a) => Set a -> FuzzySet a fromSet s = MapFS $ Set.foldr' (\k acc -> Map.insert k fuzzyTrue acc) Map.empty s -- | A set f0 is a subset of f1 if, for all elements, degree(e0) < degree(e1). subsetOf :: (Ord a) => FuzzySet a -> FuzzySet a -> Bool subsetOf (MapFS m0) (MapFS m1) = allKeyVal sub m0 where sub k v = case Map.lookup k m1 of Just v1 -> v < v1; Nothing -> False -- | The set of members with a degree greater than 0. support :: (Ord a) => FuzzySet a -> Set a support (MapFS m) = Map.keysSet $ Map.filter nonZero m -- | Number of elements with a degree greater than 0. supportSize :: (Ord a) => FuzzySet a -> Int supportSize = Set.size . support -- | Removes elements with a degree of 0. -- size $ removes0 === support remove0s :: (Ord a) => FuzzySet a -> FuzzySet a remove0s (MapFS m) = MapFS $ Map.filter isFalse m -- | Tests whether the fuzzy set is a singleton (has a support of 1). singleton :: (Ord a) => FuzzySet a -> Bool singleton f = Set.size (support f) == 1 -- | Union of two fuzzy sets (taking the max value). union :: (Ord a) => FuzzySet a -> FuzzySet a -> FuzzySet a union (MapFS m0) (MapFS m1) = MapFS $ Map.unionWith max m0 m1 -- | Intersection of two fuzzy sets (taking the min value). intersection :: (Ord a) => FuzzySet a -> FuzzySet a -> FuzzySet a intersection (MapFS m0) (MapFS m1) = MapFS $ Map.intersectionWith min m0 m1 -- | The complement of a fuzzy set. complement :: (Ord a) => FuzzySet a -> FuzzySet a complement (MapFS m) = MapFS $ Map.map invNeg m showByElem :: (ShowTxt a) => FuzzySet a -> T.Text showByElem (MapFS m) = T.concat ["{", txt, "}"] where elems = Map.toList m txt = T.intercalate ", " $ map (\(k, v) -> T.concat [showTxt k, "/", T.pack $ show v]) elems
PhDP/Manticore
Akarui/MVL/FuzzySet.hs
apache-2.0
2,955
0
14
600
1,057
558
499
59
2
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} -- | -- SAML Protocols -- -- <https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf saml-core-2.0-os> §3 module SAML2.Core.Protocols where import Control.Lens (Lens', lens, (.~), (^.), view) import Data.Maybe (fromMaybe) import Data.Proxy (Proxy, asProxyTypeOf) import qualified Text.XML.HXT.Arrow.Pickle.Schema as XPS import SAML2.Lens import SAML2.XML import qualified Text.XML.HXT.Arrow.Pickle.Xml.Invertible as XP import qualified SAML2.XML.Schema as XS import qualified SAML2.XML.Signature.Types as DS import SAML2.Core.Namespaces import SAML2.Core.Versioning import qualified SAML2.Core.Assertions as SAML import SAML2.Core.Identifiers import SAML2.Bindings.General (RelayState) import SAML2.Bindings.Identifiers ns :: Namespace ns = mkNamespace "samlp" $ samlURN SAML20 ["protocol"] xpElem :: String -> XP.PU a -> XP.PU a xpElem = xpTrimElemNS ns data ProtocolType = ProtocolType { protocolID :: XS.ID , protocolVersion :: SAMLVersion , protocolIssueInstant :: DateTime , protocolDestination :: Maybe AnyURI , protocolConsent :: IdentifiedURI Consent , protocolIssuer :: Maybe SAML.Issuer , protocolSignature :: Maybe DS.Signature , protocolExtensions :: [Node] , relayState :: Maybe RelayState -- ^out-of-band data, not part of XML } deriving (Eq, Show) instance XP.XmlPickler ProtocolType where xpickle = XP.xpWrap (pt, tp) $ (XP.xpAttr "ID" XS.xpID XP.>*< XP.xpAttr "Version" XP.xpickle XP.>*< XP.xpAttr "IssueInstant" XS.xpDateTime XP.>*< XP.xpAttrImplied "Destination" XS.xpAnyURI XP.>*< XP.xpDefault (Identified ConsentUnspecified) (XP.xpAttr "Consent" XP.xpickle) XP.>*< XP.xpOption XP.xpickle XP.>*< XP.xpOption XP.xpickle XP.>*< XP.xpOption (xpElem "Extensions" $ XP.xpList1 xpTrimAnyElem)) where pt (((((((i, v), t), d), c), u), g), x) = ProtocolType i v t d c u g (fromMaybe [] x) Nothing tp (ProtocolType i v t d c u g [] _) = (((((((i, v), t), d), c), u), g), Nothing) tp (ProtocolType i v t d c u g x _) = (((((((i, v), t), d), c), u), g), Just x) instance DS.Signable ProtocolType where signature' = $(fieldLens 'protocolSignature) signedID = protocolID class (XP.XmlPickler a, DS.Signable a, Show a) => SAMLProtocol a where samlProtocol' :: Lens' a ProtocolType isSAMLResponse :: a -> Bool isSAMLResponse_ :: Proxy a -> Maybe Bool isSAMLResponse_ = Just . isSAMLResponse . asProxyTypeOf undefined -- |§3.2.1 newtype RequestAbstractType = RequestAbstractType { requestProtocol :: ProtocolType } deriving (Eq, Show) instance XP.XmlPickler RequestAbstractType where xpickle = [XP.biCase|p <-> RequestAbstractType p|] XP.>$< XP.xpickle class SAMLProtocol a => SAMLRequest a where samlRequest' :: Lens' a RequestAbstractType requestProtocol' :: Lens' RequestAbstractType ProtocolType requestProtocol' = $(fieldLens 'requestProtocol) -- |§3.2.2 data StatusResponseType = StatusResponseType { statusProtocol :: !ProtocolType , statusInResponseTo :: Maybe XS.NCName , status :: Status } deriving (Eq, Show) instance XP.XmlPickler StatusResponseType where xpickle = [XP.biCase|((p, r), s) <-> StatusResponseType p r s|] XP.>$< (XP.xpickle XP.>*< XP.xpAttrImplied "InResponseTo" XS.xpNCName XP.>*< XP.xpickle) class SAMLProtocol a => SAMLResponse a where samlResponse' :: Lens' a StatusResponseType statusProtocol' :: Lens' StatusResponseType ProtocolType statusProtocol' = $(fieldLens 'statusProtocol) -- |§3.2.2.1 data Status = Status { statusCode :: StatusCode , statusMessage :: Maybe XString -- ^§3.2.2.3 , statusDetail :: Maybe Nodes -- ^§3.2.2.4 } deriving (Eq, Show) instance XP.XmlPickler Status where xpickle = xpElem "Status" $ [XP.biCase| ((c, m), d) <-> Status c m d|] XP.>$< (XP.xpickle XP.>*< XP.xpOption (xpElem "StatusMessage" XP.xpText0) XP.>*< XP.xpOption (xpElem "StatusDetail" XP.xpAnyCont)) -- |§3.2.2.2 data StatusCode = StatusCode { statusCode1 :: StatusCode1 , statusCodes :: [IdentifiedURI StatusCode2] } deriving (Eq, Show) instance XP.XmlPickler StatusCode where xpickle = xpElem "StatusCode" $ [XP.biCase| (v, c) <-> StatusCode v c|] XP.>$< (XP.xpAttr "Value" XP.xpickle XP.>*< xpStatusCodes) where xpStatusCodes = [XP.biCase| Nothing <-> [] Just (v, c) <-> v : c|] XP.>$< XP.xpOption (xpElem "StatusCode" $ XP.xpAttr "Value" XP.xpickle XP.>*< xpStatusCodes) data StatusCode1 = StatusSuccess | StatusRequester | StatusResponder | StatusVersionMismatch deriving (Eq, Bounded, Enum, Show) instance Identifiable URI StatusCode1 where identifier = samlURNIdentifier "status" . f where f StatusSuccess = (SAML20, "Success") f StatusRequester = (SAML20, "Requester") f StatusResponder = (SAML20, "Responder") f StatusVersionMismatch = (SAML20, "VersionMismatch") instance XP.XmlPickler StatusCode1 where xpickle = xpIdentifier XS.xpAnyURI "status" data StatusCode2 = StatusAuthnFailed | StatusInvalidAttrNameOrValue | StatusInvalidNameIDPolicy | StatusNoAuthnContext | StatusNoAvailableIDP | StatusNoPassive | StatusNoSupportedIDP | StatusPartialLogout | StatusProxyCountExceeded | StatusRequestDenied | StatusRequestUnsupported | StatusRequestVersionDeprecated | StatusRequestVersionTooHigh | StatusRequestVersionTooLow | StatusResourceNotRecognized | StatusTooManyResponses | StatusUnknownAttrProfile | StatusUnknownPrincipal | StatusUnsupportedBinding deriving (Eq, Bounded, Enum, Show) instance Identifiable URI StatusCode2 where identifier = samlURNIdentifier "status" . f where f StatusAuthnFailed = (SAML20, "AuthnFailed") f StatusInvalidAttrNameOrValue = (SAML20, "InvalidAttrNameOrValue") f StatusInvalidNameIDPolicy = (SAML20, "InvalidNameIDPolicy") f StatusNoAuthnContext = (SAML20, "NoAuthnContext") f StatusNoAvailableIDP = (SAML20, "NoAvailableIDP") f StatusNoPassive = (SAML20, "NoPassive") f StatusNoSupportedIDP = (SAML20, "NoSupportedIDP") f StatusPartialLogout = (SAML20, "PartialLogout") f StatusProxyCountExceeded = (SAML20, "ProxyCountExceeded") f StatusRequestDenied = (SAML20, "RequestDenied") f StatusRequestUnsupported = (SAML20, "RequestUnsupported") f StatusRequestVersionDeprecated = (SAML20, "RequestVersionDeprecated") f StatusRequestVersionTooHigh = (SAML20, "RequestVersionTooHigh") f StatusRequestVersionTooLow = (SAML20, "RequestVersionTooLow") f StatusResourceNotRecognized = (SAML20, "ResourceNotRecognized") f StatusTooManyResponses = (SAML20, "TooManyResponses") f StatusUnknownAttrProfile = (SAML20, "UnknownAttrProfile") f StatusUnknownPrincipal = (SAML20, "UnknownPrincipal") f StatusUnsupportedBinding = (SAML20, "UnsupportedBinding") successStatus :: Status successStatus = Status (StatusCode StatusSuccess []) Nothing Nothing -- |§3.3.1 data AssertionIDRequest = AssertionIDRequest { assertionIDRequest :: !RequestAbstractType , assertionIDRequestRef :: List1 (SAML.AssertionIDRef) } deriving (Eq, Show) instance XP.XmlPickler AssertionIDRequest where xpickle = xpElem "AssertionIDRequest" $ [XP.biCase| (q, r) <-> AssertionIDRequest q r|] XP.>$< (XP.xpickle XP.>*< xpList1 XP.xpickle) instance DS.Signable AssertionIDRequest where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol AssertionIDRequest where samlProtocol' = samlRequest' . requestProtocol' isSAMLResponse _ = False instance SAMLRequest AssertionIDRequest where samlRequest' = $(fieldLens 'assertionIDRequest) -- |§3.3.2.1 data SubjectQueryAbstractType = SubjectQueryAbstractType { subjectQuery :: !RequestAbstractType , subjectQuerySubject :: SAML.Subject } deriving (Eq, Show) instance XP.XmlPickler SubjectQueryAbstractType where xpickle = [XP.biCase| (q, r) <-> SubjectQueryAbstractType q r|] XP.>$< (XP.xpickle XP.>*< XP.xpickle) subjectQuery' :: Lens' SubjectQueryAbstractType RequestAbstractType subjectQuery' = $(fieldLens 'subjectQuery) -- |§3.3.2.2 data AuthnQuery = AuthnQuery { authnQuery :: !SubjectQueryAbstractType , authnQuerySessionIndex :: Maybe XString , authnQueryRequestedAuthnContext :: Maybe RequestedAuthnContext } deriving (Eq, Show) instance XP.XmlPickler AuthnQuery where xpickle = xpElem "AuthnQuery" $ [XP.biCase| ((q, i), c) <-> AuthnQuery q i c|] XP.>$< (XP.xpickle XP.>*< XP.xpAttrImplied "SessionIndex" XS.xpString XP.>*< XP.xpOption XP.xpickle) instance DS.Signable AuthnQuery where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol AuthnQuery where samlProtocol' = samlRequest' . requestProtocol' isSAMLResponse _ = False instance SAMLRequest AuthnQuery where samlRequest' = authnQuery' . subjectQuery' where authnQuery' = $(fieldLens 'authnQuery) -- |§3.3.2.2.1 data RequestedAuthnContext = RequestedAuthnContext { requestedAuthnContextComparison :: Maybe AuthnContextComparisonType , requestedAuthnContextRefs :: AuthnContextRefs } deriving (Eq, Show) instance XP.XmlPickler RequestedAuthnContext where xpickle = xpElem "RequestedAuthnContext" $ [XP.biCase| (c, r) <-> RequestedAuthnContext c r|] XP.>$< (XP.xpAttrImplied "Comparison" XP.xpickle XP.>*< XP.xpickle) data AuthnContextRefs = AuthnContextClassRefs (List1 AnyURI) | AuthnContextDeclRefs (List1 AnyURI) deriving (Eq, Show) instance XP.XmlPickler AuthnContextRefs where xpickle = [XP.biCase| Left l <-> AuthnContextClassRefs l Right l <-> AuthnContextDeclRefs l|] XP.>$< (xpList1 (SAML.xpElem "AuthnContextClassRef" XS.xpAnyURI) XP.>|< xpList1 (SAML.xpElem "AuthnContextDeclRef" XS.xpAnyURI)) data AuthnContextComparisonType = ComparisonExact | ComparisonMinimum | ComparisonMaximum | ComparisonBetter deriving (Eq, Enum, Bounded, Show) instance Identifiable XString AuthnContextComparisonType where identifier ComparisonExact = "exact" identifier ComparisonMinimum = "minimum" identifier ComparisonMaximum = "maximum" identifier ComparisonBetter = "better" instance XP.XmlPickler AuthnContextComparisonType where xpickle = xpIdentifier (XP.xpTextDT (XPS.scDT (namespaceURIString ns) "AuthnContextComparisonType" [])) "AuthnContextComparisonType" -- |§3.3.2.3 data AttributeQuery = AttributeQuery { attributeQuery :: !SubjectQueryAbstractType , attributeQueryAttributes :: [SAML.Attribute] } deriving (Eq, Show) instance XP.XmlPickler AttributeQuery where xpickle = xpElem "AttributeQuery" $ [XP.biCase| (q, a) <-> AttributeQuery q a|] XP.>$< (XP.xpickle XP.>*< XP.xpList XP.xpickle) instance DS.Signable AttributeQuery where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol AttributeQuery where samlProtocol' = samlRequest' . requestProtocol' isSAMLResponse _ = False instance SAMLRequest AttributeQuery where samlRequest' = attributeQuery' . subjectQuery' where attributeQuery' = $(fieldLens 'attributeQuery) -- |§3.3.2.4 data AuthzDecisionQuery = AuthzDecisionQuery { authzDecisionQuery :: !SubjectQueryAbstractType , authzDecisionQueryResource :: AnyURI , authzDecisionQueryActions :: [SAML.Action] , authzDecisionQueryEvidence :: SAML.Evidence } deriving (Eq, Show) instance XP.XmlPickler AuthzDecisionQuery where xpickle = xpElem "AuthzDecisionQuery" $ [XP.biCase| (((q, r), a), e) <-> AuthzDecisionQuery q r a e|] XP.>$< (XP.xpickle XP.>*< XP.xpAttr "Resource" XS.xpAnyURI XP.>*< XP.xpList XP.xpickle XP.>*< XP.xpickle) instance DS.Signable AuthzDecisionQuery where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol AuthzDecisionQuery where samlProtocol' = samlRequest' . requestProtocol' isSAMLResponse _ = False instance SAMLRequest AuthzDecisionQuery where samlRequest' = authzDecisionQuery' . subjectQuery' where authzDecisionQuery' = $(fieldLens 'authzDecisionQuery) -- |§3.3.3 data Response = Response { response :: !StatusResponseType , responseAssertions :: [SAML.PossiblyEncrypted SAML.Assertion] } deriving (Eq, Show) instance XP.XmlPickler Response where xpickle = xpElem "Response" $ [XP.biCase| (r, a) <-> Response r a|] XP.>$< (XP.xpickle XP.>*< XP.xpList SAML.xpPossiblyEncrypted) instance DS.Signable Response where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol Response where samlProtocol' = samlResponse' . statusProtocol' isSAMLResponse _ = True instance SAMLResponse Response where samlResponse' = $(fieldLens 'response) -- |§3.4.1 data AuthnRequest = AuthnRequest { authnRequest :: !RequestAbstractType , authnRequestForceAuthn :: XS.Boolean , authnRequestIsPassive :: XS.Boolean , authnRequestAssertionConsumerService :: AssertionConsumerService , authnRequestAssertionConsumingServiceIndex :: Maybe XS.UnsignedShort , authnRequestProviderName :: Maybe XString , authnRequestSubject :: Maybe SAML.Subject , authnRequestNameIDPolicy :: Maybe NameIDPolicy , authnRequestConditions :: Maybe SAML.Conditions , authnRequestRequestedAuthnContext :: Maybe RequestedAuthnContext , authnRequestScoping :: Maybe Scoping } deriving (Eq, Show) data AssertionConsumerService = AssertionConsumerServiceIndex XS.UnsignedShort | AssertionConsumerServiceURL { authnRequestAssertionConsumerServiceURL :: Maybe AnyURI , authnRequestProtocolBinding :: Maybe (IdentifiedURI Binding) } deriving (Eq, Show) instance XP.XmlPickler AuthnRequest where xpickle = xpElem "AuthnRequest" $ [XP.biCase| ((((((((((q, f), p), Left i), g), n), s), np), c), r), sc) <-> AuthnRequest q f p (AssertionConsumerServiceIndex i) g n s np c r sc ((((((((((q, f), p), Right (u, b)), g), n), s), np), c), r), sc) <-> AuthnRequest q f p (AssertionConsumerServiceURL u b) g n s np c r sc|] XP.>$< (XP.xpickle XP.>*< XP.xpDefault False (XP.xpAttr "ForceAuthn" XS.xpBoolean) XP.>*< XP.xpDefault False (XP.xpAttr "IsPassive" XS.xpBoolean) XP.>*< (XP.xpAttr "AssertionConsumerServiceIndex" XS.xpUnsignedShort XP.>|< (XP.xpAttrImplied "AssertionConsumerServiceURL" XS.xpAnyURI XP.>*< XP.xpAttrImplied "ProtocolBinding" XP.xpickle)) XP.>*< XP.xpAttrImplied "AttributeConsumingServiceIndex" XS.xpUnsignedShort XP.>*< XP.xpAttrImplied "ProviderName" XS.xpString XP.>*< XP.xpOption XP.xpickle XP.>*< XP.xpOption XP.xpickle XP.>*< XP.xpOption XP.xpickle XP.>*< XP.xpOption XP.xpickle XP.>*< XP.xpOption XP.xpickle) instance DS.Signable AuthnRequest where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol AuthnRequest where samlProtocol' = samlRequest' . requestProtocol' isSAMLResponse _ = False instance SAMLRequest AuthnRequest where samlRequest' = $(fieldLens 'authnRequest) -- |§3.4.1.1 data NameIDPolicy = NameIDPolicy { nameIDPolicyFormat :: IdentifiedURI NameIDFormat , nameIDPolicySPNameQualifier :: Maybe XString , nameIDPolicyAllowCreate :: Bool } deriving (Eq, Show) instance XP.XmlPickler NameIDPolicy where xpickle = xpElem "NameIDPolicy" $ [XP.biCase| ((f, q), c) <-> NameIDPolicy f q c|] XP.>$< (XP.xpDefault (Identified NameIDFormatUnspecified) (XP.xpAttr "Format" XP.xpickle) XP.>*< XP.xpAttrImplied "SPNameQualifier" XS.xpString XP.>*< XP.xpDefault False (XP.xpAttr "AllowCreate" XS.xpBoolean)) -- |§3.4.1.2 data Scoping = Scoping { scopingProxyCount :: Maybe XS.NonNegativeInteger , scopingIDPList :: Maybe IDPList , scopingRequesterID :: [AnyURI] } deriving (Eq, Show) instance XP.XmlPickler Scoping where xpickle = xpElem "Scoping" $ [XP.biCase| ((c, i), r) <-> Scoping c i r|] XP.>$< (XP.xpAttrImplied "ProxyCount" XS.xpNonNegativeInteger XP.>*< XP.xpOption XP.xpickle XP.>*< XP.xpList (xpElem "RequesterID" XS.xpAnyURI)) -- |§3.4.1.3 data IDPList = IDPList { idpList :: List1 IDPEntry , idpGetComplete :: Maybe AnyURI } deriving (Eq, Show) instance XP.XmlPickler IDPList where xpickle = xpElem "IDPList" $ [XP.biCase| (l, c) <-> IDPList l c|] XP.>$< (xpList1 XP.xpickle XP.>*< XP.xpOption (xpElem "GetComplete" XS.xpAnyURI)) -- |§3.4.1.3.1 data IDPEntry = IDPEntry { idpEntryProviderID :: AnyURI , idpEntryName :: Maybe XString , idpEntryLoc :: Maybe AnyURI } deriving (Eq, Show) instance XP.XmlPickler IDPEntry where xpickle = xpElem "IDPEntry" $ [XP.biCase| ((p, n), l) <-> IDPEntry p n l|] XP.>$< (XP.xpAttr "ProviderID" XS.xpAnyURI XP.>*< XP.xpAttrImplied "Name" XS.xpString XP.>*< XP.xpAttrImplied "Loc" XS.xpAnyURI) -- |§3.5.1 data ArtifactResolve = ArtifactResolve { artifactResolve :: !RequestAbstractType , artifactResolveArtifact :: XString } deriving (Eq, Show) instance XP.XmlPickler ArtifactResolve where xpickle = xpElem "ArtifactResolve" $ [XP.biCase| (r, a) <-> ArtifactResolve r a|] XP.>$< (XP.xpickle XP.>*< xpElem "Artifact" XS.xpString) instance DS.Signable ArtifactResolve where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol ArtifactResolve where samlProtocol' = samlRequest' . requestProtocol' isSAMLResponse _ = False instance SAMLRequest ArtifactResolve where samlRequest' = $(fieldLens 'artifactResolve) -- |§3.5.2 data ArtifactResponse = ArtifactResponse { artifactResponse :: !StatusResponseType , artifactResponseMessage :: Maybe Node } deriving (Eq, Show) instance XP.XmlPickler ArtifactResponse where xpickle = xpElem "ArtifactResponse" $ [XP.biCase| (r, a) <-> ArtifactResponse r a|] XP.>$< (XP.xpickle XP.>*< XP.xpOption xpTrimAnyElem) instance DS.Signable ArtifactResponse where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol ArtifactResponse where samlProtocol' = samlResponse' . statusProtocol' isSAMLResponse _ = True instance SAMLResponse ArtifactResponse where samlResponse' = $(fieldLens 'artifactResponse) -- |§3.6.1 data ManageNameIDRequest = ManageNameIDRequest { manageNameIDRequest :: !RequestAbstractType , manageNameIDRequestNameID :: SAML.PossiblyEncrypted SAML.NameID , manageNameIDRequestNewID :: Maybe (SAML.PossiblyEncrypted NewID) } deriving (Eq, Show) instance XP.XmlPickler ManageNameIDRequest where xpickle = xpElem "ManageNameIDRequest" $ [XP.biCase| ((r, o), Left n) <-> ManageNameIDRequest r o (Just n) ((r, o), Right ()) <-> ManageNameIDRequest r o Nothing|] XP.>$< (XP.xpickle XP.>*< SAML.xpPossiblyEncrypted XP.>*< (SAML.xpPossiblyEncrypted XP.>|< xpElem "Terminate" XP.xpUnit)) instance DS.Signable ManageNameIDRequest where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol ManageNameIDRequest where samlProtocol' = samlRequest' . requestProtocol' isSAMLResponse _ = False instance SAMLRequest ManageNameIDRequest where samlRequest' = $(fieldLens 'manageNameIDRequest) newtype NewID = NewID{ newID :: XString } deriving (Eq, Show) instance XP.XmlPickler NewID where xpickle = xpElem "NewID" $ [XP.biCase| n <-> NewID n|] XP.>$< XS.xpString type NewEncryptedID = SAML.EncryptedElement NewID instance XP.XmlPickler NewEncryptedID where xpickle = xpElem "NewEncryptedID" SAML.xpEncryptedElement -- |§3.6.2 newtype ManageNameIDResponse = ManageNameIDResponse { manageNameIDResponse :: StatusResponseType } deriving (Eq, Show) instance XP.XmlPickler ManageNameIDResponse where xpickle = xpElem "ManageNameIDResponse" $ [XP.biCase| r <-> ManageNameIDResponse r|] XP.>$< XP.xpickle instance DS.Signable ManageNameIDResponse where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol ManageNameIDResponse where samlProtocol' = samlResponse' . statusProtocol' isSAMLResponse _ = True instance SAMLResponse ManageNameIDResponse where samlResponse' = $(fieldLens 'manageNameIDResponse) -- |§3.7.1 data LogoutRequest = LogoutRequest { logoutRequest :: !RequestAbstractType , logoutRequestReason :: Maybe (Identified XString LogoutReason) , logoutRequestNotOnOrAfter :: Maybe XS.DateTime , logoutRequestIdentifier :: SAML.PossiblyEncrypted SAML.Identifier , logoutRequestSessionIndex :: [XString] } deriving (Eq, Show) instance XP.XmlPickler LogoutRequest where xpickle = xpElem "LogoutRequest" $ [XP.biCase| ((((q, r), t), i), s) <-> LogoutRequest q r t i s|] XP.>$< (XP.xpickle XP.>*< XP.xpAttrImplied "Reason" XP.xpickle XP.>*< XP.xpAttrImplied "NotOnOrAfter" XS.xpDateTime XP.>*< SAML.xpPossiblyEncrypted XP.>*< XP.xpList (xpElem "SessionIndex" XS.xpString)) instance DS.Signable LogoutRequest where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol LogoutRequest where samlProtocol' = samlRequest' . requestProtocol' isSAMLResponse _ = False instance SAMLRequest LogoutRequest where samlRequest' = $(fieldLens 'logoutRequest) -- |§3.7.2 newtype LogoutResponse = LogoutResponse { logoutResponse :: StatusResponseType } deriving (Eq, Show) instance XP.XmlPickler LogoutResponse where xpickle = xpElem "LogoutResponse" $ [XP.biCase| r <-> LogoutResponse r|] XP.>$< XP.xpickle instance DS.Signable LogoutResponse where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol LogoutResponse where samlProtocol' = samlResponse' . statusProtocol' isSAMLResponse _ = True instance SAMLResponse LogoutResponse where samlResponse' = $(fieldLens 'logoutResponse) -- |§3.7.3 data LogoutReason = LogoutReasonUser | LogoutReasonAdmin deriving (Eq, Enum, Bounded, Show) instance Identifiable XString LogoutReason where identifier = show . samlURNIdentifier "logout" . f where f LogoutReasonUser = (SAML20, "user") f LogoutReasonAdmin = (SAML20, "admin") instance XP.XmlPickler (Identified XString LogoutReason) where xpickle = xpIdentified XS.xpString -- |§3.8.1 data NameIDMappingRequest = NameIDMappingRequest { nameIDMappingRequest :: !RequestAbstractType , nameIDMappingRequestIdentifier :: SAML.PossiblyEncrypted SAML.Identifier , nameIDMappingRequestPolicy :: NameIDPolicy } deriving (Eq, Show) instance XP.XmlPickler NameIDMappingRequest where xpickle = xpElem "NameIDMappingRequest" $ [XP.biCase| ((r, i), p) <-> NameIDMappingRequest r i p|] XP.>$< (XP.xpickle XP.>*< SAML.xpPossiblyEncrypted XP.>*< XP.xpickle) instance DS.Signable NameIDMappingRequest where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol NameIDMappingRequest where samlProtocol' = samlRequest' . requestProtocol' isSAMLResponse _ = False instance SAMLRequest NameIDMappingRequest where samlRequest' = $(fieldLens 'nameIDMappingRequest) -- |§3.8.2 data NameIDMappingResponse = NameIDMappingResponse { nameIDMappingResponse :: !StatusResponseType , nameIDMappingResponseNameID :: SAML.PossiblyEncrypted SAML.NameID } deriving (Eq, Show) instance XP.XmlPickler NameIDMappingResponse where xpickle = xpElem "NameIDMappingResponse" $ [XP.biCase| (r, a) <-> NameIDMappingResponse r a|] XP.>$< (XP.xpickle XP.>*< SAML.xpPossiblyEncrypted) instance DS.Signable NameIDMappingResponse where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol NameIDMappingResponse where samlProtocol' = samlResponse' . statusProtocol' isSAMLResponse _ = True instance SAMLResponse NameIDMappingResponse where samlResponse' = $(fieldLens 'nameIDMappingResponse) data AnyRequest = RequestAssertionIDRequest !AssertionIDRequest | RequestAuthnQuery !AuthnQuery | RequestAttributeQuery !AttributeQuery | RequestAuthzDecisionQuery !AuthzDecisionQuery | RequestAuthnRequest !AuthnRequest | RequestArtifactResolve !ArtifactResolve | RequestManageNameIDRequest !ManageNameIDRequest | RequestLogoutRequest !LogoutRequest | RequestNameIDMappingRequest !NameIDMappingRequest deriving (Eq, Show) instance XP.XmlPickler AnyRequest where xpickle = [XP.biCase| Left (Left (Left (Left (Left (Left (Left (Left r))))))) <-> RequestAssertionIDRequest r Left (Left (Left (Left (Left (Left (Left (Right r))))))) <-> RequestAuthnQuery r Left (Left (Left (Left (Left (Left (Right r)))))) <-> RequestAttributeQuery r Left (Left (Left (Left (Left (Right r))))) <-> RequestAuthzDecisionQuery r Left (Left (Left (Left (Right r)))) <-> RequestAuthnRequest r Left (Left (Left (Right r))) <-> RequestArtifactResolve r Left (Left (Right r)) <-> RequestManageNameIDRequest r Left (Right r) <-> RequestLogoutRequest r Right r <-> RequestNameIDMappingRequest r|] XP.>$< (XP.xpickle XP.>|< XP.xpickle XP.>|< XP.xpickle XP.>|< XP.xpickle XP.>|< XP.xpickle XP.>|< XP.xpickle XP.>|< XP.xpickle XP.>|< XP.xpickle XP.>|< XP.xpickle) instance DS.Signable AnyRequest where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol AnyRequest where samlProtocol' = samlRequest' . requestProtocol' isSAMLResponse _ = False instance SAMLRequest AnyRequest where samlRequest' = lens g s where g (RequestAssertionIDRequest r) = r ^. samlRequest' g (RequestAuthnQuery r) = r ^. samlRequest' g (RequestAttributeQuery r) = r ^. samlRequest' g (RequestAuthzDecisionQuery r) = r ^. samlRequest' g (RequestAuthnRequest r) = r ^. samlRequest' g (RequestArtifactResolve r) = r ^. samlRequest' g (RequestManageNameIDRequest r) = r ^. samlRequest' g (RequestLogoutRequest r) = r ^. samlRequest' g (RequestNameIDMappingRequest r) = r ^. samlRequest' s (RequestAssertionIDRequest r) q = RequestAssertionIDRequest $ samlRequest' .~ q $ r s (RequestAuthnQuery r) q = RequestAuthnQuery $ samlRequest' .~ q $ r s (RequestAttributeQuery r) q = RequestAttributeQuery $ samlRequest' .~ q $ r s (RequestAuthzDecisionQuery r) q = RequestAuthzDecisionQuery $ samlRequest' .~ q $ r s (RequestAuthnRequest r) q = RequestAuthnRequest $ samlRequest' .~ q $ r s (RequestArtifactResolve r) q = RequestArtifactResolve $ samlRequest' .~ q $ r s (RequestManageNameIDRequest r) q = RequestManageNameIDRequest $ samlRequest' .~ q $ r s (RequestLogoutRequest r) q = RequestLogoutRequest $ samlRequest' .~ q $ r s (RequestNameIDMappingRequest r) q = RequestNameIDMappingRequest $ samlRequest' .~ q $ r data AnyResponse = ResponseResponse !Response | ResponseArtifactResponse !ArtifactResponse deriving (Eq, Show) instance XP.XmlPickler AnyResponse where xpickle = [XP.biCase| Left r <-> ResponseResponse r Right r <-> ResponseArtifactResponse r|] XP.>$< (XP.xpickle XP.>|< XP.xpickle) instance DS.Signable AnyResponse where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol AnyResponse where samlProtocol' = samlResponse' . statusProtocol' isSAMLResponse _ = True instance SAMLResponse AnyResponse where samlResponse' = lens g s where g (ResponseResponse r) = r ^. samlResponse' g (ResponseArtifactResponse r) = r ^. samlResponse' s (ResponseResponse r) q = ResponseResponse $ samlResponse' .~ q $ r s (ResponseArtifactResponse r) q = ResponseArtifactResponse $ samlResponse' .~ q $ r data AnyProtocol = ProtocolRequest !AnyRequest | ProtocolResponse !AnyResponse deriving (Eq, Show) instance XP.XmlPickler AnyProtocol where xpickle = [XP.biCase| Left r <-> ProtocolRequest r Right r <-> ProtocolResponse r|] XP.>$< (XP.xpickle XP.>|< XP.xpickle) instance DS.Signable AnyProtocol where signature' = samlProtocol' . DS.signature' signedID = protocolID . view samlProtocol' instance SAMLProtocol AnyProtocol where samlProtocol' = lens g s where g (ProtocolRequest r) = r ^. samlProtocol' g (ProtocolResponse r) = r ^. samlProtocol' s (ProtocolRequest r) q = ProtocolRequest $ samlProtocol' .~ q $ r s (ProtocolResponse r) q = ProtocolResponse $ samlProtocol' .~ q $ r isSAMLResponse (ProtocolRequest _) = False isSAMLResponse (ProtocolResponse _) = True isSAMLResponse_ _ = Nothing
dylex/hsaml2
SAML2/Core/Protocols.hs
apache-2.0
29,388
0
21
5,245
7,004
3,784
3,220
664
1
{-# LANGUAGE QuasiQuotes #-} ----------------------------------------------------------------------------- -- -- Module : Model.PaperReader.NatureA -- Copyright : -- License : BSD3 -- -- Maintainer : Hiro Kai -- Stability : Experimental -- Portability : -- -- | -- ----------------------------------------------------------------------------- -- -- For Nature (new format) article -- {-# LANGUAGE DoAndIfThenElse #-} module Parser.Publisher.NatureA ( natureAReader ) where import Parser.Import import Text.XML import Text.XML.Cursor as C import qualified Data.Text as T import Data.Text.Lazy (toStrict) import Data.List import Parser.Utils import Control.Applicative import qualified Data.Map as M import Parser.Publisher.NatureCommon (_title,_volume,_pageFrom,_pageTo) natureAReader :: PaperReader natureAReader = defaultReader { supportedUrl = _supportedUrl, supported = _supported, title = anyLevel _title, abstract = absLevel _abstract, doi = anyLevel _doi, journal = anyLevel _journal, volume = anyLevel _volume, pageFrom = anyLevel _pageFrom, pageTo = anyLevel _pageTo, year = anyLevel _year, authors = anyLevel _authors, articleType = anyLevel _articleType, refs = onlyFullL _refs, figs = onlyFullL _figs, toc = onlyFull _toc, mainHtml = onlyFull _mainHtml, readerName = _readerName } _readerName _ = "NatureA" _supportedUrl _ url = boolToSupp $ "http://www.nature.com/nature/" `T.isPrefixOf` url _supported r url c = boolToSupp $ isJust ((supportedUrl r) r url) && ((articleType r) r SUndecidable c == Just "Article") _mainHtml _ = fmap FlatHtml . render . map subLink . nofignav . nolater . noabstract . map node . concatMap (element "section") . descendant _doi _ = toStrict . innerText . queryT [jq|dd.doi|] _journal _ cursor = Just $ head $ map (T.strip . head) $ filter (\x -> not $ null x) $ cursor $// element "p" &| attributeIs "class" "article-type" &.// content _year _ cursor = headm (getMeta "DC.date" cursor) >>= f where f s | T.length s >= 4 = Just $ read $ T.unpack (T.take 4 s) | otherwise = Nothing _authors _ = getMeta "DC.creator" _abstract _ cur = if null es then Nothing else (render . (:[]) . node . head) es where es = cur $| query "#abstract p" >=> child -- _title _ cursor = Just $ T.concat $ cursor $| query "h1.article-heading" &.// content -- _articleType _ cursor = Just $ head $ map (T.strip . last) $ filter (\x -> not $ null x) $ -- cursor $// element "p" &| attributeIs "class" "article-type" &.// content _articleType _ cursor = (headMay $ getMeta "prism.section" cursor) <|> (headm $ map (T.strip . last) $ filter (\x -> not $ null x) $ cursor $// element "p" &| attributeIs "class" "article-type" &.// content) _refs _ cur = map r ns where ns = map node $ cur $| query "ol.references > li" r n@(NodeElement (Element name as cs)) = Reference (refid as) (refname as) (Just def) (Just (txt cs)) (url n) refid as = fromMaybe "" (M.lookup "id" as) refname as = T.drop 3 (refid as) txt cs = T.strip $ toStrict $ innerText $ takeWhile g cs g (NodeElement (Element name as cs)) = name /= "ul" g _ = True url n = let cs = fromNode n $// element "a" >=> attribute "href" in if null cs then Nothing else Just (last cs) f s = s _figs _ cur = [] _toc _ cur = Just $ (\x -> traceShow x x) $ T.intercalate "::" $ map (toStrict . innerText) $ nav $| query "li" where nav = head $ cur $| query "section nav" subLink :: Node->Node subLink (NodeElement (Element n as cs)) = NodeElement (Element n as (map f cs)) where f (NodeElement (Element nn as cs)) | nameLocalName nn == "a" = NodeElement (Element nn (M.update g "href" as) (map subLink cs)) | otherwise = NodeElement (Element nn as (map subLink cs)) f n = n g url = if length tok < 2 then Just url else Just ("#" `T.append` last tok) where tok = T.splitOn "#" url subLink n = n nofignav = map (remove (\n -> ename n `elem` map Just ["nav","figure"])) noabstract :: [Node]->[Node] noabstract ns = tail' $ dropWhile f ns where f (NodeElement (Element _ _ cs)) = any g cs f _ = True g (NodeElement (Element _ as _)) = Just "abstract" /= M.lookup "id" as g _ = False nolater :: [Node]->[Node] nolater ns = fst $ break f ns where f (NodeElement (Element _ _ cs)) = any g cs f _ = True g (NodeElement (Element _ as _)) = Just "references" == M.lookup "id" as g _ = False defParse :: Cursor -> Maybe T.Text defParse _ = Nothing {- doi cursor = T.concat $ cursor $// element "dd" >=> attributeIs "class" "doi" &// content -} -- This does not work correctly. --paperType c = Just $ T.strip $ (trace (show es) es) -- where es = (innerHtml . (:[]) . last) $ (c $| query "p.article-type" >=> child)
hirokai/PaperServer
Parser/Publisher/NatureA.hs
bsd-2-clause
4,958
0
16
1,178
1,666
861
805
88
3
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE ImpredicativeTypes #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverlappingInstances #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} -- | -- Module : Data.Array.Accelerate.CUDA.CodeGen.Base -- Copyright : [2008..2014] Manuel M T Chakravarty, Gabriele Keller -- [2009..2014] Trevor L. McDonell -- License : BSD3 -- -- Maintainer : Trevor L. McDonell <[email protected]> -- Stability : experimental -- Portability : non-portable (GHC extensions) -- module Data.Array.Accelerate.CUDA.CodeGen.Base ( -- Names and Types CUTranslSkel(..), CUDelayedAcc(..), CUExp(..), CUFun1(..), CUFun2(..), Eliminate, Instantiate1, Instantiate2, Name, namesOfArray, namesOfAvar, groupOfInt, -- Declaration generation cint, cvar, ccall, cchar, cintegral, cbool, cshape, cslice, csize, cindexHead, cindexTail, ctoIndex, cfromIndex, readArray, writeArray, shared, indexArray, environment, arrayAsTex, arrayAsArg, umul24, gridSize, threadIdx, -- Mutable operations (.=.), locals, Lvalue(..), Rvalue(..), ) where -- library import Prelude hiding ( zipWith, zipWith3 ) import Data.List ( mapAccumR ) import Text.PrettyPrint.Mainland import Language.C.Quote.CUDA import qualified Language.C.Syntax as C import qualified Data.HashMap.Strict as Map -- cuda import Foreign.CUDA.Analysis.Device -- friends import Data.Array.Accelerate.Type import Data.Array.Accelerate.Error import Data.Array.Accelerate.Array.Representation ( SliceIndex(..) ) import Data.Array.Accelerate.Array.Sugar ( Array, Shape, Elt ) import Data.Array.Accelerate.Analysis.Shape import Data.Array.Accelerate.CUDA.CodeGen.Type import Data.Array.Accelerate.CUDA.AST -- Names -- ----- type Name = String namesOfArray :: forall e. Elt e => Name -- name of group: typically "Out" or "InX" for some number 'X' -> e -- dummy -> (Name, [Name]) -- shape and array field names namesOfArray grp _ = let ty = eltType (undefined :: e) arr x = "arr" ++ grp ++ '_':show x n = length ty in ( "sh" ++ grp, map arr [n-1, n-2 .. 0] ) namesOfAvar :: forall aenv sh e. (Shape sh, Elt e) => Gamma aenv -> Idx aenv (Array sh e) -> (Name, [Name]) namesOfAvar gamma ix = namesOfArray (groupOfAvar gamma ix) (undefined::e) groupOfAvar :: (Shape sh, Elt e) => Gamma aenv -> Idx aenv (Array sh e) -> Name groupOfAvar (Gamma gamma) = groupOfInt . (gamma Map.!) . Idx_ groupOfInt :: Int -> Name groupOfInt n = "In" ++ show n -- Types of compilation units -- -------------------------- -- A CUDA compilation unit, together with the name of the main __global__ entry -- function. -- data CUTranslSkel aenv a = CUTranslSkel Name [C.Definition] instance Show (CUTranslSkel aenv a) where show (CUTranslSkel entry _) = entry instance Pretty (CUTranslSkel aenv a) where ppr (CUTranslSkel _ code) = ppr code -- Scalar expressions, including the environment of local let-bindings to bring -- into scope before evaluating the body. -- data CUExp aenv a where CUExp :: ([C.BlockItem], [C.Exp]) -> CUExp aenv a -- Scalar functions of particular arity, with local bindings. -- type Eliminate a = forall x. [x] -> [(Bool,x)] type Instantiate1 a b = forall x. Rvalue x => [x] -> ([C.BlockItem], [C.Exp]) type Instantiate2 a b c = forall x y. (Rvalue x, Rvalue y) => [x] -> [y] -> ([C.BlockItem], [C.Exp]) data CUFun1 aenv f where CUFun1 :: (Elt a, Elt b) => Eliminate a -> Instantiate1 a b -> CUFun1 aenv (a -> b) data CUFun2 aenv f where CUFun2 :: (Elt a, Elt b, Elt c) => Eliminate a -> Eliminate b -> Instantiate2 a b c -> CUFun2 aenv (a -> b -> c) -- Delayed arrays -- data CUDelayedAcc aenv sh e where CUDelayed :: CUExp aenv sh -> CUFun1 aenv (sh -> e) -> CUFun1 aenv (Int -> e) -> CUDelayedAcc aenv sh e -- Common expression forms -- ----------------------- cint :: C.Type cint = codegenScalarType (scalarType :: ScalarType Int) cvar :: Name -> C.Exp cvar x = [cexp|$id:x|] ccall :: Name -> [C.Exp] -> C.Exp ccall fn args = [cexp|$id:fn ($args:args)|] cchar :: Char -> C.Exp cchar c = [cexp|$char:c|] cintegral :: (Integral a, Show a) => a -> C.Exp cintegral n = [cexp|$int:n|] cbool :: Bool -> C.Exp cbool = cintegral . fromEnum cslice :: SliceIndex slix sl co dim -> Name -> ([C.Param], [C.Exp], [(C.Type, Name)]) cslice slix sl = let xs = cshape' (ncodims slix) sl args = [ [cparam| const $ty:cint $id:x |] | x <- xs ] in (args, map cvar xs, zip (repeat cint) xs) where ncodims :: SliceIndex slix sl co dim -> Int ncodims SliceNil = 0 ncodims (SliceAll s) = ncodims s ncodims (SliceFixed s) = ncodims s + 1 -- Generate all the names of a shape given a base name and dimensionality cshape :: Int -> Name -> [C.Exp] cshape dim sh = [ cvar x | x <- cshape' dim sh ] cshape' :: Int -> Name -> [Name] cshape' dim sh = [ (sh ++ '_':show i) | i <- [dim-1, dim-2 .. 0] ] -- Get the innermost index of a shape/index cindexHead :: Rvalue r => [r] -> C.Exp cindexHead = rvalue . last -- Get the tail of a shape/index cindexTail :: Rvalue r => [r] -> [C.Exp] cindexTail = map rvalue . init -- generate code that calculates the product of the list of expressions csize :: Rvalue r => [r] -> C.Exp csize [] = [cexp| 1 |] csize ss = foldr1 (\a b -> [cexp| $exp:a * $exp:b |]) (map rvalue ss) -- Generate code to calculate a linear from a multi-dimensional index (given an array shape). -- ctoIndex :: (Rvalue sh, Rvalue ix) => [sh] -> [ix] -> C.Exp ctoIndex extent index = toIndex (reverse $ map rvalue extent) (reverse $ map rvalue index) -- we use a row-major representation where toIndex [] [] = [cexp| $int:(0::Int) |] toIndex [_] [i] = i toIndex (sz:sh) (i:ix) = [cexp| $exp:(toIndex sh ix) * $exp:sz + $exp:i |] toIndex _ _ = $internalError "toIndex" "argument mismatch" -- Generate code to calculate a multi-dimensional index from a linear index and a given array shape. -- This version creates temporary values that are reused in the computation. -- cfromIndex :: (Rvalue sh, Rvalue ix) => [sh] -> ix -> Name -> ([C.BlockItem], [C.Exp]) cfromIndex shName ixName tmpName = fromIndex (map rvalue shName) (rvalue ixName) where fromIndex [sh] ix = ([], [[cexp| ({ assert( $exp:ix >= 0 && $exp:ix < $exp:sh ); $exp:ix; }) |]]) fromIndex extent ix = let ((env, _, _), sh) = mapAccumR go ([], ix, 0) extent in (reverse env, sh) go (tmps,ix,n) d = let tmp = tmpName ++ '_':show (n::Int) ix' = [citem| const $ty:cint $id:tmp = $exp:ix ; |] in ((ix':tmps, [cexp| $id:tmp / $exp:d |], n+1), [cexp| $id:tmp % $exp:d |]) -- Thread blocks and indices -- ------------------------- umul24 :: DeviceProperties -> C.Exp -> C.Exp -> C.Exp umul24 dev x y | computeCapability dev < Compute 2 0 = [cexp| __umul24($exp:x, $exp:y) |] | otherwise = [cexp| $exp:x * $exp:y |] gridSize :: DeviceProperties -> C.Exp gridSize dev = umul24 dev [cexp|blockDim.x|] [cexp|gridDim.x|] threadIdx :: DeviceProperties -> C.Exp threadIdx dev = let block = umul24 dev [cexp|blockDim.x|] [cexp|blockIdx.x|] in [cexp| $exp:block + threadIdx.x |] -- Generate an array indexing expression. Depending on the hardware class, this -- will be via direct array indexing or texture references. -- indexArray :: DeviceProperties -> C.Type -- array element type (Float, Double...) -> C.Exp -- array variable name (arrInX_Y) -> C.Exp -- linear index -> C.Exp indexArray dev elt arr ix -- use the L2 cache of newer devices | computeCapability dev >= Compute 2 0 = [cexp| $exp:arr [ $exp:ix ] |] -- use the texture cache of compute 1.x devices | [cty|double|] <- elt = ccall "indexDArray" [arr, ix] | otherwise = ccall "indexArray" [arr, ix] -- Kernel function parameters -- -------------------------- -- Generate kernel parameters for an array valued argument, and a function to -- linearly index this array. Note that dimensional indexing results in error. -- readArray :: forall aenv sh e. (Shape sh, Elt e) => Name -- group names -> Array sh e -- dummy to fix types -> ( [C.Param] , [C.Exp] , CUDelayedAcc aenv sh e ) readArray grp dummy = let (sh, arrs) = namesOfArray grp (undefined :: e) args = arrayAsArg dummy grp dim = expDim (undefined :: Exp aenv sh) sh' = cshape dim sh get ix = ([], map (\a -> [cexp| $id:a [ $exp:ix ] |]) arrs) manifest = CUDelayed (CUExp ([], sh')) ($internalError "readArray" "linear indexing only") (CUFun1 (zip (repeat True)) (\[i] -> get (rvalue i))) in ( args, sh', manifest ) -- Generate function parameters and corresponding variable names for the -- components of the given output array. The parameter list generated is -- suitable for marshalling an instance of "Array sh e", consisting of a group -- name (say "Out") to be welded with a shape name "shOut" followed by the -- non-parametric array data "arrOut_aX". -- writeArray :: forall sh e. (Shape sh, Elt e) => Name -- group names -> Array sh e -- dummy to fix types -> ( [C.Param] -- function parameters to marshal the output array , [C.Exp] -- the shape of the output array , Rvalue x => x -> [C.Exp] ) -- write an element at a given index writeArray grp _ = let (sh, arrs) = namesOfArray grp (undefined :: e) dim = expDim (undefined :: Exp aenv sh) sh' = cshape' dim sh extent = [ [cparam| const $ty:cint $id:i |] | i <- sh' ] adata = zipWith (\t n -> [cparam| $ty:t * __restrict__ $id:n |]) (eltType (undefined :: e)) arrs in ( extent ++ adata , map cvar sh' , \ix -> map (\a -> [cexp| $id:a [ $exp:(rvalue ix) ] |]) arrs ) -- All dynamically allocated __shared__ memory will begin at the same base -- address. If we call this more than once, or the kernel itself declares some -- shared memory, the first parameter is a pointer to where the new declarations -- should take as the base address. -- shared :: forall e. Elt e => e -- dummy type -> Name -- group name -> C.Exp -- how much shared memory per type -> Maybe C.Exp -- (optional) initialise from this base address -> ( [C.InitGroup] -- shared memory declaration and... , Rvalue x => x -> [C.Exp]) -- ...indexing function shared _ grp size mprev = let e:es = eltType (undefined :: e) x:xs = let k = length es in map (\n -> grp ++ show n) [k, k-1 .. 0] sdata t v p = [cdecl| volatile $ty:t * $id:v = ($ty:t *) & $id:p [ $exp:size ]; |] sbase t v | Just p <- mprev = [cdecl| volatile $ty:t * $id:v = ($ty:t *) $exp:p; |] | otherwise = [cdecl| extern volatile __shared__ $ty:t $id:v [] ; |] in ( sbase e x : zipWith3 sdata es xs (init (x:xs)) , \ix -> map (\v -> [cexp| $id:v [ $exp:(rvalue ix) ] |]) (x:xs) ) -- Array environment references. The method in which arrays are accessed depends -- on the device architecture (see below). We always include the array shape -- before the array data terms. -- -- compute 1.x: -- texture references of type [Definition] -- -- compute 2.x and 3.x: -- function arguments of type [Param] -- -- NOTE: The environment variables must always be the first argument to the -- kernel function, as this is where they will be marshaled during the -- execution phase. -- environment :: forall aenv. DeviceProperties -> Gamma aenv -> ([C.Definition], [C.Param]) environment dev gamma@(Gamma aenv) | computeCapability dev < Compute 2 0 = Map.foldrWithKey (\(Idx_ v) _ (ds,ps) -> let (d,p) = asTex v in (d++ds, p++ps)) ([],[]) aenv | otherwise = ([], Map.foldrWithKey (\(Idx_ v) _ vs -> asArg v ++ vs) [] aenv) where asTex :: forall sh e. (Shape sh, Elt e) => Idx aenv (Array sh e) -> ([C.Definition], [C.Param]) asTex ix = arrayAsTex (undefined :: Array sh e) (groupOfAvar gamma ix) asArg :: forall sh e. (Shape sh, Elt e) => Idx aenv (Array sh e) -> [C.Param] asArg ix = arrayAsArg (undefined :: Array sh e) (groupOfAvar gamma ix) arrayAsTex :: forall sh e. (Shape sh, Elt e) => Array sh e -> Name -> ([C.Definition], [C.Param]) arrayAsTex _ grp = let (sh, arrs) = namesOfArray grp (undefined :: e) dim = expDim (undefined :: Exp aenv sh) extent = [ [cparam| const $ty:cint $id:i |] | i <- cshape' dim sh ] adata = zipWith (\t a -> [cedecl| static $ty:t $id:a; |]) (eltTypeTex (undefined :: e)) arrs in (adata, extent) arrayAsArg :: forall sh e. (Shape sh, Elt e) => Array sh e -> Name -> [C.Param] arrayAsArg _ grp = let (sh, arrs) = namesOfArray grp (undefined :: e) dim = expDim (undefined :: Exp aenv sh) extent = [ [cparam| const $ty:cint $id:i |] | i <- cshape' dim sh ] adata = zipWith (\t n -> [cparam| const $ty:t * __restrict__ $id:n |]) (eltType (undefined :: e)) arrs in extent ++ adata -- Mutable operations -- ------------------ -- Declare some local variables. These can be either const or mutable -- declarations. -- locals :: forall e. Elt e => Name -> e -> ( [(C.Type, Name)] -- const declarations , [C.Exp], [C.InitGroup]) -- mutable declaration and names locals base _ = let elt = eltType (undefined :: e) n = length elt local t v = let name = base ++ show v in ( (t, name), cvar name, [cdecl| $ty:t $id:name; |] ) in unzip3 $ zipWith local elt [n-1, n-2 .. 0] class Lvalue a where lvalue :: a -> C.Exp -> C.BlockItem -- Note: [Mutable l-values] -- -- Be careful when using mutable l-values that the same variable does not appear -- on both the left and right hand side. For example, the following will lead to -- problems (#114, #168): -- -- $items:(x .=. f x) -- -- $items:(y .=. combine x y) -- -- If 'x' and 'y' represent values with tuple types, they will have multiple -- components. Since the LHS is updated as the new values are calculated, it is -- possible to get into a situation where computing the new value for some of -- the components will be using the updated values, not the original values. -- -- Instead, store the result to some (temporary) variable that does not appear -- on the RHS, and then update old value using the fully computed result, e.g.: -- -- $items:(x' .=. f x) -- $items:(x .=. x') -- instance Lvalue C.Exp where lvalue x y = [citem| $exp:x = $exp:y; |] instance Lvalue (C.Type, Name) where lvalue (t,x) y = [citem| const $ty:t $id:x = $exp:y; |] class Rvalue a where rvalue :: a -> C.Exp instance Rvalue C.Exp where rvalue = id instance Rvalue Name where rvalue = cvar instance Rvalue (C.Type, Name) where rvalue (_,x) = rvalue x infixr 0 .=. (.=.) :: Assign l r => l -> r -> [C.BlockItem] (.=.) = assign class Assign l r where assign :: l -> r -> [C.BlockItem] instance (Lvalue l, Rvalue r) => Assign l r where assign lhs rhs = [ lvalue lhs (rvalue rhs) ] instance Assign l r => Assign (Bool,l) r where assign (used,lhs) rhs | used = assign lhs rhs | otherwise = [] instance Assign l r => Assign [l] [r] where assign [] [] = [] assign (x:xs) (y:ys) = assign x y ++ assign xs ys assign _ _ = $internalError ".=." "argument mismatch" instance Assign l r => Assign l ([C.BlockItem], r) where assign lhs (env, rhs) = env ++ assign lhs rhs -- Prelude' -- -------- -- A version of zipWith that requires the lists to be equal length -- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c] zipWith f (x:xs) (y:ys) = f x y : zipWith f xs ys zipWith _ [] [] = [] zipWith _ _ _ = $internalError "zipWith" "argument mismatch" zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d] zipWith3 f (x:xs) (y:ys) (z:zs) = f x y z : zipWith3 f xs ys zs zipWith3 _ [] [] [] = [] zipWith3 _ _ _ _ = $internalError "zipWith3" "argument mismatch"
mikusp/accelerate-cuda
Data/Array/Accelerate/CUDA/CodeGen/Base.hs
bsd-3-clause
17,171
0
16
4,770
4,928
2,793
2,135
271
4
module Main where import Network.Salvia.Handler.ColorLog import Network.Salvia.Handlers import Network.Salvia.Impl.Server import Network.Salvia.Impl.Config import Network.Salvia.Interface import System.IO main :: IO () main = start defaultConfig -- This echoes the (parsed) query paramaters. (hDefaultEnv (do r <- hQueryParameters send (show r) hColorLog stdout)) ()
sebastiaanvisser/salvia-demo
src/QueryParams.hs
bsd-3-clause
419
0
13
93
101
57
44
15
1
module Levenshtein where matchPattern (x:xs) (y:ys) = (x == y, map (== x) ys, map (== y) xs) : matchPattern xs ys matchPattern _ _ = [] updateCosts (c1:c2:cs) (match:ms) cost = let upperCost = if match then c1 else c2 + 1 newCost = min cost upperCost in if newCost > 0 then newCost : updateCosts (c2:cs) ms newCost else repeat 0 updateCosts _ [] _ = [] updateCosts _ _ _ = error "Cost list too short." slowLDist (x:xs) (y:ys) = if x == y then slowLDist xs ys else 1 + min (slowLDist xs (y:ys)) (slowLDist (x:xs) ys) slowLDist xs [] = length xs slowLDist [] ys = length ys levDist x y = fst (quadLDist x y) quadLDist xs ys = quadLDist' xs ys (0,1) (iterate incFst (1,1)) quadLDist' _ [] _ costs = last costs quadLDist' xs (y:ys) c costs = let matches = map (==y) xs newCosts = buildRow (incFst c) c costs matches in quadLDist' xs ys (incFst c) newCosts buildRow leftCost diagonalCost (c:cs) (m:ms) = let c1 = incFst (minCost leftCost c) c2 = if m then minCost c1 diagonalCost else c1 in c2 : buildRow c2 c cs ms buildRow _ _ _ _ = [] incFst (c, n) = (c+1, n) minCost (c1, n1) (c2, n2) = case compare c1 c2 of EQ -> (c1, n1 + n2) LT -> (c1, n1) GT -> (c2, n2) {- -- xs is a superstring of ys buildIntermediate (x:_) [] = [x] buildIntermediate (x:xs) (y:ys) = if x == y then x : buildIntermediate xs ys else x : y : ys superstring (x:xs) (y:ys) (z:zs) | z /= x = x : superstring xs (y:ys) (z:zs) | z /= y = y : superstring (x:xs) ys (z:zs) | otherwise = z : superstring xs ys zs superstring xs ys [] = xs ++ ys substring (x:xs) (y:ys) (z:zs) | z /= x = substring (x:xs) ys zs | z /= y = substring xs (y:ys) zs | otherwise = z : substring xs ys zs substring _ _ _ = [] -}
cullina/Extractor
src/Levenshtein.hs
bsd-3-clause
1,927
0
11
609
665
347
318
40
3
{-# LANGUAGE MultiParamTypeClasses #-} -- {-# LANGUAGE FlexibleInstances #-} -- Copyright (c) 2009, Diego Souza -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- * Neither the name of the <ORGANIZATION> nor the names of its contributors -- may be used to endorse or promote products derived from this software -- without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- | A type class that is able to perform HTTP requests. module Network.OAuth.Http.CurlHttpClient ( CurlClient(..) ) where import Network.Curl import Network.OAuth.Http.HttpClient import Network.OAuth.Http.Request import Network.OAuth.Http.Response import Control.Monad.Trans import Data.Char (chr,ord) import qualified Data.ByteString.Lazy as B import qualified Data.ByteString.Lazy.UTF8 as U data CurlClient = CurlClient | OptionsCurlClient [CurlOption] instance HttpClient CurlClient where runClient client req = liftIO $ withCurlDo $ do { c <- initialize ; setopts c opts ; rsp <- perform_with_response_ c ; case (respCurlCode rsp) of errno | errno `elem` successCodes -> return $ Right (fromResponse rsp) | otherwise -> return $ Left (show errno) } where httpVersion = case (version req) of Http10 -> HttpVersion10 Http11 -> HttpVersion11 successCodes = [ CurlOK , CurlHttpReturnedError ] curlMethod = case (method req) of GET -> [ CurlHttpGet True ] HEAD -> [ CurlNoBody True,CurlCustomRequest "HEAD" ] other -> if ((B.null . reqPayload $ req) && 0 == length (multipartPayload req)) then [ CurlHttpGet True,CurlCustomRequest (show other) ] else [ CurlPost True,CurlCustomRequest (show other) ] curlPostData = if B.null . reqPayload $ req then case multipartPayload req of [] -> [] -- i.e., no payload at all parts -> [CurlHttpPost (convertMultipart parts)] -- i.e., "multipart/form-data" -- content with a boundary and MIME stuff -- see libcurl for HttpPost, Content else case multipartPayload req of [] -> let tostr = map (chr.fromIntegral).B.unpack field = reqPayload req in [CurlPostFields [tostr field]] -- i.e., "application/x-www-form-urlencoded" -- strings with field sep '&' -- although we're only giving libcurl a single field _ -> error "with both CurlPostFields and CurlHttpPost, I'm not sure what libcurl would do..." curlHeaders = let headers = (map (\(k,v) -> k++": "++v).toList.reqHeaders $ req) in [CurlHttpHeaders headers] opts = [ CurlURL (showURL req) , CurlHttpVersion httpVersion , CurlHeader False , CurlSSLVerifyHost 2 , CurlSSLVerifyPeer True , CurlTimeout 30 ] ++ curlHeaders ++ curlMethod ++ curlPostData ++ clientOptions clientOptions = case client of CurlClient -> [] OptionsCurlClient o -> o packedBody rsp = U.fromString . respBody $ rsp fromResponse rsp = RspHttp (respStatus rsp) (respStatusLine rsp) (fromList.respHeaders $ rsp) (packedBody rsp)
dgvncsz0f/hoauth
src/main/haskell/Network/OAuth/Http/CurlHttpClient.hs
bsd-3-clause
5,589
1
20
2,178
756
418
338
58
0
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DeriveGeneric #-} module Main ( main ) where import GHC.Generics ( Generic ) import GenArgs data MyArgs f = MyArgs { myInt :: f Int , myBool :: f Bool , myString :: f String } deriving Generic instance ToFlags MyArgs instance Show (MyArgs Flag) where show (MyArgs x y z) = "MyArgs " ++ show (x,y,z) instance Show (MyArgs Parsed) where show (MyArgs x y z) = "MyArgs " ++ show (x,y,z) dummyArgs :: MyArgs Flag dummyArgs = MyArgs { myInt = Flag { fInfo = Required , fNames = [] , fType = "FILE" , fHelp = "the important int" , fValue = 42 } , myBool = Flag { fInfo = Required , fNames = [] , fType = "BOOL" , fHelp = "the important bool" , fValue = True } , myString = Flag { fInfo = Required , fNames = [] , fType = "FILE" , fHelp = "the important string" , fValue = "42" } } main :: IO () main = do args <- parseArgs dummyArgs "woo" "oh yeah" print args
ghorn/cmdargs-generic
examples/Main.hs
bsd-3-clause
1,048
0
9
309
338
195
143
45
1
{-# LANGUAGE CPP, DeriveDataTypeable, ScopedTypeVariables #-} import System.IO import System.Console.CmdArgs import ParserTester import Llvm.Pass.Optimizer () import qualified Llvm.Pass.Mem2Reg as M2R () import qualified Llvm.Pass.Liveness as L () import qualified Llvm.Hir.Data as I import qualified Llvm.Asm as A import Llvm.Query.HirCxt import Llvm.Pass.PassManager import qualified Compiler.Hoopl as H import qualified Llvm.AsmHirConversion as Cv import qualified Llvm.Pass.NormalGraph as N import qualified Llvm.Pass.Optimizer as O import qualified Llvm.Pass.PassTester as T import qualified Llvm.Pass.DataUsage as Du import qualified Llvm.Hir.Print as P import qualified Llvm.Pass.Substitution as Sub import qualified Llvm.Pass.Changer as Cg import qualified Llvm.Pass.Visualization as Vis import qualified Llvm.Pass.SizeofVerification as Tveri import System.Exit import qualified Data.Map as M import qualified Data.Set as S import Data.List (stripPrefix) import Llvm.Matcher toStep "mem2reg" = Just Mem2Reg toStep "dce" = Just Dce toStep _ = Nothing chg = Cg.defaultChanger { Cg.change_GlobalId = \x -> case x of I.GlobalIdAlphaNum s -> case stripPrefix "llvm." s of Nothing -> I.GlobalIdAlphaNum (s ++ "_g_") Just _ -> x _ -> x , Cg.change_LocalId = \x -> case x of I.LocalIdAlphaNum s -> case stripPrefix "llvm." s of Nothing -> I.LocalIdAlphaNum (s ++ "_l_") Just _ -> x _ -> x } extractSteps :: [String] -> [Step] extractSteps l = map (\x -> case toStep x of Just s -> s Nothing -> error (x ++ " is not step") ) l data Sample = Dummy { input :: FilePath, output :: Maybe String } | Parser { input :: FilePath, output :: Maybe String, showAst :: Bool } | Ast2Ir { input :: FilePath, output :: Maybe String } | Ir2Ast { input :: FilePath, output :: Maybe String } | SizeofVerification { input :: FilePath, output :: Maybe String } | Pass { input :: FilePath, output :: Maybe String, step :: [String], fuel :: Int } | PhiFixUp { input :: FilePath, output :: Maybe String, fuel :: Int } | AstCanonic { input :: FilePath, output :: Maybe String } | DataUse { input :: FilePath, output :: Maybe String, fuel ::Int} | Change { input :: FilePath, output :: Maybe String} | Visualize { input :: FilePath, output :: Maybe String} | SrcInfoDbg { input :: FilePath, output :: Maybe String} deriving (Show, Data, Typeable, Eq) outFlags x = x &= help "Output file, stdout is used if it's not specified" &= typFile dummy = Dummy { input = def &= typ "<INPUT>" , output = outFlags Nothing } &= help "Test LLVM Parser" parser = Parser { input = def &= typ "<INPUT>" , output = outFlags Nothing , showAst = False } &= help "Test LLVM Parser" ast2ir = Ast2Ir { input = def &= typ "<INPUT>" , output = outFlags Nothing } &= help "Test Ast2Ir conversion" ir2ast = Ir2Ast { input = def &= typ "<INPUT>" , output = outFlags Nothing } &= help "Test Ir2Ast conversion" typeq = SizeofVerification { input = def &= typ "<INPUT>" , output = outFlags Nothing } &= help "Test Type Query Verification pass" astcanonic = AstCanonic { input = def &= typ "<INPUT>" , output = outFlags Nothing } &= help "Test AstCanonic conversion" datause = DataUse { input = def &= typ "<INPUT>" , output = outFlags Nothing , fuel = H.infiniteFuel &= typ "FUEL" &= help "the fuel used to rewrite the code, the default is infiniteFuel" } &= help "Test DataUsage Pass" changer = Change { input = def &= typ "<INPUT>" , output = outFlags Nothing } &= help "Test Change Pass" visual = Visualize { input = def &= typ "<INPUT>" , output = outFlags Nothing } &= help "Test Visialize Pass" srcInfo = SrcInfoDbg { input = def &= typ "<INPUT>" , output = outFlags Nothing } &= help "SrcInfo test pass" pass = Pass { input = def &= typ "<INPUT>" , output = outFlags Nothing , fuel = H.infiniteFuel &= typ "FUEL" &= help "The fuel used to run the pass, the default is infiniteFuel" , step = def &= typ "STEP" &= help "Supported steps : mem2reg, dce. Multiple passes are supported by specifying multiple --step s, e.g., --step=mem2reg --step=dce" } &= help "Test Optimization pass" phifixup = PhiFixUp { input = def &= typ "<INPUT>" , output = outFlags Nothing , fuel = H.infiniteFuel &= typ "FUEL" &= help "The fuel used to run the pass" } &= help "Test PhiFixUp pass" mode = cmdArgsMode $ modes [dummy, parser, ast2ir, ir2ast ,pass, astcanonic, phifixup ,datause, changer, visual ,srcInfo, typeq] &= help "Test sub components" &= program "Test" &= summary "Test driver v1.0" main :: IO () main = do { sel <- cmdArgsRun mode #ifdef DEBUG ; putStr $ show sel #endif ; case sel of Parser ix ox sh -> do { inh <- openFile ix ReadMode ; m <- testParser ix inh ; if sh then do { swth <- openFileOrStdout (fmap (\x -> x ++ ".show") ox) ; writeOutShow m swth ; closeFileOrStdout ox swth } else do { outh <- openFileOrStdout ox ; writeOutLlvm m outh ; closeFileOrStdout ox outh } ; hClose inh } AstCanonic ix ox -> do { inh <- openFile ix ReadMode ; outh <- openFileOrStdout ox ; ast <- testParser ix inh ; let ast' = A.simplify ast ; writeOutLlvm ast' outh ; hClose inh ; closeFileOrStdout ox outh } Ast2Ir ix ox -> do { inh <- openFile ix ReadMode ; outh <- openFileOrStdout ox ; ast <- testParser ix inh ; let ast' = A.simplify ast {- ; let (I.SpecializedModule _ ir) = mapModule id Nothing ast' -- ; let (m, ir) = H.runSimpleUniqueMonad ((Cv.asmToHir ast')::H.SimpleUniqueMonad (Cv.IdLabelMap, I.Module ())) ; writeOutIr ir outh -} ; hClose inh ; closeFileOrStdout ox outh } Ir2Ast ix ox -> do { inh <- openFile ix ReadMode ; outh <- openFileOrStdout ox ; ast <- testParser ix inh ; let ast' = A.simplify ast ; let ast'' = transformModule id Nothing ast' ; writeOutLlvm ast'' outh ; hClose inh ; closeFileOrStdout ox outh } SizeofVerification ix ox -> do { inh <- openFile ix ReadMode ; outh <- openFileOrStdout ox ; ast <- testParser ix inh ; let ast' = A.simplify ast ; let ast'' = transformModule (Tveri.mkVerificationModule) Nothing ast' -- testIr2Ast m testIr ; writeOutLlvm ast'' outh ; hClose inh ; closeFileOrStdout ox outh } Change ix ox -> do { inh <- openFile ix ReadMode ; outh <- openFileOrStdout ox ; ast <- testParser ix inh ; let ast' = A.simplify ast ; let ast'' = transformModule2 (\(I.SpecializedModule dlm m) -> (I.SpecializedModule dlm $ Sub.substitute chg m, Sub.substitute chg)) Nothing ast' ; writeOutLlvm ast'' outh ; hClose inh ; closeFileOrStdout ox outh } Visualize ix ox -> do { inh <- openFile ix ReadMode ; outh <- openFileOrStdout ox ; ast <- testParser ix inh ; let ast' = A.simplify ast ; let ast'' = transformModule (\(I.SpecializedModule dlm m) -> I.SpecializedModule dlm $ Vis.visualize (Vis.sampleVisualPlugin dlm) m) Nothing ast' ; writeOutLlvm ast'' outh ; hClose inh ; closeFileOrStdout ox outh } SrcInfoDbg ix ox -> do { inh <- openFile ix ReadMode ; outh <- openFileOrStdout ox ; ast <- testParser ix inh ; let ast' = A.simplify ast ; let (srcInfo2, sl2) = mapModule (\(I.SpecializedModule _ ir@(I.Module ls)) -> -- (m, ir@(I.Module ls)::I.Module I.NOOP) = testAst2Ir ast' let irCxt = irCxtOfModule ir srcInfo1 = srcInfoMap (unamedMetadata $ globalCxt irCxt) sl = foldl (\p s -> case s of I.ToplevelDefine tld -> (localIdSrcInfoMap (unamedMetadata $ globalCxt irCxt) (dbgDeclares $ funCxtOfTlDefine tld)):p _ -> p ) [] ls in (srcInfo1, sl)) Nothing ast' ; writeOutIr srcInfo2 outh ; writeOutIr (reverse sl2) outh ; hClose inh ; closeFileOrStdout ox outh } PhiFixUp ix ox f -> do { inh <- openFile ix ReadMode ; outh <- openFileOrStdout ox ; ast <- testParser ix inh ; let ast1 = A.simplify ast {-; let (m, ir) = testAst2Ir ast1-} {-; let ir1 = H.runSimpleUniqueMonad $ H.runWithFuel f ((O.optModule1 () N.fixUpPhi ir):: H.SimpleFuelMonad (I.Module ())) -} ; let ast2 = ast1 -- undefined -- transformModule (\ir -> H.runSimpleUniqueMonad $ H.runWithFuel f (O.optModule1 () N.fixUpPhi ir)) Nothing ast1 --testIr2Ast m ir1 ; writeOutLlvm ast2 outh ; hClose inh ; closeFileOrStdout ox outh } DataUse ix ox f -> do { inh <- openFile ix ReadMode ; outh <- openFileOrStdout ox ; ast <- testParser ix inh ; let ast' = A.simplify ast ; let liv = mapModule (\(I.SpecializedModule _ ir) -> let ic = irCxtOfModule ir in H.runSimpleUniqueMonad $ H.runWithFuel f ((Du.scanModule ir ic) :: H.SimpleFuelMonad (M.Map I.FunctionInterface Du.DataUsage)) ) Nothing ast' ; writeOutIr liv outh ; hClose inh ; closeFileOrStdout ox outh } Pass ix ox passes f -> do { inh <- openFile ix ReadMode ; outh <- openFileOrStdout ox ; ast <- testParser ix inh ; let ast1 = A.simplify ast {- ; let (m, ir) = testAst2Ir ast1 ; let applySteps' = applySteps (extractSteps passes) ir ; let ir1 = H.runSimpleUniqueMonad $ H.runWithFuel f (applySteps' :: H.SimpleFuelMonad (I.Module ())) ; let ir2 = H.runSimpleUniqueMonad $ H.runWithFuel f ((O.optModule1 () N.fixUpPhi ir1) :: H.SimpleFuelMonad (I.Module ())) -} ; let ast2 = ast1 -- undefined -- testIr2Ast m ir2 ; writeOutLlvm ast2 outh ; hClose inh ; closeFileOrStdout ox outh } _ -> error $ "unexpected option " ++ show sel } openFileOrStdout :: Maybe FilePath -> IO Handle openFileOrStdout Nothing = return stdout openFileOrStdout (Just x) = openFile x WriteMode closeFileOrStdout :: Maybe FilePath -> Handle -> IO () closeFileOrStdout Nothing h = hFlush h closeFileOrStdout (Just _) h = hClose h
sanjoy/hLLVM
src/LlvmTest.hs
bsd-3-clause
15,112
0
33
7,489
3,025
1,574
1,451
217
14
{-# LANGUAGE RecordWildCards #-} module Grep(runGrep) where import Language.Haskell.HLint2 import HSE.All import Control.Monad import Data.List import Util import Idea runGrep :: String -> ParseFlags -> [FilePath] -> IO () runGrep pattern flags files = do exp <- case parseExp pattern of ParseOk x -> return x ParseFailed sl msg -> exitMessage $ (if "Parse error" `isPrefixOf` msg then msg else "Parse error in pattern: " ++ msg) ++ "\n" ++ pattern ++ "\n" ++ replicate (srcColumn sl - 1) ' ' ++ "^" let scope = scopeCreate $ Module an Nothing [] [] [] let rule = hintRules [HintRule Warning "grep" scope exp (Tuple an Boxed []) Nothing []] forM_ files $ \file -> do res <- parseModuleEx flags file Nothing case res of Left (ParseError sl msg ctxt) -> do print $ rawIdea Warning (if "Parse error" `isPrefixOf` msg then msg else "Parse error: " ++ msg) (mkSrcSpan sl sl) ctxt Nothing [] Right m -> forM_ (applyHints [] rule [m]) $ \i -> print i{ideaHint="", ideaTo=Nothing}
bergmark/hlint
src/Grep.hs
bsd-3-clause
1,165
0
20
360
404
206
198
26
5
module Model.Browse ( BrowseByLink(..) , SortBy(..) ) where import Import data BrowseByLink = BrowseByAuthorLink | BrowseByCollectionLink | BrowseByResourceLink | BrowseByTagLink | BrowseByTypeLink deriving Eq data SortBy = SortByAZ | SortByCountUp -- lowest count at top | SortByCountDown -- highest count at top | SortByYearUp -- earliest year at top | SortByYearDown -- latest year at top deriving Eq instance Show SortBy where show SortByAZ = "a-z" show SortByCountUp = "count-up" show SortByCountDown = "count-down" show SortByYearUp = "year-up" show SortByYearDown = "year-down"
duplode/dohaskell
src/Model/Browse.hs
bsd-3-clause
688
0
6
185
121
73
48
24
0
{-# LANGUAGE GADTs #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ExistentialQuantification #-} module Data.Graph.DAG ( module Data.Graph.DAG.Edge , module Data.Graph.DAG.Edge.Utils , module Data.Graph.DAG.Node , DAG (..) , glookup ) where import Data.Graph.DAG.Edge import Data.Graph.DAG.Edge.Utils import Data.Graph.DAG.Node import Data.List (lookup) import Data.Singletons import Data.Proxy import Data.Maybe (fromJust) -- | A (potentially sparse) directed acyclic graph, composed of edges and nodes. data DAG es x u a = DAG { getEdgeSchema :: (EdgeSchema es x u) , getNodeSchema :: (NodeSchema a) } instance Functor (DAG es x u) where fmap f (DAG es xs) = DAG es $ fmap f xs -- | @Data.Map.lookup@ duplicate. glookup :: String -> DAG es x u a -> Maybe a glookup k (DAG _ xs) = nlookup k xs -- | Spanning trees of a graph. gspanningtrees :: SingI (SpanningTrees' es '[]) => DAG es x u a -> [RTree a] gspanningtrees g = fmap replace $ espanningtrees $ getEdgeSchema g where replace = fmap $ fromJust . flip glookup g -- | Spanning tree of a particular node. "A possible tree of possible results" gtree :: SingI (SpanningTrees' es '[]) => String -> DAG es x unique a -> Maybe (RTree a) gtree k g = fmap (fmap $ fromJust . flip glookup g) $ etree k $ getEdgeSchema g
athanclark/dag
src/Data/Graph/DAG.hs
bsd-3-clause
1,472
0
10
361
420
231
189
31
1
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} module Mantle.Interface where import Control.Monad.Writer import qualified Data.Map as M import Mantle.RTL import Mantle.Bits import Mantle.Circuit data Inner data Outer type family Flip d type instance Flip Inner = Outer type instance Flip Outer = Inner data VoidIfc ifc = VoidIfc infix 1 =: class Interface ifc where type FlipIfc ifc newIfc :: MonadCircuit c => c (ifc, FlipIfc ifc) (=:) :: MonadCircuit c => FlipIfc ifc -> ifc -> c () data family Signal a d data instance Signal a Inner = Input { unInput :: M.Map LValue (Output a -> Expr) } data instance Signal a Outer = Output { unOutput :: Expr } type Input a = Signal a Inner type Output a = Signal a Outer outputWire :: forall a. Bits a => Output a -> Circuit (Wire a) outputWire x = do (Wire w :: Wire a) <- newWire (refInput w) =: x return $ Wire w combOutput :: Bits a => Output a -> Circuit (Output a) combOutput x = do (Wire w) <- outputWire x return $ Output (Var w) refInput :: Ref -> Input a refInput x = Input $ M.singleton (NormalRef x) unOutput indexedInput :: Ref -> Expr -> Input a indexedInput x e = Input $ M.singleton (IndexedRef x e) unOutput assocsInput :: [(LValue, Output a -> Expr)] -> Input a assocsInput xs = Input $ M.fromListWith (error "Conflicting Inputs") xs bind :: Bits a => Input a -> Output a -> Circuit () bind (Input i) o = do signal <- if M.size i <= 1 then return o else combOutput o let bound = M.mapWithKey bindComb $ M.map ($ signal) i sequence_ $ M.elems $ bound instance Monoid (Input a) where mempty = Input $ mempty mappend (Input x) (Input y) = Input $ M.unionWith (error "Conflicting Inputs") x y class IsDir d where toSignal :: Wire a -> Signal a d bindSignal :: (Bits a, MonadCircuit c) => Signal a d -> Signal a (Flip d) -> c () extOutput :: forall a c. (Bits a, MonadCircuit c) => String -> c (Input a) extOutput n = do (ExtOutput o :: ExtOutput a) <- newExtOutput n return $ refInput o instance IsDir Inner where toSignal (Wire w) = refInput w bindSignal x y = liftCircuit $ bind x y extInput :: forall a c. (Bits a, MonadCircuit c) => String -> c (Output a) extInput n = do (ExtInput i :: ExtInput a) <- newExtInput n return $ Output (Var i) instance IsDir Outer where toSignal (Wire w) = Output (Var w) bindSignal y x = liftCircuit $ bind x y type Direction d = (IsDir d, IsDir (Flip d), d ~ Flip (Flip d)) instance (Direction d, Bits a) => Interface (Signal a d) where type FlipIfc (Signal a d) = Signal a (Flip d) newIfc = do w <- newWire return (toSignal w, toSignal w) (=:) = bindSignal type Component c ifc = FlipIfc ifc -> c (VoidIfc ifc) component :: MonadCircuit mc => mc () -> mc (VoidIfc ifc) component c = c >> return VoidIfc make :: (Interface ifc, MonadCircuit c) => Component c ifc -> c ifc make compF = do (outer,inner) <- newIfc compF inner return outer instance Interface () where type FlipIfc () = () newIfc = return ((),()) _ =: _ = return () instance (Interface a, Interface b) => Interface (a,b) where type FlipIfc (a,b) = (FlipIfc a, FlipIfc b) newIfc = do (ax,ay) <- newIfc (bx,by) <- newIfc return ((ax,bx),(ay,by)) (x1,y1) =: (x2,y2) = do x1 =: x2 y1 =: y2
aninhumer/mantle
src/Mantle/Interface.hs
bsd-3-clause
3,600
0
12
918
1,525
775
750
-1
-1