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 RecordWildCards #-} module TextBuffer where import qualified Data.Sequence as S import qualified Data.Text as T import Data.Foldable as F import Data.Char -- import Data.Maybe -- import Debug.Trace -- import Text.Printf import Prelude as P data Cursor = Cursor { preferredCol :: Int , line :: Int , col :: Int } deriving (Show) data RegionStyle = RS String deriving (Show, Eq, Ord) data Region = Region { startOffset :: Int , endOffset :: Int , styles :: [RegionStyle] } deriving (Show) type Selection = Region type CutBuffer = [T.Text] type Line = T.Text type BufferContent = S.Seq Line type Undo = [Buffer -> Buffer] data Buffer = Buffer { content :: BufferContent , cursor :: Cursor , selection :: [Selection] , initialSelectionOffset :: Int , regions :: [Region] , contentChanged :: Bool , undoStack :: Undo } isFirstLine :: Buffer -> Bool isFirstLine Buffer{..} = line cursor == 0 isLastLine :: Buffer -> Bool isLastLine Buffer{..} = line cursor == S.length content - 1 lineLength :: Int -> Buffer -> Int lineLength line Buffer{..} | line >= S.length content = 0 lineLength line Buffer{..} = T.length (S.index content line) curLineLength :: Buffer -> Int curLineLength b@Buffer{..} = lineLength (line cursor) b offsetToPos :: Buffer -> Int -> (Int, Int) offsetToPos b offset | offset <= lineLength 0 b = (0, offset) offsetToPos b@Buffer{..} offset = out where len = lineLength 0 b (line, off) = offsetToPos b{content = S.drop 1 content} (offset - (len + 1)) out = (line + 1, off) posToOffset :: Buffer -> Int -> Int -> Int posToOffset Buffer{..} line col = lineOffset + col where bSlice = S.take line content lineOffset = F.foldl fn 0 bSlice fn x y = x + T.length y + 1 -- Navigation setCursorColumn :: Int -> Buffer -> Buffer setCursorColumn pos b@Buffer{..} = buffer where buffer = b{cursor = cursor{col = pos', preferredCol = pos'}} pos' = min pos (curLineLength b) startOfLine :: Buffer -> Buffer startOfLine b@Buffer{..} = b{cursor = cursor{col = 0, preferredCol = 0}} endOfLine :: Buffer -> Buffer endOfLine b@Buffer{..} = b{cursor = cursor{col = pos, preferredCol = pos}} where pos = curLineLength b toOffset :: Int -> Buffer -> Buffer toOffset offset b@Buffer{..} = b{cursor = cursor{col = col, preferredCol = col, line = line}} where (line, col) = offsetToPos b offset -- Cursor Motion cursorLeft :: Buffer -> Buffer cursorLeft b@Buffer{..} | col == 0 && line /= 0 = b' where Cursor{..} = cursor b' = endOfLine $ b {cursor = cursor{line = line - 1}} cursorLeft b@Buffer{..} | col == 0 = b where Cursor{..} = cursor cursorLeft b@Buffer{..} = setCursorColumn pos b where Cursor{..} = cursor pos = col-1 cursorRight :: Buffer -> Buffer cursorRight b@Buffer{..} | (col == curLineLength b) && line /= (S.length content - 1) = b' where Cursor{..} = cursor b' = startOfLine $ b {cursor = cursor{line = line + 1}} cursorRight b@Buffer{..} | col == curLineLength b = b where Cursor{..} = cursor cursorRight b@Buffer{..} = setCursorColumn pos b where Cursor{..} = cursor pos = col+1 cursorUp :: Buffer -> Buffer cursorUp b@Buffer{..} = b{cursor = cursor'} where Cursor{..} = cursor newLine = max 0 (line-1) newCol = min (lineLength newLine b) preferredCol cursor' = cursor{ line = newLine, col = newCol} cursorDown :: Buffer -> Buffer cursorDown b@Buffer{..} = b{cursor = cursor'} where Cursor{..} = cursor newLine = min (S.length content-1) (line+1) newCol = min (lineLength newLine b) preferredCol cursor' = cursor{line = newLine, col = newCol} insertCharacterAt :: Char -> Int -> Buffer -> Buffer insertCharacterAt c offset b = b' where b' = insertCharacter c $ toOffset offset b insertString :: T.Text -> Buffer -> Buffer insertString s b = T.foldl fn b s where fn d c = insertCharacter c d insertStrings :: CutBuffer -> Buffer -> Buffer insertStrings [] b = b insertStrings [s] b = insertString s b insertStrings (s:ss) b = b' where b' = insertStrings ss $ breakLine $ insertString s b insertTextsAt :: CutBuffer -> Int -> Buffer -> Buffer insertTextsAt ss offset b = b' where b' = insertStrings ss $ toOffset offset b deleteCharacterAt :: Int -> Buffer -> Buffer deleteCharacterAt offset b = b' where b'= deleteCharacter $ toOffset offset b unbreakLineAt :: Int -> Buffer -> Buffer unbreakLineAt = deleteCharacterAt breakLineAt :: Int -> Buffer -> Buffer breakLineAt offset b = b' where b'= breakLine $ toOffset offset b splitAtCursor :: Buffer -> (Int, T.Text, T.Text) splitAtCursor b@Buffer{..} = (cpos, l, r) where Cursor{..} = cursor cpos = posToOffset b line col (l, r) = T.splitAt col $ S.index content line insertCharacter :: Char -> Buffer -> Buffer insertCharacter c b@Buffer{..} = dirty $ cursorRight b{content = content', undoStack = undo'} where Cursor{..} = cursor (cpos, l, r) = splitAtCursor b ln' = l `T.append` (c `T.cons` r) content' = S.update line ln' content undo' = deleteCharacterAt (cpos+1) : undoStack deleteCharacter :: Buffer -> Buffer deleteCharacter b@Buffer{..} | col cursor == 0 && not (isFirstLine b) = unbreakLine b deleteCharacter b@Buffer{..} | col cursor == 0 = b deleteCharacter b@Buffer{..} = dirty $ cursorLeft b{ content = content', undoStack = undo'} where Cursor{..} = cursor (cpos, l, r) = splitAtCursor b ln' = T.take (T.length l - 1) l `T.append` r content' = S.update line ln' content undo' = insertCharacterAt (T.last l) (cpos-1) : undoStack breakLine :: Buffer -> Buffer breakLine b@Buffer{..} = dirty $ b{content = content', cursor = cursor', undoStack = undo'} where Cursor{..} = cursor cpos = posToOffset b line col (l, r) = T.splitAt col ln (s, e) = S.splitAt line content ln S.:< eResid = S.viewl e content' = (s S.|> l S.|> r) S.>< eResid cursor' = cursor{line = line + 1, col = 0, preferredCol = 0} undo' = unbreakLineAt (cpos+1) : undoStack unbreakLine :: Buffer -> Buffer unbreakLine b@Buffer{..} = dirty b{content = content', cursor = cursor', undoStack = undo'} where Cursor{..} = cursor cpos = posToOffset b line col (s, e) = S.splitAt line content (s' S.:> ln1) = S.viewr s (ln2 S.:< e') = S.viewl e content' = (s' S.|> (ln1 `T.append` ln2)) S.>< e' cursor' = cursor {col = T.length ln1, line = line - 1, preferredCol = T.length ln1} undo' = breakLineAt (cpos-1) : undoStack undo :: Buffer -> Buffer undo b@Buffer{..} | P.null undoStack = b undo b@Buffer{..} = b' {undoStack = P.tail undoStack} where b' = P.head undoStack b clearSelection :: Buffer -> Buffer clearSelection b@Buffer{..} = b{selection = []} startSelection :: Buffer -> Buffer startSelection b@Buffer{..} = b{selection = [Region cpos cpos [RS "selected"]], initialSelectionOffset = cpos} where Cursor{..} = cursor cpos = posToOffset b line col updateSelection :: Buffer -> Buffer updateSelection b@Buffer{..} | F.null selection = b updateSelection b@Buffer{..} = b{selection = selection'} where Cursor{..} = cursor cpos = posToOffset b line col selection' = P.map fn selection fn r@Region{..} = r{startOffset = o, endOffset = p, styles = s} where (o, p, s) = case cpos of _ | cpos == startOffset -> (initialSelectionOffset, cpos, []) _ | cpos > startOffset -> (initialSelectionOffset, cpos-1, [RS "selected"]) -- Special case for reverse selection of EOL Character -- reverse selections are inclusive _ | cpos == startOffset - 1 && col == lineLength line b - 1 -> (initialSelectionOffset-1, cpos, []) _ -> (initialSelectionOffset- 1 , cpos, [RS "selected"]) cutSelection :: Buffer -> (Buffer, CutBuffer) cutSelection b@Buffer{..} | F.null selection = (b, []) cutSelection b@Buffer{..} | P.null (styles (P.head selection)) = (b{selection = []}, []) cutSelection b@Buffer{..} = (dirty b', linesDeleted) where [Region{..}] = selection Cursor{..} = cursor minPos = min startOffset endOffset maxPos = max startOffset endOffset (minLine, minCol) = offsetToPos b minPos (maxLine, maxCol) = offsetToPos b maxPos (before, remainder) = S.splitAt minLine content (selLine, after) = S.splitAt (maxLine - minLine + 1) remainder (fl S.:< _) = S.viewl selLine (_ S.:> ll) = S.viewr selLine lineOut = T.take minCol fl `T.append` T.drop (maxCol+1) ll cursor' = cursor{line = minLine, col = minCol, preferredCol = minCol} linesDeleted = if minLine == maxLine then [T.take (maxCol - minCol + 1) $ T.drop minCol fl] else T.drop minCol fl : P.take (S.length selLine - 2) (P.tail (F.toList selLine)) ++ [T.take (maxCol+1) ll] undo' = insertTextsAt linesDeleted minPos : undoStack b' = b{selection = [], content = (before S.|> lineOut) S.>< after, cursor = cursor', undoStack = undo'} paste :: CutBuffer -> Buffer -> Buffer paste cutLines b@Buffer{..} = dirty b' where Cursor{..} = cursor offset = posToOffset b line col b' = insertTextsAt cutLines offset b -- TODO undo -- undo' = deleteTextAt deleteSelection :: Buffer -> Buffer deleteSelection b = fst (cutSelection b) dirty :: Buffer -> Buffer dirty b@Buffer{..} = b{contentChanged = True}
polygonhell/textEditor
src/TextBuffer.hs
bsd-3-clause
9,418
0
19
2,099
3,906
2,093
1,813
206
4
{-# LANGUAGE NondecreasingIndentation #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE CPP #-} -- | This is the driver for the 'ghc --backpack' mode, which -- is a reimplementation of the "package manager" bits of -- Backpack directly in GHC. The basic method of operation -- is to compile packages and then directly insert them into -- GHC's in memory database. -- -- The compilation products of this mode aren't really suitable -- for Cabal, because GHC makes up component IDs for the things -- it builds and doesn't serialize out the database contents. -- But it's still handy for constructing tests. module DriverBkp (doBackpack) where #include "HsVersions.h" -- In a separate module because it hooks into the parser. import BkpSyn import GHC hiding (Failed, Succeeded) import Packages import Parser import Lexer import GhcMonad import DynFlags import TcRnMonad import TcRnDriver import Module import HscTypes import StringBuffer import FastString import ErrUtils import SrcLoc import HscMain import UniqFM import UniqDFM import Outputable import Maybes import HeaderInfo import MkIface import GhcMake import UniqDSet import PrelNames import BasicTypes hiding (SuccessFlag(..)) import Finder import Util import qualified GHC.LanguageExtensions as LangExt import Data.List import System.Exit import Control.Monad import System.FilePath import Data.Version -- for the unification import Data.IORef import Data.Map (Map) import qualified Data.Map as Map -- | Entry point to compile a Backpack file. doBackpack :: FilePath -> Ghc () doBackpack src_filename = do -- Apply options from file to dflags dflags0 <- getDynFlags let dflags1 = dflags0 src_opts <- liftIO $ getOptionsFromFile dflags1 src_filename (dflags, unhandled_flags, warns) <- liftIO $ parseDynamicFilePragma dflags1 src_opts modifySession (\hsc_env -> hsc_env {hsc_dflags = dflags}) -- Cribbed from: preprocessFile / DriverPipeline liftIO $ checkProcessArgsResult dflags unhandled_flags liftIO $ handleFlagWarnings dflags warns -- TODO: Preprocessing not implemented buf <- liftIO $ hGetStringBuffer src_filename let loc = mkRealSrcLoc (mkFastString src_filename) 1 1 -- TODO: not great case unP parseBackpack (mkPState dflags buf loc) of PFailed span err -> do liftIO $ throwOneError (mkPlainErrMsg dflags span err) POk _ pkgname_bkp -> do -- OK, so we have an LHsUnit PackageName, but we want an -- LHsUnit HsComponentId. So let's rename it. let bkp = renameHsUnits dflags (packageNameMap pkgname_bkp) pkgname_bkp initBkpM src_filename bkp $ forM_ (zip [1..] bkp) $ \(i, lunit) -> do let comp_name = unLoc (hsunitName (unLoc lunit)) msgTopPackage (i,length bkp) comp_name innerBkpM $ do let (cid, insts) = computeUnitId lunit if null insts then if cid == ComponentId (fsLit "main") then compileExe lunit else compileUnit cid [] else typecheckUnit cid insts computeUnitId :: LHsUnit HsComponentId -> (ComponentId, [(ModuleName, Module)]) computeUnitId (L _ unit) = (cid, [ (r, mkHoleModule r) | r <- reqs ]) where cid = hsComponentId (unLoc (hsunitName unit)) reqs = uniqDSetToList (unionManyUniqDSets (map (get_reqs . unLoc) (hsunitBody unit))) get_reqs (DeclD SignatureD (L _ modname) _) = unitUniqDSet modname get_reqs (DeclD ModuleD _ _) = emptyUniqDSet get_reqs (IncludeD (IncludeDecl (L _ hsuid) _)) = unitIdFreeHoles (convertHsUnitId hsuid) -- | Tiny enum for all types of Backpack operations we may do. data SessionType = ExeSession | TcSession | CompSession deriving (Eq) -- | Create a temporary Session to do some sort of type checking or -- compilation. withBkpSession :: ComponentId -> [(ModuleName, Module)] -> [(UnitId, ModRenaming)] -> SessionType -- what kind of session are we doing -> BkpM a -- actual action to run -> BkpM a withBkpSession cid insts deps session_type do_this = do dflags <- getDynFlags let (ComponentId cid_fs) = cid is_primary = False uid_str = unpackFS (hashUnitId cid insts) cid_str = unpackFS cid_fs -- There are multiple units in a single Backpack file, so we -- need to separate out the results in those cases. Right now, -- we follow this hierarchy: -- $outputdir/$compid --> typecheck results -- $outputdir/$compid/$unitid --> compile results key_base p | Just f <- p dflags = f | otherwise = "." sub_comp p | is_primary = p | otherwise = p </> cid_str outdir p | CompSession <- session_type -- Special case when package is definite , not (null insts) = sub_comp (key_base p) </> uid_str | otherwise = sub_comp (key_base p) withTempSession (overHscDynFlags (\dflags -> -- If we're type-checking an indefinite package, we want to -- turn on interface writing. However, if the user also -- explicitly passed in `-fno-code`, we DON'T want to write -- interfaces unless the user also asked for `-fwrite-interface`. (case session_type of -- Make sure to write interfaces when we are type-checking -- indefinite packages. TcSession | hscTarget dflags /= HscNothing -> flip gopt_set Opt_WriteInterface | otherwise -> id CompSession -> id ExeSession -> id) $ dflags { hscTarget = case session_type of TcSession -> HscNothing _ -> hscTarget dflags, thisUnitIdInsts_ = Just insts, thisComponentId_ = Just cid, thisInstalledUnitId = case session_type of TcSession -> newInstalledUnitId cid Nothing -- No hash passed if no instances _ | null insts -> newInstalledUnitId cid Nothing | otherwise -> newInstalledUnitId cid (Just (hashUnitId cid insts)), -- Setup all of the output directories according to our hierarchy objectDir = Just (outdir objectDir), hiDir = Just (outdir hiDir), stubDir = Just (outdir stubDir), -- Unset output-file for non exe builds outputFile = if session_type == ExeSession then outputFile dflags else Nothing, -- Synthesized the flags packageFlags = packageFlags dflags ++ map (\(uid0, rn) -> let uid = unwireUnitId dflags (improveUnitId (getPackageConfigMap dflags) $ renameHoleUnitId dflags (listToUFM insts) uid0) in ExposePackage (showSDoc dflags (text "-unit-id" <+> ppr uid <+> ppr rn)) (UnitIdArg uid) rn) deps } )) $ do dflags <- getSessionDynFlags -- pprTrace "flags" (ppr insts <> ppr deps) $ return () -- Calls initPackages _ <- setSessionDynFlags dflags do_this withBkpExeSession :: [(UnitId, ModRenaming)] -> BkpM a -> BkpM a withBkpExeSession deps do_this = do withBkpSession (ComponentId (fsLit "main")) [] deps ExeSession do_this getSource :: ComponentId -> BkpM (LHsUnit HsComponentId) getSource cid = do bkp_env <- getBkpEnv case Map.lookup cid (bkp_table bkp_env) of Nothing -> pprPanic "missing needed dependency" (ppr cid) Just lunit -> return lunit typecheckUnit :: ComponentId -> [(ModuleName, Module)] -> BkpM () typecheckUnit cid insts = do lunit <- getSource cid buildUnit TcSession cid insts lunit compileUnit :: ComponentId -> [(ModuleName, Module)] -> BkpM () compileUnit cid insts = do -- Let everyone know we're building this unit ID msgUnitId (newUnitId cid insts) lunit <- getSource cid buildUnit CompSession cid insts lunit -- Invariant: this NEVER returns InstalledUnitId hsunitDeps :: HsUnit HsComponentId -> [(UnitId, ModRenaming)] hsunitDeps unit = concatMap get_dep (hsunitBody unit) where get_dep (L _ (IncludeD (IncludeDecl (L _ hsuid) mb_lrn))) = [(convertHsUnitId hsuid, go mb_lrn)] where go Nothing = ModRenaming True [] go (Just lrns) = ModRenaming False (map convRn lrns) where convRn (L _ (Renaming (L _ from) Nothing)) = (from, from) convRn (L _ (Renaming (L _ from) (Just (L _ to)))) = (from, to) get_dep _ = [] buildUnit :: SessionType -> ComponentId -> [(ModuleName, Module)] -> LHsUnit HsComponentId -> BkpM () buildUnit session cid insts lunit = do let deps_w_rns = hsunitDeps (unLoc lunit) raw_deps = map fst deps_w_rns dflags <- getDynFlags -- The compilation dependencies are just the appropriately filled -- in unit IDs which must be compiled before we can compile. let hsubst = listToUFM insts deps0 = map (renameHoleUnitId dflags hsubst) raw_deps -- Build dependencies OR make sure they make sense. BUT NOTE, -- we can only check the ones that are fully filled; the rest -- we have to defer until we've typechecked our local signature. -- TODO: work this into GhcMake!! forM_ (zip [1..] deps0) $ \(i, dep) -> case session of TcSession -> return () _ -> compileInclude (length deps0) (i, dep) dflags <- getDynFlags -- IMPROVE IT let deps = map (improveUnitId (getPackageConfigMap dflags)) deps0 mb_old_eps <- case session of TcSession -> fmap Just getEpsGhc _ -> return Nothing conf <- withBkpSession cid insts deps_w_rns session $ do dflags <- getDynFlags mod_graph <- hsunitModuleGraph dflags (unLoc lunit) -- pprTrace "mod_graph" (ppr mod_graph) $ return () msg <- mkBackpackMsg ok <- load' LoadAllTargets (Just msg) mod_graph when (failed ok) (liftIO $ exitWith (ExitFailure 1)) let hi_dir = expectJust (panic "hiDir Backpack") $ hiDir dflags export_mod ms = (ms_mod_name ms, ms_mod ms) -- Export everything! mods = [ export_mod ms | ms <- mod_graph, ms_hsc_src ms == HsSrcFile ] -- Compile relevant only hsc_env <- getSession let home_mod_infos = eltsUDFM (hsc_HPT hsc_env) linkables = map (expectJust "bkp link" . hm_linkable) . filter ((==HsSrcFile) . mi_hsc_src . hm_iface) $ home_mod_infos getOfiles (LM _ _ us) = map nameOfObject (filter isObject us) obj_files = concatMap getOfiles linkables let compat_fs = (case cid of ComponentId fs -> fs) cand_compat_pn = PackageName compat_fs compat_pn = case session of TcSession -> cand_compat_pn _ | [] <- insts -> cand_compat_pn | otherwise -> PackageName compat_fs return InstalledPackageInfo { -- Stub data abiHash = "", sourcePackageId = SourcePackageId compat_fs, packageName = compat_pn, packageVersion = makeVersion [0], unitId = toInstalledUnitId (thisPackage dflags), componentId = cid, instantiatedWith = insts, -- Slight inefficiency here haha exposedModules = map (\(m,n) -> (m,Just n)) mods, hiddenModules = [], -- TODO: doc only depends = case session of -- Technically, we should state that we depend -- on all the indefinite libraries we used to -- typecheck this. However, this field isn't -- really used for anything, so we leave it -- blank for now. TcSession -> [] _ -> map (toInstalledUnitId . unwireUnitId dflags) $ deps ++ [ moduleUnitId mod | (_, mod) <- insts , not (isHoleModule mod) ], ldOptions = case session of TcSession -> [] _ -> obj_files, importDirs = [ hi_dir ], exposed = False, indefinite = case session of TcSession -> True _ -> False, -- nope hsLibraries = [], extraLibraries = [], extraGHCiLibraries = [], libraryDynDirs = [], libraryDirs = [], frameworks = [], frameworkDirs = [], ccOptions = [], includes = [], includeDirs = [], haddockInterfaces = [], haddockHTMLs = [], trusted = False } addPackage conf case mb_old_eps of Just old_eps -> updateEpsGhc_ (const old_eps) _ -> return () compileExe :: LHsUnit HsComponentId -> BkpM () compileExe lunit = do msgUnitId mainUnitId let deps_w_rns = hsunitDeps (unLoc lunit) deps = map fst deps_w_rns -- no renaming necessary forM_ (zip [1..] deps) $ \(i, dep) -> compileInclude (length deps) (i, dep) withBkpExeSession deps_w_rns $ do dflags <- getDynFlags mod_graph <- hsunitModuleGraph dflags (unLoc lunit) msg <- mkBackpackMsg ok <- load' LoadAllTargets (Just msg) mod_graph when (failed ok) (liftIO $ exitWith (ExitFailure 1)) addPackage :: GhcMonad m => PackageConfig -> m () addPackage pkg = do dflags0 <- GHC.getSessionDynFlags case pkgDatabase dflags0 of Nothing -> panic "addPackage: called too early" Just pkgs -> do let dflags = dflags0 { pkgDatabase = Just (pkgs ++ [("(in memory " ++ showSDoc dflags0 (ppr (unitId pkg)) ++ ")", [pkg])]) } _ <- GHC.setSessionDynFlags dflags -- By this time, the global ref has probably already -- been forced, in which case doing this isn't actually -- going to do you any good. -- dflags <- GHC.getSessionDynFlags -- liftIO $ setUnsafeGlobalDynFlags dflags return () -- Precondition: UnitId is NOT InstalledUnitId compileInclude :: Int -> (Int, UnitId) -> BkpM () compileInclude n (i, uid) = do hsc_env <- getSession let dflags = hsc_dflags hsc_env msgInclude (i, n) uid -- Check if we've compiled it already case lookupPackage dflags uid of Nothing -> do case splitUnitIdInsts uid of (_, Just indef) -> innerBkpM $ compileUnit (indefUnitIdComponentId indef) (indefUnitIdInsts indef) _ -> return () Just _ -> return () -- ---------------------------------------------------------------------------- -- Backpack monad -- | Backpack monad is a 'GhcMonad' which also maintains a little extra state -- beyond the 'Session', c.f. 'BkpEnv'. type BkpM = IOEnv BkpEnv -- | Backpack environment. NB: this has a 'Session' and not an 'HscEnv', -- because we are going to update the 'HscEnv' as we go. data BkpEnv = BkpEnv { -- | The session bkp_session :: Session, -- | The filename of the bkp file we're compiling bkp_filename :: FilePath, -- | Table of source units which we know how to compile bkp_table :: Map ComponentId (LHsUnit HsComponentId), -- | When a package we are compiling includes another package -- which has not been compiled, we bump the level and compile -- that. bkp_level :: Int } -- Blah, to get rid of the default instance for IOEnv -- TODO: just make a proper new monad for BkpM, rather than use IOEnv instance {-# OVERLAPPING #-} HasDynFlags BkpM where getDynFlags = fmap hsc_dflags getSession instance GhcMonad BkpM where getSession = do Session s <- fmap bkp_session getEnv readMutVar s setSession hsc_env = do Session s <- fmap bkp_session getEnv writeMutVar s hsc_env -- | Get the current 'BkpEnv'. getBkpEnv :: BkpM BkpEnv getBkpEnv = getEnv -- | Get the nesting level, when recursively compiling modules. getBkpLevel :: BkpM Int getBkpLevel = bkp_level `fmap` getBkpEnv -- | Apply a function on 'DynFlags' on an 'HscEnv' overHscDynFlags :: (DynFlags -> DynFlags) -> HscEnv -> HscEnv overHscDynFlags f hsc_env = hsc_env { hsc_dflags = f (hsc_dflags hsc_env) } -- | Run a 'BkpM' computation, with the nesting level bumped one. innerBkpM :: BkpM a -> BkpM a innerBkpM do_this = do -- NB: withTempSession mutates, so we don't have to worry -- about bkp_session being stale. updEnv (\env -> env { bkp_level = bkp_level env + 1 }) do_this -- | Update the EPS from a 'GhcMonad'. TODO move to appropriate library spot. updateEpsGhc_ :: GhcMonad m => (ExternalPackageState -> ExternalPackageState) -> m () updateEpsGhc_ f = do hsc_env <- getSession liftIO $ atomicModifyIORef' (hsc_EPS hsc_env) (\x -> (f x, ())) -- | Get the EPS from a 'GhcMonad'. getEpsGhc :: GhcMonad m => m ExternalPackageState getEpsGhc = do hsc_env <- getSession liftIO $ readIORef (hsc_EPS hsc_env) -- | Run 'BkpM' in 'Ghc'. initBkpM :: FilePath -> [LHsUnit HsComponentId] -> BkpM a -> Ghc a initBkpM file bkp m = do reifyGhc $ \session -> do let env = BkpEnv { bkp_session = session, bkp_table = Map.fromList [(hsComponentId (unLoc (hsunitName (unLoc u))), u) | u <- bkp], bkp_filename = file, bkp_level = 0 } runIOEnv env m -- ---------------------------------------------------------------------------- -- Messaging -- | Print a compilation progress message, but with indentation according -- to @level@ (for nested compilation). backpackProgressMsg :: Int -> DynFlags -> String -> IO () backpackProgressMsg level dflags msg = compilationProgressMsg dflags $ replicate (level * 2) ' ' ++ msg -- | Creates a 'Messager' for Backpack compilation; this is basically -- a carbon copy of 'batchMsg' but calling 'backpackProgressMsg', which -- handles indentation. mkBackpackMsg :: BkpM Messager mkBackpackMsg = do level <- getBkpLevel return $ \hsc_env mod_index recomp mod_summary -> let dflags = hsc_dflags hsc_env showMsg msg reason = backpackProgressMsg level dflags $ showModuleIndex mod_index ++ msg ++ showModMsg dflags (hscTarget dflags) (recompileRequired recomp) mod_summary ++ reason in case recomp of MustCompile -> showMsg "Compiling " "" UpToDate | verbosity (hsc_dflags hsc_env) >= 2 -> showMsg "Skipping " "" | otherwise -> return () RecompBecause reason -> showMsg "Compiling " (" [" ++ reason ++ "]") -- | 'PprStyle' for Backpack messages; here we usually want the module to -- be qualified (so we can tell how it was instantiated.) But we try not -- to qualify packages so we can use simple names for them. backpackStyle :: PprStyle backpackStyle = mkUserStyle (QueryQualify neverQualifyNames alwaysQualifyModules neverQualifyPackages) AllTheWay -- | Message when we initially process a Backpack unit. msgTopPackage :: (Int,Int) -> HsComponentId -> BkpM () msgTopPackage (i,n) (HsComponentId (PackageName fs_pn) _) = do dflags <- getDynFlags level <- getBkpLevel liftIO . backpackProgressMsg level dflags $ showModuleIndex (i, n) ++ "Processing " ++ unpackFS fs_pn -- | Message when we instantiate a Backpack unit. msgUnitId :: UnitId -> BkpM () msgUnitId pk = do dflags <- getDynFlags level <- getBkpLevel liftIO . backpackProgressMsg level dflags $ "Instantiating " ++ renderWithStyle dflags (ppr pk) backpackStyle -- | Message when we include a Backpack unit. msgInclude :: (Int,Int) -> UnitId -> BkpM () msgInclude (i,n) uid = do dflags <- getDynFlags level <- getBkpLevel liftIO . backpackProgressMsg level dflags $ showModuleIndex (i, n) ++ "Including " ++ renderWithStyle dflags (ppr uid) backpackStyle -- ---------------------------------------------------------------------------- -- Conversion from PackageName to HsComponentId type PackageNameMap a = Map PackageName a -- For now, something really simple, since we're not actually going -- to use this for anything unitDefines :: LHsUnit PackageName -> (PackageName, HsComponentId) unitDefines (L _ HsUnit{ hsunitName = L _ pn@(PackageName fs) }) = (pn, HsComponentId pn (ComponentId fs)) packageNameMap :: [LHsUnit PackageName] -> PackageNameMap HsComponentId packageNameMap units = Map.fromList (map unitDefines units) renameHsUnits :: DynFlags -> PackageNameMap HsComponentId -> [LHsUnit PackageName] -> [LHsUnit HsComponentId] renameHsUnits dflags m units = map (fmap renameHsUnit) units where renamePackageName :: PackageName -> HsComponentId renamePackageName pn = case Map.lookup pn m of Nothing -> case lookupPackageName dflags pn of Nothing -> error "no package name" Just cid -> HsComponentId pn cid Just hscid -> hscid renameHsUnit :: HsUnit PackageName -> HsUnit HsComponentId renameHsUnit u = HsUnit { hsunitName = fmap renamePackageName (hsunitName u), hsunitBody = map (fmap renameHsUnitDecl) (hsunitBody u) } renameHsUnitDecl :: HsUnitDecl PackageName -> HsUnitDecl HsComponentId renameHsUnitDecl (DeclD a b c) = DeclD a b c renameHsUnitDecl (IncludeD idecl) = IncludeD IncludeDecl { idUnitId = fmap renameHsUnitId (idUnitId idecl), idModRenaming = idModRenaming idecl } renameHsUnitId :: HsUnitId PackageName -> HsUnitId HsComponentId renameHsUnitId (HsUnitId ln subst) = HsUnitId (fmap renamePackageName ln) (map (fmap renameHsModuleSubst) subst) renameHsModuleSubst :: HsModuleSubst PackageName -> HsModuleSubst HsComponentId renameHsModuleSubst (lk, lm) = (lk, fmap renameHsModuleId lm) renameHsModuleId :: HsModuleId PackageName -> HsModuleId HsComponentId renameHsModuleId (HsModuleVar lm) = HsModuleVar lm renameHsModuleId (HsModuleId luid lm) = HsModuleId (fmap renameHsUnitId luid) lm convertHsUnitId :: HsUnitId HsComponentId -> UnitId convertHsUnitId (HsUnitId (L _ hscid) subst) = newUnitId (hsComponentId hscid) (map (convertHsModuleSubst . unLoc) subst) convertHsModuleSubst :: HsModuleSubst HsComponentId -> (ModuleName, Module) convertHsModuleSubst (L _ modname, L _ m) = (modname, convertHsModuleId m) convertHsModuleId :: HsModuleId HsComponentId -> Module convertHsModuleId (HsModuleVar (L _ modname)) = mkHoleModule modname convertHsModuleId (HsModuleId (L _ hsuid) (L _ modname)) = mkModule (convertHsUnitId hsuid) modname {- ************************************************************************ * * Module graph construction * * ************************************************************************ -} -- | This is our version of GhcMake.downsweep, but with a few modifications: -- -- 1. Every module is required to be mentioned, so we don't do any funny -- business with targets or recursively grabbing dependencies. (We -- could support this in principle). -- 2. We support inline modules, whose summary we have to synthesize ourself. -- -- We don't bother trying to support GhcMake for now, it's more trouble -- than it's worth for inline modules. hsunitModuleGraph :: DynFlags -> HsUnit HsComponentId -> BkpM ModuleGraph hsunitModuleGraph dflags unit = do let decls = hsunitBody unit pn = hsPackageName (unLoc (hsunitName unit)) -- 1. Create a HsSrcFile/HsigFile summary for every -- explicitly mentioned module/signature. let get_decl (L _ (DeclD dt lmodname mb_hsmod)) = do let hsc_src = case dt of ModuleD -> HsSrcFile SignatureD -> HsigFile Just `fmap` summariseDecl pn hsc_src lmodname mb_hsmod get_decl _ = return Nothing nodes <- catMaybes `fmap` mapM get_decl decls -- 2. For each hole which does not already have an hsig file, -- create an "empty" hsig file to induce compilation for the -- requirement. let node_map = Map.fromList [ ((ms_mod_name n, ms_hsc_src n == HsigFile), n) | n <- nodes ] req_nodes <- fmap catMaybes . forM (thisUnitIdInsts dflags) $ \(mod_name, _) -> let has_local = Map.member (mod_name, True) node_map in if has_local then return Nothing else fmap Just $ summariseRequirement pn mod_name -- 3. Return the kaboodle return (nodes ++ req_nodes) summariseRequirement :: PackageName -> ModuleName -> BkpM ModSummary summariseRequirement pn mod_name = do hsc_env <- getSession let dflags = hsc_dflags hsc_env let PackageName pn_fs = pn location <- liftIO $ mkHomeModLocation2 dflags mod_name (unpackFS pn_fs </> moduleNameSlashes mod_name) "hsig" env <- getBkpEnv time <- liftIO $ getModificationUTCTime (bkp_filename env) hi_timestamp <- liftIO $ modificationTimeIfExists (ml_hi_file location) let loc = srcLocSpan (mkSrcLoc (mkFastString (bkp_filename env)) 1 1) mod <- liftIO $ addHomeModuleToFinder hsc_env mod_name location extra_sig_imports <- liftIO $ findExtraSigImports hsc_env HsigFile mod_name return ModSummary { ms_mod = mod, ms_hsc_src = HsigFile, ms_location = location, ms_hs_date = time, ms_obj_date = Nothing, ms_iface_date = hi_timestamp, ms_srcimps = [], ms_textual_imps = extra_sig_imports, ms_parsed_mod = Just (HsParsedModule { hpm_module = L loc (HsModule { hsmodName = Just (L loc mod_name), hsmodExports = Nothing, hsmodImports = [], hsmodDecls = [], hsmodDeprecMessage = Nothing, hsmodHaddockModHeader = Nothing }), hpm_src_files = [], hpm_annotations = (Map.empty, Map.empty) }), ms_hspp_file = "", -- none, it came inline ms_hspp_opts = dflags, ms_hspp_buf = Nothing } summariseDecl :: PackageName -> HscSource -> Located ModuleName -> Maybe (Located (HsModule RdrName)) -> BkpM ModSummary summariseDecl pn hsc_src (L _ modname) (Just hsmod) = hsModuleToModSummary pn hsc_src modname hsmod summariseDecl _pn hsc_src lmodname@(L loc modname) Nothing = do hsc_env <- getSession let dflags = hsc_dflags hsc_env -- TODO: this looks for modules in the wrong place r <- liftIO $ summariseModule hsc_env Map.empty -- GHC API recomp not supported (hscSourceToIsBoot hsc_src) lmodname True -- Target lets you disallow, but not here Nothing -- GHC API buffer support not supported [] -- No exclusions case r of Nothing -> throwOneError (mkPlainErrMsg dflags loc (text "module" <+> ppr modname <+> text "was not found")) Just (Left err) -> throwOneError err Just (Right summary) -> return summary -- | Up until now, GHC has assumed a single compilation target per source file. -- Backpack files with inline modules break this model, since a single file -- may generate multiple output files. How do we decide to name these files? -- Should there only be one output file? This function our current heuristic, -- which is we make a "fake" module and use that. hsModuleToModSummary :: PackageName -> HscSource -> ModuleName -> Located (HsModule RdrName) -> BkpM ModSummary hsModuleToModSummary pn hsc_src modname hsmod@(L loc (HsModule _ _ imps _ _ _)) = do hsc_env <- getSession -- Sort of the same deal as in DriverPipeline's getLocation -- Use the PACKAGE NAME to find the location let PackageName unit_fs = pn dflags = hsc_dflags hsc_env -- Unfortunately, we have to define a "fake" location in -- order to appease the various code which uses the file -- name to figure out where to put, e.g. object files. -- To add insult to injury, we don't even actually use -- these filenames to figure out where the hi files go. -- A travesty! location0 <- liftIO $ mkHomeModLocation2 dflags modname (unpackFS unit_fs </> moduleNameSlashes modname) (case hsc_src of HsigFile -> "hsig" HsBootFile -> "hs-boot" HsSrcFile -> "hs") -- DANGEROUS: bootifying can POISON the module finder cache let location = case hsc_src of HsBootFile -> addBootSuffixLocn location0 _ -> location0 -- This duplicates a pile of logic in GhcMake env <- getBkpEnv time <- liftIO $ getModificationUTCTime (bkp_filename env) hi_timestamp <- liftIO $ modificationTimeIfExists (ml_hi_file location) -- Also copied from 'getImports' let (src_idecls, ord_idecls) = partition (ideclSource.unLoc) imps -- GHC.Prim doesn't exist physically, so don't go looking for it. ordinary_imps = filter ((/= moduleName gHC_PRIM) . unLoc . ideclName . unLoc) ord_idecls implicit_prelude = xopt LangExt.ImplicitPrelude dflags implicit_imports = mkPrelImports modname loc implicit_prelude imps convImport (L _ i) = (fmap sl_fs (ideclPkgQual i), ideclName i) extra_sig_imports <- liftIO $ findExtraSigImports hsc_env hsc_src modname let normal_imports = map convImport (implicit_imports ++ ordinary_imps) required_by_imports <- liftIO $ implicitRequirements hsc_env normal_imports -- So that Finder can find it, even though it doesn't exist... this_mod <- liftIO $ addHomeModuleToFinder hsc_env modname location return ModSummary { ms_mod = this_mod, ms_hsc_src = hsc_src, ms_location = location, ms_hspp_file = (case hiDir dflags of Nothing -> "" Just d -> d) </> ".." </> moduleNameSlashes modname <.> "hi", ms_hspp_opts = dflags, ms_hspp_buf = Nothing, ms_srcimps = map convImport src_idecls, ms_textual_imps = normal_imports -- We have to do something special here: -- due to merging, requirements may end up with -- extra imports ++ extra_sig_imports ++ required_by_imports, -- This is our hack to get the parse tree to the right spot ms_parsed_mod = Just (HsParsedModule { hpm_module = hsmod, hpm_src_files = [], -- TODO if we preprocessed it hpm_annotations = (Map.empty, Map.empty) -- BOGUS }), ms_hs_date = time, ms_obj_date = Nothing, -- TODO do this, but problem: hi_timestamp is BOGUS ms_iface_date = hi_timestamp } -- | Create a new, externally provided hashed unit id from -- a hash. newInstalledUnitId :: ComponentId -> Maybe FastString -> InstalledUnitId newInstalledUnitId (ComponentId cid_fs) (Just fs) = InstalledUnitId (cid_fs `appendFS` mkFastString "+" `appendFS` fs) newInstalledUnitId (ComponentId cid_fs) Nothing = InstalledUnitId cid_fs
mettekou/ghc
compiler/backpack/DriverBkp.hs
bsd-3-clause
32,927
0
29
10,087
7,101
3,642
3,459
536
8
{-# LANGUAGE NoMonomorphismRestriction #-} --{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE RankNTypes #-} module Utils ( Monad' , (<&>) , MonadTrace (..), TraceT, runTraceT , Reversible (..), ReversibleT, postponed, reversible, neut, runRev, orElse , SimpleRefs (..), modSimpleRef, memoRead , RefContext , Exc, when', assert_, assert , IsSeq (..), S.Seq, FakeSeq , Time, prevTime, nextTime ) where import Data.Monoid import Data.IORef import Data.STRef import qualified Data.Sequence as S import Control.Applicative import Control.Arrow import Control.Monad.Identity import Control.Monad.Reader import Control.Monad.Writer import Control.Monad.State import Control.Monad.Except import Control.Monad.ST import Lens.Family2 (Lens') -------------------------------------------------------------------------------- Monad - Applicative (eliminate later) type Monad' m = (Monad m, Applicative m) -------------------------------------------------------------------------------- misc aux infixl 1 <&> (<&>) = flip (<$>) -------------------------------------------------------------------------------- exceptions type Exc = ExceptT String assert :: Monad m => String -> Exc m b -> m b assert msg m = runExceptT m >>= \case Left er -> error $ msg ++ ": " ++ er Right x -> return x assert_ :: String -> Bool -> a -> a assert_ _ True x = x assert_ msg False _ = error $ "assert: " ++ msg when' :: (Monad m, Monoid a) => Bool -> m a -> m a when' b m = if b then m else return mempty -------------------------------------------------------------------------------- tracing -- TODO: fancier tracing (indentation, tracing levels) class Monad' m => MonadTrace m where traceM :: String -> m () instance MonadTrace m => MonadTrace (ReaderT r m) where traceM = lift . traceM instance MonadTrace m => MonadTrace (StateT s m) where traceM = lift . traceM instance (MonadTrace m, Monoid w) => MonadTrace (WriterT w m) where traceM = lift . traceM instance (MonadTrace m) => MonadTrace (ExceptT e m) where traceM = lift . traceM instance MonadTrace (ST s) where traceM _ = return () -- TODO: replace with dummy instance; use TraceT instead instance MonadTrace IO where traceM = putStrLn -- traceM _ = return () ------------------- newtype TraceT m a = TraceT { unTraceT :: WriterT [String] m a } deriving (Functor, Applicative, Monad, MonadFix) instance MonadTrans TraceT where lift = TraceT . lift instance Monad' m => MonadTrace (TraceT m) where traceM = TraceT . tell . (:[]) runTraceT :: Monad m => TraceT m a -> m (a, [String]) runTraceT (TraceT m) = runWriterT m -------------------------------------------------------------------------------- Reversible monads class Monad' m => Reversible m where -- Left: restore state & continue, Right: keep state & return restore :: m (Either (m a) a) -> m a instance Reversible Identity where restore m = Identity $ runIdentity ||| id $ runIdentity m instance Reversible m => Reversible (ReaderT r m) where restore m = ReaderT $ \r -> restore $ runReaderT m r <&> (flip runReaderT r +++ id) instance (Reversible m, Monoid e) => Reversible (WriterT e m) where restore m = WriterT $ restore $ runWriterT m <&> \(a, e) -> runWriterT +++ flip (,) e $ a instance Reversible m => Reversible (StateT st m) where restore m = StateT $ \st -> restore $ runStateT m st <&> \(a, st') -> flip runStateT st +++ flip (,) st' $ a instance Reversible m => Reversible (TraceT m) where restore m = TraceT $ restore $ unTraceT m <&> (unTraceT +++ id) -- dummy instance instance Reversible IO where restore m = m <&> either (const $ error "cannot reverse IO operation") id -- dummy instance instance Reversible (ST s) where restore m = m <&> either (const $ error "cannot reverse ST operation") id -- Just, if at least one is Just (also when the other is error) -- Nothing, if all is Nothing -- error otherwise orElse :: (Reversible m, MonadTrace m) => String -> Exc m (Maybe a) -> Exc m (Maybe a) -> Exc m (Maybe a) orElse msg m1 m2 = ExceptT $ restore $ runExceptT m1 <&> \case Right (Just a) -> {-trace " ok" $ -} Right $ Right $ Just a Right Nothing -> Left $ traceM (" <- " ++ msg) >> runExceptT m2 Left e -> Left $ traceM (" <----- bt " ++ msg ++ " because " ++ e) >> runExceptT m2 <&> \case Right Nothing -> Left e x -> x -------------------------------------------------------------------------------- Reversible monad transformer newtype ReversibleT m a = ReversibleT (ReaderT Bool (WriterT (MM m, Dual (MM m)) m) a) deriving (Functor, Applicative, Monad, MonadFix) -- TODO: replace this with reversed trace instance (MonadTrace m) => MonadTrace (ReversibleT m) where traceM = ReversibleT . traceM runRev :: Monad m => ReversibleT m a -> m a runRev (ReversibleT m) = liftM fst $ runWriterT $ flip runReaderT False m neut :: Monad m => m a -> ReversibleT m a neut = ReversibleT . lift . lift postponed :: Monad m => m () -> ReversibleT m () postponed m = ReversibleT $ do b <- ask if b then tell (MM m, mempty) else lift $ lift m reversible :: Monad m => m (a, m ()) -> ReversibleT m a reversible m = ReversibleT $ do (a, r) <- lift $ lift m b <- ask when b $ tell (mempty, Dual $ MM r) return a instance Monad' m => Reversible (ReversibleT m) where restore (ReversibleT m) = ReversibleT $ do (e, (post, rev)) <- lift $ lift $ runWriterT $ flip runReaderT True m b <- ask case e of Left (ReversibleT m') -> do if b then tell (mempty, rev) else lift $ lift $ getMM $ getDual rev m' Right a -> do if b then tell (post, mempty) else lift $ lift $ getMM post return a ------------ newtype MM m = MM { getMM :: m () } instance Monad m => Monoid (MM m) where mempty = MM $ return () MM a `mappend` MM b = MM $ a >> b -------------------------------------------------------------------------------- simple references class Monad' m => SimpleRefs m where type SimpleRef m :: * -> * -- simple reference newSimpleRef :: a -> m (SimpleRef m a) readSimpleRef :: SimpleRef m a -> m a writeSimpleRef :: SimpleRef m a -> a -> m () instance SimpleRefs IO where type SimpleRef IO = IORef newSimpleRef x = newIORef x readSimpleRef r = readIORef r writeSimpleRef r a = writeIORef r a instance SimpleRefs (ST s) where type SimpleRef (ST s) = STRef s newSimpleRef = newSTRef readSimpleRef = readSTRef writeSimpleRef = writeSTRef instance SimpleRefs m => SimpleRefs (ReaderT r m) where type SimpleRef (ReaderT r m) = SimpleRef m newSimpleRef = lift . newSimpleRef readSimpleRef = lift . readSimpleRef writeSimpleRef r = lift . writeSimpleRef r instance (SimpleRefs m, Monoid w) => SimpleRefs (WriterT w m) where type SimpleRef (WriterT w m) = SimpleRef m newSimpleRef = lift . newSimpleRef readSimpleRef = lift . readSimpleRef writeSimpleRef r = lift . writeSimpleRef r instance (SimpleRefs m) => SimpleRefs (StateT w m) where type SimpleRef (StateT w m) = SimpleRef m newSimpleRef = lift . newSimpleRef readSimpleRef = lift . readSimpleRef writeSimpleRef r = lift . writeSimpleRef r instance (SimpleRefs m) => SimpleRefs (TraceT m) where type SimpleRef (TraceT m) = SimpleRef m newSimpleRef = lift . newSimpleRef readSimpleRef = lift . readSimpleRef writeSimpleRef r = lift . writeSimpleRef r instance SimpleRefs m => SimpleRefs (ReversibleT m) where type SimpleRef (ReversibleT m) = SimpleRef m newSimpleRef a = neut $ newSimpleRef a readSimpleRef r = neut $ readSimpleRef r writeSimpleRef r a = reversible $ readSimpleRef r >>= \v -> writeSimpleRef r a >> return ((), writeSimpleRef r v) modSimpleRef :: SimpleRefs m => SimpleRef m a -> (a -> m (a, b)) -> m b modSimpleRef x f = do v <- readSimpleRef x (v', a) <- f v writeSimpleRef x v' return a memoRead :: SimpleRefs m => m a -> m (m a) memoRead g = do s <- newSimpleRef Nothing pure $ readSimpleRef s >>= \case Just a -> pure a Nothing -> g >>= \a -> a <$ writeSimpleRef s (Just a) -------------------------------------------------------------------------------- RefContext -- TODO: eliminate? type RefContext m = (SimpleRefs m, Reversible m, MonadFix m, MonadTrace m) -------------------------------------------------------------------------------- discrete time newtype Time = Time Int deriving (Eq, Ord, Show) instance Monoid Time where mempty = Time 0 mappend = max nextTime :: Time -> Time nextTime (Time x) = Time (x + 1) prevTime (Time 0) = error "before 0" prevTime (Time x) = Time (x - 1) -------------------------------------------------------------------------------- sequences class IsSeq c where toList' :: c a -> [a] length' :: c a -> Int last' :: c a -> a snoc' :: c a -> a -> c a singleton :: a -> c a -- may fail at' :: Int -> Lens' (c a) a instance IsSeq S.Seq where toList' x = case S.viewl x of a S.:< x -> a: toList' x _ -> [] length' = S.length last' (S.viewr -> _ S.:> x) = x last' _ = error "impossible" snoc' = (S.|>) singleton = S.singleton at' i tr m = tr (S.index m i) <&> \x -> S.update i x m data FakeSeq a = FakeSeq {len :: Int, elemm :: a} instance IsSeq FakeSeq where toList' = (:[]) . elemm length' = len last' = elemm snoc' (FakeSeq n _) x = FakeSeq (n+1) x singleton = FakeSeq 1 at' i tr ~FakeSeq{..} = assert_ (show (len-1, i)) (i == len-1) (tr elemm) <&> \elemm -> FakeSeq{..}
divipp/lensref
src/Utils.hs
bsd-3-clause
9,990
0
17
2,313
3,481
1,791
1,690
210
4
{-# LANGUAGE MultiParamTypeClasses ,FunctionalDependencies ,FlexibleInstances ,FlexibleContexts ,GeneralizedNewtypeDeriving ,TypeSynonymInstances ,TypeOperators ,ParallelListComp ,BangPatterns #-} {-# OPTIONS -cpp #-} {-| Funsat aims to be a reasonably efficient modern SAT solver that is easy to integrate as a backend to other projects. SAT is NP-complete, and thus has reductions from many other interesting problems. We hope this implementation is efficient enough to make it useful to solve medium-size, real-world problem mapped from another space. We also have taken pains test the solver rigorously to encourage confidence in its output. One particular nicetie facilitating integration of Funsat into other projects is the efficient calculation of an /unsatisfiable core/ for unsatisfiable problems (see the "Funsat.Resolution" module). In the case a problem is unsatisfiable, as a by-product of checking the proof of unsatisfiability, Funsat will generate a minimal set of input clauses that are also unsatisfiable. Another is the ability to compile high-level circuits into CNF. Seen the "Funsat.Circuit" module. * 07 Jun 2008 21:43:42: N.B. because of the use of mutable arrays in the ST monad, the solver will actually give _wrong_ answers if you compile without optimisation. Which is okay, 'cause that's really slow anyway. [@Bibliography@] * ''Abstract DPLL and DPLL Modulo Theories'' * ''Chaff: Engineering an Efficient SAT solver'' * ''An Extensible SAT-solver'' by Niklas Een, Niklas Sorensson * ''Efficient Conflict Driven Learning in a Boolean Satisfiability Solver'' by Zhang, Madigan, Moskewicz, Malik * ''SAT-MICRO: petit mais costaud!'' by Conchon, Kanig, and Lescuyer -} module Funsat.Solver #ifndef TESTING ( -- * Interface solve , solve1 , Solution(..) -- ** Verification , verify , VerifyError(..) -- ** Configuration , FunsatConfig(..) , defaultConfig -- * Solver statistics , Stats(..) , ShowWrapped(..) , statTable , statSummary ) #endif where {- This file is part of funsat. funsat is free software: it is released under the BSD3 open source license. You can find details of this license in the file LICENSE at the root of the source tree. Copyright 2008 Denis Bueno -} import Control.Arrow( (&&&) ) import Control.Exception( assert ) import Control.Monad.Error hiding ( (>=>), forM_, runErrorT ) -- import Control.Monad.MonadST( MonadST(..) ) import Control.Monad.ST.Strict import Control.Monad.State.Lazy hiding ( (>=>), forM_ ) import Data.Array.ST hiding (unsafeFreeze) import Data.Array.Unsafe(unsafeFreeze) import Data.Array.Unboxed import Data.Foldable hiding ( sequence_ ) import Data.Int( Int64 ) import Data.List( nub, tails, sortBy, sort ) import Data.Maybe import Data.Ord( comparing ) import Data.STRef -- import Data.Sequence( Seq ) -- import Debug.Trace (trace) import Funsat.Monad import Funsat.Utils import Funsat.Resolution( ResolutionTrace(..), initResolutionTrace ) import Funsat.Types import Funsat.Types.Internal import Prelude hiding ( sum, concatMap, elem, foldr, foldl, any, maximum ) import Funsat.Resolution( ResolutionError(..) ) import Text.Printf( printf ) import qualified Data.Foldable as Fl -- import qualified Data.List as List import qualified Data.Map as Map import qualified Data.Sequence as Seq import qualified Data.Set as Set import qualified Funsat.Resolution as Resolution import qualified Text.Tabular as Tabular -- * Interface -- | Run the DPLL-based SAT solver on the given CNF instance. Returns a -- solution, along with internal solver statistics and possibly a resolution -- trace. The trace is for checking a proof of `Unsat', and thus is only -- present when the result is `Unsat'. solve :: FunsatConfig -> CNF -> (Solution, Stats, Maybe ResolutionTrace) solve cfg fIn = -- To solve, we simply take baby steps toward the solution using solveStep, -- starting with an initial assignment. -- trace ("input " ++ show f) $ either (error "solve: invariant violated") id $ runST $ evalSSTErrMonad (do initialAssignment <- liftST $ newSTUArray (V 1, V (numVars f)) 0 (a, isUnsat) <- initialState initialAssignment if isUnsat then reportSolution (Unsat a) else stepToSolution initialAssignment >>= reportSolution) SC{ cnf = f{ clauses = Set.empty }, dl = [] , watches = undefined, learnt = undefined , propQ = Seq.empty, trail = [], level = undefined , stats = FunStats{numConfl = 0,numConflTotal = 0,numDecisions = 0,numImpl = 0} , reason = Map.empty, varOrder = undefined , resolutionTrace = PartialResolutionTrace 1 [] [] Map.empty , dpllConfig = cfg } where f = preprocessCNF fIn -- If returns True, then problem is unsat. initialState :: MAssignment s -> FunMonad s (IAssignment, Bool) initialState m = do initialLevel <- liftST $ newSTUArray (V 1, V (numVars f)) noLevel modify $ \s -> s{ level = initialLevel } initialWatches <- liftST $ newSTArray (L (- (numVars f)), L (numVars f)) [] modify $ \s -> s{ watches = initialWatches } initialLearnts <- liftST $ newSTArray (L (- (numVars f)), L (numVars f)) [] modify $ \s -> s{ learnt = initialLearnts } initialVarOrder <- liftST $ newSTUArray (V 1, V (numVars f)) initialActivity modify $ \s -> s{ varOrder = VarOrder initialVarOrder } -- Watch each clause, making sure to bork if we find a contradiction. (`catchError` (const $ liftST (unsafeFreezeAss m) >>= \a -> return (a,True))) $ do forM_ (clauses f) (\c -> do cid <- nextTraceId isConsistent <- watchClause m (c, cid) False when (not isConsistent) -- conflict data is ignored here, so safe to fake (do traceClauseId cid ; throwError (L 0, [], 0))) a <- liftST (unsafeFreezeAss m) return (a, False) -- | Solve with the default configuration `defaultConfig'. solve1 :: CNF -> (Solution, Stats, Maybe ResolutionTrace) solve1 = solve defaultConfig -- | This function applies `solveStep' recursively until SAT instance is -- solved, starting with the given initial assignment. It also implements the -- conflict-based restarting (see `FunsatConfig'). stepToSolution :: MAssignment s -> FunMonad s Solution stepToSolution assignment = do step <- solveStep assignment useRestarts <- gets (configUseRestarts . dpllConfig) isTimeToRestart <- uncurry ((>=)) `liftM` gets ((numConfl . stats) &&& (configRestart . dpllConfig)) case step of Left m -> do when (useRestarts && isTimeToRestart) (do _stats <- extractStats -- trace ("Restarting...") $ -- trace (statSummary stats) $ resetState m) stepToSolution m Right s -> return s where resetState m = do modify $ \s -> let st = stats s in s{ stats = st{numConfl = 0} } -- Require more conflicts before next restart. modifySlot dpllConfig $ \s c -> s{ dpllConfig = c{ configRestart = ceiling (configRestartBump c * fromIntegral (configRestart c)) } } lvl :: FrozenLevelArray <- gets level >>= liftST . unsafeFreeze undoneLits <- takeWhile (\l -> lvl ! (var l) > 0) `liftM` gets trail forM_ undoneLits $ const (undoOne m) modify $ \s -> s{ dl = [], propQ = Seq.empty } compactDB unsafeFreezeAss m >>= simplifyDB reportSolution :: Solution -> FunMonad s (Solution, Stats, Maybe ResolutionTrace) reportSolution s = do stats <- extractStats case s of Sat _ -> return (s, stats, Nothing) Unsat _ -> do resTrace <- constructResTrace s return (s, stats, Just resTrace) -- | A default configuration based on the formula to solve. -- -- * restarts every 100 conflicts -- -- * requires 1.5 as many restarts after restarting as before, each time -- -- * VSIDS to be enabled -- -- * restarts to be enabled defaultConfig :: FunsatConfig defaultConfig = Cfg { configRestart = 100 -- fromIntegral $ max (numVars f `div` 10) 100 , configRestartBump = 1.5 , configUseVSIDS = True , configUseRestarts = True } -- * Preprocessing -- | Some kind of preprocessing. -- -- * remove duplicates preprocessCNF :: CNF -> CNF preprocessCNF f = f{clauses = simpClauses (clauses f)} where simpClauses = Set.map nub -- rm dups -- | Simplify the clause database. Eventually should supersede, probably, -- `preprocessCNF'. -- -- Precondition: decision level 0. simplifyDB :: IAssignment -> FunMonad s () simplifyDB mFr = do -- For each clause in the database, remove it if satisfied; if it contains a -- literal whose negation is assigned, delete that literal. n <- numVars `liftM` gets cnf s <- get liftST . forM_ [V 1 .. V n] $ \i -> when (mFr!i /= 0) $ do let l = L (mFr!i) filterL _i = map (\(p, c, cid) -> (p, filter (/= negate l) c, cid)) -- Remove unsat literal `negate l' from clauses. -- modifyArray (watches s) l filterL modifyArray (learnt s) l filterL -- Clauses containing `l' are Sat. -- writeArray (watches s) (negate l) [] writeArray (learnt s) (negate l) [] -- * Internals -- | The DPLL procedure is modeled as a state transition system. This -- function takes one step in that transition system. Given an unsatisfactory -- assignment, perform one state transition, producing a new assignment and a -- new state. solveStep :: MAssignment s -> FunMonad s (Either (MAssignment s) Solution) solveStep m = do unsafeFreezeAss m >>= solveStepInvariants conf <- gets dpllConfig let selector = if configUseVSIDS conf then select else selectStatic maybeConfl <- bcp m mFr <- unsafeFreezeAss m voArr <- gets (varOrderArr . varOrder) voFr <- FrozenVarOrder `liftM` liftST (unsafeFreeze voArr) s <- get stepForward $ -- Check if unsat. unsat maybeConfl s ==> postProcessUnsat maybeConfl -- Unit propagation may reveal conflicts; check. >< maybeConfl >=> backJump m -- No conflicts. Decide. >< selector mFr voFr >=> decide m where -- Take the step chosen by the transition guards above. stepForward Nothing = (Right . Sat) `liftM` unsafeFreezeAss m stepForward (Just step) = do r <- step case r of Nothing -> (Right . Unsat) `liftM` liftST (unsafeFreezeAss m) Just m -> return . Left $ m -- | /Precondition:/ problem determined to be unsat. -- -- Records id of conflicting clause in trace before failing. Always returns -- `Nothing'. postProcessUnsat :: Maybe (Lit, Clause, ClauseId) -> FunMonad s (Maybe a) postProcessUnsat maybeConfl = do traceClauseId $ (thd . fromJust) maybeConfl return Nothing where thd (_,_,i) = i -- | Check data structure invariants. Unless @-fno-ignore-asserts@ is passed, -- this should be optimised away to nothing. solveStepInvariants :: IAssignment -> FunMonad s () {-# INLINE solveStepInvariants #-} solveStepInvariants _m = assert True $ do s <- get -- no dups in decision list or trail assert ((length . dl) s == (length . nub . dl) s) $ assert ((length . trail) s == (length . nub . trail) s) $ return () -- ** Internals -- | Value of the `level' array if corresponding variable unassigned. Had -- better be less that 0. noLevel :: Level noLevel = -1 -- *** Boolean constraint propagation -- | Assign a new literal, and enqueue any implied assignments. If a conflict -- is detected, return @Just (impliedLit, conflictingClause)@; otherwise -- return @Nothing@. The @impliedLit@ is implied by the clause, but conflicts -- with the assignment. -- -- If no new clauses are unit (i.e. no implied assignments), simply update -- watched literals. bcpLit :: MAssignment s -> Lit -- ^ Assigned literal which might propagate. -> FunMonad s (Maybe (Lit, Clause, ClauseId)) bcpLit m l = do ws <- gets watches ; ls <- gets learnt clauses <- liftST $ readArray ws l learnts <- liftST $ readArray ls l liftST $ do writeArray ws l [] ; writeArray ls l [] -- Update wather lists for normal & learnt clauses; if conflict is found, -- return that and don't update anything else. (`catchError` return . Just) $ do {-# SCC "bcpWatches" #-} forM_ (tails clauses) (updateWatches (\ f l -> liftST $ modifyArray ws l (const f))) {-# SCC "bcpLearnts" #-} forM_ (tails learnts) (updateWatches (\ f l -> liftST $ modifyArray ls l (const f))) return Nothing -- no conflict where -- updateWatches: `l' has been assigned, so we look at the clauses in -- which contain @negate l@, namely the watcher list for l. For each -- annotated clause, find the status of its watched literals. If a -- conflict is found, the at-fault clause is returned through Left, and -- the unprocessed clauses are placed back into the appropriate watcher -- list. {-# INLINE updateWatches #-} updateWatches _ [] = return () updateWatches alter (annCl@(watchRef, c, cid) : restClauses) = do mFr <- unsafeFreezeAss m q <- liftST $ do (x, y) <- readSTRef watchRef return $ if x == l then y else x -- l,q are the (negated) literals being watched for clause c. if negate q `isTrueUnder` mFr -- if other true, clause already sat then alter (annCl:) l else case find (\x -> x /= negate q && x /= negate l && not (x `isFalseUnder` mFr)) c of Just l' -> do -- found unassigned literal, negate l', to watch liftST $ writeSTRef watchRef (q, negate l') alter (annCl:) (negate l') Nothing -> do -- all other lits false, clause is unit incNumImpl alter (annCl:) l isConsistent <- enqueue m (negate q) (Just (c, cid)) when (not isConsistent) $ do -- unit literal is conflicting alter (restClauses ++) l clearQueue throwError (negate q, c, cid) -- | Boolean constraint propagation of all literals in `propQ'. If a conflict -- is found it is returned exactly as described for `bcpLit'. bcp :: MAssignment s -> FunMonad s (Maybe (Lit, Clause, ClauseId)) bcp m = do q <- gets propQ if Seq.null q then return Nothing else do p <- dequeue bcpLit m p >>= maybe (bcp m) (return . Just) -- *** Decisions -- | Find and return a decision variable. A /decision variable/ must be (1) -- undefined under the assignment and (2) it or its negation occur in the -- formula. -- -- Select a decision variable, if possible, and return it and the adjusted -- `VarOrder'. select :: IAssignment -> FrozenVarOrder -> Maybe Var {-# INLINE select #-} select = varOrderGet selectStatic :: IAssignment -> a -> Maybe Var {-# INLINE selectStatic #-} selectStatic m _ = find (`isUndefUnder` m) (range . bounds $ m) -- | Assign given decision variable. Records the current assignment before -- deciding on the decision variable indexing the assignment. decide :: MAssignment s -> Var -> FunMonad s (Maybe (MAssignment s)) decide m v = do let ld = L (unVar v) (SC{dl=dl}) <- get -- trace ("decide " ++ show ld) $ return () incNumDecisions modify $ \s -> s{ dl = ld:dl } _ <- enqueue m ld Nothing return $ Just m -- *** Backtracking -- | Non-chronological backtracking. The current returns the learned clause -- implied by the first unique implication point cut of the conflict graph. backJump :: MAssignment s -> (Lit, Clause, ClauseId) -- ^ @(l, c)@, where attempting to assign @l@ conflicted with -- clause @c@. -> FunMonad s (Maybe (MAssignment s)) backJump m c@(_, _conflict, _) = get >>= \(SC{dl=dl, reason=_reason}) -> do _theTrail <- gets trail -- trace ("********** conflict = " ++ show c) $ return () -- trace ("trail = " ++ show _theTrail) $ return () -- trace ("dlits (" ++ show (length dl) ++ ") = " ++ show dl) $ return () -- ++ "reason: " ++ Map.showTree _reason -- ) ( incNumConfl ; incNumConflTotal levelArr :: FrozenLevelArray <- do s <- get liftST $ unsafeFreeze (level s) (learntCl, learntClId, newLevel) <- do mFr <- unsafeFreezeAss m analyse mFr levelArr dl c s <- get let numDecisionsToUndo = length dl - newLevel dl' = drop numDecisionsToUndo dl undoneLits = takeWhile (\lit -> levelArr ! (var lit) > newLevel) (trail s) forM_ undoneLits $ const (undoOne m) -- backtrack mFr <- unsafeFreezeAss m assert (numDecisionsToUndo > 0) $ assert (not (null learntCl)) $ assert (learntCl `isUnitUnder` mFr) $ modify $ \s -> s{ dl = dl' } -- undo decisions mFr <- unsafeFreezeAss m -- trace ("new mFr: " ++ showAssignment mFr) $ return () -- TODO once I'm sure this works I don't need getUnit, I can just use the -- uip of the cut. _ <- watchClause m (learntCl, learntClId) True _ <- enqueue m (getUnit learntCl mFr) (Just (learntCl, learntClId)) -- learntCl is asserting return $ Just m -- | @doWhile cmd test@ first runs @cmd@, then loops testing @test@ and -- executing @cmd@. The traditional @do-while@ semantics, in other words. doWhile :: (Monad m) => m () -> m Bool -> m () doWhile body test = do body shouldContinue <- test when shouldContinue $ doWhile body test -- | Analyse a the conflict graph and produce a learned clause. We use the -- First UIP cut of the conflict graph. -- -- May undo part of the trail, but not past the current decision level. analyse :: IAssignment -> FrozenLevelArray -> [Lit] -> (Lit, Clause, ClauseId) -> FunMonad s (Clause, ClauseId, Int) -- ^ learned clause and new decision level analyse mFr levelArr dlits (cLit, cClause, cCid) = do st <- get -- trace ("mFr: " ++ showAssignment mFr) $ assert True (return ()) -- let (learntCl, newLevel) = cutLearn mFr levelArr firstUIPCut -- firstUIPCut = uipCut dlits levelArr conflGraph (unLit cLit) -- (firstUIP conflGraph) -- conflGraph = mkConflGraph mFr levelArr (reason st) dlits c -- :: Gr CGNodeAnnot () -- trace ("graphviz graph:\n" ++ graphviz' conflGraph) $ return () -- trace ("cut: " ++ show firstUIPCut) $ return () -- trace ("topSort: " ++ show topSortNodes) $ return () -- trace ("dlits (" ++ show (length dlits) ++ "): " ++ show dlits) $ return () -- trace ("learnt: " ++ show (map (\l -> (l, levelArr!(var l))) learntCl, newLevel)) $ return () -- outputConflict "conflict.dot" (graphviz' conflGraph) $ return () -- return $ (learntCl, newLevel) m <- liftST $ unsafeThawAss mFr a <- firstUIPBFS m (numVars . cnf $ st) (reason st) -- trace ("firstUIPBFS learned: " ++ show a) $ return () return a where -- BFS by undoing the trail backward. From Minisat paper. Returns -- conflict clause and backtrack level. firstUIPBFS :: MAssignment s -> Int -> ReasonMap -> FunMonad s (Clause, ClauseId, Int) firstUIPBFS m nVars reasonMap = do resolveSourcesR <- liftST $ newSTRef [] -- trace sources let addResolveSource clauseId = liftST $ modifySTRef resolveSourcesR (clauseId:) -- Literals we should process. seenArr <- liftST $ newSTUArray (V 1, V nVars) False counterR <- liftST $ newSTRef (0 :: Int) -- Number of unprocessed current-level -- lits we know about. pR <- liftST $ newSTRef cLit -- Invariant: literal from current dec. lev. out_learnedR <- liftST $ newSTRef [] out_btlevelR <- liftST $ newSTRef 0 let reasonL l = if l == cLit then (cClause, cCid) else let (r, rid) = Map.findWithDefault (error "analyse: reasonL") (var l) reasonMap in (r `without` l, rid) (`doWhile` (liftM (> 0) (liftST $ readSTRef counterR))) $ do p <- liftST $ readSTRef pR let (p_reason, p_rid) = reasonL p traceClauseId p_rid addResolveSource p_rid forM_ p_reason (bump . var) -- For each unseen reason, -- > from the current level, bump counter -- > from lower level, put in learned clause liftST . forM_ p_reason $ \q -> do seenq <- readArray seenArr (var q) when (not seenq) $ do writeArray seenArr (var q) True if levelL q == currentLevel then modifySTRef counterR (+ 1) else if levelL q > 0 then do modifySTRef out_learnedR (q:) modifySTRef out_btlevelR $ max (levelL q) else return () -- Select next literal to look at: (`doWhile` (liftST (readSTRef pR >>= readArray seenArr . var) >>= return . not)) $ do p <- head `liftM` gets trail -- a dec. var. only if the counter = -- 1, i.e., loop terminates now liftST $ writeSTRef pR p undoOne m -- Invariant states p is from current level, so when we're done -- with it, we've thrown away one lit. from counting toward -- counter. liftST $ modifySTRef counterR (\c -> c - 1) p <- liftST $ readSTRef pR liftST $ modifySTRef out_learnedR (negate p:) bump . var $ p out_learned <- liftST $ readSTRef out_learnedR out_btlevel <- liftST $ readSTRef out_btlevelR learnedClauseId <- nextTraceId storeResolvedSources resolveSourcesR learnedClauseId traceClauseId learnedClauseId return (out_learned, learnedClauseId, out_btlevel) -- helpers currentLevel = length dlits levelL l = levelArr!(var l) storeResolvedSources rsR clauseId = do rsReversed <- liftST $ readSTRef rsR modifySlot resolutionTrace $ \s rt -> s{resolutionTrace = rt{resSourceMap = Map.insert clauseId (reverse rsReversed) (resSourceMap rt)}} -- | Delete the assignment to last-assigned literal. Undoes the trail, the -- assignment, sets `noLevel', undoes reason. -- -- Does /not/ touch `dl'. undoOne :: MAssignment s -> FunMonad s () {-# INLINE undoOne #-} undoOne m = do trl <- gets trail lvl <- gets level case trl of [] -> error "undoOne of empty trail" (l:trl') -> do _ <- ($) liftST $ m `unassign` l liftST $ writeArray lvl (var l) noLevel modify $ \s -> s{ trail = trl' , reason = Map.delete (var l) (reason s) } -- | Increase the recorded activity of given variable. bump :: Var -> FunMonad s () {-# INLINE bump #-} bump v = varOrderMod v (+ varInc) -- | Constant amount by which a variable is `bump'ed. varInc :: Double varInc = 1.0 -- *** Impossible to satisfy -- | /O(1)/. Test for unsatisfiability. -- -- The DPLL paper says, ''A problem is unsatisfiable if there is a conflicting -- clause and there are no decision literals in @m@.'' But we were deciding -- on all literals *without* creating a conflicting clause. So now we also -- test whether we've made all possible decisions, too. unsat :: Maybe a -> FunsatState s -> Bool {-# INLINE unsat #-} unsat maybeConflict (SC{dl=dl}) = isUnsat where isUnsat = (null dl && isJust maybeConflict) -- or BitSet.size bad == numVars cnf -- ** Helpers -- *** Clause compaction -- | Keep the smaller half of the learned clauses. compactDB :: FunMonad s () compactDB = do n <- numVars `liftM` gets cnf lArr <- gets learnt clauses <- liftST $ (nub . Fl.concat) `liftM` forM [L (- n) .. L n] (\v -> do val <- readArray lArr v ; writeArray lArr v [] return val) let clauses' = take (length clauses `div` 2) $ sortBy (comparing (length . (\(_,s,_) -> s))) clauses liftST $ forM_ clauses' (\ wCl@(r, _, _) -> do (x, y) <- readSTRef r modifyArray lArr x $ const (wCl:) modifyArray lArr y $ const (wCl:)) -- *** Unit propagation -- | Add clause to the watcher lists, unless clause is a singleton; if clause -- is a singleton, `enqueue's fact and returns `False' if fact is in conflict, -- `True' otherwise. This function should be called exactly once per clause, -- per run. It should not be called to reconstruct the watcher list when -- propagating. -- -- Currently the watched literals in each clause are the first two. -- -- Also adds unique clause ids to trace. watchClause :: MAssignment s -> (Clause, ClauseId) -> Bool -- ^ Is this clause learned? -> FunMonad s Bool {-# INLINE watchClause #-} watchClause m (c, cid) isLearnt = do case c of [] -> return True [l] -> do result <- enqueue m l (Just (c, cid)) levelArr <- gets level liftST $ writeArray levelArr (var l) 0 when (not isLearnt) ( modifySlot resolutionTrace $ \s rt -> s{resolutionTrace=rt{resTraceOriginalSingles= (c,cid):resTraceOriginalSingles rt}}) return result _ -> do let p = (negate (c !! 0), negate (c !! 1)) _insert annCl@(_, cl) list -- avoid watching dup clauses | any (\(_, c) -> cl == c) list = list | otherwise = annCl:list r <- liftST $ newSTRef p let annCl = (r, c, cid) addCl arr = do modifyArray arr (fst p) $ const (annCl:) modifyArray arr (snd p) $ const (annCl:) get >>= liftST . addCl . (if isLearnt then learnt else watches) return True -- | Enqueue literal in the `propQ' and place it in the current assignment. -- If this conflicts with an existing assignment, returns @False@; otherwise -- returns @True@. In case there is a conflict, the assignment is /not/ -- altered. -- -- Also records decision level, modifies trail, and records reason for -- assignment. enqueue :: MAssignment s -> Lit -- ^ The literal that has been assigned true. -> Maybe (Clause, ClauseId) -- ^ The reason for enqueuing the literal. Including a -- non-@Nothing@ value here adjusts the `reason' map. -> FunMonad s Bool {-# INLINE enqueue #-} -- enqueue _m l _r | trace ("enqueue " ++ show l) $ False = undefined enqueue m l r = do mFr <- unsafeFreezeAss m case l `statusUnder` mFr of Right b -> return b -- conflict/already assigned Left () -> do _ <- liftST $ m `assign` l -- assign decision level for literal gets (level &&& (length . dl)) >>= \(levelArr, dlInt) -> liftST (writeArray levelArr (var l) dlInt) modify $ \s -> s{ trail = l : (trail s) , propQ = propQ s Seq.|> l } when (isJust r) $ modifySlot reason $ \s m -> s{reason = Map.insert (var l) (fromJust r) m} return True -- | Pop the `propQ'. Error (crash) if it is empty. dequeue :: FunMonad s Lit {-# INLINE dequeue #-} dequeue = do q <- gets propQ case Seq.viewl q of Seq.EmptyL -> error "dequeue of empty propQ" top Seq.:< q' -> do modify $ \s -> s{propQ = q'} return top -- | Clear the `propQ'. clearQueue :: FunMonad s () {-# INLINE clearQueue #-} clearQueue = modify $ \s -> s{propQ = Seq.empty} -- *** Dynamic variable ordering -- | Modify priority of variable; takes care of @Double@ overflow. varOrderMod :: Var -> (Double -> Double) -> FunMonad s () varOrderMod v f = do vo <- varOrderArr `liftM` gets varOrder vActivity <- liftST $ readArray vo v when (f vActivity > 1e100) $ rescaleActivities vo liftST $ writeArray vo v (f vActivity) where rescaleActivities vo = liftST $ do indices <- range `liftM` getBounds vo forM_ indices (\i -> modifyArray vo i $ const (* 1e-100)) -- | Retrieve the maximum-priority variable from the variable order. varOrderGet :: IAssignment -> FrozenVarOrder -> Maybe Var {-# INLINE varOrderGet #-} varOrderGet mFr (FrozenVarOrder voFr) = -- find highest var undef under mFr, then find one with highest activity (`fmap` goUndef highestIndex) $ \start -> goActivity start start where highestIndex = snd . bounds $ voFr maxActivity v v' = if voFr!v > voFr!v' then v else v' -- @goActivity current highest@ returns highest-activity var goActivity !(V 0) !h = h goActivity !v@(V n) !h = if v `isUndefUnder` mFr then goActivity (V $! n-1) (v `maxActivity` h) else goActivity (V $! n-1) h -- returns highest var that is undef under mFr goUndef !(V 0) = Nothing goUndef !v@(V n) | v `isUndefUnder` mFr = Just v | otherwise = goUndef (V $! n-1) -- | Generate a new clause identifier (always unique). nextTraceId :: FunMonad s Int nextTraceId = do counter <- gets (resTraceIdCount . resolutionTrace) modifySlot resolutionTrace $ \s rt -> s{ resolutionTrace = rt{ resTraceIdCount = succ counter }} return $! counter -- | Add the given clause id to the trace. traceClauseId :: ClauseId -> FunMonad s () traceClauseId cid = do modifySlot resolutionTrace $ \s rt -> s{resolutionTrace = rt{ resTrace = [cid] }} -- *** Generic state transition notation -- | Guard a transition action. If the boolean is true, return the action -- given as an argument. Otherwise, return `Nothing'. (==>) :: (Monad m) => Bool -> m a -> Maybe (m a) {-# INLINE (==>) #-} (==>) b amb = guard b >> return amb infixr 6 ==> -- | @flip fmap@. (>=>) :: (Monad m) => Maybe a -> (a -> m b) -> Maybe (m b) {-# INLINE (>=>) #-} (>=>) = flip fmap infixr 6 >=> -- | Choice of state transitions. Choose the leftmost action that isn't -- @Nothing@, or return @Nothing@ otherwise. (><) :: (Monad m) => Maybe (m a) -> Maybe (m a) -> Maybe (m a) a1 >< a2 = case (a1, a2) of (Nothing, Nothing) -> Nothing (Just _, _) -> a1 _ -> a2 infixl 5 >< -- *** Misc initialActivity :: Double initialActivity = 1.0 instance Error (Lit, Clause, ClauseId) where noMsg = (L 0, [], 0) instance Error () where noMsg = () data VerifyError = SatError [(Clause, Either () Bool)] -- ^ Indicates a unsatisfactory assignment that was claimed -- satisfactory. Each clause is tagged with its status using -- 'Funsat.Types.Model'@.statusUnder@. | UnsatError ResolutionError -- ^ Indicates an error in the resultion checking process. deriving (Show) -- | Verify the solution. In case of `Sat', checks that the assignment is -- well-formed and satisfies the CNF problem. In case of `Unsat', runs a -- resolution-based checker on a trace of the SAT solver. verify :: Solution -> Maybe ResolutionTrace -> CNF -> Maybe VerifyError verify sol maybeRT cnf = -- m is well-formed -- Fl.all (\l -> m!(V l) == l || m!(V l) == negate l || m!(V l) == 0) [1..numVars cnf] case sol of Sat m -> let unsatClauses = toList $ Set.filter (not . isTrue . snd) $ Set.map (\c -> (c, c `statusUnder` m)) (clauses cnf) in if null unsatClauses then Nothing else Just . SatError $ unsatClauses Unsat _ -> case Resolution.checkDepthFirst (fromJust maybeRT) of Left er -> Just . UnsatError $ er Right _ -> Nothing where isTrue (Right True) = True isTrue _ = False --------------------------------------- -- Statistics & trace data Stats = Stats { statsNumConfl :: Int64 -- ^ Number of conflicts since last restart. , statsNumConflTotal :: Int64 -- ^ Number of conflicts since beginning of solving. , statsNumLearnt :: Int64 -- ^ Number of learned clauses currently in DB (fluctuates because DB is -- compacted every restart). , statsAvgLearntLen :: Double -- ^ Avg. number of literals per learnt clause. , statsNumDecisions :: Int64 -- ^ Total number of decisions since beginning of solving. , statsNumImpl :: Int64 -- ^ Total number of unit implications since beginning of solving. } -- | The show instance uses the wrapped string. newtype ShowWrapped = WrapString { unwrapString :: String } instance Show ShowWrapped where show = unwrapString instance Show Stats where show = show . statTable -- | Convert statistics to a nice-to-display tabular form. statTable :: Stats -> Tabular.Table ShowWrapped statTable s = Tabular.mkTable [ [WrapString "Num. Conflicts" ,WrapString $ show (statsNumConflTotal s)] , [WrapString "Num. Learned Clauses" ,WrapString $ show (statsNumLearnt s)] , [WrapString " --> Avg. Lits/Clause" ,WrapString $ show (statsAvgLearntLen s)] , [WrapString "Num. Decisions" ,WrapString $ show (statsNumDecisions s)] , [WrapString "Num. Propagations" ,WrapString $ show (statsNumImpl s)] ] -- | Converts statistics into a tabular, human-readable summary. statSummary :: Stats -> String statSummary s = show (Tabular.mkTable [[WrapString $ show (statsNumConflTotal s) ++ " Conflicts" ,WrapString $ "| " ++ show (statsNumLearnt s) ++ " Learned Clauses" ++ " (avg " ++ printf "%.2f" (statsAvgLearntLen s) ++ " lits/clause)"]]) extractStats :: FunMonad s Stats extractStats = do s <- gets stats learntArr <- get >>= liftST . unsafeFreezeWatchArray . learnt let learnts = (nub . Fl.concat) [ map (sort . (\(_,c,_) -> c)) (learntArr!i) | i <- (range . bounds) learntArr ] :: [Clause] stats = Stats { statsNumConfl = numConfl s , statsNumConflTotal = numConflTotal s , statsNumLearnt = fromIntegral $ length learnts , statsAvgLearntLen = fromIntegral (foldl' (+) 0 (map length learnts)) / fromIntegral (statsNumLearnt stats) , statsNumDecisions = numDecisions s , statsNumImpl = numImpl s } return stats unsafeFreezeWatchArray :: WatchArray s -> ST s (Array Lit [WatchedPair s]) unsafeFreezeWatchArray = freeze constructResTrace :: Solution -> FunMonad s ResolutionTrace constructResTrace sol = do s <- get watchesIndices <- range `liftM` liftST (getBounds (watches s)) origClauseMap <- foldM (\origMap i -> do clauses <- liftST $ readArray (watches s) i return $ foldr (\(_, clause, clauseId) origMap -> Map.insert clauseId clause origMap) origMap clauses) Map.empty watchesIndices let singleClauseMap = foldr (\(clause, clauseId) m -> Map.insert clauseId clause m) Map.empty (resTraceOriginalSingles . resolutionTrace $ s) anteMap = foldr (\l anteMap -> Map.insert (var l) (getAnteId s (var l)) anteMap) Map.empty (litAssignment . finalAssignment $ sol) return (initResolutionTrace (head (resTrace . resolutionTrace $ s)) (finalAssignment sol)) { traceSources = resSourceMap . resolutionTrace $ s , traceOriginalClauses = origClauseMap `Map.union` singleClauseMap , traceAntecedents = anteMap } where getAnteId s v = snd $ Map.findWithDefault (error $ "no reason for assigned var " ++ show v) v (reason s)
rbonifacio/funsat
src/Funsat/Solver.hs
bsd-3-clause
36,910
0
26
10,672
8,457
4,449
4,008
-1
-1
----------------------------------------------------------------------------- -- | -- Module : Control.Distributed.Process.Platform.UnsafePrimitives -- Copyright : (c) Tim Watson 2013 -- License : BSD3 (see the file LICENSE) -- -- Maintainer : Tim Watson <watson.timothy@gmail.com> -- Stability : experimental -- Portability : non-portable (requires concurrency) -- -- [Unsafe Messaging Primitives Using NFData] -- -- This module mirrors "Control.Distributed.Process.UnsafePrimitives", but -- attempts to provide a bit more safety by forcing evaluation before sending. -- This is handled using @NFData@, by means of the @NFSerializable@ type class. -- -- Note that we /still/ cannot guarantee that both the @NFData@ and @Binary@ -- instances will evaluate your data the same way, therefore these primitives -- still have certain risks and potential side effects. Use with caution. -- ----------------------------------------------------------------------------- module Control.Distributed.Process.Platform.UnsafePrimitives ( send , nsend , sendToAddr , sendChan , wrapMessage ) where import Control.DeepSeq (($!!)) import Control.Distributed.Process ( Process , ProcessId , SendPort , Message ) import Control.Distributed.Process.Platform.Internal.Types ( NFSerializable , Addressable , Resolvable(..) ) import qualified Control.Distributed.Process.UnsafePrimitives as Unsafe send :: NFSerializable m => ProcessId -> m -> Process () send pid msg = Unsafe.send pid $!! msg nsend :: NFSerializable a => String -> a -> Process () nsend name msg = Unsafe.nsend name $!! msg sendToAddr :: (Addressable a, NFSerializable m) => a -> m -> Process () sendToAddr addr msg = do mPid <- resolve addr case mPid of Nothing -> return () Just p -> send p msg sendChan :: (NFSerializable m) => SendPort m -> m -> Process () sendChan port msg = Unsafe.sendChan port $!! msg -- | Create an unencoded @Message@ for any @Serializable@ type. wrapMessage :: NFSerializable a => a -> Message wrapMessage msg = Unsafe.wrapMessage $!! msg
haskell-distributed/distributed-process-platform
src/Control/Distributed/Process/Platform/UnsafePrimitives.hs
bsd-3-clause
2,083
0
11
348
366
207
159
31
2
----------------------------------------------------------------------------- -- -- Module : Language.Elm.TH.HToE -- Copyright : Copyright: (c) 2011-2013 Joey Eremondi -- License : BSD3 -- -- Maintainer : joey.eremondi@usask.ca -- Stability : experimental -- Portability : portable -- -- | -- ----------------------------------------------------------------------------- module Language.Elm.TH.HToE where {-# LANGUAGE TemplateHaskell, QuasiQuotes, MultiWayIf #-} import Language.Haskell.TH.Syntax import Data.Aeson.TH import qualified SourceSyntax.Module as M import qualified SourceSyntax.Declaration as D import qualified SourceSyntax.Expression as E import qualified SourceSyntax.Literal as L import qualified SourceSyntax.Location as Lo import qualified SourceSyntax.Pattern as P import qualified SourceSyntax.Type as T import Data.List (isPrefixOf) import Language.Haskell.TH.Desugar.Sweeten import Language.Haskell.TH.Desugar import Language.Elm.TH.Util --import Parse.Expression (makeFunction) import Control.Applicative import Data.List.Split (splitOn) import Control.Monad.State (StateT) import qualified Control.Monad.State as S import qualified Data.Map as Map import Data.List (intercalate) import Debug.Trace (trace) {-| Haskell to Elm Translations Most of these functions operate in the SQ monad, so that we can compare against Haskell expressions or types in quotes (see isIntType etc.) The return value is a list of Elm declarations -} findRecords :: [Dec] -> SQ () findRecords decs = do mapM processDec decs return () where processDec :: Dec -> SQ () processDec (DataD _ _ _ ctors _) = do mapM_ processCtor ctors return () processDec (NewtypeD _ _ _ ctor _) = processCtor ctor processDec _ = return () processCtor :: Con -> SQ () processCtor (RecC name vstList) = do let str = (nameToString name) :: String let (nameList, _, _) = unzip3 vstList let names = map nameToString nameList oldState <- S.get let newState = oldState {records = Map.insert str names (records oldState) } S.put newState return () processCtor _ = return () -- |Translate a constructor into a list of Strings and type-lists, -- Which Elm uses for its internal representation of constructors --Also returns declarations associated with records translateCtor :: Con -> SQ ( (String,[T.Type]), [D.Declaration]) translateCtor (NormalC name strictTyList) = do let sndList = map snd strictTyList tyList <- mapM translateType sndList return ( (nameToElmString name, tyList), []) translateCtor (RecC name vstList) = do --ignore strictness let nameTypes = map (\(a,_,b)->(a,b)) vstList recordTy <- translateRecord nameTypes let recordDecs = map ((accessorDec name). fst) nameTypes let makerDec = recordMakerDec (nameToElmString name) (map (nameToElmString . fst) nameTypes) let unboxDec = recordUnboxDec (nameToElmString name) return ( (nameToElmString name, [recordTy]), (makerDec:unboxDec:recordDecs)) --TODO add decs --Elm has no concept of infix constructor translateCtor (InfixC t1 name t2) = translateCtor $ NormalC name [t1, t2] translateCtor (ForallC _ _ _) = unImplemented "forall constructors" -- | Take a list of declarations and a body -- and put it in a let only if the declarations list is non-empty maybeLet :: [E.Def] -> E.Expr -> E.Expr maybeLet eWhere eBody = if null eWhere then eBody else E.Let eWhere (Lo.none eBody) -------------------------------------------------------------------------- -- | Helper to get the fields of the Clause type unClause :: Clause -> ([Pat], Body, [Dec]) unClause (Clause p b d) = (p, b, d) -- |Helper for putting elements in a list single :: a -> [a] single a = [a] {-|Translate a Haskell declaration into an Elm Declaration Currently implemented: ADTs Functions Value declarations Type synonyms -} translateDec:: Dec -> SQ [D.Declaration] --TODO translate where decs into elm let-decs --TODO what about when more than one clause? translateDec (FunD name [Clause patList body whereDecs]) = do let eName = nameToElmString name (ePats, asDecList) <- unzip <$> mapM translatePattern patList let asDecs = concat asDecList eWhere <- mapM translateDef whereDecs let eDecs = asDecs ++ eWhere fnBody <- translateBody body let eBody = maybeLet eDecs fnBody return $ single $ D.Definition $ E.Definition (P.PVar eName) (makeFunction ePats (Lo.none eBody)) Nothing --TODO what is maybe arg? --multi-clause case i.e. pattern matching --Convert to a single-clause function with a case statement translateDec (FunD name clauseList) = do let ((Clause patList _ _):_) = clauseList let numArgs = length patList let argStrings = map (("arg" ++) . show) [1..numArgs] argNames <- mapM liftNewName argStrings let argPatList = map VarP argNames let argTuple = TupE $ map VarE argNames cases <- mapM clauseToCase clauseList let newBody = NormalB $ CaseE argTuple cases let singleClause = Clause argPatList newBody [] translateDec $ FunD name [singleClause] where clauseToCase (Clause patList body whereDecs) = do let leftSide = TupP patList return $ Match leftSide body whereDecs translateDec (ValD pat body whereDecs) = do (ePat, asDecs) <- translatePattern pat valBody <- translateBody body eWhere <- (asDecs ++) <$> mapM translateDef whereDecs let eBody = maybeLet eWhere valBody return $ single $ D.Definition $ E.Definition ePat (Lo.none eBody) Nothing --TODO what is maybe arg? translateDec dec@(DataD [] name tyBindings ctors names) = do --jsonDecs <- deriveFromJSON defaultOptions name (eCtors, extraDecLists) <- unzip <$> mapM translateCtor ctors return $ [ D.Datatype eName eTyVars eCtors []] ++ (concat extraDecLists) --TODO derivations? where eName = nameToElmString name eTyVars = map (nameToElmString . tyVarToName) tyBindings --TODO data case for non-empty context? translateDec (DataD cxt name tyBindings ctors names) = doEmitWarning "Data declarations with TypeClass context" --We just translate newTypes as Data definitions --TODO: what about when record notation is used? translateDec (NewtypeD cxt name tyBindings ctor nameList) = translateDec $ DataD cxt name tyBindings [ctor] nameList translateDec (TySynD name tyBindings ty) = do let eName = nameToElmString name let eTyVars = map (nameToElmString . tyVarToName) tyBindings eTy <- translateType ty return $ single $ D.TypeAlias eName eTyVars eTy [] translateDec (ClassD cxt name tyBindings funDeps decs ) = doEmitWarning "Class definitions" translateDec (InstanceD cxt ty decs) = doEmitWarning "Instance declarations" --TODO fix signatures translateDec (SigD name ty) = return []--(single . D.Definition . (E.TypeAnnotation (nameToString name)) ) <$> translateType ty translateDec (ForeignD frn) = doEmitWarning "FFI declarations" translateDec (PragmaD pragma) = doEmitWarning "Haskell Pragmas" translateDec (FamilyD famFlavour name [tyVarBndr] mKind) = doEmitWarning "Type families" translateDec (DataInstD cxt name types ctors names) = doEmitWarning "Data instances" translateDec (NewtypeInstD cxt name types ctor names) = doEmitWarning "Newtypes instances" translateDec (TySynInstD name types theTy) = doEmitWarning "Type synonym instances" -------------------------------------------------------------------------- -- | Convert a declaration to an elm Definition -- Only works on certain types of declarations TODO document which translateDef :: Dec -> SQ E.Def --TODO functions translateDef (ValD pat body whereDecs) = do (ePat, asDecs) <- translatePattern pat eWhere <- (asDecs ++ ) <$> mapM translateDef whereDecs decBody <- translateBody body let eBody = maybeLet eWhere decBody return $ E.Definition ePat (Lo.none eBody) Nothing --To do functions, we translate them into an Elm declaration --Then we convert translateDef (funD@(FunD _ _)) = do elmDec <- translateDec funD case elmDec of [D.Definition elmDef] -> return elmDef _ -> unImplemented "Function can't be converted to a declaration" translateDef d = unImplemented "Non-simple function/value definitions" -- | Helper to put an object in a tuple with an empty list as snd unFst x = (x, []) -------------------------------------------------------------------------- -- |Translate a pattern match from Haskell to Elm translatePattern :: Pat -> SQ (P.Pattern, [E.Def]) --Special case for As, to carry over the name translatePattern (AsP name initPat) = do (pat, patExp) <- patToExp initPat (retPat, subDecs) <- translatePattern $ pat dec <- translateDef $ ValD (VarP name) (NormalB patExp) [] return (retPat, [dec] ++ subDecs) {- translatePattern p = do runIO $ putStrLn $ show p ret <-translatePattern' p return (ret, []) -} translatePattern (LitP lit) = (unFst . P.PLiteral) <$> translateLiteral lit translatePattern (VarP name) = return $ unFst $ P.PVar $ nameToElmString name --Special case: if only one pattern in tuple, don't treat as tuple --TODO why do we need this? translatePattern (TupP [pat]) = translatePattern pat translatePattern (TupP patList) = do (patList, allAsDecs) <- unzip <$> mapM translatePattern patList return (P.tuple patList, concat allAsDecs) --Treat unboxed tuples like tuples translatePattern (UnboxedTupP patList) = translatePattern $ TupP patList translatePattern (ConP name patList) = do let str = nameToString name (patList, allAsDecs) <- unzip <$> mapM translatePattern patList recMap <- records <$> S.get if (Map.member str recMap ) then do let varNames = recMap Map.! str let decs = map makeDef $ zip patList varNames return (P.PData str $ [P.PRecord varNames], decs ++ (concat allAsDecs)) else do return (P.PData (nameToElmString name) patList, concat allAsDecs) where makeDef :: (P.Pattern, String) -> E.Def makeDef (pat, varString) = E.Definition pat (Lo.none $ E.Var varString) Nothing --Just pass through parentheses translatePattern (ParensP p) = translatePattern p --TODO Infix, tilde, bang, as, record, view translatePattern WildP = return $ unFst P.PAnything --Ignore the type signature if theres one in the pattern translatePattern (SigP pat _) = translatePattern pat translatePattern (ListP patList) = do (patList, allAsDecs) <- unzip <$> mapM translatePattern patList return (P.list patList, concat allAsDecs) --Convert infix patterns to Data patterns, then let Elm decide -- how it translates them (i.e. cons is a special case) translatePattern (InfixP p1 name p2) = translatePattern $ ConP name [p1,p2] --treat unboxed infix like infix translatePattern (UInfixP p1 name p2) = translatePattern $ InfixP p1 name p2 --TODO implement records translatePattern (RecP _ _) = unImplemented "Record patterns" translatePattern (TildeP _) = unImplemented "Tilde patterns/laziness notation" translatePattern (BangP _) = unImplemented "Baing patterns/strictness notation" translatePattern (ViewP _ _) = unImplemented "View patterns" --translatePattern p = unImplemented $ "Misc patterns " ++ show p ------------------------------------------------------------------------- -- | Convert a pattern into an expression -- Useful for as patterns, so we can do pattern checking as well as multiple naming patToExp :: Pat -> SQ (Pat, Exp) patToExp p = do noWild <- removeWildcards [1..] p return (noWild, patToExp' noWild) where patToExp' (LitP l) = LitE l patToExp' (VarP n) = VarE n patToExp' (TupP l) = TupE $ map patToExp' l patToExp' (UnboxedTupP l) = UnboxedTupE $ map patToExp' l patToExp' (ConP n pl) = foldl AppE (VarE n) (map patToExp' pl) --Apply constructor to each subexp patToExp' (InfixP p1 n p2) = InfixE (Just $ patToExp' p1) (VarE n) (Just $ patToExp' p2) patToExp' (UInfixP p1 n p2) = UInfixE (patToExp' p1) (VarE n) (patToExp' p2) patToExp' (ParensP p) = ParensE $ patToExp' p patToExp' (AsP n p) = patToExp' p --TODO ignore name? Should get covered by other translation patToExp' WildP = error "Can't use wildcard in expression" patToExp' (ListP pList) = ListE $ map patToExp' pList patToExp' _ = unImplemented "Complex as-patterns" doWithNames nameList patList = do let nameLists = splitListN (length patList) nameList let fnsToApply = [removeWildcards nl | nl <- nameLists] let tuples = zip fnsToApply patList mapM (\(f,x)-> f $ x) tuples -- | Recursively replace wildcards in an exp with new names -- Useful for as patterns, so we can unbox patterns and re-pack them with a new name --Assumes we have an infinite list of names to take removeWildcards :: [Int] -> Pat -> SQ Pat removeWildcards (i:_) WildP = do name <- liftNewName $ ("arg_" ++ ( show i)) return $ VarP name removeWildcards nameList (TupP l) = do TupP <$> doWithNames nameList l removeWildcards nameList (UnboxedTupP l) = UnboxedTupP <$> doWithNames nameList l removeWildcards nameList (ConP n pl) = (ConP n) <$> doWithNames nameList pl removeWildcards nameList (InfixP p1 n p2) = do let (l1, l2) = splitList nameList ret1 <- removeWildcards l1 p1 ret2 <- removeWildcards l2 p2 return $ InfixP ret1 n ret2 removeWildcards nameList (UInfixP p1 n p2) = do let (l1, l2) = splitList nameList ret1 <- removeWildcards l1 p1 ret2 <- removeWildcards l2 p2 return $ UInfixP ret1 n ret2 removeWildcards nameList (ParensP p) = ParensP <$> removeWildcards nameList p removeWildcards nameList (AsP n p) = AsP n <$> removeWildcards nameList p --TODO ignore name? Should get covered by other translation removeWildcards nameList (ListP pList) = ListP <$> doWithNames nameList pList removeWildcards nameList p = return p --All other cases, nothing to remove, either simple or unsupported -------------------------------------------------------------------------- -- |Translate a function body into Elm translateBody :: Body -> SQ E.Expr translateBody (NormalB e) = translateExpression e --Just convert to a multi-way If statement translateBody (GuardedB guardExpList) = translateExpression $ MultiIfE guardExpList -- | Expression helper function to convert a Var to a String expressionToString (VarE name) = nameToElmString name -- | Generic elm expression for "otherwise" elmOtherwise = E.Var "otherwise" -- | Translate a guard into an Elm expression translateGuard (NormalG exp) = translateExpression exp translateGuard _ = unImplemented "Pattern-match guards" -------------------------------------------------------------------------- {-|Translate a haskell Expression into Elm Currently supported: Variables Literals Lambdas Constructors Function Application Parenthises tuples Conditionals Multi-way If statements Let-expressions Case expressions List literals Infix operations Supported but not translated: Type signatures -} translateExpression :: Exp -> SQ E.Expr --TODO multi pattern exp? translateExpression (LamE [pat] expBody) = do (ePat, asDecs) <- translatePattern pat lambdaBody <- translateExpression expBody let eBody = maybeLet asDecs lambdaBody return $ E.Lambda ePat (Lo.none eBody) translateExpression (VarE name) = return $ E.Var $ nameToElmString name --Just treat constructor as variable --TODO is this okay? translateExpression (ConE name) = return $ E.Var $ nameToElmString name translateExpression (LitE lit) = E.Literal <$> translateLiteral lit --Lo.none converts expressions to located expressions with no location --Special case for records, we need a curry-able function to construct records in Elm translateExpression (AppE fun@(ConE ctor) arg) = do recMap <- records <$> S.get let str = nameToString ctor if Map.member str recMap then do let recordFunc = mkName $ recordMakerName (nameToString ctor) translateExpression (AppE (VarE recordFunc) arg) else do eFun <- translateExpression fun eArg <- translateExpression arg return $ E.App (Lo.none eFun) (Lo.none eArg) translateExpression (AppE fun arg) = do eFun <- translateExpression fun eArg <- translateExpression arg return $ E.App (Lo.none eFun) (Lo.none eArg) --TODO infix stuff, ranges, record con, record update translateExpression (ParensE e) = translateExpression e translateExpression (TupE es) = (E.tuple . map Lo.none) <$> mapM translateExpression es translateExpression (CondE cond th el) = do eCond <- Lo.none <$> translateExpression cond eTh <- Lo.none <$> translateExpression th eEl <- Lo.none <$> translateExpression el let loOtherwise = Lo.none elmOtherwise return $ E.MultiIf [(eCond, eTh), (loOtherwise, eEl)] translateExpression (MultiIfE guardExpList) = do expPairs <- mapM transPair guardExpList return $ E.MultiIf expPairs where transPair (guard, exp) = do eGuard <- translateGuard guard eExp <- translateExpression exp return (Lo.none eGuard, Lo.none eExp) translateExpression (LetE decList exp) = do eDecs <- mapM translateDef decList eExp <- translateExpression exp return $ E.Let eDecs (Lo.none eExp) --TODO deal with Where translateExpression (CaseE exp matchList) = do eExp <- translateExpression exp eMatch <- mapM getMatch matchList return $ E.Case (Lo.none eExp) eMatch where getMatch (Match pat body whereDecs) = do (ePat, asDecs) <- translatePattern pat eWhere <- (asDecs ++ ) <$> mapM translateDef whereDecs matchBody <- translateBody body let eBody = maybeLet eWhere matchBody return (ePat, Lo.none eBody) translateExpression (ListE exps) = (E.ExplicitList . map Lo.none) <$> mapM translateExpression exps --Unboxed infix expression translateExpression (UInfixE e1 op e2) = do eE1 <- translateExpression e1 eE2 <- translateExpression e2 let eOp = expressionToString op return $ E.Binop eOp (Lo.none eE1) (Lo.none eE2) --Infix where we have all the parts, i.e. not a section --Just translate as unboxed translateExpression (InfixE (Just e1) op (Just e2)) = translateExpression $ UInfixE e1 op e2 translateExpression e@(RecConE name nameExpList ) = do let (names, expList) = unzip nameExpList eExps <- mapM translateExpression expList let stringList = map nameToString names let lexps = map Lo.none eExps return $ E.App (Lo.none $ E.Var $ nameToString name) (Lo.none $ E.Record $ zip stringList lexps) translateExpression e@(RecUpdE recExp nameExpList ) = do let (names, expList) = unzip nameExpList eExps <- mapM translateExpression expList let lexps = map Lo.none eExps let varStrings = map nameToString names eRec <- translateExpression recExp recMap <- records <$> S.get recName <- nameToString <$> liftNewName "rec" let ctor = recordWithFields recMap (map nameToString names) let internalRecDef = E.Definition (P.PVar recName) (Lo.none $ E.App (Lo.none $ E.Var $ unboxRecordName ctor) (Lo.none eRec)) Nothing return $ E.Let [internalRecDef] $ Lo.none $ E.App (Lo.none $ E.Var ctor) (Lo.none $ E.Modify (Lo.none $ E.Var recName) ( zip varStrings lexps) ) translateExpression (InfixE _ _ _) = unImplemented "Operator sections i.e. (+3)" --Just ignore signature translateExpression (SigE exp _) = translateExpression exp translateExpression e@(ArithSeqE r) = translateRange r translateExpression e@(LamCaseE _) = unImplemented $ "Lambda case expressions: " ++ show e translateExpression e@(DoE _) = unImplemented $ "Sugared do notation: " ++ show e translateExpression e@(CompE _) = unImplemented $ "List comprehensions: " ++ show e translateExpression e = unImplemented $ "Misc expression " ++ show e -------------------------------------------------------------------------- -- |Translate a literal value from Haskell to Elm -- Strings are translated into strings, not char lists translateLiteral :: Lit-> SQ L.Literal translateLiteral = return . noQTrans where noQTrans (CharL c) = L.Chr c noQTrans (StringL s) = L.Str s noQTrans (IntegerL i) = L.IntNum $ fromInteger i noQTrans (IntPrimL i) = L.IntNum $ fromInteger i noQTrans (WordPrimL i) = L.IntNum $ fromInteger i noQTrans (FloatPrimL f) = L.FloatNum $ fromRational f noQTrans (DoublePrimL f) = L.FloatNum $ fromRational f noQTrans (RationalL f) = L.FloatNum $ fromRational f noQTrans (StringPrimL _) = unImplemented "C-string literals" -- | Translate a Haskell range. Infinite lists not supported, since Elm is strict translateRange :: Range -> SQ E.Expr translateRange (FromToR start end) = do e1 <- Lo.none <$> translateExpression start e2 <- Lo.none <$> translateExpression end return $ E.Range e1 e2 translateRange _ = unImplemented "Infinite ranges, or ranges with steps not equal to 1" -------------------------------------------------------------------------- {-| Translate a Haskell type into an Elm type Currently translates primitive types, lists, tuples and constructors (ADTs) Doesn't support type classes or fancier types -} translateType :: Type -> SQ T.Type translateType (ForallT _ _ _ ) = unImplemented "forall types" translateType (PromotedT _ ) = unImplemented "promoted types" translateType (PromotedTupleT _ ) = unImplemented "promoted tuple types" translateType (PromotedNilT ) = unImplemented "promoted nil types" translateType (PromotedConsT ) = unImplemented "promoted cons types" translateType (StarT) = unImplemented "star types" translateType (UnboxedTupleT i ) = translateType $ TupleT i translateType ArrowT = error "Arrow type: Should never recurse this far down" translateType ListT = error "List type: Should never recurse this far down" translateType ConstraintT = unImplemented "Type constraints" translateType (LitT _) = error "Type literals" --TODO fill in other cases, esp records --Cases which aren't captured by basic pattern matching translateType t = do --Unbox some Monad information that we need isInt <- S.lift $ isIntType t isString <- S.lift $ isStringType t isFloat <- S.lift $ isFloatType t isBool <- S.lift $ isBoolType t generalTranslate isInt isString isFloat isBool --TODO get these in scope where generalTranslate :: Bool -> Bool -> Bool -> Bool -> SQ T.Type generalTranslate isInt isString isFloat isBool | isInt = return $ T.Data "Int" [] | isString = return $ T.Data "String" [] | isFloat = return $ T.Data "Float" [] | isBool = return $ T.Data "Bool" [] | isTupleType t = do tyList <- mapM translateType (tupleTypeToList t) return $ T.tupleOf tyList | otherwise = case t of --type variables (VarT name) -> return $ T.Var (nameToElmString name) --sum types/ADTs (ConT name) -> return $ T.Data (nameToElmString name) [] --TODO what is this list param? --functions (AppT (AppT ArrowT a) b) -> do ea <- translateType a eb <- translateType b return $ T.Lambda ea eb --empty tuple/record (TupleT 0) -> return $ T.recordOf [] --Lists and tuples, just Data in Elm (AppT ListT t) -> do et <- translateType t return $ T.listOf et --Type variable application: get type to apply to as Data --then add this type to the list of applied types (AppT subt tvar) -> do etvar <- translateType tvar T.Data ctor varList <- translateType subt return $ T.Data ctor (varList ++ [etvar]) -- | Special record type translation translateRecord :: [(Name, Type)] -> SQ T.Type translateRecord nameTyList = do let (nameList, tyList) = unzip nameTyList let eNames = map nameToElmString nameList eTypes <- mapM translateType tyList return $ T.recordOf $ zip eNames eTypes --Generate the function declarations associated with a record type accessorDec :: Name -> Name -> D.Declaration --Names are always local accessorDec ctor name = let nameString = nameToString name var = "rec" varExp = E.Var var varPat = P.PData (nameToString ctor) [P.PVar var] funBody = E.Access (Lo.none $ varExp) nameString fun = E.Lambda varPat (Lo.none funBody) in D.Definition $ E.Definition (P.PVar nameString) (Lo.none fun) Nothing recordMakerDec :: String -> [String] -> D.Declaration recordMakerDec ctor vars = let argNames = map (("arg" ++) . show) [1 .. (length vars)] patList = map P.PVar argNames expList = map (Lo.none . E.Var) argNames recordCons = Lo.none $ E.Record $ zip vars expList funBody = E.App (Lo.none $ E.Var ctor) recordCons fun = makeCurry patList funBody in D.Definition $ E.Definition (P.PVar $ recordMakerName ctor) (Lo.none fun) Nothing where makeCurry argPats body = foldr (\pat body-> E.Lambda pat (Lo.none body) ) body argPats recordUnboxDec :: String -> D.Declaration recordUnboxDec ctor = let pat = P.PData ctor [P.PVar "x"] body = E.Var "x" fun = E.Lambda pat (Lo.none body) in D.Definition $ E.Definition (P.PVar $ unboxRecordName ctor) (Lo.none fun) Nothing recordMakerName name = "makeRecord__" ++ name unboxRecordName name = "unboxRecord__" ++ name -------------------------------------------------------------------------- {-| Conversion from Haskell namespaces and prelude names to Elm base names -} nameToElmString :: Name -> String nameToElmString = getElmName . nameToString getElmName :: String -> String getElmName "$" = "<|" --Cons should get translated automatically, but just in case getElmName ":" = "::" --Not a change, but lets us search for . in module names getElmName "." = "." getElmName "error" = "Error.raise" --Specific cases getElmName s | length partList > 1 = getElmModuleName modul name --Default: don't change the string | otherwise = s where name = last partList modul = init partList partList = (splitOn "." s) --modules that are supported by Elm elmHasFunction :: String -> String -> Bool elmHasFunction "Dict" s = s `elem` ["empty", "singleton", "insert", "update", "remove", "member", "lookup", "findWithDefault", "union", "intersect", "diff", "keys", "values", "toList", "fromList", "map", "foldl", "foldr"] elmHasFunction "Json" s = s `elem` ["String", "Number", "Boolean", "Null", "Array", "Object"] elmHasFunction "Error" s = s `elem` ["raise"] elmHasFunction _ _ = False directTranslate "Dict" s = case Map.lookup s m of Just ret -> ret Nothing -> error $ "Elm Dictionary operation not supported: " ++ s where m = Map.fromList [("Map", "Dict")] --TODO more getElmModuleName :: [String] -> String -> String --TODO fix infix? getElmModuleName ["Data", "Map"] name = "Dict." ++ case name of --TODO are there any special cases? _ -> if (elmHasFunction "Dict" name) then name else directTranslate "Dict" name getElmModuleName ["Data", "Aeson"] s = "Json." ++ case s of _ -> if (elmHasFunction "Json" s) then s else error "Elm Dictionary doesn't support operation " ++ s getElmModuleName m s = (intercalate "." m) ++ "." ++ s
JoeyEremondi/haskelm-old
src/Language/Elm/TH/HToE.hs
bsd-3-clause
27,478
0
17
5,576
7,687
3,820
3,867
-1
-1
module Random.IntervalSet where import Data.Interval as I import Data.IntervalSet as IS import Data.Foldable import Data.Monoid import Data.Random import Data.Random.Distribution.Exponential subintervals ::Interval ->Double ->Double ->RVar [Interval] subintervals (Interval a b) p n = do lp ::Double <-exponential p let c = a + ceiling lp ln ::Double <-exponential n let d = c + ceiling ln if d >=b then return [Interval a (min b c)] else fmap (Interval a c :) (subintervals (Interval d b) p n) subset ::Interval -> RVar IntervalSet subset i = do is <-subintervals i k k return (appEndo (foldMap (Endo . IS.insert) is) IS.Empty) where k = sqrt l / 2 l = fromInteger (fromIntegral (I.length i))
ian-mi/interval-set
benchmarks/Random/IntervalSet.hs
bsd-3-clause
826
0
14
244
314
159
155
-1
-1
{-# OPTIONS_GHC -w #-} {-# LANGUAGE BangPatterns #-} -- required for versions of Happy before 1.18.6 {-# 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://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings -- for details 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 Kind ( Kind, liftedTypeKind, unliftedTypeKind, mkArrowKind ) import Class ( FunDep ) import BasicTypes import DynFlags import OrdList import HaddockUtils import BooleanFormula ( BooleanFormula, mkAnd, mkOr, mkTrue, mkVar ) 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(..)) -- parser produced by Happy Version 1.19.4 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 (OrdList (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) | HappyAbsSyn56 (Located (FamilyInfo RdrName)) | HappyAbsSyn57 (Located [LTyFamInstEqn RdrName]) | HappyAbsSyn59 (LTyFamInstEqn RdrName) | HappyAbsSyn63 (Located NewOrData) | HappyAbsSyn64 (Located (Maybe (LHsKind RdrName))) | HappyAbsSyn65 (Located (Maybe (LHsContext RdrName), LHsType RdrName)) | HappyAbsSyn66 (Maybe CType) | HappyAbsSyn67 (LDerivDecl RdrName) | HappyAbsSyn68 (LRoleAnnotDecl RdrName) | HappyAbsSyn69 (Located [Located (Maybe FastString)]) | HappyAbsSyn71 (Located (Maybe FastString)) | HappyAbsSyn73 ([Located RdrName]) | HappyAbsSyn74 (HsPatSynDir RdrName) | HappyAbsSyn75 (Located (OrdList (LHsDecl RdrName))) | HappyAbsSyn85 (Located (HsLocalBinds RdrName)) | HappyAbsSyn89 (Maybe Activation) | HappyAbsSyn90 (Activation) | HappyAbsSyn91 ([RuleBndr RdrName]) | HappyAbsSyn93 (RuleBndr RdrName) | HappyAbsSyn98 (Located [FastString]) | HappyAbsSyn99 (Located (OrdList FastString)) | HappyAbsSyn102 (CCallConv) | HappyAbsSyn103 (Safety) | HappyAbsSyn104 (Located (Located FastString, Located RdrName, LHsType RdrName)) | HappyAbsSyn105 (Maybe (LHsType RdrName)) | HappyAbsSyn107 (LHsType RdrName) | HappyAbsSyn110 ([LHsType RdrName]) | HappyAbsSyn111 (Located HsBang) | HappyAbsSyn114 (LHsContext RdrName) | HappyAbsSyn123 ([LHsTyVarBndr RdrName]) | HappyAbsSyn124 (LHsTyVarBndr RdrName) | HappyAbsSyn125 (Located [Located (FunDep RdrName)]) | HappyAbsSyn127 (Located (FunDep RdrName)) | HappyAbsSyn128 (Located [RdrName]) | HappyAbsSyn129 (LHsKind RdrName) | HappyAbsSyn133 ([LHsKind RdrName]) | HappyAbsSyn134 (Located [LConDecl RdrName]) | HappyAbsSyn136 ([LConDecl RdrName]) | HappyAbsSyn139 (LConDecl RdrName) | HappyAbsSyn140 (Located [LHsTyVarBndr RdrName]) | HappyAbsSyn141 (Located (Located RdrName, HsConDeclDetails RdrName)) | HappyAbsSyn142 ([ConDeclField RdrName]) | HappyAbsSyn145 (Located (Maybe [LHsType RdrName])) | HappyAbsSyn147 (LDocDecl) | HappyAbsSyn150 (Located (GRHSs RdrName (LHsExpr RdrName))) | HappyAbsSyn151 (Located [LGRHS RdrName (LHsExpr RdrName)]) | HappyAbsSyn152 (LGRHS RdrName (LHsExpr RdrName)) | HappyAbsSyn156 (Located (HsQuasiQuote RdrName)) | HappyAbsSyn157 (LHsExpr RdrName) | HappyAbsSyn161 (Located FastString) | HappyAbsSyn162 (Located (FastString,(Int,Int),(Int,Int))) | HappyAbsSyn168 ([LHsCmdTop RdrName]) | HappyAbsSyn169 (LHsCmdTop RdrName) | HappyAbsSyn173 ([HsTupArg RdrName]) | HappyAbsSyn177 (Located [LHsExpr RdrName]) | HappyAbsSyn178 (Located [LStmt RdrName (LHsExpr RdrName)]) | HappyAbsSyn179 (Located [[LStmt RdrName (LHsExpr RdrName)]]) | HappyAbsSyn181 (Located ([LStmt RdrName (LHsExpr RdrName)] -> Stmt RdrName (LHsExpr RdrName))) | HappyAbsSyn185 (Located [LMatch RdrName (LHsExpr RdrName)]) | HappyAbsSyn188 (LMatch RdrName (LHsExpr RdrName)) | HappyAbsSyn195 (LPat RdrName) | HappyAbsSyn198 ([LPat RdrName]) | HappyAbsSyn202 (Maybe (LStmt RdrName (LHsExpr RdrName))) | HappyAbsSyn203 (LStmt RdrName (LHsExpr RdrName)) | HappyAbsSyn205 (([HsRecField RdrName (LHsExpr RdrName)], Bool)) | HappyAbsSyn207 (HsRecField RdrName (LHsExpr RdrName)) | HappyAbsSyn208 (Located [LIPBind RdrName]) | HappyAbsSyn209 (LIPBind RdrName) | HappyAbsSyn210 (Located HsIPName) | HappyAbsSyn211 (BooleanFormula (Located RdrName)) | HappyAbsSyn220 (Located DataCon) | HappyAbsSyn255 (Located HsLit) | HappyAbsSyn257 (Located ModuleName) | HappyAbsSyn259 (LHsDocString) | HappyAbsSyn261 (Located (String, HsDocString)) | HappyAbsSyn262 (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, action_1141, action_1142, action_1143, action_1144, action_1145, action_1146, action_1147, action_1148, action_1149, action_1150, action_1151, action_1152, action_1153, action_1154, action_1155, action_1156, action_1157, action_1158, action_1159, action_1160, action_1161, action_1162, action_1163, action_1164, action_1165, action_1166, action_1167, action_1168, action_1169, action_1170, action_1171, action_1172, action_1173, action_1174, action_1175, action_1176, action_1177, action_1178, action_1179, action_1180, action_1181, action_1182, action_1183, action_1184, action_1185, action_1186, action_1187, action_1188, action_1189, action_1190, action_1191, action_1192, action_1193, action_1194, action_1195, action_1196, action_1197, action_1198, action_1199, action_1200, action_1201, action_1202, action_1203, action_1204, action_1205, action_1206, action_1207, action_1208, action_1209, action_1210, action_1211, action_1212, action_1213, action_1214, action_1215, action_1216, action_1217, action_1218, action_1219, action_1220, action_1221, action_1222, action_1223, action_1224, action_1225, action_1226, action_1227, action_1228, action_1229, action_1230, action_1231, action_1232, action_1233, action_1234, action_1235 :: () => 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, happyReduce_650, happyReduce_651, happyReduce_652, happyReduce_653, happyReduce_654, happyReduce_655, happyReduce_656, happyReduce_657, happyReduce_658, happyReduce_659, happyReduce_660, happyReduce_661, happyReduce_662, happyReduce_663, happyReduce_664, happyReduce_665, happyReduce_666, happyReduce_667, happyReduce_668, happyReduce_669, happyReduce_670, happyReduce_671, happyReduce_672, happyReduce_673, happyReduce_674, happyReduce_675, happyReduce_676, happyReduce_677, happyReduce_678, happyReduce_679, happyReduce_680, happyReduce_681, happyReduce_682, happyReduce_683, happyReduce_684, happyReduce_685, happyReduce_686, happyReduce_687, happyReduce_688, happyReduce_689, happyReduce_690, happyReduce_691, happyReduce_692, happyReduce_693, happyReduce_694, happyReduce_695, happyReduce_696, happyReduce_697, happyReduce_698, happyReduce_699, happyReduce_700, happyReduce_701, happyReduce_702, happyReduce_703, happyReduce_704, happyReduce_705, happyReduce_706, happyReduce_707, happyReduce_708, happyReduce_709 :: () => ({-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 (266) = happyShift action_37 action_0 (267) = happyShift action_38 action_0 (268) = happyShift action_39 action_0 (273) = happyShift action_40 action_0 (275) = happyShift action_41 action_0 (276) = happyShift action_42 action_0 (283) = happyShift action_164 action_0 (287) = happyShift action_47 action_0 (291) = happyShift action_48 action_0 (293) = happyShift action_49 action_0 (294) = happyShift action_50 action_0 (295) = happyShift action_51 action_0 (296) = happyShift action_52 action_0 (297) = happyShift action_53 action_0 (298) = happyShift action_54 action_0 (299) = happyShift action_55 action_0 (300) = happyShift action_56 action_0 (301) = happyShift action_57 action_0 (302) = happyShift action_58 action_0 (303) = happyShift action_59 action_0 (304) = happyShift action_60 action_0 (305) = happyShift action_61 action_0 (306) = happyShift action_62 action_0 (307) = happyShift action_63 action_0 (308) = happyShift action_165 action_0 (309) = happyShift action_64 action_0 (318) = happyShift action_68 action_0 (319) = happyShift action_69 action_0 (320) = happyShift action_70 action_0 (336) = happyShift action_72 action_0 (342) = happyShift action_73 action_0 (345) = happyShift action_74 action_0 (346) = happyShift action_166 action_0 (357) = happyShift action_75 action_0 (359) = happyShift action_76 action_0 (361) = happyShift action_118 action_0 (363) = happyShift action_78 action_0 (365) = happyShift action_79 action_0 (370) = happyShift action_80 action_0 (371) = happyShift action_81 action_0 (372) = happyShift action_82 action_0 (375) = happyShift action_83 action_0 (376) = happyShift action_84 action_0 (379) = happyShift action_85 action_0 (380) = happyShift action_86 action_0 (381) = happyShift action_87 action_0 (382) = happyShift action_88 action_0 (383) = happyShift action_89 action_0 (384) = happyShift action_90 action_0 (385) = happyShift action_91 action_0 (386) = happyShift action_92 action_0 (387) = happyShift action_93 action_0 (388) = happyShift action_94 action_0 (389) = happyShift action_95 action_0 (390) = happyShift action_96 action_0 (391) = happyShift action_97 action_0 (396) = happyShift action_98 action_0 (397) = happyShift action_99 action_0 (398) = happyShift action_100 action_0 (399) = happyShift action_101 action_0 (401) = happyShift action_102 action_0 (403) = happyShift action_103 action_0 (404) = happyShift action_104 action_0 (405) = happyShift action_105 action_0 (406) = happyShift action_106 action_0 (407) = happyShift action_107 action_0 (408) = happyShift action_108 action_0 (409) = happyShift action_109 action_0 (38) = happyGoto action_13 action_0 (156) = happyGoto action_16 action_0 (157) = happyGoto action_160 action_0 (158) = happyGoto action_116 action_0 (159) = happyGoto action_18 action_0 (161) = happyGoto action_19 action_0 (162) = happyGoto action_20 action_0 (163) = happyGoto action_21 action_0 (164) = happyGoto action_22 action_0 (165) = happyGoto action_23 action_0 (166) = happyGoto action_24 action_0 (167) = happyGoto action_25 action_0 (196) = happyGoto action_161 action_0 (203) = happyGoto action_172 action_0 (204) = happyGoto action_163 action_0 (210) = happyGoto action_26 action_0 (217) = happyGoto action_27 action_0 (220) = happyGoto action_28 action_0 (241) = happyGoto action_30 action_0 (242) = happyGoto action_31 action_0 (243) = happyGoto action_117 action_0 (249) = happyGoto action_33 action_0 (251) = happyGoto action_34 action_0 (252) = happyGoto action_35 action_0 (255) = happyGoto action_36 action_0 _ = happyFail action_1 (277) = happyShift action_159 action_1 (40) = happyGoto action_171 action_1 _ = happyFail action_2 (266) = happyShift action_37 action_2 (267) = happyShift action_38 action_2 (268) = happyShift action_39 action_2 (269) = happyShift action_137 action_2 (270) = happyShift action_138 action_2 (271) = happyShift action_139 action_2 (272) = happyShift action_140 action_2 (273) = happyShift action_40 action_2 (275) = happyShift action_41 action_2 (276) = happyShift action_42 action_2 (279) = happyShift action_43 action_2 (280) = happyShift action_44 action_2 (281) = happyShift action_45 action_2 (282) = happyShift action_141 action_2 (283) = happyShift action_46 action_2 (285) = happyShift action_142 action_2 (287) = happyShift action_47 action_2 (289) = happyShift action_143 action_2 (291) = happyShift action_48 action_2 (292) = happyShift action_144 action_2 (293) = happyShift action_49 action_2 (294) = happyShift action_50 action_2 (295) = happyShift action_51 action_2 (296) = happyShift action_52 action_2 (297) = happyShift action_53 action_2 (298) = happyShift action_54 action_2 (299) = happyShift action_55 action_2 (300) = happyShift action_56 action_2 (301) = happyShift action_57 action_2 (302) = happyShift action_58 action_2 (303) = happyShift action_59 action_2 (304) = happyShift action_60 action_2 (305) = happyShift action_61 action_2 (306) = happyShift action_62 action_2 (307) = happyShift action_63 action_2 (309) = happyShift action_64 action_2 (312) = happyShift action_145 action_2 (313) = happyShift action_65 action_2 (314) = happyShift action_66 action_2 (315) = happyShift action_67 action_2 (317) = happyShift action_146 action_2 (318) = happyShift action_68 action_2 (319) = happyShift action_69 action_2 (320) = happyShift action_70 action_2 (321) = happyShift action_147 action_2 (322) = happyShift action_148 action_2 (325) = happyShift action_149 action_2 (326) = happyShift action_150 action_2 (327) = happyShift action_151 action_2 (328) = happyShift action_152 action_2 (329) = happyShift action_71 action_2 (336) = happyShift action_72 action_2 (342) = happyShift action_73 action_2 (345) = happyShift action_74 action_2 (346) = happyShift action_153 action_2 (357) = happyShift action_75 action_2 (359) = happyShift action_76 action_2 (361) = happyShift action_77 action_2 (363) = happyShift action_78 action_2 (365) = happyShift action_79 action_2 (370) = happyShift action_80 action_2 (371) = happyShift action_81 action_2 (372) = happyShift action_82 action_2 (375) = happyShift action_83 action_2 (376) = happyShift action_84 action_2 (379) = happyShift action_85 action_2 (380) = happyShift action_86 action_2 (381) = happyShift action_87 action_2 (382) = happyShift action_88 action_2 (383) = happyShift action_89 action_2 (384) = happyShift action_90 action_2 (385) = happyShift action_91 action_2 (386) = happyShift action_92 action_2 (387) = happyShift action_93 action_2 (388) = happyShift action_94 action_2 (389) = happyShift action_95 action_2 (390) = happyShift action_96 action_2 (391) = happyShift action_97 action_2 (392) = happyShift action_154 action_2 (393) = happyShift action_155 action_2 (394) = happyShift action_156 action_2 (395) = happyShift action_157 action_2 (396) = happyShift action_98 action_2 (397) = happyShift action_99 action_2 (398) = happyShift action_100 action_2 (399) = happyShift action_101 action_2 (401) = happyShift action_102 action_2 (403) = happyShift action_103 action_2 (404) = happyShift action_104 action_2 (405) = happyShift action_105 action_2 (406) = happyShift action_106 action_2 (407) = happyShift action_107 action_2 (408) = happyShift action_108 action_2 (409) = happyShift action_109 action_2 (38) = happyGoto action_13 action_2 (49) = happyGoto action_14 action_2 (52) = happyGoto action_170 action_2 (53) = happyGoto action_120 action_2 (54) = happyGoto action_121 action_2 (55) = happyGoto action_122 action_2 (63) = happyGoto action_123 action_2 (67) = happyGoto action_124 action_2 (68) = happyGoto action_125 action_2 (72) = happyGoto action_126 action_2 (100) = happyGoto action_127 action_2 (146) = happyGoto action_128 action_2 (147) = happyGoto action_129 action_2 (148) = happyGoto action_130 action_2 (153) = happyGoto action_131 action_2 (156) = happyGoto action_16 action_2 (158) = happyGoto action_132 action_2 (159) = happyGoto action_18 action_2 (161) = happyGoto action_19 action_2 (162) = happyGoto action_20 action_2 (163) = happyGoto action_21 action_2 (164) = happyGoto action_22 action_2 (165) = happyGoto action_23 action_2 (166) = happyGoto action_24 action_2 (167) = happyGoto action_25 action_2 (210) = happyGoto action_26 action_2 (217) = happyGoto action_27 action_2 (220) = happyGoto action_28 action_2 (240) = happyGoto action_29 action_2 (241) = happyGoto action_30 action_2 (242) = happyGoto action_31 action_2 (243) = happyGoto action_32 action_2 (249) = happyGoto action_33 action_2 (251) = happyGoto action_34 action_2 (252) = happyGoto action_35 action_2 (255) = happyGoto action_36 action_2 (259) = happyGoto action_133 action_2 (260) = happyGoto action_134 action_2 (261) = happyGoto action_135 action_2 (262) = happyGoto action_136 action_2 _ = happyFail action_3 (266) = happyShift action_37 action_3 (267) = happyShift action_38 action_3 (268) = happyShift action_39 action_3 (273) = happyShift action_40 action_3 (275) = happyShift action_41 action_3 (276) = happyShift action_42 action_3 (279) = happyShift action_43 action_3 (280) = happyShift action_44 action_3 (281) = happyShift action_45 action_3 (283) = happyShift action_46 action_3 (287) = happyShift action_47 action_3 (291) = happyShift action_48 action_3 (293) = happyShift action_49 action_3 (294) = happyShift action_50 action_3 (295) = happyShift action_51 action_3 (296) = happyShift action_52 action_3 (297) = happyShift action_53 action_3 (298) = happyShift action_54 action_3 (299) = happyShift action_55 action_3 (300) = happyShift action_56 action_3 (301) = happyShift action_57 action_3 (302) = happyShift action_58 action_3 (303) = happyShift action_59 action_3 (304) = happyShift action_60 action_3 (305) = happyShift action_61 action_3 (306) = happyShift action_62 action_3 (307) = happyShift action_63 action_3 (309) = happyShift action_64 action_3 (313) = happyShift action_65 action_3 (314) = happyShift action_66 action_3 (315) = happyShift action_67 action_3 (318) = happyShift action_68 action_3 (319) = happyShift action_69 action_3 (320) = happyShift action_70 action_3 (329) = happyShift action_71 action_3 (336) = happyShift action_72 action_3 (342) = happyShift action_73 action_3 (345) = happyShift action_74 action_3 (357) = happyShift action_75 action_3 (359) = happyShift action_76 action_3 (361) = happyShift action_77 action_3 (363) = happyShift action_78 action_3 (365) = happyShift action_79 action_3 (370) = happyShift action_80 action_3 (371) = happyShift action_81 action_3 (372) = happyShift action_82 action_3 (375) = happyShift action_83 action_3 (376) = happyShift action_84 action_3 (379) = happyShift action_85 action_3 (380) = happyShift action_86 action_3 (381) = happyShift action_87 action_3 (382) = happyShift action_88 action_3 (383) = happyShift action_89 action_3 (384) = happyShift action_90 action_3 (385) = happyShift action_91 action_3 (386) = happyShift action_92 action_3 (387) = happyShift action_93 action_3 (388) = happyShift action_94 action_3 (389) = happyShift action_95 action_3 (390) = happyShift action_96 action_3 (391) = happyShift action_97 action_3 (396) = happyShift action_98 action_3 (397) = happyShift action_99 action_3 (398) = happyShift action_100 action_3 (399) = happyShift action_101 action_3 (401) = happyShift action_102 action_3 (403) = happyShift action_103 action_3 (404) = happyShift action_104 action_3 (405) = happyShift action_105 action_3 (406) = happyShift action_106 action_3 (407) = happyShift action_107 action_3 (408) = happyShift action_108 action_3 (409) = happyShift action_109 action_3 (15) = happyGoto action_169 action_3 (38) = happyGoto action_13 action_3 (49) = happyGoto action_14 action_3 (153) = happyGoto action_15 action_3 (156) = happyGoto action_16 action_3 (158) = happyGoto action_17 action_3 (159) = happyGoto action_18 action_3 (161) = happyGoto action_19 action_3 (162) = happyGoto action_20 action_3 (163) = happyGoto action_21 action_3 (164) = happyGoto action_22 action_3 (165) = happyGoto action_23 action_3 (166) = happyGoto action_24 action_3 (167) = happyGoto action_25 action_3 (210) = happyGoto action_26 action_3 (217) = happyGoto action_27 action_3 (220) = happyGoto action_28 action_3 (240) = happyGoto action_29 action_3 (241) = happyGoto action_30 action_3 (242) = happyGoto action_31 action_3 (243) = happyGoto action_32 action_3 (249) = happyGoto action_33 action_3 (251) = happyGoto action_34 action_3 (252) = happyGoto action_35 action_3 (255) = happyGoto action_36 action_3 _ = happyFail action_4 (392) = happyShift action_113 action_4 (16) = happyGoto action_168 action_4 (19) = happyGoto action_111 action_4 (263) = happyGoto action_112 action_4 _ = happyReduce_22 action_5 (266) = happyShift action_37 action_5 (267) = happyShift action_38 action_5 (268) = happyShift action_39 action_5 (273) = happyShift action_40 action_5 (275) = happyShift action_41 action_5 (276) = happyShift action_42 action_5 (283) = happyShift action_46 action_5 (287) = happyShift action_47 action_5 (291) = happyShift action_48 action_5 (293) = happyShift action_49 action_5 (294) = happyShift action_50 action_5 (295) = happyShift action_51 action_5 (296) = happyShift action_52 action_5 (297) = happyShift action_53 action_5 (298) = happyShift action_54 action_5 (299) = happyShift action_55 action_5 (300) = happyShift action_56 action_5 (301) = happyShift action_57 action_5 (302) = happyShift action_58 action_5 (303) = happyShift action_59 action_5 (304) = happyShift action_60 action_5 (305) = happyShift action_61 action_5 (306) = happyShift action_62 action_5 (307) = happyShift action_63 action_5 (309) = happyShift action_64 action_5 (318) = happyShift action_68 action_5 (319) = happyShift action_69 action_5 (320) = happyShift action_70 action_5 (336) = happyShift action_72 action_5 (342) = happyShift action_73 action_5 (345) = happyShift action_74 action_5 (357) = happyShift action_75 action_5 (359) = happyShift action_76 action_5 (361) = happyShift action_118 action_5 (363) = happyShift action_78 action_5 (365) = happyShift action_79 action_5 (370) = happyShift action_80 action_5 (371) = happyShift action_81 action_5 (372) = happyShift action_82 action_5 (375) = happyShift action_83 action_5 (376) = happyShift action_84 action_5 (379) = happyShift action_85 action_5 (380) = happyShift action_86 action_5 (381) = happyShift action_87 action_5 (382) = happyShift action_88 action_5 (383) = happyShift action_89 action_5 (384) = happyShift action_90 action_5 (385) = happyShift action_91 action_5 (386) = happyShift action_92 action_5 (387) = happyShift action_93 action_5 (388) = happyShift action_94 action_5 (389) = happyShift action_95 action_5 (390) = happyShift action_96 action_5 (391) = happyShift action_97 action_5 (396) = happyShift action_98 action_5 (397) = happyShift action_99 action_5 (398) = happyShift action_100 action_5 (399) = happyShift action_101 action_5 (401) = happyShift action_102 action_5 (403) = happyShift action_103 action_5 (404) = happyShift action_104 action_5 (405) = happyShift action_105 action_5 (406) = happyShift action_106 action_5 (407) = happyShift action_107 action_5 (408) = happyShift action_108 action_5 (409) = happyShift action_109 action_5 (38) = happyGoto action_13 action_5 (156) = happyGoto action_16 action_5 (157) = happyGoto action_167 action_5 (158) = happyGoto action_116 action_5 (159) = happyGoto action_18 action_5 (161) = happyGoto action_19 action_5 (162) = happyGoto action_20 action_5 (163) = happyGoto action_21 action_5 (164) = happyGoto action_22 action_5 (165) = happyGoto action_23 action_5 (166) = happyGoto action_24 action_5 (167) = happyGoto action_25 action_5 (210) = happyGoto action_26 action_5 (217) = happyGoto action_27 action_5 (220) = happyGoto action_28 action_5 (241) = happyGoto action_30 action_5 (242) = happyGoto action_31 action_5 (243) = happyGoto action_117 action_5 (249) = happyGoto action_33 action_5 (251) = happyGoto action_34 action_5 (252) = happyGoto action_35 action_5 (255) = happyGoto action_36 action_5 _ = happyFail action_6 (266) = happyShift action_37 action_6 (267) = happyShift action_38 action_6 (268) = happyShift action_39 action_6 (273) = happyShift action_40 action_6 (275) = happyShift action_41 action_6 (276) = happyShift action_42 action_6 (283) = happyShift action_164 action_6 (287) = happyShift action_47 action_6 (291) = happyShift action_48 action_6 (293) = happyShift action_49 action_6 (294) = happyShift action_50 action_6 (295) = happyShift action_51 action_6 (296) = happyShift action_52 action_6 (297) = happyShift action_53 action_6 (298) = happyShift action_54 action_6 (299) = happyShift action_55 action_6 (300) = happyShift action_56 action_6 (301) = happyShift action_57 action_6 (302) = happyShift action_58 action_6 (303) = happyShift action_59 action_6 (304) = happyShift action_60 action_6 (305) = happyShift action_61 action_6 (306) = happyShift action_62 action_6 (307) = happyShift action_63 action_6 (308) = happyShift action_165 action_6 (309) = happyShift action_64 action_6 (318) = happyShift action_68 action_6 (319) = happyShift action_69 action_6 (320) = happyShift action_70 action_6 (336) = happyShift action_72 action_6 (342) = happyShift action_73 action_6 (345) = happyShift action_74 action_6 (346) = happyShift action_166 action_6 (357) = happyShift action_75 action_6 (359) = happyShift action_76 action_6 (361) = happyShift action_118 action_6 (363) = happyShift action_78 action_6 (365) = happyShift action_79 action_6 (370) = happyShift action_80 action_6 (371) = happyShift action_81 action_6 (372) = happyShift action_82 action_6 (375) = happyShift action_83 action_6 (376) = happyShift action_84 action_6 (379) = happyShift action_85 action_6 (380) = happyShift action_86 action_6 (381) = happyShift action_87 action_6 (382) = happyShift action_88 action_6 (383) = happyShift action_89 action_6 (384) = happyShift action_90 action_6 (385) = happyShift action_91 action_6 (386) = happyShift action_92 action_6 (387) = happyShift action_93 action_6 (388) = happyShift action_94 action_6 (389) = happyShift action_95 action_6 (390) = happyShift action_96 action_6 (391) = happyShift action_97 action_6 (396) = happyShift action_98 action_6 (397) = happyShift action_99 action_6 (398) = happyShift action_100 action_6 (399) = happyShift action_101 action_6 (401) = happyShift action_102 action_6 (403) = happyShift action_103 action_6 (404) = happyShift action_104 action_6 (405) = happyShift action_105 action_6 (406) = happyShift action_106 action_6 (407) = happyShift action_107 action_6 (408) = happyShift action_108 action_6 (409) = happyShift action_109 action_6 (38) = happyGoto action_13 action_6 (156) = happyGoto action_16 action_6 (157) = happyGoto action_160 action_6 (158) = happyGoto action_116 action_6 (159) = happyGoto action_18 action_6 (161) = happyGoto action_19 action_6 (162) = happyGoto action_20 action_6 (163) = happyGoto action_21 action_6 (164) = happyGoto action_22 action_6 (165) = happyGoto action_23 action_6 (166) = happyGoto action_24 action_6 (167) = happyGoto action_25 action_6 (196) = happyGoto action_161 action_6 (203) = happyGoto action_162 action_6 (204) = happyGoto action_163 action_6 (210) = happyGoto action_26 action_6 (217) = happyGoto action_27 action_6 (220) = happyGoto action_28 action_6 (241) = happyGoto action_30 action_6 (242) = happyGoto action_31 action_6 (243) = happyGoto action_117 action_6 (249) = happyGoto action_33 action_6 (251) = happyGoto action_34 action_6 (252) = happyGoto action_35 action_6 (255) = happyGoto action_36 action_6 _ = happyFail action_7 (277) = happyShift action_159 action_7 (40) = happyGoto action_158 action_7 _ = happyFail action_8 (266) = happyShift action_37 action_8 (267) = happyShift action_38 action_8 (268) = happyShift action_39 action_8 (269) = happyShift action_137 action_8 (270) = happyShift action_138 action_8 (271) = happyShift action_139 action_8 (272) = happyShift action_140 action_8 (273) = happyShift action_40 action_8 (275) = happyShift action_41 action_8 (276) = happyShift action_42 action_8 (279) = happyShift action_43 action_8 (280) = happyShift action_44 action_8 (281) = happyShift action_45 action_8 (282) = happyShift action_141 action_8 (283) = happyShift action_46 action_8 (285) = happyShift action_142 action_8 (287) = happyShift action_47 action_8 (289) = happyShift action_143 action_8 (291) = happyShift action_48 action_8 (292) = happyShift action_144 action_8 (293) = happyShift action_49 action_8 (294) = happyShift action_50 action_8 (295) = happyShift action_51 action_8 (296) = happyShift action_52 action_8 (297) = happyShift action_53 action_8 (298) = happyShift action_54 action_8 (299) = happyShift action_55 action_8 (300) = happyShift action_56 action_8 (301) = happyShift action_57 action_8 (302) = happyShift action_58 action_8 (303) = happyShift action_59 action_8 (304) = happyShift action_60 action_8 (305) = happyShift action_61 action_8 (306) = happyShift action_62 action_8 (307) = happyShift action_63 action_8 (309) = happyShift action_64 action_8 (312) = happyShift action_145 action_8 (313) = happyShift action_65 action_8 (314) = happyShift action_66 action_8 (315) = happyShift action_67 action_8 (317) = happyShift action_146 action_8 (318) = happyShift action_68 action_8 (319) = happyShift action_69 action_8 (320) = happyShift action_70 action_8 (321) = happyShift action_147 action_8 (322) = happyShift action_148 action_8 (325) = happyShift action_149 action_8 (326) = happyShift action_150 action_8 (327) = happyShift action_151 action_8 (328) = happyShift action_152 action_8 (329) = happyShift action_71 action_8 (336) = happyShift action_72 action_8 (342) = happyShift action_73 action_8 (345) = happyShift action_74 action_8 (346) = happyShift action_153 action_8 (357) = happyShift action_75 action_8 (359) = happyShift action_76 action_8 (361) = happyShift action_77 action_8 (363) = happyShift action_78 action_8 (365) = happyShift action_79 action_8 (370) = happyShift action_80 action_8 (371) = happyShift action_81 action_8 (372) = happyShift action_82 action_8 (375) = happyShift action_83 action_8 (376) = happyShift action_84 action_8 (379) = happyShift action_85 action_8 (380) = happyShift action_86 action_8 (381) = happyShift action_87 action_8 (382) = happyShift action_88 action_8 (383) = happyShift action_89 action_8 (384) = happyShift action_90 action_8 (385) = happyShift action_91 action_8 (386) = happyShift action_92 action_8 (387) = happyShift action_93 action_8 (388) = happyShift action_94 action_8 (389) = happyShift action_95 action_8 (390) = happyShift action_96 action_8 (391) = happyShift action_97 action_8 (392) = happyShift action_154 action_8 (393) = happyShift action_155 action_8 (394) = happyShift action_156 action_8 (395) = happyShift action_157 action_8 (396) = happyShift action_98 action_8 (397) = happyShift action_99 action_8 (398) = happyShift action_100 action_8 (399) = happyShift action_101 action_8 (401) = happyShift action_102 action_8 (403) = happyShift action_103 action_8 (404) = happyShift action_104 action_8 (405) = happyShift action_105 action_8 (406) = happyShift action_106 action_8 (407) = happyShift action_107 action_8 (408) = happyShift action_108 action_8 (409) = happyShift action_109 action_8 (38) = happyGoto action_13 action_8 (49) = happyGoto action_14 action_8 (52) = happyGoto action_119 action_8 (53) = happyGoto action_120 action_8 (54) = happyGoto action_121 action_8 (55) = happyGoto action_122 action_8 (63) = happyGoto action_123 action_8 (67) = happyGoto action_124 action_8 (68) = happyGoto action_125 action_8 (72) = happyGoto action_126 action_8 (100) = happyGoto action_127 action_8 (146) = happyGoto action_128 action_8 (147) = happyGoto action_129 action_8 (148) = happyGoto action_130 action_8 (153) = happyGoto action_131 action_8 (156) = happyGoto action_16 action_8 (158) = happyGoto action_132 action_8 (159) = happyGoto action_18 action_8 (161) = happyGoto action_19 action_8 (162) = happyGoto action_20 action_8 (163) = happyGoto action_21 action_8 (164) = happyGoto action_22 action_8 (165) = happyGoto action_23 action_8 (166) = happyGoto action_24 action_8 (167) = happyGoto action_25 action_8 (210) = happyGoto action_26 action_8 (217) = happyGoto action_27 action_8 (220) = happyGoto action_28 action_8 (240) = happyGoto action_29 action_8 (241) = happyGoto action_30 action_8 (242) = happyGoto action_31 action_8 (243) = happyGoto action_32 action_8 (249) = happyGoto action_33 action_8 (251) = happyGoto action_34 action_8 (252) = happyGoto action_35 action_8 (255) = happyGoto action_36 action_8 (259) = happyGoto action_133 action_8 (260) = happyGoto action_134 action_8 (261) = happyGoto action_135 action_8 (262) = happyGoto action_136 action_8 _ = happyFail action_9 (266) = happyShift action_37 action_9 (267) = happyShift action_38 action_9 (268) = happyShift action_39 action_9 (273) = happyShift action_40 action_9 (275) = happyShift action_41 action_9 (276) = happyShift action_42 action_9 (283) = happyShift action_46 action_9 (287) = happyShift action_47 action_9 (291) = happyShift action_48 action_9 (293) = happyShift action_49 action_9 (294) = happyShift action_50 action_9 (295) = happyShift action_51 action_9 (296) = happyShift action_52 action_9 (297) = happyShift action_53 action_9 (298) = happyShift action_54 action_9 (299) = happyShift action_55 action_9 (300) = happyShift action_56 action_9 (301) = happyShift action_57 action_9 (302) = happyShift action_58 action_9 (303) = happyShift action_59 action_9 (304) = happyShift action_60 action_9 (305) = happyShift action_61 action_9 (306) = happyShift action_62 action_9 (307) = happyShift action_63 action_9 (309) = happyShift action_64 action_9 (318) = happyShift action_68 action_9 (319) = happyShift action_69 action_9 (320) = happyShift action_70 action_9 (336) = happyShift action_72 action_9 (342) = happyShift action_73 action_9 (345) = happyShift action_74 action_9 (357) = happyShift action_75 action_9 (359) = happyShift action_76 action_9 (361) = happyShift action_118 action_9 (363) = happyShift action_78 action_9 (365) = happyShift action_79 action_9 (370) = happyShift action_80 action_9 (371) = happyShift action_81 action_9 (372) = happyShift action_82 action_9 (375) = happyShift action_83 action_9 (376) = happyShift action_84 action_9 (379) = happyShift action_85 action_9 (380) = happyShift action_86 action_9 (381) = happyShift action_87 action_9 (382) = happyShift action_88 action_9 (383) = happyShift action_89 action_9 (384) = happyShift action_90 action_9 (385) = happyShift action_91 action_9 (386) = happyShift action_92 action_9 (387) = happyShift action_93 action_9 (388) = happyShift action_94 action_9 (389) = happyShift action_95 action_9 (390) = happyShift action_96 action_9 (391) = happyShift action_97 action_9 (396) = happyShift action_98 action_9 (397) = happyShift action_99 action_9 (398) = happyShift action_100 action_9 (399) = happyShift action_101 action_9 (401) = happyShift action_102 action_9 (403) = happyShift action_103 action_9 (404) = happyShift action_104 action_9 (405) = happyShift action_105 action_9 (406) = happyShift action_106 action_9 (407) = happyShift action_107 action_9 (408) = happyShift action_108 action_9 (409) = happyShift action_109 action_9 (38) = happyGoto action_13 action_9 (156) = happyGoto action_16 action_9 (157) = happyGoto action_115 action_9 (158) = happyGoto action_116 action_9 (159) = happyGoto action_18 action_9 (161) = happyGoto action_19 action_9 (162) = happyGoto action_20 action_9 (163) = happyGoto action_21 action_9 (164) = happyGoto action_22 action_9 (165) = happyGoto action_23 action_9 (166) = happyGoto action_24 action_9 (167) = happyGoto action_25 action_9 (210) = happyGoto action_26 action_9 (217) = happyGoto action_27 action_9 (220) = happyGoto action_28 action_9 (241) = happyGoto action_30 action_9 (242) = happyGoto action_31 action_9 (243) = happyGoto action_117 action_9 (249) = happyGoto action_33 action_9 (251) = happyGoto action_34 action_9 (252) = happyGoto action_35 action_9 (255) = happyGoto action_36 action_9 _ = happyFail action_10 (266) = happyShift action_37 action_10 (267) = happyShift action_38 action_10 (268) = happyShift action_39 action_10 (273) = happyShift action_40 action_10 (275) = happyShift action_41 action_10 (276) = happyShift action_42 action_10 (279) = happyShift action_43 action_10 (280) = happyShift action_44 action_10 (281) = happyShift action_45 action_10 (283) = happyShift action_46 action_10 (287) = happyShift action_47 action_10 (291) = happyShift action_48 action_10 (293) = happyShift action_49 action_10 (294) = happyShift action_50 action_10 (295) = happyShift action_51 action_10 (296) = happyShift action_52 action_10 (297) = happyShift action_53 action_10 (298) = happyShift action_54 action_10 (299) = happyShift action_55 action_10 (300) = happyShift action_56 action_10 (301) = happyShift action_57 action_10 (302) = happyShift action_58 action_10 (303) = happyShift action_59 action_10 (304) = happyShift action_60 action_10 (305) = happyShift action_61 action_10 (306) = happyShift action_62 action_10 (307) = happyShift action_63 action_10 (309) = happyShift action_64 action_10 (313) = happyShift action_65 action_10 (314) = happyShift action_66 action_10 (315) = happyShift action_67 action_10 (318) = happyShift action_68 action_10 (319) = happyShift action_69 action_10 (320) = happyShift action_70 action_10 (329) = happyShift action_71 action_10 (336) = happyShift action_72 action_10 (342) = happyShift action_73 action_10 (345) = happyShift action_74 action_10 (357) = happyShift action_75 action_10 (359) = happyShift action_76 action_10 (361) = happyShift action_77 action_10 (363) = happyShift action_78 action_10 (365) = happyShift action_79 action_10 (370) = happyShift action_80 action_10 (371) = happyShift action_81 action_10 (372) = happyShift action_82 action_10 (375) = happyShift action_83 action_10 (376) = happyShift action_84 action_10 (379) = happyShift action_85 action_10 (380) = happyShift action_86 action_10 (381) = happyShift action_87 action_10 (382) = happyShift action_88 action_10 (383) = happyShift action_89 action_10 (384) = happyShift action_90 action_10 (385) = happyShift action_91 action_10 (386) = happyShift action_92 action_10 (387) = happyShift action_93 action_10 (388) = happyShift action_94 action_10 (389) = happyShift action_95 action_10 (390) = happyShift action_96 action_10 (391) = happyShift action_97 action_10 (396) = happyShift action_98 action_10 (397) = happyShift action_99 action_10 (398) = happyShift action_100 action_10 (399) = happyShift action_101 action_10 (401) = happyShift action_102 action_10 (403) = happyShift action_103 action_10 (404) = happyShift action_104 action_10 (405) = happyShift action_105 action_10 (406) = happyShift action_106 action_10 (407) = happyShift action_107 action_10 (408) = happyShift action_108 action_10 (409) = happyShift action_109 action_10 (15) = happyGoto action_114 action_10 (38) = happyGoto action_13 action_10 (49) = happyGoto action_14 action_10 (153) = happyGoto action_15 action_10 (156) = happyGoto action_16 action_10 (158) = happyGoto action_17 action_10 (159) = happyGoto action_18 action_10 (161) = happyGoto action_19 action_10 (162) = happyGoto action_20 action_10 (163) = happyGoto action_21 action_10 (164) = happyGoto action_22 action_10 (165) = happyGoto action_23 action_10 (166) = happyGoto action_24 action_10 (167) = happyGoto action_25 action_10 (210) = happyGoto action_26 action_10 (217) = happyGoto action_27 action_10 (220) = happyGoto action_28 action_10 (240) = happyGoto action_29 action_10 (241) = happyGoto action_30 action_10 (242) = happyGoto action_31 action_10 (243) = happyGoto action_32 action_10 (249) = happyGoto action_33 action_10 (251) = happyGoto action_34 action_10 (252) = happyGoto action_35 action_10 (255) = happyGoto action_36 action_10 _ = happyFail action_11 (392) = happyShift action_113 action_11 (16) = happyGoto action_110 action_11 (19) = happyGoto action_111 action_11 (263) = happyGoto action_112 action_11 _ = happyReduce_22 action_12 (266) = happyShift action_37 action_12 (267) = happyShift action_38 action_12 (268) = happyShift action_39 action_12 (273) = happyShift action_40 action_12 (275) = happyShift action_41 action_12 (276) = happyShift action_42 action_12 (279) = happyShift action_43 action_12 (280) = happyShift action_44 action_12 (281) = happyShift action_45 action_12 (283) = happyShift action_46 action_12 (287) = happyShift action_47 action_12 (291) = happyShift action_48 action_12 (293) = happyShift action_49 action_12 (294) = happyShift action_50 action_12 (295) = happyShift action_51 action_12 (296) = happyShift action_52 action_12 (297) = happyShift action_53 action_12 (298) = happyShift action_54 action_12 (299) = happyShift action_55 action_12 (300) = happyShift action_56 action_12 (301) = happyShift action_57 action_12 (302) = happyShift action_58 action_12 (303) = happyShift action_59 action_12 (304) = happyShift action_60 action_12 (305) = happyShift action_61 action_12 (306) = happyShift action_62 action_12 (307) = happyShift action_63 action_12 (309) = happyShift action_64 action_12 (313) = happyShift action_65 action_12 (314) = happyShift action_66 action_12 (315) = happyShift action_67 action_12 (318) = happyShift action_68 action_12 (319) = happyShift action_69 action_12 (320) = happyShift action_70 action_12 (329) = happyShift action_71 action_12 (336) = happyShift action_72 action_12 (342) = happyShift action_73 action_12 (345) = happyShift action_74 action_12 (357) = happyShift action_75 action_12 (359) = happyShift action_76 action_12 (361) = happyShift action_77 action_12 (363) = happyShift action_78 action_12 (365) = happyShift action_79 action_12 (370) = happyShift action_80 action_12 (371) = happyShift action_81 action_12 (372) = happyShift action_82 action_12 (375) = happyShift action_83 action_12 (376) = happyShift action_84 action_12 (379) = happyShift action_85 action_12 (380) = happyShift action_86 action_12 (381) = happyShift action_87 action_12 (382) = happyShift action_88 action_12 (383) = happyShift action_89 action_12 (384) = happyShift action_90 action_12 (385) = happyShift action_91 action_12 (386) = happyShift action_92 action_12 (387) = happyShift action_93 action_12 (388) = happyShift action_94 action_12 (389) = happyShift action_95 action_12 (390) = happyShift action_96 action_12 (391) = happyShift action_97 action_12 (396) = happyShift action_98 action_12 (397) = happyShift action_99 action_12 (398) = happyShift action_100 action_12 (399) = happyShift action_101 action_12 (401) = happyShift action_102 action_12 (403) = happyShift action_103 action_12 (404) = happyShift action_104 action_12 (405) = happyShift action_105 action_12 (406) = happyShift action_106 action_12 (407) = happyShift action_107 action_12 (408) = happyShift action_108 action_12 (409) = happyShift action_109 action_12 (38) = happyGoto action_13 action_12 (49) = happyGoto action_14 action_12 (153) = happyGoto action_15 action_12 (156) = happyGoto action_16 action_12 (158) = happyGoto action_17 action_12 (159) = happyGoto action_18 action_12 (161) = happyGoto action_19 action_12 (162) = happyGoto action_20 action_12 (163) = happyGoto action_21 action_12 (164) = happyGoto action_22 action_12 (165) = happyGoto action_23 action_12 (166) = happyGoto action_24 action_12 (167) = happyGoto action_25 action_12 (210) = happyGoto action_26 action_12 (217) = happyGoto action_27 action_12 (220) = happyGoto action_28 action_12 (240) = happyGoto action_29 action_12 (241) = happyGoto action_30 action_12 (242) = happyGoto action_31 action_12 (243) = happyGoto action_32 action_12 (249) = happyGoto action_33 action_12 (251) = happyGoto action_34 action_12 (252) = happyGoto action_35 action_12 (255) = happyGoto action_36 action_12 _ = happyFail action_13 _ = happyReduce_437 action_14 (384) = happyShift action_391 action_14 (48) = happyGoto action_390 action_14 _ = happyReduce_85 action_15 _ = happyReduce_12 action_16 _ = happyReduce_458 action_17 (333) = happyShift action_278 action_17 (334) = happyShift action_389 action_17 (345) = happyShift action_280 action_17 (346) = happyShift action_281 action_17 (347) = happyShift action_282 action_17 (352) = happyShift action_283 action_17 (369) = happyShift action_284 action_17 (373) = happyShift action_285 action_17 (374) = happyShift action_286 action_17 (377) = happyShift action_287 action_17 (378) = happyShift action_288 action_17 (222) = happyGoto action_268 action_17 (233) = happyGoto action_269 action_17 (235) = happyGoto action_270 action_17 (244) = happyGoto action_271 action_17 (246) = happyGoto action_272 action_17 (247) = happyGoto action_273 action_17 (248) = happyGoto action_274 action_17 (250) = happyGoto action_275 action_17 (253) = happyGoto action_276 action_17 (254) = happyGoto action_277 action_17 _ = happyFail action_18 _ = happyReduce_408 action_19 (266) = happyShift action_37 action_19 (267) = happyShift action_38 action_19 (268) = happyShift action_39 action_19 (273) = happyShift action_40 action_19 (275) = happyShift action_41 action_19 (276) = happyShift action_42 action_19 (283) = happyShift action_46 action_19 (287) = happyShift action_47 action_19 (291) = happyShift action_48 action_19 (293) = happyShift action_49 action_19 (294) = happyShift action_50 action_19 (295) = happyShift action_51 action_19 (296) = happyShift action_52 action_19 (297) = happyShift action_53 action_19 (298) = happyShift action_54 action_19 (299) = happyShift action_55 action_19 (300) = happyShift action_56 action_19 (301) = happyShift action_57 action_19 (302) = happyShift action_58 action_19 (303) = happyShift action_59 action_19 (304) = happyShift action_60 action_19 (305) = happyShift action_61 action_19 (306) = happyShift action_62 action_19 (307) = happyShift action_63 action_19 (309) = happyShift action_64 action_19 (318) = happyShift action_68 action_19 (319) = happyShift action_69 action_19 (320) = happyShift action_70 action_19 (336) = happyShift action_72 action_19 (342) = happyShift action_73 action_19 (345) = happyShift action_74 action_19 (357) = happyShift action_75 action_19 (359) = happyShift action_76 action_19 (361) = happyShift action_118 action_19 (363) = happyShift action_78 action_19 (365) = happyShift action_79 action_19 (370) = happyShift action_80 action_19 (371) = happyShift action_81 action_19 (372) = happyShift action_82 action_19 (375) = happyShift action_83 action_19 (376) = happyShift action_84 action_19 (379) = happyShift action_85 action_19 (380) = happyShift action_86 action_19 (381) = happyShift action_87 action_19 (382) = happyShift action_88 action_19 (383) = happyShift action_89 action_19 (384) = happyShift action_90 action_19 (385) = happyShift action_91 action_19 (386) = happyShift action_92 action_19 (387) = happyShift action_93 action_19 (388) = happyShift action_94 action_19 (389) = happyShift action_95 action_19 (390) = happyShift action_96 action_19 (391) = happyShift action_97 action_19 (396) = happyShift action_98 action_19 (397) = happyShift action_99 action_19 (398) = happyShift action_100 action_19 (399) = happyShift action_101 action_19 (401) = happyShift action_102 action_19 (403) = happyShift action_103 action_19 (404) = happyShift action_104 action_19 (405) = happyShift action_105 action_19 (406) = happyShift action_106 action_19 (407) = happyShift action_107 action_19 (408) = happyShift action_108 action_19 (409) = happyShift action_109 action_19 (38) = happyGoto action_13 action_19 (156) = happyGoto action_16 action_19 (157) = happyGoto action_388 action_19 (158) = happyGoto action_116 action_19 (159) = happyGoto action_18 action_19 (161) = happyGoto action_19 action_19 (162) = happyGoto action_20 action_19 (163) = happyGoto action_21 action_19 (164) = happyGoto action_22 action_19 (165) = happyGoto action_23 action_19 (166) = happyGoto action_24 action_19 (167) = happyGoto action_25 action_19 (210) = happyGoto action_26 action_19 (217) = happyGoto action_27 action_19 (220) = happyGoto action_28 action_19 (241) = happyGoto action_30 action_19 (242) = happyGoto action_31 action_19 (243) = happyGoto action_117 action_19 (249) = happyGoto action_33 action_19 (251) = happyGoto action_34 action_19 (252) = happyGoto action_35 action_19 (255) = happyGoto action_36 action_19 _ = happyFail action_20 (266) = happyShift action_37 action_20 (267) = happyShift action_38 action_20 (268) = happyShift action_39 action_20 (273) = happyShift action_40 action_20 (275) = happyShift action_41 action_20 (276) = happyShift action_42 action_20 (283) = happyShift action_46 action_20 (287) = happyShift action_47 action_20 (291) = happyShift action_48 action_20 (293) = happyShift action_49 action_20 (294) = happyShift action_50 action_20 (295) = happyShift action_51 action_20 (296) = happyShift action_52 action_20 (297) = happyShift action_53 action_20 (298) = happyShift action_54 action_20 (299) = happyShift action_55 action_20 (300) = happyShift action_56 action_20 (301) = happyShift action_57 action_20 (302) = happyShift action_58 action_20 (303) = happyShift action_59 action_20 (304) = happyShift action_60 action_20 (305) = happyShift action_61 action_20 (306) = happyShift action_62 action_20 (307) = happyShift action_63 action_20 (309) = happyShift action_64 action_20 (318) = happyShift action_68 action_20 (319) = happyShift action_69 action_20 (320) = happyShift action_70 action_20 (336) = happyShift action_72 action_20 (342) = happyShift action_73 action_20 (345) = happyShift action_74 action_20 (357) = happyShift action_75 action_20 (359) = happyShift action_76 action_20 (361) = happyShift action_118 action_20 (363) = happyShift action_78 action_20 (365) = happyShift action_79 action_20 (370) = happyShift action_80 action_20 (371) = happyShift action_81 action_20 (372) = happyShift action_82 action_20 (375) = happyShift action_83 action_20 (376) = happyShift action_84 action_20 (379) = happyShift action_85 action_20 (380) = happyShift action_86 action_20 (381) = happyShift action_87 action_20 (382) = happyShift action_88 action_20 (383) = happyShift action_89 action_20 (384) = happyShift action_90 action_20 (385) = happyShift action_91 action_20 (386) = happyShift action_92 action_20 (387) = happyShift action_93 action_20 (388) = happyShift action_94 action_20 (389) = happyShift action_95 action_20 (390) = happyShift action_96 action_20 (391) = happyShift action_97 action_20 (396) = happyShift action_98 action_20 (397) = happyShift action_99 action_20 (398) = happyShift action_100 action_20 (399) = happyShift action_101 action_20 (401) = happyShift action_102 action_20 (403) = happyShift action_103 action_20 (404) = happyShift action_104 action_20 (405) = happyShift action_105 action_20 (406) = happyShift action_106 action_20 (407) = happyShift action_107 action_20 (408) = happyShift action_108 action_20 (409) = happyShift action_109 action_20 (38) = happyGoto action_13 action_20 (156) = happyGoto action_16 action_20 (157) = happyGoto action_387 action_20 (158) = happyGoto action_116 action_20 (159) = happyGoto action_18 action_20 (161) = happyGoto action_19 action_20 (162) = happyGoto action_20 action_20 (163) = happyGoto action_21 action_20 (164) = happyGoto action_22 action_20 (165) = happyGoto action_23 action_20 (166) = happyGoto action_24 action_20 (167) = happyGoto action_25 action_20 (210) = happyGoto action_26 action_20 (217) = happyGoto action_27 action_20 (220) = happyGoto action_28 action_20 (241) = happyGoto action_30 action_20 (242) = happyGoto action_31 action_20 (243) = happyGoto action_117 action_20 (249) = happyGoto action_33 action_20 (251) = happyGoto action_34 action_20 (252) = happyGoto action_35 action_20 (255) = happyGoto action_36 action_20 _ = happyFail action_21 (266) = happyShift action_37 action_21 (267) = happyShift action_38 action_21 (275) = happyShift action_41 action_21 (287) = happyShift action_47 action_21 (291) = happyShift action_48 action_21 (293) = happyShift action_49 action_21 (294) = happyShift action_50 action_21 (295) = happyShift action_51 action_21 (296) = happyShift action_52 action_21 (297) = happyShift action_53 action_21 (298) = happyShift action_54 action_21 (300) = happyShift action_56 action_21 (301) = happyShift action_57 action_21 (302) = happyShift action_58 action_21 (303) = happyShift action_59 action_21 (304) = happyShift action_60 action_21 (305) = happyShift action_61 action_21 (306) = happyShift action_62 action_21 (309) = happyShift action_64 action_21 (342) = happyShift action_73 action_21 (357) = happyShift action_75 action_21 (359) = happyShift action_76 action_21 (361) = happyShift action_118 action_21 (363) = happyShift action_78 action_21 (365) = happyShift action_79 action_21 (370) = happyShift action_80 action_21 (371) = happyShift action_81 action_21 (372) = happyShift action_82 action_21 (375) = happyShift action_83 action_21 (376) = happyShift action_84 action_21 (379) = happyShift action_85 action_21 (380) = happyShift action_86 action_21 (381) = happyShift action_87 action_21 (382) = happyShift action_88 action_21 (383) = happyShift action_89 action_21 (384) = happyShift action_90 action_21 (385) = happyShift action_91 action_21 (386) = happyShift action_92 action_21 (387) = happyShift action_93 action_21 (388) = happyShift action_94 action_21 (389) = happyShift action_95 action_21 (390) = happyShift action_96 action_21 (391) = happyShift action_97 action_21 (396) = happyShift action_98 action_21 (397) = happyShift action_99 action_21 (398) = happyShift action_100 action_21 (399) = happyShift action_101 action_21 (401) = happyShift action_102 action_21 (403) = happyShift action_103 action_21 (404) = happyShift action_104 action_21 (405) = happyShift action_105 action_21 (406) = happyShift action_106 action_21 (407) = happyShift action_107 action_21 (408) = happyShift action_108 action_21 (409) = happyShift action_109 action_21 (38) = happyGoto action_13 action_21 (156) = happyGoto action_16 action_21 (164) = happyGoto action_386 action_21 (165) = happyGoto action_23 action_21 (166) = happyGoto action_24 action_21 (167) = happyGoto action_25 action_21 (210) = happyGoto action_26 action_21 (217) = happyGoto action_27 action_21 (220) = happyGoto action_28 action_21 (241) = happyGoto action_30 action_21 (242) = happyGoto action_31 action_21 (243) = happyGoto action_117 action_21 (249) = happyGoto action_33 action_21 (251) = happyGoto action_34 action_21 (252) = happyGoto action_35 action_21 (255) = happyGoto action_36 action_21 _ = happyReduce_423 action_22 _ = happyReduce_430 action_23 (353) = happyShift action_385 action_23 _ = happyReduce_433 action_24 _ = happyReduce_435 action_25 _ = happyReduce_448 action_26 _ = happyReduce_436 action_27 _ = happyReduce_65 action_28 _ = happyReduce_578 action_29 (368) = happyShift action_384 action_29 _ = happyFail action_30 (341) = happyShift action_383 action_30 _ = happyReduce_64 action_31 _ = happyReduce_641 action_32 (368) = happyReduce_639 action_32 _ = happyReduce_644 action_33 _ = happyReduce_648 action_34 _ = happyReduce_576 action_35 _ = happyReduce_679 action_36 _ = happyReduce_438 action_37 _ = happyReduce_447 action_38 _ = happyReduce_664 action_39 (266) = happyShift action_37 action_39 (267) = happyShift action_38 action_39 (268) = happyShift action_39 action_39 (273) = happyShift action_40 action_39 (275) = happyShift action_41 action_39 (276) = happyShift action_42 action_39 (283) = happyShift action_46 action_39 (287) = happyShift action_47 action_39 (291) = happyShift action_48 action_39 (293) = happyShift action_49 action_39 (294) = happyShift action_50 action_39 (295) = happyShift action_51 action_39 (296) = happyShift action_52 action_39 (297) = happyShift action_53 action_39 (298) = happyShift action_54 action_39 (299) = happyShift action_55 action_39 (300) = happyShift action_56 action_39 (301) = happyShift action_57 action_39 (302) = happyShift action_58 action_39 (303) = happyShift action_59 action_39 (304) = happyShift action_60 action_39 (305) = happyShift action_61 action_39 (306) = happyShift action_62 action_39 (307) = happyShift action_63 action_39 (309) = happyShift action_64 action_39 (318) = happyShift action_68 action_39 (319) = happyShift action_69 action_39 (320) = happyShift action_70 action_39 (336) = happyShift action_72 action_39 (342) = happyShift action_73 action_39 (345) = happyShift action_74 action_39 (357) = happyShift action_75 action_39 (359) = happyShift action_76 action_39 (361) = happyShift action_118 action_39 (363) = happyShift action_78 action_39 (365) = happyShift action_79 action_39 (370) = happyShift action_80 action_39 (371) = happyShift action_81 action_39 (372) = happyShift action_82 action_39 (375) = happyShift action_83 action_39 (376) = happyShift action_84 action_39 (379) = happyShift action_85 action_39 (380) = happyShift action_86 action_39 (381) = happyShift action_87 action_39 (382) = happyShift action_88 action_39 (383) = happyShift action_89 action_39 (384) = happyShift action_90 action_39 (385) = happyShift action_91 action_39 (386) = happyShift action_92 action_39 (387) = happyShift action_93 action_39 (388) = happyShift action_94 action_39 (389) = happyShift action_95 action_39 (390) = happyShift action_96 action_39 (391) = happyShift action_97 action_39 (396) = happyShift action_98 action_39 (397) = happyShift action_99 action_39 (398) = happyShift action_100 action_39 (399) = happyShift action_101 action_39 (401) = happyShift action_102 action_39 (403) = happyShift action_103 action_39 (404) = happyShift action_104 action_39 (405) = happyShift action_105 action_39 (406) = happyShift action_106 action_39 (407) = happyShift action_107 action_39 (408) = happyShift action_108 action_39 (409) = happyShift action_109 action_39 (38) = happyGoto action_13 action_39 (156) = happyGoto action_16 action_39 (157) = happyGoto action_382 action_39 (158) = happyGoto action_116 action_39 (159) = happyGoto action_18 action_39 (161) = happyGoto action_19 action_39 (162) = happyGoto action_20 action_39 (163) = happyGoto action_21 action_39 (164) = happyGoto action_22 action_39 (165) = happyGoto action_23 action_39 (166) = happyGoto action_24 action_39 (167) = happyGoto action_25 action_39 (210) = happyGoto action_26 action_39 (217) = happyGoto action_27 action_39 (220) = happyGoto action_28 action_39 (241) = happyGoto action_30 action_39 (242) = happyGoto action_31 action_39 (243) = happyGoto action_117 action_39 (249) = happyGoto action_33 action_39 (251) = happyGoto action_34 action_39 (252) = happyGoto action_35 action_39 (255) = happyGoto action_36 action_39 _ = happyFail action_40 (353) = happyShift action_175 action_40 (355) = happyShift action_176 action_40 (199) = happyGoto action_381 action_40 _ = happyFail action_41 _ = happyReduce_666 action_42 (266) = happyShift action_37 action_42 (267) = happyShift action_38 action_42 (268) = happyShift action_39 action_42 (273) = happyShift action_40 action_42 (275) = happyShift action_41 action_42 (276) = happyShift action_42 action_42 (283) = happyShift action_46 action_42 (287) = happyShift action_47 action_42 (291) = happyShift action_48 action_42 (293) = happyShift action_49 action_42 (294) = happyShift action_50 action_42 (295) = happyShift action_51 action_42 (296) = happyShift action_52 action_42 (297) = happyShift action_53 action_42 (298) = happyShift action_54 action_42 (299) = happyShift action_55 action_42 (300) = happyShift action_56 action_42 (301) = happyShift action_57 action_42 (302) = happyShift action_58 action_42 (303) = happyShift action_59 action_42 (304) = happyShift action_60 action_42 (305) = happyShift action_61 action_42 (306) = happyShift action_62 action_42 (307) = happyShift action_63 action_42 (309) = happyShift action_64 action_42 (318) = happyShift action_68 action_42 (319) = happyShift action_69 action_42 (320) = happyShift action_70 action_42 (336) = happyShift action_72 action_42 (338) = happyShift action_379 action_42 (342) = happyShift action_73 action_42 (345) = happyShift action_74 action_42 (353) = happyShift action_380 action_42 (357) = happyShift action_75 action_42 (359) = happyShift action_76 action_42 (361) = happyShift action_118 action_42 (363) = happyShift action_78 action_42 (365) = happyShift action_79 action_42 (370) = happyShift action_80 action_42 (371) = happyShift action_81 action_42 (372) = happyShift action_82 action_42 (375) = happyShift action_83 action_42 (376) = happyShift action_84 action_42 (379) = happyShift action_85 action_42 (380) = happyShift action_86 action_42 (381) = happyShift action_87 action_42 (382) = happyShift action_88 action_42 (383) = happyShift action_89 action_42 (384) = happyShift action_90 action_42 (385) = happyShift action_91 action_42 (386) = happyShift action_92 action_42 (387) = happyShift action_93 action_42 (388) = happyShift action_94 action_42 (389) = happyShift action_95 action_42 (390) = happyShift action_96 action_42 (391) = happyShift action_97 action_42 (396) = happyShift action_98 action_42 (397) = happyShift action_99 action_42 (398) = happyShift action_100 action_42 (399) = happyShift action_101 action_42 (401) = happyShift action_102 action_42 (403) = happyShift action_103 action_42 (404) = happyShift action_104 action_42 (405) = happyShift action_105 action_42 (406) = happyShift action_106 action_42 (407) = happyShift action_107 action_42 (408) = happyShift action_108 action_42 (409) = happyShift action_109 action_42 (38) = happyGoto action_13 action_42 (156) = happyGoto action_16 action_42 (157) = happyGoto action_375 action_42 (158) = happyGoto action_116 action_42 (159) = happyGoto action_18 action_42 (161) = happyGoto action_19 action_42 (162) = happyGoto action_20 action_42 (163) = happyGoto action_21 action_42 (164) = happyGoto action_22 action_42 (165) = happyGoto action_23 action_42 (166) = happyGoto action_24 action_42 (167) = happyGoto action_25 action_42 (192) = happyGoto action_376 action_42 (193) = happyGoto action_377 action_42 (194) = happyGoto action_378 action_42 (210) = happyGoto action_26 action_42 (217) = happyGoto action_27 action_42 (220) = happyGoto action_28 action_42 (241) = happyGoto action_30 action_42 (242) = happyGoto action_31 action_42 (243) = happyGoto action_117 action_42 (249) = happyGoto action_33 action_42 (251) = happyGoto action_34 action_42 (252) = happyGoto action_35 action_42 (255) = happyGoto action_36 action_42 _ = happyFail action_43 _ = happyReduce_87 action_44 _ = happyReduce_88 action_45 _ = happyReduce_89 action_46 (353) = happyShift action_179 action_46 (355) = happyShift action_180 action_46 (84) = happyGoto action_177 action_46 (85) = happyGoto action_374 action_46 _ = happyFail action_47 _ = happyReduce_665 action_48 _ = happyReduce_652 action_49 _ = happyReduce_667 action_50 _ = happyReduce_668 action_51 _ = happyReduce_669 action_52 _ = happyReduce_650 action_53 _ = happyReduce_651 action_54 _ = happyReduce_649 action_55 (353) = happyShift action_175 action_55 (355) = happyShift action_176 action_55 (199) = happyGoto action_373 action_55 _ = happyFail action_56 _ = happyReduce_653 action_57 _ = happyReduce_654 action_58 _ = happyReduce_670 action_59 _ = happyReduce_671 action_60 _ = happyReduce_672 action_61 _ = happyReduce_673 action_62 _ = happyReduce_674 action_63 (266) = happyShift action_37 action_63 (267) = happyShift action_38 action_63 (275) = happyShift action_41 action_63 (287) = happyShift action_47 action_63 (291) = happyShift action_48 action_63 (293) = happyShift action_49 action_63 (294) = happyShift action_50 action_63 (295) = happyShift action_51 action_63 (296) = happyShift action_52 action_63 (297) = happyShift action_53 action_63 (298) = happyShift action_54 action_63 (300) = happyShift action_56 action_63 (301) = happyShift action_57 action_63 (302) = happyShift action_58 action_63 (303) = happyShift action_59 action_63 (304) = happyShift action_60 action_63 (305) = happyShift action_61 action_63 (306) = happyShift action_62 action_63 (309) = happyShift action_64 action_63 (342) = happyShift action_73 action_63 (357) = happyShift action_75 action_63 (359) = happyShift action_76 action_63 (361) = happyShift action_118 action_63 (363) = happyShift action_78 action_63 (365) = happyShift action_79 action_63 (370) = happyShift action_80 action_63 (371) = happyShift action_81 action_63 (372) = happyShift action_82 action_63 (375) = happyShift action_83 action_63 (376) = happyShift action_84 action_63 (379) = happyShift action_85 action_63 (380) = happyShift action_86 action_63 (381) = happyShift action_87 action_63 (382) = happyShift action_88 action_63 (383) = happyShift action_89 action_63 (384) = happyShift action_90 action_63 (385) = happyShift action_91 action_63 (386) = happyShift action_92 action_63 (387) = happyShift action_93 action_63 (388) = happyShift action_94 action_63 (389) = happyShift action_95 action_63 (390) = happyShift action_96 action_63 (391) = happyShift action_97 action_63 (396) = happyShift action_98 action_63 (397) = happyShift action_99 action_63 (398) = happyShift action_100 action_63 (399) = happyShift action_101 action_63 (401) = happyShift action_102 action_63 (403) = happyShift action_103 action_63 (404) = happyShift action_104 action_63 (405) = happyShift action_105 action_63 (406) = happyShift action_106 action_63 (407) = happyShift action_107 action_63 (408) = happyShift action_108 action_63 (409) = happyShift action_109 action_63 (38) = happyGoto action_13 action_63 (156) = happyGoto action_16 action_63 (164) = happyGoto action_372 action_63 (165) = happyGoto action_23 action_63 (166) = happyGoto action_24 action_63 (167) = happyGoto action_25 action_63 (210) = happyGoto action_26 action_63 (217) = happyGoto action_27 action_63 (220) = happyGoto action_28 action_63 (241) = happyGoto action_30 action_63 (242) = happyGoto action_31 action_63 (243) = happyGoto action_117 action_63 (249) = happyGoto action_33 action_63 (251) = happyGoto action_34 action_63 (252) = happyGoto action_35 action_63 (255) = happyGoto action_36 action_63 _ = happyFail action_64 _ = happyReduce_675 action_65 (357) = happyShift action_368 action_65 (154) = happyGoto action_371 action_65 (155) = happyGoto action_367 action_65 _ = happyReduce_396 action_66 (282) = happyShift action_370 action_66 (357) = happyShift action_368 action_66 (154) = happyGoto action_369 action_66 (155) = happyGoto action_367 action_66 _ = happyReduce_396 action_67 (357) = happyShift action_368 action_67 (154) = happyGoto action_366 action_67 (155) = happyGoto action_367 action_67 _ = happyReduce_396 action_68 (383) = happyShift action_365 action_68 _ = happyFail action_69 (371) = happyShift action_363 action_69 (383) = happyShift action_364 action_69 _ = happyFail action_70 (383) = happyShift action_362 action_70 _ = happyFail action_71 (267) = happyShift action_38 action_71 (275) = happyShift action_41 action_71 (287) = happyShift action_47 action_71 (291) = happyShift action_48 action_71 (293) = happyShift action_49 action_71 (294) = happyShift action_50 action_71 (295) = happyShift action_51 action_71 (296) = happyShift action_52 action_71 (297) = happyShift action_53 action_71 (298) = happyShift action_54 action_71 (300) = happyShift action_56 action_71 (301) = happyShift action_57 action_71 (302) = happyShift action_58 action_71 (303) = happyShift action_59 action_71 (304) = happyShift action_60 action_71 (305) = happyShift action_61 action_71 (306) = happyShift action_62 action_71 (309) = happyShift action_64 action_71 (357) = happyShift action_199 action_71 (361) = happyShift action_361 action_71 (363) = happyShift action_201 action_71 (371) = happyShift action_81 action_71 (372) = happyShift action_82 action_71 (211) = happyGoto action_356 action_71 (212) = happyGoto action_357 action_71 (213) = happyGoto action_358 action_71 (214) = happyGoto action_359 action_71 (216) = happyGoto action_360 action_71 (218) = happyGoto action_192 action_71 (220) = happyGoto action_193 action_71 (240) = happyGoto action_194 action_71 (243) = happyGoto action_195 action_71 (249) = happyGoto action_33 action_71 (252) = happyGoto action_196 action_71 _ = happyReduce_565 action_72 (266) = happyShift action_37 action_72 (267) = happyShift action_38 action_72 (275) = happyShift action_41 action_72 (287) = happyShift action_47 action_72 (291) = happyShift action_48 action_72 (293) = happyShift action_49 action_72 (294) = happyShift action_50 action_72 (295) = happyShift action_51 action_72 (296) = happyShift action_52 action_72 (297) = happyShift action_53 action_72 (298) = happyShift action_54 action_72 (300) = happyShift action_56 action_72 (301) = happyShift action_57 action_72 (302) = happyShift action_58 action_72 (303) = happyShift action_59 action_72 (304) = happyShift action_60 action_72 (305) = happyShift action_61 action_72 (306) = happyShift action_62 action_72 (309) = happyShift action_64 action_72 (337) = happyShift action_354 action_72 (342) = happyShift action_73 action_72 (346) = happyShift action_355 action_72 (357) = happyShift action_75 action_72 (359) = happyShift action_76 action_72 (361) = happyShift action_118 action_72 (363) = happyShift action_78 action_72 (365) = happyShift action_79 action_72 (370) = happyShift action_80 action_72 (371) = happyShift action_81 action_72 (372) = happyShift action_82 action_72 (375) = happyShift action_83 action_72 (376) = happyShift action_84 action_72 (379) = happyShift action_85 action_72 (380) = happyShift action_86 action_72 (381) = happyShift action_87 action_72 (382) = happyShift action_88 action_72 (383) = happyShift action_89 action_72 (384) = happyShift action_90 action_72 (385) = happyShift action_91 action_72 (386) = happyShift action_92 action_72 (387) = happyShift action_93 action_72 (388) = happyShift action_94 action_72 (389) = happyShift action_95 action_72 (390) = happyShift action_96 action_72 (391) = happyShift action_97 action_72 (396) = happyShift action_98 action_72 (397) = happyShift action_99 action_72 (398) = happyShift action_100 action_72 (399) = happyShift action_101 action_72 (401) = happyShift action_102 action_72 (403) = happyShift action_103 action_72 (404) = happyShift action_104 action_72 (405) = happyShift action_105 action_72 (406) = happyShift action_106 action_72 (407) = happyShift action_107 action_72 (408) = happyShift action_108 action_72 (409) = happyShift action_109 action_72 (38) = happyGoto action_13 action_72 (156) = happyGoto action_16 action_72 (164) = happyGoto action_352 action_72 (165) = happyGoto action_23 action_72 (166) = happyGoto action_24 action_72 (167) = happyGoto action_25 action_72 (197) = happyGoto action_353 action_72 (210) = happyGoto action_26 action_72 (217) = happyGoto action_27 action_72 (220) = happyGoto action_28 action_72 (241) = happyGoto action_30 action_72 (242) = happyGoto action_31 action_72 (243) = happyGoto action_117 action_72 (249) = happyGoto action_33 action_72 (251) = happyGoto action_34 action_72 (252) = happyGoto action_35 action_72 (255) = happyGoto action_36 action_72 _ = happyFail action_73 (266) = happyShift action_37 action_73 (267) = happyShift action_38 action_73 (275) = happyShift action_41 action_73 (287) = happyShift action_47 action_73 (291) = happyShift action_48 action_73 (293) = happyShift action_49 action_73 (294) = happyShift action_50 action_73 (295) = happyShift action_51 action_73 (296) = happyShift action_52 action_73 (297) = happyShift action_53 action_73 (298) = happyShift action_54 action_73 (300) = happyShift action_56 action_73 (301) = happyShift action_57 action_73 (302) = happyShift action_58 action_73 (303) = happyShift action_59 action_73 (304) = happyShift action_60 action_73 (305) = happyShift action_61 action_73 (306) = happyShift action_62 action_73 (309) = happyShift action_64 action_73 (342) = happyShift action_73 action_73 (357) = happyShift action_75 action_73 (359) = happyShift action_76 action_73 (361) = happyShift action_118 action_73 (363) = happyShift action_78 action_73 (365) = happyShift action_79 action_73 (370) = happyShift action_80 action_73 (371) = happyShift action_81 action_73 (372) = happyShift action_82 action_73 (375) = happyShift action_83 action_73 (376) = happyShift action_84 action_73 (379) = happyShift action_85 action_73 (380) = happyShift action_86 action_73 (381) = happyShift action_87 action_73 (382) = happyShift action_88 action_73 (383) = happyShift action_89 action_73 (384) = happyShift action_90 action_73 (385) = happyShift action_91 action_73 (386) = happyShift action_92 action_73 (387) = happyShift action_93 action_73 (388) = happyShift action_94 action_73 (389) = happyShift action_95 action_73 (390) = happyShift action_96 action_73 (391) = happyShift action_97 action_73 (396) = happyShift action_98 action_73 (397) = happyShift action_99 action_73 (398) = happyShift action_100 action_73 (399) = happyShift action_101 action_73 (401) = happyShift action_102 action_73 (403) = happyShift action_103 action_73 (404) = happyShift action_104 action_73 (405) = happyShift action_105 action_73 (406) = happyShift action_106 action_73 (407) = happyShift action_107 action_73 (408) = happyShift action_108 action_73 (409) = happyShift action_109 action_73 (38) = happyGoto action_13 action_73 (156) = happyGoto action_16 action_73 (164) = happyGoto action_351 action_73 (165) = happyGoto action_23 action_73 (166) = happyGoto action_24 action_73 (167) = happyGoto action_25 action_73 (210) = happyGoto action_26 action_73 (217) = happyGoto action_27 action_73 (220) = happyGoto action_28 action_73 (241) = happyGoto action_30 action_73 (242) = happyGoto action_31 action_73 (243) = happyGoto action_117 action_73 (249) = happyGoto action_33 action_73 (251) = happyGoto action_34 action_73 (252) = happyGoto action_35 action_73 (255) = happyGoto action_36 action_73 _ = happyFail action_74 (266) = happyShift action_37 action_74 (267) = happyShift action_38 action_74 (275) = happyShift action_41 action_74 (287) = happyShift action_47 action_74 (291) = happyShift action_48 action_74 (293) = happyShift action_49 action_74 (294) = happyShift action_50 action_74 (295) = happyShift action_51 action_74 (296) = happyShift action_52 action_74 (297) = happyShift action_53 action_74 (298) = happyShift action_54 action_74 (300) = happyShift action_56 action_74 (301) = happyShift action_57 action_74 (302) = happyShift action_58 action_74 (303) = happyShift action_59 action_74 (304) = happyShift action_60 action_74 (305) = happyShift action_61 action_74 (306) = happyShift action_62 action_74 (309) = happyShift action_64 action_74 (342) = happyShift action_73 action_74 (357) = happyShift action_75 action_74 (359) = happyShift action_76 action_74 (361) = happyShift action_118 action_74 (363) = happyShift action_78 action_74 (365) = happyShift action_79 action_74 (370) = happyShift action_80 action_74 (371) = happyShift action_81 action_74 (372) = happyShift action_82 action_74 (375) = happyShift action_83 action_74 (376) = happyShift action_84 action_74 (379) = happyShift action_85 action_74 (380) = happyShift action_86 action_74 (381) = happyShift action_87 action_74 (382) = happyShift action_88 action_74 (383) = happyShift action_89 action_74 (384) = happyShift action_90 action_74 (385) = happyShift action_91 action_74 (386) = happyShift action_92 action_74 (387) = happyShift action_93 action_74 (388) = happyShift action_94 action_74 (389) = happyShift action_95 action_74 (390) = happyShift action_96 action_74 (391) = happyShift action_97 action_74 (396) = happyShift action_98 action_74 (397) = happyShift action_99 action_74 (398) = happyShift action_100 action_74 (399) = happyShift action_101 action_74 (401) = happyShift action_102 action_74 (403) = happyShift action_103 action_74 (404) = happyShift action_104 action_74 (405) = happyShift action_105 action_74 (406) = happyShift action_106 action_74 (407) = happyShift action_107 action_74 (408) = happyShift action_108 action_74 (409) = happyShift action_109 action_74 (38) = happyGoto action_13 action_74 (156) = happyGoto action_16 action_74 (163) = happyGoto action_350 action_74 (164) = happyGoto action_22 action_74 (165) = happyGoto action_23 action_74 (166) = happyGoto action_24 action_74 (167) = happyGoto action_25 action_74 (210) = happyGoto action_26 action_74 (217) = happyGoto action_27 action_74 (220) = happyGoto action_28 action_74 (241) = happyGoto action_30 action_74 (242) = happyGoto action_31 action_74 (243) = happyGoto action_117 action_74 (249) = happyGoto action_33 action_74 (251) = happyGoto action_34 action_74 (252) = happyGoto action_35 action_74 (255) = happyGoto action_36 action_74 _ = happyFail action_75 (266) = happyShift action_37 action_75 (267) = happyShift action_38 action_75 (268) = happyShift action_39 action_75 (273) = happyShift action_40 action_75 (275) = happyShift action_41 action_75 (276) = happyShift action_42 action_75 (283) = happyShift action_46 action_75 (287) = happyShift action_47 action_75 (291) = happyShift action_48 action_75 (293) = happyShift action_49 action_75 (294) = happyShift action_50 action_75 (295) = happyShift action_51 action_75 (296) = happyShift action_52 action_75 (297) = happyShift action_53 action_75 (298) = happyShift action_54 action_75 (299) = happyShift action_55 action_75 (300) = happyShift action_56 action_75 (301) = happyShift action_57 action_75 (302) = happyShift action_58 action_75 (303) = happyShift action_59 action_75 (304) = happyShift action_60 action_75 (305) = happyShift action_61 action_75 (306) = happyShift action_62 action_75 (307) = happyShift action_63 action_75 (309) = happyShift action_64 action_75 (318) = happyShift action_68 action_75 (319) = happyShift action_69 action_75 (320) = happyShift action_70 action_75 (333) = happyShift action_278 action_75 (336) = happyShift action_72 action_75 (342) = happyShift action_73 action_75 (345) = happyShift action_74 action_75 (346) = happyShift action_281 action_75 (347) = happyShift action_282 action_75 (352) = happyShift action_283 action_75 (357) = happyShift action_75 action_75 (358) = happyShift action_349 action_75 (359) = happyShift action_76 action_75 (361) = happyShift action_118 action_75 (363) = happyShift action_78 action_75 (365) = happyShift action_79 action_75 (369) = happyShift action_308 action_75 (370) = happyShift action_80 action_75 (371) = happyShift action_81 action_75 (372) = happyShift action_82 action_75 (373) = happyShift action_285 action_75 (374) = happyShift action_286 action_75 (375) = happyShift action_83 action_75 (376) = happyShift action_84 action_75 (377) = happyShift action_287 action_75 (378) = happyShift action_288 action_75 (379) = happyShift action_85 action_75 (380) = happyShift action_86 action_75 (381) = happyShift action_87 action_75 (382) = happyShift action_88 action_75 (383) = happyShift action_89 action_75 (384) = happyShift action_90 action_75 (385) = happyShift action_91 action_75 (386) = happyShift action_92 action_75 (387) = happyShift action_93 action_75 (388) = happyShift action_94 action_75 (389) = happyShift action_95 action_75 (390) = happyShift action_96 action_75 (391) = happyShift action_97 action_75 (396) = happyShift action_98 action_75 (397) = happyShift action_99 action_75 (398) = happyShift action_100 action_75 (399) = happyShift action_101 action_75 (401) = happyShift action_102 action_75 (403) = happyShift action_103 action_75 (404) = happyShift action_104 action_75 (405) = happyShift action_105 action_75 (406) = happyShift action_106 action_75 (407) = happyShift action_107 action_75 (408) = happyShift action_108 action_75 (409) = happyShift action_109 action_75 (38) = happyGoto action_13 action_75 (156) = happyGoto action_16 action_75 (157) = happyGoto action_292 action_75 (158) = happyGoto action_293 action_75 (159) = happyGoto action_18 action_75 (161) = happyGoto action_19 action_75 (162) = happyGoto action_20 action_75 (163) = happyGoto action_21 action_75 (164) = happyGoto action_22 action_75 (165) = happyGoto action_23 action_75 (166) = happyGoto action_24 action_75 (167) = happyGoto action_25 action_75 (172) = happyGoto action_346 action_75 (176) = happyGoto action_347 action_75 (177) = happyGoto action_348 action_75 (210) = happyGoto action_26 action_75 (217) = happyGoto action_27 action_75 (220) = happyGoto action_28 action_75 (222) = happyGoto action_296 action_75 (234) = happyGoto action_297 action_75 (236) = happyGoto action_298 action_75 (241) = happyGoto action_30 action_75 (242) = happyGoto action_31 action_75 (243) = happyGoto action_117 action_75 (245) = happyGoto action_299 action_75 (246) = happyGoto action_338 action_75 (248) = happyGoto action_339 action_75 (249) = happyGoto action_33 action_75 (250) = happyGoto action_275 action_75 (251) = happyGoto action_34 action_75 (252) = happyGoto action_35 action_75 (253) = happyGoto action_276 action_75 (254) = happyGoto action_277 action_75 (255) = happyGoto action_36 action_75 _ = happyFail action_76 (266) = happyShift action_37 action_76 (267) = happyShift action_38 action_76 (268) = happyShift action_39 action_76 (273) = happyShift action_40 action_76 (275) = happyShift action_41 action_76 (276) = happyShift action_42 action_76 (283) = happyShift action_46 action_76 (287) = happyShift action_47 action_76 (291) = happyShift action_48 action_76 (293) = happyShift action_49 action_76 (294) = happyShift action_50 action_76 (295) = happyShift action_51 action_76 (296) = happyShift action_52 action_76 (297) = happyShift action_53 action_76 (298) = happyShift action_54 action_76 (299) = happyShift action_55 action_76 (300) = happyShift action_56 action_76 (301) = happyShift action_57 action_76 (302) = happyShift action_58 action_76 (303) = happyShift action_59 action_76 (304) = happyShift action_60 action_76 (305) = happyShift action_61 action_76 (306) = happyShift action_62 action_76 (307) = happyShift action_63 action_76 (309) = happyShift action_64 action_76 (318) = happyShift action_68 action_76 (319) = happyShift action_69 action_76 (320) = happyShift action_70 action_76 (333) = happyShift action_278 action_76 (336) = happyShift action_72 action_76 (342) = happyShift action_73 action_76 (345) = happyShift action_74 action_76 (346) = happyShift action_281 action_76 (347) = happyShift action_282 action_76 (352) = happyShift action_283 action_76 (357) = happyShift action_75 action_76 (359) = happyShift action_76 action_76 (361) = happyShift action_118 action_76 (363) = happyShift action_78 action_76 (365) = happyShift action_79 action_76 (369) = happyShift action_308 action_76 (370) = happyShift action_80 action_76 (371) = happyShift action_81 action_76 (372) = happyShift action_82 action_76 (373) = happyShift action_285 action_76 (374) = happyShift action_286 action_76 (375) = happyShift action_83 action_76 (376) = happyShift action_84 action_76 (377) = happyShift action_287 action_76 (378) = happyShift action_288 action_76 (379) = happyShift action_85 action_76 (380) = happyShift action_86 action_76 (381) = happyShift action_87 action_76 (382) = happyShift action_88 action_76 (383) = happyShift action_89 action_76 (384) = happyShift action_90 action_76 (385) = happyShift action_91 action_76 (386) = happyShift action_92 action_76 (387) = happyShift action_93 action_76 (388) = happyShift action_94 action_76 (389) = happyShift action_95 action_76 (390) = happyShift action_96 action_76 (391) = happyShift action_97 action_76 (396) = happyShift action_98 action_76 (397) = happyShift action_99 action_76 (398) = happyShift action_100 action_76 (399) = happyShift action_101 action_76 (401) = happyShift action_102 action_76 (403) = happyShift action_103 action_76 (404) = happyShift action_104 action_76 (405) = happyShift action_105 action_76 (406) = happyShift action_106 action_76 (407) = happyShift action_107 action_76 (408) = happyShift action_108 action_76 (409) = happyShift action_109 action_76 (38) = happyGoto action_13 action_76 (156) = happyGoto action_16 action_76 (157) = happyGoto action_292 action_76 (158) = happyGoto action_293 action_76 (159) = happyGoto action_18 action_76 (161) = happyGoto action_19 action_76 (162) = happyGoto action_20 action_76 (163) = happyGoto action_21 action_76 (164) = happyGoto action_22 action_76 (165) = happyGoto action_23 action_76 (166) = happyGoto action_24 action_76 (167) = happyGoto action_25 action_76 (172) = happyGoto action_343 action_76 (177) = happyGoto action_344 action_76 (182) = happyGoto action_345 action_76 (210) = happyGoto action_26 action_76 (217) = happyGoto action_27 action_76 (220) = happyGoto action_28 action_76 (222) = happyGoto action_296 action_76 (234) = happyGoto action_297 action_76 (236) = happyGoto action_298 action_76 (241) = happyGoto action_30 action_76 (242) = happyGoto action_31 action_76 (243) = happyGoto action_117 action_76 (245) = happyGoto action_299 action_76 (246) = happyGoto action_338 action_76 (248) = happyGoto action_339 action_76 (249) = happyGoto action_33 action_76 (250) = happyGoto action_275 action_76 (251) = happyGoto action_34 action_76 (252) = happyGoto action_35 action_76 (253) = happyGoto action_276 action_76 (254) = happyGoto action_277 action_76 (255) = happyGoto action_36 action_76 _ = happyReduce_501 action_77 (266) = happyShift action_37 action_77 (267) = happyShift action_38 action_77 (268) = happyShift action_39 action_77 (273) = happyShift action_40 action_77 (275) = happyShift action_41 action_77 (276) = happyShift action_42 action_77 (283) = happyShift action_46 action_77 (287) = happyShift action_47 action_77 (291) = happyShift action_48 action_77 (293) = happyShift action_49 action_77 (294) = happyShift action_50 action_77 (295) = happyShift action_51 action_77 (296) = happyShift action_52 action_77 (297) = happyShift action_53 action_77 (298) = happyShift action_54 action_77 (299) = happyShift action_55 action_77 (300) = happyShift action_56 action_77 (301) = happyShift action_57 action_77 (302) = happyShift action_58 action_77 (303) = happyShift action_59 action_77 (304) = happyShift action_60 action_77 (305) = happyShift action_61 action_77 (306) = happyShift action_62 action_77 (307) = happyShift action_63 action_77 (309) = happyShift action_64 action_77 (318) = happyShift action_68 action_77 (319) = happyShift action_69 action_77 (320) = happyShift action_70 action_77 (333) = happyShift action_278 action_77 (336) = happyShift action_72 action_77 (342) = happyShift action_73 action_77 (345) = happyShift action_305 action_77 (346) = happyShift action_281 action_77 (347) = happyShift action_282 action_77 (352) = happyShift action_283 action_77 (357) = happyShift action_75 action_77 (359) = happyShift action_76 action_77 (361) = happyShift action_118 action_77 (362) = happyShift action_306 action_77 (363) = happyShift action_78 action_77 (365) = happyShift action_79 action_77 (368) = happyShift action_307 action_77 (369) = happyShift action_308 action_77 (370) = happyShift action_80 action_77 (371) = happyShift action_81 action_77 (372) = happyShift action_82 action_77 (373) = happyShift action_285 action_77 (374) = happyShift action_286 action_77 (375) = happyShift action_83 action_77 (376) = happyShift action_84 action_77 (377) = happyShift action_287 action_77 (378) = happyShift action_288 action_77 (379) = happyShift action_85 action_77 (380) = happyShift action_86 action_77 (381) = happyShift action_87 action_77 (382) = happyShift action_88 action_77 (383) = happyShift action_89 action_77 (384) = happyShift action_90 action_77 (385) = happyShift action_91 action_77 (386) = happyShift action_92 action_77 (387) = happyShift action_93 action_77 (388) = happyShift action_94 action_77 (389) = happyShift action_95 action_77 (390) = happyShift action_96 action_77 (391) = happyShift action_97 action_77 (396) = happyShift action_98 action_77 (397) = happyShift action_99 action_77 (398) = happyShift action_100 action_77 (399) = happyShift action_101 action_77 (401) = happyShift action_102 action_77 (403) = happyShift action_103 action_77 (404) = happyShift action_104 action_77 (405) = happyShift action_105 action_77 (406) = happyShift action_106 action_77 (407) = happyShift action_107 action_77 (408) = happyShift action_108 action_77 (409) = happyShift action_109 action_77 (38) = happyGoto action_13 action_77 (156) = happyGoto action_16 action_77 (157) = happyGoto action_292 action_77 (158) = happyGoto action_293 action_77 (159) = happyGoto action_18 action_77 (161) = happyGoto action_19 action_77 (162) = happyGoto action_20 action_77 (163) = happyGoto action_21 action_77 (164) = happyGoto action_22 action_77 (165) = happyGoto action_23 action_77 (166) = happyGoto action_24 action_77 (167) = happyGoto action_25 action_77 (172) = happyGoto action_294 action_77 (173) = happyGoto action_295 action_77 (210) = happyGoto action_26 action_77 (217) = happyGoto action_27 action_77 (220) = happyGoto action_28 action_77 (222) = happyGoto action_296 action_77 (234) = happyGoto action_297 action_77 (236) = happyGoto action_298 action_77 (241) = happyGoto action_30 action_77 (242) = happyGoto action_31 action_77 (243) = happyGoto action_117 action_77 (245) = happyGoto action_299 action_77 (246) = happyGoto action_300 action_77 (247) = happyGoto action_342 action_77 (248) = happyGoto action_302 action_77 (249) = happyGoto action_33 action_77 (250) = happyGoto action_275 action_77 (251) = happyGoto action_34 action_77 (252) = happyGoto action_35 action_77 (253) = happyGoto action_303 action_77 (254) = happyGoto action_277 action_77 (255) = happyGoto action_36 action_77 (258) = happyGoto action_304 action_77 _ = happyFail action_78 (266) = happyShift action_37 action_78 (267) = happyShift action_38 action_78 (268) = happyShift action_39 action_78 (273) = happyShift action_40 action_78 (275) = happyShift action_41 action_78 (276) = happyShift action_42 action_78 (283) = happyShift action_46 action_78 (287) = happyShift action_47 action_78 (291) = happyShift action_48 action_78 (293) = happyShift action_49 action_78 (294) = happyShift action_50 action_78 (295) = happyShift action_51 action_78 (296) = happyShift action_52 action_78 (297) = happyShift action_53 action_78 (298) = happyShift action_54 action_78 (299) = happyShift action_55 action_78 (300) = happyShift action_56 action_78 (301) = happyShift action_57 action_78 (302) = happyShift action_58 action_78 (303) = happyShift action_59 action_78 (304) = happyShift action_60 action_78 (305) = happyShift action_61 action_78 (306) = happyShift action_62 action_78 (307) = happyShift action_63 action_78 (309) = happyShift action_64 action_78 (318) = happyShift action_68 action_78 (319) = happyShift action_69 action_78 (320) = happyShift action_70 action_78 (333) = happyShift action_278 action_78 (336) = happyShift action_72 action_78 (342) = happyShift action_73 action_78 (345) = happyShift action_74 action_78 (346) = happyShift action_281 action_78 (347) = happyShift action_282 action_78 (352) = happyShift action_283 action_78 (357) = happyShift action_75 action_78 (359) = happyShift action_76 action_78 (361) = happyShift action_118 action_78 (363) = happyShift action_78 action_78 (364) = happyShift action_341 action_78 (365) = happyShift action_79 action_78 (368) = happyShift action_307 action_78 (369) = happyShift action_308 action_78 (370) = happyShift action_80 action_78 (371) = happyShift action_81 action_78 (372) = happyShift action_82 action_78 (373) = happyShift action_285 action_78 (374) = happyShift action_286 action_78 (375) = happyShift action_83 action_78 (376) = happyShift action_84 action_78 (377) = happyShift action_287 action_78 (378) = happyShift action_288 action_78 (379) = happyShift action_85 action_78 (380) = happyShift action_86 action_78 (381) = happyShift action_87 action_78 (382) = happyShift action_88 action_78 (383) = happyShift action_89 action_78 (384) = happyShift action_90 action_78 (385) = happyShift action_91 action_78 (386) = happyShift action_92 action_78 (387) = happyShift action_93 action_78 (388) = happyShift action_94 action_78 (389) = happyShift action_95 action_78 (390) = happyShift action_96 action_78 (391) = happyShift action_97 action_78 (396) = happyShift action_98 action_78 (397) = happyShift action_99 action_78 (398) = happyShift action_100 action_78 (399) = happyShift action_101 action_78 (401) = happyShift action_102 action_78 (403) = happyShift action_103 action_78 (404) = happyShift action_104 action_78 (405) = happyShift action_105 action_78 (406) = happyShift action_106 action_78 (407) = happyShift action_107 action_78 (408) = happyShift action_108 action_78 (409) = happyShift action_109 action_78 (38) = happyGoto action_13 action_78 (156) = happyGoto action_16 action_78 (157) = happyGoto action_292 action_78 (158) = happyGoto action_293 action_78 (159) = happyGoto action_18 action_78 (161) = happyGoto action_19 action_78 (162) = happyGoto action_20 action_78 (163) = happyGoto action_21 action_78 (164) = happyGoto action_22 action_78 (165) = happyGoto action_23 action_78 (166) = happyGoto action_24 action_78 (167) = happyGoto action_25 action_78 (172) = happyGoto action_336 action_78 (173) = happyGoto action_337 action_78 (210) = happyGoto action_26 action_78 (217) = happyGoto action_27 action_78 (220) = happyGoto action_28 action_78 (222) = happyGoto action_296 action_78 (234) = happyGoto action_297 action_78 (236) = happyGoto action_298 action_78 (241) = happyGoto action_30 action_78 (242) = happyGoto action_31 action_78 (243) = happyGoto action_117 action_78 (245) = happyGoto action_299 action_78 (246) = happyGoto action_338 action_78 (248) = happyGoto action_339 action_78 (249) = happyGoto action_33 action_78 (250) = happyGoto action_275 action_78 (251) = happyGoto action_34 action_78 (252) = happyGoto action_35 action_78 (253) = happyGoto action_276 action_78 (254) = happyGoto action_277 action_78 (255) = happyGoto action_36 action_78 (258) = happyGoto action_340 action_78 _ = happyFail action_79 (266) = happyShift action_37 action_79 (267) = happyShift action_38 action_79 (275) = happyShift action_41 action_79 (287) = happyShift action_47 action_79 (291) = happyShift action_48 action_79 (293) = happyShift action_49 action_79 (294) = happyShift action_50 action_79 (295) = happyShift action_51 action_79 (296) = happyShift action_52 action_79 (297) = happyShift action_53 action_79 (298) = happyShift action_54 action_79 (300) = happyShift action_56 action_79 (301) = happyShift action_57 action_79 (302) = happyShift action_58 action_79 (303) = happyShift action_59 action_79 (304) = happyShift action_60 action_79 (305) = happyShift action_61 action_79 (306) = happyShift action_62 action_79 (309) = happyShift action_64 action_79 (357) = happyShift action_75 action_79 (359) = happyShift action_76 action_79 (361) = happyShift action_118 action_79 (363) = happyShift action_78 action_79 (365) = happyShift action_79 action_79 (370) = happyShift action_80 action_79 (371) = happyShift action_81 action_79 (372) = happyShift action_82 action_79 (375) = happyShift action_83 action_79 (376) = happyShift action_84 action_79 (379) = happyShift action_85 action_79 (380) = happyShift action_86 action_79 (381) = happyShift action_87 action_79 (382) = happyShift action_88 action_79 (383) = happyShift action_89 action_79 (384) = happyShift action_90 action_79 (385) = happyShift action_91 action_79 (386) = happyShift action_92 action_79 (387) = happyShift action_93 action_79 (388) = happyShift action_94 action_79 (389) = happyShift action_95 action_79 (390) = happyShift action_96 action_79 (391) = happyShift action_97 action_79 (396) = happyShift action_98 action_79 (397) = happyShift action_99 action_79 (398) = happyShift action_100 action_79 (399) = happyShift action_101 action_79 (401) = happyShift action_102 action_79 (403) = happyShift action_103 action_79 (404) = happyShift action_104 action_79 (405) = happyShift action_105 action_79 (406) = happyShift action_106 action_79 (407) = happyShift action_107 action_79 (408) = happyShift action_108 action_79 (409) = happyShift action_109 action_79 (38) = happyGoto action_13 action_79 (156) = happyGoto action_16 action_79 (166) = happyGoto action_334 action_79 (167) = happyGoto action_25 action_79 (210) = happyGoto action_26 action_79 (217) = happyGoto action_27 action_79 (220) = happyGoto action_28 action_79 (241) = happyGoto action_335 action_79 (242) = happyGoto action_31 action_79 (243) = happyGoto action_117 action_79 (249) = happyGoto action_33 action_79 (251) = happyGoto action_34 action_79 (252) = happyGoto action_35 action_79 (255) = happyGoto action_36 action_79 _ = happyFail action_80 (267) = happyShift action_38 action_80 (275) = happyShift action_41 action_80 (287) = happyShift action_47 action_80 (291) = happyShift action_48 action_80 (293) = happyShift action_49 action_80 (294) = happyShift action_50 action_80 (295) = happyShift action_51 action_80 (296) = happyShift action_52 action_80 (297) = happyShift action_53 action_80 (298) = happyShift action_54 action_80 (300) = happyShift action_56 action_80 (301) = happyShift action_57 action_80 (302) = happyShift action_58 action_80 (303) = happyShift action_59 action_80 (304) = happyShift action_60 action_80 (305) = happyShift action_61 action_80 (306) = happyShift action_62 action_80 (309) = happyShift action_64 action_80 (357) = happyShift action_199 action_80 (361) = happyShift action_333 action_80 (363) = happyShift action_201 action_80 (371) = happyShift action_81 action_80 (372) = happyShift action_82 action_80 (375) = happyShift action_83 action_80 (376) = happyShift action_84 action_80 (379) = happyShift action_85 action_80 (380) = happyShift action_86 action_80 (217) = happyGoto action_331 action_80 (220) = happyGoto action_28 action_80 (241) = happyGoto action_332 action_80 (242) = happyGoto action_31 action_80 (243) = happyGoto action_117 action_80 (249) = happyGoto action_33 action_80 (251) = happyGoto action_34 action_80 (252) = happyGoto action_35 action_80 _ = happyFail action_81 _ = happyReduce_647 action_82 _ = happyReduce_682 action_83 _ = happyReduce_645 action_84 _ = happyReduce_680 action_85 _ = happyReduce_646 action_86 _ = happyReduce_681 action_87 _ = happyReduce_563 action_88 _ = happyReduce_687 action_89 _ = happyReduce_688 action_90 _ = happyReduce_439 action_91 _ = happyReduce_440 action_92 _ = happyReduce_691 action_93 _ = happyReduce_692 action_94 _ = happyReduce_689 action_95 _ = happyReduce_690 action_96 _ = happyReduce_693 action_97 _ = happyReduce_694 action_98 (266) = happyShift action_37 action_98 (267) = happyShift action_38 action_98 (268) = happyShift action_39 action_98 (273) = happyShift action_40 action_98 (275) = happyShift action_41 action_98 (276) = happyShift action_42 action_98 (283) = happyShift action_46 action_98 (287) = happyShift action_47 action_98 (291) = happyShift action_48 action_98 (293) = happyShift action_49 action_98 (294) = happyShift action_50 action_98 (295) = happyShift action_51 action_98 (296) = happyShift action_52 action_98 (297) = happyShift action_53 action_98 (298) = happyShift action_54 action_98 (299) = happyShift action_55 action_98 (300) = happyShift action_56 action_98 (301) = happyShift action_57 action_98 (302) = happyShift action_58 action_98 (303) = happyShift action_59 action_98 (304) = happyShift action_60 action_98 (305) = happyShift action_61 action_98 (306) = happyShift action_62 action_98 (307) = happyShift action_63 action_98 (309) = happyShift action_64 action_98 (318) = happyShift action_68 action_98 (319) = happyShift action_69 action_98 (320) = happyShift action_70 action_98 (336) = happyShift action_72 action_98 (342) = happyShift action_73 action_98 (345) = happyShift action_74 action_98 (357) = happyShift action_75 action_98 (359) = happyShift action_76 action_98 (361) = happyShift action_118 action_98 (363) = happyShift action_78 action_98 (365) = happyShift action_79 action_98 (370) = happyShift action_80 action_98 (371) = happyShift action_81 action_98 (372) = happyShift action_82 action_98 (375) = happyShift action_83 action_98 (376) = happyShift action_84 action_98 (379) = happyShift action_85 action_98 (380) = happyShift action_86 action_98 (381) = happyShift action_87 action_98 (382) = happyShift action_88 action_98 (383) = happyShift action_89 action_98 (384) = happyShift action_90 action_98 (385) = happyShift action_91 action_98 (386) = happyShift action_92 action_98 (387) = happyShift action_93 action_98 (388) = happyShift action_94 action_98 (389) = happyShift action_95 action_98 (390) = happyShift action_96 action_98 (391) = happyShift action_97 action_98 (396) = happyShift action_98 action_98 (397) = happyShift action_99 action_98 (398) = happyShift action_100 action_98 (399) = happyShift action_101 action_98 (401) = happyShift action_102 action_98 (403) = happyShift action_103 action_98 (404) = happyShift action_104 action_98 (405) = happyShift action_105 action_98 (406) = happyShift action_106 action_98 (407) = happyShift action_107 action_98 (408) = happyShift action_108 action_98 (409) = happyShift action_109 action_98 (38) = happyGoto action_13 action_98 (156) = happyGoto action_16 action_98 (157) = happyGoto action_330 action_98 (158) = happyGoto action_116 action_98 (159) = happyGoto action_18 action_98 (161) = happyGoto action_19 action_98 (162) = happyGoto action_20 action_98 (163) = happyGoto action_21 action_98 (164) = happyGoto action_22 action_98 (165) = happyGoto action_23 action_98 (166) = happyGoto action_24 action_98 (167) = happyGoto action_25 action_98 (210) = happyGoto action_26 action_98 (217) = happyGoto action_27 action_98 (220) = happyGoto action_28 action_98 (241) = happyGoto action_30 action_98 (242) = happyGoto action_31 action_98 (243) = happyGoto action_117 action_98 (249) = happyGoto action_33 action_98 (251) = happyGoto action_34 action_98 (252) = happyGoto action_35 action_98 (255) = happyGoto action_36 action_98 _ = happyFail action_99 (266) = happyShift action_37 action_99 (267) = happyShift action_38 action_99 (268) = happyShift action_39 action_99 (273) = happyShift action_40 action_99 (275) = happyShift action_41 action_99 (276) = happyShift action_42 action_99 (283) = happyShift action_46 action_99 (287) = happyShift action_47 action_99 (291) = happyShift action_48 action_99 (293) = happyShift action_49 action_99 (294) = happyShift action_50 action_99 (295) = happyShift action_51 action_99 (296) = happyShift action_52 action_99 (297) = happyShift action_53 action_99 (298) = happyShift action_54 action_99 (299) = happyShift action_55 action_99 (300) = happyShift action_56 action_99 (301) = happyShift action_57 action_99 (302) = happyShift action_58 action_99 (303) = happyShift action_59 action_99 (304) = happyShift action_60 action_99 (305) = happyShift action_61 action_99 (306) = happyShift action_62 action_99 (307) = happyShift action_63 action_99 (309) = happyShift action_64 action_99 (318) = happyShift action_68 action_99 (319) = happyShift action_69 action_99 (320) = happyShift action_70 action_99 (336) = happyShift action_72 action_99 (342) = happyShift action_73 action_99 (345) = happyShift action_74 action_99 (357) = happyShift action_75 action_99 (359) = happyShift action_76 action_99 (361) = happyShift action_118 action_99 (363) = happyShift action_78 action_99 (365) = happyShift action_79 action_99 (370) = happyShift action_80 action_99 (371) = happyShift action_81 action_99 (372) = happyShift action_82 action_99 (375) = happyShift action_83 action_99 (376) = happyShift action_84 action_99 (379) = happyShift action_85 action_99 (380) = happyShift action_86 action_99 (381) = happyShift action_87 action_99 (382) = happyShift action_88 action_99 (383) = happyShift action_89 action_99 (384) = happyShift action_90 action_99 (385) = happyShift action_91 action_99 (386) = happyShift action_92 action_99 (387) = happyShift action_93 action_99 (388) = happyShift action_94 action_99 (389) = happyShift action_95 action_99 (390) = happyShift action_96 action_99 (391) = happyShift action_97 action_99 (396) = happyShift action_98 action_99 (397) = happyShift action_99 action_99 (398) = happyShift action_100 action_99 (399) = happyShift action_101 action_99 (401) = happyShift action_102 action_99 (403) = happyShift action_103 action_99 (404) = happyShift action_104 action_99 (405) = happyShift action_105 action_99 (406) = happyShift action_106 action_99 (407) = happyShift action_107 action_99 (408) = happyShift action_108 action_99 (409) = happyShift action_109 action_99 (38) = happyGoto action_13 action_99 (156) = happyGoto action_16 action_99 (158) = happyGoto action_329 action_99 (159) = happyGoto action_18 action_99 (161) = happyGoto action_19 action_99 (162) = happyGoto action_20 action_99 (163) = happyGoto action_21 action_99 (164) = happyGoto action_22 action_99 (165) = happyGoto action_23 action_99 (166) = happyGoto action_24 action_99 (167) = happyGoto action_25 action_99 (210) = happyGoto action_26 action_99 (217) = happyGoto action_27 action_99 (220) = happyGoto action_28 action_99 (241) = happyGoto action_30 action_99 (242) = happyGoto action_31 action_99 (243) = happyGoto action_117 action_99 (249) = happyGoto action_33 action_99 (251) = happyGoto action_34 action_99 (252) = happyGoto action_35 action_99 (255) = happyGoto action_36 action_99 _ = happyFail action_100 (267) = happyShift action_38 action_100 (275) = happyShift action_41 action_100 (287) = happyShift action_47 action_100 (291) = happyShift action_260 action_100 (293) = happyShift action_49 action_100 (294) = happyShift action_50 action_100 (295) = happyShift action_51 action_100 (296) = happyShift action_231 action_100 (297) = happyShift action_232 action_100 (298) = happyShift action_233 action_100 (302) = happyShift action_58 action_100 (303) = happyShift action_59 action_100 (304) = happyShift action_60 action_100 (305) = happyShift action_61 action_100 (306) = happyShift action_62 action_100 (309) = happyShift action_64 action_100 (323) = happyShift action_236 action_100 (324) = happyShift action_237 action_100 (346) = happyShift action_238 action_100 (353) = happyShift action_239 action_100 (357) = happyShift action_240 action_100 (359) = happyShift action_241 action_100 (361) = happyShift action_242 action_100 (363) = happyShift action_243 action_100 (370) = happyShift action_244 action_100 (371) = happyShift action_245 action_100 (372) = happyShift action_246 action_100 (376) = happyShift action_247 action_100 (380) = happyShift action_248 action_100 (381) = happyShift action_87 action_100 (383) = happyShift action_249 action_100 (384) = happyShift action_250 action_100 (403) = happyShift action_251 action_100 (404) = happyShift action_252 action_100 (408) = happyShift action_108 action_100 (409) = happyShift action_109 action_100 (111) = happyGoto action_218 action_100 (112) = happyGoto action_328 action_100 (114) = happyGoto action_255 action_100 (115) = happyGoto action_256 action_100 (117) = happyGoto action_257 action_100 (118) = happyGoto action_221 action_100 (156) = happyGoto action_222 action_100 (210) = happyGoto action_259 action_100 (224) = happyGoto action_223 action_100 (225) = happyGoto action_224 action_100 (227) = happyGoto action_225 action_100 (228) = happyGoto action_226 action_100 (237) = happyGoto action_227 action_100 (239) = happyGoto action_228 action_100 (249) = happyGoto action_229 action_100 _ = happyFail action_101 (353) = happyShift action_326 action_101 (355) = happyShift action_327 action_101 (170) = happyGoto action_325 action_101 _ = happyFail action_102 (266) = happyShift action_37 action_102 (267) = happyShift action_38 action_102 (268) = happyShift action_39 action_102 (273) = happyShift action_40 action_102 (275) = happyShift action_41 action_102 (276) = happyShift action_42 action_102 (283) = happyShift action_46 action_102 (287) = happyShift action_47 action_102 (291) = happyShift action_48 action_102 (293) = happyShift action_49 action_102 (294) = happyShift action_50 action_102 (295) = happyShift action_51 action_102 (296) = happyShift action_52 action_102 (297) = happyShift action_53 action_102 (298) = happyShift action_54 action_102 (299) = happyShift action_55 action_102 (300) = happyShift action_56 action_102 (301) = happyShift action_57 action_102 (302) = happyShift action_58 action_102 (303) = happyShift action_59 action_102 (304) = happyShift action_60 action_102 (305) = happyShift action_61 action_102 (306) = happyShift action_62 action_102 (307) = happyShift action_63 action_102 (309) = happyShift action_64 action_102 (318) = happyShift action_68 action_102 (319) = happyShift action_69 action_102 (320) = happyShift action_70 action_102 (336) = happyShift action_72 action_102 (342) = happyShift action_73 action_102 (345) = happyShift action_74 action_102 (357) = happyShift action_75 action_102 (359) = happyShift action_76 action_102 (361) = happyShift action_118 action_102 (363) = happyShift action_78 action_102 (365) = happyShift action_79 action_102 (370) = happyShift action_80 action_102 (371) = happyShift action_81 action_102 (372) = happyShift action_82 action_102 (375) = happyShift action_83 action_102 (376) = happyShift action_84 action_102 (379) = happyShift action_85 action_102 (380) = happyShift action_86 action_102 (381) = happyShift action_87 action_102 (382) = happyShift action_88 action_102 (383) = happyShift action_89 action_102 (384) = happyShift action_90 action_102 (385) = happyShift action_91 action_102 (386) = happyShift action_92 action_102 (387) = happyShift action_93 action_102 (388) = happyShift action_94 action_102 (389) = happyShift action_95 action_102 (390) = happyShift action_96 action_102 (391) = happyShift action_97 action_102 (396) = happyShift action_98 action_102 (397) = happyShift action_99 action_102 (398) = happyShift action_100 action_102 (399) = happyShift action_101 action_102 (401) = happyShift action_102 action_102 (403) = happyShift action_103 action_102 (404) = happyShift action_104 action_102 (405) = happyShift action_105 action_102 (406) = happyShift action_106 action_102 (407) = happyShift action_107 action_102 (408) = happyShift action_108 action_102 (409) = happyShift action_109 action_102 (38) = happyGoto action_13 action_102 (156) = happyGoto action_16 action_102 (157) = happyGoto action_324 action_102 (158) = happyGoto action_116 action_102 (159) = happyGoto action_18 action_102 (161) = happyGoto action_19 action_102 (162) = happyGoto action_20 action_102 (163) = happyGoto action_21 action_102 (164) = happyGoto action_22 action_102 (165) = happyGoto action_23 action_102 (166) = happyGoto action_24 action_102 (167) = happyGoto action_25 action_102 (210) = happyGoto action_26 action_102 (217) = happyGoto action_27 action_102 (220) = happyGoto action_28 action_102 (241) = happyGoto action_30 action_102 (242) = happyGoto action_31 action_102 (243) = happyGoto action_117 action_102 (249) = happyGoto action_33 action_102 (251) = happyGoto action_34 action_102 (252) = happyGoto action_35 action_102 (255) = happyGoto action_36 action_102 _ = happyFail action_103 _ = happyReduce_460 action_104 (266) = happyShift action_37 action_104 (267) = happyShift action_38 action_104 (268) = happyShift action_39 action_104 (273) = happyShift action_40 action_104 (275) = happyShift action_41 action_104 (276) = happyShift action_42 action_104 (283) = happyShift action_46 action_104 (287) = happyShift action_47 action_104 (291) = happyShift action_48 action_104 (293) = happyShift action_49 action_104 (294) = happyShift action_50 action_104 (295) = happyShift action_51 action_104 (296) = happyShift action_52 action_104 (297) = happyShift action_53 action_104 (298) = happyShift action_54 action_104 (299) = happyShift action_55 action_104 (300) = happyShift action_56 action_104 (301) = happyShift action_57 action_104 (302) = happyShift action_58 action_104 (303) = happyShift action_59 action_104 (304) = happyShift action_60 action_104 (305) = happyShift action_61 action_104 (306) = happyShift action_62 action_104 (307) = happyShift action_63 action_104 (309) = happyShift action_64 action_104 (318) = happyShift action_68 action_104 (319) = happyShift action_69 action_104 (320) = happyShift action_70 action_104 (336) = happyShift action_72 action_104 (342) = happyShift action_73 action_104 (345) = happyShift action_74 action_104 (357) = happyShift action_75 action_104 (359) = happyShift action_76 action_104 (361) = happyShift action_118 action_104 (363) = happyShift action_78 action_104 (365) = happyShift action_79 action_104 (370) = happyShift action_80 action_104 (371) = happyShift action_81 action_104 (372) = happyShift action_82 action_104 (375) = happyShift action_83 action_104 (376) = happyShift action_84 action_104 (379) = happyShift action_85 action_104 (380) = happyShift action_86 action_104 (381) = happyShift action_87 action_104 (382) = happyShift action_88 action_104 (383) = happyShift action_89 action_104 (384) = happyShift action_90 action_104 (385) = happyShift action_91 action_104 (386) = happyShift action_92 action_104 (387) = happyShift action_93 action_104 (388) = happyShift action_94 action_104 (389) = happyShift action_95 action_104 (390) = happyShift action_96 action_104 (391) = happyShift action_97 action_104 (396) = happyShift action_98 action_104 (397) = happyShift action_99 action_104 (398) = happyShift action_100 action_104 (399) = happyShift action_101 action_104 (401) = happyShift action_102 action_104 (403) = happyShift action_103 action_104 (404) = happyShift action_104 action_104 (405) = happyShift action_105 action_104 (406) = happyShift action_106 action_104 (407) = happyShift action_107 action_104 (408) = happyShift action_108 action_104 (409) = happyShift action_109 action_104 (38) = happyGoto action_13 action_104 (156) = happyGoto action_16 action_104 (157) = happyGoto action_323 action_104 (158) = happyGoto action_116 action_104 (159) = happyGoto action_18 action_104 (161) = happyGoto action_19 action_104 (162) = happyGoto action_20 action_104 (163) = happyGoto action_21 action_104 (164) = happyGoto action_22 action_104 (165) = happyGoto action_23 action_104 (166) = happyGoto action_24 action_104 (167) = happyGoto action_25 action_104 (210) = happyGoto action_26 action_104 (217) = happyGoto action_27 action_104 (220) = happyGoto action_28 action_104 (241) = happyGoto action_30 action_104 (242) = happyGoto action_31 action_104 (243) = happyGoto action_117 action_104 (249) = happyGoto action_33 action_104 (251) = happyGoto action_34 action_104 (252) = happyGoto action_35 action_104 (255) = happyGoto action_36 action_104 _ = happyFail action_105 _ = happyReduce_462 action_106 (266) = happyShift action_37 action_106 (267) = happyShift action_38 action_106 (268) = happyShift action_39 action_106 (273) = happyShift action_40 action_106 (275) = happyShift action_41 action_106 (276) = happyShift action_42 action_106 (283) = happyShift action_46 action_106 (287) = happyShift action_47 action_106 (291) = happyShift action_48 action_106 (293) = happyShift action_49 action_106 (294) = happyShift action_50 action_106 (295) = happyShift action_51 action_106 (296) = happyShift action_52 action_106 (297) = happyShift action_53 action_106 (298) = happyShift action_54 action_106 (299) = happyShift action_55 action_106 (300) = happyShift action_56 action_106 (301) = happyShift action_57 action_106 (302) = happyShift action_58 action_106 (303) = happyShift action_59 action_106 (304) = happyShift action_60 action_106 (305) = happyShift action_61 action_106 (306) = happyShift action_62 action_106 (307) = happyShift action_63 action_106 (309) = happyShift action_64 action_106 (318) = happyShift action_68 action_106 (319) = happyShift action_69 action_106 (320) = happyShift action_70 action_106 (336) = happyShift action_72 action_106 (342) = happyShift action_73 action_106 (345) = happyShift action_74 action_106 (357) = happyShift action_75 action_106 (359) = happyShift action_76 action_106 (361) = happyShift action_118 action_106 (363) = happyShift action_78 action_106 (365) = happyShift action_79 action_106 (370) = happyShift action_80 action_106 (371) = happyShift action_81 action_106 (372) = happyShift action_82 action_106 (375) = happyShift action_83 action_106 (376) = happyShift action_84 action_106 (379) = happyShift action_85 action_106 (380) = happyShift action_86 action_106 (381) = happyShift action_87 action_106 (382) = happyShift action_88 action_106 (383) = happyShift action_89 action_106 (384) = happyShift action_90 action_106 (385) = happyShift action_91 action_106 (386) = happyShift action_92 action_106 (387) = happyShift action_93 action_106 (388) = happyShift action_94 action_106 (389) = happyShift action_95 action_106 (390) = happyShift action_96 action_106 (391) = happyShift action_97 action_106 (396) = happyShift action_98 action_106 (397) = happyShift action_99 action_106 (398) = happyShift action_100 action_106 (399) = happyShift action_101 action_106 (401) = happyShift action_102 action_106 (403) = happyShift action_103 action_106 (404) = happyShift action_104 action_106 (405) = happyShift action_105 action_106 (406) = happyShift action_106 action_106 (407) = happyShift action_107 action_106 (408) = happyShift action_108 action_106 (409) = happyShift action_109 action_106 (38) = happyGoto action_13 action_106 (156) = happyGoto action_16 action_106 (157) = happyGoto action_322 action_106 (158) = happyGoto action_116 action_106 (159) = happyGoto action_18 action_106 (161) = happyGoto action_19 action_106 (162) = happyGoto action_20 action_106 (163) = happyGoto action_21 action_106 (164) = happyGoto action_22 action_106 (165) = happyGoto action_23 action_106 (166) = happyGoto action_24 action_106 (167) = happyGoto action_25 action_106 (210) = happyGoto action_26 action_106 (217) = happyGoto action_27 action_106 (220) = happyGoto action_28 action_106 (241) = happyGoto action_30 action_106 (242) = happyGoto action_31 action_106 (243) = happyGoto action_117 action_106 (249) = happyGoto action_33 action_106 (251) = happyGoto action_34 action_106 (252) = happyGoto action_35 action_106 (255) = happyGoto action_36 action_106 _ = happyFail action_107 (267) = happyShift action_38 action_107 (275) = happyShift action_41 action_107 (287) = happyShift action_47 action_107 (293) = happyShift action_49 action_107 (294) = happyShift action_50 action_107 (295) = happyShift action_51 action_107 (296) = happyShift action_231 action_107 (297) = happyShift action_232 action_107 (298) = happyShift action_233 action_107 (302) = happyShift action_58 action_107 (303) = happyShift action_59 action_107 (304) = happyShift action_60 action_107 (305) = happyShift action_61 action_107 (306) = happyShift action_62 action_107 (309) = happyShift action_64 action_107 (357) = happyShift action_318 action_107 (359) = happyShift action_319 action_107 (361) = happyShift action_320 action_107 (363) = happyShift action_321 action_107 (371) = happyShift action_245 action_107 (372) = happyShift action_246 action_107 (376) = happyShift action_247 action_107 (380) = happyShift action_248 action_107 (223) = happyGoto action_315 action_107 (224) = happyGoto action_316 action_107 (225) = happyGoto action_224 action_107 (227) = happyGoto action_225 action_107 (228) = happyGoto action_226 action_107 (237) = happyGoto action_317 action_107 (239) = happyGoto action_228 action_107 (249) = happyGoto action_229 action_107 _ = happyFail action_108 _ = happyReduce_400 action_109 _ = happyReduce_401 action_110 (410) = happyAccept action_110 _ = happyFail action_111 (284) = happyShift action_314 action_111 _ = happyFail action_112 _ = happyReduce_21 action_113 _ = happyReduce_705 action_114 (410) = happyAccept action_114 _ = happyFail action_115 (410) = happyAccept action_115 _ = happyFail action_116 (333) = happyShift action_278 action_116 (334) = happyShift action_309 action_116 (345) = happyShift action_280 action_116 (346) = happyShift action_281 action_116 (347) = happyShift action_282 action_116 (348) = happyShift action_310 action_116 (349) = happyShift action_311 action_116 (350) = happyShift action_312 action_116 (351) = happyShift action_313 action_116 (352) = happyShift action_283 action_116 (369) = happyShift action_284 action_116 (373) = happyShift action_285 action_116 (374) = happyShift action_286 action_116 (377) = happyShift action_287 action_116 (378) = happyShift action_288 action_116 (222) = happyGoto action_268 action_116 (233) = happyGoto action_269 action_116 (235) = happyGoto action_270 action_116 (244) = happyGoto action_271 action_116 (246) = happyGoto action_272 action_116 (247) = happyGoto action_273 action_116 (248) = happyGoto action_274 action_116 (250) = happyGoto action_275 action_116 (253) = happyGoto action_276 action_116 (254) = happyGoto action_277 action_116 _ = happyReduce_407 action_117 _ = happyReduce_644 action_118 (266) = happyShift action_37 action_118 (267) = happyShift action_38 action_118 (268) = happyShift action_39 action_118 (273) = happyShift action_40 action_118 (275) = happyShift action_41 action_118 (276) = happyShift action_42 action_118 (283) = happyShift action_46 action_118 (287) = happyShift action_47 action_118 (291) = happyShift action_48 action_118 (293) = happyShift action_49 action_118 (294) = happyShift action_50 action_118 (295) = happyShift action_51 action_118 (296) = happyShift action_52 action_118 (297) = happyShift action_53 action_118 (298) = happyShift action_54 action_118 (299) = happyShift action_55 action_118 (300) = happyShift action_56 action_118 (301) = happyShift action_57 action_118 (302) = happyShift action_58 action_118 (303) = happyShift action_59 action_118 (304) = happyShift action_60 action_118 (305) = happyShift action_61 action_118 (306) = happyShift action_62 action_118 (307) = happyShift action_63 action_118 (309) = happyShift action_64 action_118 (318) = happyShift action_68 action_118 (319) = happyShift action_69 action_118 (320) = happyShift action_70 action_118 (333) = happyShift action_278 action_118 (336) = happyShift action_72 action_118 (342) = happyShift action_73 action_118 (345) = happyShift action_305 action_118 (346) = happyShift action_281 action_118 (347) = happyShift action_282 action_118 (352) = happyShift action_283 action_118 (357) = happyShift action_75 action_118 (359) = happyShift action_76 action_118 (361) = happyShift action_118 action_118 (362) = happyShift action_306 action_118 (363) = happyShift action_78 action_118 (365) = happyShift action_79 action_118 (368) = happyShift action_307 action_118 (369) = happyShift action_308 action_118 (370) = happyShift action_80 action_118 (371) = happyShift action_81 action_118 (372) = happyShift action_82 action_118 (373) = happyShift action_285 action_118 (374) = happyShift action_286 action_118 (375) = happyShift action_83 action_118 (376) = happyShift action_84 action_118 (377) = happyShift action_287 action_118 (378) = happyShift action_288 action_118 (379) = happyShift action_85 action_118 (380) = happyShift action_86 action_118 (381) = happyShift action_87 action_118 (382) = happyShift action_88 action_118 (383) = happyShift action_89 action_118 (384) = happyShift action_90 action_118 (385) = happyShift action_91 action_118 (386) = happyShift action_92 action_118 (387) = happyShift action_93 action_118 (388) = happyShift action_94 action_118 (389) = happyShift action_95 action_118 (390) = happyShift action_96 action_118 (391) = happyShift action_97 action_118 (396) = happyShift action_98 action_118 (397) = happyShift action_99 action_118 (398) = happyShift action_100 action_118 (399) = happyShift action_101 action_118 (401) = happyShift action_102 action_118 (403) = happyShift action_103 action_118 (404) = happyShift action_104 action_118 (405) = happyShift action_105 action_118 (406) = happyShift action_106 action_118 (407) = happyShift action_107 action_118 (408) = happyShift action_108 action_118 (409) = happyShift action_109 action_118 (38) = happyGoto action_13 action_118 (156) = happyGoto action_16 action_118 (157) = happyGoto action_292 action_118 (158) = happyGoto action_293 action_118 (159) = happyGoto action_18 action_118 (161) = happyGoto action_19 action_118 (162) = happyGoto action_20 action_118 (163) = happyGoto action_21 action_118 (164) = happyGoto action_22 action_118 (165) = happyGoto action_23 action_118 (166) = happyGoto action_24 action_118 (167) = happyGoto action_25 action_118 (172) = happyGoto action_294 action_118 (173) = happyGoto action_295 action_118 (210) = happyGoto action_26 action_118 (217) = happyGoto action_27 action_118 (220) = happyGoto action_28 action_118 (222) = happyGoto action_296 action_118 (234) = happyGoto action_297 action_118 (236) = happyGoto action_298 action_118 (241) = happyGoto action_30 action_118 (242) = happyGoto action_31 action_118 (243) = happyGoto action_117 action_118 (245) = happyGoto action_299 action_118 (246) = happyGoto action_300 action_118 (247) = happyGoto action_301 action_118 (248) = happyGoto action_302 action_118 (249) = happyGoto action_33 action_118 (250) = happyGoto action_275 action_118 (251) = happyGoto action_34 action_118 (252) = happyGoto action_35 action_118 (253) = happyGoto action_303 action_118 (254) = happyGoto action_277 action_118 (255) = happyGoto action_36 action_118 (258) = happyGoto action_304 action_118 _ = happyFail action_119 (410) = happyAccept action_119 _ = happyFail action_120 _ = happyReduce_95 action_121 _ = happyReduce_96 action_122 _ = happyReduce_97 action_123 (282) = happyShift action_290 action_123 (330) = happyShift action_291 action_123 (66) = happyGoto action_289 action_123 _ = happyReduce_153 action_124 _ = happyReduce_98 action_125 _ = happyReduce_99 action_126 _ = happyReduce_379 action_127 _ = happyReduce_112 action_128 _ = happyReduce_380 action_129 _ = happyReduce_371 action_130 _ = happyReduce_113 action_131 _ = happyReduce_376 action_132 (333) = happyShift action_278 action_132 (334) = happyShift action_279 action_132 (335) = happyReduce_246 action_132 (338) = happyReduce_246 action_132 (345) = happyShift action_280 action_132 (346) = happyShift action_281 action_132 (347) = happyShift action_282 action_132 (352) = happyShift action_283 action_132 (369) = happyShift action_284 action_132 (373) = happyShift action_285 action_132 (374) = happyShift action_286 action_132 (377) = happyShift action_287 action_132 (378) = happyShift action_288 action_132 (105) = happyGoto action_267 action_132 (222) = happyGoto action_268 action_132 (233) = happyGoto action_269 action_132 (235) = happyGoto action_270 action_132 (244) = happyGoto action_271 action_132 (246) = happyGoto action_272 action_132 (247) = happyGoto action_273 action_132 (248) = happyGoto action_274 action_132 (250) = happyGoto action_275 action_132 (253) = happyGoto action_276 action_132 (254) = happyGoto action_277 action_132 _ = happyReduce_114 action_133 _ = happyReduce_372 action_134 _ = happyReduce_373 action_135 _ = happyReduce_374 action_136 _ = happyReduce_375 action_137 (267) = happyShift action_38 action_137 (275) = happyShift action_41 action_137 (287) = happyShift action_47 action_137 (293) = happyShift action_49 action_137 (294) = happyShift action_50 action_137 (295) = happyShift action_51 action_137 (296) = happyShift action_231 action_137 (297) = happyShift action_232 action_137 (298) = happyShift action_233 action_137 (302) = happyShift action_58 action_137 (303) = happyShift action_59 action_137 (304) = happyShift action_60 action_137 (305) = happyShift action_61 action_137 (306) = happyShift action_62 action_137 (309) = happyShift action_64 action_137 (323) = happyShift action_236 action_137 (324) = happyShift action_237 action_137 (346) = happyShift action_238 action_137 (353) = happyShift action_239 action_137 (357) = happyShift action_240 action_137 (359) = happyShift action_241 action_137 (361) = happyShift action_242 action_137 (363) = happyShift action_243 action_137 (370) = happyShift action_244 action_137 (371) = happyShift action_245 action_137 (372) = happyShift action_246 action_137 (376) = happyShift action_247 action_137 (380) = happyShift action_248 action_137 (383) = happyShift action_249 action_137 (384) = happyShift action_250 action_137 (403) = happyShift action_251 action_137 (404) = happyShift action_252 action_137 (408) = happyShift action_108 action_137 (409) = happyShift action_109 action_137 (65) = happyGoto action_264 action_137 (111) = happyGoto action_218 action_137 (114) = happyGoto action_265 action_137 (115) = happyGoto action_266 action_137 (117) = happyGoto action_257 action_137 (118) = happyGoto action_221 action_137 (156) = happyGoto action_222 action_137 (224) = happyGoto action_223 action_137 (225) = happyGoto action_224 action_137 (227) = happyGoto action_225 action_137 (228) = happyGoto action_226 action_137 (237) = happyGoto action_227 action_137 (239) = happyGoto action_228 action_137 (249) = happyGoto action_229 action_137 _ = happyFail action_138 (300) = happyShift action_263 action_138 _ = happyReduce_145 action_139 (361) = happyShift action_262 action_139 _ = happyFail action_140 (282) = happyShift action_261 action_140 _ = happyFail action_141 (267) = happyShift action_38 action_141 (275) = happyShift action_41 action_141 (287) = happyShift action_47 action_141 (291) = happyShift action_260 action_141 (293) = happyShift action_49 action_141 (294) = happyShift action_50 action_141 (295) = happyShift action_51 action_141 (296) = happyShift action_231 action_141 (297) = happyShift action_232 action_141 (298) = happyShift action_233 action_141 (302) = happyShift action_58 action_141 (303) = happyShift action_59 action_141 (304) = happyShift action_60 action_141 (305) = happyShift action_61 action_141 (306) = happyShift action_62 action_141 (309) = happyShift action_64 action_141 (323) = happyShift action_236 action_141 (324) = happyShift action_237 action_141 (346) = happyShift action_238 action_141 (353) = happyShift action_239 action_141 (357) = happyShift action_240 action_141 (359) = happyShift action_241 action_141 (361) = happyShift action_242 action_141 (363) = happyShift action_243 action_141 (370) = happyShift action_244 action_141 (371) = happyShift action_245 action_141 (372) = happyShift action_246 action_141 (376) = happyShift action_247 action_141 (380) = happyShift action_248 action_141 (381) = happyShift action_87 action_141 (383) = happyShift action_249 action_141 (384) = happyShift action_250 action_141 (403) = happyShift action_251 action_141 (404) = happyShift action_252 action_141 (408) = happyShift action_108 action_141 (409) = happyShift action_109 action_141 (107) = happyGoto action_253 action_141 (111) = happyGoto action_218 action_141 (112) = happyGoto action_254 action_141 (114) = happyGoto action_255 action_141 (115) = happyGoto action_256 action_141 (117) = happyGoto action_257 action_141 (118) = happyGoto action_221 action_141 (119) = happyGoto action_258 action_141 (156) = happyGoto action_222 action_141 (210) = happyGoto action_259 action_141 (224) = happyGoto action_223 action_141 (225) = happyGoto action_224 action_141 (227) = happyGoto action_225 action_141 (228) = happyGoto action_226 action_141 (237) = happyGoto action_227 action_141 (239) = happyGoto action_228 action_141 (249) = happyGoto action_229 action_141 _ = happyFail action_142 _ = happyReduce_146 action_143 (267) = happyShift action_38 action_143 (275) = happyShift action_41 action_143 (282) = happyShift action_230 action_143 (287) = happyShift action_47 action_143 (293) = happyShift action_49 action_143 (294) = happyShift action_50 action_143 (295) = happyShift action_51 action_143 (296) = happyShift action_231 action_143 (297) = happyShift action_232 action_143 (298) = happyShift action_233 action_143 (300) = happyShift action_234 action_143 (301) = happyShift action_235 action_143 (302) = happyShift action_58 action_143 (303) = happyShift action_59 action_143 (304) = happyShift action_60 action_143 (305) = happyShift action_61 action_143 (306) = happyShift action_62 action_143 (309) = happyShift action_64 action_143 (323) = happyShift action_236 action_143 (324) = happyShift action_237 action_143 (346) = happyShift action_238 action_143 (353) = happyShift action_239 action_143 (357) = happyShift action_240 action_143 (359) = happyShift action_241 action_143 (361) = happyShift action_242 action_143 (363) = happyShift action_243 action_143 (370) = happyShift action_244 action_143 (371) = happyShift action_245 action_143 (372) = happyShift action_246 action_143 (376) = happyShift action_247 action_143 (380) = happyShift action_248 action_143 (383) = happyShift action_249 action_143 (384) = happyShift action_250 action_143 (403) = happyShift action_251 action_143 (404) = happyShift action_252 action_143 (408) = happyShift action_108 action_143 (409) = happyShift action_109 action_143 (111) = happyGoto action_218 action_143 (115) = happyGoto action_219 action_143 (117) = happyGoto action_220 action_143 (118) = happyGoto action_221 action_143 (156) = happyGoto action_222 action_143 (224) = happyGoto action_223 action_143 (225) = happyGoto action_224 action_143 (227) = happyGoto action_225 action_143 (228) = happyGoto action_226 action_143 (237) = happyGoto action_227 action_143 (239) = happyGoto action_228 action_143 (249) = happyGoto action_229 action_143 _ = happyFail action_144 (277) = happyShift action_216 action_144 (293) = happyShift action_217 action_144 (101) = happyGoto action_215 action_144 _ = happyFail action_145 (267) = happyShift action_38 action_145 (275) = happyShift action_41 action_145 (287) = happyShift action_47 action_145 (291) = happyShift action_48 action_145 (293) = happyShift action_49 action_145 (294) = happyShift action_50 action_145 (295) = happyShift action_51 action_145 (296) = happyShift action_52 action_145 (297) = happyShift action_53 action_145 (298) = happyShift action_54 action_145 (300) = happyShift action_56 action_145 (301) = happyShift action_57 action_145 (302) = happyShift action_58 action_145 (303) = happyShift action_59 action_145 (304) = happyShift action_60 action_145 (305) = happyShift action_61 action_145 (306) = happyShift action_62 action_145 (309) = happyShift action_64 action_145 (357) = happyShift action_199 action_145 (361) = happyShift action_214 action_145 (363) = happyShift action_201 action_145 (371) = happyShift action_81 action_145 (372) = happyShift action_82 action_145 (218) = happyGoto action_212 action_145 (220) = happyGoto action_193 action_145 (243) = happyGoto action_213 action_145 (249) = happyGoto action_33 action_145 (252) = happyGoto action_196 action_145 _ = happyFail action_146 (383) = happyShift action_211 action_146 (87) = happyGoto action_209 action_146 (88) = happyGoto action_210 action_146 _ = happyReduce_203 action_147 (267) = happyShift action_38 action_147 (275) = happyShift action_41 action_147 (287) = happyShift action_47 action_147 (291) = happyShift action_48 action_147 (293) = happyShift action_49 action_147 (294) = happyShift action_50 action_147 (295) = happyShift action_51 action_147 (296) = happyShift action_52 action_147 (297) = happyShift action_53 action_147 (298) = happyShift action_54 action_147 (300) = happyShift action_56 action_147 (301) = happyShift action_57 action_147 (302) = happyShift action_58 action_147 (303) = happyShift action_59 action_147 (304) = happyShift action_60 action_147 (305) = happyShift action_61 action_147 (306) = happyShift action_62 action_147 (309) = happyShift action_64 action_147 (357) = happyShift action_199 action_147 (361) = happyShift action_200 action_147 (363) = happyShift action_201 action_147 (371) = happyShift action_81 action_147 (372) = happyShift action_82 action_147 (96) = happyGoto action_206 action_147 (97) = happyGoto action_207 action_147 (215) = happyGoto action_208 action_147 (216) = happyGoto action_205 action_147 (218) = happyGoto action_192 action_147 (220) = happyGoto action_193 action_147 (240) = happyGoto action_194 action_147 (243) = happyGoto action_195 action_147 (249) = happyGoto action_33 action_147 (252) = happyGoto action_196 action_147 _ = happyReduce_224 action_148 (267) = happyShift action_38 action_148 (275) = happyShift action_41 action_148 (287) = happyShift action_47 action_148 (291) = happyShift action_48 action_148 (293) = happyShift action_49 action_148 (294) = happyShift action_50 action_148 (295) = happyShift action_51 action_148 (296) = happyShift action_52 action_148 (297) = happyShift action_53 action_148 (298) = happyShift action_54 action_148 (300) = happyShift action_56 action_148 (301) = happyShift action_57 action_148 (302) = happyShift action_58 action_148 (303) = happyShift action_59 action_148 (304) = happyShift action_60 action_148 (305) = happyShift action_61 action_148 (306) = happyShift action_62 action_148 (309) = happyShift action_64 action_148 (357) = happyShift action_199 action_148 (361) = happyShift action_200 action_148 (363) = happyShift action_201 action_148 (371) = happyShift action_81 action_148 (372) = happyShift action_82 action_148 (94) = happyGoto action_202 action_148 (95) = happyGoto action_203 action_148 (215) = happyGoto action_204 action_148 (216) = happyGoto action_205 action_148 (218) = happyGoto action_192 action_148 (220) = happyGoto action_193 action_148 (240) = happyGoto action_194 action_148 (243) = happyGoto action_195 action_148 (249) = happyGoto action_33 action_148 (252) = happyGoto action_196 action_148 _ = happyReduce_219 action_149 (267) = happyShift action_38 action_149 (275) = happyShift action_41 action_149 (284) = happyShift action_197 action_149 (287) = happyShift action_47 action_149 (289) = happyShift action_198 action_149 (291) = happyShift action_48 action_149 (293) = happyShift action_49 action_149 (294) = happyShift action_50 action_149 (295) = happyShift action_51 action_149 (296) = happyShift action_52 action_149 (297) = happyShift action_53 action_149 (298) = happyShift action_54 action_149 (300) = happyShift action_56 action_149 (301) = happyShift action_57 action_149 (302) = happyShift action_58 action_149 (303) = happyShift action_59 action_149 (304) = happyShift action_60 action_149 (305) = happyShift action_61 action_149 (306) = happyShift action_62 action_149 (309) = happyShift action_64 action_149 (357) = happyShift action_199 action_149 (361) = happyShift action_200 action_149 (363) = happyShift action_201 action_149 (371) = happyShift action_81 action_149 (372) = happyShift action_82 action_149 (216) = happyGoto action_191 action_149 (218) = happyGoto action_192 action_149 (220) = happyGoto action_193 action_149 (240) = happyGoto action_194 action_149 (243) = happyGoto action_195 action_149 (249) = happyGoto action_33 action_149 (252) = happyGoto action_196 action_149 _ = happyFail action_150 (267) = happyShift action_38 action_150 (269) = happyShift action_189 action_150 (275) = happyShift action_41 action_150 (287) = happyShift action_47 action_150 (289) = happyShift action_190 action_150 (291) = happyShift action_48 action_150 (293) = happyShift action_49 action_150 (294) = happyShift action_50 action_150 (295) = happyShift action_51 action_150 (296) = happyShift action_52 action_150 (297) = happyShift action_53 action_150 (298) = happyShift action_54 action_150 (300) = happyShift action_56 action_150 (301) = happyShift action_57 action_150 (302) = happyShift action_58 action_150 (303) = happyShift action_59 action_150 (304) = happyShift action_60 action_150 (305) = happyShift action_61 action_150 (306) = happyShift action_62 action_150 (309) = happyShift action_64 action_150 (361) = happyShift action_186 action_150 (371) = happyShift action_81 action_150 (375) = happyShift action_83 action_150 (379) = happyShift action_85 action_150 (241) = happyGoto action_188 action_150 (242) = happyGoto action_31 action_150 (243) = happyGoto action_117 action_150 (249) = happyGoto action_33 action_150 _ = happyFail action_151 (289) = happyShift action_187 action_151 _ = happyFail action_152 (267) = happyShift action_38 action_152 (275) = happyShift action_41 action_152 (287) = happyShift action_47 action_152 (291) = happyShift action_48 action_152 (293) = happyShift action_49 action_152 (294) = happyShift action_50 action_152 (295) = happyShift action_51 action_152 (296) = happyShift action_52 action_152 (297) = happyShift action_53 action_152 (298) = happyShift action_54 action_152 (300) = happyShift action_56 action_152 (301) = happyShift action_57 action_152 (302) = happyShift action_58 action_152 (303) = happyShift action_59 action_152 (304) = happyShift action_60 action_152 (305) = happyShift action_61 action_152 (306) = happyShift action_62 action_152 (309) = happyShift action_64 action_152 (361) = happyShift action_186 action_152 (371) = happyShift action_81 action_152 (375) = happyShift action_83 action_152 (379) = happyShift action_85 action_152 (241) = happyGoto action_185 action_152 (242) = happyGoto action_31 action_152 (243) = happyGoto action_117 action_152 (249) = happyGoto action_33 action_152 _ = happyFail action_153 (266) = happyShift action_37 action_153 (267) = happyShift action_38 action_153 (275) = happyShift action_41 action_153 (287) = happyShift action_47 action_153 (291) = happyShift action_48 action_153 (293) = happyShift action_49 action_153 (294) = happyShift action_50 action_153 (295) = happyShift action_51 action_153 (296) = happyShift action_52 action_153 (297) = happyShift action_53 action_153 (298) = happyShift action_54 action_153 (300) = happyShift action_56 action_153 (301) = happyShift action_57 action_153 (302) = happyShift action_58 action_153 (303) = happyShift action_59 action_153 (304) = happyShift action_60 action_153 (305) = happyShift action_61 action_153 (306) = happyShift action_62 action_153 (309) = happyShift action_64 action_153 (342) = happyShift action_73 action_153 (357) = happyShift action_75 action_153 (359) = happyShift action_76 action_153 (361) = happyShift action_118 action_153 (363) = happyShift action_78 action_153 (365) = happyShift action_79 action_153 (370) = happyShift action_80 action_153 (371) = happyShift action_81 action_153 (372) = happyShift action_82 action_153 (375) = happyShift action_83 action_153 (376) = happyShift action_84 action_153 (379) = happyShift action_85 action_153 (380) = happyShift action_86 action_153 (381) = happyShift action_87 action_153 (382) = happyShift action_88 action_153 (383) = happyShift action_89 action_153 (384) = happyShift action_90 action_153 (385) = happyShift action_91 action_153 (386) = happyShift action_92 action_153 (387) = happyShift action_93 action_153 (388) = happyShift action_94 action_153 (389) = happyShift action_95 action_153 (390) = happyShift action_96 action_153 (391) = happyShift action_97 action_153 (396) = happyShift action_98 action_153 (397) = happyShift action_99 action_153 (398) = happyShift action_100 action_153 (399) = happyShift action_101 action_153 (401) = happyShift action_102 action_153 (403) = happyShift action_103 action_153 (404) = happyShift action_104 action_153 (405) = happyShift action_105 action_153 (406) = happyShift action_106 action_153 (407) = happyShift action_107 action_153 (408) = happyShift action_108 action_153 (409) = happyShift action_109 action_153 (38) = happyGoto action_13 action_153 (156) = happyGoto action_16 action_153 (164) = happyGoto action_184 action_153 (165) = happyGoto action_23 action_153 (166) = happyGoto action_24 action_153 (167) = happyGoto action_25 action_153 (210) = happyGoto action_26 action_153 (217) = happyGoto action_27 action_153 (220) = happyGoto action_28 action_153 (241) = happyGoto action_30 action_153 (242) = happyGoto action_31 action_153 (243) = happyGoto action_117 action_153 (249) = happyGoto action_33 action_153 (251) = happyGoto action_34 action_153 (252) = happyGoto action_35 action_153 (255) = happyGoto action_36 action_153 _ = happyFail action_154 _ = happyReduce_701 action_155 _ = happyReduce_702 action_156 _ = happyReduce_703 action_157 _ = happyReduce_704 action_158 (410) = happyAccept action_158 _ = happyFail action_159 (316) = happyShift action_183 action_159 (41) = happyGoto action_182 action_159 _ = happyReduce_72 action_160 (339) = happyReduce_532 action_160 _ = happyReduce_550 action_161 (339) = happyShift action_181 action_161 _ = happyFail action_162 (410) = happyAccept action_162 _ = happyFail action_163 _ = happyReduce_547 action_164 (353) = happyShift action_179 action_164 (355) = happyShift action_180 action_164 (84) = happyGoto action_177 action_164 (85) = happyGoto action_178 action_164 _ = happyFail action_165 (353) = happyShift action_175 action_165 (355) = happyShift action_176 action_165 (199) = happyGoto action_174 action_165 _ = happyFail action_166 (266) = happyShift action_37 action_166 (267) = happyShift action_38 action_166 (275) = happyShift action_41 action_166 (287) = happyShift action_47 action_166 (291) = happyShift action_48 action_166 (293) = happyShift action_49 action_166 (294) = happyShift action_50 action_166 (295) = happyShift action_51 action_166 (296) = happyShift action_52 action_166 (297) = happyShift action_53 action_166 (298) = happyShift action_54 action_166 (300) = happyShift action_56 action_166 (301) = happyShift action_57 action_166 (302) = happyShift action_58 action_166 (303) = happyShift action_59 action_166 (304) = happyShift action_60 action_166 (305) = happyShift action_61 action_166 (306) = happyShift action_62 action_166 (309) = happyShift action_64 action_166 (342) = happyShift action_73 action_166 (357) = happyShift action_75 action_166 (359) = happyShift action_76 action_166 (361) = happyShift action_118 action_166 (363) = happyShift action_78 action_166 (365) = happyShift action_79 action_166 (370) = happyShift action_80 action_166 (371) = happyShift action_81 action_166 (372) = happyShift action_82 action_166 (375) = happyShift action_83 action_166 (376) = happyShift action_84 action_166 (379) = happyShift action_85 action_166 (380) = happyShift action_86 action_166 (381) = happyShift action_87 action_166 (382) = happyShift action_88 action_166 (383) = happyShift action_89 action_166 (384) = happyShift action_90 action_166 (385) = happyShift action_91 action_166 (386) = happyShift action_92 action_166 (387) = happyShift action_93 action_166 (388) = happyShift action_94 action_166 (389) = happyShift action_95 action_166 (390) = happyShift action_96 action_166 (391) = happyShift action_97 action_166 (396) = happyShift action_98 action_166 (397) = happyShift action_99 action_166 (398) = happyShift action_100 action_166 (399) = happyShift action_101 action_166 (401) = happyShift action_102 action_166 (403) = happyShift action_103 action_166 (404) = happyShift action_104 action_166 (405) = happyShift action_105 action_166 (406) = happyShift action_106 action_166 (407) = happyShift action_107 action_166 (408) = happyShift action_108 action_166 (409) = happyShift action_109 action_166 (38) = happyGoto action_13 action_166 (156) = happyGoto action_16 action_166 (164) = happyGoto action_173 action_166 (165) = happyGoto action_23 action_166 (166) = happyGoto action_24 action_166 (167) = happyGoto action_25 action_166 (210) = happyGoto action_26 action_166 (217) = happyGoto action_27 action_166 (220) = happyGoto action_28 action_166 (241) = happyGoto action_30 action_166 (242) = happyGoto action_31 action_166 (243) = happyGoto action_117 action_166 (249) = happyGoto action_33 action_166 (251) = happyGoto action_34 action_166 (252) = happyGoto action_35 action_166 (255) = happyGoto action_36 action_166 _ = happyFail action_167 (1) = happyAccept action_167 _ = happyFail action_168 (1) = happyAccept action_168 _ = happyFail action_169 (1) = happyAccept action_169 _ = happyFail action_170 (1) = happyAccept action_170 _ = happyFail action_171 (1) = happyAccept action_171 _ = happyFail action_172 (1) = happyAccept action_172 _ = happyFail action_173 _ = happyReduce_533 action_174 _ = happyReduce_548 action_175 (266) = happyShift action_37 action_175 (267) = happyShift action_38 action_175 (268) = happyShift action_39 action_175 (273) = happyShift action_40 action_175 (275) = happyShift action_41 action_175 (276) = happyShift action_42 action_175 (283) = happyShift action_164 action_175 (287) = happyShift action_47 action_175 (291) = happyShift action_48 action_175 (293) = happyShift action_49 action_175 (294) = happyShift action_50 action_175 (295) = happyShift action_51 action_175 (296) = happyShift action_52 action_175 (297) = happyShift action_53 action_175 (298) = happyShift action_54 action_175 (299) = happyShift action_55 action_175 (300) = happyShift action_56 action_175 (301) = happyShift action_57 action_175 (302) = happyShift action_58 action_175 (303) = happyShift action_59 action_175 (304) = happyShift action_60 action_175 (305) = happyShift action_61 action_175 (306) = happyShift action_62 action_175 (307) = happyShift action_63 action_175 (308) = happyShift action_165 action_175 (309) = happyShift action_64 action_175 (318) = happyShift action_68 action_175 (319) = happyShift action_69 action_175 (320) = happyShift action_70 action_175 (336) = happyShift action_72 action_175 (342) = happyShift action_73 action_175 (345) = happyShift action_74 action_175 (346) = happyShift action_166 action_175 (357) = happyShift action_75 action_175 (359) = happyShift action_76 action_175 (361) = happyShift action_118 action_175 (363) = happyShift action_78 action_175 (365) = happyShift action_79 action_175 (367) = happyShift action_638 action_175 (370) = happyShift action_80 action_175 (371) = happyShift action_81 action_175 (372) = happyShift action_82 action_175 (375) = happyShift action_83 action_175 (376) = happyShift action_84 action_175 (379) = happyShift action_85 action_175 (380) = happyShift action_86 action_175 (381) = happyShift action_87 action_175 (382) = happyShift action_88 action_175 (383) = happyShift action_89 action_175 (384) = happyShift action_90 action_175 (385) = happyShift action_91 action_175 (386) = happyShift action_92 action_175 (387) = happyShift action_93 action_175 (388) = happyShift action_94 action_175 (389) = happyShift action_95 action_175 (390) = happyShift action_96 action_175 (391) = happyShift action_97 action_175 (396) = happyShift action_98 action_175 (397) = happyShift action_99 action_175 (398) = happyShift action_100 action_175 (399) = happyShift action_101 action_175 (401) = happyShift action_102 action_175 (403) = happyShift action_103 action_175 (404) = happyShift action_104 action_175 (405) = happyShift action_105 action_175 (406) = happyShift action_106 action_175 (407) = happyShift action_107 action_175 (408) = happyShift action_108 action_175 (409) = happyShift action_109 action_175 (38) = happyGoto action_13 action_175 (156) = happyGoto action_16 action_175 (157) = happyGoto action_160 action_175 (158) = happyGoto action_116 action_175 (159) = happyGoto action_18 action_175 (161) = happyGoto action_19 action_175 (162) = happyGoto action_20 action_175 (163) = happyGoto action_21 action_175 (164) = happyGoto action_22 action_175 (165) = happyGoto action_23 action_175 (166) = happyGoto action_24 action_175 (167) = happyGoto action_25 action_175 (196) = happyGoto action_161 action_175 (200) = happyGoto action_639 action_175 (203) = happyGoto action_637 action_175 (204) = happyGoto action_163 action_175 (210) = happyGoto action_26 action_175 (217) = happyGoto action_27 action_175 (220) = happyGoto action_28 action_175 (241) = happyGoto action_30 action_175 (242) = happyGoto action_31 action_175 (243) = happyGoto action_117 action_175 (249) = happyGoto action_33 action_175 (251) = happyGoto action_34 action_175 (252) = happyGoto action_35 action_175 (255) = happyGoto action_36 action_175 _ = happyReduce_542 action_176 (266) = happyShift action_37 action_176 (267) = happyShift action_38 action_176 (268) = happyShift action_39 action_176 (273) = happyShift action_40 action_176 (275) = happyShift action_41 action_176 (276) = happyShift action_42 action_176 (283) = happyShift action_164 action_176 (287) = happyShift action_47 action_176 (291) = happyShift action_48 action_176 (293) = happyShift action_49 action_176 (294) = happyShift action_50 action_176 (295) = happyShift action_51 action_176 (296) = happyShift action_52 action_176 (297) = happyShift action_53 action_176 (298) = happyShift action_54 action_176 (299) = happyShift action_55 action_176 (300) = happyShift action_56 action_176 (301) = happyShift action_57 action_176 (302) = happyShift action_58 action_176 (303) = happyShift action_59 action_176 (304) = happyShift action_60 action_176 (305) = happyShift action_61 action_176 (306) = happyShift action_62 action_176 (307) = happyShift action_63 action_176 (308) = happyShift action_165 action_176 (309) = happyShift action_64 action_176 (318) = happyShift action_68 action_176 (319) = happyShift action_69 action_176 (320) = happyShift action_70 action_176 (336) = happyShift action_72 action_176 (342) = happyShift action_73 action_176 (345) = happyShift action_74 action_176 (346) = happyShift action_166 action_176 (357) = happyShift action_75 action_176 (359) = happyShift action_76 action_176 (361) = happyShift action_118 action_176 (363) = happyShift action_78 action_176 (365) = happyShift action_79 action_176 (367) = happyShift action_638 action_176 (370) = happyShift action_80 action_176 (371) = happyShift action_81 action_176 (372) = happyShift action_82 action_176 (375) = happyShift action_83 action_176 (376) = happyShift action_84 action_176 (379) = happyShift action_85 action_176 (380) = happyShift action_86 action_176 (381) = happyShift action_87 action_176 (382) = happyShift action_88 action_176 (383) = happyShift action_89 action_176 (384) = happyShift action_90 action_176 (385) = happyShift action_91 action_176 (386) = happyShift action_92 action_176 (387) = happyShift action_93 action_176 (388) = happyShift action_94 action_176 (389) = happyShift action_95 action_176 (390) = happyShift action_96 action_176 (391) = happyShift action_97 action_176 (396) = happyShift action_98 action_176 (397) = happyShift action_99 action_176 (398) = happyShift action_100 action_176 (399) = happyShift action_101 action_176 (401) = happyShift action_102 action_176 (403) = happyShift action_103 action_176 (404) = happyShift action_104 action_176 (405) = happyShift action_105 action_176 (406) = happyShift action_106 action_176 (407) = happyShift action_107 action_176 (408) = happyShift action_108 action_176 (409) = happyShift action_109 action_176 (38) = happyGoto action_13 action_176 (156) = happyGoto action_16 action_176 (157) = happyGoto action_160 action_176 (158) = happyGoto action_116 action_176 (159) = happyGoto action_18 action_176 (161) = happyGoto action_19 action_176 (162) = happyGoto action_20 action_176 (163) = happyGoto action_21 action_176 (164) = happyGoto action_22 action_176 (165) = happyGoto action_23 action_176 (166) = happyGoto action_24 action_176 (167) = happyGoto action_25 action_176 (196) = happyGoto action_161 action_176 (200) = happyGoto action_636 action_176 (203) = happyGoto action_637 action_176 (204) = happyGoto action_163 action_176 (210) = happyGoto action_26 action_176 (217) = happyGoto action_27 action_176 (220) = happyGoto action_28 action_176 (241) = happyGoto action_30 action_176 (242) = happyGoto action_31 action_176 (243) = happyGoto action_117 action_176 (249) = happyGoto action_33 action_176 (251) = happyGoto action_34 action_176 (252) = happyGoto action_35 action_176 (255) = happyGoto action_36 action_176 _ = happyReduce_542 action_177 _ = happyReduce_195 action_178 (278) = happyShift action_427 action_178 _ = happyReduce_551 action_179 (266) = happyShift action_37 action_179 (267) = happyShift action_38 action_179 (268) = happyShift action_39 action_179 (273) = happyShift action_40 action_179 (275) = happyShift action_41 action_179 (276) = happyShift action_42 action_179 (279) = happyShift action_43 action_179 (280) = happyShift action_44 action_179 (281) = happyShift action_45 action_179 (283) = happyShift action_46 action_179 (287) = happyShift action_47 action_179 (291) = happyShift action_48 action_179 (293) = happyShift action_49 action_179 (294) = happyShift action_50 action_179 (295) = happyShift action_51 action_179 (296) = happyShift action_52 action_179 (297) = happyShift action_53 action_179 (298) = happyShift action_54 action_179 (299) = happyShift action_55 action_179 (300) = happyShift action_56 action_179 (301) = happyShift action_57 action_179 (302) = happyShift action_58 action_179 (303) = happyShift action_59 action_179 (304) = happyShift action_60 action_179 (305) = happyShift action_61 action_179 (306) = happyShift action_62 action_179 (307) = happyShift action_63 action_179 (309) = happyShift action_64 action_179 (312) = happyShift action_145 action_179 (313) = happyShift action_65 action_179 (314) = happyShift action_66 action_179 (315) = happyShift action_67 action_179 (318) = happyShift action_68 action_179 (319) = happyShift action_69 action_179 (320) = happyShift action_70 action_179 (329) = happyShift action_71 action_179 (336) = happyShift action_72 action_179 (342) = happyShift action_73 action_179 (345) = happyShift action_74 action_179 (346) = happyShift action_153 action_179 (357) = happyShift action_75 action_179 (359) = happyShift action_76 action_179 (361) = happyShift action_77 action_179 (363) = happyShift action_78 action_179 (365) = happyShift action_79 action_179 (370) = happyShift action_80 action_179 (371) = happyShift action_81 action_179 (372) = happyShift action_82 action_179 (375) = happyShift action_83 action_179 (376) = happyShift action_84 action_179 (379) = happyShift action_85 action_179 (380) = happyShift action_86 action_179 (381) = happyShift action_87 action_179 (382) = happyShift action_88 action_179 (383) = happyShift action_89 action_179 (384) = happyShift action_90 action_179 (385) = happyShift action_91 action_179 (386) = happyShift action_92 action_179 (387) = happyShift action_93 action_179 (388) = happyShift action_94 action_179 (389) = happyShift action_95 action_179 (390) = happyShift action_96 action_179 (391) = happyShift action_97 action_179 (392) = happyShift action_154 action_179 (393) = happyShift action_155 action_179 (394) = happyShift action_156 action_179 (395) = happyShift action_157 action_179 (396) = happyShift action_98 action_179 (397) = happyShift action_99 action_179 (398) = happyShift action_100 action_179 (399) = happyShift action_101 action_179 (401) = happyShift action_102 action_179 (403) = happyShift action_103 action_179 (404) = happyShift action_104 action_179 (405) = happyShift action_105 action_179 (406) = happyShift action_106 action_179 (407) = happyShift action_107 action_179 (408) = happyShift action_108 action_179 (409) = happyShift action_109 action_179 (38) = happyGoto action_13 action_179 (49) = happyGoto action_14 action_179 (72) = happyGoto action_126 action_179 (83) = happyGoto action_634 action_179 (146) = happyGoto action_128 action_179 (147) = happyGoto action_129 action_179 (148) = happyGoto action_627 action_179 (149) = happyGoto action_628 action_179 (153) = happyGoto action_131 action_179 (156) = happyGoto action_16 action_179 (158) = happyGoto action_629 action_179 (159) = happyGoto action_18 action_179 (161) = happyGoto action_19 action_179 (162) = happyGoto action_20 action_179 (163) = happyGoto action_21 action_179 (164) = happyGoto action_22 action_179 (165) = happyGoto action_23 action_179 (166) = happyGoto action_24 action_179 (167) = happyGoto action_630 action_179 (208) = happyGoto action_635 action_179 (209) = happyGoto action_632 action_179 (210) = happyGoto action_633 action_179 (217) = happyGoto action_27 action_179 (220) = happyGoto action_28 action_179 (240) = happyGoto action_29 action_179 (241) = happyGoto action_30 action_179 (242) = happyGoto action_31 action_179 (243) = happyGoto action_32 action_179 (249) = happyGoto action_33 action_179 (251) = happyGoto action_34 action_179 (252) = happyGoto action_35 action_179 (255) = happyGoto action_36 action_179 (259) = happyGoto action_133 action_179 (260) = happyGoto action_134 action_179 (261) = happyGoto action_135 action_179 (262) = happyGoto action_136 action_179 _ = happyReduce_192 action_180 (266) = happyShift action_37 action_180 (267) = happyShift action_38 action_180 (268) = happyShift action_39 action_180 (273) = happyShift action_40 action_180 (275) = happyShift action_41 action_180 (276) = happyShift action_42 action_180 (279) = happyShift action_43 action_180 (280) = happyShift action_44 action_180 (281) = happyShift action_45 action_180 (283) = happyShift action_46 action_180 (287) = happyShift action_47 action_180 (291) = happyShift action_48 action_180 (293) = happyShift action_49 action_180 (294) = happyShift action_50 action_180 (295) = happyShift action_51 action_180 (296) = happyShift action_52 action_180 (297) = happyShift action_53 action_180 (298) = happyShift action_54 action_180 (299) = happyShift action_55 action_180 (300) = happyShift action_56 action_180 (301) = happyShift action_57 action_180 (302) = happyShift action_58 action_180 (303) = happyShift action_59 action_180 (304) = happyShift action_60 action_180 (305) = happyShift action_61 action_180 (306) = happyShift action_62 action_180 (307) = happyShift action_63 action_180 (309) = happyShift action_64 action_180 (312) = happyShift action_145 action_180 (313) = happyShift action_65 action_180 (314) = happyShift action_66 action_180 (315) = happyShift action_67 action_180 (318) = happyShift action_68 action_180 (319) = happyShift action_69 action_180 (320) = happyShift action_70 action_180 (329) = happyShift action_71 action_180 (336) = happyShift action_72 action_180 (342) = happyShift action_73 action_180 (345) = happyShift action_74 action_180 (346) = happyShift action_153 action_180 (357) = happyShift action_75 action_180 (359) = happyShift action_76 action_180 (361) = happyShift action_77 action_180 (363) = happyShift action_78 action_180 (365) = happyShift action_79 action_180 (370) = happyShift action_80 action_180 (371) = happyShift action_81 action_180 (372) = happyShift action_82 action_180 (375) = happyShift action_83 action_180 (376) = happyShift action_84 action_180 (379) = happyShift action_85 action_180 (380) = happyShift action_86 action_180 (381) = happyShift action_87 action_180 (382) = happyShift action_88 action_180 (383) = happyShift action_89 action_180 (384) = happyShift action_90 action_180 (385) = happyShift action_91 action_180 (386) = happyShift action_92 action_180 (387) = happyShift action_93 action_180 (388) = happyShift action_94 action_180 (389) = happyShift action_95 action_180 (390) = happyShift action_96 action_180 (391) = happyShift action_97 action_180 (392) = happyShift action_154 action_180 (393) = happyShift action_155 action_180 (394) = happyShift action_156 action_180 (395) = happyShift action_157 action_180 (396) = happyShift action_98 action_180 (397) = happyShift action_99 action_180 (398) = happyShift action_100 action_180 (399) = happyShift action_101 action_180 (401) = happyShift action_102 action_180 (403) = happyShift action_103 action_180 (404) = happyShift action_104 action_180 (405) = happyShift action_105 action_180 (406) = happyShift action_106 action_180 (407) = happyShift action_107 action_180 (408) = happyShift action_108 action_180 (409) = happyShift action_109 action_180 (38) = happyGoto action_13 action_180 (49) = happyGoto action_14 action_180 (72) = happyGoto action_126 action_180 (83) = happyGoto action_626 action_180 (146) = happyGoto action_128 action_180 (147) = happyGoto action_129 action_180 (148) = happyGoto action_627 action_180 (149) = happyGoto action_628 action_180 (153) = happyGoto action_131 action_180 (156) = happyGoto action_16 action_180 (158) = happyGoto action_629 action_180 (159) = happyGoto action_18 action_180 (161) = happyGoto action_19 action_180 (162) = happyGoto action_20 action_180 (163) = happyGoto action_21 action_180 (164) = happyGoto action_22 action_180 (165) = happyGoto action_23 action_180 (166) = happyGoto action_24 action_180 (167) = happyGoto action_630 action_180 (208) = happyGoto action_631 action_180 (209) = happyGoto action_632 action_180 (210) = happyGoto action_633 action_180 (217) = happyGoto action_27 action_180 (220) = happyGoto action_28 action_180 (240) = happyGoto action_29 action_180 (241) = happyGoto action_30 action_180 (242) = happyGoto action_31 action_180 (243) = happyGoto action_32 action_180 (249) = happyGoto action_33 action_180 (251) = happyGoto action_34 action_180 (252) = happyGoto action_35 action_180 (255) = happyGoto action_36 action_180 (259) = happyGoto action_133 action_180 (260) = happyGoto action_134 action_180 (261) = happyGoto action_135 action_180 (262) = happyGoto action_136 action_180 _ = happyReduce_192 action_181 (266) = happyShift action_37 action_181 (267) = happyShift action_38 action_181 (268) = happyShift action_39 action_181 (273) = happyShift action_40 action_181 (275) = happyShift action_41 action_181 (276) = happyShift action_42 action_181 (283) = happyShift action_46 action_181 (287) = happyShift action_47 action_181 (291) = happyShift action_48 action_181 (293) = happyShift action_49 action_181 (294) = happyShift action_50 action_181 (295) = happyShift action_51 action_181 (296) = happyShift action_52 action_181 (297) = happyShift action_53 action_181 (298) = happyShift action_54 action_181 (299) = happyShift action_55 action_181 (300) = happyShift action_56 action_181 (301) = happyShift action_57 action_181 (302) = happyShift action_58 action_181 (303) = happyShift action_59 action_181 (304) = happyShift action_60 action_181 (305) = happyShift action_61 action_181 (306) = happyShift action_62 action_181 (307) = happyShift action_63 action_181 (309) = happyShift action_64 action_181 (318) = happyShift action_68 action_181 (319) = happyShift action_69 action_181 (320) = happyShift action_70 action_181 (336) = happyShift action_72 action_181 (342) = happyShift action_73 action_181 (345) = happyShift action_74 action_181 (357) = happyShift action_75 action_181 (359) = happyShift action_76 action_181 (361) = happyShift action_118 action_181 (363) = happyShift action_78 action_181 (365) = happyShift action_79 action_181 (370) = happyShift action_80 action_181 (371) = happyShift action_81 action_181 (372) = happyShift action_82 action_181 (375) = happyShift action_83 action_181 (376) = happyShift action_84 action_181 (379) = happyShift action_85 action_181 (380) = happyShift action_86 action_181 (381) = happyShift action_87 action_181 (382) = happyShift action_88 action_181 (383) = happyShift action_89 action_181 (384) = happyShift action_90 action_181 (385) = happyShift action_91 action_181 (386) = happyShift action_92 action_181 (387) = happyShift action_93 action_181 (388) = happyShift action_94 action_181 (389) = happyShift action_95 action_181 (390) = happyShift action_96 action_181 (391) = happyShift action_97 action_181 (396) = happyShift action_98 action_181 (397) = happyShift action_99 action_181 (398) = happyShift action_100 action_181 (399) = happyShift action_101 action_181 (401) = happyShift action_102 action_181 (403) = happyShift action_103 action_181 (404) = happyShift action_104 action_181 (405) = happyShift action_105 action_181 (406) = happyShift action_106 action_181 (407) = happyShift action_107 action_181 (408) = happyShift action_108 action_181 (409) = happyShift action_109 action_181 (38) = happyGoto action_13 action_181 (156) = happyGoto action_16 action_181 (157) = happyGoto action_625 action_181 (158) = happyGoto action_116 action_181 (159) = happyGoto action_18 action_181 (161) = happyGoto action_19 action_181 (162) = happyGoto action_20 action_181 (163) = happyGoto action_21 action_181 (164) = happyGoto action_22 action_181 (165) = happyGoto action_23 action_181 (166) = happyGoto action_24 action_181 (167) = happyGoto action_25 action_181 (210) = happyGoto action_26 action_181 (217) = happyGoto action_27 action_181 (220) = happyGoto action_28 action_181 (241) = happyGoto action_30 action_181 (242) = happyGoto action_31 action_181 (243) = happyGoto action_117 action_181 (249) = happyGoto action_33 action_181 (251) = happyGoto action_34 action_181 (252) = happyGoto action_35 action_181 (255) = happyGoto action_36 action_181 _ = happyFail action_182 (296) = happyShift action_624 action_182 (42) = happyGoto action_623 action_182 _ = happyReduce_74 action_183 (331) = happyShift action_622 action_183 _ = happyFail action_184 (335) = happyShift action_534 action_184 (338) = happyShift action_535 action_184 (150) = happyGoto action_621 action_184 (151) = happyGoto action_532 action_184 (152) = happyGoto action_533 action_184 _ = happyFail action_185 (331) = happyShift action_620 action_185 _ = happyFail action_186 (345) = happyShift action_280 action_186 (346) = happyShift action_281 action_186 (347) = happyShift action_282 action_186 (352) = happyShift action_283 action_186 (373) = happyShift action_285 action_186 (377) = happyShift action_287 action_186 (246) = happyGoto action_471 action_186 (247) = happyGoto action_301 action_186 (248) = happyGoto action_274 action_186 (250) = happyGoto action_275 action_186 _ = happyFail action_187 (357) = happyShift action_318 action_187 (359) = happyShift action_319 action_187 (361) = happyShift action_320 action_187 (363) = happyShift action_321 action_187 (372) = happyShift action_246 action_187 (376) = happyShift action_247 action_187 (380) = happyShift action_248 action_187 (223) = happyGoto action_619 action_187 (224) = happyGoto action_316 action_187 (225) = happyGoto action_224 action_187 (227) = happyGoto action_225 action_187 (228) = happyGoto action_226 action_187 _ = happyFail action_188 (335) = happyShift action_618 action_188 _ = happyFail action_189 (357) = happyShift action_318 action_189 (359) = happyShift action_319 action_189 (361) = happyShift action_320 action_189 (363) = happyShift action_321 action_189 (372) = happyShift action_246 action_189 (376) = happyShift action_247 action_189 (380) = happyShift action_248 action_189 (223) = happyGoto action_617 action_189 (224) = happyGoto action_316 action_189 (225) = happyGoto action_224 action_189 (227) = happyGoto action_225 action_189 (228) = happyGoto action_226 action_189 _ = happyFail action_190 (357) = happyShift action_318 action_190 (359) = happyShift action_319 action_190 (361) = happyShift action_320 action_190 (363) = happyShift action_321 action_190 (372) = happyShift action_246 action_190 (376) = happyShift action_247 action_190 (380) = happyShift action_248 action_190 (223) = happyGoto action_616 action_190 (224) = happyGoto action_316 action_190 (225) = happyGoto action_224 action_190 (227) = happyGoto action_225 action_190 (228) = happyGoto action_226 action_190 _ = happyFail action_191 (266) = happyShift action_37 action_191 (267) = happyShift action_38 action_191 (275) = happyShift action_41 action_191 (287) = happyShift action_47 action_191 (291) = happyShift action_48 action_191 (293) = happyShift action_49 action_191 (294) = happyShift action_50 action_191 (295) = happyShift action_51 action_191 (296) = happyShift action_52 action_191 (297) = happyShift action_53 action_191 (298) = happyShift action_54 action_191 (300) = happyShift action_56 action_191 (301) = happyShift action_57 action_191 (302) = happyShift action_58 action_191 (303) = happyShift action_59 action_191 (304) = happyShift action_60 action_191 (305) = happyShift action_61 action_191 (306) = happyShift action_62 action_191 (309) = happyShift action_64 action_191 (342) = happyShift action_73 action_191 (357) = happyShift action_75 action_191 (359) = happyShift action_76 action_191 (361) = happyShift action_118 action_191 (363) = happyShift action_78 action_191 (365) = happyShift action_79 action_191 (370) = happyShift action_80 action_191 (371) = happyShift action_81 action_191 (372) = happyShift action_82 action_191 (375) = happyShift action_83 action_191 (376) = happyShift action_84 action_191 (379) = happyShift action_85 action_191 (380) = happyShift action_86 action_191 (381) = happyShift action_87 action_191 (382) = happyShift action_88 action_191 (383) = happyShift action_89 action_191 (384) = happyShift action_90 action_191 (385) = happyShift action_91 action_191 (386) = happyShift action_92 action_191 (387) = happyShift action_93 action_191 (388) = happyShift action_94 action_191 (389) = happyShift action_95 action_191 (390) = happyShift action_96 action_191 (391) = happyShift action_97 action_191 (396) = happyShift action_98 action_191 (397) = happyShift action_99 action_191 (398) = happyShift action_100 action_191 (399) = happyShift action_101 action_191 (401) = happyShift action_102 action_191 (403) = happyShift action_103 action_191 (404) = happyShift action_104 action_191 (405) = happyShift action_105 action_191 (406) = happyShift action_106 action_191 (407) = happyShift action_107 action_191 (408) = happyShift action_108 action_191 (409) = happyShift action_109 action_191 (38) = happyGoto action_13 action_191 (156) = happyGoto action_16 action_191 (164) = happyGoto action_615 action_191 (165) = happyGoto action_23 action_191 (166) = happyGoto action_24 action_191 (167) = happyGoto action_25 action_191 (210) = happyGoto action_26 action_191 (217) = happyGoto action_27 action_191 (220) = happyGoto action_28 action_191 (241) = happyGoto action_30 action_191 (242) = happyGoto action_31 action_191 (243) = happyGoto action_117 action_191 (249) = happyGoto action_33 action_191 (251) = happyGoto action_34 action_191 (252) = happyGoto action_35 action_191 (255) = happyGoto action_36 action_191 _ = happyFail action_192 _ = happyReduce_575 action_193 _ = happyReduce_581 action_194 _ = happyReduce_574 action_195 _ = happyReduce_639 action_196 _ = happyReduce_579 action_197 (266) = happyShift action_37 action_197 (267) = happyShift action_38 action_197 (275) = happyShift action_41 action_197 (287) = happyShift action_47 action_197 (291) = happyShift action_48 action_197 (293) = happyShift action_49 action_197 (294) = happyShift action_50 action_197 (295) = happyShift action_51 action_197 (296) = happyShift action_52 action_197 (297) = happyShift action_53 action_197 (298) = happyShift action_54 action_197 (300) = happyShift action_56 action_197 (301) = happyShift action_57 action_197 (302) = happyShift action_58 action_197 (303) = happyShift action_59 action_197 (304) = happyShift action_60 action_197 (305) = happyShift action_61 action_197 (306) = happyShift action_62 action_197 (309) = happyShift action_64 action_197 (342) = happyShift action_73 action_197 (357) = happyShift action_75 action_197 (359) = happyShift action_76 action_197 (361) = happyShift action_118 action_197 (363) = happyShift action_78 action_197 (365) = happyShift action_79 action_197 (370) = happyShift action_80 action_197 (371) = happyShift action_81 action_197 (372) = happyShift action_82 action_197 (375) = happyShift action_83 action_197 (376) = happyShift action_84 action_197 (379) = happyShift action_85 action_197 (380) = happyShift action_86 action_197 (381) = happyShift action_87 action_197 (382) = happyShift action_88 action_197 (383) = happyShift action_89 action_197 (384) = happyShift action_90 action_197 (385) = happyShift action_91 action_197 (386) = happyShift action_92 action_197 (387) = happyShift action_93 action_197 (388) = happyShift action_94 action_197 (389) = happyShift action_95 action_197 (390) = happyShift action_96 action_197 (391) = happyShift action_97 action_197 (396) = happyShift action_98 action_197 (397) = happyShift action_99 action_197 (398) = happyShift action_100 action_197 (399) = happyShift action_101 action_197 (401) = happyShift action_102 action_197 (403) = happyShift action_103 action_197 (404) = happyShift action_104 action_197 (405) = happyShift action_105 action_197 (406) = happyShift action_106 action_197 (407) = happyShift action_107 action_197 (408) = happyShift action_108 action_197 (409) = happyShift action_109 action_197 (38) = happyGoto action_13 action_197 (156) = happyGoto action_16 action_197 (164) = happyGoto action_614 action_197 (165) = happyGoto action_23 action_197 (166) = happyGoto action_24 action_197 (167) = happyGoto action_25 action_197 (210) = happyGoto action_26 action_197 (217) = happyGoto action_27 action_197 (220) = happyGoto action_28 action_197 (241) = happyGoto action_30 action_197 (242) = happyGoto action_31 action_197 (243) = happyGoto action_117 action_197 (249) = happyGoto action_33 action_197 (251) = happyGoto action_34 action_197 (252) = happyGoto action_35 action_197 (255) = happyGoto action_36 action_197 _ = happyFail action_198 (372) = happyShift action_246 action_198 (228) = happyGoto action_613 action_198 _ = happyFail action_199 (358) = happyShift action_349 action_199 _ = happyFail action_200 (333) = happyShift action_278 action_200 (345) = happyShift action_280 action_200 (346) = happyShift action_281 action_200 (347) = happyShift action_282 action_200 (352) = happyShift action_283 action_200 (362) = happyShift action_306 action_200 (368) = happyShift action_307 action_200 (373) = happyShift action_285 action_200 (374) = happyShift action_286 action_200 (247) = happyGoto action_440 action_200 (248) = happyGoto action_274 action_200 (250) = happyGoto action_275 action_200 (254) = happyGoto action_441 action_200 (258) = happyGoto action_442 action_200 _ = happyFail action_201 (364) = happyShift action_341 action_201 (368) = happyShift action_307 action_201 (258) = happyGoto action_612 action_201 _ = happyFail action_202 (331) = happyShift action_610 action_202 (367) = happyShift action_611 action_202 _ = happyFail action_203 _ = happyReduce_218 action_204 (357) = happyShift action_604 action_204 (383) = happyShift action_605 action_204 (98) = happyGoto action_609 action_204 _ = happyFail action_205 (368) = happyShift action_608 action_205 _ = happyReduce_572 action_206 (331) = happyShift action_606 action_206 (367) = happyShift action_607 action_206 _ = happyFail action_207 _ = happyReduce_223 action_208 (357) = happyShift action_604 action_208 (383) = happyShift action_605 action_208 (98) = happyGoto action_603 action_208 _ = happyFail action_209 (331) = happyShift action_601 action_209 (367) = happyShift action_602 action_209 _ = happyFail action_210 _ = happyReduce_202 action_211 (357) = happyShift action_600 action_211 (89) = happyGoto action_598 action_211 (90) = happyGoto action_599 action_211 _ = happyReduce_205 action_212 (267) = happyShift action_38 action_212 (275) = happyShift action_41 action_212 (287) = happyShift action_47 action_212 (291) = happyShift action_48 action_212 (293) = happyShift action_49 action_212 (294) = happyShift action_50 action_212 (295) = happyShift action_51 action_212 (296) = happyShift action_52 action_212 (297) = happyShift action_53 action_212 (298) = happyShift action_54 action_212 (300) = happyShift action_56 action_212 (301) = happyShift action_57 action_212 (302) = happyShift action_58 action_212 (303) = happyShift action_59 action_212 (304) = happyShift action_60 action_212 (305) = happyShift action_61 action_212 (306) = happyShift action_62 action_212 (309) = happyShift action_64 action_212 (371) = happyShift action_81 action_212 (73) = happyGoto action_596 action_212 (243) = happyGoto action_597 action_212 (249) = happyGoto action_33 action_212 _ = happyReduce_164 action_213 (333) = happyShift action_278 action_213 (369) = happyShift action_595 action_213 (374) = happyShift action_286 action_213 (221) = happyGoto action_594 action_213 (254) = happyGoto action_397 action_213 _ = happyFail action_214 (333) = happyShift action_278 action_214 (362) = happyShift action_306 action_214 (368) = happyShift action_307 action_214 (374) = happyShift action_286 action_214 (254) = happyGoto action_441 action_214 (258) = happyGoto action_442 action_214 _ = happyFail action_215 _ = happyReduce_101 action_216 (302) = happyShift action_588 action_216 (303) = happyShift action_589 action_216 (304) = happyShift action_590 action_216 (305) = happyShift action_591 action_216 (306) = happyShift action_592 action_216 (102) = happyGoto action_593 action_216 _ = happyFail action_217 (302) = happyShift action_588 action_217 (303) = happyShift action_589 action_217 (304) = happyShift action_590 action_217 (305) = happyShift action_591 action_217 (306) = happyShift action_592 action_217 (102) = happyGoto action_587 action_217 _ = happyFail action_218 (267) = happyShift action_38 action_218 (275) = happyShift action_41 action_218 (287) = happyShift action_47 action_218 (293) = happyShift action_49 action_218 (294) = happyShift action_50 action_218 (295) = happyShift action_51 action_218 (296) = happyShift action_231 action_218 (297) = happyShift action_232 action_218 (298) = happyShift action_233 action_218 (302) = happyShift action_58 action_218 (303) = happyShift action_59 action_218 (304) = happyShift action_60 action_218 (305) = happyShift action_61 action_218 (306) = happyShift action_62 action_218 (309) = happyShift action_64 action_218 (323) = happyShift action_236 action_218 (324) = happyShift action_237 action_218 (346) = happyShift action_238 action_218 (353) = happyShift action_239 action_218 (357) = happyShift action_240 action_218 (359) = happyShift action_241 action_218 (361) = happyShift action_242 action_218 (363) = happyShift action_243 action_218 (370) = happyShift action_244 action_218 (371) = happyShift action_245 action_218 (372) = happyShift action_246 action_218 (376) = happyShift action_247 action_218 (380) = happyShift action_248 action_218 (383) = happyShift action_249 action_218 (384) = happyShift action_250 action_218 (403) = happyShift action_251 action_218 (404) = happyShift action_252 action_218 (408) = happyShift action_108 action_218 (409) = happyShift action_109 action_218 (111) = happyGoto action_218 action_218 (118) = happyGoto action_586 action_218 (156) = happyGoto action_222 action_218 (224) = happyGoto action_223 action_218 (225) = happyGoto action_224 action_218 (227) = happyGoto action_225 action_218 (228) = happyGoto action_226 action_218 (237) = happyGoto action_227 action_218 (239) = happyGoto action_228 action_218 (249) = happyGoto action_229 action_218 _ = happyFail action_219 (335) = happyShift action_585 action_219 _ = happyFail action_220 (267) = happyShift action_38 action_220 (275) = happyShift action_41 action_220 (287) = happyShift action_47 action_220 (293) = happyShift action_49 action_220 (294) = happyShift action_50 action_220 (295) = happyShift action_51 action_220 (296) = happyShift action_231 action_220 (297) = happyShift action_232 action_220 (298) = happyShift action_233 action_220 (302) = happyShift action_58 action_220 (303) = happyShift action_59 action_220 (304) = happyShift action_60 action_220 (305) = happyShift action_61 action_220 (306) = happyShift action_62 action_220 (309) = happyShift action_64 action_220 (323) = happyShift action_236 action_220 (324) = happyShift action_237 action_220 (340) = happyShift action_555 action_220 (342) = happyShift action_584 action_220 (345) = happyShift action_493 action_220 (346) = happyShift action_238 action_220 (347) = happyShift action_494 action_220 (352) = happyShift action_557 action_220 (353) = happyShift action_239 action_220 (357) = happyShift action_240 action_220 (359) = happyShift action_241 action_220 (361) = happyShift action_242 action_220 (363) = happyShift action_243 action_220 (369) = happyShift action_558 action_220 (370) = happyShift action_559 action_220 (371) = happyShift action_245 action_220 (372) = happyShift action_246 action_220 (373) = happyShift action_496 action_220 (374) = happyShift action_497 action_220 (376) = happyShift action_247 action_220 (377) = happyShift action_498 action_220 (378) = happyShift action_499 action_220 (380) = happyShift action_248 action_220 (383) = happyShift action_249 action_220 (384) = happyShift action_250 action_220 (403) = happyShift action_251 action_220 (404) = happyShift action_252 action_220 (408) = happyShift action_108 action_220 (409) = happyShift action_109 action_220 (111) = happyGoto action_218 action_220 (118) = happyGoto action_551 action_220 (156) = happyGoto action_222 action_220 (224) = happyGoto action_223 action_220 (225) = happyGoto action_224 action_220 (226) = happyGoto action_552 action_220 (227) = happyGoto action_225 action_220 (228) = happyGoto action_226 action_220 (229) = happyGoto action_553 action_220 (230) = happyGoto action_488 action_220 (237) = happyGoto action_227 action_220 (238) = happyGoto action_554 action_220 (239) = happyGoto action_228 action_220 (249) = happyGoto action_229 action_220 _ = happyReduce_271 action_221 _ = happyReduce_290 action_222 _ = happyReduce_303 action_223 _ = happyReduce_291 action_224 _ = happyReduce_596 action_225 _ = happyReduce_603 action_226 _ = happyReduce_610 action_227 _ = happyReduce_292 action_228 _ = happyReduce_631 action_229 _ = happyReduce_635 action_230 (267) = happyShift action_38 action_230 (275) = happyShift action_41 action_230 (287) = happyShift action_47 action_230 (293) = happyShift action_49 action_230 (294) = happyShift action_50 action_230 (295) = happyShift action_51 action_230 (296) = happyShift action_231 action_230 (297) = happyShift action_232 action_230 (298) = happyShift action_233 action_230 (302) = happyShift action_58 action_230 (303) = happyShift action_59 action_230 (304) = happyShift action_60 action_230 (305) = happyShift action_61 action_230 (306) = happyShift action_62 action_230 (309) = happyShift action_64 action_230 (323) = happyShift action_236 action_230 (324) = happyShift action_237 action_230 (346) = happyShift action_238 action_230 (353) = happyShift action_239 action_230 (357) = happyShift action_240 action_230 (359) = happyShift action_241 action_230 (361) = happyShift action_242 action_230 (363) = happyShift action_243 action_230 (370) = happyShift action_244 action_230 (371) = happyShift action_245 action_230 (372) = happyShift action_246 action_230 (376) = happyShift action_247 action_230 (380) = happyShift action_248 action_230 (383) = happyShift action_249 action_230 (384) = happyShift action_250 action_230 (403) = happyShift action_251 action_230 (404) = happyShift action_252 action_230 (408) = happyShift action_108 action_230 (409) = happyShift action_109 action_230 (59) = happyGoto action_582 action_230 (111) = happyGoto action_218 action_230 (115) = happyGoto action_583 action_230 (117) = happyGoto action_220 action_230 (118) = happyGoto action_221 action_230 (156) = happyGoto action_222 action_230 (224) = happyGoto action_223 action_230 (225) = happyGoto action_224 action_230 (227) = happyGoto action_225 action_230 (228) = happyGoto action_226 action_230 (237) = happyGoto action_227 action_230 (239) = happyGoto action_228 action_230 (249) = happyGoto action_229 action_230 _ = happyFail action_231 _ = happyReduce_637 action_232 _ = happyReduce_638 action_233 _ = happyReduce_636 action_234 (267) = happyShift action_38 action_234 (275) = happyShift action_41 action_234 (287) = happyShift action_47 action_234 (293) = happyShift action_49 action_234 (294) = happyShift action_50 action_234 (295) = happyShift action_51 action_234 (296) = happyShift action_231 action_234 (297) = happyShift action_232 action_234 (298) = happyShift action_233 action_234 (302) = happyShift action_58 action_234 (303) = happyShift action_59 action_234 (304) = happyShift action_60 action_234 (305) = happyShift action_61 action_234 (306) = happyShift action_62 action_234 (309) = happyShift action_64 action_234 (323) = happyShift action_236 action_234 (324) = happyShift action_237 action_234 (346) = happyShift action_238 action_234 (353) = happyShift action_239 action_234 (357) = happyShift action_240 action_234 (359) = happyShift action_241 action_234 (361) = happyShift action_242 action_234 (363) = happyShift action_243 action_234 (370) = happyShift action_244 action_234 (371) = happyShift action_245 action_234 (372) = happyShift action_246 action_234 (376) = happyShift action_247 action_234 (380) = happyShift action_248 action_234 (383) = happyShift action_249 action_234 (384) = happyShift action_250 action_234 (403) = happyShift action_251 action_234 (404) = happyShift action_252 action_234 (408) = happyShift action_108 action_234 (409) = happyShift action_109 action_234 (111) = happyGoto action_218 action_234 (115) = happyGoto action_581 action_234 (117) = happyGoto action_220 action_234 (118) = happyGoto action_221 action_234 (156) = happyGoto action_222 action_234 (224) = happyGoto action_223 action_234 (225) = happyGoto action_224 action_234 (227) = happyGoto action_225 action_234 (228) = happyGoto action_226 action_234 (237) = happyGoto action_227 action_234 (239) = happyGoto action_228 action_234 (249) = happyGoto action_229 action_234 _ = happyFail action_235 (361) = happyShift action_580 action_235 (372) = happyShift action_246 action_235 (376) = happyShift action_247 action_235 (380) = happyShift action_248 action_235 (225) = happyGoto action_579 action_235 (227) = happyGoto action_225 action_235 (228) = happyGoto action_226 action_235 _ = happyFail action_236 (331) = happyShift action_578 action_236 _ = happyFail action_237 (331) = happyShift action_577 action_237 _ = happyFail action_238 _ = happyReduce_256 action_239 (354) = happyReduce_362 action_239 (392) = happyShift action_154 action_239 (142) = happyGoto action_572 action_239 (143) = happyGoto action_573 action_239 (144) = happyGoto action_574 action_239 (259) = happyGoto action_575 action_239 (265) = happyGoto action_576 action_239 _ = happyReduce_709 action_240 (267) = happyShift action_38 action_240 (275) = happyShift action_41 action_240 (287) = happyShift action_47 action_240 (291) = happyShift action_260 action_240 (293) = happyShift action_49 action_240 (294) = happyShift action_50 action_240 (295) = happyShift action_51 action_240 (296) = happyShift action_231 action_240 (297) = happyShift action_232 action_240 (298) = happyShift action_233 action_240 (302) = happyShift action_58 action_240 (303) = happyShift action_59 action_240 (304) = happyShift action_60 action_240 (305) = happyShift action_61 action_240 (306) = happyShift action_62 action_240 (309) = happyShift action_64 action_240 (323) = happyShift action_236 action_240 (324) = happyShift action_237 action_240 (346) = happyShift action_238 action_240 (353) = happyShift action_239 action_240 (357) = happyShift action_240 action_240 (358) = happyShift action_501 action_240 (359) = happyShift action_241 action_240 (361) = happyShift action_242 action_240 (363) = happyShift action_243 action_240 (370) = happyShift action_244 action_240 (371) = happyShift action_245 action_240 (372) = happyShift action_246 action_240 (376) = happyShift action_247 action_240 (380) = happyShift action_248 action_240 (381) = happyShift action_87 action_240 (383) = happyShift action_249 action_240 (384) = happyShift action_250 action_240 (403) = happyShift action_251 action_240 (404) = happyShift action_252 action_240 (408) = happyShift action_108 action_240 (409) = happyShift action_109 action_240 (111) = happyGoto action_218 action_240 (112) = happyGoto action_571 action_240 (114) = happyGoto action_255 action_240 (115) = happyGoto action_256 action_240 (117) = happyGoto action_257 action_240 (118) = happyGoto action_221 action_240 (156) = happyGoto action_222 action_240 (210) = happyGoto action_259 action_240 (224) = happyGoto action_223 action_240 (225) = happyGoto action_224 action_240 (227) = happyGoto action_225 action_240 (228) = happyGoto action_226 action_240 (237) = happyGoto action_227 action_240 (239) = happyGoto action_228 action_240 (249) = happyGoto action_229 action_240 _ = happyFail action_241 (267) = happyShift action_38 action_241 (275) = happyShift action_41 action_241 (287) = happyShift action_47 action_241 (291) = happyShift action_260 action_241 (293) = happyShift action_49 action_241 (294) = happyShift action_50 action_241 (295) = happyShift action_51 action_241 (296) = happyShift action_231 action_241 (297) = happyShift action_232 action_241 (298) = happyShift action_233 action_241 (302) = happyShift action_58 action_241 (303) = happyShift action_59 action_241 (304) = happyShift action_60 action_241 (305) = happyShift action_61 action_241 (306) = happyShift action_62 action_241 (309) = happyShift action_64 action_241 (323) = happyShift action_236 action_241 (324) = happyShift action_237 action_241 (346) = happyShift action_238 action_241 (353) = happyShift action_239 action_241 (357) = happyShift action_240 action_241 (359) = happyShift action_241 action_241 (360) = happyShift action_500 action_241 (361) = happyShift action_242 action_241 (363) = happyShift action_243 action_241 (370) = happyShift action_244 action_241 (371) = happyShift action_245 action_241 (372) = happyShift action_246 action_241 (376) = happyShift action_247 action_241 (380) = happyShift action_248 action_241 (381) = happyShift action_87 action_241 (383) = happyShift action_249 action_241 (384) = happyShift action_250 action_241 (403) = happyShift action_251 action_241 (404) = happyShift action_252 action_241 (408) = happyShift action_108 action_241 (409) = happyShift action_109 action_241 (111) = happyGoto action_218 action_241 (112) = happyGoto action_570 action_241 (114) = happyGoto action_255 action_241 (115) = happyGoto action_256 action_241 (117) = happyGoto action_257 action_241 (118) = happyGoto action_221 action_241 (156) = happyGoto action_222 action_241 (210) = happyGoto action_259 action_241 (224) = happyGoto action_223 action_241 (225) = happyGoto action_224 action_241 (227) = happyGoto action_225 action_241 (228) = happyGoto action_226 action_241 (237) = happyGoto action_227 action_241 (239) = happyGoto action_228 action_241 (249) = happyGoto action_229 action_241 _ = happyFail action_242 (267) = happyShift action_38 action_242 (275) = happyShift action_41 action_242 (287) = happyShift action_47 action_242 (291) = happyShift action_260 action_242 (293) = happyShift action_49 action_242 (294) = happyShift action_50 action_242 (295) = happyShift action_51 action_242 (296) = happyShift action_231 action_242 (297) = happyShift action_232 action_242 (298) = happyShift action_233 action_242 (302) = happyShift action_58 action_242 (303) = happyShift action_59 action_242 (304) = happyShift action_60 action_242 (305) = happyShift action_61 action_242 (306) = happyShift action_62 action_242 (309) = happyShift action_64 action_242 (323) = happyShift action_236 action_242 (324) = happyShift action_237 action_242 (340) = happyShift action_490 action_242 (342) = happyShift action_491 action_242 (343) = happyShift action_492 action_242 (345) = happyShift action_493 action_242 (346) = happyShift action_238 action_242 (347) = happyShift action_494 action_242 (353) = happyShift action_239 action_242 (357) = happyShift action_240 action_242 (359) = happyShift action_241 action_242 (361) = happyShift action_242 action_242 (362) = happyShift action_569 action_242 (363) = happyShift action_243 action_242 (368) = happyShift action_307 action_242 (370) = happyShift action_244 action_242 (371) = happyShift action_245 action_242 (372) = happyShift action_246 action_242 (373) = happyShift action_496 action_242 (374) = happyShift action_497 action_242 (376) = happyShift action_247 action_242 (377) = happyShift action_498 action_242 (378) = happyShift action_499 action_242 (380) = happyShift action_248 action_242 (381) = happyShift action_87 action_242 (383) = happyShift action_249 action_242 (384) = happyShift action_250 action_242 (403) = happyShift action_251 action_242 (404) = happyShift action_252 action_242 (408) = happyShift action_108 action_242 (409) = happyShift action_109 action_242 (111) = happyGoto action_218 action_242 (112) = happyGoto action_568 action_242 (114) = happyGoto action_255 action_242 (115) = happyGoto action_256 action_242 (117) = happyGoto action_257 action_242 (118) = happyGoto action_221 action_242 (156) = happyGoto action_222 action_242 (210) = happyGoto action_259 action_242 (224) = happyGoto action_223 action_242 (225) = happyGoto action_224 action_242 (227) = happyGoto action_225 action_242 (228) = happyGoto action_226 action_242 (229) = happyGoto action_487 action_242 (230) = happyGoto action_488 action_242 (237) = happyGoto action_227 action_242 (239) = happyGoto action_228 action_242 (249) = happyGoto action_229 action_242 (258) = happyGoto action_489 action_242 _ = happyFail action_243 (267) = happyShift action_38 action_243 (275) = happyShift action_41 action_243 (287) = happyShift action_47 action_243 (291) = happyShift action_260 action_243 (293) = happyShift action_49 action_243 (294) = happyShift action_50 action_243 (295) = happyShift action_51 action_243 (296) = happyShift action_231 action_243 (297) = happyShift action_232 action_243 (298) = happyShift action_233 action_243 (302) = happyShift action_58 action_243 (303) = happyShift action_59 action_243 (304) = happyShift action_60 action_243 (305) = happyShift action_61 action_243 (306) = happyShift action_62 action_243 (309) = happyShift action_64 action_243 (323) = happyShift action_236 action_243 (324) = happyShift action_237 action_243 (346) = happyShift action_238 action_243 (353) = happyShift action_239 action_243 (357) = happyShift action_240 action_243 (359) = happyShift action_241 action_243 (361) = happyShift action_242 action_243 (363) = happyShift action_243 action_243 (364) = happyShift action_567 action_243 (368) = happyShift action_307 action_243 (370) = happyShift action_244 action_243 (371) = happyShift action_245 action_243 (372) = happyShift action_246 action_243 (376) = happyShift action_247 action_243 (380) = happyShift action_248 action_243 (381) = happyShift action_87 action_243 (383) = happyShift action_249 action_243 (384) = happyShift action_250 action_243 (403) = happyShift action_251 action_243 (404) = happyShift action_252 action_243 (408) = happyShift action_108 action_243 (409) = happyShift action_109 action_243 (111) = happyGoto action_218 action_243 (112) = happyGoto action_540 action_243 (114) = happyGoto action_255 action_243 (115) = happyGoto action_256 action_243 (117) = happyGoto action_257 action_243 (118) = happyGoto action_221 action_243 (122) = happyGoto action_566 action_243 (156) = happyGoto action_222 action_243 (210) = happyGoto action_259 action_243 (224) = happyGoto action_223 action_243 (225) = happyGoto action_224 action_243 (227) = happyGoto action_225 action_243 (228) = happyGoto action_226 action_243 (237) = happyGoto action_227 action_243 (239) = happyGoto action_228 action_243 (249) = happyGoto action_229 action_243 (258) = happyGoto action_485 action_243 _ = happyFail action_244 (267) = happyShift action_38 action_244 (275) = happyShift action_41 action_244 (287) = happyShift action_47 action_244 (291) = happyShift action_48 action_244 (293) = happyShift action_49 action_244 (294) = happyShift action_50 action_244 (295) = happyShift action_51 action_244 (296) = happyShift action_52 action_244 (297) = happyShift action_53 action_244 (298) = happyShift action_54 action_244 (300) = happyShift action_56 action_244 (301) = happyShift action_57 action_244 (302) = happyShift action_58 action_244 (303) = happyShift action_59 action_244 (304) = happyShift action_60 action_244 (305) = happyShift action_61 action_244 (306) = happyShift action_62 action_244 (309) = happyShift action_64 action_244 (357) = happyShift action_564 action_244 (361) = happyShift action_565 action_244 (363) = happyShift action_201 action_244 (371) = happyShift action_81 action_244 (372) = happyShift action_82 action_244 (376) = happyShift action_84 action_244 (380) = happyShift action_86 action_244 (217) = happyGoto action_562 action_244 (220) = happyGoto action_28 action_244 (240) = happyGoto action_563 action_244 (243) = happyGoto action_195 action_244 (249) = happyGoto action_33 action_244 (251) = happyGoto action_34 action_244 (252) = happyGoto action_35 action_244 _ = happyFail action_245 _ = happyReduce_634 action_246 _ = happyReduce_611 action_247 _ = happyReduce_608 action_248 _ = happyReduce_609 action_249 _ = happyReduce_312 action_250 _ = happyReduce_311 action_251 _ = happyReduce_305 action_252 (266) = happyShift action_37 action_252 (267) = happyShift action_38 action_252 (268) = happyShift action_39 action_252 (273) = happyShift action_40 action_252 (275) = happyShift action_41 action_252 (276) = happyShift action_42 action_252 (283) = happyShift action_46 action_252 (287) = happyShift action_47 action_252 (291) = happyShift action_48 action_252 (293) = happyShift action_49 action_252 (294) = happyShift action_50 action_252 (295) = happyShift action_51 action_252 (296) = happyShift action_52 action_252 (297) = happyShift action_53 action_252 (298) = happyShift action_54 action_252 (299) = happyShift action_55 action_252 (300) = happyShift action_56 action_252 (301) = happyShift action_57 action_252 (302) = happyShift action_58 action_252 (303) = happyShift action_59 action_252 (304) = happyShift action_60 action_252 (305) = happyShift action_61 action_252 (306) = happyShift action_62 action_252 (307) = happyShift action_63 action_252 (309) = happyShift action_64 action_252 (318) = happyShift action_68 action_252 (319) = happyShift action_69 action_252 (320) = happyShift action_70 action_252 (336) = happyShift action_72 action_252 (342) = happyShift action_73 action_252 (345) = happyShift action_74 action_252 (357) = happyShift action_75 action_252 (359) = happyShift action_76 action_252 (361) = happyShift action_118 action_252 (363) = happyShift action_78 action_252 (365) = happyShift action_79 action_252 (370) = happyShift action_80 action_252 (371) = happyShift action_81 action_252 (372) = happyShift action_82 action_252 (375) = happyShift action_83 action_252 (376) = happyShift action_84 action_252 (379) = happyShift action_85 action_252 (380) = happyShift action_86 action_252 (381) = happyShift action_87 action_252 (382) = happyShift action_88 action_252 (383) = happyShift action_89 action_252 (384) = happyShift action_90 action_252 (385) = happyShift action_91 action_252 (386) = happyShift action_92 action_252 (387) = happyShift action_93 action_252 (388) = happyShift action_94 action_252 (389) = happyShift action_95 action_252 (390) = happyShift action_96 action_252 (391) = happyShift action_97 action_252 (396) = happyShift action_98 action_252 (397) = happyShift action_99 action_252 (398) = happyShift action_100 action_252 (399) = happyShift action_101 action_252 (401) = happyShift action_102 action_252 (403) = happyShift action_103 action_252 (404) = happyShift action_104 action_252 (405) = happyShift action_105 action_252 (406) = happyShift action_106 action_252 (407) = happyShift action_107 action_252 (408) = happyShift action_108 action_252 (409) = happyShift action_109 action_252 (38) = happyGoto action_13 action_252 (156) = happyGoto action_16 action_252 (157) = happyGoto action_561 action_252 (158) = happyGoto action_116 action_252 (159) = happyGoto action_18 action_252 (161) = happyGoto action_19 action_252 (162) = happyGoto action_20 action_252 (163) = happyGoto action_21 action_252 (164) = happyGoto action_22 action_252 (165) = happyGoto action_23 action_252 (166) = happyGoto action_24 action_252 (167) = happyGoto action_25 action_252 (210) = happyGoto action_26 action_252 (217) = happyGoto action_27 action_252 (220) = happyGoto action_28 action_252 (241) = happyGoto action_30 action_252 (242) = happyGoto action_31 action_252 (243) = happyGoto action_117 action_252 (249) = happyGoto action_33 action_252 (251) = happyGoto action_34 action_252 (252) = happyGoto action_35 action_252 (255) = happyGoto action_36 action_252 _ = happyFail action_253 _ = happyReduce_313 action_254 _ = happyReduce_250 action_255 (344) = happyShift action_560 action_255 _ = happyFail action_256 _ = happyReduce_264 action_257 (267) = happyShift action_38 action_257 (275) = happyShift action_41 action_257 (287) = happyShift action_47 action_257 (293) = happyShift action_49 action_257 (294) = happyShift action_50 action_257 (295) = happyShift action_51 action_257 (296) = happyShift action_231 action_257 (297) = happyShift action_232 action_257 (298) = happyShift action_233 action_257 (302) = happyShift action_58 action_257 (303) = happyShift action_59 action_257 (304) = happyShift action_60 action_257 (305) = happyShift action_61 action_257 (306) = happyShift action_62 action_257 (309) = happyShift action_64 action_257 (323) = happyShift action_236 action_257 (324) = happyShift action_237 action_257 (340) = happyShift action_555 action_257 (342) = happyShift action_556 action_257 (344) = happyReduce_270 action_257 (345) = happyShift action_493 action_257 (346) = happyShift action_238 action_257 (347) = happyShift action_494 action_257 (352) = happyShift action_557 action_257 (353) = happyShift action_239 action_257 (357) = happyShift action_240 action_257 (359) = happyShift action_241 action_257 (361) = happyShift action_242 action_257 (363) = happyShift action_243 action_257 (369) = happyShift action_558 action_257 (370) = happyShift action_559 action_257 (371) = happyShift action_245 action_257 (372) = happyShift action_246 action_257 (373) = happyShift action_496 action_257 (374) = happyShift action_497 action_257 (376) = happyShift action_247 action_257 (377) = happyShift action_498 action_257 (378) = happyShift action_499 action_257 (380) = happyShift action_248 action_257 (383) = happyShift action_249 action_257 (384) = happyShift action_250 action_257 (403) = happyShift action_251 action_257 (404) = happyShift action_252 action_257 (408) = happyShift action_108 action_257 (409) = happyShift action_109 action_257 (111) = happyGoto action_218 action_257 (118) = happyGoto action_551 action_257 (156) = happyGoto action_222 action_257 (224) = happyGoto action_223 action_257 (225) = happyGoto action_224 action_257 (226) = happyGoto action_552 action_257 (227) = happyGoto action_225 action_257 (228) = happyGoto action_226 action_257 (229) = happyGoto action_553 action_257 (230) = happyGoto action_488 action_257 (237) = happyGoto action_227 action_257 (238) = happyGoto action_554 action_257 (239) = happyGoto action_228 action_257 (249) = happyGoto action_229 action_257 _ = happyReduce_271 action_258 (290) = happyShift action_550 action_258 (82) = happyGoto action_549 action_258 _ = happyReduce_188 action_259 (334) = happyShift action_548 action_259 _ = happyFail action_260 (267) = happyShift action_38 action_260 (275) = happyShift action_41 action_260 (287) = happyShift action_47 action_260 (293) = happyShift action_49 action_260 (294) = happyShift action_50 action_260 (295) = happyShift action_51 action_260 (296) = happyShift action_231 action_260 (297) = happyShift action_232 action_260 (298) = happyShift action_233 action_260 (302) = happyShift action_58 action_260 (303) = happyShift action_59 action_260 (304) = happyShift action_60 action_260 (305) = happyShift action_61 action_260 (306) = happyShift action_62 action_260 (309) = happyShift action_64 action_260 (361) = happyShift action_547 action_260 (371) = happyShift action_245 action_260 (123) = happyGoto action_544 action_260 (124) = happyGoto action_545 action_260 (237) = happyGoto action_546 action_260 (239) = happyGoto action_228 action_260 (249) = happyGoto action_229 action_260 _ = happyReduce_321 action_261 (267) = happyShift action_38 action_261 (275) = happyShift action_41 action_261 (287) = happyShift action_47 action_261 (291) = happyShift action_260 action_261 (293) = happyShift action_49 action_261 (294) = happyShift action_50 action_261 (295) = happyShift action_51 action_261 (296) = happyShift action_231 action_261 (297) = happyShift action_232 action_261 (298) = happyShift action_233 action_261 (302) = happyShift action_58 action_261 (303) = happyShift action_59 action_261 (304) = happyShift action_60 action_261 (305) = happyShift action_61 action_261 (306) = happyShift action_62 action_261 (309) = happyShift action_64 action_261 (323) = happyShift action_236 action_261 (324) = happyShift action_237 action_261 (346) = happyShift action_238 action_261 (353) = happyShift action_239 action_261 (357) = happyShift action_240 action_261 (359) = happyShift action_241 action_261 (361) = happyShift action_242 action_261 (363) = happyShift action_243 action_261 (370) = happyShift action_244 action_261 (371) = happyShift action_245 action_261 (372) = happyShift action_246 action_261 (376) = happyShift action_247 action_261 (380) = happyShift action_248 action_261 (381) = happyShift action_87 action_261 (383) = happyShift action_249 action_261 (384) = happyShift action_250 action_261 (403) = happyShift action_251 action_261 (404) = happyShift action_252 action_261 (408) = happyShift action_108 action_261 (409) = happyShift action_109 action_261 (107) = happyGoto action_253 action_261 (111) = happyGoto action_218 action_261 (112) = happyGoto action_254 action_261 (114) = happyGoto action_255 action_261 (115) = happyGoto action_256 action_261 (117) = happyGoto action_257 action_261 (118) = happyGoto action_221 action_261 (119) = happyGoto action_543 action_261 (156) = happyGoto action_222 action_261 (210) = happyGoto action_259 action_261 (224) = happyGoto action_223 action_261 (225) = happyGoto action_224 action_261 (227) = happyGoto action_225 action_261 (228) = happyGoto action_226 action_261 (237) = happyGoto action_227 action_261 (239) = happyGoto action_228 action_261 (249) = happyGoto action_229 action_261 _ = happyFail action_262 (267) = happyShift action_38 action_262 (275) = happyShift action_41 action_262 (287) = happyShift action_47 action_262 (291) = happyShift action_260 action_262 (293) = happyShift action_49 action_262 (294) = happyShift action_50 action_262 (295) = happyShift action_51 action_262 (296) = happyShift action_231 action_262 (297) = happyShift action_232 action_262 (298) = happyShift action_233 action_262 (302) = happyShift action_58 action_262 (303) = happyShift action_59 action_262 (304) = happyShift action_60 action_262 (305) = happyShift action_61 action_262 (306) = happyShift action_62 action_262 (309) = happyShift action_64 action_262 (323) = happyShift action_236 action_262 (324) = happyShift action_237 action_262 (346) = happyShift action_238 action_262 (353) = happyShift action_239 action_262 (357) = happyShift action_240 action_262 (359) = happyShift action_241 action_262 (361) = happyShift action_242 action_262 (363) = happyShift action_243 action_262 (370) = happyShift action_244 action_262 (371) = happyShift action_245 action_262 (372) = happyShift action_246 action_262 (376) = happyShift action_247 action_262 (380) = happyShift action_248 action_262 (381) = happyShift action_87 action_262 (383) = happyShift action_249 action_262 (384) = happyShift action_250 action_262 (403) = happyShift action_251 action_262 (404) = happyShift action_252 action_262 (408) = happyShift action_108 action_262 (409) = happyShift action_109 action_262 (111) = happyGoto action_218 action_262 (112) = happyGoto action_540 action_262 (114) = happyGoto action_255 action_262 (115) = happyGoto action_256 action_262 (117) = happyGoto action_257 action_262 (118) = happyGoto action_221 action_262 (121) = happyGoto action_541 action_262 (122) = happyGoto action_542 action_262 (156) = happyGoto action_222 action_262 (210) = happyGoto action_259 action_262 (224) = happyGoto action_223 action_262 (225) = happyGoto action_224 action_262 (227) = happyGoto action_225 action_262 (228) = happyGoto action_226 action_262 (237) = happyGoto action_227 action_262 (239) = happyGoto action_228 action_262 (249) = happyGoto action_229 action_262 _ = happyReduce_317 action_263 (267) = happyShift action_38 action_263 (275) = happyShift action_41 action_263 (287) = happyShift action_47 action_263 (293) = happyShift action_49 action_263 (294) = happyShift action_50 action_263 (295) = happyShift action_51 action_263 (296) = happyShift action_231 action_263 (297) = happyShift action_232 action_263 (298) = happyShift action_233 action_263 (302) = happyShift action_58 action_263 (303) = happyShift action_59 action_263 (304) = happyShift action_60 action_263 (305) = happyShift action_61 action_263 (306) = happyShift action_62 action_263 (309) = happyShift action_64 action_263 (323) = happyShift action_236 action_263 (324) = happyShift action_237 action_263 (346) = happyShift action_238 action_263 (353) = happyShift action_239 action_263 (357) = happyShift action_240 action_263 (359) = happyShift action_241 action_263 (361) = happyShift action_242 action_263 (363) = happyShift action_243 action_263 (370) = happyShift action_244 action_263 (371) = happyShift action_245 action_263 (372) = happyShift action_246 action_263 (376) = happyShift action_247 action_263 (380) = happyShift action_248 action_263 (383) = happyShift action_249 action_263 (384) = happyShift action_250 action_263 (403) = happyShift action_251 action_263 (404) = happyShift action_252 action_263 (408) = happyShift action_108 action_263 (409) = happyShift action_109 action_263 (111) = happyGoto action_218 action_263 (115) = happyGoto action_539 action_263 (117) = happyGoto action_220 action_263 (118) = happyGoto action_221 action_263 (156) = happyGoto action_222 action_263 (224) = happyGoto action_223 action_263 (225) = happyGoto action_224 action_263 (227) = happyGoto action_225 action_263 (228) = happyGoto action_226 action_263 (237) = happyGoto action_227 action_263 (239) = happyGoto action_228 action_263 (249) = happyGoto action_229 action_263 _ = happyFail action_264 (338) = happyShift action_538 action_264 (125) = happyGoto action_537 action_264 _ = happyReduce_324 action_265 (344) = happyShift action_536 action_265 _ = happyFail action_266 _ = happyReduce_150 action_267 (335) = happyShift action_534 action_267 (338) = happyShift action_535 action_267 (150) = happyGoto action_531 action_267 (151) = happyGoto action_532 action_267 (152) = happyGoto action_533 action_267 _ = happyFail action_268 _ = happyReduce_624 action_269 (266) = happyShift action_37 action_269 (267) = happyShift action_38 action_269 (268) = happyShift action_39 action_269 (273) = happyShift action_40 action_269 (275) = happyShift action_41 action_269 (276) = happyShift action_42 action_269 (283) = happyShift action_46 action_269 (287) = happyShift action_47 action_269 (291) = happyShift action_48 action_269 (293) = happyShift action_49 action_269 (294) = happyShift action_50 action_269 (295) = happyShift action_51 action_269 (296) = happyShift action_52 action_269 (297) = happyShift action_53 action_269 (298) = happyShift action_54 action_269 (299) = happyShift action_55 action_269 (300) = happyShift action_56 action_269 (301) = happyShift action_57 action_269 (302) = happyShift action_58 action_269 (303) = happyShift action_59 action_269 (304) = happyShift action_60 action_269 (305) = happyShift action_61 action_269 (306) = happyShift action_62 action_269 (307) = happyShift action_63 action_269 (309) = happyShift action_64 action_269 (318) = happyShift action_68 action_269 (319) = happyShift action_69 action_269 (320) = happyShift action_70 action_269 (336) = happyShift action_72 action_269 (342) = happyShift action_73 action_269 (345) = happyShift action_74 action_269 (357) = happyShift action_75 action_269 (359) = happyShift action_76 action_269 (361) = happyShift action_118 action_269 (363) = happyShift action_78 action_269 (365) = happyShift action_79 action_269 (370) = happyShift action_80 action_269 (371) = happyShift action_81 action_269 (372) = happyShift action_82 action_269 (375) = happyShift action_83 action_269 (376) = happyShift action_84 action_269 (379) = happyShift action_85 action_269 (380) = happyShift action_86 action_269 (381) = happyShift action_87 action_269 (382) = happyShift action_88 action_269 (383) = happyShift action_89 action_269 (384) = happyShift action_90 action_269 (385) = happyShift action_91 action_269 (386) = happyShift action_92 action_269 (387) = happyShift action_93 action_269 (388) = happyShift action_94 action_269 (389) = happyShift action_95 action_269 (390) = happyShift action_96 action_269 (391) = happyShift action_97 action_269 (396) = happyShift action_98 action_269 (397) = happyShift action_99 action_269 (398) = happyShift action_100 action_269 (399) = happyShift action_101 action_269 (401) = happyShift action_102 action_269 (403) = happyShift action_103 action_269 (404) = happyShift action_104 action_269 (405) = happyShift action_105 action_269 (406) = happyShift action_106 action_269 (407) = happyShift action_107 action_269 (408) = happyShift action_108 action_269 (409) = happyShift action_109 action_269 (38) = happyGoto action_13 action_269 (156) = happyGoto action_16 action_269 (159) = happyGoto action_530 action_269 (161) = happyGoto action_19 action_269 (162) = happyGoto action_20 action_269 (163) = happyGoto action_21 action_269 (164) = happyGoto action_22 action_269 (165) = happyGoto action_23 action_269 (166) = happyGoto action_24 action_269 (167) = happyGoto action_25 action_269 (210) = happyGoto action_26 action_269 (217) = happyGoto action_27 action_269 (220) = happyGoto action_28 action_269 (241) = happyGoto action_30 action_269 (242) = happyGoto action_31 action_269 (243) = happyGoto action_117 action_269 (249) = happyGoto action_33 action_269 (251) = happyGoto action_34 action_269 (252) = happyGoto action_35 action_269 (255) = happyGoto action_36 action_269 _ = happyFail action_270 _ = happyReduce_623 action_271 _ = happyReduce_627 action_272 _ = happyReduce_656 action_273 _ = happyReduce_655 action_274 _ = happyReduce_660 action_275 _ = happyReduce_663 action_276 _ = happyReduce_591 action_277 _ = happyReduce_683 action_278 _ = happyReduce_686 action_279 (267) = happyShift action_38 action_279 (275) = happyShift action_41 action_279 (287) = happyShift action_47 action_279 (291) = happyShift action_529 action_279 (293) = happyShift action_49 action_279 (294) = happyShift action_50 action_279 (295) = happyShift action_51 action_279 (296) = happyShift action_231 action_279 (297) = happyShift action_232 action_279 (298) = happyShift action_233 action_279 (302) = happyShift action_58 action_279 (303) = happyShift action_59 action_279 (304) = happyShift action_60 action_279 (305) = happyShift action_61 action_279 (306) = happyShift action_62 action_279 (309) = happyShift action_64 action_279 (323) = happyShift action_236 action_279 (324) = happyShift action_237 action_279 (346) = happyShift action_238 action_279 (353) = happyShift action_239 action_279 (357) = happyShift action_240 action_279 (359) = happyShift action_241 action_279 (361) = happyShift action_242 action_279 (363) = happyShift action_243 action_279 (370) = happyShift action_244 action_279 (371) = happyShift action_245 action_279 (372) = happyShift action_246 action_279 (376) = happyShift action_247 action_279 (380) = happyShift action_248 action_279 (381) = happyShift action_87 action_279 (383) = happyShift action_249 action_279 (384) = happyShift action_250 action_279 (403) = happyShift action_251 action_279 (404) = happyShift action_252 action_279 (408) = happyShift action_108 action_279 (409) = happyShift action_109 action_279 (107) = happyGoto action_525 action_279 (108) = happyGoto action_399 action_279 (111) = happyGoto action_218 action_279 (112) = happyGoto action_254 action_279 (113) = happyGoto action_400 action_279 (114) = happyGoto action_526 action_279 (115) = happyGoto action_256 action_279 (116) = happyGoto action_402 action_279 (117) = happyGoto action_527 action_279 (118) = happyGoto action_221 action_279 (156) = happyGoto action_222 action_279 (210) = happyGoto action_528 action_279 (224) = happyGoto action_223 action_279 (225) = happyGoto action_224 action_279 (227) = happyGoto action_225 action_279 (228) = happyGoto action_226 action_279 (237) = happyGoto action_227 action_279 (239) = happyGoto action_228 action_279 (249) = happyGoto action_229 action_279 _ = happyFail action_280 _ = happyReduce_661 action_281 _ = happyReduce_676 action_282 _ = happyReduce_678 action_283 _ = happyReduce_677 action_284 (267) = happyShift action_38 action_284 (275) = happyShift action_41 action_284 (287) = happyShift action_47 action_284 (291) = happyShift action_48 action_284 (293) = happyShift action_49 action_284 (294) = happyShift action_50 action_284 (295) = happyShift action_51 action_284 (296) = happyShift action_52 action_284 (297) = happyShift action_53 action_284 (298) = happyShift action_54 action_284 (300) = happyShift action_56 action_284 (301) = happyShift action_57 action_284 (302) = happyShift action_58 action_284 (303) = happyShift action_59 action_284 (304) = happyShift action_60 action_284 (305) = happyShift action_61 action_284 (306) = happyShift action_62 action_284 (309) = happyShift action_64 action_284 (371) = happyShift action_81 action_284 (372) = happyShift action_82 action_284 (375) = happyShift action_83 action_284 (376) = happyShift action_84 action_284 (379) = happyShift action_85 action_284 (380) = happyShift action_86 action_284 (242) = happyGoto action_524 action_284 (243) = happyGoto action_117 action_284 (249) = happyGoto action_33 action_284 (251) = happyGoto action_511 action_284 (252) = happyGoto action_35 action_284 _ = happyFail action_285 _ = happyReduce_662 action_286 _ = happyReduce_685 action_287 _ = happyReduce_659 action_288 _ = happyReduce_684 action_289 (267) = happyShift action_38 action_289 (275) = happyShift action_41 action_289 (287) = happyShift action_47 action_289 (293) = happyShift action_49 action_289 (294) = happyShift action_50 action_289 (295) = happyShift action_51 action_289 (296) = happyShift action_231 action_289 (297) = happyShift action_232 action_289 (298) = happyShift action_233 action_289 (302) = happyShift action_58 action_289 (303) = happyShift action_59 action_289 (304) = happyShift action_60 action_289 (305) = happyShift action_61 action_289 (306) = happyShift action_62 action_289 (309) = happyShift action_64 action_289 (323) = happyShift action_236 action_289 (324) = happyShift action_237 action_289 (346) = happyShift action_238 action_289 (353) = happyShift action_239 action_289 (357) = happyShift action_240 action_289 (359) = happyShift action_241 action_289 (361) = happyShift action_242 action_289 (363) = happyShift action_243 action_289 (370) = happyShift action_244 action_289 (371) = happyShift action_245 action_289 (372) = happyShift action_246 action_289 (376) = happyShift action_247 action_289 (380) = happyShift action_248 action_289 (383) = happyShift action_249 action_289 (384) = happyShift action_250 action_289 (403) = happyShift action_251 action_289 (404) = happyShift action_252 action_289 (408) = happyShift action_108 action_289 (409) = happyShift action_109 action_289 (65) = happyGoto action_523 action_289 (111) = happyGoto action_218 action_289 (114) = happyGoto action_265 action_289 (115) = happyGoto action_266 action_289 (117) = happyGoto action_257 action_289 (118) = happyGoto action_221 action_289 (156) = happyGoto action_222 action_289 (224) = happyGoto action_223 action_289 (225) = happyGoto action_224 action_289 (227) = happyGoto action_225 action_289 (228) = happyGoto action_226 action_289 (237) = happyGoto action_227 action_289 (239) = happyGoto action_228 action_289 (249) = happyGoto action_229 action_289 _ = happyFail action_290 (330) = happyShift action_291 action_290 (66) = happyGoto action_522 action_290 _ = happyReduce_153 action_291 (383) = happyShift action_521 action_291 _ = happyFail action_292 (340) = happyShift action_520 action_292 _ = happyReduce_471 action_293 (333) = happyShift action_278 action_293 (334) = happyShift action_309 action_293 (345) = happyShift action_280 action_293 (346) = happyShift action_281 action_293 (347) = happyShift action_282 action_293 (348) = happyShift action_310 action_293 (349) = happyShift action_311 action_293 (350) = happyShift action_312 action_293 (351) = happyShift action_313 action_293 (352) = happyShift action_283 action_293 (369) = happyShift action_284 action_293 (373) = happyShift action_285 action_293 (374) = happyShift action_286 action_293 (377) = happyShift action_287 action_293 (378) = happyShift action_288 action_293 (222) = happyGoto action_268 action_293 (233) = happyGoto action_519 action_293 (235) = happyGoto action_270 action_293 (244) = happyGoto action_271 action_293 (246) = happyGoto action_272 action_293 (247) = happyGoto action_273 action_293 (248) = happyGoto action_274 action_293 (250) = happyGoto action_275 action_293 (253) = happyGoto action_276 action_293 (254) = happyGoto action_277 action_293 _ = happyReduce_407 action_294 (362) = happyShift action_518 action_294 (368) = happyShift action_307 action_294 (174) = happyGoto action_467 action_294 (258) = happyGoto action_468 action_294 _ = happyFail action_295 (362) = happyShift action_517 action_295 _ = happyFail action_296 _ = happyReduce_626 action_297 (266) = happyShift action_37 action_297 (267) = happyShift action_38 action_297 (268) = happyShift action_39 action_297 (273) = happyShift action_40 action_297 (275) = happyShift action_41 action_297 (276) = happyShift action_42 action_297 (283) = happyShift action_46 action_297 (287) = happyShift action_47 action_297 (291) = happyShift action_48 action_297 (293) = happyShift action_49 action_297 (294) = happyShift action_50 action_297 (295) = happyShift action_51 action_297 (296) = happyShift action_52 action_297 (297) = happyShift action_53 action_297 (298) = happyShift action_54 action_297 (299) = happyShift action_55 action_297 (300) = happyShift action_56 action_297 (301) = happyShift action_57 action_297 (302) = happyShift action_58 action_297 (303) = happyShift action_59 action_297 (304) = happyShift action_60 action_297 (305) = happyShift action_61 action_297 (306) = happyShift action_62 action_297 (307) = happyShift action_63 action_297 (309) = happyShift action_64 action_297 (318) = happyShift action_68 action_297 (319) = happyShift action_69 action_297 (320) = happyShift action_70 action_297 (336) = happyShift action_72 action_297 (342) = happyShift action_73 action_297 (345) = happyShift action_74 action_297 (357) = happyShift action_75 action_297 (359) = happyShift action_76 action_297 (361) = happyShift action_118 action_297 (363) = happyShift action_78 action_297 (365) = happyShift action_79 action_297 (370) = happyShift action_80 action_297 (371) = happyShift action_81 action_297 (372) = happyShift action_82 action_297 (375) = happyShift action_83 action_297 (376) = happyShift action_84 action_297 (379) = happyShift action_85 action_297 (380) = happyShift action_86 action_297 (381) = happyShift action_87 action_297 (382) = happyShift action_88 action_297 (383) = happyShift action_89 action_297 (384) = happyShift action_90 action_297 (385) = happyShift action_91 action_297 (386) = happyShift action_92 action_297 (387) = happyShift action_93 action_297 (388) = happyShift action_94 action_297 (389) = happyShift action_95 action_297 (390) = happyShift action_96 action_297 (391) = happyShift action_97 action_297 (396) = happyShift action_98 action_297 (397) = happyShift action_99 action_297 (398) = happyShift action_100 action_297 (399) = happyShift action_101 action_297 (401) = happyShift action_102 action_297 (403) = happyShift action_103 action_297 (404) = happyShift action_104 action_297 (405) = happyShift action_105 action_297 (406) = happyShift action_106 action_297 (407) = happyShift action_107 action_297 (408) = happyShift action_108 action_297 (409) = happyShift action_109 action_297 (38) = happyGoto action_13 action_297 (156) = happyGoto action_16 action_297 (158) = happyGoto action_516 action_297 (159) = happyGoto action_18 action_297 (161) = happyGoto action_19 action_297 (162) = happyGoto action_20 action_297 (163) = happyGoto action_21 action_297 (164) = happyGoto action_22 action_297 (165) = happyGoto action_23 action_297 (166) = happyGoto action_24 action_297 (167) = happyGoto action_25 action_297 (210) = happyGoto action_26 action_297 (217) = happyGoto action_27 action_297 (220) = happyGoto action_28 action_297 (241) = happyGoto action_30 action_297 (242) = happyGoto action_31 action_297 (243) = happyGoto action_117 action_297 (249) = happyGoto action_33 action_297 (251) = happyGoto action_34 action_297 (252) = happyGoto action_35 action_297 (255) = happyGoto action_36 action_297 _ = happyFail action_298 _ = happyReduce_625 action_299 _ = happyReduce_629 action_300 (362) = happyShift action_515 action_300 _ = happyReduce_658 action_301 (362) = happyShift action_514 action_301 _ = happyFail action_302 (362) = happyReduce_660 action_302 _ = happyReduce_657 action_303 (362) = happyShift action_513 action_303 _ = happyReduce_591 action_304 (266) = happyShift action_37 action_304 (267) = happyShift action_38 action_304 (268) = happyShift action_39 action_304 (273) = happyShift action_40 action_304 (275) = happyShift action_41 action_304 (276) = happyShift action_42 action_304 (283) = happyShift action_46 action_304 (287) = happyShift action_47 action_304 (291) = happyShift action_48 action_304 (293) = happyShift action_49 action_304 (294) = happyShift action_50 action_304 (295) = happyShift action_51 action_304 (296) = happyShift action_52 action_304 (297) = happyShift action_53 action_304 (298) = happyShift action_54 action_304 (299) = happyShift action_55 action_304 (300) = happyShift action_56 action_304 (301) = happyShift action_57 action_304 (302) = happyShift action_58 action_304 (303) = happyShift action_59 action_304 (304) = happyShift action_60 action_304 (305) = happyShift action_61 action_304 (306) = happyShift action_62 action_304 (307) = happyShift action_63 action_304 (309) = happyShift action_64 action_304 (318) = happyShift action_68 action_304 (319) = happyShift action_69 action_304 (320) = happyShift action_70 action_304 (333) = happyShift action_278 action_304 (336) = happyShift action_72 action_304 (342) = happyShift action_73 action_304 (345) = happyShift action_74 action_304 (346) = happyShift action_281 action_304 (347) = happyShift action_282 action_304 (352) = happyShift action_283 action_304 (357) = happyShift action_75 action_304 (359) = happyShift action_76 action_304 (361) = happyShift action_118 action_304 (362) = happyShift action_512 action_304 (363) = happyShift action_78 action_304 (365) = happyShift action_79 action_304 (368) = happyShift action_465 action_304 (369) = happyShift action_308 action_304 (370) = happyShift action_80 action_304 (371) = happyShift action_81 action_304 (372) = happyShift action_82 action_304 (373) = happyShift action_285 action_304 (374) = happyShift action_286 action_304 (375) = happyShift action_83 action_304 (376) = happyShift action_84 action_304 (377) = happyShift action_287 action_304 (378) = happyShift action_288 action_304 (379) = happyShift action_85 action_304 (380) = happyShift action_86 action_304 (381) = happyShift action_87 action_304 (382) = happyShift action_88 action_304 (383) = happyShift action_89 action_304 (384) = happyShift action_90 action_304 (385) = happyShift action_91 action_304 (386) = happyShift action_92 action_304 (387) = happyShift action_93 action_304 (388) = happyShift action_94 action_304 (389) = happyShift action_95 action_304 (390) = happyShift action_96 action_304 (391) = happyShift action_97 action_304 (396) = happyShift action_98 action_304 (397) = happyShift action_99 action_304 (398) = happyShift action_100 action_304 (399) = happyShift action_101 action_304 (401) = happyShift action_102 action_304 (403) = happyShift action_103 action_304 (404) = happyShift action_104 action_304 (405) = happyShift action_105 action_304 (406) = happyShift action_106 action_304 (407) = happyShift action_107 action_304 (408) = happyShift action_108 action_304 (409) = happyShift action_109 action_304 (38) = happyGoto action_13 action_304 (156) = happyGoto action_16 action_304 (157) = happyGoto action_292 action_304 (158) = happyGoto action_293 action_304 (159) = happyGoto action_18 action_304 (161) = happyGoto action_19 action_304 (162) = happyGoto action_20 action_304 (163) = happyGoto action_21 action_304 (164) = happyGoto action_22 action_304 (165) = happyGoto action_23 action_304 (166) = happyGoto action_24 action_304 (167) = happyGoto action_25 action_304 (172) = happyGoto action_462 action_304 (175) = happyGoto action_463 action_304 (210) = happyGoto action_26 action_304 (217) = happyGoto action_27 action_304 (220) = happyGoto action_28 action_304 (222) = happyGoto action_296 action_304 (234) = happyGoto action_297 action_304 (236) = happyGoto action_298 action_304 (241) = happyGoto action_30 action_304 (242) = happyGoto action_31 action_304 (243) = happyGoto action_117 action_304 (245) = happyGoto action_299 action_304 (246) = happyGoto action_338 action_304 (248) = happyGoto action_339 action_304 (249) = happyGoto action_33 action_304 (250) = happyGoto action_275 action_304 (251) = happyGoto action_34 action_304 (252) = happyGoto action_35 action_304 (253) = happyGoto action_276 action_304 (254) = happyGoto action_277 action_304 (255) = happyGoto action_36 action_304 _ = happyFail action_305 (266) = happyShift action_37 action_305 (267) = happyShift action_38 action_305 (275) = happyShift action_41 action_305 (287) = happyShift action_47 action_305 (291) = happyShift action_48 action_305 (293) = happyShift action_49 action_305 (294) = happyShift action_50 action_305 (295) = happyShift action_51 action_305 (296) = happyShift action_52 action_305 (297) = happyShift action_53 action_305 (298) = happyShift action_54 action_305 (300) = happyShift action_56 action_305 (301) = happyShift action_57 action_305 (302) = happyShift action_58 action_305 (303) = happyShift action_59 action_305 (304) = happyShift action_60 action_305 (305) = happyShift action_61 action_305 (306) = happyShift action_62 action_305 (309) = happyShift action_64 action_305 (342) = happyShift action_73 action_305 (357) = happyShift action_75 action_305 (359) = happyShift action_76 action_305 (361) = happyShift action_118 action_305 (363) = happyShift action_78 action_305 (365) = happyShift action_79 action_305 (370) = happyShift action_80 action_305 (371) = happyShift action_81 action_305 (372) = happyShift action_82 action_305 (375) = happyShift action_83 action_305 (376) = happyShift action_84 action_305 (379) = happyShift action_85 action_305 (380) = happyShift action_86 action_305 (381) = happyShift action_87 action_305 (382) = happyShift action_88 action_305 (383) = happyShift action_89 action_305 (384) = happyShift action_90 action_305 (385) = happyShift action_91 action_305 (386) = happyShift action_92 action_305 (387) = happyShift action_93 action_305 (388) = happyShift action_94 action_305 (389) = happyShift action_95 action_305 (390) = happyShift action_96 action_305 (391) = happyShift action_97 action_305 (396) = happyShift action_98 action_305 (397) = happyShift action_99 action_305 (398) = happyShift action_100 action_305 (399) = happyShift action_101 action_305 (401) = happyShift action_102 action_305 (403) = happyShift action_103 action_305 (404) = happyShift action_104 action_305 (405) = happyShift action_105 action_305 (406) = happyShift action_106 action_305 (407) = happyShift action_107 action_305 (408) = happyShift action_108 action_305 (409) = happyShift action_109 action_305 (38) = happyGoto action_13 action_305 (156) = happyGoto action_16 action_305 (163) = happyGoto action_350 action_305 (164) = happyGoto action_22 action_305 (165) = happyGoto action_23 action_305 (166) = happyGoto action_24 action_305 (167) = happyGoto action_25 action_305 (210) = happyGoto action_26 action_305 (217) = happyGoto action_27 action_305 (220) = happyGoto action_28 action_305 (241) = happyGoto action_30 action_305 (242) = happyGoto action_31 action_305 (243) = happyGoto action_117 action_305 (249) = happyGoto action_33 action_305 (251) = happyGoto action_34 action_305 (252) = happyGoto action_35 action_305 (255) = happyGoto action_36 action_305 _ = happyReduce_661 action_306 _ = happyReduce_584 action_307 _ = happyReduce_700 action_308 (267) = happyShift action_38 action_308 (275) = happyShift action_41 action_308 (287) = happyShift action_47 action_308 (291) = happyShift action_48 action_308 (293) = happyShift action_49 action_308 (294) = happyShift action_50 action_308 (295) = happyShift action_51 action_308 (296) = happyShift action_52 action_308 (297) = happyShift action_53 action_308 (298) = happyShift action_54 action_308 (300) = happyShift action_56 action_308 (301) = happyShift action_57 action_308 (302) = happyShift action_58 action_308 (303) = happyShift action_59 action_308 (304) = happyShift action_60 action_308 (305) = happyShift action_61 action_308 (306) = happyShift action_62 action_308 (309) = happyShift action_64 action_308 (371) = happyShift action_81 action_308 (372) = happyShift action_82 action_308 (375) = happyShift action_83 action_308 (376) = happyShift action_84 action_308 (379) = happyShift action_85 action_308 (380) = happyShift action_86 action_308 (242) = happyGoto action_510 action_308 (243) = happyGoto action_117 action_308 (249) = happyGoto action_33 action_308 (251) = happyGoto action_511 action_308 (252) = happyGoto action_35 action_308 _ = happyFail action_309 (267) = happyShift action_38 action_309 (275) = happyShift action_41 action_309 (287) = happyShift action_47 action_309 (291) = happyShift action_260 action_309 (293) = happyShift action_49 action_309 (294) = happyShift action_50 action_309 (295) = happyShift action_51 action_309 (296) = happyShift action_231 action_309 (297) = happyShift action_232 action_309 (298) = happyShift action_233 action_309 (302) = happyShift action_58 action_309 (303) = happyShift action_59 action_309 (304) = happyShift action_60 action_309 (305) = happyShift action_61 action_309 (306) = happyShift action_62 action_309 (309) = happyShift action_64 action_309 (323) = happyShift action_236 action_309 (324) = happyShift action_237 action_309 (346) = happyShift action_238 action_309 (353) = happyShift action_239 action_309 (357) = happyShift action_240 action_309 (359) = happyShift action_241 action_309 (361) = happyShift action_242 action_309 (363) = happyShift action_243 action_309 (370) = happyShift action_244 action_309 (371) = happyShift action_245 action_309 (372) = happyShift action_246 action_309 (376) = happyShift action_247 action_309 (380) = happyShift action_248 action_309 (381) = happyShift action_87 action_309 (383) = happyShift action_249 action_309 (384) = happyShift action_250 action_309 (403) = happyShift action_251 action_309 (404) = happyShift action_252 action_309 (408) = happyShift action_108 action_309 (409) = happyShift action_109 action_309 (107) = happyGoto action_509 action_309 (111) = happyGoto action_218 action_309 (112) = happyGoto action_254 action_309 (114) = happyGoto action_255 action_309 (115) = happyGoto action_256 action_309 (117) = happyGoto action_257 action_309 (118) = happyGoto action_221 action_309 (156) = happyGoto action_222 action_309 (210) = happyGoto action_259 action_309 (224) = happyGoto action_223 action_309 (225) = happyGoto action_224 action_309 (227) = happyGoto action_225 action_309 (228) = happyGoto action_226 action_309 (237) = happyGoto action_227 action_309 (239) = happyGoto action_228 action_309 (249) = happyGoto action_229 action_309 _ = happyFail action_310 (266) = happyShift action_37 action_310 (267) = happyShift action_38 action_310 (268) = happyShift action_39 action_310 (273) = happyShift action_40 action_310 (275) = happyShift action_41 action_310 (276) = happyShift action_42 action_310 (283) = happyShift action_46 action_310 (287) = happyShift action_47 action_310 (291) = happyShift action_48 action_310 (293) = happyShift action_49 action_310 (294) = happyShift action_50 action_310 (295) = happyShift action_51 action_310 (296) = happyShift action_52 action_310 (297) = happyShift action_53 action_310 (298) = happyShift action_54 action_310 (299) = happyShift action_55 action_310 (300) = happyShift action_56 action_310 (301) = happyShift action_57 action_310 (302) = happyShift action_58 action_310 (303) = happyShift action_59 action_310 (304) = happyShift action_60 action_310 (305) = happyShift action_61 action_310 (306) = happyShift action_62 action_310 (307) = happyShift action_63 action_310 (309) = happyShift action_64 action_310 (318) = happyShift action_68 action_310 (319) = happyShift action_69 action_310 (320) = happyShift action_70 action_310 (336) = happyShift action_72 action_310 (342) = happyShift action_73 action_310 (345) = happyShift action_74 action_310 (357) = happyShift action_75 action_310 (359) = happyShift action_76 action_310 (361) = happyShift action_118 action_310 (363) = happyShift action_78 action_310 (365) = happyShift action_79 action_310 (370) = happyShift action_80 action_310 (371) = happyShift action_81 action_310 (372) = happyShift action_82 action_310 (375) = happyShift action_83 action_310 (376) = happyShift action_84 action_310 (379) = happyShift action_85 action_310 (380) = happyShift action_86 action_310 (381) = happyShift action_87 action_310 (382) = happyShift action_88 action_310 (383) = happyShift action_89 action_310 (384) = happyShift action_90 action_310 (385) = happyShift action_91 action_310 (386) = happyShift action_92 action_310 (387) = happyShift action_93 action_310 (388) = happyShift action_94 action_310 (389) = happyShift action_95 action_310 (390) = happyShift action_96 action_310 (391) = happyShift action_97 action_310 (396) = happyShift action_98 action_310 (397) = happyShift action_99 action_310 (398) = happyShift action_100 action_310 (399) = happyShift action_101 action_310 (401) = happyShift action_102 action_310 (403) = happyShift action_103 action_310 (404) = happyShift action_104 action_310 (405) = happyShift action_105 action_310 (406) = happyShift action_106 action_310 (407) = happyShift action_107 action_310 (408) = happyShift action_108 action_310 (409) = happyShift action_109 action_310 (38) = happyGoto action_13 action_310 (156) = happyGoto action_16 action_310 (157) = happyGoto action_508 action_310 (158) = happyGoto action_116 action_310 (159) = happyGoto action_18 action_310 (161) = happyGoto action_19 action_310 (162) = happyGoto action_20 action_310 (163) = happyGoto action_21 action_310 (164) = happyGoto action_22 action_310 (165) = happyGoto action_23 action_310 (166) = happyGoto action_24 action_310 (167) = happyGoto action_25 action_310 (210) = happyGoto action_26 action_310 (217) = happyGoto action_27 action_310 (220) = happyGoto action_28 action_310 (241) = happyGoto action_30 action_310 (242) = happyGoto action_31 action_310 (243) = happyGoto action_117 action_310 (249) = happyGoto action_33 action_310 (251) = happyGoto action_34 action_310 (252) = happyGoto action_35 action_310 (255) = happyGoto action_36 action_310 _ = happyFail action_311 (266) = happyShift action_37 action_311 (267) = happyShift action_38 action_311 (268) = happyShift action_39 action_311 (273) = happyShift action_40 action_311 (275) = happyShift action_41 action_311 (276) = happyShift action_42 action_311 (283) = happyShift action_46 action_311 (287) = happyShift action_47 action_311 (291) = happyShift action_48 action_311 (293) = happyShift action_49 action_311 (294) = happyShift action_50 action_311 (295) = happyShift action_51 action_311 (296) = happyShift action_52 action_311 (297) = happyShift action_53 action_311 (298) = happyShift action_54 action_311 (299) = happyShift action_55 action_311 (300) = happyShift action_56 action_311 (301) = happyShift action_57 action_311 (302) = happyShift action_58 action_311 (303) = happyShift action_59 action_311 (304) = happyShift action_60 action_311 (305) = happyShift action_61 action_311 (306) = happyShift action_62 action_311 (307) = happyShift action_63 action_311 (309) = happyShift action_64 action_311 (318) = happyShift action_68 action_311 (319) = happyShift action_69 action_311 (320) = happyShift action_70 action_311 (336) = happyShift action_72 action_311 (342) = happyShift action_73 action_311 (345) = happyShift action_74 action_311 (357) = happyShift action_75 action_311 (359) = happyShift action_76 action_311 (361) = happyShift action_118 action_311 (363) = happyShift action_78 action_311 (365) = happyShift action_79 action_311 (370) = happyShift action_80 action_311 (371) = happyShift action_81 action_311 (372) = happyShift action_82 action_311 (375) = happyShift action_83 action_311 (376) = happyShift action_84 action_311 (379) = happyShift action_85 action_311 (380) = happyShift action_86 action_311 (381) = happyShift action_87 action_311 (382) = happyShift action_88 action_311 (383) = happyShift action_89 action_311 (384) = happyShift action_90 action_311 (385) = happyShift action_91 action_311 (386) = happyShift action_92 action_311 (387) = happyShift action_93 action_311 (388) = happyShift action_94 action_311 (389) = happyShift action_95 action_311 (390) = happyShift action_96 action_311 (391) = happyShift action_97 action_311 (396) = happyShift action_98 action_311 (397) = happyShift action_99 action_311 (398) = happyShift action_100 action_311 (399) = happyShift action_101 action_311 (401) = happyShift action_102 action_311 (403) = happyShift action_103 action_311 (404) = happyShift action_104 action_311 (405) = happyShift action_105 action_311 (406) = happyShift action_106 action_311 (407) = happyShift action_107 action_311 (408) = happyShift action_108 action_311 (409) = happyShift action_109 action_311 (38) = happyGoto action_13 action_311 (156) = happyGoto action_16 action_311 (157) = happyGoto action_507 action_311 (158) = happyGoto action_116 action_311 (159) = happyGoto action_18 action_311 (161) = happyGoto action_19 action_311 (162) = happyGoto action_20 action_311 (163) = happyGoto action_21 action_311 (164) = happyGoto action_22 action_311 (165) = happyGoto action_23 action_311 (166) = happyGoto action_24 action_311 (167) = happyGoto action_25 action_311 (210) = happyGoto action_26 action_311 (217) = happyGoto action_27 action_311 (220) = happyGoto action_28 action_311 (241) = happyGoto action_30 action_311 (242) = happyGoto action_31 action_311 (243) = happyGoto action_117 action_311 (249) = happyGoto action_33 action_311 (251) = happyGoto action_34 action_311 (252) = happyGoto action_35 action_311 (255) = happyGoto action_36 action_311 _ = happyFail action_312 (266) = happyShift action_37 action_312 (267) = happyShift action_38 action_312 (268) = happyShift action_39 action_312 (273) = happyShift action_40 action_312 (275) = happyShift action_41 action_312 (276) = happyShift action_42 action_312 (283) = happyShift action_46 action_312 (287) = happyShift action_47 action_312 (291) = happyShift action_48 action_312 (293) = happyShift action_49 action_312 (294) = happyShift action_50 action_312 (295) = happyShift action_51 action_312 (296) = happyShift action_52 action_312 (297) = happyShift action_53 action_312 (298) = happyShift action_54 action_312 (299) = happyShift action_55 action_312 (300) = happyShift action_56 action_312 (301) = happyShift action_57 action_312 (302) = happyShift action_58 action_312 (303) = happyShift action_59 action_312 (304) = happyShift action_60 action_312 (305) = happyShift action_61 action_312 (306) = happyShift action_62 action_312 (307) = happyShift action_63 action_312 (309) = happyShift action_64 action_312 (318) = happyShift action_68 action_312 (319) = happyShift action_69 action_312 (320) = happyShift action_70 action_312 (336) = happyShift action_72 action_312 (342) = happyShift action_73 action_312 (345) = happyShift action_74 action_312 (357) = happyShift action_75 action_312 (359) = happyShift action_76 action_312 (361) = happyShift action_118 action_312 (363) = happyShift action_78 action_312 (365) = happyShift action_79 action_312 (370) = happyShift action_80 action_312 (371) = happyShift action_81 action_312 (372) = happyShift action_82 action_312 (375) = happyShift action_83 action_312 (376) = happyShift action_84 action_312 (379) = happyShift action_85 action_312 (380) = happyShift action_86 action_312 (381) = happyShift action_87 action_312 (382) = happyShift action_88 action_312 (383) = happyShift action_89 action_312 (384) = happyShift action_90 action_312 (385) = happyShift action_91 action_312 (386) = happyShift action_92 action_312 (387) = happyShift action_93 action_312 (388) = happyShift action_94 action_312 (389) = happyShift action_95 action_312 (390) = happyShift action_96 action_312 (391) = happyShift action_97 action_312 (396) = happyShift action_98 action_312 (397) = happyShift action_99 action_312 (398) = happyShift action_100 action_312 (399) = happyShift action_101 action_312 (401) = happyShift action_102 action_312 (403) = happyShift action_103 action_312 (404) = happyShift action_104 action_312 (405) = happyShift action_105 action_312 (406) = happyShift action_106 action_312 (407) = happyShift action_107 action_312 (408) = happyShift action_108 action_312 (409) = happyShift action_109 action_312 (38) = happyGoto action_13 action_312 (156) = happyGoto action_16 action_312 (157) = happyGoto action_506 action_312 (158) = happyGoto action_116 action_312 (159) = happyGoto action_18 action_312 (161) = happyGoto action_19 action_312 (162) = happyGoto action_20 action_312 (163) = happyGoto action_21 action_312 (164) = happyGoto action_22 action_312 (165) = happyGoto action_23 action_312 (166) = happyGoto action_24 action_312 (167) = happyGoto action_25 action_312 (210) = happyGoto action_26 action_312 (217) = happyGoto action_27 action_312 (220) = happyGoto action_28 action_312 (241) = happyGoto action_30 action_312 (242) = happyGoto action_31 action_312 (243) = happyGoto action_117 action_312 (249) = happyGoto action_33 action_312 (251) = happyGoto action_34 action_312 (252) = happyGoto action_35 action_312 (255) = happyGoto action_36 action_312 _ = happyFail action_313 (266) = happyShift action_37 action_313 (267) = happyShift action_38 action_313 (268) = happyShift action_39 action_313 (273) = happyShift action_40 action_313 (275) = happyShift action_41 action_313 (276) = happyShift action_42 action_313 (283) = happyShift action_46 action_313 (287) = happyShift action_47 action_313 (291) = happyShift action_48 action_313 (293) = happyShift action_49 action_313 (294) = happyShift action_50 action_313 (295) = happyShift action_51 action_313 (296) = happyShift action_52 action_313 (297) = happyShift action_53 action_313 (298) = happyShift action_54 action_313 (299) = happyShift action_55 action_313 (300) = happyShift action_56 action_313 (301) = happyShift action_57 action_313 (302) = happyShift action_58 action_313 (303) = happyShift action_59 action_313 (304) = happyShift action_60 action_313 (305) = happyShift action_61 action_313 (306) = happyShift action_62 action_313 (307) = happyShift action_63 action_313 (309) = happyShift action_64 action_313 (318) = happyShift action_68 action_313 (319) = happyShift action_69 action_313 (320) = happyShift action_70 action_313 (336) = happyShift action_72 action_313 (342) = happyShift action_73 action_313 (345) = happyShift action_74 action_313 (357) = happyShift action_75 action_313 (359) = happyShift action_76 action_313 (361) = happyShift action_118 action_313 (363) = happyShift action_78 action_313 (365) = happyShift action_79 action_313 (370) = happyShift action_80 action_313 (371) = happyShift action_81 action_313 (372) = happyShift action_82 action_313 (375) = happyShift action_83 action_313 (376) = happyShift action_84 action_313 (379) = happyShift action_85 action_313 (380) = happyShift action_86 action_313 (381) = happyShift action_87 action_313 (382) = happyShift action_88 action_313 (383) = happyShift action_89 action_313 (384) = happyShift action_90 action_313 (385) = happyShift action_91 action_313 (386) = happyShift action_92 action_313 (387) = happyShift action_93 action_313 (388) = happyShift action_94 action_313 (389) = happyShift action_95 action_313 (390) = happyShift action_96 action_313 (391) = happyShift action_97 action_313 (396) = happyShift action_98 action_313 (397) = happyShift action_99 action_313 (398) = happyShift action_100 action_313 (399) = happyShift action_101 action_313 (401) = happyShift action_102 action_313 (403) = happyShift action_103 action_313 (404) = happyShift action_104 action_313 (405) = happyShift action_105 action_313 (406) = happyShift action_106 action_313 (407) = happyShift action_107 action_313 (408) = happyShift action_108 action_313 (409) = happyShift action_109 action_313 (38) = happyGoto action_13 action_313 (156) = happyGoto action_16 action_313 (157) = happyGoto action_505 action_313 (158) = happyGoto action_116 action_313 (159) = happyGoto action_18 action_313 (161) = happyGoto action_19 action_313 (162) = happyGoto action_20 action_313 (163) = happyGoto action_21 action_313 (164) = happyGoto action_22 action_313 (165) = happyGoto action_23 action_313 (166) = happyGoto action_24 action_313 (167) = happyGoto action_25 action_313 (210) = happyGoto action_26 action_313 (217) = happyGoto action_27 action_313 (220) = happyGoto action_28 action_313 (241) = happyGoto action_30 action_313 (242) = happyGoto action_31 action_313 (243) = happyGoto action_117 action_313 (249) = happyGoto action_33 action_313 (251) = happyGoto action_34 action_313 (252) = happyGoto action_35 action_313 (255) = happyGoto action_36 action_313 _ = happyFail action_314 (372) = happyShift action_503 action_314 (376) = happyShift action_504 action_314 (257) = happyGoto action_502 action_314 _ = happyFail action_315 _ = happyReduce_452 action_316 _ = happyReduce_593 action_317 _ = happyReduce_451 action_318 (358) = happyShift action_501 action_318 _ = happyFail action_319 (360) = happyShift action_500 action_319 _ = happyFail action_320 (340) = happyShift action_490 action_320 (342) = happyShift action_491 action_320 (343) = happyShift action_492 action_320 (345) = happyShift action_493 action_320 (347) = happyShift action_494 action_320 (362) = happyShift action_495 action_320 (368) = happyShift action_307 action_320 (373) = happyShift action_496 action_320 (374) = happyShift action_497 action_320 (377) = happyShift action_498 action_320 (378) = happyShift action_499 action_320 (229) = happyGoto action_487 action_320 (230) = happyGoto action_488 action_320 (258) = happyGoto action_489 action_320 _ = happyFail action_321 (364) = happyShift action_486 action_321 (368) = happyShift action_307 action_321 (258) = happyGoto action_485 action_321 _ = happyFail action_322 (362) = happyShift action_484 action_322 _ = happyFail action_323 (362) = happyShift action_483 action_323 _ = happyFail action_324 (402) = happyShift action_482 action_324 _ = happyFail action_325 (400) = happyShift action_481 action_325 _ = happyFail action_326 (266) = happyShift action_37 action_326 (267) = happyShift action_38 action_326 (268) = happyShift action_39 action_326 (269) = happyShift action_137 action_326 (270) = happyShift action_138 action_326 (271) = happyShift action_139 action_326 (272) = happyShift action_140 action_326 (273) = happyShift action_40 action_326 (275) = happyShift action_41 action_326 (276) = happyShift action_42 action_326 (279) = happyShift action_43 action_326 (280) = happyShift action_44 action_326 (281) = happyShift action_45 action_326 (282) = happyShift action_141 action_326 (283) = happyShift action_46 action_326 (285) = happyShift action_142 action_326 (287) = happyShift action_47 action_326 (289) = happyShift action_143 action_326 (291) = happyShift action_48 action_326 (292) = happyShift action_144 action_326 (293) = happyShift action_49 action_326 (294) = happyShift action_50 action_326 (295) = happyShift action_51 action_326 (296) = happyShift action_52 action_326 (297) = happyShift action_53 action_326 (298) = happyShift action_54 action_326 (299) = happyShift action_55 action_326 (300) = happyShift action_56 action_326 (301) = happyShift action_57 action_326 (302) = happyShift action_58 action_326 (303) = happyShift action_59 action_326 (304) = happyShift action_60 action_326 (305) = happyShift action_61 action_326 (306) = happyShift action_62 action_326 (307) = happyShift action_63 action_326 (309) = happyShift action_64 action_326 (312) = happyShift action_145 action_326 (313) = happyShift action_65 action_326 (314) = happyShift action_66 action_326 (315) = happyShift action_67 action_326 (317) = happyShift action_146 action_326 (318) = happyShift action_68 action_326 (319) = happyShift action_69 action_326 (320) = happyShift action_70 action_326 (321) = happyShift action_147 action_326 (322) = happyShift action_148 action_326 (325) = happyShift action_149 action_326 (326) = happyShift action_150 action_326 (327) = happyShift action_151 action_326 (328) = happyShift action_152 action_326 (329) = happyShift action_71 action_326 (336) = happyShift action_72 action_326 (342) = happyShift action_73 action_326 (345) = happyShift action_74 action_326 (346) = happyShift action_153 action_326 (357) = happyShift action_75 action_326 (359) = happyShift action_76 action_326 (361) = happyShift action_77 action_326 (363) = happyShift action_78 action_326 (365) = happyShift action_79 action_326 (370) = happyShift action_80 action_326 (371) = happyShift action_81 action_326 (372) = happyShift action_82 action_326 (375) = happyShift action_83 action_326 (376) = happyShift action_84 action_326 (379) = happyShift action_85 action_326 (380) = happyShift action_86 action_326 (381) = happyShift action_87 action_326 (382) = happyShift action_88 action_326 (383) = happyShift action_89 action_326 (384) = happyShift action_90 action_326 (385) = happyShift action_91 action_326 (386) = happyShift action_92 action_326 (387) = happyShift action_93 action_326 (388) = happyShift action_94 action_326 (389) = happyShift action_95 action_326 (390) = happyShift action_96 action_326 (391) = happyShift action_97 action_326 (392) = happyShift action_154 action_326 (393) = happyShift action_155 action_326 (394) = happyShift action_156 action_326 (395) = happyShift action_157 action_326 (396) = happyShift action_98 action_326 (397) = happyShift action_99 action_326 (398) = happyShift action_100 action_326 (399) = happyShift action_101 action_326 (401) = happyShift action_102 action_326 (403) = happyShift action_103 action_326 (404) = happyShift action_104 action_326 (405) = happyShift action_105 action_326 (406) = happyShift action_106 action_326 (407) = happyShift action_107 action_326 (408) = happyShift action_108 action_326 (409) = happyShift action_109 action_326 (25) = happyGoto action_476 action_326 (38) = happyGoto action_13 action_326 (49) = happyGoto action_14 action_326 (51) = happyGoto action_477 action_326 (52) = happyGoto action_478 action_326 (53) = happyGoto action_120 action_326 (54) = happyGoto action_121 action_326 (55) = happyGoto action_122 action_326 (63) = happyGoto action_123 action_326 (67) = happyGoto action_124 action_326 (68) = happyGoto action_125 action_326 (72) = happyGoto action_126 action_326 (100) = happyGoto action_127 action_326 (146) = happyGoto action_128 action_326 (147) = happyGoto action_129 action_326 (148) = happyGoto action_130 action_326 (153) = happyGoto action_131 action_326 (156) = happyGoto action_16 action_326 (158) = happyGoto action_132 action_326 (159) = happyGoto action_18 action_326 (161) = happyGoto action_19 action_326 (162) = happyGoto action_20 action_326 (163) = happyGoto action_21 action_326 (164) = happyGoto action_22 action_326 (165) = happyGoto action_23 action_326 (166) = happyGoto action_24 action_326 (167) = happyGoto action_25 action_326 (171) = happyGoto action_480 action_326 (210) = happyGoto action_26 action_326 (217) = happyGoto action_27 action_326 (220) = happyGoto action_28 action_326 (240) = happyGoto action_29 action_326 (241) = happyGoto action_30 action_326 (242) = happyGoto action_31 action_326 (243) = happyGoto action_32 action_326 (249) = happyGoto action_33 action_326 (251) = happyGoto action_34 action_326 (252) = happyGoto action_35 action_326 (255) = happyGoto action_36 action_326 (259) = happyGoto action_133 action_326 (260) = happyGoto action_134 action_326 (261) = happyGoto action_135 action_326 (262) = happyGoto action_136 action_326 _ = happyReduce_469 action_327 (266) = happyShift action_37 action_327 (267) = happyShift action_38 action_327 (268) = happyShift action_39 action_327 (269) = happyShift action_137 action_327 (270) = happyShift action_138 action_327 (271) = happyShift action_139 action_327 (272) = happyShift action_140 action_327 (273) = happyShift action_40 action_327 (275) = happyShift action_41 action_327 (276) = happyShift action_42 action_327 (279) = happyShift action_43 action_327 (280) = happyShift action_44 action_327 (281) = happyShift action_45 action_327 (282) = happyShift action_141 action_327 (283) = happyShift action_46 action_327 (285) = happyShift action_142 action_327 (287) = happyShift action_47 action_327 (289) = happyShift action_143 action_327 (291) = happyShift action_48 action_327 (292) = happyShift action_144 action_327 (293) = happyShift action_49 action_327 (294) = happyShift action_50 action_327 (295) = happyShift action_51 action_327 (296) = happyShift action_52 action_327 (297) = happyShift action_53 action_327 (298) = happyShift action_54 action_327 (299) = happyShift action_55 action_327 (300) = happyShift action_56 action_327 (301) = happyShift action_57 action_327 (302) = happyShift action_58 action_327 (303) = happyShift action_59 action_327 (304) = happyShift action_60 action_327 (305) = happyShift action_61 action_327 (306) = happyShift action_62 action_327 (307) = happyShift action_63 action_327 (309) = happyShift action_64 action_327 (312) = happyShift action_145 action_327 (313) = happyShift action_65 action_327 (314) = happyShift action_66 action_327 (315) = happyShift action_67 action_327 (317) = happyShift action_146 action_327 (318) = happyShift action_68 action_327 (319) = happyShift action_69 action_327 (320) = happyShift action_70 action_327 (321) = happyShift action_147 action_327 (322) = happyShift action_148 action_327 (325) = happyShift action_149 action_327 (326) = happyShift action_150 action_327 (327) = happyShift action_151 action_327 (328) = happyShift action_152 action_327 (329) = happyShift action_71 action_327 (336) = happyShift action_72 action_327 (342) = happyShift action_73 action_327 (345) = happyShift action_74 action_327 (346) = happyShift action_153 action_327 (357) = happyShift action_75 action_327 (359) = happyShift action_76 action_327 (361) = happyShift action_77 action_327 (363) = happyShift action_78 action_327 (365) = happyShift action_79 action_327 (370) = happyShift action_80 action_327 (371) = happyShift action_81 action_327 (372) = happyShift action_82 action_327 (375) = happyShift action_83 action_327 (376) = happyShift action_84 action_327 (379) = happyShift action_85 action_327 (380) = happyShift action_86 action_327 (381) = happyShift action_87 action_327 (382) = happyShift action_88 action_327 (383) = happyShift action_89 action_327 (384) = happyShift action_90 action_327 (385) = happyShift action_91 action_327 (386) = happyShift action_92 action_327 (387) = happyShift action_93 action_327 (388) = happyShift action_94 action_327 (389) = happyShift action_95 action_327 (390) = happyShift action_96 action_327 (391) = happyShift action_97 action_327 (392) = happyShift action_154 action_327 (393) = happyShift action_155 action_327 (394) = happyShift action_156 action_327 (395) = happyShift action_157 action_327 (396) = happyShift action_98 action_327 (397) = happyShift action_99 action_327 (398) = happyShift action_100 action_327 (399) = happyShift action_101 action_327 (401) = happyShift action_102 action_327 (403) = happyShift action_103 action_327 (404) = happyShift action_104 action_327 (405) = happyShift action_105 action_327 (406) = happyShift action_106 action_327 (407) = happyShift action_107 action_327 (408) = happyShift action_108 action_327 (409) = happyShift action_109 action_327 (25) = happyGoto action_476 action_327 (38) = happyGoto action_13 action_327 (49) = happyGoto action_14 action_327 (51) = happyGoto action_477 action_327 (52) = happyGoto action_478 action_327 (53) = happyGoto action_120 action_327 (54) = happyGoto action_121 action_327 (55) = happyGoto action_122 action_327 (63) = happyGoto action_123 action_327 (67) = happyGoto action_124 action_327 (68) = happyGoto action_125 action_327 (72) = happyGoto action_126 action_327 (100) = happyGoto action_127 action_327 (146) = happyGoto action_128 action_327 (147) = happyGoto action_129 action_327 (148) = happyGoto action_130 action_327 (153) = happyGoto action_131 action_327 (156) = happyGoto action_16 action_327 (158) = happyGoto action_132 action_327 (159) = happyGoto action_18 action_327 (161) = happyGoto action_19 action_327 (162) = happyGoto action_20 action_327 (163) = happyGoto action_21 action_327 (164) = happyGoto action_22 action_327 (165) = happyGoto action_23 action_327 (166) = happyGoto action_24 action_327 (167) = happyGoto action_25 action_327 (171) = happyGoto action_479 action_327 (210) = happyGoto action_26 action_327 (217) = happyGoto action_27 action_327 (220) = happyGoto action_28 action_327 (240) = happyGoto action_29 action_327 (241) = happyGoto action_30 action_327 (242) = happyGoto action_31 action_327 (243) = happyGoto action_32 action_327 (249) = happyGoto action_33 action_327 (251) = happyGoto action_34 action_327 (252) = happyGoto action_35 action_327 (255) = happyGoto action_36 action_327 (259) = happyGoto action_133 action_327 (260) = happyGoto action_134 action_327 (261) = happyGoto action_135 action_327 (262) = happyGoto action_136 action_327 _ = happyReduce_469 action_328 (400) = happyShift action_475 action_328 _ = happyFail action_329 (333) = happyShift action_278 action_329 (345) = happyShift action_280 action_329 (346) = happyShift action_281 action_329 (347) = happyShift action_282 action_329 (352) = happyShift action_283 action_329 (369) = happyShift action_284 action_329 (373) = happyShift action_285 action_329 (374) = happyShift action_286 action_329 (377) = happyShift action_287 action_329 (378) = happyShift action_288 action_329 (400) = happyShift action_474 action_329 (222) = happyGoto action_268 action_329 (233) = happyGoto action_269 action_329 (235) = happyGoto action_270 action_329 (244) = happyGoto action_271 action_329 (246) = happyGoto action_272 action_329 (247) = happyGoto action_273 action_329 (248) = happyGoto action_274 action_329 (250) = happyGoto action_275 action_329 (253) = happyGoto action_276 action_329 (254) = happyGoto action_277 action_329 _ = happyFail action_330 (400) = happyShift action_473 action_330 _ = happyFail action_331 _ = happyReduce_450 action_332 _ = happyReduce_449 action_333 (333) = happyShift action_278 action_333 (345) = happyShift action_280 action_333 (346) = happyShift action_281 action_333 (347) = happyShift action_282 action_333 (352) = happyShift action_283 action_333 (362) = happyShift action_306 action_333 (368) = happyShift action_307 action_333 (373) = happyShift action_285 action_333 (374) = happyShift action_286 action_333 (377) = happyShift action_287 action_333 (378) = happyShift action_288 action_333 (246) = happyGoto action_471 action_333 (247) = happyGoto action_301 action_333 (248) = happyGoto action_274 action_333 (250) = happyGoto action_275 action_333 (253) = happyGoto action_472 action_333 (254) = happyGoto action_277 action_333 (258) = happyGoto action_442 action_333 _ = happyFail action_334 (168) = happyGoto action_470 action_334 _ = happyReduce_465 action_335 _ = happyReduce_64 action_336 (364) = happyShift action_469 action_336 (368) = happyShift action_307 action_336 (174) = happyGoto action_467 action_336 (258) = happyGoto action_468 action_336 _ = happyFail action_337 (364) = happyShift action_466 action_337 _ = happyFail action_338 _ = happyReduce_658 action_339 _ = happyReduce_657 action_340 (266) = happyShift action_37 action_340 (267) = happyShift action_38 action_340 (268) = happyShift action_39 action_340 (273) = happyShift action_40 action_340 (275) = happyShift action_41 action_340 (276) = happyShift action_42 action_340 (283) = happyShift action_46 action_340 (287) = happyShift action_47 action_340 (291) = happyShift action_48 action_340 (293) = happyShift action_49 action_340 (294) = happyShift action_50 action_340 (295) = happyShift action_51 action_340 (296) = happyShift action_52 action_340 (297) = happyShift action_53 action_340 (298) = happyShift action_54 action_340 (299) = happyShift action_55 action_340 (300) = happyShift action_56 action_340 (301) = happyShift action_57 action_340 (302) = happyShift action_58 action_340 (303) = happyShift action_59 action_340 (304) = happyShift action_60 action_340 (305) = happyShift action_61 action_340 (306) = happyShift action_62 action_340 (307) = happyShift action_63 action_340 (309) = happyShift action_64 action_340 (318) = happyShift action_68 action_340 (319) = happyShift action_69 action_340 (320) = happyShift action_70 action_340 (333) = happyShift action_278 action_340 (336) = happyShift action_72 action_340 (342) = happyShift action_73 action_340 (345) = happyShift action_74 action_340 (346) = happyShift action_281 action_340 (347) = happyShift action_282 action_340 (352) = happyShift action_283 action_340 (357) = happyShift action_75 action_340 (359) = happyShift action_76 action_340 (361) = happyShift action_118 action_340 (363) = happyShift action_78 action_340 (364) = happyShift action_464 action_340 (365) = happyShift action_79 action_340 (368) = happyShift action_465 action_340 (369) = happyShift action_308 action_340 (370) = happyShift action_80 action_340 (371) = happyShift action_81 action_340 (372) = happyShift action_82 action_340 (373) = happyShift action_285 action_340 (374) = happyShift action_286 action_340 (375) = happyShift action_83 action_340 (376) = happyShift action_84 action_340 (377) = happyShift action_287 action_340 (378) = happyShift action_288 action_340 (379) = happyShift action_85 action_340 (380) = happyShift action_86 action_340 (381) = happyShift action_87 action_340 (382) = happyShift action_88 action_340 (383) = happyShift action_89 action_340 (384) = happyShift action_90 action_340 (385) = happyShift action_91 action_340 (386) = happyShift action_92 action_340 (387) = happyShift action_93 action_340 (388) = happyShift action_94 action_340 (389) = happyShift action_95 action_340 (390) = happyShift action_96 action_340 (391) = happyShift action_97 action_340 (396) = happyShift action_98 action_340 (397) = happyShift action_99 action_340 (398) = happyShift action_100 action_340 (399) = happyShift action_101 action_340 (401) = happyShift action_102 action_340 (403) = happyShift action_103 action_340 (404) = happyShift action_104 action_340 (405) = happyShift action_105 action_340 (406) = happyShift action_106 action_340 (407) = happyShift action_107 action_340 (408) = happyShift action_108 action_340 (409) = happyShift action_109 action_340 (38) = happyGoto action_13 action_340 (156) = happyGoto action_16 action_340 (157) = happyGoto action_292 action_340 (158) = happyGoto action_293 action_340 (159) = happyGoto action_18 action_340 (161) = happyGoto action_19 action_340 (162) = happyGoto action_20 action_340 (163) = happyGoto action_21 action_340 (164) = happyGoto action_22 action_340 (165) = happyGoto action_23 action_340 (166) = happyGoto action_24 action_340 (167) = happyGoto action_25 action_340 (172) = happyGoto action_462 action_340 (175) = happyGoto action_463 action_340 (210) = happyGoto action_26 action_340 (217) = happyGoto action_27 action_340 (220) = happyGoto action_28 action_340 (222) = happyGoto action_296 action_340 (234) = happyGoto action_297 action_340 (236) = happyGoto action_298 action_340 (241) = happyGoto action_30 action_340 (242) = happyGoto action_31 action_340 (243) = happyGoto action_117 action_340 (245) = happyGoto action_299 action_340 (246) = happyGoto action_338 action_340 (248) = happyGoto action_339 action_340 (249) = happyGoto action_33 action_340 (250) = happyGoto action_275 action_340 (251) = happyGoto action_34 action_340 (252) = happyGoto action_35 action_340 (253) = happyGoto action_276 action_340 (254) = happyGoto action_277 action_340 (255) = happyGoto action_36 action_340 _ = happyFail action_341 _ = happyReduce_586 action_342 (362) = happyShift action_461 action_342 _ = happyFail action_343 (332) = happyShift action_458 action_343 (338) = happyShift action_459 action_343 (368) = happyShift action_460 action_343 _ = happyReduce_502 action_344 (368) = happyShift action_452 action_344 _ = happyReduce_503 action_345 (360) = happyShift action_457 action_345 _ = happyFail action_346 (332) = happyShift action_454 action_346 (338) = happyShift action_455 action_346 (368) = happyShift action_456 action_346 _ = happyReduce_481 action_347 (358) = happyShift action_453 action_347 _ = happyFail action_348 (368) = happyShift action_452 action_348 _ = happyReduce_482 action_349 _ = happyReduce_588 action_350 (266) = happyShift action_37 action_350 (267) = happyShift action_38 action_350 (275) = happyShift action_41 action_350 (287) = happyShift action_47 action_350 (291) = happyShift action_48 action_350 (293) = happyShift action_49 action_350 (294) = happyShift action_50 action_350 (295) = happyShift action_51 action_350 (296) = happyShift action_52 action_350 (297) = happyShift action_53 action_350 (298) = happyShift action_54 action_350 (300) = happyShift action_56 action_350 (301) = happyShift action_57 action_350 (302) = happyShift action_58 action_350 (303) = happyShift action_59 action_350 (304) = happyShift action_60 action_350 (305) = happyShift action_61 action_350 (306) = happyShift action_62 action_350 (309) = happyShift action_64 action_350 (342) = happyShift action_73 action_350 (357) = happyShift action_75 action_350 (359) = happyShift action_76 action_350 (361) = happyShift action_118 action_350 (363) = happyShift action_78 action_350 (365) = happyShift action_79 action_350 (370) = happyShift action_80 action_350 (371) = happyShift action_81 action_350 (372) = happyShift action_82 action_350 (375) = happyShift action_83 action_350 (376) = happyShift action_84 action_350 (379) = happyShift action_85 action_350 (380) = happyShift action_86 action_350 (381) = happyShift action_87 action_350 (382) = happyShift action_88 action_350 (383) = happyShift action_89 action_350 (384) = happyShift action_90 action_350 (385) = happyShift action_91 action_350 (386) = happyShift action_92 action_350 (387) = happyShift action_93 action_350 (388) = happyShift action_94 action_350 (389) = happyShift action_95 action_350 (390) = happyShift action_96 action_350 (391) = happyShift action_97 action_350 (396) = happyShift action_98 action_350 (397) = happyShift action_99 action_350 (398) = happyShift action_100 action_350 (399) = happyShift action_101 action_350 (401) = happyShift action_102 action_350 (403) = happyShift action_103 action_350 (404) = happyShift action_104 action_350 (405) = happyShift action_105 action_350 (406) = happyShift action_106 action_350 (407) = happyShift action_107 action_350 (408) = happyShift action_108 action_350 (409) = happyShift action_109 action_350 (38) = happyGoto action_13 action_350 (156) = happyGoto action_16 action_350 (164) = happyGoto action_386 action_350 (165) = happyGoto action_23 action_350 (166) = happyGoto action_24 action_350 (167) = happyGoto action_25 action_350 (210) = happyGoto action_26 action_350 (217) = happyGoto action_27 action_350 (220) = happyGoto action_28 action_350 (241) = happyGoto action_30 action_350 (242) = happyGoto action_31 action_350 (243) = happyGoto action_117 action_350 (249) = happyGoto action_33 action_350 (251) = happyGoto action_34 action_350 (252) = happyGoto action_35 action_350 (255) = happyGoto action_36 action_350 _ = happyReduce_416 action_351 _ = happyReduce_432 action_352 _ = happyReduce_534 action_353 (266) = happyShift action_37 action_353 (267) = happyShift action_38 action_353 (275) = happyShift action_41 action_353 (287) = happyShift action_47 action_353 (291) = happyShift action_48 action_353 (293) = happyShift action_49 action_353 (294) = happyShift action_50 action_353 (295) = happyShift action_51 action_353 (296) = happyShift action_52 action_353 (297) = happyShift action_53 action_353 (298) = happyShift action_54 action_353 (300) = happyShift action_56 action_353 (301) = happyShift action_57 action_353 (302) = happyShift action_58 action_353 (303) = happyShift action_59 action_353 (304) = happyShift action_60 action_353 (305) = happyShift action_61 action_353 (306) = happyShift action_62 action_353 (309) = happyShift action_64 action_353 (342) = happyShift action_73 action_353 (346) = happyShift action_355 action_353 (357) = happyShift action_75 action_353 (359) = happyShift action_76 action_353 (361) = happyShift action_118 action_353 (363) = happyShift action_78 action_353 (365) = happyShift action_79 action_353 (370) = happyShift action_80 action_353 (371) = happyShift action_81 action_353 (372) = happyShift action_82 action_353 (375) = happyShift action_83 action_353 (376) = happyShift action_84 action_353 (379) = happyShift action_85 action_353 (380) = happyShift action_86 action_353 (381) = happyShift action_87 action_353 (382) = happyShift action_88 action_353 (383) = happyShift action_89 action_353 (384) = happyShift action_90 action_353 (385) = happyShift action_91 action_353 (386) = happyShift action_92 action_353 (387) = happyShift action_93 action_353 (388) = happyShift action_94 action_353 (389) = happyShift action_95 action_353 (390) = happyShift action_96 action_353 (391) = happyShift action_97 action_353 (396) = happyShift action_98 action_353 (397) = happyShift action_99 action_353 (398) = happyShift action_100 action_353 (399) = happyShift action_101 action_353 (401) = happyShift action_102 action_353 (403) = happyShift action_103 action_353 (404) = happyShift action_104 action_353 (405) = happyShift action_105 action_353 (406) = happyShift action_106 action_353 (407) = happyShift action_107 action_353 (408) = happyShift action_108 action_353 (409) = happyShift action_109 action_353 (38) = happyGoto action_13 action_353 (156) = happyGoto action_16 action_353 (164) = happyGoto action_352 action_353 (165) = happyGoto action_23 action_353 (166) = happyGoto action_24 action_353 (167) = happyGoto action_25 action_353 (197) = happyGoto action_450 action_353 (198) = happyGoto action_451 action_353 (210) = happyGoto action_26 action_353 (217) = happyGoto action_27 action_353 (220) = happyGoto action_28 action_353 (241) = happyGoto action_30 action_353 (242) = happyGoto action_31 action_353 (243) = happyGoto action_117 action_353 (249) = happyGoto action_33 action_353 (251) = happyGoto action_34 action_353 (252) = happyGoto action_35 action_353 (255) = happyGoto action_36 action_353 _ = happyReduce_537 action_354 (353) = happyShift action_448 action_354 (355) = happyShift action_449 action_354 (185) = happyGoto action_447 action_354 _ = happyFail action_355 (266) = happyShift action_37 action_355 (267) = happyShift action_38 action_355 (275) = happyShift action_41 action_355 (287) = happyShift action_47 action_355 (291) = happyShift action_48 action_355 (293) = happyShift action_49 action_355 (294) = happyShift action_50 action_355 (295) = happyShift action_51 action_355 (296) = happyShift action_52 action_355 (297) = happyShift action_53 action_355 (298) = happyShift action_54 action_355 (300) = happyShift action_56 action_355 (301) = happyShift action_57 action_355 (302) = happyShift action_58 action_355 (303) = happyShift action_59 action_355 (304) = happyShift action_60 action_355 (305) = happyShift action_61 action_355 (306) = happyShift action_62 action_355 (309) = happyShift action_64 action_355 (342) = happyShift action_73 action_355 (357) = happyShift action_75 action_355 (359) = happyShift action_76 action_355 (361) = happyShift action_118 action_355 (363) = happyShift action_78 action_355 (365) = happyShift action_79 action_355 (370) = happyShift action_80 action_355 (371) = happyShift action_81 action_355 (372) = happyShift action_82 action_355 (375) = happyShift action_83 action_355 (376) = happyShift action_84 action_355 (379) = happyShift action_85 action_355 (380) = happyShift action_86 action_355 (381) = happyShift action_87 action_355 (382) = happyShift action_88 action_355 (383) = happyShift action_89 action_355 (384) = happyShift action_90 action_355 (385) = happyShift action_91 action_355 (386) = happyShift action_92 action_355 (387) = happyShift action_93 action_355 (388) = happyShift action_94 action_355 (389) = happyShift action_95 action_355 (390) = happyShift action_96 action_355 (391) = happyShift action_97 action_355 (396) = happyShift action_98 action_355 (397) = happyShift action_99 action_355 (398) = happyShift action_100 action_355 (399) = happyShift action_101 action_355 (401) = happyShift action_102 action_355 (403) = happyShift action_103 action_355 (404) = happyShift action_104 action_355 (405) = happyShift action_105 action_355 (406) = happyShift action_106 action_355 (407) = happyShift action_107 action_355 (408) = happyShift action_108 action_355 (409) = happyShift action_109 action_355 (38) = happyGoto action_13 action_355 (156) = happyGoto action_16 action_355 (164) = happyGoto action_446 action_355 (165) = happyGoto action_23 action_355 (166) = happyGoto action_24 action_355 (167) = happyGoto action_25 action_355 (210) = happyGoto action_26 action_355 (217) = happyGoto action_27 action_355 (220) = happyGoto action_28 action_355 (241) = happyGoto action_30 action_355 (242) = happyGoto action_31 action_355 (243) = happyGoto action_117 action_355 (249) = happyGoto action_33 action_355 (251) = happyGoto action_34 action_355 (252) = happyGoto action_35 action_355 (255) = happyGoto action_36 action_355 _ = happyFail action_356 (331) = happyShift action_445 action_356 _ = happyFail action_357 _ = happyReduce_564 action_358 (338) = happyShift action_444 action_358 _ = happyReduce_566 action_359 (368) = happyShift action_443 action_359 _ = happyReduce_568 action_360 _ = happyReduce_571 action_361 (267) = happyShift action_38 action_361 (275) = happyShift action_41 action_361 (287) = happyShift action_47 action_361 (291) = happyShift action_48 action_361 (293) = happyShift action_49 action_361 (294) = happyShift action_50 action_361 (295) = happyShift action_51 action_361 (296) = happyShift action_52 action_361 (297) = happyShift action_53 action_361 (298) = happyShift action_54 action_361 (300) = happyShift action_56 action_361 (301) = happyShift action_57 action_361 (302) = happyShift action_58 action_361 (303) = happyShift action_59 action_361 (304) = happyShift action_60 action_361 (305) = happyShift action_61 action_361 (306) = happyShift action_62 action_361 (309) = happyShift action_64 action_361 (333) = happyShift action_278 action_361 (345) = happyShift action_280 action_361 (346) = happyShift action_281 action_361 (347) = happyShift action_282 action_361 (352) = happyShift action_283 action_361 (357) = happyShift action_199 action_361 (361) = happyShift action_361 action_361 (362) = happyShift action_306 action_361 (363) = happyShift action_201 action_361 (368) = happyShift action_307 action_361 (371) = happyShift action_81 action_361 (372) = happyShift action_82 action_361 (373) = happyShift action_285 action_361 (374) = happyShift action_286 action_361 (212) = happyGoto action_439 action_361 (213) = happyGoto action_358 action_361 (214) = happyGoto action_359 action_361 (216) = happyGoto action_360 action_361 (218) = happyGoto action_192 action_361 (220) = happyGoto action_193 action_361 (240) = happyGoto action_194 action_361 (243) = happyGoto action_195 action_361 (247) = happyGoto action_440 action_361 (248) = happyGoto action_274 action_361 (249) = happyGoto action_33 action_361 (250) = happyGoto action_275 action_361 (252) = happyGoto action_196 action_361 (254) = happyGoto action_441 action_361 (258) = happyGoto action_442 action_361 _ = happyFail action_362 (384) = happyShift action_438 action_362 _ = happyFail action_363 (331) = happyShift action_437 action_363 _ = happyFail action_364 (331) = happyShift action_436 action_364 _ = happyFail action_365 (331) = happyShift action_435 action_365 _ = happyFail action_366 (267) = happyShift action_38 action_366 (275) = happyShift action_41 action_366 (287) = happyShift action_47 action_366 (291) = happyShift action_48 action_366 (293) = happyShift action_49 action_366 (294) = happyShift action_50 action_366 (295) = happyShift action_51 action_366 (296) = happyShift action_52 action_366 (297) = happyShift action_53 action_366 (298) = happyShift action_54 action_366 (300) = happyShift action_56 action_366 (301) = happyShift action_57 action_366 (302) = happyShift action_58 action_366 (303) = happyShift action_59 action_366 (304) = happyShift action_60 action_366 (305) = happyShift action_61 action_366 (306) = happyShift action_62 action_366 (309) = happyShift action_64 action_366 (361) = happyShift action_186 action_366 (371) = happyShift action_81 action_366 (375) = happyShift action_83 action_366 (379) = happyShift action_85 action_366 (241) = happyGoto action_434 action_366 (242) = happyGoto action_31 action_366 (243) = happyGoto action_117 action_366 (249) = happyGoto action_33 action_366 _ = happyFail action_367 _ = happyReduce_397 action_368 (342) = happyShift action_432 action_368 (384) = happyShift action_433 action_368 _ = happyFail action_369 (267) = happyShift action_38 action_369 (275) = happyShift action_41 action_369 (287) = happyShift action_47 action_369 (291) = happyShift action_48 action_369 (293) = happyShift action_49 action_369 (294) = happyShift action_50 action_369 (295) = happyShift action_51 action_369 (296) = happyShift action_52 action_369 (297) = happyShift action_53 action_369 (298) = happyShift action_54 action_369 (300) = happyShift action_56 action_369 (301) = happyShift action_57 action_369 (302) = happyShift action_58 action_369 (303) = happyShift action_59 action_369 (304) = happyShift action_60 action_369 (305) = happyShift action_61 action_369 (306) = happyShift action_62 action_369 (309) = happyShift action_64 action_369 (361) = happyShift action_186 action_369 (371) = happyShift action_81 action_369 (375) = happyShift action_83 action_369 (379) = happyShift action_85 action_369 (241) = happyGoto action_431 action_369 (242) = happyGoto action_31 action_369 (243) = happyGoto action_117 action_369 (249) = happyGoto action_33 action_369 _ = happyFail action_370 (267) = happyShift action_38 action_370 (275) = happyShift action_41 action_370 (287) = happyShift action_47 action_370 (291) = happyShift action_260 action_370 (293) = happyShift action_49 action_370 (294) = happyShift action_50 action_370 (295) = happyShift action_51 action_370 (296) = happyShift action_231 action_370 (297) = happyShift action_232 action_370 (298) = happyShift action_233 action_370 (302) = happyShift action_58 action_370 (303) = happyShift action_59 action_370 (304) = happyShift action_60 action_370 (305) = happyShift action_61 action_370 (306) = happyShift action_62 action_370 (309) = happyShift action_64 action_370 (323) = happyShift action_236 action_370 (324) = happyShift action_237 action_370 (346) = happyShift action_238 action_370 (353) = happyShift action_239 action_370 (357) = happyShift action_240 action_370 (359) = happyShift action_241 action_370 (361) = happyShift action_242 action_370 (363) = happyShift action_243 action_370 (370) = happyShift action_244 action_370 (371) = happyShift action_245 action_370 (372) = happyShift action_246 action_370 (376) = happyShift action_247 action_370 (380) = happyShift action_248 action_370 (381) = happyShift action_87 action_370 (383) = happyShift action_249 action_370 (384) = happyShift action_250 action_370 (403) = happyShift action_251 action_370 (404) = happyShift action_252 action_370 (408) = happyShift action_108 action_370 (409) = happyShift action_109 action_370 (107) = happyGoto action_253 action_370 (111) = happyGoto action_218 action_370 (112) = happyGoto action_254 action_370 (114) = happyGoto action_255 action_370 (115) = happyGoto action_256 action_370 (117) = happyGoto action_257 action_370 (118) = happyGoto action_221 action_370 (119) = happyGoto action_430 action_370 (156) = happyGoto action_222 action_370 (210) = happyGoto action_259 action_370 (224) = happyGoto action_223 action_370 (225) = happyGoto action_224 action_370 (227) = happyGoto action_225 action_370 (228) = happyGoto action_226 action_370 (237) = happyGoto action_227 action_370 (239) = happyGoto action_228 action_370 (249) = happyGoto action_229 action_370 _ = happyFail action_371 (267) = happyShift action_38 action_371 (275) = happyShift action_41 action_371 (287) = happyShift action_47 action_371 (291) = happyShift action_48 action_371 (293) = happyShift action_49 action_371 (294) = happyShift action_50 action_371 (295) = happyShift action_51 action_371 (296) = happyShift action_52 action_371 (297) = happyShift action_53 action_371 (298) = happyShift action_54 action_371 (300) = happyShift action_56 action_371 (301) = happyShift action_57 action_371 (302) = happyShift action_58 action_371 (303) = happyShift action_59 action_371 (304) = happyShift action_60 action_371 (305) = happyShift action_61 action_371 (306) = happyShift action_62 action_371 (309) = happyShift action_64 action_371 (361) = happyShift action_186 action_371 (371) = happyShift action_81 action_371 (375) = happyShift action_83 action_371 (379) = happyShift action_85 action_371 (241) = happyGoto action_429 action_371 (242) = happyGoto action_31 action_371 (243) = happyGoto action_117 action_371 (249) = happyGoto action_33 action_371 _ = happyFail action_372 (340) = happyShift action_428 action_372 _ = happyFail action_373 _ = happyReduce_418 action_374 (278) = happyShift action_427 action_374 _ = happyFail action_375 (367) = happyShift action_421 action_375 (160) = happyGoto action_426 action_375 _ = happyReduce_425 action_376 (1) = happyShift action_424 action_376 (338) = happyShift action_379 action_376 (356) = happyShift action_425 action_376 (194) = happyGoto action_422 action_376 (256) = happyGoto action_423 action_376 _ = happyFail action_377 _ = happyReduce_414 action_378 (367) = happyShift action_421 action_378 (160) = happyGoto action_420 action_378 _ = happyReduce_425 action_379 (266) = happyShift action_37 action_379 (267) = happyShift action_38 action_379 (268) = happyShift action_39 action_379 (273) = happyShift action_40 action_379 (275) = happyShift action_41 action_379 (276) = happyShift action_42 action_379 (283) = happyShift action_164 action_379 (287) = happyShift action_47 action_379 (291) = happyShift action_48 action_379 (293) = happyShift action_49 action_379 (294) = happyShift action_50 action_379 (295) = happyShift action_51 action_379 (296) = happyShift action_52 action_379 (297) = happyShift action_53 action_379 (298) = happyShift action_54 action_379 (299) = happyShift action_55 action_379 (300) = happyShift action_56 action_379 (301) = happyShift action_57 action_379 (302) = happyShift action_58 action_379 (303) = happyShift action_59 action_379 (304) = happyShift action_60 action_379 (305) = happyShift action_61 action_379 (306) = happyShift action_62 action_379 (307) = happyShift action_63 action_379 (309) = happyShift action_64 action_379 (318) = happyShift action_68 action_379 (319) = happyShift action_69 action_379 (320) = happyShift action_70 action_379 (336) = happyShift action_72 action_379 (342) = happyShift action_73 action_379 (345) = happyShift action_74 action_379 (346) = happyShift action_166 action_379 (357) = happyShift action_75 action_379 (359) = happyShift action_76 action_379 (361) = happyShift action_118 action_379 (363) = happyShift action_78 action_379 (365) = happyShift action_79 action_379 (370) = happyShift action_80 action_379 (371) = happyShift action_81 action_379 (372) = happyShift action_82 action_379 (375) = happyShift action_83 action_379 (376) = happyShift action_84 action_379 (379) = happyShift action_85 action_379 (380) = happyShift action_86 action_379 (381) = happyShift action_87 action_379 (382) = happyShift action_88 action_379 (383) = happyShift action_89 action_379 (384) = happyShift action_90 action_379 (385) = happyShift action_91 action_379 (386) = happyShift action_92 action_379 (387) = happyShift action_93 action_379 (388) = happyShift action_94 action_379 (389) = happyShift action_95 action_379 (390) = happyShift action_96 action_379 (391) = happyShift action_97 action_379 (396) = happyShift action_98 action_379 (397) = happyShift action_99 action_379 (398) = happyShift action_100 action_379 (399) = happyShift action_101 action_379 (401) = happyShift action_102 action_379 (403) = happyShift action_103 action_379 (404) = happyShift action_104 action_379 (405) = happyShift action_105 action_379 (406) = happyShift action_106 action_379 (407) = happyShift action_107 action_379 (408) = happyShift action_108 action_379 (409) = happyShift action_109 action_379 (38) = happyGoto action_13 action_379 (156) = happyGoto action_16 action_379 (157) = happyGoto action_160 action_379 (158) = happyGoto action_116 action_379 (159) = happyGoto action_18 action_379 (161) = happyGoto action_19 action_379 (162) = happyGoto action_20 action_379 (163) = happyGoto action_21 action_379 (164) = happyGoto action_22 action_379 (165) = happyGoto action_23 action_379 (166) = happyGoto action_24 action_379 (167) = happyGoto action_25 action_379 (183) = happyGoto action_417 action_379 (184) = happyGoto action_418 action_379 (196) = happyGoto action_161 action_379 (204) = happyGoto action_419 action_379 (210) = happyGoto action_26 action_379 (217) = happyGoto action_27 action_379 (220) = happyGoto action_28 action_379 (241) = happyGoto action_30 action_379 (242) = happyGoto action_31 action_379 (243) = happyGoto action_117 action_379 (249) = happyGoto action_33 action_379 (251) = happyGoto action_34 action_379 (252) = happyGoto action_35 action_379 (255) = happyGoto action_36 action_379 _ = happyFail action_380 (338) = happyShift action_379 action_380 (192) = happyGoto action_416 action_380 (194) = happyGoto action_378 action_380 _ = happyFail action_381 _ = happyReduce_417 action_382 (286) = happyShift action_415 action_382 _ = happyFail action_383 (266) = happyShift action_37 action_383 (267) = happyShift action_38 action_383 (275) = happyShift action_41 action_383 (287) = happyShift action_47 action_383 (291) = happyShift action_48 action_383 (293) = happyShift action_49 action_383 (294) = happyShift action_50 action_383 (295) = happyShift action_51 action_383 (296) = happyShift action_52 action_383 (297) = happyShift action_53 action_383 (298) = happyShift action_54 action_383 (300) = happyShift action_56 action_383 (301) = happyShift action_57 action_383 (302) = happyShift action_58 action_383 (303) = happyShift action_59 action_383 (304) = happyShift action_60 action_383 (305) = happyShift action_61 action_383 (306) = happyShift action_62 action_383 (309) = happyShift action_64 action_383 (342) = happyShift action_73 action_383 (357) = happyShift action_75 action_383 (359) = happyShift action_76 action_383 (361) = happyShift action_118 action_383 (363) = happyShift action_78 action_383 (365) = happyShift action_79 action_383 (370) = happyShift action_80 action_383 (371) = happyShift action_81 action_383 (372) = happyShift action_82 action_383 (375) = happyShift action_83 action_383 (376) = happyShift action_84 action_383 (379) = happyShift action_85 action_383 (380) = happyShift action_86 action_383 (381) = happyShift action_87 action_383 (382) = happyShift action_88 action_383 (383) = happyShift action_89 action_383 (384) = happyShift action_90 action_383 (385) = happyShift action_91 action_383 (386) = happyShift action_92 action_383 (387) = happyShift action_93 action_383 (388) = happyShift action_94 action_383 (389) = happyShift action_95 action_383 (390) = happyShift action_96 action_383 (391) = happyShift action_97 action_383 (396) = happyShift action_98 action_383 (397) = happyShift action_99 action_383 (398) = happyShift action_100 action_383 (399) = happyShift action_101 action_383 (401) = happyShift action_102 action_383 (403) = happyShift action_103 action_383 (404) = happyShift action_104 action_383 (405) = happyShift action_105 action_383 (406) = happyShift action_106 action_383 (407) = happyShift action_107 action_383 (408) = happyShift action_108 action_383 (409) = happyShift action_109 action_383 (38) = happyGoto action_13 action_383 (156) = happyGoto action_16 action_383 (164) = happyGoto action_414 action_383 (165) = happyGoto action_23 action_383 (166) = happyGoto action_24 action_383 (167) = happyGoto action_25 action_383 (210) = happyGoto action_26 action_383 (217) = happyGoto action_27 action_383 (220) = happyGoto action_28 action_383 (241) = happyGoto action_30 action_383 (242) = happyGoto action_31 action_383 (243) = happyGoto action_117 action_383 (249) = happyGoto action_33 action_383 (251) = happyGoto action_34 action_383 (252) = happyGoto action_35 action_383 (255) = happyGoto action_36 action_383 _ = happyFail action_384 (267) = happyShift action_38 action_384 (275) = happyShift action_41 action_384 (287) = happyShift action_47 action_384 (291) = happyShift action_48 action_384 (293) = happyShift action_49 action_384 (294) = happyShift action_50 action_384 (295) = happyShift action_51 action_384 (296) = happyShift action_52 action_384 (297) = happyShift action_53 action_384 (298) = happyShift action_54 action_384 (300) = happyShift action_56 action_384 (301) = happyShift action_57 action_384 (302) = happyShift action_58 action_384 (303) = happyShift action_59 action_384 (304) = happyShift action_60 action_384 (305) = happyShift action_61 action_384 (306) = happyShift action_62 action_384 (309) = happyShift action_64 action_384 (361) = happyShift action_413 action_384 (371) = happyShift action_81 action_384 (109) = happyGoto action_411 action_384 (240) = happyGoto action_412 action_384 (243) = happyGoto action_195 action_384 (249) = happyGoto action_33 action_384 _ = happyFail action_385 (267) = happyShift action_38 action_385 (275) = happyShift action_41 action_385 (287) = happyShift action_47 action_385 (291) = happyShift action_48 action_385 (293) = happyShift action_49 action_385 (294) = happyShift action_50 action_385 (295) = happyShift action_51 action_385 (296) = happyShift action_52 action_385 (297) = happyShift action_53 action_385 (298) = happyShift action_54 action_385 (300) = happyShift action_56 action_385 (301) = happyShift action_57 action_385 (302) = happyShift action_58 action_385 (303) = happyShift action_59 action_385 (304) = happyShift action_60 action_385 (305) = happyShift action_61 action_385 (306) = happyShift action_62 action_385 (309) = happyShift action_64 action_385 (332) = happyShift action_410 action_385 (361) = happyShift action_186 action_385 (371) = happyShift action_81 action_385 (375) = happyShift action_83 action_385 (379) = happyShift action_85 action_385 (205) = happyGoto action_406 action_385 (206) = happyGoto action_407 action_385 (207) = happyGoto action_408 action_385 (241) = happyGoto action_409 action_385 (242) = happyGoto action_31 action_385 (243) = happyGoto action_117 action_385 (249) = happyGoto action_33 action_385 _ = happyReduce_553 action_386 _ = happyReduce_429 action_387 _ = happyReduce_420 action_388 _ = happyReduce_419 action_389 (267) = happyShift action_38 action_389 (275) = happyShift action_41 action_389 (287) = happyShift action_47 action_389 (291) = happyShift action_405 action_389 (293) = happyShift action_49 action_389 (294) = happyShift action_50 action_389 (295) = happyShift action_51 action_389 (296) = happyShift action_231 action_389 (297) = happyShift action_232 action_389 (298) = happyShift action_233 action_389 (302) = happyShift action_58 action_389 (303) = happyShift action_59 action_389 (304) = happyShift action_60 action_389 (305) = happyShift action_61 action_389 (306) = happyShift action_62 action_389 (309) = happyShift action_64 action_389 (323) = happyShift action_236 action_389 (324) = happyShift action_237 action_389 (346) = happyShift action_238 action_389 (353) = happyShift action_239 action_389 (357) = happyShift action_240 action_389 (359) = happyShift action_241 action_389 (361) = happyShift action_242 action_389 (363) = happyShift action_243 action_389 (370) = happyShift action_244 action_389 (371) = happyShift action_245 action_389 (372) = happyShift action_246 action_389 (376) = happyShift action_247 action_389 (380) = happyShift action_248 action_389 (381) = happyShift action_87 action_389 (383) = happyShift action_249 action_389 (384) = happyShift action_250 action_389 (403) = happyShift action_251 action_389 (404) = happyShift action_252 action_389 (408) = happyShift action_108 action_389 (409) = happyShift action_109 action_389 (108) = happyGoto action_399 action_389 (111) = happyGoto action_218 action_389 (113) = happyGoto action_400 action_389 (114) = happyGoto action_401 action_389 (116) = happyGoto action_402 action_389 (117) = happyGoto action_403 action_389 (118) = happyGoto action_221 action_389 (156) = happyGoto action_222 action_389 (210) = happyGoto action_404 action_389 (224) = happyGoto action_223 action_389 (225) = happyGoto action_224 action_389 (227) = happyGoto action_225 action_389 (228) = happyGoto action_226 action_389 (237) = happyGoto action_227 action_389 (239) = happyGoto action_228 action_389 (249) = happyGoto action_229 action_389 _ = happyFail action_390 (333) = happyShift action_278 action_390 (345) = happyShift action_280 action_390 (346) = happyShift action_281 action_390 (347) = happyShift action_282 action_390 (352) = happyShift action_283 action_390 (369) = happyShift action_398 action_390 (373) = happyShift action_285 action_390 (374) = happyShift action_286 action_390 (50) = happyGoto action_392 action_390 (221) = happyGoto action_393 action_390 (231) = happyGoto action_394 action_390 (232) = happyGoto action_395 action_390 (247) = happyGoto action_396 action_390 (248) = happyGoto action_274 action_390 (250) = happyGoto action_275 action_390 (254) = happyGoto action_397 action_390 _ = happyFail action_391 _ = happyReduce_86 action_392 (368) = happyShift action_841 action_392 _ = happyReduce_390 action_393 _ = happyReduce_620 action_394 _ = happyReduce_91 action_395 _ = happyReduce_619 action_396 _ = happyReduce_621 action_397 _ = happyReduce_589 action_398 (267) = happyShift action_38 action_398 (275) = happyShift action_41 action_398 (287) = happyShift action_47 action_398 (291) = happyShift action_48 action_398 (293) = happyShift action_49 action_398 (294) = happyShift action_50 action_398 (295) = happyShift action_51 action_398 (296) = happyShift action_52 action_398 (297) = happyShift action_53 action_398 (298) = happyShift action_54 action_398 (300) = happyShift action_56 action_398 (301) = happyShift action_57 action_398 (302) = happyShift action_58 action_398 (303) = happyShift action_59 action_398 (304) = happyShift action_60 action_398 (305) = happyShift action_61 action_398 (306) = happyShift action_62 action_398 (309) = happyShift action_64 action_398 (371) = happyShift action_81 action_398 (372) = happyShift action_82 action_398 (243) = happyGoto action_840 action_398 (249) = happyGoto action_33 action_398 (252) = happyGoto action_677 action_398 _ = happyFail action_399 _ = happyReduce_388 action_400 _ = happyReduce_251 action_401 (344) = happyShift action_839 action_401 _ = happyFail action_402 _ = happyReduce_268 action_403 (267) = happyShift action_38 action_403 (275) = happyShift action_41 action_403 (287) = happyShift action_47 action_403 (293) = happyShift action_49 action_403 (294) = happyShift action_50 action_403 (295) = happyShift action_51 action_403 (296) = happyShift action_231 action_403 (297) = happyShift action_232 action_403 (298) = happyShift action_233 action_403 (302) = happyShift action_58 action_403 (303) = happyShift action_59 action_403 (304) = happyShift action_60 action_403 (305) = happyShift action_61 action_403 (306) = happyShift action_62 action_403 (309) = happyShift action_64 action_403 (323) = happyShift action_236 action_403 (324) = happyShift action_237 action_403 (340) = happyShift action_836 action_403 (342) = happyShift action_837 action_403 (344) = happyReduce_270 action_403 (345) = happyShift action_493 action_403 (346) = happyShift action_238 action_403 (347) = happyShift action_494 action_403 (352) = happyShift action_557 action_403 (353) = happyShift action_239 action_403 (357) = happyShift action_240 action_403 (359) = happyShift action_241 action_403 (361) = happyShift action_242 action_403 (363) = happyShift action_243 action_403 (369) = happyShift action_558 action_403 (370) = happyShift action_838 action_403 (371) = happyShift action_245 action_403 (372) = happyShift action_246 action_403 (373) = happyShift action_496 action_403 (374) = happyShift action_497 action_403 (376) = happyShift action_247 action_403 (377) = happyShift action_498 action_403 (378) = happyShift action_499 action_403 (380) = happyShift action_248 action_403 (383) = happyShift action_249 action_403 (384) = happyShift action_250 action_403 (393) = happyShift action_155 action_403 (403) = happyShift action_251 action_403 (404) = happyShift action_252 action_403 (408) = happyShift action_108 action_403 (409) = happyShift action_109 action_403 (111) = happyGoto action_218 action_403 (118) = happyGoto action_551 action_403 (156) = happyGoto action_222 action_403 (224) = happyGoto action_223 action_403 (225) = happyGoto action_224 action_403 (226) = happyGoto action_834 action_403 (227) = happyGoto action_225 action_403 (228) = happyGoto action_226 action_403 (229) = happyGoto action_553 action_403 (230) = happyGoto action_488 action_403 (237) = happyGoto action_227 action_403 (238) = happyGoto action_835 action_403 (239) = happyGoto action_228 action_403 (249) = happyGoto action_229 action_403 (260) = happyGoto action_748 action_403 _ = happyReduce_278 action_404 (334) = happyShift action_833 action_404 _ = happyFail action_405 (267) = happyShift action_38 action_405 (275) = happyShift action_41 action_405 (287) = happyShift action_47 action_405 (293) = happyShift action_49 action_405 (294) = happyShift action_50 action_405 (295) = happyShift action_51 action_405 (296) = happyShift action_231 action_405 (297) = happyShift action_232 action_405 (298) = happyShift action_233 action_405 (302) = happyShift action_58 action_405 (303) = happyShift action_59 action_405 (304) = happyShift action_60 action_405 (305) = happyShift action_61 action_405 (306) = happyShift action_62 action_405 (309) = happyShift action_64 action_405 (361) = happyShift action_547 action_405 (371) = happyShift action_245 action_405 (123) = happyGoto action_832 action_405 (124) = happyGoto action_545 action_405 (237) = happyGoto action_546 action_405 (239) = happyGoto action_228 action_405 (249) = happyGoto action_229 action_405 _ = happyReduce_321 action_406 (354) = happyShift action_831 action_406 _ = happyFail action_407 _ = happyReduce_552 action_408 (368) = happyShift action_830 action_408 _ = happyReduce_555 action_409 (335) = happyShift action_829 action_409 _ = happyReduce_558 action_410 _ = happyReduce_556 action_411 (334) = happyShift action_827 action_411 (368) = happyShift action_828 action_411 _ = happyFail action_412 _ = happyReduce_253 action_413 (345) = happyShift action_280 action_413 (346) = happyShift action_281 action_413 (347) = happyShift action_282 action_413 (352) = happyShift action_283 action_413 (373) = happyShift action_285 action_413 (247) = happyGoto action_440 action_413 (248) = happyGoto action_274 action_413 (250) = happyGoto action_275 action_413 _ = happyFail action_414 _ = happyReduce_431 action_415 (353) = happyShift action_448 action_415 (355) = happyShift action_449 action_415 (185) = happyGoto action_826 action_415 _ = happyFail action_416 (338) = happyShift action_379 action_416 (354) = happyShift action_825 action_416 (194) = happyGoto action_422 action_416 _ = happyFail action_417 (340) = happyShift action_824 action_417 _ = happyFail action_418 (368) = happyShift action_823 action_418 _ = happyReduce_507 action_419 _ = happyReduce_509 action_420 _ = happyReduce_526 action_421 _ = happyReduce_424 action_422 (367) = happyShift action_421 action_422 (160) = happyGoto action_822 action_422 _ = happyReduce_425 action_423 _ = happyReduce_528 action_424 _ = happyReduce_696 action_425 _ = happyReduce_695 action_426 (288) = happyShift action_821 action_426 _ = happyFail action_427 (266) = happyShift action_37 action_427 (267) = happyShift action_38 action_427 (268) = happyShift action_39 action_427 (273) = happyShift action_40 action_427 (275) = happyShift action_41 action_427 (276) = happyShift action_42 action_427 (283) = happyShift action_46 action_427 (287) = happyShift action_47 action_427 (291) = happyShift action_48 action_427 (293) = happyShift action_49 action_427 (294) = happyShift action_50 action_427 (295) = happyShift action_51 action_427 (296) = happyShift action_52 action_427 (297) = happyShift action_53 action_427 (298) = happyShift action_54 action_427 (299) = happyShift action_55 action_427 (300) = happyShift action_56 action_427 (301) = happyShift action_57 action_427 (302) = happyShift action_58 action_427 (303) = happyShift action_59 action_427 (304) = happyShift action_60 action_427 (305) = happyShift action_61 action_427 (306) = happyShift action_62 action_427 (307) = happyShift action_63 action_427 (309) = happyShift action_64 action_427 (318) = happyShift action_68 action_427 (319) = happyShift action_69 action_427 (320) = happyShift action_70 action_427 (336) = happyShift action_72 action_427 (342) = happyShift action_73 action_427 (345) = happyShift action_74 action_427 (357) = happyShift action_75 action_427 (359) = happyShift action_76 action_427 (361) = happyShift action_118 action_427 (363) = happyShift action_78 action_427 (365) = happyShift action_79 action_427 (370) = happyShift action_80 action_427 (371) = happyShift action_81 action_427 (372) = happyShift action_82 action_427 (375) = happyShift action_83 action_427 (376) = happyShift action_84 action_427 (379) = happyShift action_85 action_427 (380) = happyShift action_86 action_427 (381) = happyShift action_87 action_427 (382) = happyShift action_88 action_427 (383) = happyShift action_89 action_427 (384) = happyShift action_90 action_427 (385) = happyShift action_91 action_427 (386) = happyShift action_92 action_427 (387) = happyShift action_93 action_427 (388) = happyShift action_94 action_427 (389) = happyShift action_95 action_427 (390) = happyShift action_96 action_427 (391) = happyShift action_97 action_427 (396) = happyShift action_98 action_427 (397) = happyShift action_99 action_427 (398) = happyShift action_100 action_427 (399) = happyShift action_101 action_427 (401) = happyShift action_102 action_427 (403) = happyShift action_103 action_427 (404) = happyShift action_104 action_427 (405) = happyShift action_105 action_427 (406) = happyShift action_106 action_427 (407) = happyShift action_107 action_427 (408) = happyShift action_108 action_427 (409) = happyShift action_109 action_427 (38) = happyGoto action_13 action_427 (156) = happyGoto action_16 action_427 (157) = happyGoto action_820 action_427 (158) = happyGoto action_116 action_427 (159) = happyGoto action_18 action_427 (161) = happyGoto action_19 action_427 (162) = happyGoto action_20 action_427 (163) = happyGoto action_21 action_427 (164) = happyGoto action_22 action_427 (165) = happyGoto action_23 action_427 (166) = happyGoto action_24 action_427 (167) = happyGoto action_25 action_427 (210) = happyGoto action_26 action_427 (217) = happyGoto action_27 action_427 (220) = happyGoto action_28 action_427 (241) = happyGoto action_30 action_427 (242) = happyGoto action_31 action_427 (243) = happyGoto action_117 action_427 (249) = happyGoto action_33 action_427 (251) = happyGoto action_34 action_427 (252) = happyGoto action_35 action_427 (255) = happyGoto action_36 action_427 _ = happyFail action_428 (266) = happyShift action_37 action_428 (267) = happyShift action_38 action_428 (268) = happyShift action_39 action_428 (273) = happyShift action_40 action_428 (275) = happyShift action_41 action_428 (276) = happyShift action_42 action_428 (283) = happyShift action_46 action_428 (287) = happyShift action_47 action_428 (291) = happyShift action_48 action_428 (293) = happyShift action_49 action_428 (294) = happyShift action_50 action_428 (295) = happyShift action_51 action_428 (296) = happyShift action_52 action_428 (297) = happyShift action_53 action_428 (298) = happyShift action_54 action_428 (299) = happyShift action_55 action_428 (300) = happyShift action_56 action_428 (301) = happyShift action_57 action_428 (302) = happyShift action_58 action_428 (303) = happyShift action_59 action_428 (304) = happyShift action_60 action_428 (305) = happyShift action_61 action_428 (306) = happyShift action_62 action_428 (307) = happyShift action_63 action_428 (309) = happyShift action_64 action_428 (318) = happyShift action_68 action_428 (319) = happyShift action_69 action_428 (320) = happyShift action_70 action_428 (336) = happyShift action_72 action_428 (342) = happyShift action_73 action_428 (345) = happyShift action_74 action_428 (357) = happyShift action_75 action_428 (359) = happyShift action_76 action_428 (361) = happyShift action_118 action_428 (363) = happyShift action_78 action_428 (365) = happyShift action_79 action_428 (370) = happyShift action_80 action_428 (371) = happyShift action_81 action_428 (372) = happyShift action_82 action_428 (375) = happyShift action_83 action_428 (376) = happyShift action_84 action_428 (379) = happyShift action_85 action_428 (380) = happyShift action_86 action_428 (381) = happyShift action_87 action_428 (382) = happyShift action_88 action_428 (383) = happyShift action_89 action_428 (384) = happyShift action_90 action_428 (385) = happyShift action_91 action_428 (386) = happyShift action_92 action_428 (387) = happyShift action_93 action_428 (388) = happyShift action_94 action_428 (389) = happyShift action_95 action_428 (390) = happyShift action_96 action_428 (391) = happyShift action_97 action_428 (396) = happyShift action_98 action_428 (397) = happyShift action_99 action_428 (398) = happyShift action_100 action_428 (399) = happyShift action_101 action_428 (401) = happyShift action_102 action_428 (403) = happyShift action_103 action_428 (404) = happyShift action_104 action_428 (405) = happyShift action_105 action_428 (406) = happyShift action_106 action_428 (407) = happyShift action_107 action_428 (408) = happyShift action_108 action_428 (409) = happyShift action_109 action_428 (38) = happyGoto action_13 action_428 (156) = happyGoto action_16 action_428 (157) = happyGoto action_819 action_428 (158) = happyGoto action_116 action_428 (159) = happyGoto action_18 action_428 (161) = happyGoto action_19 action_428 (162) = happyGoto action_20 action_428 (163) = happyGoto action_21 action_428 (164) = happyGoto action_22 action_428 (165) = happyGoto action_23 action_428 (166) = happyGoto action_24 action_428 (167) = happyGoto action_25 action_428 (210) = happyGoto action_26 action_428 (217) = happyGoto action_27 action_428 (220) = happyGoto action_28 action_428 (241) = happyGoto action_30 action_428 (242) = happyGoto action_31 action_428 (243) = happyGoto action_117 action_428 (249) = happyGoto action_33 action_428 (251) = happyGoto action_34 action_428 (252) = happyGoto action_35 action_428 (255) = happyGoto action_36 action_428 _ = happyFail action_429 (331) = happyShift action_818 action_429 _ = happyFail action_430 (331) = happyShift action_817 action_430 _ = happyFail action_431 (334) = happyShift action_816 action_431 _ = happyFail action_432 (384) = happyShift action_815 action_432 _ = happyFail action_433 (358) = happyShift action_814 action_433 _ = happyFail action_434 (334) = happyShift action_813 action_434 _ = happyFail action_435 (266) = happyShift action_37 action_435 (267) = happyShift action_38 action_435 (268) = happyShift action_39 action_435 (273) = happyShift action_40 action_435 (275) = happyShift action_41 action_435 (276) = happyShift action_42 action_435 (283) = happyShift action_46 action_435 (287) = happyShift action_47 action_435 (291) = happyShift action_48 action_435 (293) = happyShift action_49 action_435 (294) = happyShift action_50 action_435 (295) = happyShift action_51 action_435 (296) = happyShift action_52 action_435 (297) = happyShift action_53 action_435 (298) = happyShift action_54 action_435 (299) = happyShift action_55 action_435 (300) = happyShift action_56 action_435 (301) = happyShift action_57 action_435 (302) = happyShift action_58 action_435 (303) = happyShift action_59 action_435 (304) = happyShift action_60 action_435 (305) = happyShift action_61 action_435 (306) = happyShift action_62 action_435 (307) = happyShift action_63 action_435 (309) = happyShift action_64 action_435 (318) = happyShift action_68 action_435 (319) = happyShift action_69 action_435 (320) = happyShift action_70 action_435 (336) = happyShift action_72 action_435 (342) = happyShift action_73 action_435 (345) = happyShift action_74 action_435 (357) = happyShift action_75 action_435 (359) = happyShift action_76 action_435 (361) = happyShift action_118 action_435 (363) = happyShift action_78 action_435 (365) = happyShift action_79 action_435 (370) = happyShift action_80 action_435 (371) = happyShift action_81 action_435 (372) = happyShift action_82 action_435 (375) = happyShift action_83 action_435 (376) = happyShift action_84 action_435 (379) = happyShift action_85 action_435 (380) = happyShift action_86 action_435 (381) = happyShift action_87 action_435 (382) = happyShift action_88 action_435 (383) = happyShift action_89 action_435 (384) = happyShift action_90 action_435 (385) = happyShift action_91 action_435 (386) = happyShift action_92 action_435 (387) = happyShift action_93 action_435 (388) = happyShift action_94 action_435 (389) = happyShift action_95 action_435 (390) = happyShift action_96 action_435 (391) = happyShift action_97 action_435 (396) = happyShift action_98 action_435 (397) = happyShift action_99 action_435 (398) = happyShift action_100 action_435 (399) = happyShift action_101 action_435 (401) = happyShift action_102 action_435 (403) = happyShift action_103 action_435 (404) = happyShift action_104 action_435 (405) = happyShift action_105 action_435 (406) = happyShift action_106 action_435 (407) = happyShift action_107 action_435 (408) = happyShift action_108 action_435 (409) = happyShift action_109 action_435 (38) = happyGoto action_13 action_435 (156) = happyGoto action_16 action_435 (157) = happyGoto action_812 action_435 (158) = happyGoto action_116 action_435 (159) = happyGoto action_18 action_435 (161) = happyGoto action_19 action_435 (162) = happyGoto action_20 action_435 (163) = happyGoto action_21 action_435 (164) = happyGoto action_22 action_435 (165) = happyGoto action_23 action_435 (166) = happyGoto action_24 action_435 (167) = happyGoto action_25 action_435 (210) = happyGoto action_26 action_435 (217) = happyGoto action_27 action_435 (220) = happyGoto action_28 action_435 (241) = happyGoto action_30 action_435 (242) = happyGoto action_31 action_435 (243) = happyGoto action_117 action_435 (249) = happyGoto action_33 action_435 (251) = happyGoto action_34 action_435 (252) = happyGoto action_35 action_435 (255) = happyGoto action_36 action_435 _ = happyFail action_436 _ = happyReduce_426 action_437 _ = happyReduce_427 action_438 (333) = happyShift action_811 action_438 _ = happyFail action_439 (362) = happyShift action_810 action_439 _ = happyFail action_440 (362) = happyShift action_809 action_440 _ = happyFail action_441 (362) = happyShift action_808 action_441 _ = happyFail action_442 (362) = happyShift action_512 action_442 (368) = happyShift action_465 action_442 _ = happyFail action_443 (267) = happyShift action_38 action_443 (275) = happyShift action_41 action_443 (287) = happyShift action_47 action_443 (291) = happyShift action_48 action_443 (293) = happyShift action_49 action_443 (294) = happyShift action_50 action_443 (295) = happyShift action_51 action_443 (296) = happyShift action_52 action_443 (297) = happyShift action_53 action_443 (298) = happyShift action_54 action_443 (300) = happyShift action_56 action_443 (301) = happyShift action_57 action_443 (302) = happyShift action_58 action_443 (303) = happyShift action_59 action_443 (304) = happyShift action_60 action_443 (305) = happyShift action_61 action_443 (306) = happyShift action_62 action_443 (309) = happyShift action_64 action_443 (357) = happyShift action_199 action_443 (361) = happyShift action_361 action_443 (363) = happyShift action_201 action_443 (371) = happyShift action_81 action_443 (372) = happyShift action_82 action_443 (213) = happyGoto action_807 action_443 (214) = happyGoto action_359 action_443 (216) = happyGoto action_360 action_443 (218) = happyGoto action_192 action_443 (220) = happyGoto action_193 action_443 (240) = happyGoto action_194 action_443 (243) = happyGoto action_195 action_443 (249) = happyGoto action_33 action_443 (252) = happyGoto action_196 action_443 _ = happyFail action_444 (267) = happyShift action_38 action_444 (275) = happyShift action_41 action_444 (287) = happyShift action_47 action_444 (291) = happyShift action_48 action_444 (293) = happyShift action_49 action_444 (294) = happyShift action_50 action_444 (295) = happyShift action_51 action_444 (296) = happyShift action_52 action_444 (297) = happyShift action_53 action_444 (298) = happyShift action_54 action_444 (300) = happyShift action_56 action_444 (301) = happyShift action_57 action_444 (302) = happyShift action_58 action_444 (303) = happyShift action_59 action_444 (304) = happyShift action_60 action_444 (305) = happyShift action_61 action_444 (306) = happyShift action_62 action_444 (309) = happyShift action_64 action_444 (357) = happyShift action_199 action_444 (361) = happyShift action_361 action_444 (363) = happyShift action_201 action_444 (371) = happyShift action_81 action_444 (372) = happyShift action_82 action_444 (212) = happyGoto action_806 action_444 (213) = happyGoto action_358 action_444 (214) = happyGoto action_359 action_444 (216) = happyGoto action_360 action_444 (218) = happyGoto action_192 action_444 (220) = happyGoto action_193 action_444 (240) = happyGoto action_194 action_444 (243) = happyGoto action_195 action_444 (249) = happyGoto action_33 action_444 (252) = happyGoto action_196 action_444 _ = happyFail action_445 _ = happyReduce_395 action_446 _ = happyReduce_535 action_447 _ = happyReduce_412 action_448 (266) = happyShift action_37 action_448 (267) = happyShift action_38 action_448 (268) = happyShift action_39 action_448 (273) = happyShift action_40 action_448 (275) = happyShift action_41 action_448 (276) = happyShift action_42 action_448 (283) = happyShift action_46 action_448 (287) = happyShift action_47 action_448 (291) = happyShift action_48 action_448 (293) = happyShift action_49 action_448 (294) = happyShift action_50 action_448 (295) = happyShift action_51 action_448 (296) = happyShift action_52 action_448 (297) = happyShift action_53 action_448 (298) = happyShift action_54 action_448 (299) = happyShift action_55 action_448 (300) = happyShift action_56 action_448 (301) = happyShift action_57 action_448 (302) = happyShift action_58 action_448 (303) = happyShift action_59 action_448 (304) = happyShift action_60 action_448 (305) = happyShift action_61 action_448 (306) = happyShift action_62 action_448 (307) = happyShift action_63 action_448 (309) = happyShift action_64 action_448 (318) = happyShift action_68 action_448 (319) = happyShift action_69 action_448 (320) = happyShift action_70 action_448 (336) = happyShift action_72 action_448 (342) = happyShift action_73 action_448 (345) = happyShift action_74 action_448 (346) = happyShift action_802 action_448 (354) = happyShift action_805 action_448 (357) = happyShift action_75 action_448 (359) = happyShift action_76 action_448 (361) = happyShift action_118 action_448 (363) = happyShift action_78 action_448 (365) = happyShift action_79 action_448 (367) = happyShift action_803 action_448 (370) = happyShift action_80 action_448 (371) = happyShift action_81 action_448 (372) = happyShift action_82 action_448 (375) = happyShift action_83 action_448 (376) = happyShift action_84 action_448 (379) = happyShift action_85 action_448 (380) = happyShift action_86 action_448 (381) = happyShift action_87 action_448 (382) = happyShift action_88 action_448 (383) = happyShift action_89 action_448 (384) = happyShift action_90 action_448 (385) = happyShift action_91 action_448 (386) = happyShift action_92 action_448 (387) = happyShift action_93 action_448 (388) = happyShift action_94 action_448 (389) = happyShift action_95 action_448 (390) = happyShift action_96 action_448 (391) = happyShift action_97 action_448 (396) = happyShift action_98 action_448 (397) = happyShift action_99 action_448 (398) = happyShift action_100 action_448 (399) = happyShift action_101 action_448 (401) = happyShift action_102 action_448 (403) = happyShift action_103 action_448 (404) = happyShift action_104 action_448 (405) = happyShift action_105 action_448 (406) = happyShift action_106 action_448 (407) = happyShift action_107 action_448 (408) = happyShift action_108 action_448 (409) = happyShift action_109 action_448 (38) = happyGoto action_13 action_448 (156) = happyGoto action_16 action_448 (157) = happyGoto action_796 action_448 (158) = happyGoto action_116 action_448 (159) = happyGoto action_18 action_448 (161) = happyGoto action_19 action_448 (162) = happyGoto action_20 action_448 (163) = happyGoto action_21 action_448 (164) = happyGoto action_22 action_448 (165) = happyGoto action_23 action_448 (166) = happyGoto action_24 action_448 (167) = happyGoto action_25 action_448 (186) = happyGoto action_804 action_448 (187) = happyGoto action_798 action_448 (188) = happyGoto action_799 action_448 (195) = happyGoto action_800 action_448 (210) = happyGoto action_26 action_448 (217) = happyGoto action_27 action_448 (220) = happyGoto action_28 action_448 (241) = happyGoto action_30 action_448 (242) = happyGoto action_31 action_448 (243) = happyGoto action_117 action_448 (249) = happyGoto action_33 action_448 (251) = happyGoto action_34 action_448 (252) = happyGoto action_35 action_448 (255) = happyGoto action_36 action_448 _ = happyFail action_449 (1) = happyShift action_424 action_449 (266) = happyShift action_37 action_449 (267) = happyShift action_38 action_449 (268) = happyShift action_39 action_449 (273) = happyShift action_40 action_449 (275) = happyShift action_41 action_449 (276) = happyShift action_42 action_449 (283) = happyShift action_46 action_449 (287) = happyShift action_47 action_449 (291) = happyShift action_48 action_449 (293) = happyShift action_49 action_449 (294) = happyShift action_50 action_449 (295) = happyShift action_51 action_449 (296) = happyShift action_52 action_449 (297) = happyShift action_53 action_449 (298) = happyShift action_54 action_449 (299) = happyShift action_55 action_449 (300) = happyShift action_56 action_449 (301) = happyShift action_57 action_449 (302) = happyShift action_58 action_449 (303) = happyShift action_59 action_449 (304) = happyShift action_60 action_449 (305) = happyShift action_61 action_449 (306) = happyShift action_62 action_449 (307) = happyShift action_63 action_449 (309) = happyShift action_64 action_449 (318) = happyShift action_68 action_449 (319) = happyShift action_69 action_449 (320) = happyShift action_70 action_449 (336) = happyShift action_72 action_449 (342) = happyShift action_73 action_449 (345) = happyShift action_74 action_449 (346) = happyShift action_802 action_449 (356) = happyShift action_425 action_449 (357) = happyShift action_75 action_449 (359) = happyShift action_76 action_449 (361) = happyShift action_118 action_449 (363) = happyShift action_78 action_449 (365) = happyShift action_79 action_449 (367) = happyShift action_803 action_449 (370) = happyShift action_80 action_449 (371) = happyShift action_81 action_449 (372) = happyShift action_82 action_449 (375) = happyShift action_83 action_449 (376) = happyShift action_84 action_449 (379) = happyShift action_85 action_449 (380) = happyShift action_86 action_449 (381) = happyShift action_87 action_449 (382) = happyShift action_88 action_449 (383) = happyShift action_89 action_449 (384) = happyShift action_90 action_449 (385) = happyShift action_91 action_449 (386) = happyShift action_92 action_449 (387) = happyShift action_93 action_449 (388) = happyShift action_94 action_449 (389) = happyShift action_95 action_449 (390) = happyShift action_96 action_449 (391) = happyShift action_97 action_449 (396) = happyShift action_98 action_449 (397) = happyShift action_99 action_449 (398) = happyShift action_100 action_449 (399) = happyShift action_101 action_449 (401) = happyShift action_102 action_449 (403) = happyShift action_103 action_449 (404) = happyShift action_104 action_449 (405) = happyShift action_105 action_449 (406) = happyShift action_106 action_449 (407) = happyShift action_107 action_449 (408) = happyShift action_108 action_449 (409) = happyShift action_109 action_449 (38) = happyGoto action_13 action_449 (156) = happyGoto action_16 action_449 (157) = happyGoto action_796 action_449 (158) = happyGoto action_116 action_449 (159) = happyGoto action_18 action_449 (161) = happyGoto action_19 action_449 (162) = happyGoto action_20 action_449 (163) = happyGoto action_21 action_449 (164) = happyGoto action_22 action_449 (165) = happyGoto action_23 action_449 (166) = happyGoto action_24 action_449 (167) = happyGoto action_25 action_449 (186) = happyGoto action_797 action_449 (187) = happyGoto action_798 action_449 (188) = happyGoto action_799 action_449 (195) = happyGoto action_800 action_449 (210) = happyGoto action_26 action_449 (217) = happyGoto action_27 action_449 (220) = happyGoto action_28 action_449 (241) = happyGoto action_30 action_449 (242) = happyGoto action_31 action_449 (243) = happyGoto action_117 action_449 (249) = happyGoto action_33 action_449 (251) = happyGoto action_34 action_449 (252) = happyGoto action_35 action_449 (255) = happyGoto action_36 action_449 (256) = happyGoto action_801 action_449 _ = happyFail action_450 (266) = happyShift action_37 action_450 (267) = happyShift action_38 action_450 (275) = happyShift action_41 action_450 (287) = happyShift action_47 action_450 (291) = happyShift action_48 action_450 (293) = happyShift action_49 action_450 (294) = happyShift action_50 action_450 (295) = happyShift action_51 action_450 (296) = happyShift action_52 action_450 (297) = happyShift action_53 action_450 (298) = happyShift action_54 action_450 (300) = happyShift action_56 action_450 (301) = happyShift action_57 action_450 (302) = happyShift action_58 action_450 (303) = happyShift action_59 action_450 (304) = happyShift action_60 action_450 (305) = happyShift action_61 action_450 (306) = happyShift action_62 action_450 (309) = happyShift action_64 action_450 (342) = happyShift action_73 action_450 (346) = happyShift action_355 action_450 (357) = happyShift action_75 action_450 (359) = happyShift action_76 action_450 (361) = happyShift action_118 action_450 (363) = happyShift action_78 action_450 (365) = happyShift action_79 action_450 (370) = happyShift action_80 action_450 (371) = happyShift action_81 action_450 (372) = happyShift action_82 action_450 (375) = happyShift action_83 action_450 (376) = happyShift action_84 action_450 (379) = happyShift action_85 action_450 (380) = happyShift action_86 action_450 (381) = happyShift action_87 action_450 (382) = happyShift action_88 action_450 (383) = happyShift action_89 action_450 (384) = happyShift action_90 action_450 (385) = happyShift action_91 action_450 (386) = happyShift action_92 action_450 (387) = happyShift action_93 action_450 (388) = happyShift action_94 action_450 (389) = happyShift action_95 action_450 (390) = happyShift action_96 action_450 (391) = happyShift action_97 action_450 (396) = happyShift action_98 action_450 (397) = happyShift action_99 action_450 (398) = happyShift action_100 action_450 (399) = happyShift action_101 action_450 (401) = happyShift action_102 action_450 (403) = happyShift action_103 action_450 (404) = happyShift action_104 action_450 (405) = happyShift action_105 action_450 (406) = happyShift action_106 action_450 (407) = happyShift action_107 action_450 (408) = happyShift action_108 action_450 (409) = happyShift action_109 action_450 (38) = happyGoto action_13 action_450 (156) = happyGoto action_16 action_450 (164) = happyGoto action_352 action_450 (165) = happyGoto action_23 action_450 (166) = happyGoto action_24 action_450 (167) = happyGoto action_25 action_450 (197) = happyGoto action_450 action_450 (198) = happyGoto action_795 action_450 (210) = happyGoto action_26 action_450 (217) = happyGoto action_27 action_450 (220) = happyGoto action_28 action_450 (241) = happyGoto action_30 action_450 (242) = happyGoto action_31 action_450 (243) = happyGoto action_117 action_450 (249) = happyGoto action_33 action_450 (251) = happyGoto action_34 action_450 (252) = happyGoto action_35 action_450 (255) = happyGoto action_36 action_450 _ = happyReduce_537 action_451 (334) = happyShift action_794 action_451 (106) = happyGoto action_793 action_451 _ = happyReduce_248 action_452 (266) = happyShift action_37 action_452 (267) = happyShift action_38 action_452 (268) = happyShift action_39 action_452 (273) = happyShift action_40 action_452 (275) = happyShift action_41 action_452 (276) = happyShift action_42 action_452 (283) = happyShift action_46 action_452 (287) = happyShift action_47 action_452 (291) = happyShift action_48 action_452 (293) = happyShift action_49 action_452 (294) = happyShift action_50 action_452 (295) = happyShift action_51 action_452 (296) = happyShift action_52 action_452 (297) = happyShift action_53 action_452 (298) = happyShift action_54 action_452 (299) = happyShift action_55 action_452 (300) = happyShift action_56 action_452 (301) = happyShift action_57 action_452 (302) = happyShift action_58 action_452 (303) = happyShift action_59 action_452 (304) = happyShift action_60 action_452 (305) = happyShift action_61 action_452 (306) = happyShift action_62 action_452 (307) = happyShift action_63 action_452 (309) = happyShift action_64 action_452 (318) = happyShift action_68 action_452 (319) = happyShift action_69 action_452 (320) = happyShift action_70 action_452 (333) = happyShift action_278 action_452 (336) = happyShift action_72 action_452 (342) = happyShift action_73 action_452 (345) = happyShift action_74 action_452 (346) = happyShift action_281 action_452 (347) = happyShift action_282 action_452 (352) = happyShift action_283 action_452 (357) = happyShift action_75 action_452 (359) = happyShift action_76 action_452 (361) = happyShift action_118 action_452 (363) = happyShift action_78 action_452 (365) = happyShift action_79 action_452 (369) = happyShift action_308 action_452 (370) = happyShift action_80 action_452 (371) = happyShift action_81 action_452 (372) = happyShift action_82 action_452 (373) = happyShift action_285 action_452 (374) = happyShift action_286 action_452 (375) = happyShift action_83 action_452 (376) = happyShift action_84 action_452 (377) = happyShift action_287 action_452 (378) = happyShift action_288 action_452 (379) = happyShift action_85 action_452 (380) = happyShift action_86 action_452 (381) = happyShift action_87 action_452 (382) = happyShift action_88 action_452 (383) = happyShift action_89 action_452 (384) = happyShift action_90 action_452 (385) = happyShift action_91 action_452 (386) = happyShift action_92 action_452 (387) = happyShift action_93 action_452 (388) = happyShift action_94 action_452 (389) = happyShift action_95 action_452 (390) = happyShift action_96 action_452 (391) = happyShift action_97 action_452 (396) = happyShift action_98 action_452 (397) = happyShift action_99 action_452 (398) = happyShift action_100 action_452 (399) = happyShift action_101 action_452 (401) = happyShift action_102 action_452 (403) = happyShift action_103 action_452 (404) = happyShift action_104 action_452 (405) = happyShift action_105 action_452 (406) = happyShift action_106 action_452 (407) = happyShift action_107 action_452 (408) = happyShift action_108 action_452 (409) = happyShift action_109 action_452 (38) = happyGoto action_13 action_452 (156) = happyGoto action_16 action_452 (157) = happyGoto action_292 action_452 (158) = happyGoto action_293 action_452 (159) = happyGoto action_18 action_452 (161) = happyGoto action_19 action_452 (162) = happyGoto action_20 action_452 (163) = happyGoto action_21 action_452 (164) = happyGoto action_22 action_452 (165) = happyGoto action_23 action_452 (166) = happyGoto action_24 action_452 (167) = happyGoto action_25 action_452 (172) = happyGoto action_792 action_452 (210) = happyGoto action_26 action_452 (217) = happyGoto action_27 action_452 (220) = happyGoto action_28 action_452 (222) = happyGoto action_296 action_452 (234) = happyGoto action_297 action_452 (236) = happyGoto action_298 action_452 (241) = happyGoto action_30 action_452 (242) = happyGoto action_31 action_452 (243) = happyGoto action_117 action_452 (245) = happyGoto action_299 action_452 (246) = happyGoto action_338 action_452 (248) = happyGoto action_339 action_452 (249) = happyGoto action_33 action_452 (250) = happyGoto action_275 action_452 (251) = happyGoto action_34 action_452 (252) = happyGoto action_35 action_452 (253) = happyGoto action_276 action_452 (254) = happyGoto action_277 action_452 (255) = happyGoto action_36 action_452 _ = happyFail action_453 _ = happyReduce_445 action_454 (266) = happyShift action_37 action_454 (267) = happyShift action_38 action_454 (268) = happyShift action_39 action_454 (273) = happyShift action_40 action_454 (275) = happyShift action_41 action_454 (276) = happyShift action_42 action_454 (283) = happyShift action_46 action_454 (287) = happyShift action_47 action_454 (291) = happyShift action_48 action_454 (293) = happyShift action_49 action_454 (294) = happyShift action_50 action_454 (295) = happyShift action_51 action_454 (296) = happyShift action_52 action_454 (297) = happyShift action_53 action_454 (298) = happyShift action_54 action_454 (299) = happyShift action_55 action_454 (300) = happyShift action_56 action_454 (301) = happyShift action_57 action_454 (302) = happyShift action_58 action_454 (303) = happyShift action_59 action_454 (304) = happyShift action_60 action_454 (305) = happyShift action_61 action_454 (306) = happyShift action_62 action_454 (307) = happyShift action_63 action_454 (309) = happyShift action_64 action_454 (318) = happyShift action_68 action_454 (319) = happyShift action_69 action_454 (320) = happyShift action_70 action_454 (336) = happyShift action_72 action_454 (342) = happyShift action_73 action_454 (345) = happyShift action_74 action_454 (357) = happyShift action_75 action_454 (359) = happyShift action_76 action_454 (361) = happyShift action_118 action_454 (363) = happyShift action_78 action_454 (365) = happyShift action_79 action_454 (370) = happyShift action_80 action_454 (371) = happyShift action_81 action_454 (372) = happyShift action_82 action_454 (375) = happyShift action_83 action_454 (376) = happyShift action_84 action_454 (379) = happyShift action_85 action_454 (380) = happyShift action_86 action_454 (381) = happyShift action_87 action_454 (382) = happyShift action_88 action_454 (383) = happyShift action_89 action_454 (384) = happyShift action_90 action_454 (385) = happyShift action_91 action_454 (386) = happyShift action_92 action_454 (387) = happyShift action_93 action_454 (388) = happyShift action_94 action_454 (389) = happyShift action_95 action_454 (390) = happyShift action_96 action_454 (391) = happyShift action_97 action_454 (396) = happyShift action_98 action_454 (397) = happyShift action_99 action_454 (398) = happyShift action_100 action_454 (399) = happyShift action_101 action_454 (401) = happyShift action_102 action_454 (403) = happyShift action_103 action_454 (404) = happyShift action_104 action_454 (405) = happyShift action_105 action_454 (406) = happyShift action_106 action_454 (407) = happyShift action_107 action_454 (408) = happyShift action_108 action_454 (409) = happyShift action_109 action_454 (38) = happyGoto action_13 action_454 (156) = happyGoto action_16 action_454 (157) = happyGoto action_791 action_454 (158) = happyGoto action_116 action_454 (159) = happyGoto action_18 action_454 (161) = happyGoto action_19 action_454 (162) = happyGoto action_20 action_454 (163) = happyGoto action_21 action_454 (164) = happyGoto action_22 action_454 (165) = happyGoto action_23 action_454 (166) = happyGoto action_24 action_454 (167) = happyGoto action_25 action_454 (210) = happyGoto action_26 action_454 (217) = happyGoto action_27 action_454 (220) = happyGoto action_28 action_454 (241) = happyGoto action_30 action_454 (242) = happyGoto action_31 action_454 (243) = happyGoto action_117 action_454 (249) = happyGoto action_33 action_454 (251) = happyGoto action_34 action_454 (252) = happyGoto action_35 action_454 (255) = happyGoto action_36 action_454 _ = happyReduce_483 action_455 (266) = happyShift action_37 action_455 (267) = happyShift action_38 action_455 (268) = happyShift action_39 action_455 (273) = happyShift action_40 action_455 (275) = happyShift action_41 action_455 (276) = happyShift action_42 action_455 (283) = happyShift action_164 action_455 (287) = happyShift action_47 action_455 (288) = happyShift action_787 action_455 (291) = happyShift action_48 action_455 (293) = happyShift action_49 action_455 (294) = happyShift action_50 action_455 (295) = happyShift action_51 action_455 (296) = happyShift action_52 action_455 (297) = happyShift action_53 action_455 (298) = happyShift action_54 action_455 (299) = happyShift action_55 action_455 (300) = happyShift action_56 action_455 (301) = happyShift action_57 action_455 (302) = happyShift action_58 action_455 (303) = happyShift action_59 action_455 (304) = happyShift action_60 action_455 (305) = happyShift action_61 action_455 (306) = happyShift action_62 action_455 (307) = happyShift action_63 action_455 (309) = happyShift action_64 action_455 (318) = happyShift action_68 action_455 (319) = happyShift action_69 action_455 (320) = happyShift action_70 action_455 (336) = happyShift action_72 action_455 (342) = happyShift action_73 action_455 (345) = happyShift action_74 action_455 (346) = happyShift action_166 action_455 (357) = happyShift action_75 action_455 (359) = happyShift action_76 action_455 (361) = happyShift action_118 action_455 (363) = happyShift action_78 action_455 (365) = happyShift action_79 action_455 (370) = happyShift action_80 action_455 (371) = happyShift action_81 action_455 (372) = happyShift action_82 action_455 (375) = happyShift action_83 action_455 (376) = happyShift action_84 action_455 (379) = happyShift action_85 action_455 (380) = happyShift action_86 action_455 (381) = happyShift action_87 action_455 (382) = happyShift action_88 action_455 (383) = happyShift action_89 action_455 (384) = happyShift action_90 action_455 (385) = happyShift action_91 action_455 (386) = happyShift action_92 action_455 (387) = happyShift action_93 action_455 (388) = happyShift action_94 action_455 (389) = happyShift action_95 action_455 (390) = happyShift action_96 action_455 (391) = happyShift action_97 action_455 (396) = happyShift action_98 action_455 (397) = happyShift action_99 action_455 (398) = happyShift action_100 action_455 (399) = happyShift action_101 action_455 (401) = happyShift action_102 action_455 (403) = happyShift action_103 action_455 (404) = happyShift action_104 action_455 (405) = happyShift action_105 action_455 (406) = happyShift action_106 action_455 (407) = happyShift action_107 action_455 (408) = happyShift action_108 action_455 (409) = happyShift action_109 action_455 (38) = happyGoto action_13 action_455 (156) = happyGoto action_16 action_455 (157) = happyGoto action_160 action_455 (158) = happyGoto action_116 action_455 (159) = happyGoto action_18 action_455 (161) = happyGoto action_19 action_455 (162) = happyGoto action_20 action_455 (163) = happyGoto action_21 action_455 (164) = happyGoto action_22 action_455 (165) = happyGoto action_23 action_455 (166) = happyGoto action_24 action_455 (167) = happyGoto action_25 action_455 (178) = happyGoto action_790 action_455 (179) = happyGoto action_783 action_455 (180) = happyGoto action_784 action_455 (181) = happyGoto action_785 action_455 (196) = happyGoto action_161 action_455 (204) = happyGoto action_786 action_455 (210) = happyGoto action_26 action_455 (217) = happyGoto action_27 action_455 (220) = happyGoto action_28 action_455 (241) = happyGoto action_30 action_455 (242) = happyGoto action_31 action_455 (243) = happyGoto action_117 action_455 (249) = happyGoto action_33 action_455 (251) = happyGoto action_34 action_455 (252) = happyGoto action_35 action_455 (255) = happyGoto action_36 action_455 _ = happyFail action_456 (266) = happyShift action_37 action_456 (267) = happyShift action_38 action_456 (268) = happyShift action_39 action_456 (273) = happyShift action_40 action_456 (275) = happyShift action_41 action_456 (276) = happyShift action_42 action_456 (283) = happyShift action_46 action_456 (287) = happyShift action_47 action_456 (291) = happyShift action_48 action_456 (293) = happyShift action_49 action_456 (294) = happyShift action_50 action_456 (295) = happyShift action_51 action_456 (296) = happyShift action_52 action_456 (297) = happyShift action_53 action_456 (298) = happyShift action_54 action_456 (299) = happyShift action_55 action_456 (300) = happyShift action_56 action_456 (301) = happyShift action_57 action_456 (302) = happyShift action_58 action_456 (303) = happyShift action_59 action_456 (304) = happyShift action_60 action_456 (305) = happyShift action_61 action_456 (306) = happyShift action_62 action_456 (307) = happyShift action_63 action_456 (309) = happyShift action_64 action_456 (318) = happyShift action_68 action_456 (319) = happyShift action_69 action_456 (320) = happyShift action_70 action_456 (333) = happyShift action_278 action_456 (336) = happyShift action_72 action_456 (342) = happyShift action_73 action_456 (345) = happyShift action_74 action_456 (346) = happyShift action_281 action_456 (347) = happyShift action_282 action_456 (352) = happyShift action_283 action_456 (357) = happyShift action_75 action_456 (359) = happyShift action_76 action_456 (361) = happyShift action_118 action_456 (363) = happyShift action_78 action_456 (365) = happyShift action_79 action_456 (369) = happyShift action_308 action_456 (370) = happyShift action_80 action_456 (371) = happyShift action_81 action_456 (372) = happyShift action_82 action_456 (373) = happyShift action_285 action_456 (374) = happyShift action_286 action_456 (375) = happyShift action_83 action_456 (376) = happyShift action_84 action_456 (377) = happyShift action_287 action_456 (378) = happyShift action_288 action_456 (379) = happyShift action_85 action_456 (380) = happyShift action_86 action_456 (381) = happyShift action_87 action_456 (382) = happyShift action_88 action_456 (383) = happyShift action_89 action_456 (384) = happyShift action_90 action_456 (385) = happyShift action_91 action_456 (386) = happyShift action_92 action_456 (387) = happyShift action_93 action_456 (388) = happyShift action_94 action_456 (389) = happyShift action_95 action_456 (390) = happyShift action_96 action_456 (391) = happyShift action_97 action_456 (396) = happyShift action_98 action_456 (397) = happyShift action_99 action_456 (398) = happyShift action_100 action_456 (399) = happyShift action_101 action_456 (401) = happyShift action_102 action_456 (403) = happyShift action_103 action_456 (404) = happyShift action_104 action_456 (405) = happyShift action_105 action_456 (406) = happyShift action_106 action_456 (407) = happyShift action_107 action_456 (408) = happyShift action_108 action_456 (409) = happyShift action_109 action_456 (38) = happyGoto action_13 action_456 (156) = happyGoto action_16 action_456 (157) = happyGoto action_789 action_456 (158) = happyGoto action_293 action_456 (159) = happyGoto action_18 action_456 (161) = happyGoto action_19 action_456 (162) = happyGoto action_20 action_456 (163) = happyGoto action_21 action_456 (164) = happyGoto action_22 action_456 (165) = happyGoto action_23 action_456 (166) = happyGoto action_24 action_456 (167) = happyGoto action_25 action_456 (172) = happyGoto action_781 action_456 (210) = happyGoto action_26 action_456 (217) = happyGoto action_27 action_456 (220) = happyGoto action_28 action_456 (222) = happyGoto action_296 action_456 (234) = happyGoto action_297 action_456 (236) = happyGoto action_298 action_456 (241) = happyGoto action_30 action_456 (242) = happyGoto action_31 action_456 (243) = happyGoto action_117 action_456 (245) = happyGoto action_299 action_456 (246) = happyGoto action_338 action_456 (248) = happyGoto action_339 action_456 (249) = happyGoto action_33 action_456 (250) = happyGoto action_275 action_456 (251) = happyGoto action_34 action_456 (252) = happyGoto action_35 action_456 (253) = happyGoto action_276 action_456 (254) = happyGoto action_277 action_456 (255) = happyGoto action_36 action_456 _ = happyFail action_457 _ = happyReduce_446 action_458 (266) = happyShift action_37 action_458 (267) = happyShift action_38 action_458 (268) = happyShift action_39 action_458 (273) = happyShift action_40 action_458 (275) = happyShift action_41 action_458 (276) = happyShift action_42 action_458 (283) = happyShift action_46 action_458 (287) = happyShift action_47 action_458 (291) = happyShift action_48 action_458 (293) = happyShift action_49 action_458 (294) = happyShift action_50 action_458 (295) = happyShift action_51 action_458 (296) = happyShift action_52 action_458 (297) = happyShift action_53 action_458 (298) = happyShift action_54 action_458 (299) = happyShift action_55 action_458 (300) = happyShift action_56 action_458 (301) = happyShift action_57 action_458 (302) = happyShift action_58 action_458 (303) = happyShift action_59 action_458 (304) = happyShift action_60 action_458 (305) = happyShift action_61 action_458 (306) = happyShift action_62 action_458 (307) = happyShift action_63 action_458 (309) = happyShift action_64 action_458 (318) = happyShift action_68 action_458 (319) = happyShift action_69 action_458 (320) = happyShift action_70 action_458 (336) = happyShift action_72 action_458 (342) = happyShift action_73 action_458 (345) = happyShift action_74 action_458 (357) = happyShift action_75 action_458 (359) = happyShift action_76 action_458 (361) = happyShift action_118 action_458 (363) = happyShift action_78 action_458 (365) = happyShift action_79 action_458 (370) = happyShift action_80 action_458 (371) = happyShift action_81 action_458 (372) = happyShift action_82 action_458 (375) = happyShift action_83 action_458 (376) = happyShift action_84 action_458 (379) = happyShift action_85 action_458 (380) = happyShift action_86 action_458 (381) = happyShift action_87 action_458 (382) = happyShift action_88 action_458 (383) = happyShift action_89 action_458 (384) = happyShift action_90 action_458 (385) = happyShift action_91 action_458 (386) = happyShift action_92 action_458 (387) = happyShift action_93 action_458 (388) = happyShift action_94 action_458 (389) = happyShift action_95 action_458 (390) = happyShift action_96 action_458 (391) = happyShift action_97 action_458 (396) = happyShift action_98 action_458 (397) = happyShift action_99 action_458 (398) = happyShift action_100 action_458 (399) = happyShift action_101 action_458 (401) = happyShift action_102 action_458 (403) = happyShift action_103 action_458 (404) = happyShift action_104 action_458 (405) = happyShift action_105 action_458 (406) = happyShift action_106 action_458 (407) = happyShift action_107 action_458 (408) = happyShift action_108 action_458 (409) = happyShift action_109 action_458 (38) = happyGoto action_13 action_458 (156) = happyGoto action_16 action_458 (157) = happyGoto action_788 action_458 (158) = happyGoto action_116 action_458 (159) = happyGoto action_18 action_458 (161) = happyGoto action_19 action_458 (162) = happyGoto action_20 action_458 (163) = happyGoto action_21 action_458 (164) = happyGoto action_22 action_458 (165) = happyGoto action_23 action_458 (166) = happyGoto action_24 action_458 (167) = happyGoto action_25 action_458 (210) = happyGoto action_26 action_458 (217) = happyGoto action_27 action_458 (220) = happyGoto action_28 action_458 (241) = happyGoto action_30 action_458 (242) = happyGoto action_31 action_458 (243) = happyGoto action_117 action_458 (249) = happyGoto action_33 action_458 (251) = happyGoto action_34 action_458 (252) = happyGoto action_35 action_458 (255) = happyGoto action_36 action_458 _ = happyFail action_459 (266) = happyShift action_37 action_459 (267) = happyShift action_38 action_459 (268) = happyShift action_39 action_459 (273) = happyShift action_40 action_459 (275) = happyShift action_41 action_459 (276) = happyShift action_42 action_459 (283) = happyShift action_164 action_459 (287) = happyShift action_47 action_459 (288) = happyShift action_787 action_459 (291) = happyShift action_48 action_459 (293) = happyShift action_49 action_459 (294) = happyShift action_50 action_459 (295) = happyShift action_51 action_459 (296) = happyShift action_52 action_459 (297) = happyShift action_53 action_459 (298) = happyShift action_54 action_459 (299) = happyShift action_55 action_459 (300) = happyShift action_56 action_459 (301) = happyShift action_57 action_459 (302) = happyShift action_58 action_459 (303) = happyShift action_59 action_459 (304) = happyShift action_60 action_459 (305) = happyShift action_61 action_459 (306) = happyShift action_62 action_459 (307) = happyShift action_63 action_459 (309) = happyShift action_64 action_459 (318) = happyShift action_68 action_459 (319) = happyShift action_69 action_459 (320) = happyShift action_70 action_459 (336) = happyShift action_72 action_459 (342) = happyShift action_73 action_459 (345) = happyShift action_74 action_459 (346) = happyShift action_166 action_459 (357) = happyShift action_75 action_459 (359) = happyShift action_76 action_459 (361) = happyShift action_118 action_459 (363) = happyShift action_78 action_459 (365) = happyShift action_79 action_459 (370) = happyShift action_80 action_459 (371) = happyShift action_81 action_459 (372) = happyShift action_82 action_459 (375) = happyShift action_83 action_459 (376) = happyShift action_84 action_459 (379) = happyShift action_85 action_459 (380) = happyShift action_86 action_459 (381) = happyShift action_87 action_459 (382) = happyShift action_88 action_459 (383) = happyShift action_89 action_459 (384) = happyShift action_90 action_459 (385) = happyShift action_91 action_459 (386) = happyShift action_92 action_459 (387) = happyShift action_93 action_459 (388) = happyShift action_94 action_459 (389) = happyShift action_95 action_459 (390) = happyShift action_96 action_459 (391) = happyShift action_97 action_459 (396) = happyShift action_98 action_459 (397) = happyShift action_99 action_459 (398) = happyShift action_100 action_459 (399) = happyShift action_101 action_459 (401) = happyShift action_102 action_459 (403) = happyShift action_103 action_459 (404) = happyShift action_104 action_459 (405) = happyShift action_105 action_459 (406) = happyShift action_106 action_459 (407) = happyShift action_107 action_459 (408) = happyShift action_108 action_459 (409) = happyShift action_109 action_459 (38) = happyGoto action_13 action_459 (156) = happyGoto action_16 action_459 (157) = happyGoto action_160 action_459 (158) = happyGoto action_116 action_459 (159) = happyGoto action_18 action_459 (161) = happyGoto action_19 action_459 (162) = happyGoto action_20 action_459 (163) = happyGoto action_21 action_459 (164) = happyGoto action_22 action_459 (165) = happyGoto action_23 action_459 (166) = happyGoto action_24 action_459 (167) = happyGoto action_25 action_459 (178) = happyGoto action_782 action_459 (179) = happyGoto action_783 action_459 (180) = happyGoto action_784 action_459 (181) = happyGoto action_785 action_459 (196) = happyGoto action_161 action_459 (204) = happyGoto action_786 action_459 (210) = happyGoto action_26 action_459 (217) = happyGoto action_27 action_459 (220) = happyGoto action_28 action_459 (241) = happyGoto action_30 action_459 (242) = happyGoto action_31 action_459 (243) = happyGoto action_117 action_459 (249) = happyGoto action_33 action_459 (251) = happyGoto action_34 action_459 (252) = happyGoto action_35 action_459 (255) = happyGoto action_36 action_459 _ = happyFail action_460 (266) = happyShift action_37 action_460 (267) = happyShift action_38 action_460 (268) = happyShift action_39 action_460 (273) = happyShift action_40 action_460 (275) = happyShift action_41 action_460 (276) = happyShift action_42 action_460 (283) = happyShift action_46 action_460 (287) = happyShift action_47 action_460 (291) = happyShift action_48 action_460 (293) = happyShift action_49 action_460 (294) = happyShift action_50 action_460 (295) = happyShift action_51 action_460 (296) = happyShift action_52 action_460 (297) = happyShift action_53 action_460 (298) = happyShift action_54 action_460 (299) = happyShift action_55 action_460 (300) = happyShift action_56 action_460 (301) = happyShift action_57 action_460 (302) = happyShift action_58 action_460 (303) = happyShift action_59 action_460 (304) = happyShift action_60 action_460 (305) = happyShift action_61 action_460 (306) = happyShift action_62 action_460 (307) = happyShift action_63 action_460 (309) = happyShift action_64 action_460 (318) = happyShift action_68 action_460 (319) = happyShift action_69 action_460 (320) = happyShift action_70 action_460 (333) = happyShift action_278 action_460 (336) = happyShift action_72 action_460 (342) = happyShift action_73 action_460 (345) = happyShift action_74 action_460 (346) = happyShift action_281 action_460 (347) = happyShift action_282 action_460 (352) = happyShift action_283 action_460 (357) = happyShift action_75 action_460 (359) = happyShift action_76 action_460 (361) = happyShift action_118 action_460 (363) = happyShift action_78 action_460 (365) = happyShift action_79 action_460 (369) = happyShift action_308 action_460 (370) = happyShift action_80 action_460 (371) = happyShift action_81 action_460 (372) = happyShift action_82 action_460 (373) = happyShift action_285 action_460 (374) = happyShift action_286 action_460 (375) = happyShift action_83 action_460 (376) = happyShift action_84 action_460 (377) = happyShift action_287 action_460 (378) = happyShift action_288 action_460 (379) = happyShift action_85 action_460 (380) = happyShift action_86 action_460 (381) = happyShift action_87 action_460 (382) = happyShift action_88 action_460 (383) = happyShift action_89 action_460 (384) = happyShift action_90 action_460 (385) = happyShift action_91 action_460 (386) = happyShift action_92 action_460 (387) = happyShift action_93 action_460 (388) = happyShift action_94 action_460 (389) = happyShift action_95 action_460 (390) = happyShift action_96 action_460 (391) = happyShift action_97 action_460 (396) = happyShift action_98 action_460 (397) = happyShift action_99 action_460 (398) = happyShift action_100 action_460 (399) = happyShift action_101 action_460 (401) = happyShift action_102 action_460 (403) = happyShift action_103 action_460 (404) = happyShift action_104 action_460 (405) = happyShift action_105 action_460 (406) = happyShift action_106 action_460 (407) = happyShift action_107 action_460 (408) = happyShift action_108 action_460 (409) = happyShift action_109 action_460 (38) = happyGoto action_13 action_460 (156) = happyGoto action_16 action_460 (157) = happyGoto action_780 action_460 (158) = happyGoto action_293 action_460 (159) = happyGoto action_18 action_460 (161) = happyGoto action_19 action_460 (162) = happyGoto action_20 action_460 (163) = happyGoto action_21 action_460 (164) = happyGoto action_22 action_460 (165) = happyGoto action_23 action_460 (166) = happyGoto action_24 action_460 (167) = happyGoto action_25 action_460 (172) = happyGoto action_781 action_460 (210) = happyGoto action_26 action_460 (217) = happyGoto action_27 action_460 (220) = happyGoto action_28 action_460 (222) = happyGoto action_296 action_460 (234) = happyGoto action_297 action_460 (236) = happyGoto action_298 action_460 (241) = happyGoto action_30 action_460 (242) = happyGoto action_31 action_460 (243) = happyGoto action_117 action_460 (245) = happyGoto action_299 action_460 (246) = happyGoto action_338 action_460 (248) = happyGoto action_339 action_460 (249) = happyGoto action_33 action_460 (250) = happyGoto action_275 action_460 (251) = happyGoto action_34 action_460 (252) = happyGoto action_35 action_460 (253) = happyGoto action_276 action_460 (254) = happyGoto action_277 action_460 (255) = happyGoto action_36 action_460 _ = happyFail action_461 (368) = happyReduce_640 action_461 _ = happyReduce_642 action_462 (368) = happyShift action_307 action_462 (174) = happyGoto action_779 action_462 (258) = happyGoto action_468 action_462 _ = happyReduce_479 action_463 _ = happyReduce_476 action_464 _ = happyReduce_587 action_465 _ = happyReduce_699 action_466 _ = happyReduce_444 action_467 _ = happyReduce_475 action_468 (266) = happyShift action_37 action_468 (267) = happyShift action_38 action_468 (268) = happyShift action_39 action_468 (273) = happyShift action_40 action_468 (275) = happyShift action_41 action_468 (276) = happyShift action_42 action_468 (283) = happyShift action_46 action_468 (287) = happyShift action_47 action_468 (291) = happyShift action_48 action_468 (293) = happyShift action_49 action_468 (294) = happyShift action_50 action_468 (295) = happyShift action_51 action_468 (296) = happyShift action_52 action_468 (297) = happyShift action_53 action_468 (298) = happyShift action_54 action_468 (299) = happyShift action_55 action_468 (300) = happyShift action_56 action_468 (301) = happyShift action_57 action_468 (302) = happyShift action_58 action_468 (303) = happyShift action_59 action_468 (304) = happyShift action_60 action_468 (305) = happyShift action_61 action_468 (306) = happyShift action_62 action_468 (307) = happyShift action_63 action_468 (309) = happyShift action_64 action_468 (318) = happyShift action_68 action_468 (319) = happyShift action_69 action_468 (320) = happyShift action_70 action_468 (333) = happyShift action_278 action_468 (336) = happyShift action_72 action_468 (342) = happyShift action_73 action_468 (345) = happyShift action_74 action_468 (346) = happyShift action_281 action_468 (347) = happyShift action_282 action_468 (352) = happyShift action_283 action_468 (357) = happyShift action_75 action_468 (359) = happyShift action_76 action_468 (361) = happyShift action_118 action_468 (363) = happyShift action_78 action_468 (365) = happyShift action_79 action_468 (368) = happyShift action_465 action_468 (369) = happyShift action_308 action_468 (370) = happyShift action_80 action_468 (371) = happyShift action_81 action_468 (372) = happyShift action_82 action_468 (373) = happyShift action_285 action_468 (374) = happyShift action_286 action_468 (375) = happyShift action_83 action_468 (376) = happyShift action_84 action_468 (377) = happyShift action_287 action_468 (378) = happyShift action_288 action_468 (379) = happyShift action_85 action_468 (380) = happyShift action_86 action_468 (381) = happyShift action_87 action_468 (382) = happyShift action_88 action_468 (383) = happyShift action_89 action_468 (384) = happyShift action_90 action_468 (385) = happyShift action_91 action_468 (386) = happyShift action_92 action_468 (387) = happyShift action_93 action_468 (388) = happyShift action_94 action_468 (389) = happyShift action_95 action_468 (390) = happyShift action_96 action_468 (391) = happyShift action_97 action_468 (396) = happyShift action_98 action_468 (397) = happyShift action_99 action_468 (398) = happyShift action_100 action_468 (399) = happyShift action_101 action_468 (401) = happyShift action_102 action_468 (403) = happyShift action_103 action_468 (404) = happyShift action_104 action_468 (405) = happyShift action_105 action_468 (406) = happyShift action_106 action_468 (407) = happyShift action_107 action_468 (408) = happyShift action_108 action_468 (409) = happyShift action_109 action_468 (38) = happyGoto action_13 action_468 (156) = happyGoto action_16 action_468 (157) = happyGoto action_292 action_468 (158) = happyGoto action_293 action_468 (159) = happyGoto action_18 action_468 (161) = happyGoto action_19 action_468 (162) = happyGoto action_20 action_468 (163) = happyGoto action_21 action_468 (164) = happyGoto action_22 action_468 (165) = happyGoto action_23 action_468 (166) = happyGoto action_24 action_468 (167) = happyGoto action_25 action_468 (172) = happyGoto action_462 action_468 (175) = happyGoto action_778 action_468 (210) = happyGoto action_26 action_468 (217) = happyGoto action_27 action_468 (220) = happyGoto action_28 action_468 (222) = happyGoto action_296 action_468 (234) = happyGoto action_297 action_468 (236) = happyGoto action_298 action_468 (241) = happyGoto action_30 action_468 (242) = happyGoto action_31 action_468 (243) = happyGoto action_117 action_468 (245) = happyGoto action_299 action_468 (246) = happyGoto action_338 action_468 (248) = happyGoto action_339 action_468 (249) = happyGoto action_33 action_468 (250) = happyGoto action_275 action_468 (251) = happyGoto action_34 action_468 (252) = happyGoto action_35 action_468 (253) = happyGoto action_276 action_468 (254) = happyGoto action_277 action_468 (255) = happyGoto action_36 action_468 _ = happyReduce_480 action_469 _ = happyReduce_443 action_470 (266) = happyShift action_37 action_470 (267) = happyShift action_38 action_470 (275) = happyShift action_41 action_470 (287) = happyShift action_47 action_470 (291) = happyShift action_48 action_470 (293) = happyShift action_49 action_470 (294) = happyShift action_50 action_470 (295) = happyShift action_51 action_470 (296) = happyShift action_52 action_470 (297) = happyShift action_53 action_470 (298) = happyShift action_54 action_470 (300) = happyShift action_56 action_470 (301) = happyShift action_57 action_470 (302) = happyShift action_58 action_470 (303) = happyShift action_59 action_470 (304) = happyShift action_60 action_470 (305) = happyShift action_61 action_470 (306) = happyShift action_62 action_470 (309) = happyShift action_64 action_470 (357) = happyShift action_75 action_470 (359) = happyShift action_76 action_470 (361) = happyShift action_118 action_470 (363) = happyShift action_78 action_470 (365) = happyShift action_79 action_470 (366) = happyShift action_777 action_470 (370) = happyShift action_80 action_470 (371) = happyShift action_81 action_470 (372) = happyShift action_82 action_470 (375) = happyShift action_83 action_470 (376) = happyShift action_84 action_470 (379) = happyShift action_85 action_470 (380) = happyShift action_86 action_470 (381) = happyShift action_87 action_470 (382) = happyShift action_88 action_470 (383) = happyShift action_89 action_470 (384) = happyShift action_90 action_470 (385) = happyShift action_91 action_470 (386) = happyShift action_92 action_470 (387) = happyShift action_93 action_470 (388) = happyShift action_94 action_470 (389) = happyShift action_95 action_470 (390) = happyShift action_96 action_470 (391) = happyShift action_97 action_470 (396) = happyShift action_98 action_470 (397) = happyShift action_99 action_470 (398) = happyShift action_100 action_470 (399) = happyShift action_101 action_470 (401) = happyShift action_102 action_470 (403) = happyShift action_103 action_470 (404) = happyShift action_104 action_470 (405) = happyShift action_105 action_470 (406) = happyShift action_106 action_470 (407) = happyShift action_107 action_470 (408) = happyShift action_108 action_470 (409) = happyShift action_109 action_470 (38) = happyGoto action_13 action_470 (156) = happyGoto action_16 action_470 (166) = happyGoto action_775 action_470 (167) = happyGoto action_25 action_470 (169) = happyGoto action_776 action_470 (210) = happyGoto action_26 action_470 (217) = happyGoto action_27 action_470 (220) = happyGoto action_28 action_470 (241) = happyGoto action_335 action_470 (242) = happyGoto action_31 action_470 (243) = happyGoto action_117 action_470 (249) = happyGoto action_33 action_470 (251) = happyGoto action_34 action_470 (252) = happyGoto action_35 action_470 (255) = happyGoto action_36 action_470 _ = happyFail action_471 (362) = happyShift action_515 action_471 _ = happyFail action_472 (362) = happyShift action_513 action_472 _ = happyFail action_473 _ = happyReduce_453 action_474 _ = happyReduce_456 action_475 _ = happyReduce_455 action_476 _ = happyReduce_470 action_477 (367) = happyShift action_774 action_477 _ = happyReduce_34 action_478 _ = happyReduce_94 action_479 (1) = happyShift action_424 action_479 (356) = happyShift action_425 action_479 (256) = happyGoto action_773 action_479 _ = happyFail action_480 (354) = happyShift action_772 action_480 _ = happyFail action_481 _ = happyReduce_457 action_482 _ = happyReduce_454 action_483 _ = happyReduce_461 action_484 _ = happyReduce_463 action_485 (364) = happyShift action_771 action_485 (368) = happyShift action_465 action_485 _ = happyFail action_486 _ = happyReduce_595 action_487 (362) = happyShift action_770 action_487 _ = happyFail action_488 _ = happyReduce_614 action_489 (362) = happyShift action_769 action_489 (368) = happyShift action_465 action_489 _ = happyFail action_490 (362) = happyShift action_768 action_490 _ = happyFail action_491 (362) = happyShift action_767 action_491 _ = happyFail action_492 (362) = happyShift action_766 action_492 _ = happyFail action_493 _ = happyReduce_618 action_494 _ = happyReduce_617 action_495 _ = happyReduce_594 action_496 _ = happyReduce_616 action_497 _ = happyReduce_615 action_498 _ = happyReduce_613 action_499 _ = happyReduce_612 action_500 _ = happyReduce_601 action_501 _ = happyReduce_600 action_502 (321) = happyShift action_764 action_502 (322) = happyShift action_765 action_502 (21) = happyGoto action_763 action_502 _ = happyReduce_26 action_503 _ = happyReduce_697 action_504 _ = happyReduce_698 action_505 _ = happyReduce_406 action_506 _ = happyReduce_405 action_507 _ = happyReduce_404 action_508 _ = happyReduce_403 action_509 _ = happyReduce_402 action_510 (369) = happyShift action_762 action_510 _ = happyFail action_511 (369) = happyShift action_761 action_511 _ = happyFail action_512 _ = happyReduce_585 action_513 _ = happyReduce_577 action_514 _ = happyReduce_642 action_515 _ = happyReduce_643 action_516 (333) = happyShift action_278 action_516 (345) = happyShift action_280 action_516 (346) = happyShift action_281 action_516 (347) = happyShift action_282 action_516 (352) = happyShift action_283 action_516 (369) = happyShift action_284 action_516 (373) = happyShift action_285 action_516 (374) = happyShift action_286 action_516 (377) = happyShift action_287 action_516 (378) = happyShift action_288 action_516 (222) = happyGoto action_268 action_516 (233) = happyGoto action_269 action_516 (235) = happyGoto action_270 action_516 (244) = happyGoto action_271 action_516 (246) = happyGoto action_272 action_516 (247) = happyGoto action_273 action_516 (248) = happyGoto action_274 action_516 (250) = happyGoto action_275 action_516 (253) = happyGoto action_276 action_516 (254) = happyGoto action_277 action_516 _ = happyReduce_473 action_517 _ = happyReduce_442 action_518 _ = happyReduce_441 action_519 (266) = happyShift action_37 action_519 (267) = happyShift action_38 action_519 (268) = happyShift action_39 action_519 (273) = happyShift action_40 action_519 (275) = happyShift action_41 action_519 (276) = happyShift action_42 action_519 (283) = happyShift action_46 action_519 (287) = happyShift action_47 action_519 (291) = happyShift action_48 action_519 (293) = happyShift action_49 action_519 (294) = happyShift action_50 action_519 (295) = happyShift action_51 action_519 (296) = happyShift action_52 action_519 (297) = happyShift action_53 action_519 (298) = happyShift action_54 action_519 (299) = happyShift action_55 action_519 (300) = happyShift action_56 action_519 (301) = happyShift action_57 action_519 (302) = happyShift action_58 action_519 (303) = happyShift action_59 action_519 (304) = happyShift action_60 action_519 (305) = happyShift action_61 action_519 (306) = happyShift action_62 action_519 (307) = happyShift action_63 action_519 (309) = happyShift action_64 action_519 (318) = happyShift action_68 action_519 (319) = happyShift action_69 action_519 (320) = happyShift action_70 action_519 (336) = happyShift action_72 action_519 (342) = happyShift action_73 action_519 (345) = happyShift action_74 action_519 (357) = happyShift action_75 action_519 (359) = happyShift action_76 action_519 (361) = happyShift action_118 action_519 (363) = happyShift action_78 action_519 (365) = happyShift action_79 action_519 (370) = happyShift action_80 action_519 (371) = happyShift action_81 action_519 (372) = happyShift action_82 action_519 (375) = happyShift action_83 action_519 (376) = happyShift action_84 action_519 (379) = happyShift action_85 action_519 (380) = happyShift action_86 action_519 (381) = happyShift action_87 action_519 (382) = happyShift action_88 action_519 (383) = happyShift action_89 action_519 (384) = happyShift action_90 action_519 (385) = happyShift action_91 action_519 (386) = happyShift action_92 action_519 (387) = happyShift action_93 action_519 (388) = happyShift action_94 action_519 (389) = happyShift action_95 action_519 (390) = happyShift action_96 action_519 (391) = happyShift action_97 action_519 (396) = happyShift action_98 action_519 (397) = happyShift action_99 action_519 (398) = happyShift action_100 action_519 (399) = happyShift action_101 action_519 (401) = happyShift action_102 action_519 (403) = happyShift action_103 action_519 (404) = happyShift action_104 action_519 (405) = happyShift action_105 action_519 (406) = happyShift action_106 action_519 (407) = happyShift action_107 action_519 (408) = happyShift action_108 action_519 (409) = happyShift action_109 action_519 (38) = happyGoto action_13 action_519 (156) = happyGoto action_16 action_519 (159) = happyGoto action_530 action_519 (161) = happyGoto action_19 action_519 (162) = happyGoto action_20 action_519 (163) = happyGoto action_21 action_519 (164) = happyGoto action_22 action_519 (165) = happyGoto action_23 action_519 (166) = happyGoto action_24 action_519 (167) = happyGoto action_25 action_519 (210) = happyGoto action_26 action_519 (217) = happyGoto action_27 action_519 (220) = happyGoto action_28 action_519 (241) = happyGoto action_30 action_519 (242) = happyGoto action_31 action_519 (243) = happyGoto action_117 action_519 (249) = happyGoto action_33 action_519 (251) = happyGoto action_34 action_519 (252) = happyGoto action_35 action_519 (255) = happyGoto action_36 action_519 _ = happyReduce_472 action_520 (266) = happyShift action_37 action_520 (267) = happyShift action_38 action_520 (268) = happyShift action_39 action_520 (273) = happyShift action_40 action_520 (275) = happyShift action_41 action_520 (276) = happyShift action_42 action_520 (283) = happyShift action_46 action_520 (287) = happyShift action_47 action_520 (291) = happyShift action_48 action_520 (293) = happyShift action_49 action_520 (294) = happyShift action_50 action_520 (295) = happyShift action_51 action_520 (296) = happyShift action_52 action_520 (297) = happyShift action_53 action_520 (298) = happyShift action_54 action_520 (299) = happyShift action_55 action_520 (300) = happyShift action_56 action_520 (301) = happyShift action_57 action_520 (302) = happyShift action_58 action_520 (303) = happyShift action_59 action_520 (304) = happyShift action_60 action_520 (305) = happyShift action_61 action_520 (306) = happyShift action_62 action_520 (307) = happyShift action_63 action_520 (309) = happyShift action_64 action_520 (318) = happyShift action_68 action_520 (319) = happyShift action_69 action_520 (320) = happyShift action_70 action_520 (333) = happyShift action_278 action_520 (336) = happyShift action_72 action_520 (342) = happyShift action_73 action_520 (345) = happyShift action_74 action_520 (346) = happyShift action_281 action_520 (347) = happyShift action_282 action_520 (352) = happyShift action_283 action_520 (357) = happyShift action_75 action_520 (359) = happyShift action_76 action_520 (361) = happyShift action_118 action_520 (363) = happyShift action_78 action_520 (365) = happyShift action_79 action_520 (369) = happyShift action_308 action_520 (370) = happyShift action_80 action_520 (371) = happyShift action_81 action_520 (372) = happyShift action_82 action_520 (373) = happyShift action_285 action_520 (374) = happyShift action_286 action_520 (375) = happyShift action_83 action_520 (376) = happyShift action_84 action_520 (377) = happyShift action_287 action_520 (378) = happyShift action_288 action_520 (379) = happyShift action_85 action_520 (380) = happyShift action_86 action_520 (381) = happyShift action_87 action_520 (382) = happyShift action_88 action_520 (383) = happyShift action_89 action_520 (384) = happyShift action_90 action_520 (385) = happyShift action_91 action_520 (386) = happyShift action_92 action_520 (387) = happyShift action_93 action_520 (388) = happyShift action_94 action_520 (389) = happyShift action_95 action_520 (390) = happyShift action_96 action_520 (391) = happyShift action_97 action_520 (396) = happyShift action_98 action_520 (397) = happyShift action_99 action_520 (398) = happyShift action_100 action_520 (399) = happyShift action_101 action_520 (401) = happyShift action_102 action_520 (403) = happyShift action_103 action_520 (404) = happyShift action_104 action_520 (405) = happyShift action_105 action_520 (406) = happyShift action_106 action_520 (407) = happyShift action_107 action_520 (408) = happyShift action_108 action_520 (409) = happyShift action_109 action_520 (38) = happyGoto action_13 action_520 (156) = happyGoto action_16 action_520 (157) = happyGoto action_292 action_520 (158) = happyGoto action_293 action_520 (159) = happyGoto action_18 action_520 (161) = happyGoto action_19 action_520 (162) = happyGoto action_20 action_520 (163) = happyGoto action_21 action_520 (164) = happyGoto action_22 action_520 (165) = happyGoto action_23 action_520 (166) = happyGoto action_24 action_520 (167) = happyGoto action_25 action_520 (172) = happyGoto action_760 action_520 (210) = happyGoto action_26 action_520 (217) = happyGoto action_27 action_520 (220) = happyGoto action_28 action_520 (222) = happyGoto action_296 action_520 (234) = happyGoto action_297 action_520 (236) = happyGoto action_298 action_520 (241) = happyGoto action_30 action_520 (242) = happyGoto action_31 action_520 (243) = happyGoto action_117 action_520 (245) = happyGoto action_299 action_520 (246) = happyGoto action_338 action_520 (248) = happyGoto action_339 action_520 (249) = happyGoto action_33 action_520 (250) = happyGoto action_275 action_520 (251) = happyGoto action_34 action_520 (252) = happyGoto action_35 action_520 (253) = happyGoto action_276 action_520 (254) = happyGoto action_277 action_520 (255) = happyGoto action_36 action_520 _ = happyFail action_521 (331) = happyShift action_758 action_521 (383) = happyShift action_759 action_521 _ = happyFail action_522 (267) = happyShift action_38 action_522 (275) = happyShift action_41 action_522 (287) = happyShift action_47 action_522 (293) = happyShift action_49 action_522 (294) = happyShift action_50 action_522 (295) = happyShift action_51 action_522 (296) = happyShift action_231 action_522 (297) = happyShift action_232 action_522 (298) = happyShift action_233 action_522 (302) = happyShift action_58 action_522 (303) = happyShift action_59 action_522 (304) = happyShift action_60 action_522 (305) = happyShift action_61 action_522 (306) = happyShift action_62 action_522 (309) = happyShift action_64 action_522 (323) = happyShift action_236 action_522 (324) = happyShift action_237 action_522 (346) = happyShift action_238 action_522 (353) = happyShift action_239 action_522 (357) = happyShift action_240 action_522 (359) = happyShift action_241 action_522 (361) = happyShift action_242 action_522 (363) = happyShift action_243 action_522 (370) = happyShift action_244 action_522 (371) = happyShift action_245 action_522 (372) = happyShift action_246 action_522 (376) = happyShift action_247 action_522 (380) = happyShift action_248 action_522 (383) = happyShift action_249 action_522 (384) = happyShift action_250 action_522 (403) = happyShift action_251 action_522 (404) = happyShift action_252 action_522 (408) = happyShift action_108 action_522 (409) = happyShift action_109 action_522 (65) = happyGoto action_757 action_522 (111) = happyGoto action_218 action_522 (114) = happyGoto action_265 action_522 (115) = happyGoto action_266 action_522 (117) = happyGoto action_257 action_522 (118) = happyGoto action_221 action_522 (156) = happyGoto action_222 action_522 (224) = happyGoto action_223 action_522 (225) = happyGoto action_224 action_522 (227) = happyGoto action_225 action_522 (228) = happyGoto action_226 action_522 (237) = happyGoto action_227 action_522 (239) = happyGoto action_228 action_522 (249) = happyGoto action_229 action_522 _ = happyFail action_523 (334) = happyShift action_691 action_523 (335) = happyReduce_709 action_523 (392) = happyShift action_154 action_523 (64) = happyGoto action_754 action_523 (137) = happyGoto action_755 action_523 (259) = happyGoto action_575 action_523 (265) = happyGoto action_756 action_523 _ = happyReduce_147 action_524 (369) = happyShift action_753 action_524 _ = happyFail action_525 _ = happyReduce_247 action_526 (344) = happyShift action_752 action_526 _ = happyFail action_527 (267) = happyShift action_38 action_527 (275) = happyShift action_41 action_527 (287) = happyShift action_47 action_527 (293) = happyShift action_49 action_527 (294) = happyShift action_50 action_527 (295) = happyShift action_51 action_527 (296) = happyShift action_231 action_527 (297) = happyShift action_232 action_527 (298) = happyShift action_233 action_527 (302) = happyShift action_58 action_527 (303) = happyShift action_59 action_527 (304) = happyShift action_60 action_527 (305) = happyShift action_61 action_527 (306) = happyShift action_62 action_527 (309) = happyShift action_64 action_527 (323) = happyShift action_236 action_527 (324) = happyShift action_237 action_527 (335) = happyReduce_271 action_527 (338) = happyReduce_271 action_527 (340) = happyShift action_749 action_527 (342) = happyShift action_750 action_527 (344) = happyReduce_270 action_527 (345) = happyShift action_493 action_527 (346) = happyShift action_238 action_527 (347) = happyShift action_494 action_527 (352) = happyShift action_557 action_527 (353) = happyShift action_239 action_527 (357) = happyShift action_240 action_527 (359) = happyShift action_241 action_527 (361) = happyShift action_242 action_527 (363) = happyShift action_243 action_527 (369) = happyShift action_558 action_527 (370) = happyShift action_751 action_527 (371) = happyShift action_245 action_527 (372) = happyShift action_246 action_527 (373) = happyShift action_496 action_527 (374) = happyShift action_497 action_527 (376) = happyShift action_247 action_527 (377) = happyShift action_498 action_527 (378) = happyShift action_499 action_527 (380) = happyShift action_248 action_527 (383) = happyShift action_249 action_527 (384) = happyShift action_250 action_527 (393) = happyShift action_155 action_527 (403) = happyShift action_251 action_527 (404) = happyShift action_252 action_527 (408) = happyShift action_108 action_527 (409) = happyShift action_109 action_527 (111) = happyGoto action_218 action_527 (118) = happyGoto action_551 action_527 (156) = happyGoto action_222 action_527 (224) = happyGoto action_223 action_527 (225) = happyGoto action_224 action_527 (226) = happyGoto action_746 action_527 (227) = happyGoto action_225 action_527 (228) = happyGoto action_226 action_527 (229) = happyGoto action_553 action_527 (230) = happyGoto action_488 action_527 (237) = happyGoto action_227 action_527 (238) = happyGoto action_747 action_527 (239) = happyGoto action_228 action_527 (249) = happyGoto action_229 action_527 (260) = happyGoto action_748 action_527 _ = happyReduce_278 action_528 (334) = happyShift action_745 action_528 _ = happyFail action_529 (267) = happyShift action_38 action_529 (275) = happyShift action_41 action_529 (287) = happyShift action_47 action_529 (293) = happyShift action_49 action_529 (294) = happyShift action_50 action_529 (295) = happyShift action_51 action_529 (296) = happyShift action_231 action_529 (297) = happyShift action_232 action_529 (298) = happyShift action_233 action_529 (302) = happyShift action_58 action_529 (303) = happyShift action_59 action_529 (304) = happyShift action_60 action_529 (305) = happyShift action_61 action_529 (306) = happyShift action_62 action_529 (309) = happyShift action_64 action_529 (361) = happyShift action_547 action_529 (371) = happyShift action_245 action_529 (123) = happyGoto action_744 action_529 (124) = happyGoto action_545 action_529 (237) = happyGoto action_546 action_529 (239) = happyGoto action_228 action_529 (249) = happyGoto action_229 action_529 _ = happyReduce_321 action_530 _ = happyReduce_409 action_531 _ = happyReduce_378 action_532 (290) = happyShift action_743 action_532 (338) = happyShift action_535 action_532 (86) = happyGoto action_741 action_532 (152) = happyGoto action_742 action_532 _ = happyReduce_199 action_533 _ = happyReduce_386 action_534 (266) = happyShift action_37 action_534 (267) = happyShift action_38 action_534 (268) = happyShift action_39 action_534 (273) = happyShift action_40 action_534 (275) = happyShift action_41 action_534 (276) = happyShift action_42 action_534 (283) = happyShift action_46 action_534 (287) = happyShift action_47 action_534 (291) = happyShift action_48 action_534 (293) = happyShift action_49 action_534 (294) = happyShift action_50 action_534 (295) = happyShift action_51 action_534 (296) = happyShift action_52 action_534 (297) = happyShift action_53 action_534 (298) = happyShift action_54 action_534 (299) = happyShift action_55 action_534 (300) = happyShift action_56 action_534 (301) = happyShift action_57 action_534 (302) = happyShift action_58 action_534 (303) = happyShift action_59 action_534 (304) = happyShift action_60 action_534 (305) = happyShift action_61 action_534 (306) = happyShift action_62 action_534 (307) = happyShift action_63 action_534 (309) = happyShift action_64 action_534 (318) = happyShift action_68 action_534 (319) = happyShift action_69 action_534 (320) = happyShift action_70 action_534 (336) = happyShift action_72 action_534 (342) = happyShift action_73 action_534 (345) = happyShift action_74 action_534 (357) = happyShift action_75 action_534 (359) = happyShift action_76 action_534 (361) = happyShift action_118 action_534 (363) = happyShift action_78 action_534 (365) = happyShift action_79 action_534 (370) = happyShift action_80 action_534 (371) = happyShift action_81 action_534 (372) = happyShift action_82 action_534 (375) = happyShift action_83 action_534 (376) = happyShift action_84 action_534 (379) = happyShift action_85 action_534 (380) = happyShift action_86 action_534 (381) = happyShift action_87 action_534 (382) = happyShift action_88 action_534 (383) = happyShift action_89 action_534 (384) = happyShift action_90 action_534 (385) = happyShift action_91 action_534 (386) = happyShift action_92 action_534 (387) = happyShift action_93 action_534 (388) = happyShift action_94 action_534 (389) = happyShift action_95 action_534 (390) = happyShift action_96 action_534 (391) = happyShift action_97 action_534 (396) = happyShift action_98 action_534 (397) = happyShift action_99 action_534 (398) = happyShift action_100 action_534 (399) = happyShift action_101 action_534 (401) = happyShift action_102 action_534 (403) = happyShift action_103 action_534 (404) = happyShift action_104 action_534 (405) = happyShift action_105 action_534 (406) = happyShift action_106 action_534 (407) = happyShift action_107 action_534 (408) = happyShift action_108 action_534 (409) = happyShift action_109 action_534 (38) = happyGoto action_13 action_534 (156) = happyGoto action_16 action_534 (157) = happyGoto action_740 action_534 (158) = happyGoto action_116 action_534 (159) = happyGoto action_18 action_534 (161) = happyGoto action_19 action_534 (162) = happyGoto action_20 action_534 (163) = happyGoto action_21 action_534 (164) = happyGoto action_22 action_534 (165) = happyGoto action_23 action_534 (166) = happyGoto action_24 action_534 (167) = happyGoto action_25 action_534 (210) = happyGoto action_26 action_534 (217) = happyGoto action_27 action_534 (220) = happyGoto action_28 action_534 (241) = happyGoto action_30 action_534 (242) = happyGoto action_31 action_534 (243) = happyGoto action_117 action_534 (249) = happyGoto action_33 action_534 (251) = happyGoto action_34 action_534 (252) = happyGoto action_35 action_534 (255) = happyGoto action_36 action_534 _ = happyFail action_535 (266) = happyShift action_37 action_535 (267) = happyShift action_38 action_535 (268) = happyShift action_39 action_535 (273) = happyShift action_40 action_535 (275) = happyShift action_41 action_535 (276) = happyShift action_42 action_535 (283) = happyShift action_164 action_535 (287) = happyShift action_47 action_535 (291) = happyShift action_48 action_535 (293) = happyShift action_49 action_535 (294) = happyShift action_50 action_535 (295) = happyShift action_51 action_535 (296) = happyShift action_52 action_535 (297) = happyShift action_53 action_535 (298) = happyShift action_54 action_535 (299) = happyShift action_55 action_535 (300) = happyShift action_56 action_535 (301) = happyShift action_57 action_535 (302) = happyShift action_58 action_535 (303) = happyShift action_59 action_535 (304) = happyShift action_60 action_535 (305) = happyShift action_61 action_535 (306) = happyShift action_62 action_535 (307) = happyShift action_63 action_535 (309) = happyShift action_64 action_535 (318) = happyShift action_68 action_535 (319) = happyShift action_69 action_535 (320) = happyShift action_70 action_535 (336) = happyShift action_72 action_535 (342) = happyShift action_73 action_535 (345) = happyShift action_74 action_535 (346) = happyShift action_166 action_535 (357) = happyShift action_75 action_535 (359) = happyShift action_76 action_535 (361) = happyShift action_118 action_535 (363) = happyShift action_78 action_535 (365) = happyShift action_79 action_535 (370) = happyShift action_80 action_535 (371) = happyShift action_81 action_535 (372) = happyShift action_82 action_535 (375) = happyShift action_83 action_535 (376) = happyShift action_84 action_535 (379) = happyShift action_85 action_535 (380) = happyShift action_86 action_535 (381) = happyShift action_87 action_535 (382) = happyShift action_88 action_535 (383) = happyShift action_89 action_535 (384) = happyShift action_90 action_535 (385) = happyShift action_91 action_535 (386) = happyShift action_92 action_535 (387) = happyShift action_93 action_535 (388) = happyShift action_94 action_535 (389) = happyShift action_95 action_535 (390) = happyShift action_96 action_535 (391) = happyShift action_97 action_535 (396) = happyShift action_98 action_535 (397) = happyShift action_99 action_535 (398) = happyShift action_100 action_535 (399) = happyShift action_101 action_535 (401) = happyShift action_102 action_535 (403) = happyShift action_103 action_535 (404) = happyShift action_104 action_535 (405) = happyShift action_105 action_535 (406) = happyShift action_106 action_535 (407) = happyShift action_107 action_535 (408) = happyShift action_108 action_535 (409) = happyShift action_109 action_535 (38) = happyGoto action_13 action_535 (156) = happyGoto action_16 action_535 (157) = happyGoto action_160 action_535 (158) = happyGoto action_116 action_535 (159) = happyGoto action_18 action_535 (161) = happyGoto action_19 action_535 (162) = happyGoto action_20 action_535 (163) = happyGoto action_21 action_535 (164) = happyGoto action_22 action_535 (165) = happyGoto action_23 action_535 (166) = happyGoto action_24 action_535 (167) = happyGoto action_25 action_535 (183) = happyGoto action_739 action_535 (184) = happyGoto action_418 action_535 (196) = happyGoto action_161 action_535 (204) = happyGoto action_419 action_535 (210) = happyGoto action_26 action_535 (217) = happyGoto action_27 action_535 (220) = happyGoto action_28 action_535 (241) = happyGoto action_30 action_535 (242) = happyGoto action_31 action_535 (243) = happyGoto action_117 action_535 (249) = happyGoto action_33 action_535 (251) = happyGoto action_34 action_535 (252) = happyGoto action_35 action_535 (255) = happyGoto action_36 action_535 _ = happyFail action_536 (267) = happyShift action_38 action_536 (275) = happyShift action_41 action_536 (287) = happyShift action_47 action_536 (293) = happyShift action_49 action_536 (294) = happyShift action_50 action_536 (295) = happyShift action_51 action_536 (296) = happyShift action_231 action_536 (297) = happyShift action_232 action_536 (298) = happyShift action_233 action_536 (302) = happyShift action_58 action_536 (303) = happyShift action_59 action_536 (304) = happyShift action_60 action_536 (305) = happyShift action_61 action_536 (306) = happyShift action_62 action_536 (309) = happyShift action_64 action_536 (323) = happyShift action_236 action_536 (324) = happyShift action_237 action_536 (346) = happyShift action_238 action_536 (353) = happyShift action_239 action_536 (357) = happyShift action_240 action_536 (359) = happyShift action_241 action_536 (361) = happyShift action_242 action_536 (363) = happyShift action_243 action_536 (370) = happyShift action_244 action_536 (371) = happyShift action_245 action_536 (372) = happyShift action_246 action_536 (376) = happyShift action_247 action_536 (380) = happyShift action_248 action_536 (383) = happyShift action_249 action_536 (384) = happyShift action_250 action_536 (403) = happyShift action_251 action_536 (404) = happyShift action_252 action_536 (408) = happyShift action_108 action_536 (409) = happyShift action_109 action_536 (111) = happyGoto action_218 action_536 (115) = happyGoto action_738 action_536 (117) = happyGoto action_220 action_536 (118) = happyGoto action_221 action_536 (156) = happyGoto action_222 action_536 (224) = happyGoto action_223 action_536 (225) = happyGoto action_224 action_536 (227) = happyGoto action_225 action_536 (228) = happyGoto action_226 action_536 (237) = happyGoto action_227 action_536 (239) = happyGoto action_228 action_536 (249) = happyGoto action_229 action_536 _ = happyFail action_537 (290) = happyShift action_737 action_537 (78) = happyGoto action_736 action_537 _ = happyReduce_178 action_538 (126) = happyGoto action_733 action_538 (127) = happyGoto action_734 action_538 (128) = happyGoto action_735 action_538 _ = happyReduce_329 action_539 (334) = happyShift action_691 action_539 (64) = happyGoto action_732 action_539 _ = happyReduce_147 action_540 (368) = happyShift action_731 action_540 _ = happyReduce_318 action_541 (362) = happyShift action_730 action_541 _ = happyFail action_542 _ = happyReduce_316 action_543 _ = happyReduce_154 action_544 (352) = happyShift action_729 action_544 _ = happyFail action_545 (267) = happyShift action_38 action_545 (275) = happyShift action_41 action_545 (287) = happyShift action_47 action_545 (293) = happyShift action_49 action_545 (294) = happyShift action_50 action_545 (295) = happyShift action_51 action_545 (296) = happyShift action_231 action_545 (297) = happyShift action_232 action_545 (298) = happyShift action_233 action_545 (302) = happyShift action_58 action_545 (303) = happyShift action_59 action_545 (304) = happyShift action_60 action_545 (305) = happyShift action_61 action_545 (306) = happyShift action_62 action_545 (309) = happyShift action_64 action_545 (361) = happyShift action_547 action_545 (371) = happyShift action_245 action_545 (123) = happyGoto action_728 action_545 (124) = happyGoto action_545 action_545 (237) = happyGoto action_546 action_545 (239) = happyGoto action_228 action_545 (249) = happyGoto action_229 action_545 _ = happyReduce_321 action_546 _ = happyReduce_322 action_547 (267) = happyShift action_38 action_547 (275) = happyShift action_41 action_547 (287) = happyShift action_47 action_547 (293) = happyShift action_49 action_547 (294) = happyShift action_50 action_547 (295) = happyShift action_51 action_547 (296) = happyShift action_231 action_547 (297) = happyShift action_232 action_547 (298) = happyShift action_233 action_547 (302) = happyShift action_58 action_547 (303) = happyShift action_59 action_547 (304) = happyShift action_60 action_547 (305) = happyShift action_61 action_547 (306) = happyShift action_62 action_547 (309) = happyShift action_64 action_547 (371) = happyShift action_245 action_547 (237) = happyGoto action_727 action_547 (239) = happyGoto action_228 action_547 (249) = happyGoto action_229 action_547 _ = happyFail action_548 (267) = happyShift action_38 action_548 (275) = happyShift action_41 action_548 (287) = happyShift action_47 action_548 (293) = happyShift action_49 action_548 (294) = happyShift action_50 action_548 (295) = happyShift action_51 action_548 (296) = happyShift action_231 action_548 (297) = happyShift action_232 action_548 (298) = happyShift action_233 action_548 (302) = happyShift action_58 action_548 (303) = happyShift action_59 action_548 (304) = happyShift action_60 action_548 (305) = happyShift action_61 action_548 (306) = happyShift action_62 action_548 (309) = happyShift action_64 action_548 (323) = happyShift action_236 action_548 (324) = happyShift action_237 action_548 (346) = happyShift action_238 action_548 (353) = happyShift action_239 action_548 (357) = happyShift action_240 action_548 (359) = happyShift action_241 action_548 (361) = happyShift action_242 action_548 (363) = happyShift action_243 action_548 (370) = happyShift action_244 action_548 (371) = happyShift action_245 action_548 (372) = happyShift action_246 action_548 (376) = happyShift action_247 action_548 (380) = happyShift action_248 action_548 (383) = happyShift action_249 action_548 (384) = happyShift action_250 action_548 (403) = happyShift action_251 action_548 (404) = happyShift action_252 action_548 (408) = happyShift action_108 action_548 (409) = happyShift action_109 action_548 (111) = happyGoto action_218 action_548 (115) = happyGoto action_726 action_548 (117) = happyGoto action_220 action_548 (118) = happyGoto action_221 action_548 (156) = happyGoto action_222 action_548 (224) = happyGoto action_223 action_548 (225) = happyGoto action_224 action_548 (227) = happyGoto action_225 action_548 (228) = happyGoto action_226 action_548 (237) = happyGoto action_227 action_548 (239) = happyGoto action_228 action_548 (249) = happyGoto action_229 action_548 _ = happyFail action_549 _ = happyReduce_121 action_550 (353) = happyShift action_724 action_550 (355) = happyShift action_725 action_550 (81) = happyGoto action_723 action_550 _ = happyFail action_551 _ = happyReduce_289 action_552 (267) = happyShift action_38 action_552 (275) = happyShift action_41 action_552 (287) = happyShift action_47 action_552 (293) = happyShift action_49 action_552 (294) = happyShift action_50 action_552 (295) = happyShift action_51 action_552 (296) = happyShift action_231 action_552 (297) = happyShift action_232 action_552 (298) = happyShift action_233 action_552 (302) = happyShift action_58 action_552 (303) = happyShift action_59 action_552 (304) = happyShift action_60 action_552 (305) = happyShift action_61 action_552 (306) = happyShift action_62 action_552 (309) = happyShift action_64 action_552 (323) = happyShift action_236 action_552 (324) = happyShift action_237 action_552 (346) = happyShift action_238 action_552 (353) = happyShift action_239 action_552 (357) = happyShift action_240 action_552 (359) = happyShift action_241 action_552 (361) = happyShift action_242 action_552 (363) = happyShift action_243 action_552 (370) = happyShift action_244 action_552 (371) = happyShift action_245 action_552 (372) = happyShift action_246 action_552 (376) = happyShift action_247 action_552 (380) = happyShift action_248 action_552 (383) = happyShift action_249 action_552 (384) = happyShift action_250 action_552 (403) = happyShift action_251 action_552 (404) = happyShift action_252 action_552 (408) = happyShift action_108 action_552 (409) = happyShift action_109 action_552 (111) = happyGoto action_218 action_552 (115) = happyGoto action_722 action_552 (117) = happyGoto action_220 action_552 (118) = happyGoto action_221 action_552 (156) = happyGoto action_222 action_552 (224) = happyGoto action_223 action_552 (225) = happyGoto action_224 action_552 (227) = happyGoto action_225 action_552 (228) = happyGoto action_226 action_552 (237) = happyGoto action_227 action_552 (239) = happyGoto action_228 action_552 (249) = happyGoto action_229 action_552 _ = happyFail action_553 _ = happyReduce_606 action_554 (267) = happyShift action_38 action_554 (275) = happyShift action_41 action_554 (287) = happyShift action_47 action_554 (293) = happyShift action_49 action_554 (294) = happyShift action_50 action_554 (295) = happyShift action_51 action_554 (296) = happyShift action_231 action_554 (297) = happyShift action_232 action_554 (298) = happyShift action_233 action_554 (302) = happyShift action_58 action_554 (303) = happyShift action_59 action_554 (304) = happyShift action_60 action_554 (305) = happyShift action_61 action_554 (306) = happyShift action_62 action_554 (309) = happyShift action_64 action_554 (323) = happyShift action_236 action_554 (324) = happyShift action_237 action_554 (346) = happyShift action_238 action_554 (353) = happyShift action_239 action_554 (357) = happyShift action_240 action_554 (359) = happyShift action_241 action_554 (361) = happyShift action_242 action_554 (363) = happyShift action_243 action_554 (370) = happyShift action_244 action_554 (371) = happyShift action_245 action_554 (372) = happyShift action_246 action_554 (376) = happyShift action_247 action_554 (380) = happyShift action_248 action_554 (383) = happyShift action_249 action_554 (384) = happyShift action_250 action_554 (403) = happyShift action_251 action_554 (404) = happyShift action_252 action_554 (408) = happyShift action_108 action_554 (409) = happyShift action_109 action_554 (111) = happyGoto action_218 action_554 (115) = happyGoto action_721 action_554 (117) = happyGoto action_220 action_554 (118) = happyGoto action_221 action_554 (156) = happyGoto action_222 action_554 (224) = happyGoto action_223 action_554 (225) = happyGoto action_224 action_554 (227) = happyGoto action_225 action_554 (228) = happyGoto action_226 action_554 (237) = happyGoto action_227 action_554 (239) = happyGoto action_228 action_554 (249) = happyGoto action_229 action_554 _ = happyFail action_555 (267) = happyShift action_38 action_555 (275) = happyShift action_41 action_555 (287) = happyShift action_47 action_555 (291) = happyShift action_260 action_555 (293) = happyShift action_49 action_555 (294) = happyShift action_50 action_555 (295) = happyShift action_51 action_555 (296) = happyShift action_231 action_555 (297) = happyShift action_232 action_555 (298) = happyShift action_233 action_555 (302) = happyShift action_58 action_555 (303) = happyShift action_59 action_555 (304) = happyShift action_60 action_555 (305) = happyShift action_61 action_555 (306) = happyShift action_62 action_555 (309) = happyShift action_64 action_555 (323) = happyShift action_236 action_555 (324) = happyShift action_237 action_555 (346) = happyShift action_238 action_555 (353) = happyShift action_239 action_555 (357) = happyShift action_240 action_555 (359) = happyShift action_241 action_555 (361) = happyShift action_242 action_555 (363) = happyShift action_243 action_555 (370) = happyShift action_244 action_555 (371) = happyShift action_245 action_555 (372) = happyShift action_246 action_555 (376) = happyShift action_247 action_555 (380) = happyShift action_248 action_555 (381) = happyShift action_87 action_555 (383) = happyShift action_249 action_555 (384) = happyShift action_250 action_555 (403) = happyShift action_251 action_555 (404) = happyShift action_252 action_555 (408) = happyShift action_108 action_555 (409) = happyShift action_109 action_555 (111) = happyGoto action_218 action_555 (112) = happyGoto action_720 action_555 (114) = happyGoto action_255 action_555 (115) = happyGoto action_256 action_555 (117) = happyGoto action_257 action_555 (118) = happyGoto action_221 action_555 (156) = happyGoto action_222 action_555 (210) = happyGoto action_259 action_555 (224) = happyGoto action_223 action_555 (225) = happyGoto action_224 action_555 (227) = happyGoto action_225 action_555 (228) = happyGoto action_226 action_555 (237) = happyGoto action_227 action_555 (239) = happyGoto action_228 action_555 (249) = happyGoto action_229 action_555 _ = happyFail action_556 (267) = happyShift action_38 action_556 (275) = happyShift action_41 action_556 (287) = happyShift action_47 action_556 (293) = happyShift action_49 action_556 (294) = happyShift action_50 action_556 (295) = happyShift action_51 action_556 (296) = happyShift action_231 action_556 (297) = happyShift action_232 action_556 (298) = happyShift action_233 action_556 (302) = happyShift action_58 action_556 (303) = happyShift action_59 action_556 (304) = happyShift action_60 action_556 (305) = happyShift action_61 action_556 (306) = happyShift action_62 action_556 (309) = happyShift action_64 action_556 (323) = happyShift action_236 action_556 (324) = happyShift action_237 action_556 (346) = happyShift action_238 action_556 (353) = happyShift action_239 action_556 (357) = happyShift action_240 action_556 (359) = happyShift action_241 action_556 (361) = happyShift action_242 action_556 (363) = happyShift action_243 action_556 (370) = happyShift action_244 action_556 (371) = happyShift action_245 action_556 (372) = happyShift action_246 action_556 (376) = happyShift action_247 action_556 (380) = happyShift action_248 action_556 (383) = happyShift action_249 action_556 (384) = happyShift action_250 action_556 (403) = happyShift action_251 action_556 (404) = happyShift action_252 action_556 (408) = happyShift action_108 action_556 (409) = happyShift action_109 action_556 (111) = happyGoto action_218 action_556 (117) = happyGoto action_719 action_556 (118) = happyGoto action_221 action_556 (156) = happyGoto action_222 action_556 (224) = happyGoto action_223 action_556 (225) = happyGoto action_224 action_556 (227) = happyGoto action_225 action_556 (228) = happyGoto action_226 action_556 (237) = happyGoto action_227 action_556 (239) = happyGoto action_228 action_556 (249) = happyGoto action_229 action_556 _ = happyFail action_557 _ = happyReduce_633 action_558 (267) = happyShift action_38 action_558 (275) = happyShift action_41 action_558 (287) = happyShift action_47 action_558 (293) = happyShift action_49 action_558 (294) = happyShift action_50 action_558 (295) = happyShift action_51 action_558 (296) = happyShift action_231 action_558 (297) = happyShift action_232 action_558 (298) = happyShift action_233 action_558 (302) = happyShift action_58 action_558 (303) = happyShift action_59 action_558 (304) = happyShift action_60 action_558 (305) = happyShift action_61 action_558 (306) = happyShift action_62 action_558 (309) = happyShift action_64 action_558 (371) = happyShift action_245 action_558 (372) = happyShift action_246 action_558 (376) = happyShift action_247 action_558 (380) = happyShift action_248 action_558 (227) = happyGoto action_717 action_558 (228) = happyGoto action_226 action_558 (239) = happyGoto action_718 action_558 (249) = happyGoto action_229 action_558 _ = happyFail action_559 (267) = happyShift action_38 action_559 (275) = happyShift action_41 action_559 (287) = happyShift action_47 action_559 (291) = happyShift action_48 action_559 (293) = happyShift action_49 action_559 (294) = happyShift action_50 action_559 (295) = happyShift action_51 action_559 (296) = happyShift action_52 action_559 (297) = happyShift action_53 action_559 (298) = happyShift action_54 action_559 (300) = happyShift action_56 action_559 (301) = happyShift action_57 action_559 (302) = happyShift action_58 action_559 (303) = happyShift action_59 action_559 (304) = happyShift action_60 action_559 (305) = happyShift action_61 action_559 (306) = happyShift action_62 action_559 (309) = happyShift action_64 action_559 (333) = happyShift action_278 action_559 (345) = happyShift action_280 action_559 (346) = happyShift action_281 action_559 (347) = happyShift action_282 action_559 (352) = happyShift action_283 action_559 (357) = happyShift action_564 action_559 (361) = happyShift action_565 action_559 (363) = happyShift action_201 action_559 (369) = happyShift action_716 action_559 (371) = happyShift action_81 action_559 (372) = happyShift action_82 action_559 (373) = happyShift action_285 action_559 (374) = happyShift action_286 action_559 (376) = happyShift action_84 action_559 (378) = happyShift action_288 action_559 (380) = happyShift action_86 action_559 (217) = happyGoto action_562 action_559 (220) = happyGoto action_28 action_559 (222) = happyGoto action_714 action_559 (232) = happyGoto action_715 action_559 (240) = happyGoto action_563 action_559 (243) = happyGoto action_195 action_559 (247) = happyGoto action_396 action_559 (248) = happyGoto action_274 action_559 (249) = happyGoto action_33 action_559 (250) = happyGoto action_275 action_559 (251) = happyGoto action_34 action_559 (252) = happyGoto action_35 action_559 (253) = happyGoto action_276 action_559 (254) = happyGoto action_277 action_559 _ = happyFail action_560 (267) = happyShift action_38 action_560 (275) = happyShift action_41 action_560 (287) = happyShift action_47 action_560 (291) = happyShift action_260 action_560 (293) = happyShift action_49 action_560 (294) = happyShift action_50 action_560 (295) = happyShift action_51 action_560 (296) = happyShift action_231 action_560 (297) = happyShift action_232 action_560 (298) = happyShift action_233 action_560 (302) = happyShift action_58 action_560 (303) = happyShift action_59 action_560 (304) = happyShift action_60 action_560 (305) = happyShift action_61 action_560 (306) = happyShift action_62 action_560 (309) = happyShift action_64 action_560 (323) = happyShift action_236 action_560 (324) = happyShift action_237 action_560 (346) = happyShift action_238 action_560 (353) = happyShift action_239 action_560 (357) = happyShift action_240 action_560 (359) = happyShift action_241 action_560 (361) = happyShift action_242 action_560 (363) = happyShift action_243 action_560 (370) = happyShift action_244 action_560 (371) = happyShift action_245 action_560 (372) = happyShift action_246 action_560 (376) = happyShift action_247 action_560 (380) = happyShift action_248 action_560 (381) = happyShift action_87 action_560 (383) = happyShift action_249 action_560 (384) = happyShift action_250 action_560 (403) = happyShift action_251 action_560 (404) = happyShift action_252 action_560 (408) = happyShift action_108 action_560 (409) = happyShift action_109 action_560 (111) = happyGoto action_218 action_560 (112) = happyGoto action_713 action_560 (114) = happyGoto action_255 action_560 (115) = happyGoto action_256 action_560 (117) = happyGoto action_257 action_560 (118) = happyGoto action_221 action_560 (156) = happyGoto action_222 action_560 (210) = happyGoto action_259 action_560 (224) = happyGoto action_223 action_560 (225) = happyGoto action_224 action_560 (227) = happyGoto action_225 action_560 (228) = happyGoto action_226 action_560 (237) = happyGoto action_227 action_560 (239) = happyGoto action_228 action_560 (249) = happyGoto action_229 action_560 _ = happyFail action_561 (362) = happyShift action_712 action_561 _ = happyFail action_562 _ = happyReduce_306 action_563 _ = happyReduce_309 action_564 (267) = happyShift action_38 action_564 (275) = happyShift action_41 action_564 (287) = happyShift action_47 action_564 (291) = happyShift action_260 action_564 (293) = happyShift action_49 action_564 (294) = happyShift action_50 action_564 (295) = happyShift action_51 action_564 (296) = happyShift action_231 action_564 (297) = happyShift action_232 action_564 (298) = happyShift action_233 action_564 (302) = happyShift action_58 action_564 (303) = happyShift action_59 action_564 (304) = happyShift action_60 action_564 (305) = happyShift action_61 action_564 (306) = happyShift action_62 action_564 (309) = happyShift action_64 action_564 (323) = happyShift action_236 action_564 (324) = happyShift action_237 action_564 (346) = happyShift action_238 action_564 (353) = happyShift action_239 action_564 (357) = happyShift action_240 action_564 (358) = happyShift action_349 action_564 (359) = happyShift action_241 action_564 (361) = happyShift action_242 action_564 (363) = happyShift action_243 action_564 (370) = happyShift action_244 action_564 (371) = happyShift action_245 action_564 (372) = happyShift action_246 action_564 (376) = happyShift action_247 action_564 (380) = happyShift action_248 action_564 (381) = happyShift action_87 action_564 (383) = happyShift action_249 action_564 (384) = happyShift action_250 action_564 (403) = happyShift action_251 action_564 (404) = happyShift action_252 action_564 (408) = happyShift action_108 action_564 (409) = happyShift action_109 action_564 (111) = happyGoto action_218 action_564 (112) = happyGoto action_540 action_564 (114) = happyGoto action_255 action_564 (115) = happyGoto action_256 action_564 (117) = happyGoto action_257 action_564 (118) = happyGoto action_221 action_564 (121) = happyGoto action_711 action_564 (122) = happyGoto action_542 action_564 (156) = happyGoto action_222 action_564 (210) = happyGoto action_259 action_564 (224) = happyGoto action_223 action_564 (225) = happyGoto action_224 action_564 (227) = happyGoto action_225 action_564 (228) = happyGoto action_226 action_564 (237) = happyGoto action_227 action_564 (239) = happyGoto action_228 action_564 (249) = happyGoto action_229 action_564 _ = happyFail action_565 (267) = happyShift action_38 action_565 (275) = happyShift action_41 action_565 (287) = happyShift action_47 action_565 (291) = happyShift action_260 action_565 (293) = happyShift action_49 action_565 (294) = happyShift action_50 action_565 (295) = happyShift action_51 action_565 (296) = happyShift action_231 action_565 (297) = happyShift action_232 action_565 (298) = happyShift action_233 action_565 (302) = happyShift action_58 action_565 (303) = happyShift action_59 action_565 (304) = happyShift action_60 action_565 (305) = happyShift action_61 action_565 (306) = happyShift action_62 action_565 (309) = happyShift action_64 action_565 (323) = happyShift action_236 action_565 (324) = happyShift action_237 action_565 (333) = happyShift action_278 action_565 (345) = happyShift action_280 action_565 (346) = happyShift action_710 action_565 (347) = happyShift action_282 action_565 (352) = happyShift action_283 action_565 (353) = happyShift action_239 action_565 (357) = happyShift action_240 action_565 (359) = happyShift action_241 action_565 (361) = happyShift action_242 action_565 (362) = happyShift action_306 action_565 (363) = happyShift action_243 action_565 (368) = happyShift action_307 action_565 (370) = happyShift action_244 action_565 (371) = happyShift action_245 action_565 (372) = happyShift action_246 action_565 (373) = happyShift action_285 action_565 (374) = happyShift action_286 action_565 (376) = happyShift action_247 action_565 (378) = happyShift action_288 action_565 (380) = happyShift action_248 action_565 (381) = happyShift action_87 action_565 (383) = happyShift action_249 action_565 (384) = happyShift action_250 action_565 (403) = happyShift action_251 action_565 (404) = happyShift action_252 action_565 (408) = happyShift action_108 action_565 (409) = happyShift action_109 action_565 (111) = happyGoto action_218 action_565 (112) = happyGoto action_709 action_565 (114) = happyGoto action_255 action_565 (115) = happyGoto action_256 action_565 (117) = happyGoto action_257 action_565 (118) = happyGoto action_221 action_565 (156) = happyGoto action_222 action_565 (210) = happyGoto action_259 action_565 (224) = happyGoto action_223 action_565 (225) = happyGoto action_224 action_565 (227) = happyGoto action_225 action_565 (228) = happyGoto action_226 action_565 (237) = happyGoto action_227 action_565 (239) = happyGoto action_228 action_565 (247) = happyGoto action_440 action_565 (248) = happyGoto action_274 action_565 (249) = happyGoto action_229 action_565 (250) = happyGoto action_275 action_565 (253) = happyGoto action_472 action_565 (254) = happyGoto action_277 action_565 (258) = happyGoto action_442 action_565 _ = happyFail action_566 (364) = happyShift action_708 action_566 _ = happyFail action_567 _ = happyReduce_297 action_568 (334) = happyShift action_705 action_568 (362) = happyShift action_706 action_568 (368) = happyShift action_707 action_568 _ = happyFail action_569 _ = happyReduce_295 action_570 (360) = happyShift action_704 action_570 _ = happyFail action_571 (358) = happyShift action_702 action_571 (368) = happyShift action_703 action_571 _ = happyFail action_572 (354) = happyShift action_701 action_572 _ = happyFail action_573 _ = happyReduce_363 action_574 (368) = happyReduce_709 action_574 (392) = happyShift action_154 action_574 (259) = happyGoto action_575 action_574 (265) = happyGoto action_700 action_574 _ = happyReduce_365 action_575 _ = happyReduce_708 action_576 (267) = happyShift action_38 action_576 (275) = happyShift action_41 action_576 (287) = happyShift action_47 action_576 (291) = happyShift action_48 action_576 (293) = happyShift action_49 action_576 (294) = happyShift action_50 action_576 (295) = happyShift action_51 action_576 (296) = happyShift action_52 action_576 (297) = happyShift action_53 action_576 (298) = happyShift action_54 action_576 (300) = happyShift action_56 action_576 (301) = happyShift action_57 action_576 (302) = happyShift action_58 action_576 (303) = happyShift action_59 action_576 (304) = happyShift action_60 action_576 (305) = happyShift action_61 action_576 (306) = happyShift action_62 action_576 (309) = happyShift action_64 action_576 (361) = happyShift action_413 action_576 (371) = happyShift action_81 action_576 (109) = happyGoto action_699 action_576 (240) = happyGoto action_412 action_576 (243) = happyGoto action_195 action_576 (249) = happyGoto action_33 action_576 _ = happyFail action_577 (346) = happyShift action_698 action_577 _ = happyReduce_258 action_578 (346) = happyShift action_697 action_578 _ = happyReduce_257 action_579 (266) = happyShift action_695 action_579 (371) = happyShift action_696 action_579 (69) = happyGoto action_692 action_579 (70) = happyGoto action_693 action_579 (71) = happyGoto action_694 action_579 _ = happyReduce_156 action_580 (342) = happyShift action_491 action_580 (345) = happyShift action_493 action_580 (347) = happyShift action_494 action_580 (373) = happyShift action_496 action_580 (374) = happyShift action_497 action_580 (377) = happyShift action_498 action_580 (378) = happyShift action_499 action_580 (229) = happyGoto action_487 action_580 (230) = happyGoto action_488 action_580 _ = happyFail action_581 (334) = happyShift action_691 action_581 (64) = happyGoto action_690 action_581 _ = happyReduce_147 action_582 _ = happyReduce_122 action_583 (335) = happyShift action_689 action_583 _ = happyFail action_584 (267) = happyShift action_38 action_584 (275) = happyShift action_41 action_584 (287) = happyShift action_47 action_584 (293) = happyShift action_49 action_584 (294) = happyShift action_50 action_584 (295) = happyShift action_51 action_584 (296) = happyShift action_231 action_584 (297) = happyShift action_232 action_584 (298) = happyShift action_233 action_584 (302) = happyShift action_58 action_584 (303) = happyShift action_59 action_584 (304) = happyShift action_60 action_584 (305) = happyShift action_61 action_584 (306) = happyShift action_62 action_584 (309) = happyShift action_64 action_584 (323) = happyShift action_236 action_584 (324) = happyShift action_237 action_584 (346) = happyShift action_238 action_584 (353) = happyShift action_239 action_584 (357) = happyShift action_240 action_584 (359) = happyShift action_241 action_584 (361) = happyShift action_242 action_584 (363) = happyShift action_243 action_584 (370) = happyShift action_244 action_584 (371) = happyShift action_245 action_584 (372) = happyShift action_246 action_584 (376) = happyShift action_247 action_584 (380) = happyShift action_248 action_584 (383) = happyShift action_249 action_584 (384) = happyShift action_250 action_584 (403) = happyShift action_251 action_584 (404) = happyShift action_252 action_584 (408) = happyShift action_108 action_584 (409) = happyShift action_109 action_584 (111) = happyGoto action_218 action_584 (117) = happyGoto action_688 action_584 (118) = happyGoto action_221 action_584 (156) = happyGoto action_222 action_584 (224) = happyGoto action_223 action_584 (225) = happyGoto action_224 action_584 (227) = happyGoto action_225 action_584 (228) = happyGoto action_226 action_584 (237) = happyGoto action_227 action_584 (239) = happyGoto action_228 action_584 (249) = happyGoto action_229 action_584 _ = happyFail action_585 (267) = happyShift action_38 action_585 (275) = happyShift action_41 action_585 (287) = happyShift action_47 action_585 (291) = happyShift action_405 action_585 (293) = happyShift action_49 action_585 (294) = happyShift action_50 action_585 (295) = happyShift action_51 action_585 (296) = happyShift action_231 action_585 (297) = happyShift action_232 action_585 (298) = happyShift action_233 action_585 (302) = happyShift action_58 action_585 (303) = happyShift action_59 action_585 (304) = happyShift action_60 action_585 (305) = happyShift action_61 action_585 (306) = happyShift action_62 action_585 (309) = happyShift action_64 action_585 (323) = happyShift action_236 action_585 (324) = happyShift action_237 action_585 (346) = happyShift action_238 action_585 (353) = happyShift action_239 action_585 (357) = happyShift action_240 action_585 (359) = happyShift action_241 action_585 (361) = happyShift action_242 action_585 (363) = happyShift action_243 action_585 (370) = happyShift action_244 action_585 (371) = happyShift action_245 action_585 (372) = happyShift action_246 action_585 (376) = happyShift action_247 action_585 (380) = happyShift action_248 action_585 (381) = happyShift action_87 action_585 (383) = happyShift action_249 action_585 (384) = happyShift action_250 action_585 (403) = happyShift action_251 action_585 (404) = happyShift action_252 action_585 (408) = happyShift action_108 action_585 (409) = happyShift action_109 action_585 (111) = happyGoto action_218 action_585 (113) = happyGoto action_687 action_585 (114) = happyGoto action_401 action_585 (116) = happyGoto action_402 action_585 (117) = happyGoto action_403 action_585 (118) = happyGoto action_221 action_585 (156) = happyGoto action_222 action_585 (210) = happyGoto action_404 action_585 (224) = happyGoto action_223 action_585 (225) = happyGoto action_224 action_585 (227) = happyGoto action_225 action_585 (228) = happyGoto action_226 action_585 (237) = happyGoto action_227 action_585 (239) = happyGoto action_228 action_585 (249) = happyGoto action_229 action_585 _ = happyFail action_586 _ = happyReduce_293 action_587 (267) = happyShift action_38 action_587 (275) = happyShift action_41 action_587 (287) = happyShift action_47 action_587 (291) = happyShift action_48 action_587 (293) = happyShift action_49 action_587 (294) = happyShift action_50 action_587 (295) = happyShift action_51 action_587 (296) = happyShift action_52 action_587 (297) = happyShift action_53 action_587 (298) = happyShift action_54 action_587 (300) = happyShift action_56 action_587 (301) = happyShift action_57 action_587 (302) = happyShift action_58 action_587 (303) = happyShift action_59 action_587 (304) = happyShift action_60 action_587 (305) = happyShift action_61 action_587 (306) = happyShift action_62 action_587 (309) = happyShift action_64 action_587 (361) = happyShift action_413 action_587 (371) = happyShift action_81 action_587 (383) = happyShift action_685 action_587 (104) = happyGoto action_686 action_587 (240) = happyGoto action_681 action_587 (243) = happyGoto action_195 action_587 (249) = happyGoto action_33 action_587 _ = happyFail action_588 _ = happyReduce_236 action_589 _ = happyReduce_237 action_590 _ = happyReduce_238 action_591 _ = happyReduce_239 action_592 _ = happyReduce_240 action_593 (267) = happyShift action_38 action_593 (275) = happyShift action_41 action_593 (287) = happyShift action_47 action_593 (291) = happyShift action_48 action_593 (293) = happyShift action_49 action_593 (294) = happyShift action_50 action_593 (295) = happyShift action_51 action_593 (296) = happyShift action_682 action_593 (297) = happyShift action_683 action_593 (298) = happyShift action_684 action_593 (300) = happyShift action_56 action_593 (301) = happyShift action_57 action_593 (302) = happyShift action_58 action_593 (303) = happyShift action_59 action_593 (304) = happyShift action_60 action_593 (305) = happyShift action_61 action_593 (306) = happyShift action_62 action_593 (309) = happyShift action_64 action_593 (361) = happyShift action_413 action_593 (371) = happyShift action_81 action_593 (383) = happyShift action_685 action_593 (103) = happyGoto action_679 action_593 (104) = happyGoto action_680 action_593 (240) = happyGoto action_681 action_593 (243) = happyGoto action_195 action_593 (249) = happyGoto action_33 action_593 _ = happyFail action_594 (267) = happyShift action_38 action_594 (275) = happyShift action_41 action_594 (287) = happyShift action_47 action_594 (291) = happyShift action_48 action_594 (293) = happyShift action_49 action_594 (294) = happyShift action_50 action_594 (295) = happyShift action_51 action_594 (296) = happyShift action_52 action_594 (297) = happyShift action_53 action_594 (298) = happyShift action_54 action_594 (300) = happyShift action_56 action_594 (301) = happyShift action_57 action_594 (302) = happyShift action_58 action_594 (303) = happyShift action_59 action_594 (304) = happyShift action_60 action_594 (305) = happyShift action_61 action_594 (306) = happyShift action_62 action_594 (309) = happyShift action_64 action_594 (371) = happyShift action_81 action_594 (243) = happyGoto action_678 action_594 (249) = happyGoto action_33 action_594 _ = happyFail action_595 (372) = happyShift action_82 action_595 (252) = happyGoto action_677 action_595 _ = happyFail action_596 (335) = happyShift action_675 action_596 (339) = happyShift action_676 action_596 (74) = happyGoto action_674 action_596 _ = happyFail action_597 (267) = happyShift action_38 action_597 (275) = happyShift action_41 action_597 (287) = happyShift action_47 action_597 (291) = happyShift action_48 action_597 (293) = happyShift action_49 action_597 (294) = happyShift action_50 action_597 (295) = happyShift action_51 action_597 (296) = happyShift action_52 action_597 (297) = happyShift action_53 action_597 (298) = happyShift action_54 action_597 (300) = happyShift action_56 action_597 (301) = happyShift action_57 action_597 (302) = happyShift action_58 action_597 (303) = happyShift action_59 action_597 (304) = happyShift action_60 action_597 (305) = happyShift action_61 action_597 (306) = happyShift action_62 action_597 (309) = happyShift action_64 action_597 (371) = happyShift action_81 action_597 (73) = happyGoto action_673 action_597 (243) = happyGoto action_597 action_597 (249) = happyGoto action_33 action_597 _ = happyReduce_164 action_598 (291) = happyShift action_672 action_598 (91) = happyGoto action_671 action_598 _ = happyReduce_211 action_599 _ = happyReduce_206 action_600 (342) = happyShift action_669 action_600 (384) = happyShift action_670 action_600 _ = happyFail action_601 _ = happyReduce_104 action_602 (383) = happyShift action_211 action_602 (88) = happyGoto action_668 action_602 _ = happyReduce_201 action_603 _ = happyReduce_225 action_604 (383) = happyShift action_667 action_604 (99) = happyGoto action_666 action_604 _ = happyFail action_605 _ = happyReduce_226 action_606 _ = happyReduce_102 action_607 (267) = happyShift action_38 action_607 (275) = happyShift action_41 action_607 (287) = happyShift action_47 action_607 (291) = happyShift action_48 action_607 (293) = happyShift action_49 action_607 (294) = happyShift action_50 action_607 (295) = happyShift action_51 action_607 (296) = happyShift action_52 action_607 (297) = happyShift action_53 action_607 (298) = happyShift action_54 action_607 (300) = happyShift action_56 action_607 (301) = happyShift action_57 action_607 (302) = happyShift action_58 action_607 (303) = happyShift action_59 action_607 (304) = happyShift action_60 action_607 (305) = happyShift action_61 action_607 (306) = happyShift action_62 action_607 (309) = happyShift action_64 action_607 (357) = happyShift action_199 action_607 (361) = happyShift action_200 action_607 (363) = happyShift action_201 action_607 (371) = happyShift action_81 action_607 (372) = happyShift action_82 action_607 (97) = happyGoto action_665 action_607 (215) = happyGoto action_208 action_607 (216) = happyGoto action_205 action_607 (218) = happyGoto action_192 action_607 (220) = happyGoto action_193 action_607 (240) = happyGoto action_194 action_607 (243) = happyGoto action_195 action_607 (249) = happyGoto action_33 action_607 (252) = happyGoto action_196 action_607 _ = happyReduce_222 action_608 (267) = happyShift action_38 action_608 (275) = happyShift action_41 action_608 (287) = happyShift action_47 action_608 (291) = happyShift action_48 action_608 (293) = happyShift action_49 action_608 (294) = happyShift action_50 action_608 (295) = happyShift action_51 action_608 (296) = happyShift action_52 action_608 (297) = happyShift action_53 action_608 (298) = happyShift action_54 action_608 (300) = happyShift action_56 action_608 (301) = happyShift action_57 action_608 (302) = happyShift action_58 action_608 (303) = happyShift action_59 action_608 (304) = happyShift action_60 action_608 (305) = happyShift action_61 action_608 (306) = happyShift action_62 action_608 (309) = happyShift action_64 action_608 (357) = happyShift action_199 action_608 (361) = happyShift action_200 action_608 (363) = happyShift action_201 action_608 (371) = happyShift action_81 action_608 (372) = happyShift action_82 action_608 (215) = happyGoto action_664 action_608 (216) = happyGoto action_205 action_608 (218) = happyGoto action_192 action_608 (220) = happyGoto action_193 action_608 (240) = happyGoto action_194 action_608 (243) = happyGoto action_195 action_608 (249) = happyGoto action_33 action_608 (252) = happyGoto action_196 action_608 _ = happyFail action_609 _ = happyReduce_220 action_610 _ = happyReduce_103 action_611 (267) = happyShift action_38 action_611 (275) = happyShift action_41 action_611 (287) = happyShift action_47 action_611 (291) = happyShift action_48 action_611 (293) = happyShift action_49 action_611 (294) = happyShift action_50 action_611 (295) = happyShift action_51 action_611 (296) = happyShift action_52 action_611 (297) = happyShift action_53 action_611 (298) = happyShift action_54 action_611 (300) = happyShift action_56 action_611 (301) = happyShift action_57 action_611 (302) = happyShift action_58 action_611 (303) = happyShift action_59 action_611 (304) = happyShift action_60 action_611 (305) = happyShift action_61 action_611 (306) = happyShift action_62 action_611 (309) = happyShift action_64 action_611 (357) = happyShift action_199 action_611 (361) = happyShift action_200 action_611 (363) = happyShift action_201 action_611 (371) = happyShift action_81 action_611 (372) = happyShift action_82 action_611 (95) = happyGoto action_663 action_611 (215) = happyGoto action_204 action_611 (216) = happyGoto action_205 action_611 (218) = happyGoto action_192 action_611 (220) = happyGoto action_193 action_611 (240) = happyGoto action_194 action_611 (243) = happyGoto action_195 action_611 (249) = happyGoto action_33 action_611 (252) = happyGoto action_196 action_611 _ = happyReduce_217 action_612 (364) = happyShift action_464 action_612 (368) = happyShift action_465 action_612 _ = happyFail action_613 (266) = happyShift action_37 action_613 (267) = happyShift action_38 action_613 (275) = happyShift action_41 action_613 (287) = happyShift action_47 action_613 (291) = happyShift action_48 action_613 (293) = happyShift action_49 action_613 (294) = happyShift action_50 action_613 (295) = happyShift action_51 action_613 (296) = happyShift action_52 action_613 (297) = happyShift action_53 action_613 (298) = happyShift action_54 action_613 (300) = happyShift action_56 action_613 (301) = happyShift action_57 action_613 (302) = happyShift action_58 action_613 (303) = happyShift action_59 action_613 (304) = happyShift action_60 action_613 (305) = happyShift action_61 action_613 (306) = happyShift action_62 action_613 (309) = happyShift action_64 action_613 (342) = happyShift action_73 action_613 (357) = happyShift action_75 action_613 (359) = happyShift action_76 action_613 (361) = happyShift action_118 action_613 (363) = happyShift action_78 action_613 (365) = happyShift action_79 action_613 (370) = happyShift action_80 action_613 (371) = happyShift action_81 action_613 (372) = happyShift action_82 action_613 (375) = happyShift action_83 action_613 (376) = happyShift action_84 action_613 (379) = happyShift action_85 action_613 (380) = happyShift action_86 action_613 (381) = happyShift action_87 action_613 (382) = happyShift action_88 action_613 (383) = happyShift action_89 action_613 (384) = happyShift action_90 action_613 (385) = happyShift action_91 action_613 (386) = happyShift action_92 action_613 (387) = happyShift action_93 action_613 (388) = happyShift action_94 action_613 (389) = happyShift action_95 action_613 (390) = happyShift action_96 action_613 (391) = happyShift action_97 action_613 (396) = happyShift action_98 action_613 (397) = happyShift action_99 action_613 (398) = happyShift action_100 action_613 (399) = happyShift action_101 action_613 (401) = happyShift action_102 action_613 (403) = happyShift action_103 action_613 (404) = happyShift action_104 action_613 (405) = happyShift action_105 action_613 (406) = happyShift action_106 action_613 (407) = happyShift action_107 action_613 (408) = happyShift action_108 action_613 (409) = happyShift action_109 action_613 (38) = happyGoto action_13 action_613 (156) = happyGoto action_16 action_613 (164) = happyGoto action_662 action_613 (165) = happyGoto action_23 action_613 (166) = happyGoto action_24 action_613 (167) = happyGoto action_25 action_613 (210) = happyGoto action_26 action_613 (217) = happyGoto action_27 action_613 (220) = happyGoto action_28 action_613 (241) = happyGoto action_30 action_613 (242) = happyGoto action_31 action_613 (243) = happyGoto action_117 action_613 (249) = happyGoto action_33 action_613 (251) = happyGoto action_34 action_613 (252) = happyGoto action_35 action_613 (255) = happyGoto action_36 action_613 _ = happyFail action_614 (331) = happyShift action_661 action_614 _ = happyFail action_615 (331) = happyShift action_660 action_615 _ = happyFail action_616 (331) = happyShift action_658 action_616 (335) = happyShift action_659 action_616 _ = happyFail action_617 (331) = happyShift action_657 action_617 _ = happyFail action_618 (266) = happyShift action_37 action_618 (267) = happyShift action_38 action_618 (268) = happyShift action_39 action_618 (273) = happyShift action_40 action_618 (275) = happyShift action_41 action_618 (276) = happyShift action_42 action_618 (283) = happyShift action_46 action_618 (287) = happyShift action_47 action_618 (291) = happyShift action_48 action_618 (293) = happyShift action_49 action_618 (294) = happyShift action_50 action_618 (295) = happyShift action_51 action_618 (296) = happyShift action_52 action_618 (297) = happyShift action_53 action_618 (298) = happyShift action_54 action_618 (299) = happyShift action_55 action_618 (300) = happyShift action_56 action_618 (301) = happyShift action_57 action_618 (302) = happyShift action_58 action_618 (303) = happyShift action_59 action_618 (304) = happyShift action_60 action_618 (305) = happyShift action_61 action_618 (306) = happyShift action_62 action_618 (307) = happyShift action_63 action_618 (309) = happyShift action_64 action_618 (318) = happyShift action_68 action_618 (319) = happyShift action_69 action_618 (320) = happyShift action_70 action_618 (336) = happyShift action_72 action_618 (342) = happyShift action_73 action_618 (345) = happyShift action_74 action_618 (357) = happyShift action_75 action_618 (359) = happyShift action_76 action_618 (361) = happyShift action_118 action_618 (363) = happyShift action_78 action_618 (365) = happyShift action_79 action_618 (370) = happyShift action_80 action_618 (371) = happyShift action_81 action_618 (372) = happyShift action_82 action_618 (375) = happyShift action_83 action_618 (376) = happyShift action_84 action_618 (379) = happyShift action_85 action_618 (380) = happyShift action_86 action_618 (381) = happyShift action_87 action_618 (382) = happyShift action_88 action_618 (383) = happyShift action_89 action_618 (384) = happyShift action_90 action_618 (385) = happyShift action_91 action_618 (386) = happyShift action_92 action_618 (387) = happyShift action_93 action_618 (388) = happyShift action_94 action_618 (389) = happyShift action_95 action_618 (390) = happyShift action_96 action_618 (391) = happyShift action_97 action_618 (396) = happyShift action_98 action_618 (397) = happyShift action_99 action_618 (398) = happyShift action_100 action_618 (399) = happyShift action_101 action_618 (401) = happyShift action_102 action_618 (403) = happyShift action_103 action_618 (404) = happyShift action_104 action_618 (405) = happyShift action_105 action_618 (406) = happyShift action_106 action_618 (407) = happyShift action_107 action_618 (408) = happyShift action_108 action_618 (409) = happyShift action_109 action_618 (38) = happyGoto action_13 action_618 (156) = happyGoto action_16 action_618 (157) = happyGoto action_656 action_618 (158) = happyGoto action_116 action_618 (159) = happyGoto action_18 action_618 (161) = happyGoto action_19 action_618 (162) = happyGoto action_20 action_618 (163) = happyGoto action_21 action_618 (164) = happyGoto action_22 action_618 (165) = happyGoto action_23 action_618 (166) = happyGoto action_24 action_618 (167) = happyGoto action_25 action_618 (210) = happyGoto action_26 action_618 (217) = happyGoto action_27 action_618 (220) = happyGoto action_28 action_618 (241) = happyGoto action_30 action_618 (242) = happyGoto action_31 action_618 (243) = happyGoto action_117 action_618 (249) = happyGoto action_33 action_618 (251) = happyGoto action_34 action_618 (252) = happyGoto action_35 action_618 (255) = happyGoto action_36 action_618 _ = happyFail action_619 (331) = happyShift action_654 action_619 (335) = happyShift action_655 action_619 _ = happyFail action_620 _ = happyReduce_106 action_621 _ = happyReduce_377 action_622 _ = happyReduce_71 action_623 (287) = happyShift action_653 action_623 (44) = happyGoto action_652 action_623 _ = happyReduce_78 action_624 _ = happyReduce_73 action_625 _ = happyReduce_549 action_626 (1) = happyShift action_424 action_626 (356) = happyShift action_425 action_626 (367) = happyShift action_648 action_626 (256) = happyGoto action_651 action_626 _ = happyFail action_627 _ = happyReduce_381 action_628 _ = happyReduce_191 action_629 (333) = happyShift action_278 action_629 (334) = happyShift action_279 action_629 (345) = happyShift action_280 action_629 (346) = happyShift action_281 action_629 (347) = happyShift action_282 action_629 (352) = happyShift action_283 action_629 (369) = happyShift action_284 action_629 (373) = happyShift action_285 action_629 (374) = happyShift action_286 action_629 (377) = happyShift action_287 action_629 (378) = happyShift action_288 action_629 (105) = happyGoto action_267 action_629 (222) = happyGoto action_268 action_629 (233) = happyGoto action_269 action_629 (235) = happyGoto action_270 action_629 (244) = happyGoto action_271 action_629 (246) = happyGoto action_272 action_629 (247) = happyGoto action_273 action_629 (248) = happyGoto action_274 action_629 (250) = happyGoto action_275 action_629 (253) = happyGoto action_276 action_629 (254) = happyGoto action_277 action_629 _ = happyReduce_246 action_630 (266) = happyReduce_448 action_630 (267) = happyReduce_448 action_630 (275) = happyReduce_448 action_630 (287) = happyReduce_448 action_630 (291) = happyReduce_448 action_630 (293) = happyReduce_448 action_630 (294) = happyReduce_448 action_630 (295) = happyReduce_448 action_630 (296) = happyReduce_448 action_630 (297) = happyReduce_448 action_630 (298) = happyReduce_448 action_630 (300) = happyReduce_448 action_630 (301) = happyReduce_448 action_630 (302) = happyReduce_448 action_630 (303) = happyReduce_448 action_630 (304) = happyReduce_448 action_630 (305) = happyReduce_448 action_630 (306) = happyReduce_448 action_630 (309) = happyReduce_448 action_630 (333) = happyReduce_448 action_630 (334) = happyReduce_448 action_630 (335) = happyReduce_448 action_630 (338) = happyReduce_448 action_630 (342) = happyReduce_448 action_630 (345) = happyReduce_448 action_630 (346) = happyReduce_448 action_630 (347) = happyReduce_448 action_630 (352) = happyReduce_448 action_630 (353) = happyReduce_448 action_630 (357) = happyReduce_448 action_630 (359) = happyReduce_448 action_630 (361) = happyReduce_448 action_630 (363) = happyReduce_448 action_630 (365) = happyReduce_448 action_630 (369) = happyReduce_448 action_630 (370) = happyReduce_448 action_630 (371) = happyReduce_448 action_630 (372) = happyReduce_448 action_630 (373) = happyReduce_448 action_630 (374) = happyReduce_448 action_630 (375) = happyReduce_448 action_630 (376) = happyReduce_448 action_630 (377) = happyReduce_448 action_630 (378) = happyReduce_448 action_630 (379) = happyReduce_448 action_630 (380) = happyReduce_448 action_630 (381) = happyReduce_448 action_630 (382) = happyReduce_448 action_630 (383) = happyReduce_448 action_630 (384) = happyReduce_448 action_630 (385) = happyReduce_448 action_630 (386) = happyReduce_448 action_630 (387) = happyReduce_448 action_630 (388) = happyReduce_448 action_630 (389) = happyReduce_448 action_630 (390) = happyReduce_448 action_630 (391) = happyReduce_448 action_630 (396) = happyReduce_448 action_630 (397) = happyReduce_448 action_630 (398) = happyReduce_448 action_630 (399) = happyReduce_448 action_630 (401) = happyReduce_448 action_630 (403) = happyReduce_448 action_630 (404) = happyReduce_448 action_630 (405) = happyReduce_448 action_630 (406) = happyReduce_448 action_630 (407) = happyReduce_448 action_630 (408) = happyReduce_448 action_630 (409) = happyReduce_448 action_630 _ = happyReduce_382 action_631 (1) = happyShift action_424 action_631 (356) = happyShift action_425 action_631 (367) = happyShift action_646 action_631 (256) = happyGoto action_650 action_631 _ = happyFail action_632 _ = happyReduce_561 action_633 (335) = happyShift action_649 action_633 _ = happyReduce_436 action_634 (354) = happyShift action_647 action_634 (367) = happyShift action_648 action_634 _ = happyFail action_635 (354) = happyShift action_645 action_635 (367) = happyShift action_646 action_635 _ = happyFail action_636 (1) = happyShift action_424 action_636 (356) = happyShift action_425 action_636 (256) = happyGoto action_644 action_636 _ = happyFail action_637 (367) = happyShift action_643 action_637 (201) = happyGoto action_642 action_637 _ = happyReduce_544 action_638 (266) = happyShift action_37 action_638 (267) = happyShift action_38 action_638 (268) = happyShift action_39 action_638 (273) = happyShift action_40 action_638 (275) = happyShift action_41 action_638 (276) = happyShift action_42 action_638 (283) = happyShift action_164 action_638 (287) = happyShift action_47 action_638 (291) = happyShift action_48 action_638 (293) = happyShift action_49 action_638 (294) = happyShift action_50 action_638 (295) = happyShift action_51 action_638 (296) = happyShift action_52 action_638 (297) = happyShift action_53 action_638 (298) = happyShift action_54 action_638 (299) = happyShift action_55 action_638 (300) = happyShift action_56 action_638 (301) = happyShift action_57 action_638 (302) = happyShift action_58 action_638 (303) = happyShift action_59 action_638 (304) = happyShift action_60 action_638 (305) = happyShift action_61 action_638 (306) = happyShift action_62 action_638 (307) = happyShift action_63 action_638 (308) = happyShift action_165 action_638 (309) = happyShift action_64 action_638 (318) = happyShift action_68 action_638 (319) = happyShift action_69 action_638 (320) = happyShift action_70 action_638 (336) = happyShift action_72 action_638 (342) = happyShift action_73 action_638 (345) = happyShift action_74 action_638 (346) = happyShift action_166 action_638 (357) = happyShift action_75 action_638 (359) = happyShift action_76 action_638 (361) = happyShift action_118 action_638 (363) = happyShift action_78 action_638 (365) = happyShift action_79 action_638 (367) = happyShift action_638 action_638 (370) = happyShift action_80 action_638 (371) = happyShift action_81 action_638 (372) = happyShift action_82 action_638 (375) = happyShift action_83 action_638 (376) = happyShift action_84 action_638 (379) = happyShift action_85 action_638 (380) = happyShift action_86 action_638 (381) = happyShift action_87 action_638 (382) = happyShift action_88 action_638 (383) = happyShift action_89 action_638 (384) = happyShift action_90 action_638 (385) = happyShift action_91 action_638 (386) = happyShift action_92 action_638 (387) = happyShift action_93 action_638 (388) = happyShift action_94 action_638 (389) = happyShift action_95 action_638 (390) = happyShift action_96 action_638 (391) = happyShift action_97 action_638 (396) = happyShift action_98 action_638 (397) = happyShift action_99 action_638 (398) = happyShift action_100 action_638 (399) = happyShift action_101 action_638 (401) = happyShift action_102 action_638 (403) = happyShift action_103 action_638 (404) = happyShift action_104 action_638 (405) = happyShift action_105 action_638 (406) = happyShift action_106 action_638 (407) = happyShift action_107 action_638 (408) = happyShift action_108 action_638 (409) = happyShift action_109 action_638 (38) = happyGoto action_13 action_638 (156) = happyGoto action_16 action_638 (157) = happyGoto action_160 action_638 (158) = happyGoto action_116 action_638 (159) = happyGoto action_18 action_638 (161) = happyGoto action_19 action_638 (162) = happyGoto action_20 action_638 (163) = happyGoto action_21 action_638 (164) = happyGoto action_22 action_638 (165) = happyGoto action_23 action_638 (166) = happyGoto action_24 action_638 (167) = happyGoto action_25 action_638 (196) = happyGoto action_161 action_638 (200) = happyGoto action_641 action_638 (203) = happyGoto action_637 action_638 (204) = happyGoto action_163 action_638 (210) = happyGoto action_26 action_638 (217) = happyGoto action_27 action_638 (220) = happyGoto action_28 action_638 (241) = happyGoto action_30 action_638 (242) = happyGoto action_31 action_638 (243) = happyGoto action_117 action_638 (249) = happyGoto action_33 action_638 (251) = happyGoto action_34 action_638 (252) = happyGoto action_35 action_638 (255) = happyGoto action_36 action_638 _ = happyReduce_542 action_639 (354) = happyShift action_640 action_639 _ = happyFail action_640 _ = happyReduce_538 action_641 _ = happyReduce_541 action_642 _ = happyReduce_540 action_643 (266) = happyShift action_37 action_643 (267) = happyShift action_38 action_643 (268) = happyShift action_39 action_643 (273) = happyShift action_40 action_643 (275) = happyShift action_41 action_643 (276) = happyShift action_42 action_643 (283) = happyShift action_164 action_643 (287) = happyShift action_47 action_643 (291) = happyShift action_48 action_643 (293) = happyShift action_49 action_643 (294) = happyShift action_50 action_643 (295) = happyShift action_51 action_643 (296) = happyShift action_52 action_643 (297) = happyShift action_53 action_643 (298) = happyShift action_54 action_643 (299) = happyShift action_55 action_643 (300) = happyShift action_56 action_643 (301) = happyShift action_57 action_643 (302) = happyShift action_58 action_643 (303) = happyShift action_59 action_643 (304) = happyShift action_60 action_643 (305) = happyShift action_61 action_643 (306) = happyShift action_62 action_643 (307) = happyShift action_63 action_643 (308) = happyShift action_165 action_643 (309) = happyShift action_64 action_643 (318) = happyShift action_68 action_643 (319) = happyShift action_69 action_643 (320) = happyShift action_70 action_643 (336) = happyShift action_72 action_643 (342) = happyShift action_73 action_643 (345) = happyShift action_74 action_643 (346) = happyShift action_166 action_643 (357) = happyShift action_75 action_643 (359) = happyShift action_76 action_643 (361) = happyShift action_118 action_643 (363) = happyShift action_78 action_643 (365) = happyShift action_79 action_643 (367) = happyShift action_638 action_643 (370) = happyShift action_80 action_643 (371) = happyShift action_81 action_643 (372) = happyShift action_82 action_643 (375) = happyShift action_83 action_643 (376) = happyShift action_84 action_643 (379) = happyShift action_85 action_643 (380) = happyShift action_86 action_643 (381) = happyShift action_87 action_643 (382) = happyShift action_88 action_643 (383) = happyShift action_89 action_643 (384) = happyShift action_90 action_643 (385) = happyShift action_91 action_643 (386) = happyShift action_92 action_643 (387) = happyShift action_93 action_643 (388) = happyShift action_94 action_643 (389) = happyShift action_95 action_643 (390) = happyShift action_96 action_643 (391) = happyShift action_97 action_643 (396) = happyShift action_98 action_643 (397) = happyShift action_99 action_643 (398) = happyShift action_100 action_643 (399) = happyShift action_101 action_643 (401) = happyShift action_102 action_643 (403) = happyShift action_103 action_643 (404) = happyShift action_104 action_643 (405) = happyShift action_105 action_643 (406) = happyShift action_106 action_643 (407) = happyShift action_107 action_643 (408) = happyShift action_108 action_643 (409) = happyShift action_109 action_643 (38) = happyGoto action_13 action_643 (156) = happyGoto action_16 action_643 (157) = happyGoto action_160 action_643 (158) = happyGoto action_116 action_643 (159) = happyGoto action_18 action_643 (161) = happyGoto action_19 action_643 (162) = happyGoto action_20 action_643 (163) = happyGoto action_21 action_643 (164) = happyGoto action_22 action_643 (165) = happyGoto action_23 action_643 (166) = happyGoto action_24 action_643 (167) = happyGoto action_25 action_643 (196) = happyGoto action_161 action_643 (200) = happyGoto action_971 action_643 (203) = happyGoto action_637 action_643 (204) = happyGoto action_163 action_643 (210) = happyGoto action_26 action_643 (217) = happyGoto action_27 action_643 (220) = happyGoto action_28 action_643 (241) = happyGoto action_30 action_643 (242) = happyGoto action_31 action_643 (243) = happyGoto action_117 action_643 (249) = happyGoto action_33 action_643 (251) = happyGoto action_34 action_643 (252) = happyGoto action_35 action_643 (255) = happyGoto action_36 action_643 _ = happyReduce_542 action_644 _ = happyReduce_539 action_645 _ = happyReduce_196 action_646 (381) = happyShift action_87 action_646 (209) = happyGoto action_969 action_646 (210) = happyGoto action_970 action_646 _ = happyReduce_560 action_647 _ = happyReduce_193 action_648 (266) = happyShift action_37 action_648 (267) = happyShift action_38 action_648 (268) = happyShift action_39 action_648 (273) = happyShift action_40 action_648 (275) = happyShift action_41 action_648 (276) = happyShift action_42 action_648 (279) = happyShift action_43 action_648 (280) = happyShift action_44 action_648 (281) = happyShift action_45 action_648 (283) = happyShift action_46 action_648 (287) = happyShift action_47 action_648 (291) = happyShift action_48 action_648 (293) = happyShift action_49 action_648 (294) = happyShift action_50 action_648 (295) = happyShift action_51 action_648 (296) = happyShift action_52 action_648 (297) = happyShift action_53 action_648 (298) = happyShift action_54 action_648 (299) = happyShift action_55 action_648 (300) = happyShift action_56 action_648 (301) = happyShift action_57 action_648 (302) = happyShift action_58 action_648 (303) = happyShift action_59 action_648 (304) = happyShift action_60 action_648 (305) = happyShift action_61 action_648 (306) = happyShift action_62 action_648 (307) = happyShift action_63 action_648 (309) = happyShift action_64 action_648 (312) = happyShift action_145 action_648 (313) = happyShift action_65 action_648 (314) = happyShift action_66 action_648 (315) = happyShift action_67 action_648 (318) = happyShift action_68 action_648 (319) = happyShift action_69 action_648 (320) = happyShift action_70 action_648 (329) = happyShift action_71 action_648 (336) = happyShift action_72 action_648 (342) = happyShift action_73 action_648 (345) = happyShift action_74 action_648 (346) = happyShift action_153 action_648 (357) = happyShift action_75 action_648 (359) = happyShift action_76 action_648 (361) = happyShift action_77 action_648 (363) = happyShift action_78 action_648 (365) = happyShift action_79 action_648 (370) = happyShift action_80 action_648 (371) = happyShift action_81 action_648 (372) = happyShift action_82 action_648 (375) = happyShift action_83 action_648 (376) = happyShift action_84 action_648 (379) = happyShift action_85 action_648 (380) = happyShift action_86 action_648 (381) = happyShift action_87 action_648 (382) = happyShift action_88 action_648 (383) = happyShift action_89 action_648 (384) = happyShift action_90 action_648 (385) = happyShift action_91 action_648 (386) = happyShift action_92 action_648 (387) = happyShift action_93 action_648 (388) = happyShift action_94 action_648 (389) = happyShift action_95 action_648 (390) = happyShift action_96 action_648 (391) = happyShift action_97 action_648 (392) = happyShift action_154 action_648 (393) = happyShift action_155 action_648 (394) = happyShift action_156 action_648 (395) = happyShift action_157 action_648 (396) = happyShift action_98 action_648 (397) = happyShift action_99 action_648 (398) = happyShift action_100 action_648 (399) = happyShift action_101 action_648 (401) = happyShift action_102 action_648 (403) = happyShift action_103 action_648 (404) = happyShift action_104 action_648 (405) = happyShift action_105 action_648 (406) = happyShift action_106 action_648 (407) = happyShift action_107 action_648 (408) = happyShift action_108 action_648 (409) = happyShift action_109 action_648 (38) = happyGoto action_13 action_648 (49) = happyGoto action_14 action_648 (72) = happyGoto action_126 action_648 (146) = happyGoto action_128 action_648 (147) = happyGoto action_129 action_648 (148) = happyGoto action_627 action_648 (149) = happyGoto action_968 action_648 (153) = happyGoto action_131 action_648 (156) = happyGoto action_16 action_648 (158) = happyGoto action_629 action_648 (159) = happyGoto action_18 action_648 (161) = happyGoto action_19 action_648 (162) = happyGoto action_20 action_648 (163) = happyGoto action_21 action_648 (164) = happyGoto action_22 action_648 (165) = happyGoto action_23 action_648 (166) = happyGoto action_24 action_648 (167) = happyGoto action_630 action_648 (210) = happyGoto action_26 action_648 (217) = happyGoto action_27 action_648 (220) = happyGoto action_28 action_648 (240) = happyGoto action_29 action_648 (241) = happyGoto action_30 action_648 (242) = happyGoto action_31 action_648 (243) = happyGoto action_32 action_648 (249) = happyGoto action_33 action_648 (251) = happyGoto action_34 action_648 (252) = happyGoto action_35 action_648 (255) = happyGoto action_36 action_648 (259) = happyGoto action_133 action_648 (260) = happyGoto action_134 action_648 (261) = happyGoto action_135 action_648 (262) = happyGoto action_136 action_648 _ = happyReduce_190 action_649 (266) = happyShift action_37 action_649 (267) = happyShift action_38 action_649 (268) = happyShift action_39 action_649 (273) = happyShift action_40 action_649 (275) = happyShift action_41 action_649 (276) = happyShift action_42 action_649 (283) = happyShift action_46 action_649 (287) = happyShift action_47 action_649 (291) = happyShift action_48 action_649 (293) = happyShift action_49 action_649 (294) = happyShift action_50 action_649 (295) = happyShift action_51 action_649 (296) = happyShift action_52 action_649 (297) = happyShift action_53 action_649 (298) = happyShift action_54 action_649 (299) = happyShift action_55 action_649 (300) = happyShift action_56 action_649 (301) = happyShift action_57 action_649 (302) = happyShift action_58 action_649 (303) = happyShift action_59 action_649 (304) = happyShift action_60 action_649 (305) = happyShift action_61 action_649 (306) = happyShift action_62 action_649 (307) = happyShift action_63 action_649 (309) = happyShift action_64 action_649 (318) = happyShift action_68 action_649 (319) = happyShift action_69 action_649 (320) = happyShift action_70 action_649 (336) = happyShift action_72 action_649 (342) = happyShift action_73 action_649 (345) = happyShift action_74 action_649 (357) = happyShift action_75 action_649 (359) = happyShift action_76 action_649 (361) = happyShift action_118 action_649 (363) = happyShift action_78 action_649 (365) = happyShift action_79 action_649 (370) = happyShift action_80 action_649 (371) = happyShift action_81 action_649 (372) = happyShift action_82 action_649 (375) = happyShift action_83 action_649 (376) = happyShift action_84 action_649 (379) = happyShift action_85 action_649 (380) = happyShift action_86 action_649 (381) = happyShift action_87 action_649 (382) = happyShift action_88 action_649 (383) = happyShift action_89 action_649 (384) = happyShift action_90 action_649 (385) = happyShift action_91 action_649 (386) = happyShift action_92 action_649 (387) = happyShift action_93 action_649 (388) = happyShift action_94 action_649 (389) = happyShift action_95 action_649 (390) = happyShift action_96 action_649 (391) = happyShift action_97 action_649 (396) = happyShift action_98 action_649 (397) = happyShift action_99 action_649 (398) = happyShift action_100 action_649 (399) = happyShift action_101 action_649 (401) = happyShift action_102 action_649 (403) = happyShift action_103 action_649 (404) = happyShift action_104 action_649 (405) = happyShift action_105 action_649 (406) = happyShift action_106 action_649 (407) = happyShift action_107 action_649 (408) = happyShift action_108 action_649 (409) = happyShift action_109 action_649 (38) = happyGoto action_13 action_649 (156) = happyGoto action_16 action_649 (157) = happyGoto action_967 action_649 (158) = happyGoto action_116 action_649 (159) = happyGoto action_18 action_649 (161) = happyGoto action_19 action_649 (162) = happyGoto action_20 action_649 (163) = happyGoto action_21 action_649 (164) = happyGoto action_22 action_649 (165) = happyGoto action_23 action_649 (166) = happyGoto action_24 action_649 (167) = happyGoto action_25 action_649 (210) = happyGoto action_26 action_649 (217) = happyGoto action_27 action_649 (220) = happyGoto action_28 action_649 (241) = happyGoto action_30 action_649 (242) = happyGoto action_31 action_649 (243) = happyGoto action_117 action_649 (249) = happyGoto action_33 action_649 (251) = happyGoto action_34 action_649 (252) = happyGoto action_35 action_649 (255) = happyGoto action_36 action_649 _ = happyFail action_650 _ = happyReduce_197 action_651 _ = happyReduce_194 action_652 (383) = happyShift action_966 action_652 (43) = happyGoto action_965 action_652 _ = happyReduce_76 action_653 _ = happyReduce_77 action_654 _ = happyReduce_108 action_655 (357) = happyShift action_318 action_655 (359) = happyShift action_319 action_655 (361) = happyShift action_320 action_655 (363) = happyShift action_321 action_655 (372) = happyShift action_246 action_655 (376) = happyShift action_247 action_655 (380) = happyShift action_248 action_655 (223) = happyGoto action_964 action_655 (224) = happyGoto action_316 action_655 (225) = happyGoto action_224 action_655 (227) = happyGoto action_225 action_655 (228) = happyGoto action_226 action_655 _ = happyFail action_656 (331) = happyShift action_963 action_656 _ = happyFail action_657 _ = happyReduce_111 action_658 _ = happyReduce_107 action_659 (357) = happyShift action_318 action_659 (359) = happyShift action_319 action_659 (361) = happyShift action_320 action_659 (363) = happyShift action_321 action_659 (372) = happyShift action_246 action_659 (376) = happyShift action_247 action_659 (380) = happyShift action_248 action_659 (223) = happyGoto action_962 action_659 (224) = happyGoto action_316 action_659 (225) = happyGoto action_224 action_659 (227) = happyGoto action_225 action_659 (228) = happyGoto action_226 action_659 _ = happyFail action_660 _ = happyReduce_230 action_661 _ = happyReduce_232 action_662 (331) = happyShift action_961 action_662 _ = happyFail action_663 _ = happyReduce_216 action_664 _ = happyReduce_573 action_665 _ = happyReduce_221 action_666 (358) = happyShift action_959 action_666 (368) = happyShift action_960 action_666 _ = happyFail action_667 _ = happyReduce_229 action_668 _ = happyReduce_200 action_669 (358) = happyShift action_957 action_669 (384) = happyShift action_958 action_669 _ = happyFail action_670 (358) = happyShift action_956 action_670 _ = happyFail action_671 (266) = happyShift action_37 action_671 (267) = happyShift action_38 action_671 (268) = happyShift action_39 action_671 (273) = happyShift action_40 action_671 (275) = happyShift action_41 action_671 (276) = happyShift action_42 action_671 (283) = happyShift action_46 action_671 (287) = happyShift action_47 action_671 (291) = happyShift action_48 action_671 (293) = happyShift action_49 action_671 (294) = happyShift action_50 action_671 (295) = happyShift action_51 action_671 (296) = happyShift action_52 action_671 (297) = happyShift action_53 action_671 (298) = happyShift action_54 action_671 (299) = happyShift action_55 action_671 (300) = happyShift action_56 action_671 (301) = happyShift action_57 action_671 (302) = happyShift action_58 action_671 (303) = happyShift action_59 action_671 (304) = happyShift action_60 action_671 (305) = happyShift action_61 action_671 (306) = happyShift action_62 action_671 (307) = happyShift action_63 action_671 (309) = happyShift action_64 action_671 (318) = happyShift action_68 action_671 (319) = happyShift action_69 action_671 (320) = happyShift action_70 action_671 (336) = happyShift action_72 action_671 (342) = happyShift action_73 action_671 (345) = happyShift action_74 action_671 (357) = happyShift action_75 action_671 (359) = happyShift action_76 action_671 (361) = happyShift action_118 action_671 (363) = happyShift action_78 action_671 (365) = happyShift action_79 action_671 (370) = happyShift action_80 action_671 (371) = happyShift action_81 action_671 (372) = happyShift action_82 action_671 (375) = happyShift action_83 action_671 (376) = happyShift action_84 action_671 (379) = happyShift action_85 action_671 (380) = happyShift action_86 action_671 (381) = happyShift action_87 action_671 (382) = happyShift action_88 action_671 (383) = happyShift action_89 action_671 (384) = happyShift action_90 action_671 (385) = happyShift action_91 action_671 (386) = happyShift action_92 action_671 (387) = happyShift action_93 action_671 (388) = happyShift action_94 action_671 (389) = happyShift action_95 action_671 (390) = happyShift action_96 action_671 (391) = happyShift action_97 action_671 (396) = happyShift action_98 action_671 (397) = happyShift action_99 action_671 (398) = happyShift action_100 action_671 (399) = happyShift action_101 action_671 (401) = happyShift action_102 action_671 (403) = happyShift action_103 action_671 (404) = happyShift action_104 action_671 (405) = happyShift action_105 action_671 (406) = happyShift action_106 action_671 (407) = happyShift action_107 action_671 (408) = happyShift action_108 action_671 (409) = happyShift action_109 action_671 (38) = happyGoto action_13 action_671 (156) = happyGoto action_16 action_671 (158) = happyGoto action_955 action_671 (159) = happyGoto action_18 action_671 (161) = happyGoto action_19 action_671 (162) = happyGoto action_20 action_671 (163) = happyGoto action_21 action_671 (164) = happyGoto action_22 action_671 (165) = happyGoto action_23 action_671 (166) = happyGoto action_24 action_671 (167) = happyGoto action_25 action_671 (210) = happyGoto action_26 action_671 (217) = happyGoto action_27 action_671 (220) = happyGoto action_28 action_671 (241) = happyGoto action_30 action_671 (242) = happyGoto action_31 action_671 (243) = happyGoto action_117 action_671 (249) = happyGoto action_33 action_671 (251) = happyGoto action_34 action_671 (252) = happyGoto action_35 action_671 (255) = happyGoto action_36 action_671 _ = happyFail action_672 (267) = happyShift action_38 action_672 (275) = happyShift action_41 action_672 (287) = happyShift action_47 action_672 (291) = happyShift action_48 action_672 (293) = happyShift action_49 action_672 (294) = happyShift action_50 action_672 (295) = happyShift action_51 action_672 (296) = happyShift action_52 action_672 (297) = happyShift action_53 action_672 (298) = happyShift action_54 action_672 (300) = happyShift action_56 action_672 (301) = happyShift action_57 action_672 (302) = happyShift action_58 action_672 (303) = happyShift action_59 action_672 (304) = happyShift action_60 action_672 (305) = happyShift action_61 action_672 (306) = happyShift action_62 action_672 (309) = happyShift action_64 action_672 (361) = happyShift action_954 action_672 (371) = happyShift action_81 action_672 (92) = happyGoto action_951 action_672 (93) = happyGoto action_952 action_672 (243) = happyGoto action_953 action_672 (249) = happyGoto action_33 action_672 _ = happyFail action_673 _ = happyReduce_165 action_674 (266) = happyShift action_37 action_674 (267) = happyShift action_38 action_674 (268) = happyShift action_39 action_674 (273) = happyShift action_40 action_674 (275) = happyShift action_41 action_674 (276) = happyShift action_42 action_674 (283) = happyShift action_46 action_674 (287) = happyShift action_47 action_674 (291) = happyShift action_48 action_674 (293) = happyShift action_49 action_674 (294) = happyShift action_50 action_674 (295) = happyShift action_51 action_674 (296) = happyShift action_52 action_674 (297) = happyShift action_53 action_674 (298) = happyShift action_54 action_674 (299) = happyShift action_55 action_674 (300) = happyShift action_56 action_674 (301) = happyShift action_57 action_674 (302) = happyShift action_58 action_674 (303) = happyShift action_59 action_674 (304) = happyShift action_60 action_674 (305) = happyShift action_61 action_674 (306) = happyShift action_62 action_674 (307) = happyShift action_63 action_674 (309) = happyShift action_64 action_674 (318) = happyShift action_68 action_674 (319) = happyShift action_69 action_674 (320) = happyShift action_70 action_674 (336) = happyShift action_72 action_674 (342) = happyShift action_73 action_674 (345) = happyShift action_74 action_674 (346) = happyShift action_802 action_674 (357) = happyShift action_75 action_674 (359) = happyShift action_76 action_674 (361) = happyShift action_118 action_674 (363) = happyShift action_78 action_674 (365) = happyShift action_79 action_674 (370) = happyShift action_80 action_674 (371) = happyShift action_81 action_674 (372) = happyShift action_82 action_674 (375) = happyShift action_83 action_674 (376) = happyShift action_84 action_674 (379) = happyShift action_85 action_674 (380) = happyShift action_86 action_674 (381) = happyShift action_87 action_674 (382) = happyShift action_88 action_674 (383) = happyShift action_89 action_674 (384) = happyShift action_90 action_674 (385) = happyShift action_91 action_674 (386) = happyShift action_92 action_674 (387) = happyShift action_93 action_674 (388) = happyShift action_94 action_674 (389) = happyShift action_95 action_674 (390) = happyShift action_96 action_674 (391) = happyShift action_97 action_674 (396) = happyShift action_98 action_674 (397) = happyShift action_99 action_674 (398) = happyShift action_100 action_674 (399) = happyShift action_101 action_674 (401) = happyShift action_102 action_674 (403) = happyShift action_103 action_674 (404) = happyShift action_104 action_674 (405) = happyShift action_105 action_674 (406) = happyShift action_106 action_674 (407) = happyShift action_107 action_674 (408) = happyShift action_108 action_674 (409) = happyShift action_109 action_674 (38) = happyGoto action_13 action_674 (156) = happyGoto action_16 action_674 (157) = happyGoto action_796 action_674 (158) = happyGoto action_116 action_674 (159) = happyGoto action_18 action_674 (161) = happyGoto action_19 action_674 (162) = happyGoto action_20 action_674 (163) = happyGoto action_21 action_674 (164) = happyGoto action_22 action_674 (165) = happyGoto action_23 action_674 (166) = happyGoto action_24 action_674 (167) = happyGoto action_25 action_674 (195) = happyGoto action_950 action_674 (210) = happyGoto action_26 action_674 (217) = happyGoto action_27 action_674 (220) = happyGoto action_28 action_674 (241) = happyGoto action_30 action_674 (242) = happyGoto action_31 action_674 (243) = happyGoto action_117 action_674 (249) = happyGoto action_33 action_674 (251) = happyGoto action_34 action_674 (252) = happyGoto action_35 action_674 (255) = happyGoto action_36 action_674 _ = happyFail action_675 _ = happyReduce_167 action_676 _ = happyReduce_166 action_677 (369) = happyShift action_949 action_677 _ = happyFail action_678 (335) = happyShift action_675 action_678 (339) = happyShift action_676 action_678 (74) = happyGoto action_948 action_678 _ = happyFail action_679 (267) = happyShift action_38 action_679 (275) = happyShift action_41 action_679 (287) = happyShift action_47 action_679 (291) = happyShift action_48 action_679 (293) = happyShift action_49 action_679 (294) = happyShift action_50 action_679 (295) = happyShift action_51 action_679 (296) = happyShift action_52 action_679 (297) = happyShift action_53 action_679 (298) = happyShift action_54 action_679 (300) = happyShift action_56 action_679 (301) = happyShift action_57 action_679 (302) = happyShift action_58 action_679 (303) = happyShift action_59 action_679 (304) = happyShift action_60 action_679 (305) = happyShift action_61 action_679 (306) = happyShift action_62 action_679 (309) = happyShift action_64 action_679 (361) = happyShift action_413 action_679 (371) = happyShift action_81 action_679 (383) = happyShift action_685 action_679 (104) = happyGoto action_947 action_679 (240) = happyGoto action_681 action_679 (243) = happyGoto action_195 action_679 (249) = happyGoto action_33 action_679 _ = happyFail action_680 _ = happyReduce_234 action_681 (334) = happyShift action_946 action_681 _ = happyFail action_682 (334) = happyReduce_650 action_682 _ = happyReduce_242 action_683 (334) = happyReduce_651 action_683 _ = happyReduce_243 action_684 (334) = happyReduce_649 action_684 _ = happyReduce_241 action_685 (267) = happyShift action_38 action_685 (275) = happyShift action_41 action_685 (287) = happyShift action_47 action_685 (291) = happyShift action_48 action_685 (293) = happyShift action_49 action_685 (294) = happyShift action_50 action_685 (295) = happyShift action_51 action_685 (296) = happyShift action_52 action_685 (297) = happyShift action_53 action_685 (298) = happyShift action_54 action_685 (300) = happyShift action_56 action_685 (301) = happyShift action_57 action_685 (302) = happyShift action_58 action_685 (303) = happyShift action_59 action_685 (304) = happyShift action_60 action_685 (305) = happyShift action_61 action_685 (306) = happyShift action_62 action_685 (309) = happyShift action_64 action_685 (361) = happyShift action_413 action_685 (371) = happyShift action_81 action_685 (240) = happyGoto action_945 action_685 (243) = happyGoto action_195 action_685 (249) = happyGoto action_33 action_685 _ = happyFail action_686 _ = happyReduce_235 action_687 _ = happyReduce_116 action_688 (267) = happyShift action_38 action_688 (275) = happyShift action_41 action_688 (287) = happyShift action_47 action_688 (293) = happyShift action_49 action_688 (294) = happyShift action_50 action_688 (295) = happyShift action_51 action_688 (296) = happyShift action_231 action_688 (297) = happyShift action_232 action_688 (298) = happyShift action_233 action_688 (302) = happyShift action_58 action_688 (303) = happyShift action_59 action_688 (304) = happyShift action_60 action_688 (305) = happyShift action_61 action_688 (306) = happyShift action_62 action_688 (309) = happyShift action_64 action_688 (323) = happyShift action_236 action_688 (324) = happyShift action_237 action_688 (346) = happyShift action_238 action_688 (353) = happyShift action_239 action_688 (357) = happyShift action_240 action_688 (359) = happyShift action_241 action_688 (361) = happyShift action_242 action_688 (363) = happyShift action_243 action_688 (370) = happyShift action_244 action_688 (371) = happyShift action_245 action_688 (372) = happyShift action_246 action_688 (376) = happyShift action_247 action_688 (380) = happyShift action_248 action_688 (383) = happyShift action_249 action_688 (384) = happyShift action_250 action_688 (403) = happyShift action_251 action_688 (404) = happyShift action_252 action_688 (408) = happyShift action_108 action_688 (409) = happyShift action_109 action_688 (111) = happyGoto action_218 action_688 (118) = happyGoto action_551 action_688 (156) = happyGoto action_222 action_688 (224) = happyGoto action_223 action_688 (225) = happyGoto action_224 action_688 (227) = happyGoto action_225 action_688 (228) = happyGoto action_226 action_688 (237) = happyGoto action_227 action_688 (239) = happyGoto action_228 action_688 (249) = happyGoto action_229 action_688 _ = happyReduce_275 action_689 (267) = happyShift action_38 action_689 (275) = happyShift action_41 action_689 (287) = happyShift action_47 action_689 (291) = happyShift action_260 action_689 (293) = happyShift action_49 action_689 (294) = happyShift action_50 action_689 (295) = happyShift action_51 action_689 (296) = happyShift action_231 action_689 (297) = happyShift action_232 action_689 (298) = happyShift action_233 action_689 (302) = happyShift action_58 action_689 (303) = happyShift action_59 action_689 (304) = happyShift action_60 action_689 (305) = happyShift action_61 action_689 (306) = happyShift action_62 action_689 (309) = happyShift action_64 action_689 (323) = happyShift action_236 action_689 (324) = happyShift action_237 action_689 (346) = happyShift action_238 action_689 (353) = happyShift action_239 action_689 (357) = happyShift action_240 action_689 (359) = happyShift action_241 action_689 (361) = happyShift action_242 action_689 (363) = happyShift action_243 action_689 (370) = happyShift action_244 action_689 (371) = happyShift action_245 action_689 (372) = happyShift action_246 action_689 (376) = happyShift action_247 action_689 (380) = happyShift action_248 action_689 (381) = happyShift action_87 action_689 (383) = happyShift action_249 action_689 (384) = happyShift action_250 action_689 (403) = happyShift action_251 action_689 (404) = happyShift action_252 action_689 (408) = happyShift action_108 action_689 (409) = happyShift action_109 action_689 (111) = happyGoto action_218 action_689 (112) = happyGoto action_944 action_689 (114) = happyGoto action_255 action_689 (115) = happyGoto action_256 action_689 (117) = happyGoto action_257 action_689 (118) = happyGoto action_221 action_689 (156) = happyGoto action_222 action_689 (210) = happyGoto action_259 action_689 (224) = happyGoto action_223 action_689 (225) = happyGoto action_224 action_689 (227) = happyGoto action_225 action_689 (228) = happyGoto action_226 action_689 (237) = happyGoto action_227 action_689 (239) = happyGoto action_228 action_689 (249) = happyGoto action_229 action_689 _ = happyFail action_690 (290) = happyShift action_943 action_690 (56) = happyGoto action_942 action_690 _ = happyReduce_125 action_691 (267) = happyShift action_38 action_691 (275) = happyShift action_41 action_691 (287) = happyShift action_47 action_691 (293) = happyShift action_49 action_691 (294) = happyShift action_50 action_691 (295) = happyShift action_51 action_691 (296) = happyShift action_231 action_691 (297) = happyShift action_232 action_691 (298) = happyShift action_233 action_691 (302) = happyShift action_58 action_691 (303) = happyShift action_59 action_691 (304) = happyShift action_60 action_691 (305) = happyShift action_61 action_691 (306) = happyShift action_62 action_691 (309) = happyShift action_64 action_691 (347) = happyShift action_934 action_691 (357) = happyShift action_935 action_691 (361) = happyShift action_936 action_691 (371) = happyShift action_245 action_691 (372) = happyShift action_246 action_691 (376) = happyShift action_247 action_691 (380) = happyShift action_248 action_691 (129) = happyGoto action_941 action_691 (130) = happyGoto action_929 action_691 (131) = happyGoto action_930 action_691 (132) = happyGoto action_931 action_691 (227) = happyGoto action_932 action_691 (228) = happyGoto action_226 action_691 (237) = happyGoto action_933 action_691 (239) = happyGoto action_228 action_691 (249) = happyGoto action_229 action_691 _ = happyFail action_692 _ = happyReduce_155 action_693 (266) = happyShift action_695 action_693 (371) = happyShift action_696 action_693 (71) = happyGoto action_940 action_693 _ = happyReduce_157 action_694 _ = happyReduce_158 action_695 _ = happyReduce_161 action_696 _ = happyReduce_160 action_697 _ = happyReduce_259 action_698 _ = happyReduce_260 action_699 (334) = happyShift action_939 action_699 (368) = happyShift action_828 action_699 _ = happyFail action_700 (368) = happyShift action_938 action_700 _ = happyFail action_701 _ = happyReduce_294 action_702 _ = happyReduce_299 action_703 (267) = happyShift action_38 action_703 (275) = happyShift action_41 action_703 (287) = happyShift action_47 action_703 (291) = happyShift action_260 action_703 (293) = happyShift action_49 action_703 (294) = happyShift action_50 action_703 (295) = happyShift action_51 action_703 (296) = happyShift action_231 action_703 (297) = happyShift action_232 action_703 (298) = happyShift action_233 action_703 (302) = happyShift action_58 action_703 (303) = happyShift action_59 action_703 (304) = happyShift action_60 action_703 (305) = happyShift action_61 action_703 (306) = happyShift action_62 action_703 (309) = happyShift action_64 action_703 (323) = happyShift action_236 action_703 (324) = happyShift action_237 action_703 (346) = happyShift action_238 action_703 (353) = happyShift action_239 action_703 (357) = happyShift action_240 action_703 (359) = happyShift action_241 action_703 (361) = happyShift action_242 action_703 (363) = happyShift action_243 action_703 (370) = happyShift action_244 action_703 (371) = happyShift action_245 action_703 (372) = happyShift action_246 action_703 (376) = happyShift action_247 action_703 (380) = happyShift action_248 action_703 (381) = happyShift action_87 action_703 (383) = happyShift action_249 action_703 (384) = happyShift action_250 action_703 (403) = happyShift action_251 action_703 (404) = happyShift action_252 action_703 (408) = happyShift action_108 action_703 (409) = happyShift action_109 action_703 (111) = happyGoto action_218 action_703 (112) = happyGoto action_540 action_703 (114) = happyGoto action_255 action_703 (115) = happyGoto action_256 action_703 (117) = happyGoto action_257 action_703 (118) = happyGoto action_221 action_703 (122) = happyGoto action_937 action_703 (156) = happyGoto action_222 action_703 (210) = happyGoto action_259 action_703 (224) = happyGoto action_223 action_703 (225) = happyGoto action_224 action_703 (227) = happyGoto action_225 action_703 (228) = happyGoto action_226 action_703 (237) = happyGoto action_227 action_703 (239) = happyGoto action_228 action_703 (249) = happyGoto action_229 action_703 _ = happyFail action_704 _ = happyReduce_300 action_705 (267) = happyShift action_38 action_705 (275) = happyShift action_41 action_705 (287) = happyShift action_47 action_705 (293) = happyShift action_49 action_705 (294) = happyShift action_50 action_705 (295) = happyShift action_51 action_705 (296) = happyShift action_231 action_705 (297) = happyShift action_232 action_705 (298) = happyShift action_233 action_705 (302) = happyShift action_58 action_705 (303) = happyShift action_59 action_705 (304) = happyShift action_60 action_705 (305) = happyShift action_61 action_705 (306) = happyShift action_62 action_705 (309) = happyShift action_64 action_705 (347) = happyShift action_934 action_705 (357) = happyShift action_935 action_705 (361) = happyShift action_936 action_705 (371) = happyShift action_245 action_705 (372) = happyShift action_246 action_705 (376) = happyShift action_247 action_705 (380) = happyShift action_248 action_705 (129) = happyGoto action_928 action_705 (130) = happyGoto action_929 action_705 (131) = happyGoto action_930 action_705 (132) = happyGoto action_931 action_705 (227) = happyGoto action_932 action_705 (228) = happyGoto action_226 action_705 (237) = happyGoto action_933 action_705 (239) = happyGoto action_228 action_705 (249) = happyGoto action_229 action_705 _ = happyFail action_706 _ = happyReduce_301 action_707 (267) = happyShift action_38 action_707 (275) = happyShift action_41 action_707 (287) = happyShift action_47 action_707 (291) = happyShift action_260 action_707 (293) = happyShift action_49 action_707 (294) = happyShift action_50 action_707 (295) = happyShift action_51 action_707 (296) = happyShift action_231 action_707 (297) = happyShift action_232 action_707 (298) = happyShift action_233 action_707 (302) = happyShift action_58 action_707 (303) = happyShift action_59 action_707 (304) = happyShift action_60 action_707 (305) = happyShift action_61 action_707 (306) = happyShift action_62 action_707 (309) = happyShift action_64 action_707 (323) = happyShift action_236 action_707 (324) = happyShift action_237 action_707 (346) = happyShift action_238 action_707 (353) = happyShift action_239 action_707 (357) = happyShift action_240 action_707 (359) = happyShift action_241 action_707 (361) = happyShift action_242 action_707 (363) = happyShift action_243 action_707 (370) = happyShift action_244 action_707 (371) = happyShift action_245 action_707 (372) = happyShift action_246 action_707 (376) = happyShift action_247 action_707 (380) = happyShift action_248 action_707 (381) = happyShift action_87 action_707 (383) = happyShift action_249 action_707 (384) = happyShift action_250 action_707 (403) = happyShift action_251 action_707 (404) = happyShift action_252 action_707 (408) = happyShift action_108 action_707 (409) = happyShift action_109 action_707 (111) = happyGoto action_218 action_707 (112) = happyGoto action_540 action_707 (114) = happyGoto action_255 action_707 (115) = happyGoto action_256 action_707 (117) = happyGoto action_257 action_707 (118) = happyGoto action_221 action_707 (122) = happyGoto action_927 action_707 (156) = happyGoto action_222 action_707 (210) = happyGoto action_259 action_707 (224) = happyGoto action_223 action_707 (225) = happyGoto action_224 action_707 (227) = happyGoto action_225 action_707 (228) = happyGoto action_226 action_707 (237) = happyGoto action_227 action_707 (239) = happyGoto action_228 action_707 (249) = happyGoto action_229 action_707 _ = happyFail action_708 _ = happyReduce_298 action_709 (368) = happyShift action_926 action_709 _ = happyFail action_710 (362) = happyReduce_676 action_710 _ = happyReduce_256 action_711 (358) = happyShift action_925 action_711 _ = happyFail action_712 _ = happyReduce_304 action_713 _ = happyReduce_262 action_714 (267) = happyShift action_38 action_714 (275) = happyShift action_41 action_714 (287) = happyShift action_47 action_714 (293) = happyShift action_49 action_714 (294) = happyShift action_50 action_714 (295) = happyShift action_51 action_714 (296) = happyShift action_231 action_714 (297) = happyShift action_232 action_714 (298) = happyShift action_233 action_714 (302) = happyShift action_58 action_714 (303) = happyShift action_59 action_714 (304) = happyShift action_60 action_714 (305) = happyShift action_61 action_714 (306) = happyShift action_62 action_714 (309) = happyShift action_64 action_714 (323) = happyShift action_236 action_714 (324) = happyShift action_237 action_714 (346) = happyShift action_238 action_714 (353) = happyShift action_239 action_714 (357) = happyShift action_240 action_714 (359) = happyShift action_241 action_714 (361) = happyShift action_242 action_714 (363) = happyShift action_243 action_714 (370) = happyShift action_244 action_714 (371) = happyShift action_245 action_714 (372) = happyShift action_246 action_714 (376) = happyShift action_247 action_714 (380) = happyShift action_248 action_714 (383) = happyShift action_249 action_714 (384) = happyShift action_250 action_714 (403) = happyShift action_251 action_714 (404) = happyShift action_252 action_714 (408) = happyShift action_108 action_714 (409) = happyShift action_109 action_714 (111) = happyGoto action_218 action_714 (115) = happyGoto action_924 action_714 (117) = happyGoto action_220 action_714 (118) = happyGoto action_221 action_714 (156) = happyGoto action_222 action_714 (224) = happyGoto action_223 action_714 (225) = happyGoto action_224 action_714 (227) = happyGoto action_225 action_714 (228) = happyGoto action_226 action_714 (237) = happyGoto action_227 action_714 (239) = happyGoto action_228 action_714 (249) = happyGoto action_229 action_714 _ = happyFail action_715 (267) = happyShift action_38 action_715 (275) = happyShift action_41 action_715 (287) = happyShift action_47 action_715 (293) = happyShift action_49 action_715 (294) = happyShift action_50 action_715 (295) = happyShift action_51 action_715 (296) = happyShift action_231 action_715 (297) = happyShift action_232 action_715 (298) = happyShift action_233 action_715 (302) = happyShift action_58 action_715 (303) = happyShift action_59 action_715 (304) = happyShift action_60 action_715 (305) = happyShift action_61 action_715 (306) = happyShift action_62 action_715 (309) = happyShift action_64 action_715 (323) = happyShift action_236 action_715 (324) = happyShift action_237 action_715 (346) = happyShift action_238 action_715 (353) = happyShift action_239 action_715 (357) = happyShift action_240 action_715 (359) = happyShift action_241 action_715 (361) = happyShift action_242 action_715 (363) = happyShift action_243 action_715 (370) = happyShift action_244 action_715 (371) = happyShift action_245 action_715 (372) = happyShift action_246 action_715 (376) = happyShift action_247 action_715 (380) = happyShift action_248 action_715 (383) = happyShift action_249 action_715 (384) = happyShift action_250 action_715 (403) = happyShift action_251 action_715 (404) = happyShift action_252 action_715 (408) = happyShift action_108 action_715 (409) = happyShift action_109 action_715 (111) = happyGoto action_218 action_715 (115) = happyGoto action_923 action_715 (117) = happyGoto action_220 action_715 (118) = happyGoto action_221 action_715 (156) = happyGoto action_222 action_715 (224) = happyGoto action_223 action_715 (225) = happyGoto action_224 action_715 (227) = happyGoto action_225 action_715 (228) = happyGoto action_226 action_715 (237) = happyGoto action_227 action_715 (239) = happyGoto action_228 action_715 (249) = happyGoto action_229 action_715 _ = happyFail action_716 (267) = happyShift action_38 action_716 (275) = happyShift action_41 action_716 (287) = happyShift action_47 action_716 (291) = happyShift action_48 action_716 (293) = happyShift action_49 action_716 (294) = happyShift action_50 action_716 (295) = happyShift action_51 action_716 (296) = happyShift action_52 action_716 (297) = happyShift action_53 action_716 (298) = happyShift action_54 action_716 (300) = happyShift action_56 action_716 (301) = happyShift action_57 action_716 (302) = happyShift action_58 action_716 (303) = happyShift action_59 action_716 (304) = happyShift action_60 action_716 (305) = happyShift action_61 action_716 (306) = happyShift action_62 action_716 (309) = happyShift action_64 action_716 (371) = happyShift action_81 action_716 (372) = happyShift action_82 action_716 (376) = happyShift action_84 action_716 (380) = happyShift action_86 action_716 (243) = happyGoto action_840 action_716 (249) = happyGoto action_33 action_716 (251) = happyGoto action_511 action_716 (252) = happyGoto action_35 action_716 _ = happyFail action_717 (369) = happyShift action_922 action_717 _ = happyFail action_718 (369) = happyShift action_921 action_718 _ = happyFail action_719 (267) = happyShift action_38 action_719 (275) = happyShift action_41 action_719 (287) = happyShift action_47 action_719 (293) = happyShift action_49 action_719 (294) = happyShift action_50 action_719 (295) = happyShift action_51 action_719 (296) = happyShift action_231 action_719 (297) = happyShift action_232 action_719 (298) = happyShift action_233 action_719 (302) = happyShift action_58 action_719 (303) = happyShift action_59 action_719 (304) = happyShift action_60 action_719 (305) = happyShift action_61 action_719 (306) = happyShift action_62 action_719 (309) = happyShift action_64 action_719 (323) = happyShift action_236 action_719 (324) = happyShift action_237 action_719 (344) = happyReduce_269 action_719 (346) = happyShift action_238 action_719 (353) = happyShift action_239 action_719 (357) = happyShift action_240 action_719 (359) = happyShift action_241 action_719 (361) = happyShift action_242 action_719 (363) = happyShift action_243 action_719 (370) = happyShift action_244 action_719 (371) = happyShift action_245 action_719 (372) = happyShift action_246 action_719 (376) = happyShift action_247 action_719 (380) = happyShift action_248 action_719 (383) = happyShift action_249 action_719 (384) = happyShift action_250 action_719 (403) = happyShift action_251 action_719 (404) = happyShift action_252 action_719 (408) = happyShift action_108 action_719 (409) = happyShift action_109 action_719 (111) = happyGoto action_218 action_719 (118) = happyGoto action_551 action_719 (156) = happyGoto action_222 action_719 (224) = happyGoto action_223 action_719 (225) = happyGoto action_224 action_719 (227) = happyGoto action_225 action_719 (228) = happyGoto action_226 action_719 (237) = happyGoto action_227 action_719 (239) = happyGoto action_228 action_719 (249) = happyGoto action_229 action_719 _ = happyReduce_275 action_720 _ = happyReduce_274 action_721 _ = happyReduce_273 action_722 _ = happyReduce_272 action_723 _ = happyReduce_187 action_724 (266) = happyShift action_37 action_724 (267) = happyShift action_38 action_724 (268) = happyShift action_39 action_724 (270) = happyShift action_918 action_724 (273) = happyShift action_40 action_724 (275) = happyShift action_41 action_724 (276) = happyShift action_42 action_724 (279) = happyShift action_43 action_724 (280) = happyShift action_44 action_724 (281) = happyShift action_45 action_724 (283) = happyShift action_46 action_724 (285) = happyShift action_142 action_724 (287) = happyShift action_47 action_724 (289) = happyShift action_919 action_724 (291) = happyShift action_48 action_724 (293) = happyShift action_49 action_724 (294) = happyShift action_50 action_724 (295) = happyShift action_51 action_724 (296) = happyShift action_52 action_724 (297) = happyShift action_53 action_724 (298) = happyShift action_54 action_724 (299) = happyShift action_55 action_724 (300) = happyShift action_56 action_724 (301) = happyShift action_57 action_724 (302) = happyShift action_58 action_724 (303) = happyShift action_59 action_724 (304) = happyShift action_60 action_724 (305) = happyShift action_61 action_724 (306) = happyShift action_62 action_724 (307) = happyShift action_63 action_724 (309) = happyShift action_64 action_724 (312) = happyShift action_145 action_724 (313) = happyShift action_65 action_724 (314) = happyShift action_66 action_724 (315) = happyShift action_67 action_724 (318) = happyShift action_68 action_724 (319) = happyShift action_69 action_724 (320) = happyShift action_70 action_724 (329) = happyShift action_71 action_724 (336) = happyShift action_72 action_724 (342) = happyShift action_73 action_724 (345) = happyShift action_74 action_724 (346) = happyShift action_153 action_724 (357) = happyShift action_75 action_724 (359) = happyShift action_76 action_724 (361) = happyShift action_77 action_724 (363) = happyShift action_78 action_724 (365) = happyShift action_79 action_724 (370) = happyShift action_80 action_724 (371) = happyShift action_81 action_724 (372) = happyShift action_82 action_724 (375) = happyShift action_83 action_724 (376) = happyShift action_84 action_724 (379) = happyShift action_85 action_724 (380) = happyShift action_86 action_724 (381) = happyShift action_87 action_724 (382) = happyShift action_88 action_724 (383) = happyShift action_89 action_724 (384) = happyShift action_90 action_724 (385) = happyShift action_91 action_724 (386) = happyShift action_92 action_724 (387) = happyShift action_93 action_724 (388) = happyShift action_94 action_724 (389) = happyShift action_95 action_724 (390) = happyShift action_96 action_724 (391) = happyShift action_97 action_724 (392) = happyShift action_154 action_724 (393) = happyShift action_155 action_724 (394) = happyShift action_156 action_724 (395) = happyShift action_157 action_724 (396) = happyShift action_98 action_724 (397) = happyShift action_99 action_724 (398) = happyShift action_100 action_724 (399) = happyShift action_101 action_724 (401) = happyShift action_102 action_724 (403) = happyShift action_103 action_724 (404) = happyShift action_104 action_724 (405) = happyShift action_105 action_724 (406) = happyShift action_106 action_724 (407) = happyShift action_107 action_724 (408) = happyShift action_108 action_724 (409) = happyShift action_109 action_724 (38) = happyGoto action_13 action_724 (49) = happyGoto action_14 action_724 (62) = happyGoto action_913 action_724 (63) = happyGoto action_914 action_724 (72) = happyGoto action_126 action_724 (79) = happyGoto action_915 action_724 (80) = happyGoto action_920 action_724 (146) = happyGoto action_128 action_724 (147) = happyGoto action_129 action_724 (148) = happyGoto action_627 action_724 (149) = happyGoto action_917 action_724 (153) = happyGoto action_131 action_724 (156) = happyGoto action_16 action_724 (158) = happyGoto action_629 action_724 (159) = happyGoto action_18 action_724 (161) = happyGoto action_19 action_724 (162) = happyGoto action_20 action_724 (163) = happyGoto action_21 action_724 (164) = happyGoto action_22 action_724 (165) = happyGoto action_23 action_724 (166) = happyGoto action_24 action_724 (167) = happyGoto action_630 action_724 (210) = happyGoto action_26 action_724 (217) = happyGoto action_27 action_724 (220) = happyGoto action_28 action_724 (240) = happyGoto action_29 action_724 (241) = happyGoto action_30 action_724 (242) = happyGoto action_31 action_724 (243) = happyGoto action_32 action_724 (249) = happyGoto action_33 action_724 (251) = happyGoto action_34 action_724 (252) = happyGoto action_35 action_724 (255) = happyGoto action_36 action_724 (259) = happyGoto action_133 action_724 (260) = happyGoto action_134 action_724 (261) = happyGoto action_135 action_724 (262) = happyGoto action_136 action_724 _ = happyReduce_184 action_725 (266) = happyShift action_37 action_725 (267) = happyShift action_38 action_725 (268) = happyShift action_39 action_725 (270) = happyShift action_918 action_725 (273) = happyShift action_40 action_725 (275) = happyShift action_41 action_725 (276) = happyShift action_42 action_725 (279) = happyShift action_43 action_725 (280) = happyShift action_44 action_725 (281) = happyShift action_45 action_725 (283) = happyShift action_46 action_725 (285) = happyShift action_142 action_725 (287) = happyShift action_47 action_725 (289) = happyShift action_919 action_725 (291) = happyShift action_48 action_725 (293) = happyShift action_49 action_725 (294) = happyShift action_50 action_725 (295) = happyShift action_51 action_725 (296) = happyShift action_52 action_725 (297) = happyShift action_53 action_725 (298) = happyShift action_54 action_725 (299) = happyShift action_55 action_725 (300) = happyShift action_56 action_725 (301) = happyShift action_57 action_725 (302) = happyShift action_58 action_725 (303) = happyShift action_59 action_725 (304) = happyShift action_60 action_725 (305) = happyShift action_61 action_725 (306) = happyShift action_62 action_725 (307) = happyShift action_63 action_725 (309) = happyShift action_64 action_725 (312) = happyShift action_145 action_725 (313) = happyShift action_65 action_725 (314) = happyShift action_66 action_725 (315) = happyShift action_67 action_725 (318) = happyShift action_68 action_725 (319) = happyShift action_69 action_725 (320) = happyShift action_70 action_725 (329) = happyShift action_71 action_725 (336) = happyShift action_72 action_725 (342) = happyShift action_73 action_725 (345) = happyShift action_74 action_725 (346) = happyShift action_153 action_725 (357) = happyShift action_75 action_725 (359) = happyShift action_76 action_725 (361) = happyShift action_77 action_725 (363) = happyShift action_78 action_725 (365) = happyShift action_79 action_725 (370) = happyShift action_80 action_725 (371) = happyShift action_81 action_725 (372) = happyShift action_82 action_725 (375) = happyShift action_83 action_725 (376) = happyShift action_84 action_725 (379) = happyShift action_85 action_725 (380) = happyShift action_86 action_725 (381) = happyShift action_87 action_725 (382) = happyShift action_88 action_725 (383) = happyShift action_89 action_725 (384) = happyShift action_90 action_725 (385) = happyShift action_91 action_725 (386) = happyShift action_92 action_725 (387) = happyShift action_93 action_725 (388) = happyShift action_94 action_725 (389) = happyShift action_95 action_725 (390) = happyShift action_96 action_725 (391) = happyShift action_97 action_725 (392) = happyShift action_154 action_725 (393) = happyShift action_155 action_725 (394) = happyShift action_156 action_725 (395) = happyShift action_157 action_725 (396) = happyShift action_98 action_725 (397) = happyShift action_99 action_725 (398) = happyShift action_100 action_725 (399) = happyShift action_101 action_725 (401) = happyShift action_102 action_725 (403) = happyShift action_103 action_725 (404) = happyShift action_104 action_725 (405) = happyShift action_105 action_725 (406) = happyShift action_106 action_725 (407) = happyShift action_107 action_725 (408) = happyShift action_108 action_725 (409) = happyShift action_109 action_725 (38) = happyGoto action_13 action_725 (49) = happyGoto action_14 action_725 (62) = happyGoto action_913 action_725 (63) = happyGoto action_914 action_725 (72) = happyGoto action_126 action_725 (79) = happyGoto action_915 action_725 (80) = happyGoto action_916 action_725 (146) = happyGoto action_128 action_725 (147) = happyGoto action_129 action_725 (148) = happyGoto action_627 action_725 (149) = happyGoto action_917 action_725 (153) = happyGoto action_131 action_725 (156) = happyGoto action_16 action_725 (158) = happyGoto action_629 action_725 (159) = happyGoto action_18 action_725 (161) = happyGoto action_19 action_725 (162) = happyGoto action_20 action_725 (163) = happyGoto action_21 action_725 (164) = happyGoto action_22 action_725 (165) = happyGoto action_23 action_725 (166) = happyGoto action_24 action_725 (167) = happyGoto action_630 action_725 (210) = happyGoto action_26 action_725 (217) = happyGoto action_27 action_725 (220) = happyGoto action_28 action_725 (240) = happyGoto action_29 action_725 (241) = happyGoto action_30 action_725 (242) = happyGoto action_31 action_725 (243) = happyGoto action_32 action_725 (249) = happyGoto action_33 action_725 (251) = happyGoto action_34 action_725 (252) = happyGoto action_35 action_725 (255) = happyGoto action_36 action_725 (259) = happyGoto action_133 action_725 (260) = happyGoto action_134 action_725 (261) = happyGoto action_135 action_725 (262) = happyGoto action_136 action_725 _ = happyReduce_184 action_726 _ = happyReduce_263 action_727 (334) = happyShift action_912 action_727 _ = happyFail action_728 _ = happyReduce_320 action_729 (267) = happyShift action_38 action_729 (275) = happyShift action_41 action_729 (287) = happyShift action_47 action_729 (291) = happyShift action_260 action_729 (293) = happyShift action_49 action_729 (294) = happyShift action_50 action_729 (295) = happyShift action_51 action_729 (296) = happyShift action_231 action_729 (297) = happyShift action_232 action_729 (298) = happyShift action_233 action_729 (302) = happyShift action_58 action_729 (303) = happyShift action_59 action_729 (304) = happyShift action_60 action_729 (305) = happyShift action_61 action_729 (306) = happyShift action_62 action_729 (309) = happyShift action_64 action_729 (323) = happyShift action_236 action_729 (324) = happyShift action_237 action_729 (346) = happyShift action_238 action_729 (353) = happyShift action_239 action_729 (357) = happyShift action_240 action_729 (359) = happyShift action_241 action_729 (361) = happyShift action_242 action_729 (363) = happyShift action_243 action_729 (370) = happyShift action_244 action_729 (371) = happyShift action_245 action_729 (372) = happyShift action_246 action_729 (376) = happyShift action_247 action_729 (380) = happyShift action_248 action_729 (381) = happyShift action_87 action_729 (383) = happyShift action_249 action_729 (384) = happyShift action_250 action_729 (403) = happyShift action_251 action_729 (404) = happyShift action_252 action_729 (408) = happyShift action_108 action_729 (409) = happyShift action_109 action_729 (111) = happyGoto action_218 action_729 (112) = happyGoto action_911 action_729 (114) = happyGoto action_255 action_729 (115) = happyGoto action_256 action_729 (117) = happyGoto action_257 action_729 (118) = happyGoto action_221 action_729 (156) = happyGoto action_222 action_729 (210) = happyGoto action_259 action_729 (224) = happyGoto action_223 action_729 (225) = happyGoto action_224 action_729 (227) = happyGoto action_225 action_729 (228) = happyGoto action_226 action_729 (237) = happyGoto action_227 action_729 (239) = happyGoto action_228 action_729 (249) = happyGoto action_229 action_729 _ = happyFail action_730 _ = happyReduce_100 action_731 (267) = happyShift action_38 action_731 (275) = happyShift action_41 action_731 (287) = happyShift action_47 action_731 (291) = happyShift action_260 action_731 (293) = happyShift action_49 action_731 (294) = happyShift action_50 action_731 (295) = happyShift action_51 action_731 (296) = happyShift action_231 action_731 (297) = happyShift action_232 action_731 (298) = happyShift action_233 action_731 (302) = happyShift action_58 action_731 (303) = happyShift action_59 action_731 (304) = happyShift action_60 action_731 (305) = happyShift action_61 action_731 (306) = happyShift action_62 action_731 (309) = happyShift action_64 action_731 (323) = happyShift action_236 action_731 (324) = happyShift action_237 action_731 (346) = happyShift action_238 action_731 (353) = happyShift action_239 action_731 (357) = happyShift action_240 action_731 (359) = happyShift action_241 action_731 (361) = happyShift action_242 action_731 (363) = happyShift action_243 action_731 (370) = happyShift action_244 action_731 (371) = happyShift action_245 action_731 (372) = happyShift action_246 action_731 (376) = happyShift action_247 action_731 (380) = happyShift action_248 action_731 (381) = happyShift action_87 action_731 (383) = happyShift action_249 action_731 (384) = happyShift action_250 action_731 (403) = happyShift action_251 action_731 (404) = happyShift action_252 action_731 (408) = happyShift action_108 action_731 (409) = happyShift action_109 action_731 (111) = happyGoto action_218 action_731 (112) = happyGoto action_540 action_731 (114) = happyGoto action_255 action_731 (115) = happyGoto action_256 action_731 (117) = happyGoto action_257 action_731 (118) = happyGoto action_221 action_731 (122) = happyGoto action_910 action_731 (156) = happyGoto action_222 action_731 (210) = happyGoto action_259 action_731 (224) = happyGoto action_223 action_731 (225) = happyGoto action_224 action_731 (227) = happyGoto action_225 action_731 (228) = happyGoto action_226 action_731 (237) = happyGoto action_227 action_731 (239) = happyGoto action_228 action_731 (249) = happyGoto action_229 action_731 _ = happyFail action_732 _ = happyReduce_120 action_733 (368) = happyShift action_909 action_733 _ = happyReduce_325 action_734 _ = happyReduce_327 action_735 (267) = happyShift action_38 action_735 (275) = happyShift action_41 action_735 (287) = happyShift action_47 action_735 (293) = happyShift action_49 action_735 (294) = happyShift action_50 action_735 (295) = happyShift action_51 action_735 (296) = happyShift action_231 action_735 (297) = happyShift action_232 action_735 (298) = happyShift action_233 action_735 (302) = happyShift action_58 action_735 (303) = happyShift action_59 action_735 (304) = happyShift action_60 action_735 (305) = happyShift action_61 action_735 (306) = happyShift action_62 action_735 (309) = happyShift action_64 action_735 (340) = happyShift action_908 action_735 (371) = happyShift action_245 action_735 (237) = happyGoto action_907 action_735 (239) = happyGoto action_228 action_735 (249) = happyGoto action_229 action_735 _ = happyFail action_736 _ = happyReduce_115 action_737 (353) = happyShift action_905 action_737 (355) = happyShift action_906 action_737 (77) = happyGoto action_904 action_737 _ = happyFail action_738 _ = happyReduce_149 action_739 (335) = happyShift action_903 action_739 _ = happyFail action_740 (290) = happyShift action_743 action_740 (86) = happyGoto action_902 action_740 _ = happyReduce_199 action_741 _ = happyReduce_384 action_742 _ = happyReduce_385 action_743 (353) = happyShift action_179 action_743 (355) = happyShift action_180 action_743 (84) = happyGoto action_177 action_743 (85) = happyGoto action_901 action_743 _ = happyFail action_744 (352) = happyShift action_900 action_744 _ = happyFail action_745 (267) = happyShift action_38 action_745 (275) = happyShift action_41 action_745 (287) = happyShift action_47 action_745 (293) = happyShift action_49 action_745 (294) = happyShift action_50 action_745 (295) = happyShift action_51 action_745 (296) = happyShift action_231 action_745 (297) = happyShift action_232 action_745 (298) = happyShift action_233 action_745 (302) = happyShift action_58 action_745 (303) = happyShift action_59 action_745 (304) = happyShift action_60 action_745 (305) = happyShift action_61 action_745 (306) = happyShift action_62 action_745 (309) = happyShift action_64 action_745 (323) = happyShift action_236 action_745 (324) = happyShift action_237 action_745 (346) = happyShift action_238 action_745 (353) = happyShift action_239 action_745 (357) = happyShift action_240 action_745 (359) = happyShift action_241 action_745 (361) = happyShift action_242 action_745 (363) = happyShift action_243 action_745 (370) = happyShift action_244 action_745 (371) = happyShift action_245 action_745 (372) = happyShift action_246 action_745 (376) = happyShift action_247 action_745 (380) = happyShift action_248 action_745 (383) = happyShift action_249 action_745 (384) = happyShift action_250 action_745 (403) = happyShift action_251 action_745 (404) = happyShift action_252 action_745 (408) = happyShift action_108 action_745 (409) = happyShift action_109 action_745 (111) = happyGoto action_218 action_745 (115) = happyGoto action_899 action_745 (117) = happyGoto action_220 action_745 (118) = happyGoto action_221 action_745 (156) = happyGoto action_222 action_745 (224) = happyGoto action_223 action_745 (225) = happyGoto action_224 action_745 (227) = happyGoto action_225 action_745 (228) = happyGoto action_226 action_745 (237) = happyGoto action_227 action_745 (239) = happyGoto action_228 action_745 (249) = happyGoto action_229 action_745 _ = happyFail action_746 (267) = happyShift action_38 action_746 (275) = happyShift action_41 action_746 (287) = happyShift action_47 action_746 (293) = happyShift action_49 action_746 (294) = happyShift action_50 action_746 (295) = happyShift action_51 action_746 (296) = happyShift action_231 action_746 (297) = happyShift action_232 action_746 (298) = happyShift action_233 action_746 (302) = happyShift action_58 action_746 (303) = happyShift action_59 action_746 (304) = happyShift action_60 action_746 (305) = happyShift action_61 action_746 (306) = happyShift action_62 action_746 (309) = happyShift action_64 action_746 (323) = happyShift action_236 action_746 (324) = happyShift action_237 action_746 (346) = happyShift action_238 action_746 (353) = happyShift action_239 action_746 (357) = happyShift action_240 action_746 (359) = happyShift action_241 action_746 (361) = happyShift action_242 action_746 (363) = happyShift action_243 action_746 (370) = happyShift action_244 action_746 (371) = happyShift action_245 action_746 (372) = happyShift action_246 action_746 (376) = happyShift action_247 action_746 (380) = happyShift action_248 action_746 (383) = happyShift action_249 action_746 (384) = happyShift action_250 action_746 (403) = happyShift action_251 action_746 (404) = happyShift action_252 action_746 (408) = happyShift action_108 action_746 (409) = happyShift action_109 action_746 (111) = happyGoto action_218 action_746 (115) = happyGoto action_898 action_746 (117) = happyGoto action_220 action_746 (118) = happyGoto action_221 action_746 (156) = happyGoto action_222 action_746 (224) = happyGoto action_223 action_746 (225) = happyGoto action_224 action_746 (227) = happyGoto action_225 action_746 (228) = happyGoto action_226 action_746 (237) = happyGoto action_227 action_746 (239) = happyGoto action_228 action_746 (249) = happyGoto action_229 action_746 _ = happyFail action_747 (267) = happyShift action_38 action_747 (275) = happyShift action_41 action_747 (287) = happyShift action_47 action_747 (293) = happyShift action_49 action_747 (294) = happyShift action_50 action_747 (295) = happyShift action_51 action_747 (296) = happyShift action_231 action_747 (297) = happyShift action_232 action_747 (298) = happyShift action_233 action_747 (302) = happyShift action_58 action_747 (303) = happyShift action_59 action_747 (304) = happyShift action_60 action_747 (305) = happyShift action_61 action_747 (306) = happyShift action_62 action_747 (309) = happyShift action_64 action_747 (323) = happyShift action_236 action_747 (324) = happyShift action_237 action_747 (346) = happyShift action_238 action_747 (353) = happyShift action_239 action_747 (357) = happyShift action_240 action_747 (359) = happyShift action_241 action_747 (361) = happyShift action_242 action_747 (363) = happyShift action_243 action_747 (370) = happyShift action_244 action_747 (371) = happyShift action_245 action_747 (372) = happyShift action_246 action_747 (376) = happyShift action_247 action_747 (380) = happyShift action_248 action_747 (383) = happyShift action_249 action_747 (384) = happyShift action_250 action_747 (403) = happyShift action_251 action_747 (404) = happyShift action_252 action_747 (408) = happyShift action_108 action_747 (409) = happyShift action_109 action_747 (111) = happyGoto action_218 action_747 (115) = happyGoto action_897 action_747 (117) = happyGoto action_220 action_747 (118) = happyGoto action_221 action_747 (156) = happyGoto action_222 action_747 (224) = happyGoto action_223 action_747 (225) = happyGoto action_224 action_747 (227) = happyGoto action_225 action_747 (228) = happyGoto action_226 action_747 (237) = happyGoto action_227 action_747 (239) = happyGoto action_228 action_747 (249) = happyGoto action_229 action_747 _ = happyFail action_748 (340) = happyShift action_896 action_748 _ = happyReduce_279 action_749 (267) = happyShift action_38 action_749 (275) = happyShift action_41 action_749 (287) = happyShift action_47 action_749 (291) = happyShift action_529 action_749 (293) = happyShift action_49 action_749 (294) = happyShift action_50 action_749 (295) = happyShift action_51 action_749 (296) = happyShift action_231 action_749 (297) = happyShift action_232 action_749 (298) = happyShift action_233 action_749 (302) = happyShift action_58 action_749 (303) = happyShift action_59 action_749 (304) = happyShift action_60 action_749 (305) = happyShift action_61 action_749 (306) = happyShift action_62 action_749 (309) = happyShift action_64 action_749 (323) = happyShift action_236 action_749 (324) = happyShift action_237 action_749 (346) = happyShift action_238 action_749 (353) = happyShift action_239 action_749 (357) = happyShift action_240 action_749 (359) = happyShift action_241 action_749 (361) = happyShift action_242 action_749 (363) = happyShift action_243 action_749 (370) = happyShift action_244 action_749 (371) = happyShift action_245 action_749 (372) = happyShift action_246 action_749 (376) = happyShift action_247 action_749 (380) = happyShift action_248 action_749 (381) = happyShift action_87 action_749 (383) = happyShift action_249 action_749 (384) = happyShift action_250 action_749 (403) = happyShift action_251 action_749 (404) = happyShift action_252 action_749 (408) = happyShift action_108 action_749 (409) = happyShift action_109 action_749 (111) = happyGoto action_218 action_749 (112) = happyGoto action_720 action_749 (113) = happyGoto action_848 action_749 (114) = happyGoto action_526 action_749 (115) = happyGoto action_256 action_749 (116) = happyGoto action_402 action_749 (117) = happyGoto action_527 action_749 (118) = happyGoto action_221 action_749 (156) = happyGoto action_222 action_749 (210) = happyGoto action_528 action_749 (224) = happyGoto action_223 action_749 (225) = happyGoto action_224 action_749 (227) = happyGoto action_225 action_749 (228) = happyGoto action_226 action_749 (237) = happyGoto action_227 action_749 (239) = happyGoto action_228 action_749 (249) = happyGoto action_229 action_749 _ = happyFail action_750 (267) = happyShift action_38 action_750 (275) = happyShift action_41 action_750 (287) = happyShift action_47 action_750 (293) = happyShift action_49 action_750 (294) = happyShift action_50 action_750 (295) = happyShift action_51 action_750 (296) = happyShift action_231 action_750 (297) = happyShift action_232 action_750 (298) = happyShift action_233 action_750 (302) = happyShift action_58 action_750 (303) = happyShift action_59 action_750 (304) = happyShift action_60 action_750 (305) = happyShift action_61 action_750 (306) = happyShift action_62 action_750 (309) = happyShift action_64 action_750 (323) = happyShift action_236 action_750 (324) = happyShift action_237 action_750 (346) = happyShift action_238 action_750 (353) = happyShift action_239 action_750 (357) = happyShift action_240 action_750 (359) = happyShift action_241 action_750 (361) = happyShift action_242 action_750 (363) = happyShift action_243 action_750 (370) = happyShift action_244 action_750 (371) = happyShift action_245 action_750 (372) = happyShift action_246 action_750 (376) = happyShift action_247 action_750 (380) = happyShift action_248 action_750 (383) = happyShift action_249 action_750 (384) = happyShift action_250 action_750 (403) = happyShift action_251 action_750 (404) = happyShift action_252 action_750 (408) = happyShift action_108 action_750 (409) = happyShift action_109 action_750 (111) = happyGoto action_218 action_750 (117) = happyGoto action_895 action_750 (118) = happyGoto action_221 action_750 (156) = happyGoto action_222 action_750 (224) = happyGoto action_223 action_750 (225) = happyGoto action_224 action_750 (227) = happyGoto action_225 action_750 (228) = happyGoto action_226 action_750 (237) = happyGoto action_227 action_750 (239) = happyGoto action_228 action_750 (249) = happyGoto action_229 action_750 _ = happyFail action_751 (267) = happyShift action_38 action_751 (275) = happyShift action_41 action_751 (287) = happyShift action_47 action_751 (291) = happyShift action_48 action_751 (293) = happyShift action_49 action_751 (294) = happyShift action_50 action_751 (295) = happyShift action_51 action_751 (296) = happyShift action_52 action_751 (297) = happyShift action_53 action_751 (298) = happyShift action_54 action_751 (300) = happyShift action_56 action_751 (301) = happyShift action_57 action_751 (302) = happyShift action_58 action_751 (303) = happyShift action_59 action_751 (304) = happyShift action_60 action_751 (305) = happyShift action_61 action_751 (306) = happyShift action_62 action_751 (309) = happyShift action_64 action_751 (333) = happyShift action_278 action_751 (345) = happyShift action_280 action_751 (346) = happyShift action_281 action_751 (347) = happyShift action_282 action_751 (352) = happyShift action_283 action_751 (357) = happyShift action_564 action_751 (361) = happyShift action_565 action_751 (363) = happyShift action_201 action_751 (369) = happyShift action_716 action_751 (371) = happyShift action_81 action_751 (372) = happyShift action_82 action_751 (373) = happyShift action_285 action_751 (374) = happyShift action_286 action_751 (376) = happyShift action_84 action_751 (378) = happyShift action_288 action_751 (380) = happyShift action_86 action_751 (217) = happyGoto action_562 action_751 (220) = happyGoto action_28 action_751 (222) = happyGoto action_893 action_751 (232) = happyGoto action_894 action_751 (240) = happyGoto action_563 action_751 (243) = happyGoto action_195 action_751 (247) = happyGoto action_396 action_751 (248) = happyGoto action_274 action_751 (249) = happyGoto action_33 action_751 (250) = happyGoto action_275 action_751 (251) = happyGoto action_34 action_751 (252) = happyGoto action_35 action_751 (253) = happyGoto action_276 action_751 (254) = happyGoto action_277 action_751 _ = happyFail action_752 (267) = happyShift action_38 action_752 (275) = happyShift action_41 action_752 (287) = happyShift action_47 action_752 (291) = happyShift action_529 action_752 (293) = happyShift action_49 action_752 (294) = happyShift action_50 action_752 (295) = happyShift action_51 action_752 (296) = happyShift action_231 action_752 (297) = happyShift action_232 action_752 (298) = happyShift action_233 action_752 (302) = happyShift action_58 action_752 (303) = happyShift action_59 action_752 (304) = happyShift action_60 action_752 (305) = happyShift action_61 action_752 (306) = happyShift action_62 action_752 (309) = happyShift action_64 action_752 (323) = happyShift action_236 action_752 (324) = happyShift action_237 action_752 (346) = happyShift action_238 action_752 (353) = happyShift action_239 action_752 (357) = happyShift action_240 action_752 (359) = happyShift action_241 action_752 (361) = happyShift action_242 action_752 (363) = happyShift action_243 action_752 (370) = happyShift action_244 action_752 (371) = happyShift action_245 action_752 (372) = happyShift action_246 action_752 (376) = happyShift action_247 action_752 (380) = happyShift action_248 action_752 (381) = happyShift action_87 action_752 (383) = happyShift action_249 action_752 (384) = happyShift action_250 action_752 (403) = happyShift action_251 action_752 (404) = happyShift action_252 action_752 (408) = happyShift action_108 action_752 (409) = happyShift action_109 action_752 (111) = happyGoto action_218 action_752 (112) = happyGoto action_713 action_752 (113) = happyGoto action_844 action_752 (114) = happyGoto action_526 action_752 (115) = happyGoto action_256 action_752 (116) = happyGoto action_402 action_752 (117) = happyGoto action_527 action_752 (118) = happyGoto action_221 action_752 (156) = happyGoto action_222 action_752 (210) = happyGoto action_528 action_752 (224) = happyGoto action_223 action_752 (225) = happyGoto action_224 action_752 (227) = happyGoto action_225 action_752 (228) = happyGoto action_226 action_752 (237) = happyGoto action_227 action_752 (239) = happyGoto action_228 action_752 (249) = happyGoto action_229 action_752 _ = happyFail action_753 _ = happyReduce_628 action_754 (290) = happyShift action_892 action_754 (134) = happyGoto action_891 action_754 _ = happyReduce_347 action_755 (272) = happyShift action_890 action_755 (145) = happyGoto action_889 action_755 _ = happyReduce_367 action_756 (335) = happyShift action_888 action_756 _ = happyFail action_757 (334) = happyShift action_691 action_757 (335) = happyReduce_709 action_757 (392) = happyShift action_154 action_757 (64) = happyGoto action_886 action_757 (137) = happyGoto action_887 action_757 (259) = happyGoto action_575 action_757 (265) = happyGoto action_756 action_757 _ = happyReduce_147 action_758 _ = happyReduce_152 action_759 (331) = happyShift action_885 action_759 _ = happyFail action_760 _ = happyReduce_474 action_761 _ = happyReduce_592 action_762 _ = happyReduce_630 action_763 (361) = happyShift action_884 action_763 (29) = happyGoto action_883 action_763 _ = happyReduce_42 action_764 (357) = happyShift action_604 action_764 (383) = happyShift action_605 action_764 (98) = happyGoto action_882 action_764 _ = happyFail action_765 (357) = happyShift action_604 action_765 (383) = happyShift action_605 action_765 (98) = happyGoto action_881 action_765 _ = happyFail action_766 _ = happyReduce_602 action_767 _ = happyReduce_605 action_768 _ = happyReduce_599 action_769 _ = happyReduce_597 action_770 _ = happyReduce_604 action_771 _ = happyReduce_598 action_772 _ = happyReduce_467 action_773 _ = happyReduce_468 action_774 (266) = happyShift action_37 action_774 (267) = happyShift action_38 action_774 (268) = happyShift action_39 action_774 (269) = happyShift action_137 action_774 (270) = happyShift action_138 action_774 (271) = happyShift action_139 action_774 (272) = happyShift action_140 action_774 (273) = happyShift action_40 action_774 (275) = happyShift action_41 action_774 (276) = happyShift action_42 action_774 (279) = happyShift action_43 action_774 (280) = happyShift action_44 action_774 (281) = happyShift action_45 action_774 (282) = happyShift action_141 action_774 (283) = happyShift action_46 action_774 (285) = happyShift action_142 action_774 (287) = happyShift action_47 action_774 (289) = happyShift action_143 action_774 (291) = happyShift action_48 action_774 (292) = happyShift action_144 action_774 (293) = happyShift action_49 action_774 (294) = happyShift action_50 action_774 (295) = happyShift action_51 action_774 (296) = happyShift action_52 action_774 (297) = happyShift action_53 action_774 (298) = happyShift action_54 action_774 (299) = happyShift action_55 action_774 (300) = happyShift action_56 action_774 (301) = happyShift action_57 action_774 (302) = happyShift action_58 action_774 (303) = happyShift action_59 action_774 (304) = happyShift action_60 action_774 (305) = happyShift action_61 action_774 (306) = happyShift action_62 action_774 (307) = happyShift action_63 action_774 (309) = happyShift action_64 action_774 (312) = happyShift action_145 action_774 (313) = happyShift action_65 action_774 (314) = happyShift action_66 action_774 (315) = happyShift action_67 action_774 (317) = happyShift action_146 action_774 (318) = happyShift action_68 action_774 (319) = happyShift action_69 action_774 (320) = happyShift action_70 action_774 (321) = happyShift action_147 action_774 (322) = happyShift action_148 action_774 (325) = happyShift action_149 action_774 (326) = happyShift action_150 action_774 (327) = happyShift action_151 action_774 (328) = happyShift action_152 action_774 (329) = happyShift action_71 action_774 (336) = happyShift action_72 action_774 (342) = happyShift action_73 action_774 (345) = happyShift action_74 action_774 (346) = happyShift action_153 action_774 (357) = happyShift action_75 action_774 (359) = happyShift action_76 action_774 (361) = happyShift action_77 action_774 (363) = happyShift action_78 action_774 (365) = happyShift action_79 action_774 (370) = happyShift action_80 action_774 (371) = happyShift action_81 action_774 (372) = happyShift action_82 action_774 (375) = happyShift action_83 action_774 (376) = happyShift action_84 action_774 (379) = happyShift action_85 action_774 (380) = happyShift action_86 action_774 (381) = happyShift action_87 action_774 (382) = happyShift action_88 action_774 (383) = happyShift action_89 action_774 (384) = happyShift action_90 action_774 (385) = happyShift action_91 action_774 (386) = happyShift action_92 action_774 (387) = happyShift action_93 action_774 (388) = happyShift action_94 action_774 (389) = happyShift action_95 action_774 (390) = happyShift action_96 action_774 (391) = happyShift action_97 action_774 (392) = happyShift action_154 action_774 (393) = happyShift action_155 action_774 (394) = happyShift action_156 action_774 (395) = happyShift action_157 action_774 (396) = happyShift action_98 action_774 (397) = happyShift action_99 action_774 (398) = happyShift action_100 action_774 (399) = happyShift action_101 action_774 (401) = happyShift action_102 action_774 (403) = happyShift action_103 action_774 (404) = happyShift action_104 action_774 (405) = happyShift action_105 action_774 (406) = happyShift action_106 action_774 (407) = happyShift action_107 action_774 (408) = happyShift action_108 action_774 (409) = happyShift action_109 action_774 (38) = happyGoto action_13 action_774 (49) = happyGoto action_14 action_774 (52) = happyGoto action_880 action_774 (53) = happyGoto action_120 action_774 (54) = happyGoto action_121 action_774 (55) = happyGoto action_122 action_774 (63) = happyGoto action_123 action_774 (67) = happyGoto action_124 action_774 (68) = happyGoto action_125 action_774 (72) = happyGoto action_126 action_774 (100) = happyGoto action_127 action_774 (146) = happyGoto action_128 action_774 (147) = happyGoto action_129 action_774 (148) = happyGoto action_130 action_774 (153) = happyGoto action_131 action_774 (156) = happyGoto action_16 action_774 (158) = happyGoto action_132 action_774 (159) = happyGoto action_18 action_774 (161) = happyGoto action_19 action_774 (162) = happyGoto action_20 action_774 (163) = happyGoto action_21 action_774 (164) = happyGoto action_22 action_774 (165) = happyGoto action_23 action_774 (166) = happyGoto action_24 action_774 (167) = happyGoto action_25 action_774 (210) = happyGoto action_26 action_774 (217) = happyGoto action_27 action_774 (220) = happyGoto action_28 action_774 (240) = happyGoto action_29 action_774 (241) = happyGoto action_30 action_774 (242) = happyGoto action_31 action_774 (243) = happyGoto action_32 action_774 (249) = happyGoto action_33 action_774 (251) = happyGoto action_34 action_774 (252) = happyGoto action_35 action_774 (255) = happyGoto action_36 action_774 (259) = happyGoto action_133 action_774 (260) = happyGoto action_134 action_774 (261) = happyGoto action_135 action_774 (262) = happyGoto action_136 action_774 _ = happyReduce_93 action_775 _ = happyReduce_466 action_776 _ = happyReduce_464 action_777 _ = happyReduce_459 action_778 _ = happyReduce_477 action_779 _ = happyReduce_478 action_780 (332) = happyShift action_879 action_780 (340) = happyShift action_520 action_780 _ = happyReduce_471 action_781 _ = happyReduce_489 action_782 _ = happyReduce_506 action_783 _ = happyReduce_490 action_784 (338) = happyShift action_877 action_784 (368) = happyShift action_878 action_784 _ = happyReduce_492 action_785 _ = happyReduce_495 action_786 _ = happyReduce_496 action_787 (266) = happyShift action_37 action_787 (267) = happyShift action_38 action_787 (268) = happyShift action_39 action_787 (273) = happyShift action_40 action_787 (275) = happyShift action_41 action_787 (276) = happyShift action_42 action_787 (283) = happyShift action_46 action_787 (287) = happyShift action_47 action_787 (291) = happyShift action_48 action_787 (293) = happyShift action_49 action_787 (294) = happyShift action_50 action_787 (295) = happyShift action_51 action_787 (296) = happyShift action_52 action_787 (297) = happyShift action_53 action_787 (298) = happyShift action_54 action_787 (299) = happyShift action_55 action_787 (300) = happyShift action_56 action_787 (301) = happyShift action_57 action_787 (302) = happyShift action_58 action_787 (303) = happyShift action_59 action_787 (304) = happyShift action_60 action_787 (305) = happyShift action_61 action_787 (306) = happyShift action_62 action_787 (307) = happyShift action_63 action_787 (309) = happyShift action_876 action_787 (318) = happyShift action_68 action_787 (319) = happyShift action_69 action_787 (320) = happyShift action_70 action_787 (336) = happyShift action_72 action_787 (342) = happyShift action_73 action_787 (345) = happyShift action_74 action_787 (357) = happyShift action_75 action_787 (359) = happyShift action_76 action_787 (361) = happyShift action_118 action_787 (363) = happyShift action_78 action_787 (365) = happyShift action_79 action_787 (370) = happyShift action_80 action_787 (371) = happyShift action_81 action_787 (372) = happyShift action_82 action_787 (375) = happyShift action_83 action_787 (376) = happyShift action_84 action_787 (379) = happyShift action_85 action_787 (380) = happyShift action_86 action_787 (381) = happyShift action_87 action_787 (382) = happyShift action_88 action_787 (383) = happyShift action_89 action_787 (384) = happyShift action_90 action_787 (385) = happyShift action_91 action_787 (386) = happyShift action_92 action_787 (387) = happyShift action_93 action_787 (388) = happyShift action_94 action_787 (389) = happyShift action_95 action_787 (390) = happyShift action_96 action_787 (391) = happyShift action_97 action_787 (396) = happyShift action_98 action_787 (397) = happyShift action_99 action_787 (398) = happyShift action_100 action_787 (399) = happyShift action_101 action_787 (401) = happyShift action_102 action_787 (403) = happyShift action_103 action_787 (404) = happyShift action_104 action_787 (405) = happyShift action_105 action_787 (406) = happyShift action_106 action_787 (407) = happyShift action_107 action_787 (408) = happyShift action_108 action_787 (409) = happyShift action_109 action_787 (38) = happyGoto action_13 action_787 (156) = happyGoto action_16 action_787 (157) = happyGoto action_875 action_787 (158) = happyGoto action_116 action_787 (159) = happyGoto action_18 action_787 (161) = happyGoto action_19 action_787 (162) = happyGoto action_20 action_787 (163) = happyGoto action_21 action_787 (164) = happyGoto action_22 action_787 (165) = happyGoto action_23 action_787 (166) = happyGoto action_24 action_787 (167) = happyGoto action_25 action_787 (210) = happyGoto action_26 action_787 (217) = happyGoto action_27 action_787 (220) = happyGoto action_28 action_787 (241) = happyGoto action_30 action_787 (242) = happyGoto action_31 action_787 (243) = happyGoto action_117 action_787 (249) = happyGoto action_33 action_787 (251) = happyGoto action_34 action_787 (252) = happyGoto action_35 action_787 (255) = happyGoto action_36 action_787 _ = happyFail action_788 _ = happyReduce_504 action_789 (332) = happyShift action_874 action_789 (340) = happyShift action_520 action_789 _ = happyReduce_471 action_790 _ = happyReduce_487 action_791 _ = happyReduce_485 action_792 _ = happyReduce_488 action_793 (340) = happyShift action_873 action_793 _ = happyFail action_794 (267) = happyShift action_38 action_794 (275) = happyShift action_41 action_794 (287) = happyShift action_47 action_794 (293) = happyShift action_49 action_794 (294) = happyShift action_50 action_794 (295) = happyShift action_51 action_794 (296) = happyShift action_231 action_794 (297) = happyShift action_232 action_794 (298) = happyShift action_233 action_794 (302) = happyShift action_58 action_794 (303) = happyShift action_59 action_794 (304) = happyShift action_60 action_794 (305) = happyShift action_61 action_794 (306) = happyShift action_62 action_794 (309) = happyShift action_64 action_794 (323) = happyShift action_236 action_794 (324) = happyShift action_237 action_794 (346) = happyShift action_238 action_794 (353) = happyShift action_239 action_794 (357) = happyShift action_240 action_794 (359) = happyShift action_241 action_794 (361) = happyShift action_242 action_794 (363) = happyShift action_243 action_794 (370) = happyShift action_244 action_794 (371) = happyShift action_245 action_794 (372) = happyShift action_246 action_794 (376) = happyShift action_247 action_794 (380) = happyShift action_248 action_794 (383) = happyShift action_249 action_794 (384) = happyShift action_250 action_794 (403) = happyShift action_251 action_794 (404) = happyShift action_252 action_794 (408) = happyShift action_108 action_794 (409) = happyShift action_109 action_794 (111) = happyGoto action_218 action_794 (118) = happyGoto action_872 action_794 (156) = happyGoto action_222 action_794 (224) = happyGoto action_223 action_794 (225) = happyGoto action_224 action_794 (227) = happyGoto action_225 action_794 (228) = happyGoto action_226 action_794 (237) = happyGoto action_227 action_794 (239) = happyGoto action_228 action_794 (249) = happyGoto action_229 action_794 _ = happyFail action_795 _ = happyReduce_536 action_796 _ = happyReduce_530 action_797 (1) = happyShift action_424 action_797 (356) = happyShift action_425 action_797 (256) = happyGoto action_871 action_797 _ = happyFail action_798 (367) = happyShift action_870 action_798 _ = happyReduce_514 action_799 _ = happyReduce_518 action_800 (334) = happyShift action_869 action_800 (105) = happyGoto action_868 action_800 _ = happyReduce_246 action_801 _ = happyReduce_513 action_802 (266) = happyShift action_37 action_802 (267) = happyShift action_38 action_802 (275) = happyShift action_41 action_802 (287) = happyShift action_47 action_802 (291) = happyShift action_48 action_802 (293) = happyShift action_49 action_802 (294) = happyShift action_50 action_802 (295) = happyShift action_51 action_802 (296) = happyShift action_52 action_802 (297) = happyShift action_53 action_802 (298) = happyShift action_54 action_802 (300) = happyShift action_56 action_802 (301) = happyShift action_57 action_802 (302) = happyShift action_58 action_802 (303) = happyShift action_59 action_802 (304) = happyShift action_60 action_802 (305) = happyShift action_61 action_802 (306) = happyShift action_62 action_802 (309) = happyShift action_64 action_802 (342) = happyShift action_73 action_802 (357) = happyShift action_75 action_802 (359) = happyShift action_76 action_802 (361) = happyShift action_118 action_802 (363) = happyShift action_78 action_802 (365) = happyShift action_79 action_802 (370) = happyShift action_80 action_802 (371) = happyShift action_81 action_802 (372) = happyShift action_82 action_802 (375) = happyShift action_83 action_802 (376) = happyShift action_84 action_802 (379) = happyShift action_85 action_802 (380) = happyShift action_86 action_802 (381) = happyShift action_87 action_802 (382) = happyShift action_88 action_802 (383) = happyShift action_89 action_802 (384) = happyShift action_90 action_802 (385) = happyShift action_91 action_802 (386) = happyShift action_92 action_802 (387) = happyShift action_93 action_802 (388) = happyShift action_94 action_802 (389) = happyShift action_95 action_802 (390) = happyShift action_96 action_802 (391) = happyShift action_97 action_802 (396) = happyShift action_98 action_802 (397) = happyShift action_99 action_802 (398) = happyShift action_100 action_802 (399) = happyShift action_101 action_802 (401) = happyShift action_102 action_802 (403) = happyShift action_103 action_802 (404) = happyShift action_104 action_802 (405) = happyShift action_105 action_802 (406) = happyShift action_106 action_802 (407) = happyShift action_107 action_802 (408) = happyShift action_108 action_802 (409) = happyShift action_109 action_802 (38) = happyGoto action_13 action_802 (156) = happyGoto action_16 action_802 (164) = happyGoto action_867 action_802 (165) = happyGoto action_23 action_802 (166) = happyGoto action_24 action_802 (167) = happyGoto action_25 action_802 (210) = happyGoto action_26 action_802 (217) = happyGoto action_27 action_802 (220) = happyGoto action_28 action_802 (241) = happyGoto action_30 action_802 (242) = happyGoto action_31 action_802 (243) = happyGoto action_117 action_802 (249) = happyGoto action_33 action_802 (251) = happyGoto action_34 action_802 (252) = happyGoto action_35 action_802 (255) = happyGoto action_36 action_802 _ = happyFail action_803 (266) = happyShift action_37 action_803 (267) = happyShift action_38 action_803 (268) = happyShift action_39 action_803 (273) = happyShift action_40 action_803 (275) = happyShift action_41 action_803 (276) = happyShift action_42 action_803 (283) = happyShift action_46 action_803 (287) = happyShift action_47 action_803 (291) = happyShift action_48 action_803 (293) = happyShift action_49 action_803 (294) = happyShift action_50 action_803 (295) = happyShift action_51 action_803 (296) = happyShift action_52 action_803 (297) = happyShift action_53 action_803 (298) = happyShift action_54 action_803 (299) = happyShift action_55 action_803 (300) = happyShift action_56 action_803 (301) = happyShift action_57 action_803 (302) = happyShift action_58 action_803 (303) = happyShift action_59 action_803 (304) = happyShift action_60 action_803 (305) = happyShift action_61 action_803 (306) = happyShift action_62 action_803 (307) = happyShift action_63 action_803 (309) = happyShift action_64 action_803 (318) = happyShift action_68 action_803 (319) = happyShift action_69 action_803 (320) = happyShift action_70 action_803 (336) = happyShift action_72 action_803 (342) = happyShift action_73 action_803 (345) = happyShift action_74 action_803 (346) = happyShift action_802 action_803 (357) = happyShift action_75 action_803 (359) = happyShift action_76 action_803 (361) = happyShift action_118 action_803 (363) = happyShift action_78 action_803 (365) = happyShift action_79 action_803 (367) = happyShift action_803 action_803 (370) = happyShift action_80 action_803 (371) = happyShift action_81 action_803 (372) = happyShift action_82 action_803 (375) = happyShift action_83 action_803 (376) = happyShift action_84 action_803 (379) = happyShift action_85 action_803 (380) = happyShift action_86 action_803 (381) = happyShift action_87 action_803 (382) = happyShift action_88 action_803 (383) = happyShift action_89 action_803 (384) = happyShift action_90 action_803 (385) = happyShift action_91 action_803 (386) = happyShift action_92 action_803 (387) = happyShift action_93 action_803 (388) = happyShift action_94 action_803 (389) = happyShift action_95 action_803 (390) = happyShift action_96 action_803 (391) = happyShift action_97 action_803 (396) = happyShift action_98 action_803 (397) = happyShift action_99 action_803 (398) = happyShift action_100 action_803 (399) = happyShift action_101 action_803 (401) = happyShift action_102 action_803 (403) = happyShift action_103 action_803 (404) = happyShift action_104 action_803 (405) = happyShift action_105 action_803 (406) = happyShift action_106 action_803 (407) = happyShift action_107 action_803 (408) = happyShift action_108 action_803 (409) = happyShift action_109 action_803 (38) = happyGoto action_13 action_803 (156) = happyGoto action_16 action_803 (157) = happyGoto action_796 action_803 (158) = happyGoto action_116 action_803 (159) = happyGoto action_18 action_803 (161) = happyGoto action_19 action_803 (162) = happyGoto action_20 action_803 (163) = happyGoto action_21 action_803 (164) = happyGoto action_22 action_803 (165) = happyGoto action_23 action_803 (166) = happyGoto action_24 action_803 (167) = happyGoto action_25 action_803 (186) = happyGoto action_866 action_803 (187) = happyGoto action_798 action_803 (188) = happyGoto action_799 action_803 (195) = happyGoto action_800 action_803 (210) = happyGoto action_26 action_803 (217) = happyGoto action_27 action_803 (220) = happyGoto action_28 action_803 (241) = happyGoto action_30 action_803 (242) = happyGoto action_31 action_803 (243) = happyGoto action_117 action_803 (249) = happyGoto action_33 action_803 (251) = happyGoto action_34 action_803 (252) = happyGoto action_35 action_803 (255) = happyGoto action_36 action_803 _ = happyFail action_804 (354) = happyShift action_865 action_804 _ = happyFail action_805 _ = happyReduce_512 action_806 _ = happyReduce_567 action_807 _ = happyReduce_569 action_808 _ = happyReduce_580 action_809 _ = happyReduce_640 action_810 _ = happyReduce_570 action_811 (384) = happyShift action_864 action_811 _ = happyFail action_812 _ = happyReduce_422 action_813 (267) = happyShift action_38 action_813 (275) = happyShift action_41 action_813 (287) = happyShift action_47 action_813 (291) = happyShift action_260 action_813 (293) = happyShift action_49 action_813 (294) = happyShift action_50 action_813 (295) = happyShift action_51 action_813 (296) = happyShift action_231 action_813 (297) = happyShift action_232 action_813 (298) = happyShift action_233 action_813 (302) = happyShift action_58 action_813 (303) = happyShift action_59 action_813 (304) = happyShift action_60 action_813 (305) = happyShift action_61 action_813 (306) = happyShift action_62 action_813 (309) = happyShift action_64 action_813 (323) = happyShift action_236 action_813 (324) = happyShift action_237 action_813 (346) = happyShift action_238 action_813 (353) = happyShift action_239 action_813 (357) = happyShift action_240 action_813 (359) = happyShift action_241 action_813 (361) = happyShift action_242 action_813 (363) = happyShift action_243 action_813 (370) = happyShift action_244 action_813 (371) = happyShift action_245 action_813 (372) = happyShift action_246 action_813 (376) = happyShift action_247 action_813 (380) = happyShift action_248 action_813 (381) = happyShift action_87 action_813 (383) = happyShift action_249 action_813 (384) = happyShift action_250 action_813 (403) = happyShift action_251 action_813 (404) = happyShift action_252 action_813 (408) = happyShift action_108 action_813 (409) = happyShift action_109 action_813 (107) = happyGoto action_860 action_813 (110) = happyGoto action_863 action_813 (111) = happyGoto action_218 action_813 (112) = happyGoto action_254 action_813 (114) = happyGoto action_255 action_813 (115) = happyGoto action_256 action_813 (117) = happyGoto action_257 action_813 (118) = happyGoto action_221 action_813 (156) = happyGoto action_222 action_813 (210) = happyGoto action_259 action_813 (224) = happyGoto action_223 action_813 (225) = happyGoto action_224 action_813 (227) = happyGoto action_225 action_813 (228) = happyGoto action_226 action_813 (237) = happyGoto action_227 action_813 (239) = happyGoto action_228 action_813 (249) = happyGoto action_229 action_813 _ = happyFail action_814 _ = happyReduce_398 action_815 (358) = happyShift action_862 action_815 _ = happyFail action_816 (267) = happyShift action_38 action_816 (275) = happyShift action_41 action_816 (287) = happyShift action_47 action_816 (291) = happyShift action_260 action_816 (293) = happyShift action_49 action_816 (294) = happyShift action_50 action_816 (295) = happyShift action_51 action_816 (296) = happyShift action_231 action_816 (297) = happyShift action_232 action_816 (298) = happyShift action_233 action_816 (302) = happyShift action_58 action_816 (303) = happyShift action_59 action_816 (304) = happyShift action_60 action_816 (305) = happyShift action_61 action_816 (306) = happyShift action_62 action_816 (309) = happyShift action_64 action_816 (323) = happyShift action_236 action_816 (324) = happyShift action_237 action_816 (346) = happyShift action_238 action_816 (353) = happyShift action_239 action_816 (357) = happyShift action_240 action_816 (359) = happyShift action_241 action_816 (361) = happyShift action_242 action_816 (363) = happyShift action_243 action_816 (370) = happyShift action_244 action_816 (371) = happyShift action_245 action_816 (372) = happyShift action_246 action_816 (376) = happyShift action_247 action_816 (380) = happyShift action_248 action_816 (381) = happyShift action_87 action_816 (383) = happyShift action_249 action_816 (384) = happyShift action_250 action_816 (403) = happyShift action_251 action_816 (404) = happyShift action_252 action_816 (408) = happyShift action_108 action_816 (409) = happyShift action_109 action_816 (107) = happyGoto action_860 action_816 (110) = happyGoto action_861 action_816 (111) = happyGoto action_218 action_816 (112) = happyGoto action_254 action_816 (114) = happyGoto action_255 action_816 (115) = happyGoto action_256 action_816 (117) = happyGoto action_257 action_816 (118) = happyGoto action_221 action_816 (156) = happyGoto action_222 action_816 (210) = happyGoto action_259 action_816 (224) = happyGoto action_223 action_816 (225) = happyGoto action_224 action_816 (227) = happyGoto action_225 action_816 (228) = happyGoto action_226 action_816 (237) = happyGoto action_227 action_816 (239) = happyGoto action_228 action_816 (249) = happyGoto action_229 action_816 _ = happyFail action_817 _ = happyReduce_394 action_818 _ = happyReduce_391 action_819 _ = happyReduce_421 action_820 _ = happyReduce_411 action_821 (266) = happyShift action_37 action_821 (267) = happyShift action_38 action_821 (268) = happyShift action_39 action_821 (273) = happyShift action_40 action_821 (275) = happyShift action_41 action_821 (276) = happyShift action_42 action_821 (283) = happyShift action_46 action_821 (287) = happyShift action_47 action_821 (291) = happyShift action_48 action_821 (293) = happyShift action_49 action_821 (294) = happyShift action_50 action_821 (295) = happyShift action_51 action_821 (296) = happyShift action_52 action_821 (297) = happyShift action_53 action_821 (298) = happyShift action_54 action_821 (299) = happyShift action_55 action_821 (300) = happyShift action_56 action_821 (301) = happyShift action_57 action_821 (302) = happyShift action_58 action_821 (303) = happyShift action_59 action_821 (304) = happyShift action_60 action_821 (305) = happyShift action_61 action_821 (306) = happyShift action_62 action_821 (307) = happyShift action_63 action_821 (309) = happyShift action_64 action_821 (318) = happyShift action_68 action_821 (319) = happyShift action_69 action_821 (320) = happyShift action_70 action_821 (336) = happyShift action_72 action_821 (342) = happyShift action_73 action_821 (345) = happyShift action_74 action_821 (357) = happyShift action_75 action_821 (359) = happyShift action_76 action_821 (361) = happyShift action_118 action_821 (363) = happyShift action_78 action_821 (365) = happyShift action_79 action_821 (370) = happyShift action_80 action_821 (371) = happyShift action_81 action_821 (372) = happyShift action_82 action_821 (375) = happyShift action_83 action_821 (376) = happyShift action_84 action_821 (379) = happyShift action_85 action_821 (380) = happyShift action_86 action_821 (381) = happyShift action_87 action_821 (382) = happyShift action_88 action_821 (383) = happyShift action_89 action_821 (384) = happyShift action_90 action_821 (385) = happyShift action_91 action_821 (386) = happyShift action_92 action_821 (387) = happyShift action_93 action_821 (388) = happyShift action_94 action_821 (389) = happyShift action_95 action_821 (390) = happyShift action_96 action_821 (391) = happyShift action_97 action_821 (396) = happyShift action_98 action_821 (397) = happyShift action_99 action_821 (398) = happyShift action_100 action_821 (399) = happyShift action_101 action_821 (401) = happyShift action_102 action_821 (403) = happyShift action_103 action_821 (404) = happyShift action_104 action_821 (405) = happyShift action_105 action_821 (406) = happyShift action_106 action_821 (407) = happyShift action_107 action_821 (408) = happyShift action_108 action_821 (409) = happyShift action_109 action_821 (38) = happyGoto action_13 action_821 (156) = happyGoto action_16 action_821 (157) = happyGoto action_859 action_821 (158) = happyGoto action_116 action_821 (159) = happyGoto action_18 action_821 (161) = happyGoto action_19 action_821 (162) = happyGoto action_20 action_821 (163) = happyGoto action_21 action_821 (164) = happyGoto action_22 action_821 (165) = happyGoto action_23 action_821 (166) = happyGoto action_24 action_821 (167) = happyGoto action_25 action_821 (210) = happyGoto action_26 action_821 (217) = happyGoto action_27 action_821 (220) = happyGoto action_28 action_821 (241) = happyGoto action_30 action_821 (242) = happyGoto action_31 action_821 (243) = happyGoto action_117 action_821 (249) = happyGoto action_33 action_821 (251) = happyGoto action_34 action_821 (252) = happyGoto action_35 action_821 (255) = happyGoto action_36 action_821 _ = happyFail action_822 _ = happyReduce_525 action_823 (266) = happyShift action_37 action_823 (267) = happyShift action_38 action_823 (268) = happyShift action_39 action_823 (273) = happyShift action_40 action_823 (275) = happyShift action_41 action_823 (276) = happyShift action_42 action_823 (283) = happyShift action_164 action_823 (287) = happyShift action_47 action_823 (291) = happyShift action_48 action_823 (293) = happyShift action_49 action_823 (294) = happyShift action_50 action_823 (295) = happyShift action_51 action_823 (296) = happyShift action_52 action_823 (297) = happyShift action_53 action_823 (298) = happyShift action_54 action_823 (299) = happyShift action_55 action_823 (300) = happyShift action_56 action_823 (301) = happyShift action_57 action_823 (302) = happyShift action_58 action_823 (303) = happyShift action_59 action_823 (304) = happyShift action_60 action_823 (305) = happyShift action_61 action_823 (306) = happyShift action_62 action_823 (307) = happyShift action_63 action_823 (309) = happyShift action_64 action_823 (318) = happyShift action_68 action_823 (319) = happyShift action_69 action_823 (320) = happyShift action_70 action_823 (336) = happyShift action_72 action_823 (342) = happyShift action_73 action_823 (345) = happyShift action_74 action_823 (346) = happyShift action_166 action_823 (357) = happyShift action_75 action_823 (359) = happyShift action_76 action_823 (361) = happyShift action_118 action_823 (363) = happyShift action_78 action_823 (365) = happyShift action_79 action_823 (370) = happyShift action_80 action_823 (371) = happyShift action_81 action_823 (372) = happyShift action_82 action_823 (375) = happyShift action_83 action_823 (376) = happyShift action_84 action_823 (379) = happyShift action_85 action_823 (380) = happyShift action_86 action_823 (381) = happyShift action_87 action_823 (382) = happyShift action_88 action_823 (383) = happyShift action_89 action_823 (384) = happyShift action_90 action_823 (385) = happyShift action_91 action_823 (386) = happyShift action_92 action_823 (387) = happyShift action_93 action_823 (388) = happyShift action_94 action_823 (389) = happyShift action_95 action_823 (390) = happyShift action_96 action_823 (391) = happyShift action_97 action_823 (396) = happyShift action_98 action_823 (397) = happyShift action_99 action_823 (398) = happyShift action_100 action_823 (399) = happyShift action_101 action_823 (401) = happyShift action_102 action_823 (403) = happyShift action_103 action_823 (404) = happyShift action_104 action_823 (405) = happyShift action_105 action_823 (406) = happyShift action_106 action_823 (407) = happyShift action_107 action_823 (408) = happyShift action_108 action_823 (409) = happyShift action_109 action_823 (38) = happyGoto action_13 action_823 (156) = happyGoto action_16 action_823 (157) = happyGoto action_160 action_823 (158) = happyGoto action_116 action_823 (159) = happyGoto action_18 action_823 (161) = happyGoto action_19 action_823 (162) = happyGoto action_20 action_823 (163) = happyGoto action_21 action_823 (164) = happyGoto action_22 action_823 (165) = happyGoto action_23 action_823 (166) = happyGoto action_24 action_823 (167) = happyGoto action_25 action_823 (196) = happyGoto action_161 action_823 (204) = happyGoto action_858 action_823 (210) = happyGoto action_26 action_823 (217) = happyGoto action_27 action_823 (220) = happyGoto action_28 action_823 (241) = happyGoto action_30 action_823 (242) = happyGoto action_31 action_823 (243) = happyGoto action_117 action_823 (249) = happyGoto action_33 action_823 (251) = happyGoto action_34 action_823 (252) = happyGoto action_35 action_823 (255) = happyGoto action_36 action_823 _ = happyFail action_824 (266) = happyShift action_37 action_824 (267) = happyShift action_38 action_824 (268) = happyShift action_39 action_824 (273) = happyShift action_40 action_824 (275) = happyShift action_41 action_824 (276) = happyShift action_42 action_824 (283) = happyShift action_46 action_824 (287) = happyShift action_47 action_824 (291) = happyShift action_48 action_824 (293) = happyShift action_49 action_824 (294) = happyShift action_50 action_824 (295) = happyShift action_51 action_824 (296) = happyShift action_52 action_824 (297) = happyShift action_53 action_824 (298) = happyShift action_54 action_824 (299) = happyShift action_55 action_824 (300) = happyShift action_56 action_824 (301) = happyShift action_57 action_824 (302) = happyShift action_58 action_824 (303) = happyShift action_59 action_824 (304) = happyShift action_60 action_824 (305) = happyShift action_61 action_824 (306) = happyShift action_62 action_824 (307) = happyShift action_63 action_824 (309) = happyShift action_64 action_824 (318) = happyShift action_68 action_824 (319) = happyShift action_69 action_824 (320) = happyShift action_70 action_824 (336) = happyShift action_72 action_824 (342) = happyShift action_73 action_824 (345) = happyShift action_74 action_824 (357) = happyShift action_75 action_824 (359) = happyShift action_76 action_824 (361) = happyShift action_118 action_824 (363) = happyShift action_78 action_824 (365) = happyShift action_79 action_824 (370) = happyShift action_80 action_824 (371) = happyShift action_81 action_824 (372) = happyShift action_82 action_824 (375) = happyShift action_83 action_824 (376) = happyShift action_84 action_824 (379) = happyShift action_85 action_824 (380) = happyShift action_86 action_824 (381) = happyShift action_87 action_824 (382) = happyShift action_88 action_824 (383) = happyShift action_89 action_824 (384) = happyShift action_90 action_824 (385) = happyShift action_91 action_824 (386) = happyShift action_92 action_824 (387) = happyShift action_93 action_824 (388) = happyShift action_94 action_824 (389) = happyShift action_95 action_824 (390) = happyShift action_96 action_824 (391) = happyShift action_97 action_824 (396) = happyShift action_98 action_824 (397) = happyShift action_99 action_824 (398) = happyShift action_100 action_824 (399) = happyShift action_101 action_824 (401) = happyShift action_102 action_824 (403) = happyShift action_103 action_824 (404) = happyShift action_104 action_824 (405) = happyShift action_105 action_824 (406) = happyShift action_106 action_824 (407) = happyShift action_107 action_824 (408) = happyShift action_108 action_824 (409) = happyShift action_109 action_824 (38) = happyGoto action_13 action_824 (156) = happyGoto action_16 action_824 (157) = happyGoto action_857 action_824 (158) = happyGoto action_116 action_824 (159) = happyGoto action_18 action_824 (161) = happyGoto action_19 action_824 (162) = happyGoto action_20 action_824 (163) = happyGoto action_21 action_824 (164) = happyGoto action_22 action_824 (165) = happyGoto action_23 action_824 (166) = happyGoto action_24 action_824 (167) = happyGoto action_25 action_824 (210) = happyGoto action_26 action_824 (217) = happyGoto action_27 action_824 (220) = happyGoto action_28 action_824 (241) = happyGoto action_30 action_824 (242) = happyGoto action_31 action_824 (243) = happyGoto action_117 action_824 (249) = happyGoto action_33 action_824 (251) = happyGoto action_34 action_824 (252) = happyGoto action_35 action_824 (255) = happyGoto action_36 action_824 _ = happyFail action_825 _ = happyReduce_527 action_826 _ = happyReduce_415 action_827 (267) = happyShift action_38 action_827 (275) = happyShift action_41 action_827 (287) = happyShift action_47 action_827 (291) = happyShift action_405 action_827 (293) = happyShift action_49 action_827 (294) = happyShift action_50 action_827 (295) = happyShift action_51 action_827 (296) = happyShift action_231 action_827 (297) = happyShift action_232 action_827 (298) = happyShift action_233 action_827 (302) = happyShift action_58 action_827 (303) = happyShift action_59 action_827 (304) = happyShift action_60 action_827 (305) = happyShift action_61 action_827 (306) = happyShift action_62 action_827 (309) = happyShift action_64 action_827 (323) = happyShift action_236 action_827 (324) = happyShift action_237 action_827 (346) = happyShift action_238 action_827 (353) = happyShift action_239 action_827 (357) = happyShift action_240 action_827 (359) = happyShift action_241 action_827 (361) = happyShift action_242 action_827 (363) = happyShift action_243 action_827 (370) = happyShift action_244 action_827 (371) = happyShift action_245 action_827 (372) = happyShift action_246 action_827 (376) = happyShift action_247 action_827 (380) = happyShift action_248 action_827 (381) = happyShift action_87 action_827 (383) = happyShift action_249 action_827 (384) = happyShift action_250 action_827 (403) = happyShift action_251 action_827 (404) = happyShift action_252 action_827 (408) = happyShift action_108 action_827 (409) = happyShift action_109 action_827 (108) = happyGoto action_856 action_827 (111) = happyGoto action_218 action_827 (113) = happyGoto action_400 action_827 (114) = happyGoto action_401 action_827 (116) = happyGoto action_402 action_827 (117) = happyGoto action_403 action_827 (118) = happyGoto action_221 action_827 (156) = happyGoto action_222 action_827 (210) = happyGoto action_404 action_827 (224) = happyGoto action_223 action_827 (225) = happyGoto action_224 action_827 (227) = happyGoto action_225 action_827 (228) = happyGoto action_226 action_827 (237) = happyGoto action_227 action_827 (239) = happyGoto action_228 action_827 (249) = happyGoto action_229 action_827 _ = happyFail action_828 (267) = happyShift action_38 action_828 (275) = happyShift action_41 action_828 (287) = happyShift action_47 action_828 (291) = happyShift action_48 action_828 (293) = happyShift action_49 action_828 (294) = happyShift action_50 action_828 (295) = happyShift action_51 action_828 (296) = happyShift action_52 action_828 (297) = happyShift action_53 action_828 (298) = happyShift action_54 action_828 (300) = happyShift action_56 action_828 (301) = happyShift action_57 action_828 (302) = happyShift action_58 action_828 (303) = happyShift action_59 action_828 (304) = happyShift action_60 action_828 (305) = happyShift action_61 action_828 (306) = happyShift action_62 action_828 (309) = happyShift action_64 action_828 (361) = happyShift action_413 action_828 (371) = happyShift action_81 action_828 (240) = happyGoto action_855 action_828 (243) = happyGoto action_195 action_828 (249) = happyGoto action_33 action_828 _ = happyFail action_829 (266) = happyShift action_37 action_829 (267) = happyShift action_38 action_829 (268) = happyShift action_39 action_829 (273) = happyShift action_40 action_829 (275) = happyShift action_41 action_829 (276) = happyShift action_42 action_829 (283) = happyShift action_46 action_829 (287) = happyShift action_47 action_829 (291) = happyShift action_48 action_829 (293) = happyShift action_49 action_829 (294) = happyShift action_50 action_829 (295) = happyShift action_51 action_829 (296) = happyShift action_52 action_829 (297) = happyShift action_53 action_829 (298) = happyShift action_54 action_829 (299) = happyShift action_55 action_829 (300) = happyShift action_56 action_829 (301) = happyShift action_57 action_829 (302) = happyShift action_58 action_829 (303) = happyShift action_59 action_829 (304) = happyShift action_60 action_829 (305) = happyShift action_61 action_829 (306) = happyShift action_62 action_829 (307) = happyShift action_63 action_829 (309) = happyShift action_64 action_829 (318) = happyShift action_68 action_829 (319) = happyShift action_69 action_829 (320) = happyShift action_70 action_829 (333) = happyShift action_278 action_829 (336) = happyShift action_72 action_829 (342) = happyShift action_73 action_829 (345) = happyShift action_74 action_829 (346) = happyShift action_281 action_829 (347) = happyShift action_282 action_829 (352) = happyShift action_283 action_829 (357) = happyShift action_75 action_829 (359) = happyShift action_76 action_829 (361) = happyShift action_118 action_829 (363) = happyShift action_78 action_829 (365) = happyShift action_79 action_829 (369) = happyShift action_308 action_829 (370) = happyShift action_80 action_829 (371) = happyShift action_81 action_829 (372) = happyShift action_82 action_829 (373) = happyShift action_285 action_829 (374) = happyShift action_286 action_829 (375) = happyShift action_83 action_829 (376) = happyShift action_84 action_829 (377) = happyShift action_287 action_829 (378) = happyShift action_288 action_829 (379) = happyShift action_85 action_829 (380) = happyShift action_86 action_829 (381) = happyShift action_87 action_829 (382) = happyShift action_88 action_829 (383) = happyShift action_89 action_829 (384) = happyShift action_90 action_829 (385) = happyShift action_91 action_829 (386) = happyShift action_92 action_829 (387) = happyShift action_93 action_829 (388) = happyShift action_94 action_829 (389) = happyShift action_95 action_829 (390) = happyShift action_96 action_829 (391) = happyShift action_97 action_829 (396) = happyShift action_98 action_829 (397) = happyShift action_99 action_829 (398) = happyShift action_100 action_829 (399) = happyShift action_101 action_829 (401) = happyShift action_102 action_829 (403) = happyShift action_103 action_829 (404) = happyShift action_104 action_829 (405) = happyShift action_105 action_829 (406) = happyShift action_106 action_829 (407) = happyShift action_107 action_829 (408) = happyShift action_108 action_829 (409) = happyShift action_109 action_829 (38) = happyGoto action_13 action_829 (156) = happyGoto action_16 action_829 (157) = happyGoto action_292 action_829 (158) = happyGoto action_293 action_829 (159) = happyGoto action_18 action_829 (161) = happyGoto action_19 action_829 (162) = happyGoto action_20 action_829 (163) = happyGoto action_21 action_829 (164) = happyGoto action_22 action_829 (165) = happyGoto action_23 action_829 (166) = happyGoto action_24 action_829 (167) = happyGoto action_25 action_829 (172) = happyGoto action_854 action_829 (210) = happyGoto action_26 action_829 (217) = happyGoto action_27 action_829 (220) = happyGoto action_28 action_829 (222) = happyGoto action_296 action_829 (234) = happyGoto action_297 action_829 (236) = happyGoto action_298 action_829 (241) = happyGoto action_30 action_829 (242) = happyGoto action_31 action_829 (243) = happyGoto action_117 action_829 (245) = happyGoto action_299 action_829 (246) = happyGoto action_338 action_829 (248) = happyGoto action_339 action_829 (249) = happyGoto action_33 action_829 (250) = happyGoto action_275 action_829 (251) = happyGoto action_34 action_829 (252) = happyGoto action_35 action_829 (253) = happyGoto action_276 action_829 (254) = happyGoto action_277 action_829 (255) = happyGoto action_36 action_829 _ = happyFail action_830 (267) = happyShift action_38 action_830 (275) = happyShift action_41 action_830 (287) = happyShift action_47 action_830 (291) = happyShift action_48 action_830 (293) = happyShift action_49 action_830 (294) = happyShift action_50 action_830 (295) = happyShift action_51 action_830 (296) = happyShift action_52 action_830 (297) = happyShift action_53 action_830 (298) = happyShift action_54 action_830 (300) = happyShift action_56 action_830 (301) = happyShift action_57 action_830 (302) = happyShift action_58 action_830 (303) = happyShift action_59 action_830 (304) = happyShift action_60 action_830 (305) = happyShift action_61 action_830 (306) = happyShift action_62 action_830 (309) = happyShift action_64 action_830 (332) = happyShift action_410 action_830 (361) = happyShift action_186 action_830 (371) = happyShift action_81 action_830 (375) = happyShift action_83 action_830 (379) = happyShift action_85 action_830 (206) = happyGoto action_853 action_830 (207) = happyGoto action_408 action_830 (241) = happyGoto action_409 action_830 (242) = happyGoto action_31 action_830 (243) = happyGoto action_117 action_830 (249) = happyGoto action_33 action_830 _ = happyFail action_831 _ = happyReduce_434 action_832 (352) = happyShift action_852 action_832 _ = happyFail action_833 (267) = happyShift action_38 action_833 (275) = happyShift action_41 action_833 (287) = happyShift action_47 action_833 (293) = happyShift action_49 action_833 (294) = happyShift action_50 action_833 (295) = happyShift action_51 action_833 (296) = happyShift action_231 action_833 (297) = happyShift action_232 action_833 (298) = happyShift action_233 action_833 (302) = happyShift action_58 action_833 (303) = happyShift action_59 action_833 (304) = happyShift action_60 action_833 (305) = happyShift action_61 action_833 (306) = happyShift action_62 action_833 (309) = happyShift action_64 action_833 (323) = happyShift action_236 action_833 (324) = happyShift action_237 action_833 (346) = happyShift action_238 action_833 (353) = happyShift action_239 action_833 (357) = happyShift action_240 action_833 (359) = happyShift action_241 action_833 (361) = happyShift action_242 action_833 (363) = happyShift action_243 action_833 (370) = happyShift action_244 action_833 (371) = happyShift action_245 action_833 (372) = happyShift action_246 action_833 (376) = happyShift action_247 action_833 (380) = happyShift action_248 action_833 (383) = happyShift action_249 action_833 (384) = happyShift action_250 action_833 (403) = happyShift action_251 action_833 (404) = happyShift action_252 action_833 (408) = happyShift action_108 action_833 (409) = happyShift action_109 action_833 (111) = happyGoto action_218 action_833 (115) = happyGoto action_851 action_833 (117) = happyGoto action_220 action_833 (118) = happyGoto action_221 action_833 (156) = happyGoto action_222 action_833 (224) = happyGoto action_223 action_833 (225) = happyGoto action_224 action_833 (227) = happyGoto action_225 action_833 (228) = happyGoto action_226 action_833 (237) = happyGoto action_227 action_833 (239) = happyGoto action_228 action_833 (249) = happyGoto action_229 action_833 _ = happyFail action_834 (267) = happyShift action_38 action_834 (275) = happyShift action_41 action_834 (287) = happyShift action_47 action_834 (293) = happyShift action_49 action_834 (294) = happyShift action_50 action_834 (295) = happyShift action_51 action_834 (296) = happyShift action_231 action_834 (297) = happyShift action_232 action_834 (298) = happyShift action_233 action_834 (302) = happyShift action_58 action_834 (303) = happyShift action_59 action_834 (304) = happyShift action_60 action_834 (305) = happyShift action_61 action_834 (306) = happyShift action_62 action_834 (309) = happyShift action_64 action_834 (323) = happyShift action_236 action_834 (324) = happyShift action_237 action_834 (346) = happyShift action_238 action_834 (353) = happyShift action_239 action_834 (357) = happyShift action_240 action_834 (359) = happyShift action_241 action_834 (361) = happyShift action_242 action_834 (363) = happyShift action_243 action_834 (370) = happyShift action_244 action_834 (371) = happyShift action_245 action_834 (372) = happyShift action_246 action_834 (376) = happyShift action_247 action_834 (380) = happyShift action_248 action_834 (383) = happyShift action_249 action_834 (384) = happyShift action_250 action_834 (403) = happyShift action_251 action_834 (404) = happyShift action_252 action_834 (408) = happyShift action_108 action_834 (409) = happyShift action_109 action_834 (111) = happyGoto action_218 action_834 (115) = happyGoto action_850 action_834 (117) = happyGoto action_220 action_834 (118) = happyGoto action_221 action_834 (156) = happyGoto action_222 action_834 (224) = happyGoto action_223 action_834 (225) = happyGoto action_224 action_834 (227) = happyGoto action_225 action_834 (228) = happyGoto action_226 action_834 (237) = happyGoto action_227 action_834 (239) = happyGoto action_228 action_834 (249) = happyGoto action_229 action_834 _ = happyFail action_835 (267) = happyShift action_38 action_835 (275) = happyShift action_41 action_835 (287) = happyShift action_47 action_835 (293) = happyShift action_49 action_835 (294) = happyShift action_50 action_835 (295) = happyShift action_51 action_835 (296) = happyShift action_231 action_835 (297) = happyShift action_232 action_835 (298) = happyShift action_233 action_835 (302) = happyShift action_58 action_835 (303) = happyShift action_59 action_835 (304) = happyShift action_60 action_835 (305) = happyShift action_61 action_835 (306) = happyShift action_62 action_835 (309) = happyShift action_64 action_835 (323) = happyShift action_236 action_835 (324) = happyShift action_237 action_835 (346) = happyShift action_238 action_835 (353) = happyShift action_239 action_835 (357) = happyShift action_240 action_835 (359) = happyShift action_241 action_835 (361) = happyShift action_242 action_835 (363) = happyShift action_243 action_835 (370) = happyShift action_244 action_835 (371) = happyShift action_245 action_835 (372) = happyShift action_246 action_835 (376) = happyShift action_247 action_835 (380) = happyShift action_248 action_835 (383) = happyShift action_249 action_835 (384) = happyShift action_250 action_835 (403) = happyShift action_251 action_835 (404) = happyShift action_252 action_835 (408) = happyShift action_108 action_835 (409) = happyShift action_109 action_835 (111) = happyGoto action_218 action_835 (115) = happyGoto action_849 action_835 (117) = happyGoto action_220 action_835 (118) = happyGoto action_221 action_835 (156) = happyGoto action_222 action_835 (224) = happyGoto action_223 action_835 (225) = happyGoto action_224 action_835 (227) = happyGoto action_225 action_835 (228) = happyGoto action_226 action_835 (237) = happyGoto action_227 action_835 (239) = happyGoto action_228 action_835 (249) = happyGoto action_229 action_835 _ = happyFail action_836 (267) = happyShift action_38 action_836 (275) = happyShift action_41 action_836 (287) = happyShift action_47 action_836 (291) = happyShift action_405 action_836 (293) = happyShift action_49 action_836 (294) = happyShift action_50 action_836 (295) = happyShift action_51 action_836 (296) = happyShift action_231 action_836 (297) = happyShift action_232 action_836 (298) = happyShift action_233 action_836 (302) = happyShift action_58 action_836 (303) = happyShift action_59 action_836 (304) = happyShift action_60 action_836 (305) = happyShift action_61 action_836 (306) = happyShift action_62 action_836 (309) = happyShift action_64 action_836 (323) = happyShift action_236 action_836 (324) = happyShift action_237 action_836 (346) = happyShift action_238 action_836 (353) = happyShift action_239 action_836 (357) = happyShift action_240 action_836 (359) = happyShift action_241 action_836 (361) = happyShift action_242 action_836 (363) = happyShift action_243 action_836 (370) = happyShift action_244 action_836 (371) = happyShift action_245 action_836 (372) = happyShift action_246 action_836 (376) = happyShift action_247 action_836 (380) = happyShift action_248 action_836 (381) = happyShift action_87 action_836 (383) = happyShift action_249 action_836 (384) = happyShift action_250 action_836 (403) = happyShift action_251 action_836 (404) = happyShift action_252 action_836 (408) = happyShift action_108 action_836 (409) = happyShift action_109 action_836 (111) = happyGoto action_218 action_836 (113) = happyGoto action_848 action_836 (114) = happyGoto action_401 action_836 (116) = happyGoto action_402 action_836 (117) = happyGoto action_403 action_836 (118) = happyGoto action_221 action_836 (156) = happyGoto action_222 action_836 (210) = happyGoto action_404 action_836 (224) = happyGoto action_223 action_836 (225) = happyGoto action_224 action_836 (227) = happyGoto action_225 action_836 (228) = happyGoto action_226 action_836 (237) = happyGoto action_227 action_836 (239) = happyGoto action_228 action_836 (249) = happyGoto action_229 action_836 _ = happyFail action_837 (267) = happyShift action_38 action_837 (275) = happyShift action_41 action_837 (287) = happyShift action_47 action_837 (293) = happyShift action_49 action_837 (294) = happyShift action_50 action_837 (295) = happyShift action_51 action_837 (296) = happyShift action_231 action_837 (297) = happyShift action_232 action_837 (298) = happyShift action_233 action_837 (302) = happyShift action_58 action_837 (303) = happyShift action_59 action_837 (304) = happyShift action_60 action_837 (305) = happyShift action_61 action_837 (306) = happyShift action_62 action_837 (309) = happyShift action_64 action_837 (323) = happyShift action_236 action_837 (324) = happyShift action_237 action_837 (346) = happyShift action_238 action_837 (353) = happyShift action_239 action_837 (357) = happyShift action_240 action_837 (359) = happyShift action_241 action_837 (361) = happyShift action_242 action_837 (363) = happyShift action_243 action_837 (370) = happyShift action_244 action_837 (371) = happyShift action_245 action_837 (372) = happyShift action_246 action_837 (376) = happyShift action_247 action_837 (380) = happyShift action_248 action_837 (383) = happyShift action_249 action_837 (384) = happyShift action_250 action_837 (403) = happyShift action_251 action_837 (404) = happyShift action_252 action_837 (408) = happyShift action_108 action_837 (409) = happyShift action_109 action_837 (111) = happyGoto action_218 action_837 (117) = happyGoto action_847 action_837 (118) = happyGoto action_221 action_837 (156) = happyGoto action_222 action_837 (224) = happyGoto action_223 action_837 (225) = happyGoto action_224 action_837 (227) = happyGoto action_225 action_837 (228) = happyGoto action_226 action_837 (237) = happyGoto action_227 action_837 (239) = happyGoto action_228 action_837 (249) = happyGoto action_229 action_837 _ = happyFail action_838 (267) = happyShift action_38 action_838 (275) = happyShift action_41 action_838 (287) = happyShift action_47 action_838 (291) = happyShift action_48 action_838 (293) = happyShift action_49 action_838 (294) = happyShift action_50 action_838 (295) = happyShift action_51 action_838 (296) = happyShift action_52 action_838 (297) = happyShift action_53 action_838 (298) = happyShift action_54 action_838 (300) = happyShift action_56 action_838 (301) = happyShift action_57 action_838 (302) = happyShift action_58 action_838 (303) = happyShift action_59 action_838 (304) = happyShift action_60 action_838 (305) = happyShift action_61 action_838 (306) = happyShift action_62 action_838 (309) = happyShift action_64 action_838 (333) = happyShift action_278 action_838 (345) = happyShift action_280 action_838 (346) = happyShift action_281 action_838 (347) = happyShift action_282 action_838 (352) = happyShift action_283 action_838 (357) = happyShift action_564 action_838 (361) = happyShift action_565 action_838 (363) = happyShift action_201 action_838 (369) = happyShift action_716 action_838 (371) = happyShift action_81 action_838 (372) = happyShift action_82 action_838 (373) = happyShift action_285 action_838 (374) = happyShift action_286 action_838 (376) = happyShift action_84 action_838 (378) = happyShift action_288 action_838 (380) = happyShift action_86 action_838 (217) = happyGoto action_562 action_838 (220) = happyGoto action_28 action_838 (222) = happyGoto action_845 action_838 (232) = happyGoto action_846 action_838 (240) = happyGoto action_563 action_838 (243) = happyGoto action_195 action_838 (247) = happyGoto action_396 action_838 (248) = happyGoto action_274 action_838 (249) = happyGoto action_33 action_838 (250) = happyGoto action_275 action_838 (251) = happyGoto action_34 action_838 (252) = happyGoto action_35 action_838 (253) = happyGoto action_276 action_838 (254) = happyGoto action_277 action_838 _ = happyFail action_839 (267) = happyShift action_38 action_839 (275) = happyShift action_41 action_839 (287) = happyShift action_47 action_839 (291) = happyShift action_405 action_839 (293) = happyShift action_49 action_839 (294) = happyShift action_50 action_839 (295) = happyShift action_51 action_839 (296) = happyShift action_231 action_839 (297) = happyShift action_232 action_839 (298) = happyShift action_233 action_839 (302) = happyShift action_58 action_839 (303) = happyShift action_59 action_839 (304) = happyShift action_60 action_839 (305) = happyShift action_61 action_839 (306) = happyShift action_62 action_839 (309) = happyShift action_64 action_839 (323) = happyShift action_236 action_839 (324) = happyShift action_237 action_839 (346) = happyShift action_238 action_839 (353) = happyShift action_239 action_839 (357) = happyShift action_240 action_839 (359) = happyShift action_241 action_839 (361) = happyShift action_242 action_839 (363) = happyShift action_243 action_839 (370) = happyShift action_244 action_839 (371) = happyShift action_245 action_839 (372) = happyShift action_246 action_839 (376) = happyShift action_247 action_839 (380) = happyShift action_248 action_839 (381) = happyShift action_87 action_839 (383) = happyShift action_249 action_839 (384) = happyShift action_250 action_839 (403) = happyShift action_251 action_839 (404) = happyShift action_252 action_839 (408) = happyShift action_108 action_839 (409) = happyShift action_109 action_839 (111) = happyGoto action_218 action_839 (113) = happyGoto action_844 action_839 (114) = happyGoto action_401 action_839 (116) = happyGoto action_402 action_839 (117) = happyGoto action_403 action_839 (118) = happyGoto action_221 action_839 (156) = happyGoto action_222 action_839 (210) = happyGoto action_404 action_839 (224) = happyGoto action_223 action_839 (225) = happyGoto action_224 action_839 (227) = happyGoto action_225 action_839 (228) = happyGoto action_226 action_839 (237) = happyGoto action_227 action_839 (239) = happyGoto action_228 action_839 (249) = happyGoto action_229 action_839 _ = happyFail action_840 (369) = happyShift action_843 action_840 _ = happyFail action_841 (333) = happyShift action_278 action_841 (345) = happyShift action_280 action_841 (346) = happyShift action_281 action_841 (347) = happyShift action_282 action_841 (352) = happyShift action_283 action_841 (369) = happyShift action_398 action_841 (373) = happyShift action_285 action_841 (374) = happyShift action_286 action_841 (221) = happyGoto action_393 action_841 (231) = happyGoto action_842 action_841 (232) = happyGoto action_395 action_841 (247) = happyGoto action_396 action_841 (248) = happyGoto action_274 action_841 (250) = happyGoto action_275 action_841 (254) = happyGoto action_397 action_841 _ = happyFail action_842 _ = happyReduce_90 action_843 _ = happyReduce_622 action_844 _ = happyReduce_266 action_845 (267) = happyShift action_38 action_845 (275) = happyShift action_41 action_845 (287) = happyShift action_47 action_845 (293) = happyShift action_49 action_845 (294) = happyShift action_50 action_845 (295) = happyShift action_51 action_845 (296) = happyShift action_231 action_845 (297) = happyShift action_232 action_845 (298) = happyShift action_233 action_845 (302) = happyShift action_58 action_845 (303) = happyShift action_59 action_845 (304) = happyShift action_60 action_845 (305) = happyShift action_61 action_845 (306) = happyShift action_62 action_845 (309) = happyShift action_64 action_845 (323) = happyShift action_236 action_845 (324) = happyShift action_237 action_845 (346) = happyShift action_238 action_845 (353) = happyShift action_239 action_845 (357) = happyShift action_240 action_845 (359) = happyShift action_241 action_845 (361) = happyShift action_242 action_845 (363) = happyShift action_243 action_845 (370) = happyShift action_244 action_845 (371) = happyShift action_245 action_845 (372) = happyShift action_246 action_845 (376) = happyShift action_247 action_845 (380) = happyShift action_248 action_845 (383) = happyShift action_249 action_845 (384) = happyShift action_250 action_845 (403) = happyShift action_251 action_845 (404) = happyShift action_252 action_845 (408) = happyShift action_108 action_845 (409) = happyShift action_109 action_845 (111) = happyGoto action_218 action_845 (115) = happyGoto action_1063 action_845 (117) = happyGoto action_220 action_845 (118) = happyGoto action_221 action_845 (156) = happyGoto action_222 action_845 (224) = happyGoto action_223 action_845 (225) = happyGoto action_224 action_845 (227) = happyGoto action_225 action_845 (228) = happyGoto action_226 action_845 (237) = happyGoto action_227 action_845 (239) = happyGoto action_228 action_845 (249) = happyGoto action_229 action_845 _ = happyFail action_846 (267) = happyShift action_38 action_846 (275) = happyShift action_41 action_846 (287) = happyShift action_47 action_846 (293) = happyShift action_49 action_846 (294) = happyShift action_50 action_846 (295) = happyShift action_51 action_846 (296) = happyShift action_231 action_846 (297) = happyShift action_232 action_846 (298) = happyShift action_233 action_846 (302) = happyShift action_58 action_846 (303) = happyShift action_59 action_846 (304) = happyShift action_60 action_846 (305) = happyShift action_61 action_846 (306) = happyShift action_62 action_846 (309) = happyShift action_64 action_846 (323) = happyShift action_236 action_846 (324) = happyShift action_237 action_846 (346) = happyShift action_238 action_846 (353) = happyShift action_239 action_846 (357) = happyShift action_240 action_846 (359) = happyShift action_241 action_846 (361) = happyShift action_242 action_846 (363) = happyShift action_243 action_846 (370) = happyShift action_244 action_846 (371) = happyShift action_245 action_846 (372) = happyShift action_246 action_846 (376) = happyShift action_247 action_846 (380) = happyShift action_248 action_846 (383) = happyShift action_249 action_846 (384) = happyShift action_250 action_846 (403) = happyShift action_251 action_846 (404) = happyShift action_252 action_846 (408) = happyShift action_108 action_846 (409) = happyShift action_109 action_846 (111) = happyGoto action_218 action_846 (115) = happyGoto action_1062 action_846 (117) = happyGoto action_220 action_846 (118) = happyGoto action_221 action_846 (156) = happyGoto action_222 action_846 (224) = happyGoto action_223 action_846 (225) = happyGoto action_224 action_846 (227) = happyGoto action_225 action_846 (228) = happyGoto action_226 action_846 (237) = happyGoto action_227 action_846 (239) = happyGoto action_228 action_846 (249) = happyGoto action_229 action_846 _ = happyFail action_847 (267) = happyShift action_38 action_847 (275) = happyShift action_41 action_847 (287) = happyShift action_47 action_847 (293) = happyShift action_49 action_847 (294) = happyShift action_50 action_847 (295) = happyShift action_51 action_847 (296) = happyShift action_231 action_847 (297) = happyShift action_232 action_847 (298) = happyShift action_233 action_847 (302) = happyShift action_58 action_847 (303) = happyShift action_59 action_847 (304) = happyShift action_60 action_847 (305) = happyShift action_61 action_847 (306) = happyShift action_62 action_847 (309) = happyShift action_64 action_847 (323) = happyShift action_236 action_847 (324) = happyShift action_237 action_847 (344) = happyReduce_269 action_847 (346) = happyShift action_238 action_847 (353) = happyShift action_239 action_847 (357) = happyShift action_240 action_847 (359) = happyShift action_241 action_847 (361) = happyShift action_242 action_847 (363) = happyShift action_243 action_847 (370) = happyShift action_244 action_847 (371) = happyShift action_245 action_847 (372) = happyShift action_246 action_847 (376) = happyShift action_247 action_847 (380) = happyShift action_248 action_847 (383) = happyShift action_249 action_847 (384) = happyShift action_250 action_847 (403) = happyShift action_251 action_847 (404) = happyShift action_252 action_847 (408) = happyShift action_108 action_847 (409) = happyShift action_109 action_847 (111) = happyGoto action_218 action_847 (118) = happyGoto action_551 action_847 (156) = happyGoto action_222 action_847 (224) = happyGoto action_223 action_847 (225) = happyGoto action_224 action_847 (227) = happyGoto action_225 action_847 (228) = happyGoto action_226 action_847 (237) = happyGoto action_227 action_847 (239) = happyGoto action_228 action_847 (249) = happyGoto action_229 action_847 _ = happyReduce_286 action_848 _ = happyReduce_284 action_849 (393) = happyShift action_155 action_849 (260) = happyGoto action_1018 action_849 _ = happyReduce_282 action_850 (393) = happyShift action_155 action_850 (260) = happyGoto action_1017 action_850 _ = happyReduce_280 action_851 _ = happyReduce_267 action_852 (267) = happyShift action_38 action_852 (275) = happyShift action_41 action_852 (287) = happyShift action_47 action_852 (291) = happyShift action_405 action_852 (293) = happyShift action_49 action_852 (294) = happyShift action_50 action_852 (295) = happyShift action_51 action_852 (296) = happyShift action_231 action_852 (297) = happyShift action_232 action_852 (298) = happyShift action_233 action_852 (302) = happyShift action_58 action_852 (303) = happyShift action_59 action_852 (304) = happyShift action_60 action_852 (305) = happyShift action_61 action_852 (306) = happyShift action_62 action_852 (309) = happyShift action_64 action_852 (323) = happyShift action_236 action_852 (324) = happyShift action_237 action_852 (346) = happyShift action_238 action_852 (353) = happyShift action_239 action_852 (357) = happyShift action_240 action_852 (359) = happyShift action_241 action_852 (361) = happyShift action_242 action_852 (363) = happyShift action_243 action_852 (370) = happyShift action_244 action_852 (371) = happyShift action_245 action_852 (372) = happyShift action_246 action_852 (376) = happyShift action_247 action_852 (380) = happyShift action_248 action_852 (381) = happyShift action_87 action_852 (383) = happyShift action_249 action_852 (384) = happyShift action_250 action_852 (403) = happyShift action_251 action_852 (404) = happyShift action_252 action_852 (408) = happyShift action_108 action_852 (409) = happyShift action_109 action_852 (111) = happyGoto action_218 action_852 (113) = happyGoto action_1016 action_852 (114) = happyGoto action_401 action_852 (116) = happyGoto action_402 action_852 (117) = happyGoto action_403 action_852 (118) = happyGoto action_221 action_852 (156) = happyGoto action_222 action_852 (210) = happyGoto action_404 action_852 (224) = happyGoto action_223 action_852 (225) = happyGoto action_224 action_852 (227) = happyGoto action_225 action_852 (228) = happyGoto action_226 action_852 (237) = happyGoto action_227 action_852 (239) = happyGoto action_228 action_852 (249) = happyGoto action_229 action_852 _ = happyFail action_853 _ = happyReduce_554 action_854 _ = happyReduce_557 action_855 _ = happyReduce_252 action_856 _ = happyReduce_389 action_857 _ = happyReduce_529 action_858 _ = happyReduce_508 action_859 (367) = happyShift action_421 action_859 (160) = happyGoto action_1061 action_859 _ = happyReduce_425 action_860 (368) = happyShift action_1060 action_860 _ = happyReduce_254 action_861 (331) = happyShift action_1059 action_861 _ = happyFail action_862 _ = happyReduce_399 action_863 (331) = happyShift action_1058 action_863 _ = happyFail action_864 (345) = happyShift action_1057 action_864 _ = happyFail action_865 _ = happyReduce_510 action_866 _ = happyReduce_515 action_867 _ = happyReduce_531 action_868 (338) = happyShift action_379 action_868 (340) = happyShift action_1056 action_868 (189) = happyGoto action_1052 action_868 (190) = happyGoto action_1053 action_868 (191) = happyGoto action_1054 action_868 (194) = happyGoto action_1055 action_868 _ = happyFail action_869 (267) = happyShift action_38 action_869 (275) = happyShift action_41 action_869 (287) = happyShift action_47 action_869 (291) = happyShift action_260 action_869 (293) = happyShift action_49 action_869 (294) = happyShift action_50 action_869 (295) = happyShift action_51 action_869 (296) = happyShift action_231 action_869 (297) = happyShift action_232 action_869 (298) = happyShift action_233 action_869 (302) = happyShift action_58 action_869 (303) = happyShift action_59 action_869 (304) = happyShift action_60 action_869 (305) = happyShift action_61 action_869 (306) = happyShift action_62 action_869 (309) = happyShift action_64 action_869 (323) = happyShift action_236 action_869 (324) = happyShift action_237 action_869 (346) = happyShift action_238 action_869 (353) = happyShift action_239 action_869 (357) = happyShift action_240 action_869 (359) = happyShift action_241 action_869 (361) = happyShift action_242 action_869 (363) = happyShift action_243 action_869 (370) = happyShift action_244 action_869 (371) = happyShift action_245 action_869 (372) = happyShift action_246 action_869 (376) = happyShift action_247 action_869 (380) = happyShift action_248 action_869 (381) = happyShift action_87 action_869 (383) = happyShift action_249 action_869 (384) = happyShift action_250 action_869 (403) = happyShift action_251 action_869 (404) = happyShift action_252 action_869 (408) = happyShift action_108 action_869 (409) = happyShift action_109 action_869 (107) = happyGoto action_525 action_869 (111) = happyGoto action_218 action_869 (112) = happyGoto action_254 action_869 (114) = happyGoto action_255 action_869 (115) = happyGoto action_256 action_869 (117) = happyGoto action_257 action_869 (118) = happyGoto action_221 action_869 (156) = happyGoto action_222 action_869 (210) = happyGoto action_259 action_869 (224) = happyGoto action_223 action_869 (225) = happyGoto action_224 action_869 (227) = happyGoto action_225 action_869 (228) = happyGoto action_226 action_869 (237) = happyGoto action_227 action_869 (239) = happyGoto action_228 action_869 (249) = happyGoto action_229 action_869 _ = happyFail action_870 (266) = happyShift action_37 action_870 (267) = happyShift action_38 action_870 (268) = happyShift action_39 action_870 (273) = happyShift action_40 action_870 (275) = happyShift action_41 action_870 (276) = happyShift action_42 action_870 (283) = happyShift action_46 action_870 (287) = happyShift action_47 action_870 (291) = happyShift action_48 action_870 (293) = happyShift action_49 action_870 (294) = happyShift action_50 action_870 (295) = happyShift action_51 action_870 (296) = happyShift action_52 action_870 (297) = happyShift action_53 action_870 (298) = happyShift action_54 action_870 (299) = happyShift action_55 action_870 (300) = happyShift action_56 action_870 (301) = happyShift action_57 action_870 (302) = happyShift action_58 action_870 (303) = happyShift action_59 action_870 (304) = happyShift action_60 action_870 (305) = happyShift action_61 action_870 (306) = happyShift action_62 action_870 (307) = happyShift action_63 action_870 (309) = happyShift action_64 action_870 (318) = happyShift action_68 action_870 (319) = happyShift action_69 action_870 (320) = happyShift action_70 action_870 (336) = happyShift action_72 action_870 (342) = happyShift action_73 action_870 (345) = happyShift action_74 action_870 (346) = happyShift action_802 action_870 (357) = happyShift action_75 action_870 (359) = happyShift action_76 action_870 (361) = happyShift action_118 action_870 (363) = happyShift action_78 action_870 (365) = happyShift action_79 action_870 (370) = happyShift action_80 action_870 (371) = happyShift action_81 action_870 (372) = happyShift action_82 action_870 (375) = happyShift action_83 action_870 (376) = happyShift action_84 action_870 (379) = happyShift action_85 action_870 (380) = happyShift action_86 action_870 (381) = happyShift action_87 action_870 (382) = happyShift action_88 action_870 (383) = happyShift action_89 action_870 (384) = happyShift action_90 action_870 (385) = happyShift action_91 action_870 (386) = happyShift action_92 action_870 (387) = happyShift action_93 action_870 (388) = happyShift action_94 action_870 (389) = happyShift action_95 action_870 (390) = happyShift action_96 action_870 (391) = happyShift action_97 action_870 (396) = happyShift action_98 action_870 (397) = happyShift action_99 action_870 (398) = happyShift action_100 action_870 (399) = happyShift action_101 action_870 (401) = happyShift action_102 action_870 (403) = happyShift action_103 action_870 (404) = happyShift action_104 action_870 (405) = happyShift action_105 action_870 (406) = happyShift action_106 action_870 (407) = happyShift action_107 action_870 (408) = happyShift action_108 action_870 (409) = happyShift action_109 action_870 (38) = happyGoto action_13 action_870 (156) = happyGoto action_16 action_870 (157) = happyGoto action_796 action_870 (158) = happyGoto action_116 action_870 (159) = happyGoto action_18 action_870 (161) = happyGoto action_19 action_870 (162) = happyGoto action_20 action_870 (163) = happyGoto action_21 action_870 (164) = happyGoto action_22 action_870 (165) = happyGoto action_23 action_870 (166) = happyGoto action_24 action_870 (167) = happyGoto action_25 action_870 (188) = happyGoto action_1051 action_870 (195) = happyGoto action_800 action_870 (210) = happyGoto action_26 action_870 (217) = happyGoto action_27 action_870 (220) = happyGoto action_28 action_870 (241) = happyGoto action_30 action_870 (242) = happyGoto action_31 action_870 (243) = happyGoto action_117 action_870 (249) = happyGoto action_33 action_870 (251) = happyGoto action_34 action_870 (252) = happyGoto action_35 action_870 (255) = happyGoto action_36 action_870 _ = happyReduce_517 action_871 _ = happyReduce_511 action_872 _ = happyReduce_249 action_873 (266) = happyShift action_37 action_873 (267) = happyShift action_38 action_873 (268) = happyShift action_39 action_873 (273) = happyShift action_40 action_873 (275) = happyShift action_41 action_873 (276) = happyShift action_42 action_873 (283) = happyShift action_46 action_873 (287) = happyShift action_47 action_873 (291) = happyShift action_48 action_873 (293) = happyShift action_49 action_873 (294) = happyShift action_50 action_873 (295) = happyShift action_51 action_873 (296) = happyShift action_52 action_873 (297) = happyShift action_53 action_873 (298) = happyShift action_54 action_873 (299) = happyShift action_55 action_873 (300) = happyShift action_56 action_873 (301) = happyShift action_57 action_873 (302) = happyShift action_58 action_873 (303) = happyShift action_59 action_873 (304) = happyShift action_60 action_873 (305) = happyShift action_61 action_873 (306) = happyShift action_62 action_873 (307) = happyShift action_63 action_873 (309) = happyShift action_64 action_873 (318) = happyShift action_68 action_873 (319) = happyShift action_69 action_873 (320) = happyShift action_70 action_873 (336) = happyShift action_72 action_873 (342) = happyShift action_73 action_873 (345) = happyShift action_74 action_873 (357) = happyShift action_75 action_873 (359) = happyShift action_76 action_873 (361) = happyShift action_118 action_873 (363) = happyShift action_78 action_873 (365) = happyShift action_79 action_873 (370) = happyShift action_80 action_873 (371) = happyShift action_81 action_873 (372) = happyShift action_82 action_873 (375) = happyShift action_83 action_873 (376) = happyShift action_84 action_873 (379) = happyShift action_85 action_873 (380) = happyShift action_86 action_873 (381) = happyShift action_87 action_873 (382) = happyShift action_88 action_873 (383) = happyShift action_89 action_873 (384) = happyShift action_90 action_873 (385) = happyShift action_91 action_873 (386) = happyShift action_92 action_873 (387) = happyShift action_93 action_873 (388) = happyShift action_94 action_873 (389) = happyShift action_95 action_873 (390) = happyShift action_96 action_873 (391) = happyShift action_97 action_873 (396) = happyShift action_98 action_873 (397) = happyShift action_99 action_873 (398) = happyShift action_100 action_873 (399) = happyShift action_101 action_873 (401) = happyShift action_102 action_873 (403) = happyShift action_103 action_873 (404) = happyShift action_104 action_873 (405) = happyShift action_105 action_873 (406) = happyShift action_106 action_873 (407) = happyShift action_107 action_873 (408) = happyShift action_108 action_873 (409) = happyShift action_109 action_873 (38) = happyGoto action_13 action_873 (156) = happyGoto action_16 action_873 (157) = happyGoto action_1050 action_873 (158) = happyGoto action_116 action_873 (159) = happyGoto action_18 action_873 (161) = happyGoto action_19 action_873 (162) = happyGoto action_20 action_873 (163) = happyGoto action_21 action_873 (164) = happyGoto action_22 action_873 (165) = happyGoto action_23 action_873 (166) = happyGoto action_24 action_873 (167) = happyGoto action_25 action_873 (210) = happyGoto action_26 action_873 (217) = happyGoto action_27 action_873 (220) = happyGoto action_28 action_873 (241) = happyGoto action_30 action_873 (242) = happyGoto action_31 action_873 (243) = happyGoto action_117 action_873 (249) = happyGoto action_33 action_873 (251) = happyGoto action_34 action_873 (252) = happyGoto action_35 action_873 (255) = happyGoto action_36 action_873 _ = happyFail action_874 (266) = happyShift action_37 action_874 (267) = happyShift action_38 action_874 (268) = happyShift action_39 action_874 (273) = happyShift action_40 action_874 (275) = happyShift action_41 action_874 (276) = happyShift action_42 action_874 (283) = happyShift action_46 action_874 (287) = happyShift action_47 action_874 (291) = happyShift action_48 action_874 (293) = happyShift action_49 action_874 (294) = happyShift action_50 action_874 (295) = happyShift action_51 action_874 (296) = happyShift action_52 action_874 (297) = happyShift action_53 action_874 (298) = happyShift action_54 action_874 (299) = happyShift action_55 action_874 (300) = happyShift action_56 action_874 (301) = happyShift action_57 action_874 (302) = happyShift action_58 action_874 (303) = happyShift action_59 action_874 (304) = happyShift action_60 action_874 (305) = happyShift action_61 action_874 (306) = happyShift action_62 action_874 (307) = happyShift action_63 action_874 (309) = happyShift action_64 action_874 (318) = happyShift action_68 action_874 (319) = happyShift action_69 action_874 (320) = happyShift action_70 action_874 (336) = happyShift action_72 action_874 (342) = happyShift action_73 action_874 (345) = happyShift action_74 action_874 (357) = happyShift action_75 action_874 (359) = happyShift action_76 action_874 (361) = happyShift action_118 action_874 (363) = happyShift action_78 action_874 (365) = happyShift action_79 action_874 (370) = happyShift action_80 action_874 (371) = happyShift action_81 action_874 (372) = happyShift action_82 action_874 (375) = happyShift action_83 action_874 (376) = happyShift action_84 action_874 (379) = happyShift action_85 action_874 (380) = happyShift action_86 action_874 (381) = happyShift action_87 action_874 (382) = happyShift action_88 action_874 (383) = happyShift action_89 action_874 (384) = happyShift action_90 action_874 (385) = happyShift action_91 action_874 (386) = happyShift action_92 action_874 (387) = happyShift action_93 action_874 (388) = happyShift action_94 action_874 (389) = happyShift action_95 action_874 (390) = happyShift action_96 action_874 (391) = happyShift action_97 action_874 (396) = happyShift action_98 action_874 (397) = happyShift action_99 action_874 (398) = happyShift action_100 action_874 (399) = happyShift action_101 action_874 (401) = happyShift action_102 action_874 (403) = happyShift action_103 action_874 (404) = happyShift action_104 action_874 (405) = happyShift action_105 action_874 (406) = happyShift action_106 action_874 (407) = happyShift action_107 action_874 (408) = happyShift action_108 action_874 (409) = happyShift action_109 action_874 (38) = happyGoto action_13 action_874 (156) = happyGoto action_16 action_874 (157) = happyGoto action_1049 action_874 (158) = happyGoto action_116 action_874 (159) = happyGoto action_18 action_874 (161) = happyGoto action_19 action_874 (162) = happyGoto action_20 action_874 (163) = happyGoto action_21 action_874 (164) = happyGoto action_22 action_874 (165) = happyGoto action_23 action_874 (166) = happyGoto action_24 action_874 (167) = happyGoto action_25 action_874 (210) = happyGoto action_26 action_874 (217) = happyGoto action_27 action_874 (220) = happyGoto action_28 action_874 (241) = happyGoto action_30 action_874 (242) = happyGoto action_31 action_874 (243) = happyGoto action_117 action_874 (249) = happyGoto action_33 action_874 (251) = happyGoto action_34 action_874 (252) = happyGoto action_35 action_874 (255) = happyGoto action_36 action_874 _ = happyReduce_484 action_875 (310) = happyShift action_1048 action_875 _ = happyReduce_497 action_876 (310) = happyShift action_1046 action_876 (311) = happyShift action_1047 action_876 _ = happyReduce_675 action_877 (266) = happyShift action_37 action_877 (267) = happyShift action_38 action_877 (268) = happyShift action_39 action_877 (273) = happyShift action_40 action_877 (275) = happyShift action_41 action_877 (276) = happyShift action_42 action_877 (283) = happyShift action_164 action_877 (287) = happyShift action_47 action_877 (288) = happyShift action_787 action_877 (291) = happyShift action_48 action_877 (293) = happyShift action_49 action_877 (294) = happyShift action_50 action_877 (295) = happyShift action_51 action_877 (296) = happyShift action_52 action_877 (297) = happyShift action_53 action_877 (298) = happyShift action_54 action_877 (299) = happyShift action_55 action_877 (300) = happyShift action_56 action_877 (301) = happyShift action_57 action_877 (302) = happyShift action_58 action_877 (303) = happyShift action_59 action_877 (304) = happyShift action_60 action_877 (305) = happyShift action_61 action_877 (306) = happyShift action_62 action_877 (307) = happyShift action_63 action_877 (309) = happyShift action_64 action_877 (318) = happyShift action_68 action_877 (319) = happyShift action_69 action_877 (320) = happyShift action_70 action_877 (336) = happyShift action_72 action_877 (342) = happyShift action_73 action_877 (345) = happyShift action_74 action_877 (346) = happyShift action_166 action_877 (357) = happyShift action_75 action_877 (359) = happyShift action_76 action_877 (361) = happyShift action_118 action_877 (363) = happyShift action_78 action_877 (365) = happyShift action_79 action_877 (370) = happyShift action_80 action_877 (371) = happyShift action_81 action_877 (372) = happyShift action_82 action_877 (375) = happyShift action_83 action_877 (376) = happyShift action_84 action_877 (379) = happyShift action_85 action_877 (380) = happyShift action_86 action_877 (381) = happyShift action_87 action_877 (382) = happyShift action_88 action_877 (383) = happyShift action_89 action_877 (384) = happyShift action_90 action_877 (385) = happyShift action_91 action_877 (386) = happyShift action_92 action_877 (387) = happyShift action_93 action_877 (388) = happyShift action_94 action_877 (389) = happyShift action_95 action_877 (390) = happyShift action_96 action_877 (391) = happyShift action_97 action_877 (396) = happyShift action_98 action_877 (397) = happyShift action_99 action_877 (398) = happyShift action_100 action_877 (399) = happyShift action_101 action_877 (401) = happyShift action_102 action_877 (403) = happyShift action_103 action_877 (404) = happyShift action_104 action_877 (405) = happyShift action_105 action_877 (406) = happyShift action_106 action_877 (407) = happyShift action_107 action_877 (408) = happyShift action_108 action_877 (409) = happyShift action_109 action_877 (38) = happyGoto action_13 action_877 (156) = happyGoto action_16 action_877 (157) = happyGoto action_160 action_877 (158) = happyGoto action_116 action_877 (159) = happyGoto action_18 action_877 (161) = happyGoto action_19 action_877 (162) = happyGoto action_20 action_877 (163) = happyGoto action_21 action_877 (164) = happyGoto action_22 action_877 (165) = happyGoto action_23 action_877 (166) = happyGoto action_24 action_877 (167) = happyGoto action_25 action_877 (179) = happyGoto action_1045 action_877 (180) = happyGoto action_784 action_877 (181) = happyGoto action_785 action_877 (196) = happyGoto action_161 action_877 (204) = happyGoto action_786 action_877 (210) = happyGoto action_26 action_877 (217) = happyGoto action_27 action_877 (220) = happyGoto action_28 action_877 (241) = happyGoto action_30 action_877 (242) = happyGoto action_31 action_877 (243) = happyGoto action_117 action_877 (249) = happyGoto action_33 action_877 (251) = happyGoto action_34 action_877 (252) = happyGoto action_35 action_877 (255) = happyGoto action_36 action_877 _ = happyFail action_878 (266) = happyShift action_37 action_878 (267) = happyShift action_38 action_878 (268) = happyShift action_39 action_878 (273) = happyShift action_40 action_878 (275) = happyShift action_41 action_878 (276) = happyShift action_42 action_878 (283) = happyShift action_164 action_878 (287) = happyShift action_47 action_878 (288) = happyShift action_787 action_878 (291) = happyShift action_48 action_878 (293) = happyShift action_49 action_878 (294) = happyShift action_50 action_878 (295) = happyShift action_51 action_878 (296) = happyShift action_52 action_878 (297) = happyShift action_53 action_878 (298) = happyShift action_54 action_878 (299) = happyShift action_55 action_878 (300) = happyShift action_56 action_878 (301) = happyShift action_57 action_878 (302) = happyShift action_58 action_878 (303) = happyShift action_59 action_878 (304) = happyShift action_60 action_878 (305) = happyShift action_61 action_878 (306) = happyShift action_62 action_878 (307) = happyShift action_63 action_878 (309) = happyShift action_64 action_878 (318) = happyShift action_68 action_878 (319) = happyShift action_69 action_878 (320) = happyShift action_70 action_878 (336) = happyShift action_72 action_878 (342) = happyShift action_73 action_878 (345) = happyShift action_74 action_878 (346) = happyShift action_166 action_878 (357) = happyShift action_75 action_878 (359) = happyShift action_76 action_878 (361) = happyShift action_118 action_878 (363) = happyShift action_78 action_878 (365) = happyShift action_79 action_878 (370) = happyShift action_80 action_878 (371) = happyShift action_81 action_878 (372) = happyShift action_82 action_878 (375) = happyShift action_83 action_878 (376) = happyShift action_84 action_878 (379) = happyShift action_85 action_878 (380) = happyShift action_86 action_878 (381) = happyShift action_87 action_878 (382) = happyShift action_88 action_878 (383) = happyShift action_89 action_878 (384) = happyShift action_90 action_878 (385) = happyShift action_91 action_878 (386) = happyShift action_92 action_878 (387) = happyShift action_93 action_878 (388) = happyShift action_94 action_878 (389) = happyShift action_95 action_878 (390) = happyShift action_96 action_878 (391) = happyShift action_97 action_878 (396) = happyShift action_98 action_878 (397) = happyShift action_99 action_878 (398) = happyShift action_100 action_878 (399) = happyShift action_101 action_878 (401) = happyShift action_102 action_878 (403) = happyShift action_103 action_878 (404) = happyShift action_104 action_878 (405) = happyShift action_105 action_878 (406) = happyShift action_106 action_878 (407) = happyShift action_107 action_878 (408) = happyShift action_108 action_878 (409) = happyShift action_109 action_878 (38) = happyGoto action_13 action_878 (156) = happyGoto action_16 action_878 (157) = happyGoto action_160 action_878 (158) = happyGoto action_116 action_878 (159) = happyGoto action_18 action_878 (161) = happyGoto action_19 action_878 (162) = happyGoto action_20 action_878 (163) = happyGoto action_21 action_878 (164) = happyGoto action_22 action_878 (165) = happyGoto action_23 action_878 (166) = happyGoto action_24 action_878 (167) = happyGoto action_25 action_878 (181) = happyGoto action_1043 action_878 (196) = happyGoto action_161 action_878 (204) = happyGoto action_1044 action_878 (210) = happyGoto action_26 action_878 (217) = happyGoto action_27 action_878 (220) = happyGoto action_28 action_878 (241) = happyGoto action_30 action_878 (242) = happyGoto action_31 action_878 (243) = happyGoto action_117 action_878 (249) = happyGoto action_33 action_878 (251) = happyGoto action_34 action_878 (252) = happyGoto action_35 action_878 (255) = happyGoto action_36 action_878 _ = happyFail action_879 (266) = happyShift action_37 action_879 (267) = happyShift action_38 action_879 (268) = happyShift action_39 action_879 (273) = happyShift action_40 action_879 (275) = happyShift action_41 action_879 (276) = happyShift action_42 action_879 (283) = happyShift action_46 action_879 (287) = happyShift action_47 action_879 (291) = happyShift action_48 action_879 (293) = happyShift action_49 action_879 (294) = happyShift action_50 action_879 (295) = happyShift action_51 action_879 (296) = happyShift action_52 action_879 (297) = happyShift action_53 action_879 (298) = happyShift action_54 action_879 (299) = happyShift action_55 action_879 (300) = happyShift action_56 action_879 (301) = happyShift action_57 action_879 (302) = happyShift action_58 action_879 (303) = happyShift action_59 action_879 (304) = happyShift action_60 action_879 (305) = happyShift action_61 action_879 (306) = happyShift action_62 action_879 (307) = happyShift action_63 action_879 (309) = happyShift action_64 action_879 (318) = happyShift action_68 action_879 (319) = happyShift action_69 action_879 (320) = happyShift action_70 action_879 (336) = happyShift action_72 action_879 (342) = happyShift action_73 action_879 (345) = happyShift action_74 action_879 (357) = happyShift action_75 action_879 (359) = happyShift action_76 action_879 (361) = happyShift action_118 action_879 (363) = happyShift action_78 action_879 (365) = happyShift action_79 action_879 (370) = happyShift action_80 action_879 (371) = happyShift action_81 action_879 (372) = happyShift action_82 action_879 (375) = happyShift action_83 action_879 (376) = happyShift action_84 action_879 (379) = happyShift action_85 action_879 (380) = happyShift action_86 action_879 (381) = happyShift action_87 action_879 (382) = happyShift action_88 action_879 (383) = happyShift action_89 action_879 (384) = happyShift action_90 action_879 (385) = happyShift action_91 action_879 (386) = happyShift action_92 action_879 (387) = happyShift action_93 action_879 (388) = happyShift action_94 action_879 (389) = happyShift action_95 action_879 (390) = happyShift action_96 action_879 (391) = happyShift action_97 action_879 (396) = happyShift action_98 action_879 (397) = happyShift action_99 action_879 (398) = happyShift action_100 action_879 (399) = happyShift action_101 action_879 (401) = happyShift action_102 action_879 (403) = happyShift action_103 action_879 (404) = happyShift action_104 action_879 (405) = happyShift action_105 action_879 (406) = happyShift action_106 action_879 (407) = happyShift action_107 action_879 (408) = happyShift action_108 action_879 (409) = happyShift action_109 action_879 (38) = happyGoto action_13 action_879 (156) = happyGoto action_16 action_879 (157) = happyGoto action_1042 action_879 (158) = happyGoto action_116 action_879 (159) = happyGoto action_18 action_879 (161) = happyGoto action_19 action_879 (162) = happyGoto action_20 action_879 (163) = happyGoto action_21 action_879 (164) = happyGoto action_22 action_879 (165) = happyGoto action_23 action_879 (166) = happyGoto action_24 action_879 (167) = happyGoto action_25 action_879 (210) = happyGoto action_26 action_879 (217) = happyGoto action_27 action_879 (220) = happyGoto action_28 action_879 (241) = happyGoto action_30 action_879 (242) = happyGoto action_31 action_879 (243) = happyGoto action_117 action_879 (249) = happyGoto action_33 action_879 (251) = happyGoto action_34 action_879 (252) = happyGoto action_35 action_879 (255) = happyGoto action_36 action_879 _ = happyFail action_880 _ = happyReduce_92 action_881 (331) = happyShift action_1041 action_881 _ = happyFail action_882 (331) = happyShift action_1040 action_882 _ = happyFail action_883 (290) = happyShift action_1039 action_883 _ = happyFail action_884 (392) = happyShift action_154 action_884 (394) = happyShift action_156 action_884 (395) = happyShift action_157 action_884 (30) = happyGoto action_1032 action_884 (31) = happyGoto action_1033 action_884 (32) = happyGoto action_1034 action_884 (33) = happyGoto action_1035 action_884 (259) = happyGoto action_1036 action_884 (261) = happyGoto action_1037 action_884 (262) = happyGoto action_1038 action_884 _ = happyReduce_49 action_885 _ = happyReduce_151 action_886 (290) = happyShift action_892 action_886 (134) = happyGoto action_1031 action_886 _ = happyReduce_347 action_887 (272) = happyShift action_890 action_887 (145) = happyGoto action_1030 action_887 _ = happyReduce_367 action_888 (392) = happyShift action_154 action_888 (138) = happyGoto action_1027 action_888 (139) = happyGoto action_1028 action_888 (259) = happyGoto action_575 action_888 (265) = happyGoto action_1029 action_888 _ = happyReduce_709 action_889 _ = happyReduce_118 action_890 (361) = happyShift action_1026 action_890 (372) = happyShift action_246 action_890 (376) = happyShift action_247 action_890 (380) = happyShift action_248 action_890 (227) = happyGoto action_1025 action_890 (228) = happyGoto action_226 action_890 _ = happyFail action_891 (272) = happyShift action_890 action_891 (145) = happyGoto action_1024 action_891 _ = happyReduce_367 action_892 (353) = happyShift action_1022 action_892 (355) = happyShift action_1023 action_892 _ = happyFail action_893 (267) = happyShift action_38 action_893 (275) = happyShift action_41 action_893 (287) = happyShift action_47 action_893 (293) = happyShift action_49 action_893 (294) = happyShift action_50 action_893 (295) = happyShift action_51 action_893 (296) = happyShift action_231 action_893 (297) = happyShift action_232 action_893 (298) = happyShift action_233 action_893 (302) = happyShift action_58 action_893 (303) = happyShift action_59 action_893 (304) = happyShift action_60 action_893 (305) = happyShift action_61 action_893 (306) = happyShift action_62 action_893 (309) = happyShift action_64 action_893 (323) = happyShift action_236 action_893 (324) = happyShift action_237 action_893 (346) = happyShift action_238 action_893 (353) = happyShift action_239 action_893 (357) = happyShift action_240 action_893 (359) = happyShift action_241 action_893 (361) = happyShift action_242 action_893 (363) = happyShift action_243 action_893 (370) = happyShift action_244 action_893 (371) = happyShift action_245 action_893 (372) = happyShift action_246 action_893 (376) = happyShift action_247 action_893 (380) = happyShift action_248 action_893 (383) = happyShift action_249 action_893 (384) = happyShift action_250 action_893 (403) = happyShift action_251 action_893 (404) = happyShift action_252 action_893 (408) = happyShift action_108 action_893 (409) = happyShift action_109 action_893 (111) = happyGoto action_218 action_893 (115) = happyGoto action_1021 action_893 (117) = happyGoto action_220 action_893 (118) = happyGoto action_221 action_893 (156) = happyGoto action_222 action_893 (224) = happyGoto action_223 action_893 (225) = happyGoto action_224 action_893 (227) = happyGoto action_225 action_893 (228) = happyGoto action_226 action_893 (237) = happyGoto action_227 action_893 (239) = happyGoto action_228 action_893 (249) = happyGoto action_229 action_893 _ = happyFail action_894 (267) = happyShift action_38 action_894 (275) = happyShift action_41 action_894 (287) = happyShift action_47 action_894 (293) = happyShift action_49 action_894 (294) = happyShift action_50 action_894 (295) = happyShift action_51 action_894 (296) = happyShift action_231 action_894 (297) = happyShift action_232 action_894 (298) = happyShift action_233 action_894 (302) = happyShift action_58 action_894 (303) = happyShift action_59 action_894 (304) = happyShift action_60 action_894 (305) = happyShift action_61 action_894 (306) = happyShift action_62 action_894 (309) = happyShift action_64 action_894 (323) = happyShift action_236 action_894 (324) = happyShift action_237 action_894 (346) = happyShift action_238 action_894 (353) = happyShift action_239 action_894 (357) = happyShift action_240 action_894 (359) = happyShift action_241 action_894 (361) = happyShift action_242 action_894 (363) = happyShift action_243 action_894 (370) = happyShift action_244 action_894 (371) = happyShift action_245 action_894 (372) = happyShift action_246 action_894 (376) = happyShift action_247 action_894 (380) = happyShift action_248 action_894 (383) = happyShift action_249 action_894 (384) = happyShift action_250 action_894 (403) = happyShift action_251 action_894 (404) = happyShift action_252 action_894 (408) = happyShift action_108 action_894 (409) = happyShift action_109 action_894 (111) = happyGoto action_218 action_894 (115) = happyGoto action_1020 action_894 (117) = happyGoto action_220 action_894 (118) = happyGoto action_221 action_894 (156) = happyGoto action_222 action_894 (224) = happyGoto action_223 action_894 (225) = happyGoto action_224 action_894 (227) = happyGoto action_225 action_894 (228) = happyGoto action_226 action_894 (237) = happyGoto action_227 action_894 (239) = happyGoto action_228 action_894 (249) = happyGoto action_229 action_894 _ = happyFail action_895 (267) = happyShift action_38 action_895 (275) = happyShift action_41 action_895 (287) = happyShift action_47 action_895 (293) = happyShift action_49 action_895 (294) = happyShift action_50 action_895 (295) = happyShift action_51 action_895 (296) = happyShift action_231 action_895 (297) = happyShift action_232 action_895 (298) = happyShift action_233 action_895 (302) = happyShift action_58 action_895 (303) = happyShift action_59 action_895 (304) = happyShift action_60 action_895 (305) = happyShift action_61 action_895 (306) = happyShift action_62 action_895 (309) = happyShift action_64 action_895 (323) = happyShift action_236 action_895 (324) = happyShift action_237 action_895 (335) = happyReduce_275 action_895 (338) = happyReduce_275 action_895 (344) = happyReduce_269 action_895 (346) = happyShift action_238 action_895 (353) = happyShift action_239 action_895 (357) = happyShift action_240 action_895 (359) = happyShift action_241 action_895 (361) = happyShift action_242 action_895 (363) = happyShift action_243 action_895 (370) = happyShift action_244 action_895 (371) = happyShift action_245 action_895 (372) = happyShift action_246 action_895 (376) = happyShift action_247 action_895 (380) = happyShift action_248 action_895 (383) = happyShift action_249 action_895 (384) = happyShift action_250 action_895 (403) = happyShift action_251 action_895 (404) = happyShift action_252 action_895 (408) = happyShift action_108 action_895 (409) = happyShift action_109 action_895 (111) = happyGoto action_218 action_895 (118) = happyGoto action_551 action_895 (156) = happyGoto action_222 action_895 (224) = happyGoto action_223 action_895 (225) = happyGoto action_224 action_895 (227) = happyGoto action_225 action_895 (228) = happyGoto action_226 action_895 (237) = happyGoto action_227 action_895 (239) = happyGoto action_228 action_895 (249) = happyGoto action_229 action_895 _ = happyReduce_286 action_896 (267) = happyShift action_38 action_896 (275) = happyShift action_41 action_896 (287) = happyShift action_47 action_896 (291) = happyShift action_405 action_896 (293) = happyShift action_49 action_896 (294) = happyShift action_50 action_896 (295) = happyShift action_51 action_896 (296) = happyShift action_231 action_896 (297) = happyShift action_232 action_896 (298) = happyShift action_233 action_896 (302) = happyShift action_58 action_896 (303) = happyShift action_59 action_896 (304) = happyShift action_60 action_896 (305) = happyShift action_61 action_896 (306) = happyShift action_62 action_896 (309) = happyShift action_64 action_896 (323) = happyShift action_236 action_896 (324) = happyShift action_237 action_896 (346) = happyShift action_238 action_896 (353) = happyShift action_239 action_896 (357) = happyShift action_240 action_896 (359) = happyShift action_241 action_896 (361) = happyShift action_242 action_896 (363) = happyShift action_243 action_896 (370) = happyShift action_244 action_896 (371) = happyShift action_245 action_896 (372) = happyShift action_246 action_896 (376) = happyShift action_247 action_896 (380) = happyShift action_248 action_896 (381) = happyShift action_87 action_896 (383) = happyShift action_249 action_896 (384) = happyShift action_250 action_896 (403) = happyShift action_251 action_896 (404) = happyShift action_252 action_896 (408) = happyShift action_108 action_896 (409) = happyShift action_109 action_896 (111) = happyGoto action_218 action_896 (113) = happyGoto action_1019 action_896 (114) = happyGoto action_401 action_896 (116) = happyGoto action_402 action_896 (117) = happyGoto action_403 action_896 (118) = happyGoto action_221 action_896 (156) = happyGoto action_222 action_896 (210) = happyGoto action_404 action_896 (224) = happyGoto action_223 action_896 (225) = happyGoto action_224 action_896 (227) = happyGoto action_225 action_896 (228) = happyGoto action_226 action_896 (237) = happyGoto action_227 action_896 (239) = happyGoto action_228 action_896 (249) = happyGoto action_229 action_896 _ = happyFail action_897 (335) = happyReduce_273 action_897 (338) = happyReduce_273 action_897 (393) = happyShift action_155 action_897 (260) = happyGoto action_1018 action_897 _ = happyReduce_282 action_898 (335) = happyReduce_272 action_898 (338) = happyReduce_272 action_898 (393) = happyShift action_155 action_898 (260) = happyGoto action_1017 action_898 _ = happyReduce_280 action_899 (335) = happyReduce_263 action_899 (338) = happyReduce_263 action_899 _ = happyReduce_267 action_900 (267) = happyShift action_38 action_900 (275) = happyShift action_41 action_900 (287) = happyShift action_47 action_900 (291) = happyShift action_529 action_900 (293) = happyShift action_49 action_900 (294) = happyShift action_50 action_900 (295) = happyShift action_51 action_900 (296) = happyShift action_231 action_900 (297) = happyShift action_232 action_900 (298) = happyShift action_233 action_900 (302) = happyShift action_58 action_900 (303) = happyShift action_59 action_900 (304) = happyShift action_60 action_900 (305) = happyShift action_61 action_900 (306) = happyShift action_62 action_900 (309) = happyShift action_64 action_900 (323) = happyShift action_236 action_900 (324) = happyShift action_237 action_900 (346) = happyShift action_238 action_900 (353) = happyShift action_239 action_900 (357) = happyShift action_240 action_900 (359) = happyShift action_241 action_900 (361) = happyShift action_242 action_900 (363) = happyShift action_243 action_900 (370) = happyShift action_244 action_900 (371) = happyShift action_245 action_900 (372) = happyShift action_246 action_900 (376) = happyShift action_247 action_900 (380) = happyShift action_248 action_900 (381) = happyShift action_87 action_900 (383) = happyShift action_249 action_900 (384) = happyShift action_250 action_900 (403) = happyShift action_251 action_900 (404) = happyShift action_252 action_900 (408) = happyShift action_108 action_900 (409) = happyShift action_109 action_900 (111) = happyGoto action_218 action_900 (112) = happyGoto action_911 action_900 (113) = happyGoto action_1016 action_900 (114) = happyGoto action_526 action_900 (115) = happyGoto action_256 action_900 (116) = happyGoto action_402 action_900 (117) = happyGoto action_527 action_900 (118) = happyGoto action_221 action_900 (156) = happyGoto action_222 action_900 (210) = happyGoto action_528 action_900 (224) = happyGoto action_223 action_900 (225) = happyGoto action_224 action_900 (227) = happyGoto action_225 action_900 (228) = happyGoto action_226 action_900 (237) = happyGoto action_227 action_900 (239) = happyGoto action_228 action_900 (249) = happyGoto action_229 action_900 _ = happyFail action_901 _ = happyReduce_198 action_902 _ = happyReduce_383 action_903 (266) = happyShift action_37 action_903 (267) = happyShift action_38 action_903 (268) = happyShift action_39 action_903 (273) = happyShift action_40 action_903 (275) = happyShift action_41 action_903 (276) = happyShift action_42 action_903 (283) = happyShift action_46 action_903 (287) = happyShift action_47 action_903 (291) = happyShift action_48 action_903 (293) = happyShift action_49 action_903 (294) = happyShift action_50 action_903 (295) = happyShift action_51 action_903 (296) = happyShift action_52 action_903 (297) = happyShift action_53 action_903 (298) = happyShift action_54 action_903 (299) = happyShift action_55 action_903 (300) = happyShift action_56 action_903 (301) = happyShift action_57 action_903 (302) = happyShift action_58 action_903 (303) = happyShift action_59 action_903 (304) = happyShift action_60 action_903 (305) = happyShift action_61 action_903 (306) = happyShift action_62 action_903 (307) = happyShift action_63 action_903 (309) = happyShift action_64 action_903 (318) = happyShift action_68 action_903 (319) = happyShift action_69 action_903 (320) = happyShift action_70 action_903 (336) = happyShift action_72 action_903 (342) = happyShift action_73 action_903 (345) = happyShift action_74 action_903 (357) = happyShift action_75 action_903 (359) = happyShift action_76 action_903 (361) = happyShift action_118 action_903 (363) = happyShift action_78 action_903 (365) = happyShift action_79 action_903 (370) = happyShift action_80 action_903 (371) = happyShift action_81 action_903 (372) = happyShift action_82 action_903 (375) = happyShift action_83 action_903 (376) = happyShift action_84 action_903 (379) = happyShift action_85 action_903 (380) = happyShift action_86 action_903 (381) = happyShift action_87 action_903 (382) = happyShift action_88 action_903 (383) = happyShift action_89 action_903 (384) = happyShift action_90 action_903 (385) = happyShift action_91 action_903 (386) = happyShift action_92 action_903 (387) = happyShift action_93 action_903 (388) = happyShift action_94 action_903 (389) = happyShift action_95 action_903 (390) = happyShift action_96 action_903 (391) = happyShift action_97 action_903 (396) = happyShift action_98 action_903 (397) = happyShift action_99 action_903 (398) = happyShift action_100 action_903 (399) = happyShift action_101 action_903 (401) = happyShift action_102 action_903 (403) = happyShift action_103 action_903 (404) = happyShift action_104 action_903 (405) = happyShift action_105 action_903 (406) = happyShift action_106 action_903 (407) = happyShift action_107 action_903 (408) = happyShift action_108 action_903 (409) = happyShift action_109 action_903 (38) = happyGoto action_13 action_903 (156) = happyGoto action_16 action_903 (157) = happyGoto action_1015 action_903 (158) = happyGoto action_116 action_903 (159) = happyGoto action_18 action_903 (161) = happyGoto action_19 action_903 (162) = happyGoto action_20 action_903 (163) = happyGoto action_21 action_903 (164) = happyGoto action_22 action_903 (165) = happyGoto action_23 action_903 (166) = happyGoto action_24 action_903 (167) = happyGoto action_25 action_903 (210) = happyGoto action_26 action_903 (217) = happyGoto action_27 action_903 (220) = happyGoto action_28 action_903 (241) = happyGoto action_30 action_903 (242) = happyGoto action_31 action_903 (243) = happyGoto action_117 action_903 (249) = happyGoto action_33 action_903 (251) = happyGoto action_34 action_903 (252) = happyGoto action_35 action_903 (255) = happyGoto action_36 action_903 _ = happyFail action_904 _ = happyReduce_177 action_905 (266) = happyShift action_37 action_905 (267) = happyShift action_38 action_905 (268) = happyShift action_39 action_905 (270) = happyShift action_1011 action_905 (271) = happyShift action_1012 action_905 (273) = happyShift action_40 action_905 (275) = happyShift action_41 action_905 (276) = happyShift action_42 action_905 (279) = happyShift action_43 action_905 (280) = happyShift action_44 action_905 (281) = happyShift action_45 action_905 (283) = happyShift action_46 action_905 (287) = happyShift action_47 action_905 (289) = happyShift action_1013 action_905 (291) = happyShift action_48 action_905 (293) = happyShift action_49 action_905 (294) = happyShift action_50 action_905 (295) = happyShift action_51 action_905 (296) = happyShift action_52 action_905 (297) = happyShift action_53 action_905 (298) = happyShift action_54 action_905 (299) = happyShift action_55 action_905 (300) = happyShift action_56 action_905 (301) = happyShift action_57 action_905 (302) = happyShift action_58 action_905 (303) = happyShift action_59 action_905 (304) = happyShift action_60 action_905 (305) = happyShift action_61 action_905 (306) = happyShift action_62 action_905 (307) = happyShift action_63 action_905 (309) = happyShift action_64 action_905 (312) = happyShift action_145 action_905 (313) = happyShift action_65 action_905 (314) = happyShift action_66 action_905 (315) = happyShift action_67 action_905 (318) = happyShift action_68 action_905 (319) = happyShift action_69 action_905 (320) = happyShift action_70 action_905 (329) = happyShift action_71 action_905 (336) = happyShift action_72 action_905 (342) = happyShift action_73 action_905 (345) = happyShift action_74 action_905 (346) = happyShift action_153 action_905 (357) = happyShift action_75 action_905 (359) = happyShift action_76 action_905 (361) = happyShift action_77 action_905 (363) = happyShift action_78 action_905 (365) = happyShift action_79 action_905 (370) = happyShift action_80 action_905 (371) = happyShift action_81 action_905 (372) = happyShift action_82 action_905 (375) = happyShift action_83 action_905 (376) = happyShift action_84 action_905 (379) = happyShift action_85 action_905 (380) = happyShift action_86 action_905 (381) = happyShift action_87 action_905 (382) = happyShift action_88 action_905 (383) = happyShift action_89 action_905 (384) = happyShift action_90 action_905 (385) = happyShift action_91 action_905 (386) = happyShift action_92 action_905 (387) = happyShift action_93 action_905 (388) = happyShift action_94 action_905 (389) = happyShift action_95 action_905 (390) = happyShift action_96 action_905 (391) = happyShift action_97 action_905 (392) = happyShift action_154 action_905 (393) = happyShift action_155 action_905 (394) = happyShift action_156 action_905 (395) = happyShift action_157 action_905 (396) = happyShift action_98 action_905 (397) = happyShift action_99 action_905 (398) = happyShift action_100 action_905 (399) = happyShift action_101 action_905 (401) = happyShift action_102 action_905 (403) = happyShift action_103 action_905 (404) = happyShift action_104 action_905 (405) = happyShift action_105 action_905 (406) = happyShift action_106 action_905 (407) = happyShift action_107 action_905 (408) = happyShift action_108 action_905 (409) = happyShift action_109 action_905 (38) = happyGoto action_13 action_905 (49) = happyGoto action_14 action_905 (60) = happyGoto action_1007 action_905 (72) = happyGoto action_126 action_905 (75) = happyGoto action_1008 action_905 (76) = happyGoto action_1014 action_905 (146) = happyGoto action_128 action_905 (147) = happyGoto action_129 action_905 (148) = happyGoto action_627 action_905 (149) = happyGoto action_1010 action_905 (153) = happyGoto action_131 action_905 (156) = happyGoto action_16 action_905 (158) = happyGoto action_629 action_905 (159) = happyGoto action_18 action_905 (161) = happyGoto action_19 action_905 (162) = happyGoto action_20 action_905 (163) = happyGoto action_21 action_905 (164) = happyGoto action_22 action_905 (165) = happyGoto action_23 action_905 (166) = happyGoto action_24 action_905 (167) = happyGoto action_630 action_905 (210) = happyGoto action_26 action_905 (217) = happyGoto action_27 action_905 (220) = happyGoto action_28 action_905 (240) = happyGoto action_29 action_905 (241) = happyGoto action_30 action_905 (242) = happyGoto action_31 action_905 (243) = happyGoto action_32 action_905 (249) = happyGoto action_33 action_905 (251) = happyGoto action_34 action_905 (252) = happyGoto action_35 action_905 (255) = happyGoto action_36 action_905 (259) = happyGoto action_133 action_905 (260) = happyGoto action_134 action_905 (261) = happyGoto action_135 action_905 (262) = happyGoto action_136 action_905 _ = happyReduce_174 action_906 (266) = happyShift action_37 action_906 (267) = happyShift action_38 action_906 (268) = happyShift action_39 action_906 (270) = happyShift action_1011 action_906 (271) = happyShift action_1012 action_906 (273) = happyShift action_40 action_906 (275) = happyShift action_41 action_906 (276) = happyShift action_42 action_906 (279) = happyShift action_43 action_906 (280) = happyShift action_44 action_906 (281) = happyShift action_45 action_906 (283) = happyShift action_46 action_906 (287) = happyShift action_47 action_906 (289) = happyShift action_1013 action_906 (291) = happyShift action_48 action_906 (293) = happyShift action_49 action_906 (294) = happyShift action_50 action_906 (295) = happyShift action_51 action_906 (296) = happyShift action_52 action_906 (297) = happyShift action_53 action_906 (298) = happyShift action_54 action_906 (299) = happyShift action_55 action_906 (300) = happyShift action_56 action_906 (301) = happyShift action_57 action_906 (302) = happyShift action_58 action_906 (303) = happyShift action_59 action_906 (304) = happyShift action_60 action_906 (305) = happyShift action_61 action_906 (306) = happyShift action_62 action_906 (307) = happyShift action_63 action_906 (309) = happyShift action_64 action_906 (312) = happyShift action_145 action_906 (313) = happyShift action_65 action_906 (314) = happyShift action_66 action_906 (315) = happyShift action_67 action_906 (318) = happyShift action_68 action_906 (319) = happyShift action_69 action_906 (320) = happyShift action_70 action_906 (329) = happyShift action_71 action_906 (336) = happyShift action_72 action_906 (342) = happyShift action_73 action_906 (345) = happyShift action_74 action_906 (346) = happyShift action_153 action_906 (357) = happyShift action_75 action_906 (359) = happyShift action_76 action_906 (361) = happyShift action_77 action_906 (363) = happyShift action_78 action_906 (365) = happyShift action_79 action_906 (370) = happyShift action_80 action_906 (371) = happyShift action_81 action_906 (372) = happyShift action_82 action_906 (375) = happyShift action_83 action_906 (376) = happyShift action_84 action_906 (379) = happyShift action_85 action_906 (380) = happyShift action_86 action_906 (381) = happyShift action_87 action_906 (382) = happyShift action_88 action_906 (383) = happyShift action_89 action_906 (384) = happyShift action_90 action_906 (385) = happyShift action_91 action_906 (386) = happyShift action_92 action_906 (387) = happyShift action_93 action_906 (388) = happyShift action_94 action_906 (389) = happyShift action_95 action_906 (390) = happyShift action_96 action_906 (391) = happyShift action_97 action_906 (392) = happyShift action_154 action_906 (393) = happyShift action_155 action_906 (394) = happyShift action_156 action_906 (395) = happyShift action_157 action_906 (396) = happyShift action_98 action_906 (397) = happyShift action_99 action_906 (398) = happyShift action_100 action_906 (399) = happyShift action_101 action_906 (401) = happyShift action_102 action_906 (403) = happyShift action_103 action_906 (404) = happyShift action_104 action_906 (405) = happyShift action_105 action_906 (406) = happyShift action_106 action_906 (407) = happyShift action_107 action_906 (408) = happyShift action_108 action_906 (409) = happyShift action_109 action_906 (38) = happyGoto action_13 action_906 (49) = happyGoto action_14 action_906 (60) = happyGoto action_1007 action_906 (72) = happyGoto action_126 action_906 (75) = happyGoto action_1008 action_906 (76) = happyGoto action_1009 action_906 (146) = happyGoto action_128 action_906 (147) = happyGoto action_129 action_906 (148) = happyGoto action_627 action_906 (149) = happyGoto action_1010 action_906 (153) = happyGoto action_131 action_906 (156) = happyGoto action_16 action_906 (158) = happyGoto action_629 action_906 (159) = happyGoto action_18 action_906 (161) = happyGoto action_19 action_906 (162) = happyGoto action_20 action_906 (163) = happyGoto action_21 action_906 (164) = happyGoto action_22 action_906 (165) = happyGoto action_23 action_906 (166) = happyGoto action_24 action_906 (167) = happyGoto action_630 action_906 (210) = happyGoto action_26 action_906 (217) = happyGoto action_27 action_906 (220) = happyGoto action_28 action_906 (240) = happyGoto action_29 action_906 (241) = happyGoto action_30 action_906 (242) = happyGoto action_31 action_906 (243) = happyGoto action_32 action_906 (249) = happyGoto action_33 action_906 (251) = happyGoto action_34 action_906 (252) = happyGoto action_35 action_906 (255) = happyGoto action_36 action_906 (259) = happyGoto action_133 action_906 (260) = happyGoto action_134 action_906 (261) = happyGoto action_135 action_906 (262) = happyGoto action_136 action_906 _ = happyReduce_174 action_907 _ = happyReduce_330 action_908 (128) = happyGoto action_1006 action_908 _ = happyReduce_329 action_909 (127) = happyGoto action_1005 action_909 (128) = happyGoto action_735 action_909 _ = happyReduce_329 action_910 _ = happyReduce_319 action_911 _ = happyReduce_261 action_912 (267) = happyShift action_38 action_912 (275) = happyShift action_41 action_912 (287) = happyShift action_47 action_912 (293) = happyShift action_49 action_912 (294) = happyShift action_50 action_912 (295) = happyShift action_51 action_912 (296) = happyShift action_231 action_912 (297) = happyShift action_232 action_912 (298) = happyShift action_233 action_912 (302) = happyShift action_58 action_912 (303) = happyShift action_59 action_912 (304) = happyShift action_60 action_912 (305) = happyShift action_61 action_912 (306) = happyShift action_62 action_912 (309) = happyShift action_64 action_912 (347) = happyShift action_934 action_912 (357) = happyShift action_935 action_912 (361) = happyShift action_936 action_912 (371) = happyShift action_245 action_912 (372) = happyShift action_246 action_912 (376) = happyShift action_247 action_912 (380) = happyShift action_248 action_912 (129) = happyGoto action_1004 action_912 (130) = happyGoto action_929 action_912 (131) = happyGoto action_930 action_912 (132) = happyGoto action_931 action_912 (227) = happyGoto action_932 action_912 (228) = happyGoto action_226 action_912 (237) = happyGoto action_933 action_912 (239) = happyGoto action_228 action_912 (249) = happyGoto action_229 action_912 _ = happyFail action_913 _ = happyReduce_179 action_914 (330) = happyShift action_291 action_914 (66) = happyGoto action_1003 action_914 _ = happyReduce_153 action_915 _ = happyReduce_183 action_916 (1) = happyShift action_424 action_916 (356) = happyShift action_425 action_916 (367) = happyShift action_1000 action_916 (256) = happyGoto action_1002 action_916 _ = happyFail action_917 _ = happyReduce_180 action_918 _ = happyReduce_145 action_919 (267) = happyShift action_38 action_919 (275) = happyShift action_41 action_919 (287) = happyShift action_47 action_919 (293) = happyShift action_49 action_919 (294) = happyShift action_50 action_919 (295) = happyShift action_51 action_919 (296) = happyShift action_231 action_919 (297) = happyShift action_232 action_919 (298) = happyShift action_233 action_919 (302) = happyShift action_58 action_919 (303) = happyShift action_59 action_919 (304) = happyShift action_60 action_919 (305) = happyShift action_61 action_919 (306) = happyShift action_62 action_919 (309) = happyShift action_64 action_919 (323) = happyShift action_236 action_919 (324) = happyShift action_237 action_919 (346) = happyShift action_238 action_919 (353) = happyShift action_239 action_919 (357) = happyShift action_240 action_919 (359) = happyShift action_241 action_919 (361) = happyShift action_242 action_919 (363) = happyShift action_243 action_919 (370) = happyShift action_244 action_919 (371) = happyShift action_245 action_919 (372) = happyShift action_246 action_919 (376) = happyShift action_247 action_919 (380) = happyShift action_248 action_919 (383) = happyShift action_249 action_919 (384) = happyShift action_250 action_919 (403) = happyShift action_251 action_919 (404) = happyShift action_252 action_919 (408) = happyShift action_108 action_919 (409) = happyShift action_109 action_919 (59) = happyGoto action_1001 action_919 (111) = happyGoto action_218 action_919 (115) = happyGoto action_583 action_919 (117) = happyGoto action_220 action_919 (118) = happyGoto action_221 action_919 (156) = happyGoto action_222 action_919 (224) = happyGoto action_223 action_919 (225) = happyGoto action_224 action_919 (227) = happyGoto action_225 action_919 (228) = happyGoto action_226 action_919 (237) = happyGoto action_227 action_919 (239) = happyGoto action_228 action_919 (249) = happyGoto action_229 action_919 _ = happyFail action_920 (354) = happyShift action_999 action_920 (367) = happyShift action_1000 action_920 _ = happyFail action_921 _ = happyReduce_632 action_922 _ = happyReduce_607 action_923 _ = happyReduce_277 action_924 _ = happyReduce_276 action_925 _ = happyReduce_308 action_926 (267) = happyShift action_38 action_926 (275) = happyShift action_41 action_926 (287) = happyShift action_47 action_926 (291) = happyShift action_260 action_926 (293) = happyShift action_49 action_926 (294) = happyShift action_50 action_926 (295) = happyShift action_51 action_926 (296) = happyShift action_231 action_926 (297) = happyShift action_232 action_926 (298) = happyShift action_233 action_926 (302) = happyShift action_58 action_926 (303) = happyShift action_59 action_926 (304) = happyShift action_60 action_926 (305) = happyShift action_61 action_926 (306) = happyShift action_62 action_926 (309) = happyShift action_64 action_926 (323) = happyShift action_236 action_926 (324) = happyShift action_237 action_926 (346) = happyShift action_238 action_926 (353) = happyShift action_239 action_926 (357) = happyShift action_240 action_926 (359) = happyShift action_241 action_926 (361) = happyShift action_242 action_926 (363) = happyShift action_243 action_926 (370) = happyShift action_244 action_926 (371) = happyShift action_245 action_926 (372) = happyShift action_246 action_926 (376) = happyShift action_247 action_926 (380) = happyShift action_248 action_926 (381) = happyShift action_87 action_926 (383) = happyShift action_249 action_926 (384) = happyShift action_250 action_926 (403) = happyShift action_251 action_926 (404) = happyShift action_252 action_926 (408) = happyShift action_108 action_926 (409) = happyShift action_109 action_926 (111) = happyGoto action_218 action_926 (112) = happyGoto action_540 action_926 (114) = happyGoto action_255 action_926 (115) = happyGoto action_256 action_926 (117) = happyGoto action_257 action_926 (118) = happyGoto action_221 action_926 (122) = happyGoto action_998 action_926 (156) = happyGoto action_222 action_926 (210) = happyGoto action_259 action_926 (224) = happyGoto action_223 action_926 (225) = happyGoto action_224 action_926 (227) = happyGoto action_225 action_926 (228) = happyGoto action_226 action_926 (237) = happyGoto action_227 action_926 (239) = happyGoto action_228 action_926 (249) = happyGoto action_229 action_926 _ = happyFail action_927 (362) = happyShift action_997 action_927 _ = happyFail action_928 (362) = happyShift action_996 action_928 _ = happyFail action_929 (267) = happyShift action_38 action_929 (275) = happyShift action_41 action_929 (287) = happyShift action_47 action_929 (293) = happyShift action_49 action_929 (294) = happyShift action_50 action_929 (295) = happyShift action_51 action_929 (296) = happyShift action_231 action_929 (297) = happyShift action_232 action_929 (298) = happyShift action_233 action_929 (302) = happyShift action_58 action_929 (303) = happyShift action_59 action_929 (304) = happyShift action_60 action_929 (305) = happyShift action_61 action_929 (306) = happyShift action_62 action_929 (309) = happyShift action_64 action_929 (340) = happyShift action_995 action_929 (347) = happyShift action_934 action_929 (357) = happyShift action_935 action_929 (361) = happyShift action_936 action_929 (371) = happyShift action_245 action_929 (372) = happyShift action_246 action_929 (376) = happyShift action_247 action_929 (380) = happyShift action_248 action_929 (131) = happyGoto action_994 action_929 (132) = happyGoto action_931 action_929 (227) = happyGoto action_932 action_929 (228) = happyGoto action_226 action_929 (237) = happyGoto action_933 action_929 (239) = happyGoto action_228 action_929 (249) = happyGoto action_229 action_929 _ = happyReduce_331 action_930 _ = happyReduce_333 action_931 _ = happyReduce_337 action_932 _ = happyReduce_339 action_933 _ = happyReduce_338 action_934 _ = happyReduce_335 action_935 (267) = happyShift action_38 action_935 (275) = happyShift action_41 action_935 (287) = happyShift action_47 action_935 (293) = happyShift action_49 action_935 (294) = happyShift action_50 action_935 (295) = happyShift action_51 action_935 (296) = happyShift action_231 action_935 (297) = happyShift action_232 action_935 (298) = happyShift action_233 action_935 (302) = happyShift action_58 action_935 (303) = happyShift action_59 action_935 (304) = happyShift action_60 action_935 (305) = happyShift action_61 action_935 (306) = happyShift action_62 action_935 (309) = happyShift action_64 action_935 (347) = happyShift action_934 action_935 (357) = happyShift action_935 action_935 (361) = happyShift action_936 action_935 (371) = happyShift action_245 action_935 (372) = happyShift action_246 action_935 (376) = happyShift action_247 action_935 (380) = happyShift action_248 action_935 (129) = happyGoto action_993 action_935 (130) = happyGoto action_929 action_935 (131) = happyGoto action_930 action_935 (132) = happyGoto action_931 action_935 (227) = happyGoto action_932 action_935 (228) = happyGoto action_226 action_935 (237) = happyGoto action_933 action_935 (239) = happyGoto action_228 action_935 (249) = happyGoto action_229 action_935 _ = happyFail action_936 (267) = happyShift action_38 action_936 (275) = happyShift action_41 action_936 (287) = happyShift action_47 action_936 (293) = happyShift action_49 action_936 (294) = happyShift action_50 action_936 (295) = happyShift action_51 action_936 (296) = happyShift action_231 action_936 (297) = happyShift action_232 action_936 (298) = happyShift action_233 action_936 (302) = happyShift action_58 action_936 (303) = happyShift action_59 action_936 (304) = happyShift action_60 action_936 (305) = happyShift action_61 action_936 (306) = happyShift action_62 action_936 (309) = happyShift action_64 action_936 (347) = happyShift action_934 action_936 (357) = happyShift action_935 action_936 (361) = happyShift action_936 action_936 (362) = happyShift action_992 action_936 (371) = happyShift action_245 action_936 (372) = happyShift action_246 action_936 (376) = happyShift action_247 action_936 (380) = happyShift action_248 action_936 (129) = happyGoto action_991 action_936 (130) = happyGoto action_929 action_936 (131) = happyGoto action_930 action_936 (132) = happyGoto action_931 action_936 (227) = happyGoto action_932 action_936 (228) = happyGoto action_226 action_936 (237) = happyGoto action_933 action_936 (239) = happyGoto action_228 action_936 (249) = happyGoto action_229 action_936 _ = happyFail action_937 (358) = happyShift action_990 action_937 _ = happyFail action_938 (393) = happyShift action_155 action_938 (260) = happyGoto action_988 action_938 (264) = happyGoto action_989 action_938 _ = happyReduce_707 action_939 (267) = happyShift action_38 action_939 (275) = happyShift action_41 action_939 (287) = happyShift action_47 action_939 (291) = happyShift action_260 action_939 (293) = happyShift action_49 action_939 (294) = happyShift action_50 action_939 (295) = happyShift action_51 action_939 (296) = happyShift action_231 action_939 (297) = happyShift action_232 action_939 (298) = happyShift action_233 action_939 (302) = happyShift action_58 action_939 (303) = happyShift action_59 action_939 (304) = happyShift action_60 action_939 (305) = happyShift action_61 action_939 (306) = happyShift action_62 action_939 (309) = happyShift action_64 action_939 (323) = happyShift action_236 action_939 (324) = happyShift action_237 action_939 (346) = happyShift action_238 action_939 (353) = happyShift action_239 action_939 (357) = happyShift action_240 action_939 (359) = happyShift action_241 action_939 (361) = happyShift action_242 action_939 (363) = happyShift action_243 action_939 (370) = happyShift action_244 action_939 (371) = happyShift action_245 action_939 (372) = happyShift action_246 action_939 (376) = happyShift action_247 action_939 (380) = happyShift action_248 action_939 (381) = happyShift action_87 action_939 (383) = happyShift action_249 action_939 (384) = happyShift action_250 action_939 (403) = happyShift action_251 action_939 (404) = happyShift action_252 action_939 (408) = happyShift action_108 action_939 (409) = happyShift action_109 action_939 (111) = happyGoto action_218 action_939 (112) = happyGoto action_987 action_939 (114) = happyGoto action_255 action_939 (115) = happyGoto action_256 action_939 (117) = happyGoto action_257 action_939 (118) = happyGoto action_221 action_939 (156) = happyGoto action_222 action_939 (210) = happyGoto action_259 action_939 (224) = happyGoto action_223 action_939 (225) = happyGoto action_224 action_939 (227) = happyGoto action_225 action_939 (228) = happyGoto action_226 action_939 (237) = happyGoto action_227 action_939 (239) = happyGoto action_228 action_939 (249) = happyGoto action_229 action_939 _ = happyFail action_940 _ = happyReduce_159 action_941 _ = happyReduce_148 action_942 _ = happyReduce_117 action_943 (353) = happyShift action_985 action_943 (355) = happyShift action_986 action_943 (57) = happyGoto action_984 action_943 _ = happyFail action_944 _ = happyReduce_134 action_945 (334) = happyShift action_983 action_945 _ = happyFail action_946 (267) = happyShift action_38 action_946 (275) = happyShift action_41 action_946 (287) = happyShift action_47 action_946 (291) = happyShift action_405 action_946 (293) = happyShift action_49 action_946 (294) = happyShift action_50 action_946 (295) = happyShift action_51 action_946 (296) = happyShift action_231 action_946 (297) = happyShift action_232 action_946 (298) = happyShift action_233 action_946 (302) = happyShift action_58 action_946 (303) = happyShift action_59 action_946 (304) = happyShift action_60 action_946 (305) = happyShift action_61 action_946 (306) = happyShift action_62 action_946 (309) = happyShift action_64 action_946 (323) = happyShift action_236 action_946 (324) = happyShift action_237 action_946 (346) = happyShift action_238 action_946 (353) = happyShift action_239 action_946 (357) = happyShift action_240 action_946 (359) = happyShift action_241 action_946 (361) = happyShift action_242 action_946 (363) = happyShift action_243 action_946 (370) = happyShift action_244 action_946 (371) = happyShift action_245 action_946 (372) = happyShift action_246 action_946 (376) = happyShift action_247 action_946 (380) = happyShift action_248 action_946 (381) = happyShift action_87 action_946 (383) = happyShift action_249 action_946 (384) = happyShift action_250 action_946 (403) = happyShift action_251 action_946 (404) = happyShift action_252 action_946 (408) = happyShift action_108 action_946 (409) = happyShift action_109 action_946 (108) = happyGoto action_982 action_946 (111) = happyGoto action_218 action_946 (113) = happyGoto action_400 action_946 (114) = happyGoto action_401 action_946 (116) = happyGoto action_402 action_946 (117) = happyGoto action_403 action_946 (118) = happyGoto action_221 action_946 (156) = happyGoto action_222 action_946 (210) = happyGoto action_404 action_946 (224) = happyGoto action_223 action_946 (225) = happyGoto action_224 action_946 (227) = happyGoto action_225 action_946 (228) = happyGoto action_226 action_946 (237) = happyGoto action_227 action_946 (239) = happyGoto action_228 action_946 (249) = happyGoto action_229 action_946 _ = happyFail action_947 _ = happyReduce_233 action_948 (266) = happyShift action_37 action_948 (267) = happyShift action_38 action_948 (268) = happyShift action_39 action_948 (273) = happyShift action_40 action_948 (275) = happyShift action_41 action_948 (276) = happyShift action_42 action_948 (283) = happyShift action_46 action_948 (287) = happyShift action_47 action_948 (291) = happyShift action_48 action_948 (293) = happyShift action_49 action_948 (294) = happyShift action_50 action_948 (295) = happyShift action_51 action_948 (296) = happyShift action_52 action_948 (297) = happyShift action_53 action_948 (298) = happyShift action_54 action_948 (299) = happyShift action_55 action_948 (300) = happyShift action_56 action_948 (301) = happyShift action_57 action_948 (302) = happyShift action_58 action_948 (303) = happyShift action_59 action_948 (304) = happyShift action_60 action_948 (305) = happyShift action_61 action_948 (306) = happyShift action_62 action_948 (307) = happyShift action_63 action_948 (309) = happyShift action_64 action_948 (318) = happyShift action_68 action_948 (319) = happyShift action_69 action_948 (320) = happyShift action_70 action_948 (336) = happyShift action_72 action_948 (342) = happyShift action_73 action_948 (345) = happyShift action_74 action_948 (346) = happyShift action_802 action_948 (357) = happyShift action_75 action_948 (359) = happyShift action_76 action_948 (361) = happyShift action_118 action_948 (363) = happyShift action_78 action_948 (365) = happyShift action_79 action_948 (370) = happyShift action_80 action_948 (371) = happyShift action_81 action_948 (372) = happyShift action_82 action_948 (375) = happyShift action_83 action_948 (376) = happyShift action_84 action_948 (379) = happyShift action_85 action_948 (380) = happyShift action_86 action_948 (381) = happyShift action_87 action_948 (382) = happyShift action_88 action_948 (383) = happyShift action_89 action_948 (384) = happyShift action_90 action_948 (385) = happyShift action_91 action_948 (386) = happyShift action_92 action_948 (387) = happyShift action_93 action_948 (388) = happyShift action_94 action_948 (389) = happyShift action_95 action_948 (390) = happyShift action_96 action_948 (391) = happyShift action_97 action_948 (396) = happyShift action_98 action_948 (397) = happyShift action_99 action_948 (398) = happyShift action_100 action_948 (399) = happyShift action_101 action_948 (401) = happyShift action_102 action_948 (403) = happyShift action_103 action_948 (404) = happyShift action_104 action_948 (405) = happyShift action_105 action_948 (406) = happyShift action_106 action_948 (407) = happyShift action_107 action_948 (408) = happyShift action_108 action_948 (409) = happyShift action_109 action_948 (38) = happyGoto action_13 action_948 (156) = happyGoto action_16 action_948 (157) = happyGoto action_796 action_948 (158) = happyGoto action_116 action_948 (159) = happyGoto action_18 action_948 (161) = happyGoto action_19 action_948 (162) = happyGoto action_20 action_948 (163) = happyGoto action_21 action_948 (164) = happyGoto action_22 action_948 (165) = happyGoto action_23 action_948 (166) = happyGoto action_24 action_948 (167) = happyGoto action_25 action_948 (195) = happyGoto action_981 action_948 (210) = happyGoto action_26 action_948 (217) = happyGoto action_27 action_948 (220) = happyGoto action_28 action_948 (241) = happyGoto action_30 action_948 (242) = happyGoto action_31 action_948 (243) = happyGoto action_117 action_948 (249) = happyGoto action_33 action_948 (251) = happyGoto action_34 action_948 (252) = happyGoto action_35 action_948 (255) = happyGoto action_36 action_948 _ = happyFail action_949 _ = happyReduce_590 action_950 _ = happyReduce_162 action_951 (352) = happyShift action_980 action_951 _ = happyFail action_952 (267) = happyShift action_38 action_952 (275) = happyShift action_41 action_952 (287) = happyShift action_47 action_952 (291) = happyShift action_48 action_952 (293) = happyShift action_49 action_952 (294) = happyShift action_50 action_952 (295) = happyShift action_51 action_952 (296) = happyShift action_52 action_952 (297) = happyShift action_53 action_952 (298) = happyShift action_54 action_952 (300) = happyShift action_56 action_952 (301) = happyShift action_57 action_952 (302) = happyShift action_58 action_952 (303) = happyShift action_59 action_952 (304) = happyShift action_60 action_952 (305) = happyShift action_61 action_952 (306) = happyShift action_62 action_952 (309) = happyShift action_64 action_952 (361) = happyShift action_954 action_952 (371) = happyShift action_81 action_952 (92) = happyGoto action_979 action_952 (93) = happyGoto action_952 action_952 (243) = happyGoto action_953 action_952 (249) = happyGoto action_33 action_952 _ = happyReduce_212 action_953 _ = happyReduce_214 action_954 (267) = happyShift action_38 action_954 (275) = happyShift action_41 action_954 (287) = happyShift action_47 action_954 (291) = happyShift action_48 action_954 (293) = happyShift action_49 action_954 (294) = happyShift action_50 action_954 (295) = happyShift action_51 action_954 (296) = happyShift action_52 action_954 (297) = happyShift action_53 action_954 (298) = happyShift action_54 action_954 (300) = happyShift action_56 action_954 (301) = happyShift action_57 action_954 (302) = happyShift action_58 action_954 (303) = happyShift action_59 action_954 (304) = happyShift action_60 action_954 (305) = happyShift action_61 action_954 (306) = happyShift action_62 action_954 (309) = happyShift action_64 action_954 (371) = happyShift action_81 action_954 (243) = happyGoto action_978 action_954 (249) = happyGoto action_33 action_954 _ = happyFail action_955 (333) = happyShift action_278 action_955 (335) = happyShift action_977 action_955 (345) = happyShift action_280 action_955 (346) = happyShift action_281 action_955 (347) = happyShift action_282 action_955 (352) = happyShift action_283 action_955 (369) = happyShift action_284 action_955 (373) = happyShift action_285 action_955 (374) = happyShift action_286 action_955 (377) = happyShift action_287 action_955 (378) = happyShift action_288 action_955 (222) = happyGoto action_268 action_955 (233) = happyGoto action_269 action_955 (235) = happyGoto action_270 action_955 (244) = happyGoto action_271 action_955 (246) = happyGoto action_272 action_955 (247) = happyGoto action_273 action_955 (248) = happyGoto action_274 action_955 (250) = happyGoto action_275 action_955 (253) = happyGoto action_276 action_955 (254) = happyGoto action_277 action_955 _ = happyFail action_956 _ = happyReduce_207 action_957 _ = happyReduce_209 action_958 (358) = happyShift action_976 action_958 _ = happyFail action_959 _ = happyReduce_227 action_960 (383) = happyShift action_975 action_960 _ = happyFail action_961 _ = happyReduce_231 action_962 (331) = happyShift action_974 action_962 _ = happyFail action_963 _ = happyReduce_105 action_964 (331) = happyShift action_973 action_964 _ = happyFail action_965 (372) = happyShift action_503 action_965 (376) = happyShift action_504 action_965 (257) = happyGoto action_972 action_965 _ = happyFail action_966 _ = happyReduce_75 action_967 _ = happyReduce_562 action_968 _ = happyReduce_189 action_969 _ = happyReduce_559 action_970 (335) = happyShift action_649 action_970 _ = happyFail action_971 _ = happyReduce_543 action_972 (267) = happyShift action_1129 action_972 (45) = happyGoto action_1128 action_972 _ = happyReduce_80 action_973 _ = happyReduce_110 action_974 _ = happyReduce_109 action_975 _ = happyReduce_228 action_976 _ = happyReduce_208 action_977 (266) = happyShift action_37 action_977 (267) = happyShift action_38 action_977 (268) = happyShift action_39 action_977 (273) = happyShift action_40 action_977 (275) = happyShift action_41 action_977 (276) = happyShift action_42 action_977 (283) = happyShift action_46 action_977 (287) = happyShift action_47 action_977 (291) = happyShift action_48 action_977 (293) = happyShift action_49 action_977 (294) = happyShift action_50 action_977 (295) = happyShift action_51 action_977 (296) = happyShift action_52 action_977 (297) = happyShift action_53 action_977 (298) = happyShift action_54 action_977 (299) = happyShift action_55 action_977 (300) = happyShift action_56 action_977 (301) = happyShift action_57 action_977 (302) = happyShift action_58 action_977 (303) = happyShift action_59 action_977 (304) = happyShift action_60 action_977 (305) = happyShift action_61 action_977 (306) = happyShift action_62 action_977 (307) = happyShift action_63 action_977 (309) = happyShift action_64 action_977 (318) = happyShift action_68 action_977 (319) = happyShift action_69 action_977 (320) = happyShift action_70 action_977 (336) = happyShift action_72 action_977 (342) = happyShift action_73 action_977 (345) = happyShift action_74 action_977 (357) = happyShift action_75 action_977 (359) = happyShift action_76 action_977 (361) = happyShift action_118 action_977 (363) = happyShift action_78 action_977 (365) = happyShift action_79 action_977 (370) = happyShift action_80 action_977 (371) = happyShift action_81 action_977 (372) = happyShift action_82 action_977 (375) = happyShift action_83 action_977 (376) = happyShift action_84 action_977 (379) = happyShift action_85 action_977 (380) = happyShift action_86 action_977 (381) = happyShift action_87 action_977 (382) = happyShift action_88 action_977 (383) = happyShift action_89 action_977 (384) = happyShift action_90 action_977 (385) = happyShift action_91 action_977 (386) = happyShift action_92 action_977 (387) = happyShift action_93 action_977 (388) = happyShift action_94 action_977 (389) = happyShift action_95 action_977 (390) = happyShift action_96 action_977 (391) = happyShift action_97 action_977 (396) = happyShift action_98 action_977 (397) = happyShift action_99 action_977 (398) = happyShift action_100 action_977 (399) = happyShift action_101 action_977 (401) = happyShift action_102 action_977 (403) = happyShift action_103 action_977 (404) = happyShift action_104 action_977 (405) = happyShift action_105 action_977 (406) = happyShift action_106 action_977 (407) = happyShift action_107 action_977 (408) = happyShift action_108 action_977 (409) = happyShift action_109 action_977 (38) = happyGoto action_13 action_977 (156) = happyGoto action_16 action_977 (157) = happyGoto action_1127 action_977 (158) = happyGoto action_116 action_977 (159) = happyGoto action_18 action_977 (161) = happyGoto action_19 action_977 (162) = happyGoto action_20 action_977 (163) = happyGoto action_21 action_977 (164) = happyGoto action_22 action_977 (165) = happyGoto action_23 action_977 (166) = happyGoto action_24 action_977 (167) = happyGoto action_25 action_977 (210) = happyGoto action_26 action_977 (217) = happyGoto action_27 action_977 (220) = happyGoto action_28 action_977 (241) = happyGoto action_30 action_977 (242) = happyGoto action_31 action_977 (243) = happyGoto action_117 action_977 (249) = happyGoto action_33 action_977 (251) = happyGoto action_34 action_977 (252) = happyGoto action_35 action_977 (255) = happyGoto action_36 action_977 _ = happyFail action_978 (334) = happyShift action_1126 action_978 _ = happyFail action_979 _ = happyReduce_213 action_980 _ = happyReduce_210 action_981 _ = happyReduce_163 action_982 _ = happyReduce_245 action_983 (267) = happyShift action_38 action_983 (275) = happyShift action_41 action_983 (287) = happyShift action_47 action_983 (291) = happyShift action_405 action_983 (293) = happyShift action_49 action_983 (294) = happyShift action_50 action_983 (295) = happyShift action_51 action_983 (296) = happyShift action_231 action_983 (297) = happyShift action_232 action_983 (298) = happyShift action_233 action_983 (302) = happyShift action_58 action_983 (303) = happyShift action_59 action_983 (304) = happyShift action_60 action_983 (305) = happyShift action_61 action_983 (306) = happyShift action_62 action_983 (309) = happyShift action_64 action_983 (323) = happyShift action_236 action_983 (324) = happyShift action_237 action_983 (346) = happyShift action_238 action_983 (353) = happyShift action_239 action_983 (357) = happyShift action_240 action_983 (359) = happyShift action_241 action_983 (361) = happyShift action_242 action_983 (363) = happyShift action_243 action_983 (370) = happyShift action_244 action_983 (371) = happyShift action_245 action_983 (372) = happyShift action_246 action_983 (376) = happyShift action_247 action_983 (380) = happyShift action_248 action_983 (381) = happyShift action_87 action_983 (383) = happyShift action_249 action_983 (384) = happyShift action_250 action_983 (403) = happyShift action_251 action_983 (404) = happyShift action_252 action_983 (408) = happyShift action_108 action_983 (409) = happyShift action_109 action_983 (108) = happyGoto action_1125 action_983 (111) = happyGoto action_218 action_983 (113) = happyGoto action_400 action_983 (114) = happyGoto action_401 action_983 (116) = happyGoto action_402 action_983 (117) = happyGoto action_403 action_983 (118) = happyGoto action_221 action_983 (156) = happyGoto action_222 action_983 (210) = happyGoto action_404 action_983 (224) = happyGoto action_223 action_983 (225) = happyGoto action_224 action_983 (227) = happyGoto action_225 action_983 (228) = happyGoto action_226 action_983 (237) = happyGoto action_227 action_983 (239) = happyGoto action_228 action_983 (249) = happyGoto action_229 action_983 _ = happyFail action_984 _ = happyReduce_126 action_985 (267) = happyShift action_38 action_985 (275) = happyShift action_41 action_985 (287) = happyShift action_47 action_985 (293) = happyShift action_49 action_985 (294) = happyShift action_50 action_985 (295) = happyShift action_51 action_985 (296) = happyShift action_231 action_985 (297) = happyShift action_232 action_985 (298) = happyShift action_233 action_985 (302) = happyShift action_58 action_985 (303) = happyShift action_59 action_985 (304) = happyShift action_60 action_985 (305) = happyShift action_61 action_985 (306) = happyShift action_62 action_985 (309) = happyShift action_64 action_985 (323) = happyShift action_236 action_985 (324) = happyShift action_237 action_985 (332) = happyShift action_1124 action_985 (346) = happyShift action_238 action_985 (353) = happyShift action_239 action_985 (357) = happyShift action_240 action_985 (359) = happyShift action_241 action_985 (361) = happyShift action_242 action_985 (363) = happyShift action_243 action_985 (370) = happyShift action_244 action_985 (371) = happyShift action_245 action_985 (372) = happyShift action_246 action_985 (376) = happyShift action_247 action_985 (380) = happyShift action_248 action_985 (383) = happyShift action_249 action_985 (384) = happyShift action_250 action_985 (403) = happyShift action_251 action_985 (404) = happyShift action_252 action_985 (408) = happyShift action_108 action_985 (409) = happyShift action_109 action_985 (58) = happyGoto action_1123 action_985 (59) = happyGoto action_1121 action_985 (111) = happyGoto action_218 action_985 (115) = happyGoto action_583 action_985 (117) = happyGoto action_220 action_985 (118) = happyGoto action_221 action_985 (156) = happyGoto action_222 action_985 (224) = happyGoto action_223 action_985 (225) = happyGoto action_224 action_985 (227) = happyGoto action_225 action_985 (228) = happyGoto action_226 action_985 (237) = happyGoto action_227 action_985 (239) = happyGoto action_228 action_985 (249) = happyGoto action_229 action_985 _ = happyFail action_986 (267) = happyShift action_38 action_986 (275) = happyShift action_41 action_986 (287) = happyShift action_47 action_986 (293) = happyShift action_49 action_986 (294) = happyShift action_50 action_986 (295) = happyShift action_51 action_986 (296) = happyShift action_231 action_986 (297) = happyShift action_232 action_986 (298) = happyShift action_233 action_986 (302) = happyShift action_58 action_986 (303) = happyShift action_59 action_986 (304) = happyShift action_60 action_986 (305) = happyShift action_61 action_986 (306) = happyShift action_62 action_986 (309) = happyShift action_64 action_986 (323) = happyShift action_236 action_986 (324) = happyShift action_237 action_986 (332) = happyShift action_1122 action_986 (346) = happyShift action_238 action_986 (353) = happyShift action_239 action_986 (357) = happyShift action_240 action_986 (359) = happyShift action_241 action_986 (361) = happyShift action_242 action_986 (363) = happyShift action_243 action_986 (370) = happyShift action_244 action_986 (371) = happyShift action_245 action_986 (372) = happyShift action_246 action_986 (376) = happyShift action_247 action_986 (380) = happyShift action_248 action_986 (383) = happyShift action_249 action_986 (384) = happyShift action_250 action_986 (403) = happyShift action_251 action_986 (404) = happyShift action_252 action_986 (408) = happyShift action_108 action_986 (409) = happyShift action_109 action_986 (58) = happyGoto action_1120 action_986 (59) = happyGoto action_1121 action_986 (111) = happyGoto action_218 action_986 (115) = happyGoto action_583 action_986 (117) = happyGoto action_220 action_986 (118) = happyGoto action_221 action_986 (156) = happyGoto action_222 action_986 (224) = happyGoto action_223 action_986 (225) = happyGoto action_224 action_986 (227) = happyGoto action_225 action_986 (228) = happyGoto action_226 action_986 (237) = happyGoto action_227 action_986 (239) = happyGoto action_228 action_986 (249) = happyGoto action_229 action_986 _ = happyFail action_987 (393) = happyShift action_155 action_987 (260) = happyGoto action_988 action_987 (264) = happyGoto action_1119 action_987 _ = happyReduce_707 action_988 _ = happyReduce_706 action_989 (392) = happyShift action_154 action_989 (143) = happyGoto action_1118 action_989 (144) = happyGoto action_574 action_989 (259) = happyGoto action_575 action_989 (265) = happyGoto action_576 action_989 _ = happyReduce_709 action_990 _ = happyReduce_310 action_991 (362) = happyShift action_1116 action_991 (368) = happyShift action_1117 action_991 _ = happyFail action_992 _ = happyReduce_340 action_993 (358) = happyShift action_1115 action_993 _ = happyFail action_994 _ = happyReduce_334 action_995 (267) = happyShift action_38 action_995 (275) = happyShift action_41 action_995 (287) = happyShift action_47 action_995 (293) = happyShift action_49 action_995 (294) = happyShift action_50 action_995 (295) = happyShift action_51 action_995 (296) = happyShift action_231 action_995 (297) = happyShift action_232 action_995 (298) = happyShift action_233 action_995 (302) = happyShift action_58 action_995 (303) = happyShift action_59 action_995 (304) = happyShift action_60 action_995 (305) = happyShift action_61 action_995 (306) = happyShift action_62 action_995 (309) = happyShift action_64 action_995 (347) = happyShift action_934 action_995 (357) = happyShift action_935 action_995 (361) = happyShift action_936 action_995 (371) = happyShift action_245 action_995 (372) = happyShift action_246 action_995 (376) = happyShift action_247 action_995 (380) = happyShift action_248 action_995 (129) = happyGoto action_1114 action_995 (130) = happyGoto action_929 action_995 (131) = happyGoto action_930 action_995 (132) = happyGoto action_931 action_995 (227) = happyGoto action_932 action_995 (228) = happyGoto action_226 action_995 (237) = happyGoto action_933 action_995 (239) = happyGoto action_228 action_995 (249) = happyGoto action_229 action_995 _ = happyFail action_996 _ = happyReduce_302 action_997 _ = happyReduce_296 action_998 (362) = happyShift action_1113 action_998 _ = happyFail action_999 _ = happyReduce_185 action_1000 (266) = happyShift action_37 action_1000 (267) = happyShift action_38 action_1000 (268) = happyShift action_39 action_1000 (270) = happyShift action_918 action_1000 (273) = happyShift action_40 action_1000 (275) = happyShift action_41 action_1000 (276) = happyShift action_42 action_1000 (279) = happyShift action_43 action_1000 (280) = happyShift action_44 action_1000 (281) = happyShift action_45 action_1000 (283) = happyShift action_46 action_1000 (285) = happyShift action_142 action_1000 (287) = happyShift action_47 action_1000 (289) = happyShift action_919 action_1000 (291) = happyShift action_48 action_1000 (293) = happyShift action_49 action_1000 (294) = happyShift action_50 action_1000 (295) = happyShift action_51 action_1000 (296) = happyShift action_52 action_1000 (297) = happyShift action_53 action_1000 (298) = happyShift action_54 action_1000 (299) = happyShift action_55 action_1000 (300) = happyShift action_56 action_1000 (301) = happyShift action_57 action_1000 (302) = happyShift action_58 action_1000 (303) = happyShift action_59 action_1000 (304) = happyShift action_60 action_1000 (305) = happyShift action_61 action_1000 (306) = happyShift action_62 action_1000 (307) = happyShift action_63 action_1000 (309) = happyShift action_64 action_1000 (312) = happyShift action_145 action_1000 (313) = happyShift action_65 action_1000 (314) = happyShift action_66 action_1000 (315) = happyShift action_67 action_1000 (318) = happyShift action_68 action_1000 (319) = happyShift action_69 action_1000 (320) = happyShift action_70 action_1000 (329) = happyShift action_71 action_1000 (336) = happyShift action_72 action_1000 (342) = happyShift action_73 action_1000 (345) = happyShift action_74 action_1000 (346) = happyShift action_153 action_1000 (357) = happyShift action_75 action_1000 (359) = happyShift action_76 action_1000 (361) = happyShift action_77 action_1000 (363) = happyShift action_78 action_1000 (365) = happyShift action_79 action_1000 (370) = happyShift action_80 action_1000 (371) = happyShift action_81 action_1000 (372) = happyShift action_82 action_1000 (375) = happyShift action_83 action_1000 (376) = happyShift action_84 action_1000 (379) = happyShift action_85 action_1000 (380) = happyShift action_86 action_1000 (381) = happyShift action_87 action_1000 (382) = happyShift action_88 action_1000 (383) = happyShift action_89 action_1000 (384) = happyShift action_90 action_1000 (385) = happyShift action_91 action_1000 (386) = happyShift action_92 action_1000 (387) = happyShift action_93 action_1000 (388) = happyShift action_94 action_1000 (389) = happyShift action_95 action_1000 (390) = happyShift action_96 action_1000 (391) = happyShift action_97 action_1000 (392) = happyShift action_154 action_1000 (393) = happyShift action_155 action_1000 (394) = happyShift action_156 action_1000 (395) = happyShift action_157 action_1000 (396) = happyShift action_98 action_1000 (397) = happyShift action_99 action_1000 (398) = happyShift action_100 action_1000 (399) = happyShift action_101 action_1000 (401) = happyShift action_102 action_1000 (403) = happyShift action_103 action_1000 (404) = happyShift action_104 action_1000 (405) = happyShift action_105 action_1000 (406) = happyShift action_106 action_1000 (407) = happyShift action_107 action_1000 (408) = happyShift action_108 action_1000 (409) = happyShift action_109 action_1000 (38) = happyGoto action_13 action_1000 (49) = happyGoto action_14 action_1000 (62) = happyGoto action_913 action_1000 (63) = happyGoto action_914 action_1000 (72) = happyGoto action_126 action_1000 (79) = happyGoto action_1112 action_1000 (146) = happyGoto action_128 action_1000 (147) = happyGoto action_129 action_1000 (148) = happyGoto action_627 action_1000 (149) = happyGoto action_917 action_1000 (153) = happyGoto action_131 action_1000 (156) = happyGoto action_16 action_1000 (158) = happyGoto action_629 action_1000 (159) = happyGoto action_18 action_1000 (161) = happyGoto action_19 action_1000 (162) = happyGoto action_20 action_1000 (163) = happyGoto action_21 action_1000 (164) = happyGoto action_22 action_1000 (165) = happyGoto action_23 action_1000 (166) = happyGoto action_24 action_1000 (167) = happyGoto action_630 action_1000 (210) = happyGoto action_26 action_1000 (217) = happyGoto action_27 action_1000 (220) = happyGoto action_28 action_1000 (240) = happyGoto action_29 action_1000 (241) = happyGoto action_30 action_1000 (242) = happyGoto action_31 action_1000 (243) = happyGoto action_32 action_1000 (249) = happyGoto action_33 action_1000 (251) = happyGoto action_34 action_1000 (252) = happyGoto action_35 action_1000 (255) = happyGoto action_36 action_1000 (259) = happyGoto action_133 action_1000 (260) = happyGoto action_134 action_1000 (261) = happyGoto action_135 action_1000 (262) = happyGoto action_136 action_1000 _ = happyReduce_182 action_1001 _ = happyReduce_142 action_1002 _ = happyReduce_186 action_1003 (267) = happyShift action_38 action_1003 (275) = happyShift action_41 action_1003 (287) = happyShift action_47 action_1003 (293) = happyShift action_49 action_1003 (294) = happyShift action_50 action_1003 (295) = happyShift action_51 action_1003 (296) = happyShift action_231 action_1003 (297) = happyShift action_232 action_1003 (298) = happyShift action_233 action_1003 (302) = happyShift action_58 action_1003 (303) = happyShift action_59 action_1003 (304) = happyShift action_60 action_1003 (305) = happyShift action_61 action_1003 (306) = happyShift action_62 action_1003 (309) = happyShift action_64 action_1003 (323) = happyShift action_236 action_1003 (324) = happyShift action_237 action_1003 (346) = happyShift action_238 action_1003 (353) = happyShift action_239 action_1003 (357) = happyShift action_240 action_1003 (359) = happyShift action_241 action_1003 (361) = happyShift action_242 action_1003 (363) = happyShift action_243 action_1003 (370) = happyShift action_244 action_1003 (371) = happyShift action_245 action_1003 (372) = happyShift action_246 action_1003 (376) = happyShift action_247 action_1003 (380) = happyShift action_248 action_1003 (383) = happyShift action_249 action_1003 (384) = happyShift action_250 action_1003 (403) = happyShift action_251 action_1003 (404) = happyShift action_252 action_1003 (408) = happyShift action_108 action_1003 (409) = happyShift action_109 action_1003 (65) = happyGoto action_1111 action_1003 (111) = happyGoto action_218 action_1003 (114) = happyGoto action_265 action_1003 (115) = happyGoto action_266 action_1003 (117) = happyGoto action_257 action_1003 (118) = happyGoto action_221 action_1003 (156) = happyGoto action_222 action_1003 (224) = happyGoto action_223 action_1003 (225) = happyGoto action_224 action_1003 (227) = happyGoto action_225 action_1003 (228) = happyGoto action_226 action_1003 (237) = happyGoto action_227 action_1003 (239) = happyGoto action_228 action_1003 (249) = happyGoto action_229 action_1003 _ = happyFail action_1004 (362) = happyShift action_1110 action_1004 _ = happyFail action_1005 _ = happyReduce_326 action_1006 (267) = happyShift action_38 action_1006 (275) = happyShift action_41 action_1006 (287) = happyShift action_47 action_1006 (293) = happyShift action_49 action_1006 (294) = happyShift action_50 action_1006 (295) = happyShift action_51 action_1006 (296) = happyShift action_231 action_1006 (297) = happyShift action_232 action_1006 (298) = happyShift action_233 action_1006 (302) = happyShift action_58 action_1006 (303) = happyShift action_59 action_1006 (304) = happyShift action_60 action_1006 (305) = happyShift action_61 action_1006 (306) = happyShift action_62 action_1006 (309) = happyShift action_64 action_1006 (371) = happyShift action_245 action_1006 (237) = happyGoto action_907 action_1006 (239) = happyGoto action_228 action_1006 (249) = happyGoto action_229 action_1006 _ = happyReduce_328 action_1007 _ = happyReduce_168 action_1008 _ = happyReduce_173 action_1009 (1) = happyShift action_424 action_1009 (356) = happyShift action_425 action_1009 (367) = happyShift action_1101 action_1009 (256) = happyGoto action_1109 action_1009 _ = happyFail action_1010 _ = happyReduce_169 action_1011 (300) = happyShift action_1108 action_1011 (61) = happyGoto action_1107 action_1011 _ = happyReduce_140 action_1012 (266) = happyShift action_37 action_1012 (267) = happyShift action_38 action_1012 (268) = happyShift action_39 action_1012 (273) = happyShift action_40 action_1012 (275) = happyShift action_41 action_1012 (276) = happyShift action_42 action_1012 (283) = happyShift action_46 action_1012 (287) = happyShift action_47 action_1012 (291) = happyShift action_48 action_1012 (293) = happyShift action_49 action_1012 (294) = happyShift action_50 action_1012 (295) = happyShift action_51 action_1012 (296) = happyShift action_52 action_1012 (297) = happyShift action_53 action_1012 (298) = happyShift action_54 action_1012 (299) = happyShift action_55 action_1012 (300) = happyShift action_56 action_1012 (301) = happyShift action_57 action_1012 (302) = happyShift action_58 action_1012 (303) = happyShift action_59 action_1012 (304) = happyShift action_60 action_1012 (305) = happyShift action_61 action_1012 (306) = happyShift action_62 action_1012 (307) = happyShift action_63 action_1012 (309) = happyShift action_64 action_1012 (318) = happyShift action_68 action_1012 (319) = happyShift action_69 action_1012 (320) = happyShift action_70 action_1012 (336) = happyShift action_72 action_1012 (342) = happyShift action_73 action_1012 (345) = happyShift action_74 action_1012 (357) = happyShift action_75 action_1012 (359) = happyShift action_76 action_1012 (361) = happyShift action_118 action_1012 (363) = happyShift action_78 action_1012 (365) = happyShift action_79 action_1012 (370) = happyShift action_80 action_1012 (371) = happyShift action_81 action_1012 (372) = happyShift action_82 action_1012 (375) = happyShift action_83 action_1012 (376) = happyShift action_84 action_1012 (379) = happyShift action_85 action_1012 (380) = happyShift action_86 action_1012 (381) = happyShift action_87 action_1012 (382) = happyShift action_88 action_1012 (383) = happyShift action_89 action_1012 (384) = happyShift action_90 action_1012 (385) = happyShift action_91 action_1012 (386) = happyShift action_92 action_1012 (387) = happyShift action_93 action_1012 (388) = happyShift action_94 action_1012 (389) = happyShift action_95 action_1012 (390) = happyShift action_96 action_1012 (391) = happyShift action_97 action_1012 (396) = happyShift action_98 action_1012 (397) = happyShift action_99 action_1012 (398) = happyShift action_100 action_1012 (399) = happyShift action_101 action_1012 (401) = happyShift action_102 action_1012 (403) = happyShift action_103 action_1012 (404) = happyShift action_104 action_1012 (405) = happyShift action_105 action_1012 (406) = happyShift action_106 action_1012 (407) = happyShift action_107 action_1012 (408) = happyShift action_108 action_1012 (409) = happyShift action_109 action_1012 (38) = happyGoto action_13 action_1012 (156) = happyGoto action_16 action_1012 (158) = happyGoto action_1106 action_1012 (159) = happyGoto action_18 action_1012 (161) = happyGoto action_19 action_1012 (162) = happyGoto action_20 action_1012 (163) = happyGoto action_21 action_1012 (164) = happyGoto action_22 action_1012 (165) = happyGoto action_23 action_1012 (166) = happyGoto action_24 action_1012 (167) = happyGoto action_25 action_1012 (210) = happyGoto action_26 action_1012 (217) = happyGoto action_27 action_1012 (220) = happyGoto action_28 action_1012 (241) = happyGoto action_30 action_1012 (242) = happyGoto action_31 action_1012 (243) = happyGoto action_117 action_1012 (249) = happyGoto action_33 action_1012 (251) = happyGoto action_34 action_1012 (252) = happyGoto action_35 action_1012 (255) = happyGoto action_36 action_1012 _ = happyFail action_1013 (267) = happyShift action_38 action_1013 (275) = happyShift action_41 action_1013 (282) = happyShift action_1104 action_1013 (287) = happyShift action_47 action_1013 (293) = happyShift action_49 action_1013 (294) = happyShift action_50 action_1013 (295) = happyShift action_51 action_1013 (296) = happyShift action_231 action_1013 (297) = happyShift action_232 action_1013 (298) = happyShift action_233 action_1013 (300) = happyShift action_1105 action_1013 (302) = happyShift action_58 action_1013 (303) = happyShift action_59 action_1013 (304) = happyShift action_60 action_1013 (305) = happyShift action_61 action_1013 (306) = happyShift action_62 action_1013 (309) = happyShift action_64 action_1013 (323) = happyShift action_236 action_1013 (324) = happyShift action_237 action_1013 (346) = happyShift action_238 action_1013 (353) = happyShift action_239 action_1013 (357) = happyShift action_240 action_1013 (359) = happyShift action_241 action_1013 (361) = happyShift action_242 action_1013 (363) = happyShift action_243 action_1013 (370) = happyShift action_244 action_1013 (371) = happyShift action_245 action_1013 (372) = happyShift action_246 action_1013 (376) = happyShift action_247 action_1013 (380) = happyShift action_248 action_1013 (383) = happyShift action_249 action_1013 (384) = happyShift action_250 action_1013 (403) = happyShift action_251 action_1013 (404) = happyShift action_252 action_1013 (408) = happyShift action_108 action_1013 (409) = happyShift action_109 action_1013 (59) = happyGoto action_1102 action_1013 (111) = happyGoto action_218 action_1013 (115) = happyGoto action_1103 action_1013 (117) = happyGoto action_220 action_1013 (118) = happyGoto action_221 action_1013 (156) = happyGoto action_222 action_1013 (224) = happyGoto action_223 action_1013 (225) = happyGoto action_224 action_1013 (227) = happyGoto action_225 action_1013 (228) = happyGoto action_226 action_1013 (237) = happyGoto action_227 action_1013 (239) = happyGoto action_228 action_1013 (249) = happyGoto action_229 action_1013 _ = happyFail action_1014 (354) = happyShift action_1100 action_1014 (367) = happyShift action_1101 action_1014 _ = happyFail action_1015 _ = happyReduce_387 action_1016 _ = happyReduce_265 action_1017 _ = happyReduce_281 action_1018 _ = happyReduce_283 action_1019 _ = happyReduce_285 action_1020 (335) = happyReduce_277 action_1020 (338) = happyReduce_277 action_1020 _ = happyReduce_288 action_1021 (335) = happyReduce_276 action_1021 (338) = happyReduce_276 action_1021 _ = happyReduce_287 action_1022 (357) = happyShift action_199 action_1022 (361) = happyShift action_1097 action_1022 (363) = happyShift action_201 action_1022 (372) = happyShift action_1098 action_1022 (376) = happyShift action_247 action_1022 (380) = happyShift action_248 action_1022 (135) = happyGoto action_1099 action_1022 (136) = happyGoto action_1093 action_1022 (218) = happyGoto action_1094 action_1022 (219) = happyGoto action_1095 action_1022 (220) = happyGoto action_193 action_1022 (225) = happyGoto action_1096 action_1022 (227) = happyGoto action_225 action_1022 (228) = happyGoto action_226 action_1022 (252) = happyGoto action_196 action_1022 _ = happyReduce_350 action_1023 (357) = happyShift action_199 action_1023 (361) = happyShift action_1097 action_1023 (363) = happyShift action_201 action_1023 (372) = happyShift action_1098 action_1023 (376) = happyShift action_247 action_1023 (380) = happyShift action_248 action_1023 (135) = happyGoto action_1092 action_1023 (136) = happyGoto action_1093 action_1023 (218) = happyGoto action_1094 action_1023 (219) = happyGoto action_1095 action_1023 (220) = happyGoto action_193 action_1023 (225) = happyGoto action_1096 action_1023 (227) = happyGoto action_225 action_1023 (228) = happyGoto action_226 action_1023 (252) = happyGoto action_196 action_1023 _ = happyReduce_350 action_1024 _ = happyReduce_119 action_1025 _ = happyReduce_368 action_1026 (267) = happyShift action_38 action_1026 (275) = happyShift action_41 action_1026 (287) = happyShift action_47 action_1026 (291) = happyShift action_260 action_1026 (293) = happyShift action_49 action_1026 (294) = happyShift action_50 action_1026 (295) = happyShift action_51 action_1026 (296) = happyShift action_231 action_1026 (297) = happyShift action_232 action_1026 (298) = happyShift action_233 action_1026 (302) = happyShift action_58 action_1026 (303) = happyShift action_59 action_1026 (304) = happyShift action_60 action_1026 (305) = happyShift action_61 action_1026 (306) = happyShift action_62 action_1026 (309) = happyShift action_64 action_1026 (323) = happyShift action_236 action_1026 (324) = happyShift action_237 action_1026 (346) = happyShift action_238 action_1026 (353) = happyShift action_239 action_1026 (357) = happyShift action_240 action_1026 (359) = happyShift action_241 action_1026 (361) = happyShift action_242 action_1026 (362) = happyShift action_1091 action_1026 (363) = happyShift action_243 action_1026 (370) = happyShift action_244 action_1026 (371) = happyShift action_245 action_1026 (372) = happyShift action_246 action_1026 (376) = happyShift action_247 action_1026 (380) = happyShift action_248 action_1026 (381) = happyShift action_87 action_1026 (383) = happyShift action_249 action_1026 (384) = happyShift action_250 action_1026 (403) = happyShift action_251 action_1026 (404) = happyShift action_252 action_1026 (408) = happyShift action_108 action_1026 (409) = happyShift action_109 action_1026 (107) = happyGoto action_253 action_1026 (111) = happyGoto action_218 action_1026 (112) = happyGoto action_254 action_1026 (114) = happyGoto action_255 action_1026 (115) = happyGoto action_256 action_1026 (117) = happyGoto action_257 action_1026 (118) = happyGoto action_221 action_1026 (119) = happyGoto action_1089 action_1026 (120) = happyGoto action_1090 action_1026 (156) = happyGoto action_222 action_1026 (210) = happyGoto action_259 action_1026 (224) = happyGoto action_223 action_1026 (225) = happyGoto action_224 action_1026 (227) = happyGoto action_225 action_1026 (228) = happyGoto action_226 action_1026 (237) = happyGoto action_227 action_1026 (239) = happyGoto action_228 action_1026 (249) = happyGoto action_229 action_1026 _ = happyFail action_1027 (338) = happyReduce_709 action_1027 (392) = happyShift action_154 action_1027 (259) = happyGoto action_575 action_1027 (265) = happyGoto action_1088 action_1027 _ = happyReduce_353 action_1028 _ = happyReduce_355 action_1029 (291) = happyShift action_1087 action_1029 (140) = happyGoto action_1086 action_1029 _ = happyReduce_359 action_1030 _ = happyReduce_123 action_1031 (272) = happyShift action_890 action_1031 (145) = happyGoto action_1085 action_1031 _ = happyReduce_367 action_1032 (362) = happyShift action_1084 action_1032 _ = happyFail action_1033 _ = happyReduce_44 action_1034 (267) = happyShift action_38 action_1034 (275) = happyShift action_41 action_1034 (284) = happyShift action_1080 action_1034 (287) = happyShift action_47 action_1034 (289) = happyShift action_1081 action_1034 (291) = happyShift action_48 action_1034 (293) = happyShift action_49 action_1034 (294) = happyShift action_50 action_1034 (295) = happyShift action_51 action_1034 (296) = happyShift action_52 action_1034 (297) = happyShift action_53 action_1034 (298) = happyShift action_54 action_1034 (300) = happyShift action_56 action_1034 (301) = happyShift action_57 action_1034 (302) = happyShift action_58 action_1034 (303) = happyShift action_59 action_1034 (304) = happyShift action_60 action_1034 (305) = happyShift action_61 action_1034 (306) = happyShift action_62 action_1034 (309) = happyShift action_64 action_1034 (312) = happyShift action_1082 action_1034 (357) = happyShift action_199 action_1034 (361) = happyShift action_333 action_1034 (363) = happyShift action_201 action_1034 (368) = happyShift action_1083 action_1034 (371) = happyShift action_81 action_1034 (372) = happyShift action_82 action_1034 (375) = happyShift action_83 action_1034 (376) = happyShift action_84 action_1034 (379) = happyShift action_85 action_1034 (380) = happyShift action_86 action_1034 (34) = happyGoto action_1077 action_1034 (37) = happyGoto action_1078 action_1034 (38) = happyGoto action_1079 action_1034 (217) = happyGoto action_27 action_1034 (220) = happyGoto action_28 action_1034 (241) = happyGoto action_335 action_1034 (242) = happyGoto action_31 action_1034 (243) = happyGoto action_117 action_1034 (249) = happyGoto action_33 action_1034 (251) = happyGoto action_34 action_1034 (252) = happyGoto action_35 action_1034 _ = happyReduce_47 action_1035 (392) = happyShift action_154 action_1035 (394) = happyShift action_156 action_1035 (395) = happyShift action_157 action_1035 (32) = happyGoto action_1076 action_1035 (33) = happyGoto action_1035 action_1035 (259) = happyGoto action_1036 action_1035 (261) = happyGoto action_1037 action_1035 (262) = happyGoto action_1038 action_1035 _ = happyReduce_49 action_1036 _ = happyReduce_52 action_1037 _ = happyReduce_51 action_1038 _ = happyReduce_50 action_1039 (353) = happyShift action_1074 action_1039 (355) = happyShift action_1075 action_1039 (22) = happyGoto action_1073 action_1039 _ = happyFail action_1040 _ = happyReduce_24 action_1041 _ = happyReduce_25 action_1042 _ = happyReduce_505 action_1043 _ = happyReduce_493 action_1044 _ = happyReduce_494 action_1045 _ = happyReduce_491 action_1046 (266) = happyShift action_37 action_1046 (267) = happyShift action_38 action_1046 (268) = happyShift action_39 action_1046 (273) = happyShift action_40 action_1046 (275) = happyShift action_41 action_1046 (276) = happyShift action_42 action_1046 (283) = happyShift action_46 action_1046 (287) = happyShift action_47 action_1046 (291) = happyShift action_48 action_1046 (293) = happyShift action_49 action_1046 (294) = happyShift action_50 action_1046 (295) = happyShift action_51 action_1046 (296) = happyShift action_52 action_1046 (297) = happyShift action_53 action_1046 (298) = happyShift action_54 action_1046 (299) = happyShift action_55 action_1046 (300) = happyShift action_56 action_1046 (301) = happyShift action_57 action_1046 (302) = happyShift action_58 action_1046 (303) = happyShift action_59 action_1046 (304) = happyShift action_60 action_1046 (305) = happyShift action_61 action_1046 (306) = happyShift action_62 action_1046 (307) = happyShift action_63 action_1046 (309) = happyShift action_64 action_1046 (318) = happyShift action_68 action_1046 (319) = happyShift action_69 action_1046 (320) = happyShift action_70 action_1046 (336) = happyShift action_72 action_1046 (342) = happyShift action_73 action_1046 (345) = happyShift action_74 action_1046 (357) = happyShift action_75 action_1046 (359) = happyShift action_76 action_1046 (361) = happyShift action_118 action_1046 (363) = happyShift action_78 action_1046 (365) = happyShift action_79 action_1046 (370) = happyShift action_80 action_1046 (371) = happyShift action_81 action_1046 (372) = happyShift action_82 action_1046 (375) = happyShift action_83 action_1046 (376) = happyShift action_84 action_1046 (379) = happyShift action_85 action_1046 (380) = happyShift action_86 action_1046 (381) = happyShift action_87 action_1046 (382) = happyShift action_88 action_1046 (383) = happyShift action_89 action_1046 (384) = happyShift action_90 action_1046 (385) = happyShift action_91 action_1046 (386) = happyShift action_92 action_1046 (387) = happyShift action_93 action_1046 (388) = happyShift action_94 action_1046 (389) = happyShift action_95 action_1046 (390) = happyShift action_96 action_1046 (391) = happyShift action_97 action_1046 (396) = happyShift action_98 action_1046 (397) = happyShift action_99 action_1046 (398) = happyShift action_100 action_1046 (399) = happyShift action_101 action_1046 (401) = happyShift action_102 action_1046 (403) = happyShift action_103 action_1046 (404) = happyShift action_104 action_1046 (405) = happyShift action_105 action_1046 (406) = happyShift action_106 action_1046 (407) = happyShift action_107 action_1046 (408) = happyShift action_108 action_1046 (409) = happyShift action_109 action_1046 (38) = happyGoto action_13 action_1046 (156) = happyGoto action_16 action_1046 (157) = happyGoto action_1072 action_1046 (158) = happyGoto action_116 action_1046 (159) = happyGoto action_18 action_1046 (161) = happyGoto action_19 action_1046 (162) = happyGoto action_20 action_1046 (163) = happyGoto action_21 action_1046 (164) = happyGoto action_22 action_1046 (165) = happyGoto action_23 action_1046 (166) = happyGoto action_24 action_1046 (167) = happyGoto action_25 action_1046 (210) = happyGoto action_26 action_1046 (217) = happyGoto action_27 action_1046 (220) = happyGoto action_28 action_1046 (241) = happyGoto action_30 action_1046 (242) = happyGoto action_31 action_1046 (243) = happyGoto action_117 action_1046 (249) = happyGoto action_33 action_1046 (251) = happyGoto action_34 action_1046 (252) = happyGoto action_35 action_1046 (255) = happyGoto action_36 action_1046 _ = happyFail action_1047 (266) = happyShift action_37 action_1047 (267) = happyShift action_38 action_1047 (268) = happyShift action_39 action_1047 (273) = happyShift action_40 action_1047 (275) = happyShift action_41 action_1047 (276) = happyShift action_42 action_1047 (283) = happyShift action_46 action_1047 (287) = happyShift action_47 action_1047 (291) = happyShift action_48 action_1047 (293) = happyShift action_49 action_1047 (294) = happyShift action_50 action_1047 (295) = happyShift action_51 action_1047 (296) = happyShift action_52 action_1047 (297) = happyShift action_53 action_1047 (298) = happyShift action_54 action_1047 (299) = happyShift action_55 action_1047 (300) = happyShift action_56 action_1047 (301) = happyShift action_57 action_1047 (302) = happyShift action_58 action_1047 (303) = happyShift action_59 action_1047 (304) = happyShift action_60 action_1047 (305) = happyShift action_61 action_1047 (306) = happyShift action_62 action_1047 (307) = happyShift action_63 action_1047 (309) = happyShift action_64 action_1047 (318) = happyShift action_68 action_1047 (319) = happyShift action_69 action_1047 (320) = happyShift action_70 action_1047 (336) = happyShift action_72 action_1047 (342) = happyShift action_73 action_1047 (345) = happyShift action_74 action_1047 (357) = happyShift action_75 action_1047 (359) = happyShift action_76 action_1047 (361) = happyShift action_118 action_1047 (363) = happyShift action_78 action_1047 (365) = happyShift action_79 action_1047 (370) = happyShift action_80 action_1047 (371) = happyShift action_81 action_1047 (372) = happyShift action_82 action_1047 (375) = happyShift action_83 action_1047 (376) = happyShift action_84 action_1047 (379) = happyShift action_85 action_1047 (380) = happyShift action_86 action_1047 (381) = happyShift action_87 action_1047 (382) = happyShift action_88 action_1047 (383) = happyShift action_89 action_1047 (384) = happyShift action_90 action_1047 (385) = happyShift action_91 action_1047 (386) = happyShift action_92 action_1047 (387) = happyShift action_93 action_1047 (388) = happyShift action_94 action_1047 (389) = happyShift action_95 action_1047 (390) = happyShift action_96 action_1047 (391) = happyShift action_97 action_1047 (396) = happyShift action_98 action_1047 (397) = happyShift action_99 action_1047 (398) = happyShift action_100 action_1047 (399) = happyShift action_101 action_1047 (401) = happyShift action_102 action_1047 (403) = happyShift action_103 action_1047 (404) = happyShift action_104 action_1047 (405) = happyShift action_105 action_1047 (406) = happyShift action_106 action_1047 (407) = happyShift action_107 action_1047 (408) = happyShift action_108 action_1047 (409) = happyShift action_109 action_1047 (38) = happyGoto action_13 action_1047 (156) = happyGoto action_16 action_1047 (157) = happyGoto action_1071 action_1047 (158) = happyGoto action_116 action_1047 (159) = happyGoto action_18 action_1047 (161) = happyGoto action_19 action_1047 (162) = happyGoto action_20 action_1047 (163) = happyGoto action_21 action_1047 (164) = happyGoto action_22 action_1047 (165) = happyGoto action_23 action_1047 (166) = happyGoto action_24 action_1047 (167) = happyGoto action_25 action_1047 (210) = happyGoto action_26 action_1047 (217) = happyGoto action_27 action_1047 (220) = happyGoto action_28 action_1047 (241) = happyGoto action_30 action_1047 (242) = happyGoto action_31 action_1047 (243) = happyGoto action_117 action_1047 (249) = happyGoto action_33 action_1047 (251) = happyGoto action_34 action_1047 (252) = happyGoto action_35 action_1047 (255) = happyGoto action_36 action_1047 _ = happyFail action_1048 (266) = happyShift action_37 action_1048 (267) = happyShift action_38 action_1048 (268) = happyShift action_39 action_1048 (273) = happyShift action_40 action_1048 (275) = happyShift action_41 action_1048 (276) = happyShift action_42 action_1048 (283) = happyShift action_46 action_1048 (287) = happyShift action_47 action_1048 (291) = happyShift action_48 action_1048 (293) = happyShift action_49 action_1048 (294) = happyShift action_50 action_1048 (295) = happyShift action_51 action_1048 (296) = happyShift action_52 action_1048 (297) = happyShift action_53 action_1048 (298) = happyShift action_54 action_1048 (299) = happyShift action_55 action_1048 (300) = happyShift action_56 action_1048 (301) = happyShift action_57 action_1048 (302) = happyShift action_58 action_1048 (303) = happyShift action_59 action_1048 (304) = happyShift action_60 action_1048 (305) = happyShift action_61 action_1048 (306) = happyShift action_62 action_1048 (307) = happyShift action_63 action_1048 (309) = happyShift action_64 action_1048 (318) = happyShift action_68 action_1048 (319) = happyShift action_69 action_1048 (320) = happyShift action_70 action_1048 (336) = happyShift action_72 action_1048 (342) = happyShift action_73 action_1048 (345) = happyShift action_74 action_1048 (357) = happyShift action_75 action_1048 (359) = happyShift action_76 action_1048 (361) = happyShift action_118 action_1048 (363) = happyShift action_78 action_1048 (365) = happyShift action_79 action_1048 (370) = happyShift action_80 action_1048 (371) = happyShift action_81 action_1048 (372) = happyShift action_82 action_1048 (375) = happyShift action_83 action_1048 (376) = happyShift action_84 action_1048 (379) = happyShift action_85 action_1048 (380) = happyShift action_86 action_1048 (381) = happyShift action_87 action_1048 (382) = happyShift action_88 action_1048 (383) = happyShift action_89 action_1048 (384) = happyShift action_90 action_1048 (385) = happyShift action_91 action_1048 (386) = happyShift action_92 action_1048 (387) = happyShift action_93 action_1048 (388) = happyShift action_94 action_1048 (389) = happyShift action_95 action_1048 (390) = happyShift action_96 action_1048 (391) = happyShift action_97 action_1048 (396) = happyShift action_98 action_1048 (397) = happyShift action_99 action_1048 (398) = happyShift action_100 action_1048 (399) = happyShift action_101 action_1048 (401) = happyShift action_102 action_1048 (403) = happyShift action_103 action_1048 (404) = happyShift action_104 action_1048 (405) = happyShift action_105 action_1048 (406) = happyShift action_106 action_1048 (407) = happyShift action_107 action_1048 (408) = happyShift action_108 action_1048 (409) = happyShift action_109 action_1048 (38) = happyGoto action_13 action_1048 (156) = happyGoto action_16 action_1048 (157) = happyGoto action_1070 action_1048 (158) = happyGoto action_116 action_1048 (159) = happyGoto action_18 action_1048 (161) = happyGoto action_19 action_1048 (162) = happyGoto action_20 action_1048 (163) = happyGoto action_21 action_1048 (164) = happyGoto action_22 action_1048 (165) = happyGoto action_23 action_1048 (166) = happyGoto action_24 action_1048 (167) = happyGoto action_25 action_1048 (210) = happyGoto action_26 action_1048 (217) = happyGoto action_27 action_1048 (220) = happyGoto action_28 action_1048 (241) = happyGoto action_30 action_1048 (242) = happyGoto action_31 action_1048 (243) = happyGoto action_117 action_1048 (249) = happyGoto action_33 action_1048 (251) = happyGoto action_34 action_1048 (252) = happyGoto action_35 action_1048 (255) = happyGoto action_36 action_1048 _ = happyFail action_1049 _ = happyReduce_486 action_1050 _ = happyReduce_410 action_1051 _ = happyReduce_516 action_1052 _ = happyReduce_519 action_1053 (290) = happyShift action_743 action_1053 (86) = happyGoto action_1069 action_1053 _ = happyReduce_199 action_1054 (338) = happyShift action_379 action_1054 (194) = happyGoto action_1068 action_1054 _ = happyReduce_522 action_1055 _ = happyReduce_524 action_1056 (266) = happyShift action_37 action_1056 (267) = happyShift action_38 action_1056 (268) = happyShift action_39 action_1056 (273) = happyShift action_40 action_1056 (275) = happyShift action_41 action_1056 (276) = happyShift action_42 action_1056 (283) = happyShift action_46 action_1056 (287) = happyShift action_47 action_1056 (291) = happyShift action_48 action_1056 (293) = happyShift action_49 action_1056 (294) = happyShift action_50 action_1056 (295) = happyShift action_51 action_1056 (296) = happyShift action_52 action_1056 (297) = happyShift action_53 action_1056 (298) = happyShift action_54 action_1056 (299) = happyShift action_55 action_1056 (300) = happyShift action_56 action_1056 (301) = happyShift action_57 action_1056 (302) = happyShift action_58 action_1056 (303) = happyShift action_59 action_1056 (304) = happyShift action_60 action_1056 (305) = happyShift action_61 action_1056 (306) = happyShift action_62 action_1056 (307) = happyShift action_63 action_1056 (309) = happyShift action_64 action_1056 (318) = happyShift action_68 action_1056 (319) = happyShift action_69 action_1056 (320) = happyShift action_70 action_1056 (336) = happyShift action_72 action_1056 (342) = happyShift action_73 action_1056 (345) = happyShift action_74 action_1056 (357) = happyShift action_75 action_1056 (359) = happyShift action_76 action_1056 (361) = happyShift action_118 action_1056 (363) = happyShift action_78 action_1056 (365) = happyShift action_79 action_1056 (370) = happyShift action_80 action_1056 (371) = happyShift action_81 action_1056 (372) = happyShift action_82 action_1056 (375) = happyShift action_83 action_1056 (376) = happyShift action_84 action_1056 (379) = happyShift action_85 action_1056 (380) = happyShift action_86 action_1056 (381) = happyShift action_87 action_1056 (382) = happyShift action_88 action_1056 (383) = happyShift action_89 action_1056 (384) = happyShift action_90 action_1056 (385) = happyShift action_91 action_1056 (386) = happyShift action_92 action_1056 (387) = happyShift action_93 action_1056 (388) = happyShift action_94 action_1056 (389) = happyShift action_95 action_1056 (390) = happyShift action_96 action_1056 (391) = happyShift action_97 action_1056 (396) = happyShift action_98 action_1056 (397) = happyShift action_99 action_1056 (398) = happyShift action_100 action_1056 (399) = happyShift action_101 action_1056 (401) = happyShift action_102 action_1056 (403) = happyShift action_103 action_1056 (404) = happyShift action_104 action_1056 (405) = happyShift action_105 action_1056 (406) = happyShift action_106 action_1056 (407) = happyShift action_107 action_1056 (408) = happyShift action_108 action_1056 (409) = happyShift action_109 action_1056 (38) = happyGoto action_13 action_1056 (156) = happyGoto action_16 action_1056 (157) = happyGoto action_1067 action_1056 (158) = happyGoto action_116 action_1056 (159) = happyGoto action_18 action_1056 (161) = happyGoto action_19 action_1056 (162) = happyGoto action_20 action_1056 (163) = happyGoto action_21 action_1056 (164) = happyGoto action_22 action_1056 (165) = happyGoto action_23 action_1056 (166) = happyGoto action_24 action_1056 (167) = happyGoto action_25 action_1056 (210) = happyGoto action_26 action_1056 (217) = happyGoto action_27 action_1056 (220) = happyGoto action_28 action_1056 (241) = happyGoto action_30 action_1056 (242) = happyGoto action_31 action_1056 (243) = happyGoto action_117 action_1056 (249) = happyGoto action_33 action_1056 (251) = happyGoto action_34 action_1056 (252) = happyGoto action_35 action_1056 (255) = happyGoto action_36 action_1056 _ = happyFail action_1057 (384) = happyShift action_1066 action_1057 _ = happyFail action_1058 _ = happyReduce_393 action_1059 _ = happyReduce_392 action_1060 (267) = happyShift action_38 action_1060 (275) = happyShift action_41 action_1060 (287) = happyShift action_47 action_1060 (291) = happyShift action_260 action_1060 (293) = happyShift action_49 action_1060 (294) = happyShift action_50 action_1060 (295) = happyShift action_51 action_1060 (296) = happyShift action_231 action_1060 (297) = happyShift action_232 action_1060 (298) = happyShift action_233 action_1060 (302) = happyShift action_58 action_1060 (303) = happyShift action_59 action_1060 (304) = happyShift action_60 action_1060 (305) = happyShift action_61 action_1060 (306) = happyShift action_62 action_1060 (309) = happyShift action_64 action_1060 (323) = happyShift action_236 action_1060 (324) = happyShift action_237 action_1060 (346) = happyShift action_238 action_1060 (353) = happyShift action_239 action_1060 (357) = happyShift action_240 action_1060 (359) = happyShift action_241 action_1060 (361) = happyShift action_242 action_1060 (363) = happyShift action_243 action_1060 (370) = happyShift action_244 action_1060 (371) = happyShift action_245 action_1060 (372) = happyShift action_246 action_1060 (376) = happyShift action_247 action_1060 (380) = happyShift action_248 action_1060 (381) = happyShift action_87 action_1060 (383) = happyShift action_249 action_1060 (384) = happyShift action_250 action_1060 (403) = happyShift action_251 action_1060 (404) = happyShift action_252 action_1060 (408) = happyShift action_108 action_1060 (409) = happyShift action_109 action_1060 (107) = happyGoto action_860 action_1060 (110) = happyGoto action_1065 action_1060 (111) = happyGoto action_218 action_1060 (112) = happyGoto action_254 action_1060 (114) = happyGoto action_255 action_1060 (115) = happyGoto action_256 action_1060 (117) = happyGoto action_257 action_1060 (118) = happyGoto action_221 action_1060 (156) = happyGoto action_222 action_1060 (210) = happyGoto action_259 action_1060 (224) = happyGoto action_223 action_1060 (225) = happyGoto action_224 action_1060 (227) = happyGoto action_225 action_1060 (228) = happyGoto action_226 action_1060 (237) = happyGoto action_227 action_1060 (239) = happyGoto action_228 action_1060 (249) = happyGoto action_229 action_1060 _ = happyFail action_1061 (274) = happyShift action_1064 action_1061 _ = happyFail action_1062 _ = happyReduce_288 action_1063 _ = happyReduce_287 action_1064 (266) = happyShift action_37 action_1064 (267) = happyShift action_38 action_1064 (268) = happyShift action_39 action_1064 (273) = happyShift action_40 action_1064 (275) = happyShift action_41 action_1064 (276) = happyShift action_42 action_1064 (283) = happyShift action_46 action_1064 (287) = happyShift action_47 action_1064 (291) = happyShift action_48 action_1064 (293) = happyShift action_49 action_1064 (294) = happyShift action_50 action_1064 (295) = happyShift action_51 action_1064 (296) = happyShift action_52 action_1064 (297) = happyShift action_53 action_1064 (298) = happyShift action_54 action_1064 (299) = happyShift action_55 action_1064 (300) = happyShift action_56 action_1064 (301) = happyShift action_57 action_1064 (302) = happyShift action_58 action_1064 (303) = happyShift action_59 action_1064 (304) = happyShift action_60 action_1064 (305) = happyShift action_61 action_1064 (306) = happyShift action_62 action_1064 (307) = happyShift action_63 action_1064 (309) = happyShift action_64 action_1064 (318) = happyShift action_68 action_1064 (319) = happyShift action_69 action_1064 (320) = happyShift action_70 action_1064 (336) = happyShift action_72 action_1064 (342) = happyShift action_73 action_1064 (345) = happyShift action_74 action_1064 (357) = happyShift action_75 action_1064 (359) = happyShift action_76 action_1064 (361) = happyShift action_118 action_1064 (363) = happyShift action_78 action_1064 (365) = happyShift action_79 action_1064 (370) = happyShift action_80 action_1064 (371) = happyShift action_81 action_1064 (372) = happyShift action_82 action_1064 (375) = happyShift action_83 action_1064 (376) = happyShift action_84 action_1064 (379) = happyShift action_85 action_1064 (380) = happyShift action_86 action_1064 (381) = happyShift action_87 action_1064 (382) = happyShift action_88 action_1064 (383) = happyShift action_89 action_1064 (384) = happyShift action_90 action_1064 (385) = happyShift action_91 action_1064 (386) = happyShift action_92 action_1064 (387) = happyShift action_93 action_1064 (388) = happyShift action_94 action_1064 (389) = happyShift action_95 action_1064 (390) = happyShift action_96 action_1064 (391) = happyShift action_97 action_1064 (396) = happyShift action_98 action_1064 (397) = happyShift action_99 action_1064 (398) = happyShift action_100 action_1064 (399) = happyShift action_101 action_1064 (401) = happyShift action_102 action_1064 (403) = happyShift action_103 action_1064 (404) = happyShift action_104 action_1064 (405) = happyShift action_105 action_1064 (406) = happyShift action_106 action_1064 (407) = happyShift action_107 action_1064 (408) = happyShift action_108 action_1064 (409) = happyShift action_109 action_1064 (38) = happyGoto action_13 action_1064 (156) = happyGoto action_16 action_1064 (157) = happyGoto action_1180 action_1064 (158) = happyGoto action_116 action_1064 (159) = happyGoto action_18 action_1064 (161) = happyGoto action_19 action_1064 (162) = happyGoto action_20 action_1064 (163) = happyGoto action_21 action_1064 (164) = happyGoto action_22 action_1064 (165) = happyGoto action_23 action_1064 (166) = happyGoto action_24 action_1064 (167) = happyGoto action_25 action_1064 (210) = happyGoto action_26 action_1064 (217) = happyGoto action_27 action_1064 (220) = happyGoto action_28 action_1064 (241) = happyGoto action_30 action_1064 (242) = happyGoto action_31 action_1064 (243) = happyGoto action_117 action_1064 (249) = happyGoto action_33 action_1064 (251) = happyGoto action_34 action_1064 (252) = happyGoto action_35 action_1064 (255) = happyGoto action_36 action_1064 _ = happyFail action_1065 _ = happyReduce_255 action_1066 (333) = happyShift action_1179 action_1066 _ = happyFail action_1067 _ = happyReduce_521 action_1068 _ = happyReduce_523 action_1069 _ = happyReduce_520 action_1070 _ = happyReduce_498 action_1071 _ = happyReduce_499 action_1072 (311) = happyShift action_1178 action_1072 _ = happyFail action_1073 _ = happyReduce_13 action_1074 (266) = happyShift action_37 action_1074 (267) = happyShift action_38 action_1074 (268) = happyShift action_39 action_1074 (269) = happyShift action_137 action_1074 (270) = happyShift action_138 action_1074 (271) = happyShift action_139 action_1074 (272) = happyShift action_140 action_1074 (273) = happyShift action_40 action_1074 (275) = happyShift action_41 action_1074 (276) = happyShift action_42 action_1074 (277) = happyShift action_159 action_1074 (279) = happyShift action_43 action_1074 (280) = happyShift action_44 action_1074 (281) = happyShift action_45 action_1074 (282) = happyShift action_141 action_1074 (283) = happyShift action_46 action_1074 (285) = happyShift action_142 action_1074 (287) = happyShift action_47 action_1074 (289) = happyShift action_143 action_1074 (291) = happyShift action_48 action_1074 (292) = happyShift action_144 action_1074 (293) = happyShift action_49 action_1074 (294) = happyShift action_50 action_1074 (295) = happyShift action_51 action_1074 (296) = happyShift action_52 action_1074 (297) = happyShift action_53 action_1074 (298) = happyShift action_54 action_1074 (299) = happyShift action_55 action_1074 (300) = happyShift action_56 action_1074 (301) = happyShift action_57 action_1074 (302) = happyShift action_58 action_1074 (303) = happyShift action_59 action_1074 (304) = happyShift action_60 action_1074 (305) = happyShift action_61 action_1074 (306) = happyShift action_62 action_1074 (307) = happyShift action_63 action_1074 (309) = happyShift action_64 action_1074 (312) = happyShift action_145 action_1074 (313) = happyShift action_65 action_1074 (314) = happyShift action_66 action_1074 (315) = happyShift action_67 action_1074 (317) = happyShift action_146 action_1074 (318) = happyShift action_68 action_1074 (319) = happyShift action_69 action_1074 (320) = happyShift action_70 action_1074 (321) = happyShift action_147 action_1074 (322) = happyShift action_148 action_1074 (325) = happyShift action_149 action_1074 (326) = happyShift action_150 action_1074 (327) = happyShift action_151 action_1074 (328) = happyShift action_152 action_1074 (329) = happyShift action_71 action_1074 (336) = happyShift action_72 action_1074 (342) = happyShift action_73 action_1074 (345) = happyShift action_74 action_1074 (346) = happyShift action_153 action_1074 (357) = happyShift action_75 action_1074 (359) = happyShift action_76 action_1074 (361) = happyShift action_77 action_1074 (363) = happyShift action_78 action_1074 (365) = happyShift action_79 action_1074 (370) = happyShift action_80 action_1074 (371) = happyShift action_81 action_1074 (372) = happyShift action_82 action_1074 (375) = happyShift action_83 action_1074 (376) = happyShift action_84 action_1074 (379) = happyShift action_85 action_1074 (380) = happyShift action_86 action_1074 (381) = happyShift action_87 action_1074 (382) = happyShift action_88 action_1074 (383) = happyShift action_89 action_1074 (384) = happyShift action_90 action_1074 (385) = happyShift action_91 action_1074 (386) = happyShift action_92 action_1074 (387) = happyShift action_93 action_1074 (388) = happyShift action_94 action_1074 (389) = happyShift action_95 action_1074 (390) = happyShift action_96 action_1074 (391) = happyShift action_97 action_1074 (392) = happyShift action_154 action_1074 (393) = happyShift action_155 action_1074 (394) = happyShift action_156 action_1074 (395) = happyShift action_157 action_1074 (396) = happyShift action_98 action_1074 (397) = happyShift action_99 action_1074 (398) = happyShift action_100 action_1074 (399) = happyShift action_101 action_1074 (401) = happyShift action_102 action_1074 (403) = happyShift action_103 action_1074 (404) = happyShift action_104 action_1074 (405) = happyShift action_105 action_1074 (406) = happyShift action_106 action_1074 (407) = happyShift action_107 action_1074 (408) = happyShift action_108 action_1074 (409) = happyShift action_109 action_1074 (24) = happyGoto action_1177 action_1074 (25) = happyGoto action_1174 action_1074 (38) = happyGoto action_13 action_1074 (39) = happyGoto action_1175 action_1074 (40) = happyGoto action_1176 action_1074 (49) = happyGoto action_14 action_1074 (51) = happyGoto action_477 action_1074 (52) = happyGoto action_478 action_1074 (53) = happyGoto action_120 action_1074 (54) = happyGoto action_121 action_1074 (55) = happyGoto action_122 action_1074 (63) = happyGoto action_123 action_1074 (67) = happyGoto action_124 action_1074 (68) = happyGoto action_125 action_1074 (72) = happyGoto action_126 action_1074 (100) = happyGoto action_127 action_1074 (146) = happyGoto action_128 action_1074 (147) = happyGoto action_129 action_1074 (148) = happyGoto action_130 action_1074 (153) = happyGoto action_131 action_1074 (156) = happyGoto action_16 action_1074 (158) = happyGoto action_132 action_1074 (159) = happyGoto action_18 action_1074 (161) = happyGoto action_19 action_1074 (162) = happyGoto action_20 action_1074 (163) = happyGoto action_21 action_1074 (164) = happyGoto action_22 action_1074 (165) = happyGoto action_23 action_1074 (166) = happyGoto action_24 action_1074 (167) = happyGoto action_25 action_1074 (210) = happyGoto action_26 action_1074 (217) = happyGoto action_27 action_1074 (220) = happyGoto action_28 action_1074 (240) = happyGoto action_29 action_1074 (241) = happyGoto action_30 action_1074 (242) = happyGoto action_31 action_1074 (243) = happyGoto action_32 action_1074 (249) = happyGoto action_33 action_1074 (251) = happyGoto action_34 action_1074 (252) = happyGoto action_35 action_1074 (255) = happyGoto action_36 action_1074 (259) = happyGoto action_133 action_1074 (260) = happyGoto action_134 action_1074 (261) = happyGoto action_135 action_1074 (262) = happyGoto action_136 action_1074 _ = happyReduce_69 action_1075 (266) = happyShift action_37 action_1075 (267) = happyShift action_38 action_1075 (268) = happyShift action_39 action_1075 (269) = happyShift action_137 action_1075 (270) = happyShift action_138 action_1075 (271) = happyShift action_139 action_1075 (272) = happyShift action_140 action_1075 (273) = happyShift action_40 action_1075 (275) = happyShift action_41 action_1075 (276) = happyShift action_42 action_1075 (277) = happyShift action_159 action_1075 (279) = happyShift action_43 action_1075 (280) = happyShift action_44 action_1075 (281) = happyShift action_45 action_1075 (282) = happyShift action_141 action_1075 (283) = happyShift action_46 action_1075 (285) = happyShift action_142 action_1075 (287) = happyShift action_47 action_1075 (289) = happyShift action_143 action_1075 (291) = happyShift action_48 action_1075 (292) = happyShift action_144 action_1075 (293) = happyShift action_49 action_1075 (294) = happyShift action_50 action_1075 (295) = happyShift action_51 action_1075 (296) = happyShift action_52 action_1075 (297) = happyShift action_53 action_1075 (298) = happyShift action_54 action_1075 (299) = happyShift action_55 action_1075 (300) = happyShift action_56 action_1075 (301) = happyShift action_57 action_1075 (302) = happyShift action_58 action_1075 (303) = happyShift action_59 action_1075 (304) = happyShift action_60 action_1075 (305) = happyShift action_61 action_1075 (306) = happyShift action_62 action_1075 (307) = happyShift action_63 action_1075 (309) = happyShift action_64 action_1075 (312) = happyShift action_145 action_1075 (313) = happyShift action_65 action_1075 (314) = happyShift action_66 action_1075 (315) = happyShift action_67 action_1075 (317) = happyShift action_146 action_1075 (318) = happyShift action_68 action_1075 (319) = happyShift action_69 action_1075 (320) = happyShift action_70 action_1075 (321) = happyShift action_147 action_1075 (322) = happyShift action_148 action_1075 (325) = happyShift action_149 action_1075 (326) = happyShift action_150 action_1075 (327) = happyShift action_151 action_1075 (328) = happyShift action_152 action_1075 (329) = happyShift action_71 action_1075 (336) = happyShift action_72 action_1075 (342) = happyShift action_73 action_1075 (345) = happyShift action_74 action_1075 (346) = happyShift action_153 action_1075 (357) = happyShift action_75 action_1075 (359) = happyShift action_76 action_1075 (361) = happyShift action_77 action_1075 (363) = happyShift action_78 action_1075 (365) = happyShift action_79 action_1075 (370) = happyShift action_80 action_1075 (371) = happyShift action_81 action_1075 (372) = happyShift action_82 action_1075 (375) = happyShift action_83 action_1075 (376) = happyShift action_84 action_1075 (379) = happyShift action_85 action_1075 (380) = happyShift action_86 action_1075 (381) = happyShift action_87 action_1075 (382) = happyShift action_88 action_1075 (383) = happyShift action_89 action_1075 (384) = happyShift action_90 action_1075 (385) = happyShift action_91 action_1075 (386) = happyShift action_92 action_1075 (387) = happyShift action_93 action_1075 (388) = happyShift action_94 action_1075 (389) = happyShift action_95 action_1075 (390) = happyShift action_96 action_1075 (391) = happyShift action_97 action_1075 (392) = happyShift action_154 action_1075 (393) = happyShift action_155 action_1075 (394) = happyShift action_156 action_1075 (395) = happyShift action_157 action_1075 (396) = happyShift action_98 action_1075 (397) = happyShift action_99 action_1075 (398) = happyShift action_100 action_1075 (399) = happyShift action_101 action_1075 (401) = happyShift action_102 action_1075 (403) = happyShift action_103 action_1075 (404) = happyShift action_104 action_1075 (405) = happyShift action_105 action_1075 (406) = happyShift action_106 action_1075 (407) = happyShift action_107 action_1075 (408) = happyShift action_108 action_1075 (409) = happyShift action_109 action_1075 (24) = happyGoto action_1173 action_1075 (25) = happyGoto action_1174 action_1075 (38) = happyGoto action_13 action_1075 (39) = happyGoto action_1175 action_1075 (40) = happyGoto action_1176 action_1075 (49) = happyGoto action_14 action_1075 (51) = happyGoto action_477 action_1075 (52) = happyGoto action_478 action_1075 (53) = happyGoto action_120 action_1075 (54) = happyGoto action_121 action_1075 (55) = happyGoto action_122 action_1075 (63) = happyGoto action_123 action_1075 (67) = happyGoto action_124 action_1075 (68) = happyGoto action_125 action_1075 (72) = happyGoto action_126 action_1075 (100) = happyGoto action_127 action_1075 (146) = happyGoto action_128 action_1075 (147) = happyGoto action_129 action_1075 (148) = happyGoto action_130 action_1075 (153) = happyGoto action_131 action_1075 (156) = happyGoto action_16 action_1075 (158) = happyGoto action_132 action_1075 (159) = happyGoto action_18 action_1075 (161) = happyGoto action_19 action_1075 (162) = happyGoto action_20 action_1075 (163) = happyGoto action_21 action_1075 (164) = happyGoto action_22 action_1075 (165) = happyGoto action_23 action_1075 (166) = happyGoto action_24 action_1075 (167) = happyGoto action_25 action_1075 (210) = happyGoto action_26 action_1075 (217) = happyGoto action_27 action_1075 (220) = happyGoto action_28 action_1075 (240) = happyGoto action_29 action_1075 (241) = happyGoto action_30 action_1075 (242) = happyGoto action_31 action_1075 (243) = happyGoto action_32 action_1075 (249) = happyGoto action_33 action_1075 (251) = happyGoto action_34 action_1075 (252) = happyGoto action_35 action_1075 (255) = happyGoto action_36 action_1075 (259) = happyGoto action_133 action_1075 (260) = happyGoto action_134 action_1075 (261) = happyGoto action_135 action_1075 (262) = happyGoto action_136 action_1075 _ = happyReduce_69 action_1076 _ = happyReduce_48 action_1077 (392) = happyShift action_154 action_1077 (394) = happyShift action_156 action_1077 (395) = happyShift action_157 action_1077 (32) = happyGoto action_1172 action_1077 (33) = happyGoto action_1035 action_1077 (259) = happyGoto action_1036 action_1077 (261) = happyGoto action_1037 action_1077 (262) = happyGoto action_1038 action_1077 _ = happyReduce_49 action_1078 (361) = happyShift action_1171 action_1078 (35) = happyGoto action_1170 action_1078 _ = happyReduce_56 action_1079 _ = happyReduce_62 action_1080 (372) = happyShift action_503 action_1080 (376) = happyShift action_504 action_1080 (257) = happyGoto action_1169 action_1080 _ = happyFail action_1081 (267) = happyShift action_38 action_1081 (275) = happyShift action_41 action_1081 (287) = happyShift action_47 action_1081 (291) = happyShift action_48 action_1081 (293) = happyShift action_49 action_1081 (294) = happyShift action_50 action_1081 (295) = happyShift action_51 action_1081 (296) = happyShift action_52 action_1081 (297) = happyShift action_53 action_1081 (298) = happyShift action_54 action_1081 (300) = happyShift action_56 action_1081 (301) = happyShift action_57 action_1081 (302) = happyShift action_58 action_1081 (303) = happyShift action_59 action_1081 (304) = happyShift action_60 action_1081 (305) = happyShift action_61 action_1081 (306) = happyShift action_62 action_1081 (309) = happyShift action_64 action_1081 (357) = happyShift action_199 action_1081 (361) = happyShift action_333 action_1081 (363) = happyShift action_201 action_1081 (371) = happyShift action_81 action_1081 (372) = happyShift action_82 action_1081 (375) = happyShift action_83 action_1081 (376) = happyShift action_84 action_1081 (379) = happyShift action_85 action_1081 (380) = happyShift action_86 action_1081 (38) = happyGoto action_1168 action_1081 (217) = happyGoto action_27 action_1081 (220) = happyGoto action_28 action_1081 (241) = happyGoto action_335 action_1081 (242) = happyGoto action_31 action_1081 (243) = happyGoto action_117 action_1081 (249) = happyGoto action_33 action_1081 (251) = happyGoto action_34 action_1081 (252) = happyGoto action_35 action_1081 _ = happyFail action_1082 (357) = happyShift action_199 action_1082 (361) = happyShift action_1167 action_1082 (363) = happyShift action_201 action_1082 (372) = happyShift action_82 action_1082 (376) = happyShift action_84 action_1082 (380) = happyShift action_86 action_1082 (217) = happyGoto action_1166 action_1082 (220) = happyGoto action_28 action_1082 (251) = happyGoto action_34 action_1082 (252) = happyGoto action_35 action_1082 _ = happyFail action_1083 (392) = happyShift action_154 action_1083 (394) = happyShift action_156 action_1083 (395) = happyShift action_157 action_1083 (32) = happyGoto action_1165 action_1083 (33) = happyGoto action_1035 action_1083 (259) = happyGoto action_1036 action_1083 (261) = happyGoto action_1037 action_1083 (262) = happyGoto action_1038 action_1083 _ = happyReduce_49 action_1084 _ = happyReduce_41 action_1085 _ = happyReduce_124 action_1086 (267) = happyShift action_38 action_1086 (275) = happyShift action_41 action_1086 (287) = happyShift action_47 action_1086 (293) = happyShift action_49 action_1086 (294) = happyShift action_50 action_1086 (295) = happyShift action_51 action_1086 (296) = happyShift action_231 action_1086 (297) = happyShift action_232 action_1086 (298) = happyShift action_233 action_1086 (302) = happyShift action_58 action_1086 (303) = happyShift action_59 action_1086 (304) = happyShift action_60 action_1086 (305) = happyShift action_61 action_1086 (306) = happyShift action_62 action_1086 (309) = happyShift action_64 action_1086 (323) = happyShift action_236 action_1086 (324) = happyShift action_237 action_1086 (346) = happyShift action_238 action_1086 (353) = happyShift action_239 action_1086 (357) = happyShift action_240 action_1086 (359) = happyShift action_241 action_1086 (361) = happyShift action_242 action_1086 (363) = happyShift action_243 action_1086 (370) = happyShift action_244 action_1086 (371) = happyShift action_245 action_1086 (372) = happyShift action_246 action_1086 (376) = happyShift action_247 action_1086 (380) = happyShift action_248 action_1086 (383) = happyShift action_249 action_1086 (384) = happyShift action_250 action_1086 (403) = happyShift action_251 action_1086 (404) = happyShift action_252 action_1086 (408) = happyShift action_108 action_1086 (409) = happyShift action_109 action_1086 (111) = happyGoto action_218 action_1086 (114) = happyGoto action_1162 action_1086 (117) = happyGoto action_1163 action_1086 (118) = happyGoto action_221 action_1086 (141) = happyGoto action_1164 action_1086 (156) = happyGoto action_222 action_1086 (224) = happyGoto action_223 action_1086 (225) = happyGoto action_224 action_1086 (227) = happyGoto action_225 action_1086 (228) = happyGoto action_226 action_1086 (237) = happyGoto action_227 action_1086 (239) = happyGoto action_228 action_1086 (249) = happyGoto action_229 action_1086 _ = happyFail action_1087 (267) = happyShift action_38 action_1087 (275) = happyShift action_41 action_1087 (287) = happyShift action_47 action_1087 (293) = happyShift action_49 action_1087 (294) = happyShift action_50 action_1087 (295) = happyShift action_51 action_1087 (296) = happyShift action_231 action_1087 (297) = happyShift action_232 action_1087 (298) = happyShift action_233 action_1087 (302) = happyShift action_58 action_1087 (303) = happyShift action_59 action_1087 (304) = happyShift action_60 action_1087 (305) = happyShift action_61 action_1087 (306) = happyShift action_62 action_1087 (309) = happyShift action_64 action_1087 (361) = happyShift action_547 action_1087 (371) = happyShift action_245 action_1087 (123) = happyGoto action_1161 action_1087 (124) = happyGoto action_545 action_1087 (237) = happyGoto action_546 action_1087 (239) = happyGoto action_228 action_1087 (249) = happyGoto action_229 action_1087 _ = happyReduce_321 action_1088 (338) = happyShift action_1160 action_1088 _ = happyFail action_1089 (368) = happyShift action_1159 action_1089 _ = happyReduce_314 action_1090 (362) = happyShift action_1158 action_1090 _ = happyFail action_1091 _ = happyReduce_369 action_1092 (1) = happyShift action_424 action_1092 (356) = happyShift action_425 action_1092 (256) = happyGoto action_1157 action_1092 _ = happyFail action_1093 (367) = happyShift action_1156 action_1093 _ = happyReduce_349 action_1094 (368) = happyShift action_1155 action_1094 _ = happyReduce_582 action_1095 (334) = happyShift action_1154 action_1095 _ = happyFail action_1096 (353) = happyShift action_1153 action_1096 _ = happyFail action_1097 (333) = happyShift action_278 action_1097 (342) = happyShift action_491 action_1097 (345) = happyShift action_493 action_1097 (347) = happyShift action_494 action_1097 (362) = happyShift action_306 action_1097 (368) = happyShift action_307 action_1097 (373) = happyShift action_496 action_1097 (374) = happyShift action_1152 action_1097 (377) = happyShift action_498 action_1097 (378) = happyShift action_499 action_1097 (229) = happyGoto action_487 action_1097 (230) = happyGoto action_488 action_1097 (254) = happyGoto action_441 action_1097 (258) = happyGoto action_442 action_1097 _ = happyFail action_1098 (353) = happyReduce_611 action_1098 _ = happyReduce_682 action_1099 (354) = happyShift action_1151 action_1099 _ = happyFail action_1100 _ = happyReduce_175 action_1101 (266) = happyShift action_37 action_1101 (267) = happyShift action_38 action_1101 (268) = happyShift action_39 action_1101 (270) = happyShift action_1011 action_1101 (271) = happyShift action_1012 action_1101 (273) = happyShift action_40 action_1101 (275) = happyShift action_41 action_1101 (276) = happyShift action_42 action_1101 (279) = happyShift action_43 action_1101 (280) = happyShift action_44 action_1101 (281) = happyShift action_45 action_1101 (283) = happyShift action_46 action_1101 (287) = happyShift action_47 action_1101 (289) = happyShift action_1013 action_1101 (291) = happyShift action_48 action_1101 (293) = happyShift action_49 action_1101 (294) = happyShift action_50 action_1101 (295) = happyShift action_51 action_1101 (296) = happyShift action_52 action_1101 (297) = happyShift action_53 action_1101 (298) = happyShift action_54 action_1101 (299) = happyShift action_55 action_1101 (300) = happyShift action_56 action_1101 (301) = happyShift action_57 action_1101 (302) = happyShift action_58 action_1101 (303) = happyShift action_59 action_1101 (304) = happyShift action_60 action_1101 (305) = happyShift action_61 action_1101 (306) = happyShift action_62 action_1101 (307) = happyShift action_63 action_1101 (309) = happyShift action_64 action_1101 (312) = happyShift action_145 action_1101 (313) = happyShift action_65 action_1101 (314) = happyShift action_66 action_1101 (315) = happyShift action_67 action_1101 (318) = happyShift action_68 action_1101 (319) = happyShift action_69 action_1101 (320) = happyShift action_70 action_1101 (329) = happyShift action_71 action_1101 (336) = happyShift action_72 action_1101 (342) = happyShift action_73 action_1101 (345) = happyShift action_74 action_1101 (346) = happyShift action_153 action_1101 (357) = happyShift action_75 action_1101 (359) = happyShift action_76 action_1101 (361) = happyShift action_77 action_1101 (363) = happyShift action_78 action_1101 (365) = happyShift action_79 action_1101 (370) = happyShift action_80 action_1101 (371) = happyShift action_81 action_1101 (372) = happyShift action_82 action_1101 (375) = happyShift action_83 action_1101 (376) = happyShift action_84 action_1101 (379) = happyShift action_85 action_1101 (380) = happyShift action_86 action_1101 (381) = happyShift action_87 action_1101 (382) = happyShift action_88 action_1101 (383) = happyShift action_89 action_1101 (384) = happyShift action_90 action_1101 (385) = happyShift action_91 action_1101 (386) = happyShift action_92 action_1101 (387) = happyShift action_93 action_1101 (388) = happyShift action_94 action_1101 (389) = happyShift action_95 action_1101 (390) = happyShift action_96 action_1101 (391) = happyShift action_97 action_1101 (392) = happyShift action_154 action_1101 (393) = happyShift action_155 action_1101 (394) = happyShift action_156 action_1101 (395) = happyShift action_157 action_1101 (396) = happyShift action_98 action_1101 (397) = happyShift action_99 action_1101 (398) = happyShift action_100 action_1101 (399) = happyShift action_101 action_1101 (401) = happyShift action_102 action_1101 (403) = happyShift action_103 action_1101 (404) = happyShift action_104 action_1101 (405) = happyShift action_105 action_1101 (406) = happyShift action_106 action_1101 (407) = happyShift action_107 action_1101 (408) = happyShift action_108 action_1101 (409) = happyShift action_109 action_1101 (38) = happyGoto action_13 action_1101 (49) = happyGoto action_14 action_1101 (60) = happyGoto action_1007 action_1101 (72) = happyGoto action_126 action_1101 (75) = happyGoto action_1150 action_1101 (146) = happyGoto action_128 action_1101 (147) = happyGoto action_129 action_1101 (148) = happyGoto action_627 action_1101 (149) = happyGoto action_1010 action_1101 (153) = happyGoto action_131 action_1101 (156) = happyGoto action_16 action_1101 (158) = happyGoto action_629 action_1101 (159) = happyGoto action_18 action_1101 (161) = happyGoto action_19 action_1101 (162) = happyGoto action_20 action_1101 (163) = happyGoto action_21 action_1101 (164) = happyGoto action_22 action_1101 (165) = happyGoto action_23 action_1101 (166) = happyGoto action_24 action_1101 (167) = happyGoto action_630 action_1101 (210) = happyGoto action_26 action_1101 (217) = happyGoto action_27 action_1101 (220) = happyGoto action_28 action_1101 (240) = happyGoto action_29 action_1101 (241) = happyGoto action_30 action_1101 (242) = happyGoto action_31 action_1101 (243) = happyGoto action_32 action_1101 (249) = happyGoto action_33 action_1101 (251) = happyGoto action_34 action_1101 (252) = happyGoto action_35 action_1101 (255) = happyGoto action_36 action_1101 (259) = happyGoto action_133 action_1101 (260) = happyGoto action_134 action_1101 (261) = happyGoto action_135 action_1101 (262) = happyGoto action_136 action_1101 _ = happyReduce_172 action_1102 _ = happyReduce_138 action_1103 (334) = happyShift action_691 action_1103 (335) = happyShift action_689 action_1103 (64) = happyGoto action_1149 action_1103 _ = happyReduce_147 action_1104 (267) = happyShift action_38 action_1104 (275) = happyShift action_41 action_1104 (287) = happyShift action_47 action_1104 (293) = happyShift action_49 action_1104 (294) = happyShift action_50 action_1104 (295) = happyShift action_51 action_1104 (296) = happyShift action_231 action_1104 (297) = happyShift action_232 action_1104 (298) = happyShift action_233 action_1104 (302) = happyShift action_58 action_1104 (303) = happyShift action_59 action_1104 (304) = happyShift action_60 action_1104 (305) = happyShift action_61 action_1104 (306) = happyShift action_62 action_1104 (309) = happyShift action_64 action_1104 (323) = happyShift action_236 action_1104 (324) = happyShift action_237 action_1104 (346) = happyShift action_238 action_1104 (353) = happyShift action_239 action_1104 (357) = happyShift action_240 action_1104 (359) = happyShift action_241 action_1104 (361) = happyShift action_242 action_1104 (363) = happyShift action_243 action_1104 (370) = happyShift action_244 action_1104 (371) = happyShift action_245 action_1104 (372) = happyShift action_246 action_1104 (376) = happyShift action_247 action_1104 (380) = happyShift action_248 action_1104 (383) = happyShift action_249 action_1104 (384) = happyShift action_250 action_1104 (403) = happyShift action_251 action_1104 (404) = happyShift action_252 action_1104 (408) = happyShift action_108 action_1104 (409) = happyShift action_109 action_1104 (59) = happyGoto action_1148 action_1104 (111) = happyGoto action_218 action_1104 (115) = happyGoto action_583 action_1104 (117) = happyGoto action_220 action_1104 (118) = happyGoto action_221 action_1104 (156) = happyGoto action_222 action_1104 (224) = happyGoto action_223 action_1104 (225) = happyGoto action_224 action_1104 (227) = happyGoto action_225 action_1104 (228) = happyGoto action_226 action_1104 (237) = happyGoto action_227 action_1104 (239) = happyGoto action_228 action_1104 (249) = happyGoto action_229 action_1104 _ = happyFail action_1105 (267) = happyShift action_38 action_1105 (275) = happyShift action_41 action_1105 (287) = happyShift action_47 action_1105 (293) = happyShift action_49 action_1105 (294) = happyShift action_50 action_1105 (295) = happyShift action_51 action_1105 (296) = happyShift action_231 action_1105 (297) = happyShift action_232 action_1105 (298) = happyShift action_233 action_1105 (302) = happyShift action_58 action_1105 (303) = happyShift action_59 action_1105 (304) = happyShift action_60 action_1105 (305) = happyShift action_61 action_1105 (306) = happyShift action_62 action_1105 (309) = happyShift action_64 action_1105 (323) = happyShift action_236 action_1105 (324) = happyShift action_237 action_1105 (346) = happyShift action_238 action_1105 (353) = happyShift action_239 action_1105 (357) = happyShift action_240 action_1105 (359) = happyShift action_241 action_1105 (361) = happyShift action_242 action_1105 (363) = happyShift action_243 action_1105 (370) = happyShift action_244 action_1105 (371) = happyShift action_245 action_1105 (372) = happyShift action_246 action_1105 (376) = happyShift action_247 action_1105 (380) = happyShift action_248 action_1105 (383) = happyShift action_249 action_1105 (384) = happyShift action_250 action_1105 (403) = happyShift action_251 action_1105 (404) = happyShift action_252 action_1105 (408) = happyShift action_108 action_1105 (409) = happyShift action_109 action_1105 (111) = happyGoto action_218 action_1105 (115) = happyGoto action_1147 action_1105 (117) = happyGoto action_220 action_1105 (118) = happyGoto action_221 action_1105 (156) = happyGoto action_222 action_1105 (224) = happyGoto action_223 action_1105 (225) = happyGoto action_224 action_1105 (227) = happyGoto action_225 action_1105 (228) = happyGoto action_226 action_1105 (237) = happyGoto action_227 action_1105 (239) = happyGoto action_228 action_1105 (249) = happyGoto action_229 action_1105 _ = happyFail action_1106 (333) = happyShift action_278 action_1106 (334) = happyShift action_1146 action_1106 (345) = happyShift action_280 action_1106 (346) = happyShift action_281 action_1106 (347) = happyShift action_282 action_1106 (352) = happyShift action_283 action_1106 (369) = happyShift action_284 action_1106 (373) = happyShift action_285 action_1106 (374) = happyShift action_286 action_1106 (377) = happyShift action_287 action_1106 (378) = happyShift action_288 action_1106 (222) = happyGoto action_268 action_1106 (233) = happyGoto action_269 action_1106 (235) = happyGoto action_270 action_1106 (244) = happyGoto action_271 action_1106 (246) = happyGoto action_272 action_1106 (247) = happyGoto action_273 action_1106 (248) = happyGoto action_274 action_1106 (250) = happyGoto action_275 action_1106 (253) = happyGoto action_276 action_1106 (254) = happyGoto action_277 action_1106 _ = happyFail action_1107 (267) = happyShift action_38 action_1107 (275) = happyShift action_41 action_1107 (287) = happyShift action_47 action_1107 (293) = happyShift action_49 action_1107 (294) = happyShift action_50 action_1107 (295) = happyShift action_51 action_1107 (296) = happyShift action_231 action_1107 (297) = happyShift action_232 action_1107 (298) = happyShift action_233 action_1107 (302) = happyShift action_58 action_1107 (303) = happyShift action_59 action_1107 (304) = happyShift action_60 action_1107 (305) = happyShift action_61 action_1107 (306) = happyShift action_62 action_1107 (309) = happyShift action_64 action_1107 (323) = happyShift action_236 action_1107 (324) = happyShift action_237 action_1107 (346) = happyShift action_238 action_1107 (353) = happyShift action_239 action_1107 (357) = happyShift action_240 action_1107 (359) = happyShift action_241 action_1107 (361) = happyShift action_242 action_1107 (363) = happyShift action_243 action_1107 (370) = happyShift action_244 action_1107 (371) = happyShift action_245 action_1107 (372) = happyShift action_246 action_1107 (376) = happyShift action_247 action_1107 (380) = happyShift action_248 action_1107 (383) = happyShift action_249 action_1107 (384) = happyShift action_250 action_1107 (403) = happyShift action_251 action_1107 (404) = happyShift action_252 action_1107 (408) = happyShift action_108 action_1107 (409) = happyShift action_109 action_1107 (111) = happyGoto action_218 action_1107 (115) = happyGoto action_1145 action_1107 (117) = happyGoto action_220 action_1107 (118) = happyGoto action_221 action_1107 (156) = happyGoto action_222 action_1107 (224) = happyGoto action_223 action_1107 (225) = happyGoto action_224 action_1107 (227) = happyGoto action_225 action_1107 (228) = happyGoto action_226 action_1107 (237) = happyGoto action_227 action_1107 (239) = happyGoto action_228 action_1107 (249) = happyGoto action_229 action_1107 _ = happyFail action_1108 _ = happyReduce_141 action_1109 _ = happyReduce_176 action_1110 _ = happyReduce_323 action_1111 (334) = happyShift action_691 action_1111 (335) = happyReduce_709 action_1111 (392) = happyShift action_154 action_1111 (64) = happyGoto action_1143 action_1111 (137) = happyGoto action_1144 action_1111 (259) = happyGoto action_575 action_1111 (265) = happyGoto action_756 action_1111 _ = happyReduce_147 action_1112 _ = happyReduce_181 action_1113 _ = happyReduce_307 action_1114 _ = happyReduce_332 action_1115 _ = happyReduce_342 action_1116 _ = happyReduce_336 action_1117 (267) = happyShift action_38 action_1117 (275) = happyShift action_41 action_1117 (287) = happyShift action_47 action_1117 (293) = happyShift action_49 action_1117 (294) = happyShift action_50 action_1117 (295) = happyShift action_51 action_1117 (296) = happyShift action_231 action_1117 (297) = happyShift action_232 action_1117 (298) = happyShift action_233 action_1117 (302) = happyShift action_58 action_1117 (303) = happyShift action_59 action_1117 (304) = happyShift action_60 action_1117 (305) = happyShift action_61 action_1117 (306) = happyShift action_62 action_1117 (309) = happyShift action_64 action_1117 (347) = happyShift action_934 action_1117 (357) = happyShift action_935 action_1117 (361) = happyShift action_936 action_1117 (371) = happyShift action_245 action_1117 (372) = happyShift action_246 action_1117 (376) = happyShift action_247 action_1117 (380) = happyShift action_248 action_1117 (129) = happyGoto action_1141 action_1117 (130) = happyGoto action_929 action_1117 (131) = happyGoto action_930 action_1117 (132) = happyGoto action_931 action_1117 (133) = happyGoto action_1142 action_1117 (227) = happyGoto action_932 action_1117 (228) = happyGoto action_226 action_1117 (237) = happyGoto action_933 action_1117 (239) = happyGoto action_228 action_1117 (249) = happyGoto action_229 action_1117 _ = happyFail action_1118 _ = happyReduce_364 action_1119 _ = happyReduce_366 action_1120 (1) = happyShift action_424 action_1120 (356) = happyShift action_425 action_1120 (367) = happyShift action_1138 action_1120 (256) = happyGoto action_1140 action_1120 _ = happyFail action_1121 _ = happyReduce_133 action_1122 (1) = happyShift action_424 action_1122 (356) = happyShift action_425 action_1122 (256) = happyGoto action_1139 action_1122 _ = happyFail action_1123 (354) = happyShift action_1137 action_1123 (367) = happyShift action_1138 action_1123 _ = happyFail action_1124 (354) = happyShift action_1136 action_1124 _ = happyFail action_1125 _ = happyReduce_244 action_1126 (267) = happyShift action_38 action_1126 (275) = happyShift action_41 action_1126 (287) = happyShift action_47 action_1126 (291) = happyShift action_260 action_1126 (293) = happyShift action_49 action_1126 (294) = happyShift action_50 action_1126 (295) = happyShift action_51 action_1126 (296) = happyShift action_231 action_1126 (297) = happyShift action_232 action_1126 (298) = happyShift action_233 action_1126 (302) = happyShift action_58 action_1126 (303) = happyShift action_59 action_1126 (304) = happyShift action_60 action_1126 (305) = happyShift action_61 action_1126 (306) = happyShift action_62 action_1126 (309) = happyShift action_64 action_1126 (323) = happyShift action_236 action_1126 (324) = happyShift action_237 action_1126 (346) = happyShift action_238 action_1126 (353) = happyShift action_239 action_1126 (357) = happyShift action_240 action_1126 (359) = happyShift action_241 action_1126 (361) = happyShift action_242 action_1126 (363) = happyShift action_243 action_1126 (370) = happyShift action_244 action_1126 (371) = happyShift action_245 action_1126 (372) = happyShift action_246 action_1126 (376) = happyShift action_247 action_1126 (380) = happyShift action_248 action_1126 (381) = happyShift action_87 action_1126 (383) = happyShift action_249 action_1126 (384) = happyShift action_250 action_1126 (403) = happyShift action_251 action_1126 (404) = happyShift action_252 action_1126 (408) = happyShift action_108 action_1126 (409) = happyShift action_109 action_1126 (111) = happyGoto action_218 action_1126 (112) = happyGoto action_1135 action_1126 (114) = happyGoto action_255 action_1126 (115) = happyGoto action_256 action_1126 (117) = happyGoto action_257 action_1126 (118) = happyGoto action_221 action_1126 (156) = happyGoto action_222 action_1126 (210) = happyGoto action_259 action_1126 (224) = happyGoto action_223 action_1126 (225) = happyGoto action_224 action_1126 (227) = happyGoto action_225 action_1126 (228) = happyGoto action_226 action_1126 (237) = happyGoto action_227 action_1126 (239) = happyGoto action_228 action_1126 (249) = happyGoto action_229 action_1126 _ = happyFail action_1127 _ = happyReduce_204 action_1128 (275) = happyShift action_1133 action_1128 (361) = happyShift action_1134 action_1128 (46) = happyGoto action_1131 action_1128 (47) = happyGoto action_1132 action_1128 _ = happyReduce_82 action_1129 (372) = happyShift action_503 action_1129 (376) = happyShift action_504 action_1129 (257) = happyGoto action_1130 action_1129 _ = happyFail action_1130 _ = happyReduce_79 action_1131 _ = happyReduce_70 action_1132 _ = happyReduce_81 action_1133 (361) = happyShift action_1212 action_1133 _ = happyFail action_1134 (392) = happyShift action_154 action_1134 (394) = happyShift action_156 action_1134 (395) = happyShift action_157 action_1134 (30) = happyGoto action_1211 action_1134 (31) = happyGoto action_1033 action_1134 (32) = happyGoto action_1034 action_1134 (33) = happyGoto action_1035 action_1134 (259) = happyGoto action_1036 action_1134 (261) = happyGoto action_1037 action_1134 (262) = happyGoto action_1038 action_1134 _ = happyReduce_49 action_1135 (362) = happyShift action_1210 action_1135 _ = happyFail action_1136 _ = happyReduce_129 action_1137 _ = happyReduce_127 action_1138 (267) = happyShift action_38 action_1138 (275) = happyShift action_41 action_1138 (287) = happyShift action_47 action_1138 (293) = happyShift action_49 action_1138 (294) = happyShift action_50 action_1138 (295) = happyShift action_51 action_1138 (296) = happyShift action_231 action_1138 (297) = happyShift action_232 action_1138 (298) = happyShift action_233 action_1138 (302) = happyShift action_58 action_1138 (303) = happyShift action_59 action_1138 (304) = happyShift action_60 action_1138 (305) = happyShift action_61 action_1138 (306) = happyShift action_62 action_1138 (309) = happyShift action_64 action_1138 (323) = happyShift action_236 action_1138 (324) = happyShift action_237 action_1138 (346) = happyShift action_238 action_1138 (353) = happyShift action_239 action_1138 (357) = happyShift action_240 action_1138 (359) = happyShift action_241 action_1138 (361) = happyShift action_242 action_1138 (363) = happyShift action_243 action_1138 (370) = happyShift action_244 action_1138 (371) = happyShift action_245 action_1138 (372) = happyShift action_246 action_1138 (376) = happyShift action_247 action_1138 (380) = happyShift action_248 action_1138 (383) = happyShift action_249 action_1138 (384) = happyShift action_250 action_1138 (403) = happyShift action_251 action_1138 (404) = happyShift action_252 action_1138 (408) = happyShift action_108 action_1138 (409) = happyShift action_109 action_1138 (59) = happyGoto action_1209 action_1138 (111) = happyGoto action_218 action_1138 (115) = happyGoto action_583 action_1138 (117) = happyGoto action_220 action_1138 (118) = happyGoto action_221 action_1138 (156) = happyGoto action_222 action_1138 (224) = happyGoto action_223 action_1138 (225) = happyGoto action_224 action_1138 (227) = happyGoto action_225 action_1138 (228) = happyGoto action_226 action_1138 (237) = happyGoto action_227 action_1138 (239) = happyGoto action_228 action_1138 (249) = happyGoto action_229 action_1138 _ = happyReduce_132 action_1139 _ = happyReduce_130 action_1140 _ = happyReduce_128 action_1141 (368) = happyShift action_1208 action_1141 _ = happyReduce_343 action_1142 (362) = happyShift action_1207 action_1142 _ = happyFail action_1143 (290) = happyShift action_892 action_1143 (134) = happyGoto action_1206 action_1143 _ = happyReduce_347 action_1144 (272) = happyShift action_890 action_1144 (145) = happyGoto action_1205 action_1144 _ = happyReduce_367 action_1145 (334) = happyShift action_691 action_1145 (64) = happyGoto action_1204 action_1145 _ = happyReduce_147 action_1146 (267) = happyShift action_38 action_1146 (275) = happyShift action_41 action_1146 (287) = happyShift action_47 action_1146 (291) = happyShift action_405 action_1146 (293) = happyShift action_49 action_1146 (294) = happyShift action_50 action_1146 (295) = happyShift action_51 action_1146 (296) = happyShift action_231 action_1146 (297) = happyShift action_232 action_1146 (298) = happyShift action_233 action_1146 (302) = happyShift action_58 action_1146 (303) = happyShift action_59 action_1146 (304) = happyShift action_60 action_1146 (305) = happyShift action_61 action_1146 (306) = happyShift action_62 action_1146 (309) = happyShift action_64 action_1146 (323) = happyShift action_236 action_1146 (324) = happyShift action_237 action_1146 (346) = happyShift action_238 action_1146 (353) = happyShift action_239 action_1146 (357) = happyShift action_240 action_1146 (359) = happyShift action_241 action_1146 (361) = happyShift action_242 action_1146 (363) = happyShift action_243 action_1146 (370) = happyShift action_244 action_1146 (371) = happyShift action_245 action_1146 (372) = happyShift action_246 action_1146 (376) = happyShift action_247 action_1146 (380) = happyShift action_248 action_1146 (381) = happyShift action_87 action_1146 (383) = happyShift action_249 action_1146 (384) = happyShift action_250 action_1146 (403) = happyShift action_251 action_1146 (404) = happyShift action_252 action_1146 (408) = happyShift action_108 action_1146 (409) = happyShift action_109 action_1146 (108) = happyGoto action_1203 action_1146 (111) = happyGoto action_218 action_1146 (113) = happyGoto action_400 action_1146 (114) = happyGoto action_401 action_1146 (116) = happyGoto action_402 action_1146 (117) = happyGoto action_403 action_1146 (118) = happyGoto action_221 action_1146 (156) = happyGoto action_222 action_1146 (210) = happyGoto action_404 action_1146 (224) = happyGoto action_223 action_1146 (225) = happyGoto action_224 action_1146 (227) = happyGoto action_225 action_1146 (228) = happyGoto action_226 action_1146 (237) = happyGoto action_227 action_1146 (239) = happyGoto action_228 action_1146 (249) = happyGoto action_229 action_1146 _ = happyFail action_1147 (334) = happyShift action_691 action_1147 (64) = happyGoto action_1202 action_1147 _ = happyReduce_147 action_1148 _ = happyReduce_139 action_1149 _ = happyReduce_136 action_1150 _ = happyReduce_171 action_1151 _ = happyReduce_345 action_1152 (362) = happyReduce_685 action_1152 _ = happyReduce_685 action_1153 (354) = happyReduce_362 action_1153 (392) = happyShift action_154 action_1153 (142) = happyGoto action_1201 action_1153 (143) = happyGoto action_573 action_1153 (144) = happyGoto action_574 action_1153 (259) = happyGoto action_575 action_1153 (265) = happyGoto action_576 action_1153 _ = happyReduce_709 action_1154 (267) = happyShift action_38 action_1154 (275) = happyShift action_41 action_1154 (287) = happyShift action_47 action_1154 (291) = happyShift action_260 action_1154 (293) = happyShift action_49 action_1154 (294) = happyShift action_50 action_1154 (295) = happyShift action_51 action_1154 (296) = happyShift action_231 action_1154 (297) = happyShift action_232 action_1154 (298) = happyShift action_233 action_1154 (302) = happyShift action_58 action_1154 (303) = happyShift action_59 action_1154 (304) = happyShift action_60 action_1154 (305) = happyShift action_61 action_1154 (306) = happyShift action_62 action_1154 (309) = happyShift action_64 action_1154 (323) = happyShift action_236 action_1154 (324) = happyShift action_237 action_1154 (346) = happyShift action_238 action_1154 (353) = happyShift action_239 action_1154 (357) = happyShift action_240 action_1154 (359) = happyShift action_241 action_1154 (361) = happyShift action_242 action_1154 (363) = happyShift action_243 action_1154 (370) = happyShift action_244 action_1154 (371) = happyShift action_245 action_1154 (372) = happyShift action_246 action_1154 (376) = happyShift action_247 action_1154 (380) = happyShift action_248 action_1154 (381) = happyShift action_87 action_1154 (383) = happyShift action_249 action_1154 (384) = happyShift action_250 action_1154 (403) = happyShift action_251 action_1154 (404) = happyShift action_252 action_1154 (408) = happyShift action_108 action_1154 (409) = happyShift action_109 action_1154 (107) = happyGoto action_1200 action_1154 (111) = happyGoto action_218 action_1154 (112) = happyGoto action_254 action_1154 (114) = happyGoto action_255 action_1154 (115) = happyGoto action_256 action_1154 (117) = happyGoto action_257 action_1154 (118) = happyGoto action_221 action_1154 (156) = happyGoto action_222 action_1154 (210) = happyGoto action_259 action_1154 (224) = happyGoto action_223 action_1154 (225) = happyGoto action_224 action_1154 (227) = happyGoto action_225 action_1154 (228) = happyGoto action_226 action_1154 (237) = happyGoto action_227 action_1154 (239) = happyGoto action_228 action_1154 (249) = happyGoto action_229 action_1154 _ = happyFail action_1155 (357) = happyShift action_199 action_1155 (361) = happyShift action_214 action_1155 (363) = happyShift action_201 action_1155 (372) = happyShift action_82 action_1155 (218) = happyGoto action_1094 action_1155 (219) = happyGoto action_1199 action_1155 (220) = happyGoto action_193 action_1155 (252) = happyGoto action_196 action_1155 _ = happyFail action_1156 (357) = happyShift action_199 action_1156 (361) = happyShift action_1097 action_1156 (363) = happyShift action_201 action_1156 (372) = happyShift action_1098 action_1156 (376) = happyShift action_247 action_1156 (380) = happyShift action_248 action_1156 (135) = happyGoto action_1198 action_1156 (136) = happyGoto action_1093 action_1156 (218) = happyGoto action_1094 action_1156 (219) = happyGoto action_1095 action_1156 (220) = happyGoto action_193 action_1156 (225) = happyGoto action_1096 action_1156 (227) = happyGoto action_225 action_1156 (228) = happyGoto action_226 action_1156 (252) = happyGoto action_196 action_1156 _ = happyReduce_350 action_1157 _ = happyReduce_346 action_1158 _ = happyReduce_370 action_1159 (267) = happyShift action_38 action_1159 (275) = happyShift action_41 action_1159 (287) = happyShift action_47 action_1159 (291) = happyShift action_260 action_1159 (293) = happyShift action_49 action_1159 (294) = happyShift action_50 action_1159 (295) = happyShift action_51 action_1159 (296) = happyShift action_231 action_1159 (297) = happyShift action_232 action_1159 (298) = happyShift action_233 action_1159 (302) = happyShift action_58 action_1159 (303) = happyShift action_59 action_1159 (304) = happyShift action_60 action_1159 (305) = happyShift action_61 action_1159 (306) = happyShift action_62 action_1159 (309) = happyShift action_64 action_1159 (323) = happyShift action_236 action_1159 (324) = happyShift action_237 action_1159 (346) = happyShift action_238 action_1159 (353) = happyShift action_239 action_1159 (357) = happyShift action_240 action_1159 (359) = happyShift action_241 action_1159 (361) = happyShift action_242 action_1159 (363) = happyShift action_243 action_1159 (370) = happyShift action_244 action_1159 (371) = happyShift action_245 action_1159 (372) = happyShift action_246 action_1159 (376) = happyShift action_247 action_1159 (380) = happyShift action_248 action_1159 (381) = happyShift action_87 action_1159 (383) = happyShift action_249 action_1159 (384) = happyShift action_250 action_1159 (403) = happyShift action_251 action_1159 (404) = happyShift action_252 action_1159 (408) = happyShift action_108 action_1159 (409) = happyShift action_109 action_1159 (107) = happyGoto action_253 action_1159 (111) = happyGoto action_218 action_1159 (112) = happyGoto action_254 action_1159 (114) = happyGoto action_255 action_1159 (115) = happyGoto action_256 action_1159 (117) = happyGoto action_257 action_1159 (118) = happyGoto action_221 action_1159 (119) = happyGoto action_1089 action_1159 (120) = happyGoto action_1197 action_1159 (156) = happyGoto action_222 action_1159 (210) = happyGoto action_259 action_1159 (224) = happyGoto action_223 action_1159 (225) = happyGoto action_224 action_1159 (227) = happyGoto action_225 action_1159 (228) = happyGoto action_226 action_1159 (237) = happyGoto action_227 action_1159 (239) = happyGoto action_228 action_1159 (249) = happyGoto action_229 action_1159 _ = happyFail action_1160 (393) = happyShift action_155 action_1160 (260) = happyGoto action_988 action_1160 (264) = happyGoto action_1196 action_1160 _ = happyReduce_707 action_1161 (352) = happyShift action_1195 action_1161 _ = happyFail action_1162 (344) = happyShift action_1194 action_1162 _ = happyFail action_1163 (267) = happyShift action_38 action_1163 (275) = happyShift action_41 action_1163 (287) = happyShift action_47 action_1163 (293) = happyShift action_49 action_1163 (294) = happyShift action_50 action_1163 (295) = happyShift action_51 action_1163 (296) = happyShift action_231 action_1163 (297) = happyShift action_232 action_1163 (298) = happyShift action_233 action_1163 (302) = happyShift action_58 action_1163 (303) = happyShift action_59 action_1163 (304) = happyShift action_60 action_1163 (305) = happyShift action_61 action_1163 (306) = happyShift action_62 action_1163 (309) = happyShift action_64 action_1163 (323) = happyShift action_236 action_1163 (324) = happyShift action_237 action_1163 (333) = happyShift action_278 action_1163 (342) = happyShift action_1193 action_1163 (344) = happyReduce_270 action_1163 (346) = happyShift action_238 action_1163 (353) = happyShift action_239 action_1163 (357) = happyShift action_240 action_1163 (359) = happyShift action_241 action_1163 (361) = happyShift action_242 action_1163 (363) = happyShift action_243 action_1163 (369) = happyShift action_595 action_1163 (370) = happyShift action_244 action_1163 (371) = happyShift action_245 action_1163 (372) = happyShift action_246 action_1163 (374) = happyShift action_286 action_1163 (376) = happyShift action_247 action_1163 (380) = happyShift action_248 action_1163 (383) = happyShift action_249 action_1163 (384) = happyShift action_250 action_1163 (403) = happyShift action_251 action_1163 (404) = happyShift action_252 action_1163 (408) = happyShift action_108 action_1163 (409) = happyShift action_109 action_1163 (111) = happyGoto action_218 action_1163 (118) = happyGoto action_551 action_1163 (156) = happyGoto action_222 action_1163 (221) = happyGoto action_1192 action_1163 (224) = happyGoto action_223 action_1163 (225) = happyGoto action_224 action_1163 (227) = happyGoto action_225 action_1163 (228) = happyGoto action_226 action_1163 (237) = happyGoto action_227 action_1163 (239) = happyGoto action_228 action_1163 (249) = happyGoto action_229 action_1163 (254) = happyGoto action_397 action_1163 _ = happyReduce_360 action_1164 (393) = happyShift action_155 action_1164 (260) = happyGoto action_988 action_1164 (264) = happyGoto action_1191 action_1164 _ = happyReduce_707 action_1165 _ = happyReduce_43 action_1166 _ = happyReduce_55 action_1167 (333) = happyShift action_278 action_1167 (362) = happyShift action_306 action_1167 (368) = happyShift action_307 action_1167 (374) = happyShift action_286 action_1167 (378) = happyShift action_288 action_1167 (253) = happyGoto action_472 action_1167 (254) = happyGoto action_277 action_1167 (258) = happyGoto action_442 action_1167 _ = happyFail action_1168 _ = happyReduce_63 action_1169 _ = happyReduce_54 action_1170 _ = happyReduce_53 action_1171 (267) = happyShift action_38 action_1171 (275) = happyShift action_41 action_1171 (287) = happyShift action_47 action_1171 (289) = happyShift action_1081 action_1171 (291) = happyShift action_48 action_1171 (293) = happyShift action_49 action_1171 (294) = happyShift action_50 action_1171 (295) = happyShift action_51 action_1171 (296) = happyShift action_52 action_1171 (297) = happyShift action_53 action_1171 (298) = happyShift action_54 action_1171 (300) = happyShift action_56 action_1171 (301) = happyShift action_57 action_1171 (302) = happyShift action_58 action_1171 (303) = happyShift action_59 action_1171 (304) = happyShift action_60 action_1171 (305) = happyShift action_61 action_1171 (306) = happyShift action_62 action_1171 (309) = happyShift action_64 action_1171 (332) = happyShift action_1189 action_1171 (357) = happyShift action_199 action_1171 (361) = happyShift action_333 action_1171 (362) = happyShift action_1190 action_1171 (363) = happyShift action_201 action_1171 (371) = happyShift action_81 action_1171 (372) = happyShift action_82 action_1171 (375) = happyShift action_83 action_1171 (376) = happyShift action_84 action_1171 (379) = happyShift action_85 action_1171 (380) = happyShift action_86 action_1171 (36) = happyGoto action_1187 action_1171 (37) = happyGoto action_1188 action_1171 (38) = happyGoto action_1079 action_1171 (217) = happyGoto action_27 action_1171 (220) = happyGoto action_28 action_1171 (241) = happyGoto action_335 action_1171 (242) = happyGoto action_31 action_1171 (243) = happyGoto action_117 action_1171 (249) = happyGoto action_33 action_1171 (251) = happyGoto action_34 action_1171 (252) = happyGoto action_35 action_1171 _ = happyFail action_1172 (368) = happyShift action_1186 action_1172 _ = happyReduce_46 action_1173 (1) = happyShift action_424 action_1173 (356) = happyShift action_425 action_1173 (256) = happyGoto action_1185 action_1173 _ = happyFail action_1174 _ = happyReduce_33 action_1175 (367) = happyShift action_1184 action_1175 _ = happyReduce_31 action_1176 _ = happyReduce_68 action_1177 (354) = happyShift action_1183 action_1177 _ = happyFail action_1178 (266) = happyShift action_37 action_1178 (267) = happyShift action_38 action_1178 (268) = happyShift action_39 action_1178 (273) = happyShift action_40 action_1178 (275) = happyShift action_41 action_1178 (276) = happyShift action_42 action_1178 (283) = happyShift action_46 action_1178 (287) = happyShift action_47 action_1178 (291) = happyShift action_48 action_1178 (293) = happyShift action_49 action_1178 (294) = happyShift action_50 action_1178 (295) = happyShift action_51 action_1178 (296) = happyShift action_52 action_1178 (297) = happyShift action_53 action_1178 (298) = happyShift action_54 action_1178 (299) = happyShift action_55 action_1178 (300) = happyShift action_56 action_1178 (301) = happyShift action_57 action_1178 (302) = happyShift action_58 action_1178 (303) = happyShift action_59 action_1178 (304) = happyShift action_60 action_1178 (305) = happyShift action_61 action_1178 (306) = happyShift action_62 action_1178 (307) = happyShift action_63 action_1178 (309) = happyShift action_64 action_1178 (318) = happyShift action_68 action_1178 (319) = happyShift action_69 action_1178 (320) = happyShift action_70 action_1178 (336) = happyShift action_72 action_1178 (342) = happyShift action_73 action_1178 (345) = happyShift action_74 action_1178 (357) = happyShift action_75 action_1178 (359) = happyShift action_76 action_1178 (361) = happyShift action_118 action_1178 (363) = happyShift action_78 action_1178 (365) = happyShift action_79 action_1178 (370) = happyShift action_80 action_1178 (371) = happyShift action_81 action_1178 (372) = happyShift action_82 action_1178 (375) = happyShift action_83 action_1178 (376) = happyShift action_84 action_1178 (379) = happyShift action_85 action_1178 (380) = happyShift action_86 action_1178 (381) = happyShift action_87 action_1178 (382) = happyShift action_88 action_1178 (383) = happyShift action_89 action_1178 (384) = happyShift action_90 action_1178 (385) = happyShift action_91 action_1178 (386) = happyShift action_92 action_1178 (387) = happyShift action_93 action_1178 (388) = happyShift action_94 action_1178 (389) = happyShift action_95 action_1178 (390) = happyShift action_96 action_1178 (391) = happyShift action_97 action_1178 (396) = happyShift action_98 action_1178 (397) = happyShift action_99 action_1178 (398) = happyShift action_100 action_1178 (399) = happyShift action_101 action_1178 (401) = happyShift action_102 action_1178 (403) = happyShift action_103 action_1178 (404) = happyShift action_104 action_1178 (405) = happyShift action_105 action_1178 (406) = happyShift action_106 action_1178 (407) = happyShift action_107 action_1178 (408) = happyShift action_108 action_1178 (409) = happyShift action_109 action_1178 (38) = happyGoto action_13 action_1178 (156) = happyGoto action_16 action_1178 (157) = happyGoto action_1182 action_1178 (158) = happyGoto action_116 action_1178 (159) = happyGoto action_18 action_1178 (161) = happyGoto action_19 action_1178 (162) = happyGoto action_20 action_1178 (163) = happyGoto action_21 action_1178 (164) = happyGoto action_22 action_1178 (165) = happyGoto action_23 action_1178 (166) = happyGoto action_24 action_1178 (167) = happyGoto action_25 action_1178 (210) = happyGoto action_26 action_1178 (217) = happyGoto action_27 action_1178 (220) = happyGoto action_28 action_1178 (241) = happyGoto action_30 action_1178 (242) = happyGoto action_31 action_1178 (243) = happyGoto action_117 action_1178 (249) = happyGoto action_33 action_1178 (251) = happyGoto action_34 action_1178 (252) = happyGoto action_35 action_1178 (255) = happyGoto action_36 action_1178 _ = happyFail action_1179 (384) = happyShift action_1181 action_1179 _ = happyFail action_1180 _ = happyReduce_413 action_1181 (331) = happyShift action_1230 action_1181 _ = happyFail action_1182 _ = happyReduce_500 action_1183 _ = happyReduce_27 action_1184 (266) = happyShift action_37 action_1184 (267) = happyShift action_38 action_1184 (268) = happyShift action_39 action_1184 (269) = happyShift action_137 action_1184 (270) = happyShift action_138 action_1184 (271) = happyShift action_139 action_1184 (272) = happyShift action_140 action_1184 (273) = happyShift action_40 action_1184 (275) = happyShift action_41 action_1184 (276) = happyShift action_42 action_1184 (277) = happyShift action_159 action_1184 (279) = happyShift action_43 action_1184 (280) = happyShift action_44 action_1184 (281) = happyShift action_45 action_1184 (282) = happyShift action_141 action_1184 (283) = happyShift action_46 action_1184 (285) = happyShift action_142 action_1184 (287) = happyShift action_47 action_1184 (289) = happyShift action_143 action_1184 (291) = happyShift action_48 action_1184 (292) = happyShift action_144 action_1184 (293) = happyShift action_49 action_1184 (294) = happyShift action_50 action_1184 (295) = happyShift action_51 action_1184 (296) = happyShift action_52 action_1184 (297) = happyShift action_53 action_1184 (298) = happyShift action_54 action_1184 (299) = happyShift action_55 action_1184 (300) = happyShift action_56 action_1184 (301) = happyShift action_57 action_1184 (302) = happyShift action_58 action_1184 (303) = happyShift action_59 action_1184 (304) = happyShift action_60 action_1184 (305) = happyShift action_61 action_1184 (306) = happyShift action_62 action_1184 (307) = happyShift action_63 action_1184 (309) = happyShift action_64 action_1184 (312) = happyShift action_145 action_1184 (313) = happyShift action_65 action_1184 (314) = happyShift action_66 action_1184 (315) = happyShift action_67 action_1184 (317) = happyShift action_146 action_1184 (318) = happyShift action_68 action_1184 (319) = happyShift action_69 action_1184 (320) = happyShift action_70 action_1184 (321) = happyShift action_147 action_1184 (322) = happyShift action_148 action_1184 (325) = happyShift action_149 action_1184 (326) = happyShift action_150 action_1184 (327) = happyShift action_151 action_1184 (328) = happyShift action_152 action_1184 (329) = happyShift action_71 action_1184 (336) = happyShift action_72 action_1184 (342) = happyShift action_73 action_1184 (345) = happyShift action_74 action_1184 (346) = happyShift action_153 action_1184 (357) = happyShift action_75 action_1184 (359) = happyShift action_76 action_1184 (361) = happyShift action_77 action_1184 (363) = happyShift action_78 action_1184 (365) = happyShift action_79 action_1184 (370) = happyShift action_80 action_1184 (371) = happyShift action_81 action_1184 (372) = happyShift action_82 action_1184 (375) = happyShift action_83 action_1184 (376) = happyShift action_84 action_1184 (379) = happyShift action_85 action_1184 (380) = happyShift action_86 action_1184 (381) = happyShift action_87 action_1184 (382) = happyShift action_88 action_1184 (383) = happyShift action_89 action_1184 (384) = happyShift action_90 action_1184 (385) = happyShift action_91 action_1184 (386) = happyShift action_92 action_1184 (387) = happyShift action_93 action_1184 (388) = happyShift action_94 action_1184 (389) = happyShift action_95 action_1184 (390) = happyShift action_96 action_1184 (391) = happyShift action_97 action_1184 (392) = happyShift action_154 action_1184 (393) = happyShift action_155 action_1184 (394) = happyShift action_156 action_1184 (395) = happyShift action_157 action_1184 (396) = happyShift action_98 action_1184 (397) = happyShift action_99 action_1184 (398) = happyShift action_100 action_1184 (399) = happyShift action_101 action_1184 (401) = happyShift action_102 action_1184 (403) = happyShift action_103 action_1184 (404) = happyShift action_104 action_1184 (405) = happyShift action_105 action_1184 (406) = happyShift action_106 action_1184 (407) = happyShift action_107 action_1184 (408) = happyShift action_108 action_1184 (409) = happyShift action_109 action_1184 (25) = happyGoto action_1228 action_1184 (38) = happyGoto action_13 action_1184 (40) = happyGoto action_1229 action_1184 (49) = happyGoto action_14 action_1184 (51) = happyGoto action_477 action_1184 (52) = happyGoto action_478 action_1184 (53) = happyGoto action_120 action_1184 (54) = happyGoto action_121 action_1184 (55) = happyGoto action_122 action_1184 (63) = happyGoto action_123 action_1184 (67) = happyGoto action_124 action_1184 (68) = happyGoto action_125 action_1184 (72) = happyGoto action_126 action_1184 (100) = happyGoto action_127 action_1184 (146) = happyGoto action_128 action_1184 (147) = happyGoto action_129 action_1184 (148) = happyGoto action_130 action_1184 (153) = happyGoto action_131 action_1184 (156) = happyGoto action_16 action_1184 (158) = happyGoto action_132 action_1184 (159) = happyGoto action_18 action_1184 (161) = happyGoto action_19 action_1184 (162) = happyGoto action_20 action_1184 (163) = happyGoto action_21 action_1184 (164) = happyGoto action_22 action_1184 (165) = happyGoto action_23 action_1184 (166) = happyGoto action_24 action_1184 (167) = happyGoto action_25 action_1184 (210) = happyGoto action_26 action_1184 (217) = happyGoto action_27 action_1184 (220) = happyGoto action_28 action_1184 (240) = happyGoto action_29 action_1184 (241) = happyGoto action_30 action_1184 (242) = happyGoto action_31 action_1184 (243) = happyGoto action_32 action_1184 (249) = happyGoto action_33 action_1184 (251) = happyGoto action_34 action_1184 (252) = happyGoto action_35 action_1184 (255) = happyGoto action_36 action_1184 (259) = happyGoto action_133 action_1184 (260) = happyGoto action_134 action_1184 (261) = happyGoto action_135 action_1184 (262) = happyGoto action_136 action_1184 _ = happyReduce_67 action_1185 _ = happyReduce_28 action_1186 (392) = happyShift action_154 action_1186 (394) = happyShift action_156 action_1186 (395) = happyShift action_157 action_1186 (31) = happyGoto action_1226 action_1186 (32) = happyGoto action_1227 action_1186 (33) = happyGoto action_1035 action_1186 (259) = happyGoto action_1036 action_1186 (261) = happyGoto action_1037 action_1186 (262) = happyGoto action_1038 action_1186 _ = happyReduce_49 action_1187 (362) = happyShift action_1224 action_1187 (368) = happyShift action_1225 action_1187 _ = happyFail action_1188 _ = happyReduce_61 action_1189 (362) = happyShift action_1223 action_1189 _ = happyFail action_1190 _ = happyReduce_58 action_1191 _ = happyReduce_357 action_1192 (267) = happyShift action_38 action_1192 (275) = happyShift action_41 action_1192 (287) = happyShift action_47 action_1192 (293) = happyShift action_49 action_1192 (294) = happyShift action_50 action_1192 (295) = happyShift action_51 action_1192 (296) = happyShift action_231 action_1192 (297) = happyShift action_232 action_1192 (298) = happyShift action_233 action_1192 (302) = happyShift action_58 action_1192 (303) = happyShift action_59 action_1192 (304) = happyShift action_60 action_1192 (305) = happyShift action_61 action_1192 (306) = happyShift action_62 action_1192 (309) = happyShift action_64 action_1192 (323) = happyShift action_236 action_1192 (324) = happyShift action_237 action_1192 (346) = happyShift action_238 action_1192 (353) = happyShift action_239 action_1192 (357) = happyShift action_240 action_1192 (359) = happyShift action_241 action_1192 (361) = happyShift action_242 action_1192 (363) = happyShift action_243 action_1192 (370) = happyShift action_244 action_1192 (371) = happyShift action_245 action_1192 (372) = happyShift action_246 action_1192 (376) = happyShift action_247 action_1192 (380) = happyShift action_248 action_1192 (383) = happyShift action_249 action_1192 (384) = happyShift action_250 action_1192 (403) = happyShift action_251 action_1192 (404) = happyShift action_252 action_1192 (408) = happyShift action_108 action_1192 (409) = happyShift action_109 action_1192 (111) = happyGoto action_218 action_1192 (117) = happyGoto action_1222 action_1192 (118) = happyGoto action_221 action_1192 (156) = happyGoto action_222 action_1192 (224) = happyGoto action_223 action_1192 (225) = happyGoto action_224 action_1192 (227) = happyGoto action_225 action_1192 (228) = happyGoto action_226 action_1192 (237) = happyGoto action_227 action_1192 (239) = happyGoto action_228 action_1192 (249) = happyGoto action_229 action_1192 _ = happyFail action_1193 (267) = happyShift action_38 action_1193 (275) = happyShift action_41 action_1193 (287) = happyShift action_47 action_1193 (293) = happyShift action_49 action_1193 (294) = happyShift action_50 action_1193 (295) = happyShift action_51 action_1193 (296) = happyShift action_231 action_1193 (297) = happyShift action_232 action_1193 (298) = happyShift action_233 action_1193 (302) = happyShift action_58 action_1193 (303) = happyShift action_59 action_1193 (304) = happyShift action_60 action_1193 (305) = happyShift action_61 action_1193 (306) = happyShift action_62 action_1193 (309) = happyShift action_64 action_1193 (323) = happyShift action_236 action_1193 (324) = happyShift action_237 action_1193 (346) = happyShift action_238 action_1193 (353) = happyShift action_239 action_1193 (357) = happyShift action_240 action_1193 (359) = happyShift action_241 action_1193 (361) = happyShift action_242 action_1193 (363) = happyShift action_243 action_1193 (370) = happyShift action_244 action_1193 (371) = happyShift action_245 action_1193 (372) = happyShift action_246 action_1193 (376) = happyShift action_247 action_1193 (380) = happyShift action_248 action_1193 (383) = happyShift action_249 action_1193 (384) = happyShift action_250 action_1193 (403) = happyShift action_251 action_1193 (404) = happyShift action_252 action_1193 (408) = happyShift action_108 action_1193 (409) = happyShift action_109 action_1193 (111) = happyGoto action_218 action_1193 (117) = happyGoto action_1221 action_1193 (118) = happyGoto action_221 action_1193 (156) = happyGoto action_222 action_1193 (224) = happyGoto action_223 action_1193 (225) = happyGoto action_224 action_1193 (227) = happyGoto action_225 action_1193 (228) = happyGoto action_226 action_1193 (237) = happyGoto action_227 action_1193 (239) = happyGoto action_228 action_1193 (249) = happyGoto action_229 action_1193 _ = happyFail action_1194 (267) = happyShift action_38 action_1194 (275) = happyShift action_41 action_1194 (287) = happyShift action_47 action_1194 (293) = happyShift action_49 action_1194 (294) = happyShift action_50 action_1194 (295) = happyShift action_51 action_1194 (296) = happyShift action_231 action_1194 (297) = happyShift action_232 action_1194 (298) = happyShift action_233 action_1194 (302) = happyShift action_58 action_1194 (303) = happyShift action_59 action_1194 (304) = happyShift action_60 action_1194 (305) = happyShift action_61 action_1194 (306) = happyShift action_62 action_1194 (309) = happyShift action_64 action_1194 (323) = happyShift action_236 action_1194 (324) = happyShift action_237 action_1194 (346) = happyShift action_238 action_1194 (353) = happyShift action_239 action_1194 (357) = happyShift action_240 action_1194 (359) = happyShift action_241 action_1194 (361) = happyShift action_242 action_1194 (363) = happyShift action_243 action_1194 (370) = happyShift action_244 action_1194 (371) = happyShift action_245 action_1194 (372) = happyShift action_246 action_1194 (376) = happyShift action_247 action_1194 (380) = happyShift action_248 action_1194 (383) = happyShift action_249 action_1194 (384) = happyShift action_250 action_1194 (403) = happyShift action_251 action_1194 (404) = happyShift action_252 action_1194 (408) = happyShift action_108 action_1194 (409) = happyShift action_109 action_1194 (111) = happyGoto action_218 action_1194 (117) = happyGoto action_1219 action_1194 (118) = happyGoto action_221 action_1194 (141) = happyGoto action_1220 action_1194 (156) = happyGoto action_222 action_1194 (224) = happyGoto action_223 action_1194 (225) = happyGoto action_224 action_1194 (227) = happyGoto action_225 action_1194 (228) = happyGoto action_226 action_1194 (237) = happyGoto action_227 action_1194 (239) = happyGoto action_228 action_1194 (249) = happyGoto action_229 action_1194 _ = happyFail action_1195 _ = happyReduce_358 action_1196 (392) = happyShift action_154 action_1196 (139) = happyGoto action_1218 action_1196 (259) = happyGoto action_575 action_1196 (265) = happyGoto action_1029 action_1196 _ = happyReduce_709 action_1197 _ = happyReduce_315 action_1198 _ = happyReduce_348 action_1199 _ = happyReduce_583 action_1200 _ = happyReduce_351 action_1201 (354) = happyShift action_1217 action_1201 _ = happyFail action_1202 _ = happyReduce_137 action_1203 _ = happyReduce_170 action_1204 _ = happyReduce_135 action_1205 _ = happyReduce_143 action_1206 (272) = happyShift action_890 action_1206 (145) = happyGoto action_1216 action_1206 _ = happyReduce_367 action_1207 _ = happyReduce_341 action_1208 (267) = happyShift action_38 action_1208 (275) = happyShift action_41 action_1208 (287) = happyShift action_47 action_1208 (293) = happyShift action_49 action_1208 (294) = happyShift action_50 action_1208 (295) = happyShift action_51 action_1208 (296) = happyShift action_231 action_1208 (297) = happyShift action_232 action_1208 (298) = happyShift action_233 action_1208 (302) = happyShift action_58 action_1208 (303) = happyShift action_59 action_1208 (304) = happyShift action_60 action_1208 (305) = happyShift action_61 action_1208 (306) = happyShift action_62 action_1208 (309) = happyShift action_64 action_1208 (347) = happyShift action_934 action_1208 (357) = happyShift action_935 action_1208 (361) = happyShift action_936 action_1208 (371) = happyShift action_245 action_1208 (372) = happyShift action_246 action_1208 (376) = happyShift action_247 action_1208 (380) = happyShift action_248 action_1208 (129) = happyGoto action_1141 action_1208 (130) = happyGoto action_929 action_1208 (131) = happyGoto action_930 action_1208 (132) = happyGoto action_931 action_1208 (133) = happyGoto action_1215 action_1208 (227) = happyGoto action_932 action_1208 (228) = happyGoto action_226 action_1208 (237) = happyGoto action_933 action_1208 (239) = happyGoto action_228 action_1208 (249) = happyGoto action_229 action_1208 _ = happyFail action_1209 _ = happyReduce_131 action_1210 _ = happyReduce_215 action_1211 (362) = happyShift action_1214 action_1211 _ = happyFail action_1212 (392) = happyShift action_154 action_1212 (394) = happyShift action_156 action_1212 (395) = happyShift action_157 action_1212 (30) = happyGoto action_1213 action_1212 (31) = happyGoto action_1033 action_1212 (32) = happyGoto action_1034 action_1212 (33) = happyGoto action_1035 action_1212 (259) = happyGoto action_1036 action_1212 (261) = happyGoto action_1037 action_1212 (262) = happyGoto action_1038 action_1212 _ = happyReduce_49 action_1213 (362) = happyShift action_1234 action_1213 _ = happyFail action_1214 _ = happyReduce_83 action_1215 _ = happyReduce_344 action_1216 _ = happyReduce_144 action_1217 (334) = happyShift action_1233 action_1217 _ = happyFail action_1218 _ = happyReduce_354 action_1219 (267) = happyShift action_38 action_1219 (275) = happyShift action_41 action_1219 (287) = happyShift action_47 action_1219 (293) = happyShift action_49 action_1219 (294) = happyShift action_50 action_1219 (295) = happyShift action_51 action_1219 (296) = happyShift action_231 action_1219 (297) = happyShift action_232 action_1219 (298) = happyShift action_233 action_1219 (302) = happyShift action_58 action_1219 (303) = happyShift action_59 action_1219 (304) = happyShift action_60 action_1219 (305) = happyShift action_61 action_1219 (306) = happyShift action_62 action_1219 (309) = happyShift action_64 action_1219 (323) = happyShift action_236 action_1219 (324) = happyShift action_237 action_1219 (333) = happyShift action_278 action_1219 (346) = happyShift action_238 action_1219 (353) = happyShift action_239 action_1219 (357) = happyShift action_240 action_1219 (359) = happyShift action_241 action_1219 (361) = happyShift action_242 action_1219 (363) = happyShift action_243 action_1219 (369) = happyShift action_595 action_1219 (370) = happyShift action_244 action_1219 (371) = happyShift action_245 action_1219 (372) = happyShift action_246 action_1219 (374) = happyShift action_286 action_1219 (376) = happyShift action_247 action_1219 (380) = happyShift action_248 action_1219 (383) = happyShift action_249 action_1219 (384) = happyShift action_250 action_1219 (403) = happyShift action_251 action_1219 (404) = happyShift action_252 action_1219 (408) = happyShift action_108 action_1219 (409) = happyShift action_109 action_1219 (111) = happyGoto action_218 action_1219 (118) = happyGoto action_551 action_1219 (156) = happyGoto action_222 action_1219 (221) = happyGoto action_1192 action_1219 (224) = happyGoto action_223 action_1219 (225) = happyGoto action_224 action_1219 (227) = happyGoto action_225 action_1219 (228) = happyGoto action_226 action_1219 (237) = happyGoto action_227 action_1219 (239) = happyGoto action_228 action_1219 (249) = happyGoto action_229 action_1219 (254) = happyGoto action_397 action_1219 _ = happyReduce_360 action_1220 (393) = happyShift action_155 action_1220 (260) = happyGoto action_988 action_1220 (264) = happyGoto action_1232 action_1220 _ = happyReduce_707 action_1221 (267) = happyShift action_38 action_1221 (275) = happyShift action_41 action_1221 (287) = happyShift action_47 action_1221 (293) = happyShift action_49 action_1221 (294) = happyShift action_50 action_1221 (295) = happyShift action_51 action_1221 (296) = happyShift action_231 action_1221 (297) = happyShift action_232 action_1221 (298) = happyShift action_233 action_1221 (302) = happyShift action_58 action_1221 (303) = happyShift action_59 action_1221 (304) = happyShift action_60 action_1221 (305) = happyShift action_61 action_1221 (306) = happyShift action_62 action_1221 (309) = happyShift action_64 action_1221 (323) = happyShift action_236 action_1221 (324) = happyShift action_237 action_1221 (346) = happyShift action_238 action_1221 (353) = happyShift action_239 action_1221 (357) = happyShift action_240 action_1221 (359) = happyShift action_241 action_1221 (361) = happyShift action_242 action_1221 (363) = happyShift action_243 action_1221 (370) = happyShift action_244 action_1221 (371) = happyShift action_245 action_1221 (372) = happyShift action_246 action_1221 (376) = happyShift action_247 action_1221 (380) = happyShift action_248 action_1221 (383) = happyShift action_249 action_1221 (384) = happyShift action_250 action_1221 (403) = happyShift action_251 action_1221 (404) = happyShift action_252 action_1221 (408) = happyShift action_108 action_1221 (409) = happyShift action_109 action_1221 (111) = happyGoto action_218 action_1221 (118) = happyGoto action_551 action_1221 (156) = happyGoto action_222 action_1221 (224) = happyGoto action_223 action_1221 (225) = happyGoto action_224 action_1221 (227) = happyGoto action_225 action_1221 (228) = happyGoto action_226 action_1221 (237) = happyGoto action_227 action_1221 (239) = happyGoto action_228 action_1221 (249) = happyGoto action_229 action_1221 _ = happyReduce_269 action_1222 (267) = happyShift action_38 action_1222 (275) = happyShift action_41 action_1222 (287) = happyShift action_47 action_1222 (293) = happyShift action_49 action_1222 (294) = happyShift action_50 action_1222 (295) = happyShift action_51 action_1222 (296) = happyShift action_231 action_1222 (297) = happyShift action_232 action_1222 (298) = happyShift action_233 action_1222 (302) = happyShift action_58 action_1222 (303) = happyShift action_59 action_1222 (304) = happyShift action_60 action_1222 (305) = happyShift action_61 action_1222 (306) = happyShift action_62 action_1222 (309) = happyShift action_64 action_1222 (323) = happyShift action_236 action_1222 (324) = happyShift action_237 action_1222 (346) = happyShift action_238 action_1222 (353) = happyShift action_239 action_1222 (357) = happyShift action_240 action_1222 (359) = happyShift action_241 action_1222 (361) = happyShift action_242 action_1222 (363) = happyShift action_243 action_1222 (370) = happyShift action_244 action_1222 (371) = happyShift action_245 action_1222 (372) = happyShift action_246 action_1222 (376) = happyShift action_247 action_1222 (380) = happyShift action_248 action_1222 (383) = happyShift action_249 action_1222 (384) = happyShift action_250 action_1222 (403) = happyShift action_251 action_1222 (404) = happyShift action_252 action_1222 (408) = happyShift action_108 action_1222 (409) = happyShift action_109 action_1222 (111) = happyGoto action_218 action_1222 (118) = happyGoto action_551 action_1222 (156) = happyGoto action_222 action_1222 (224) = happyGoto action_223 action_1222 (225) = happyGoto action_224 action_1222 (227) = happyGoto action_225 action_1222 (228) = happyGoto action_226 action_1222 (237) = happyGoto action_227 action_1222 (239) = happyGoto action_228 action_1222 (249) = happyGoto action_229 action_1222 _ = happyReduce_361 action_1223 _ = happyReduce_57 action_1224 _ = happyReduce_59 action_1225 (267) = happyShift action_38 action_1225 (275) = happyShift action_41 action_1225 (287) = happyShift action_47 action_1225 (289) = happyShift action_1081 action_1225 (291) = happyShift action_48 action_1225 (293) = happyShift action_49 action_1225 (294) = happyShift action_50 action_1225 (295) = happyShift action_51 action_1225 (296) = happyShift action_52 action_1225 (297) = happyShift action_53 action_1225 (298) = happyShift action_54 action_1225 (300) = happyShift action_56 action_1225 (301) = happyShift action_57 action_1225 (302) = happyShift action_58 action_1225 (303) = happyShift action_59 action_1225 (304) = happyShift action_60 action_1225 (305) = happyShift action_61 action_1225 (306) = happyShift action_62 action_1225 (309) = happyShift action_64 action_1225 (357) = happyShift action_199 action_1225 (361) = happyShift action_333 action_1225 (363) = happyShift action_201 action_1225 (371) = happyShift action_81 action_1225 (372) = happyShift action_82 action_1225 (375) = happyShift action_83 action_1225 (376) = happyShift action_84 action_1225 (379) = happyShift action_85 action_1225 (380) = happyShift action_86 action_1225 (37) = happyGoto action_1231 action_1225 (38) = happyGoto action_1079 action_1225 (217) = happyGoto action_27 action_1225 (220) = happyGoto action_28 action_1225 (241) = happyGoto action_335 action_1225 (242) = happyGoto action_31 action_1225 (243) = happyGoto action_117 action_1225 (249) = happyGoto action_33 action_1225 (251) = happyGoto action_34 action_1225 (252) = happyGoto action_35 action_1225 _ = happyFail action_1226 _ = happyReduce_45 action_1227 (267) = happyShift action_38 action_1227 (275) = happyShift action_41 action_1227 (284) = happyShift action_1080 action_1227 (287) = happyShift action_47 action_1227 (289) = happyShift action_1081 action_1227 (291) = happyShift action_48 action_1227 (293) = happyShift action_49 action_1227 (294) = happyShift action_50 action_1227 (295) = happyShift action_51 action_1227 (296) = happyShift action_52 action_1227 (297) = happyShift action_53 action_1227 (298) = happyShift action_54 action_1227 (300) = happyShift action_56 action_1227 (301) = happyShift action_57 action_1227 (302) = happyShift action_58 action_1227 (303) = happyShift action_59 action_1227 (304) = happyShift action_60 action_1227 (305) = happyShift action_61 action_1227 (306) = happyShift action_62 action_1227 (309) = happyShift action_64 action_1227 (312) = happyShift action_1082 action_1227 (357) = happyShift action_199 action_1227 (361) = happyShift action_333 action_1227 (363) = happyShift action_201 action_1227 (371) = happyShift action_81 action_1227 (372) = happyShift action_82 action_1227 (375) = happyShift action_83 action_1227 (376) = happyShift action_84 action_1227 (379) = happyShift action_85 action_1227 (380) = happyShift action_86 action_1227 (34) = happyGoto action_1077 action_1227 (37) = happyGoto action_1078 action_1227 (38) = happyGoto action_1079 action_1227 (217) = happyGoto action_27 action_1227 (220) = happyGoto action_28 action_1227 (241) = happyGoto action_335 action_1227 (242) = happyGoto action_31 action_1227 (243) = happyGoto action_117 action_1227 (249) = happyGoto action_33 action_1227 (251) = happyGoto action_34 action_1227 (252) = happyGoto action_35 action_1227 _ = happyReduce_47 action_1228 _ = happyReduce_32 action_1229 _ = happyReduce_66 action_1230 _ = happyReduce_428 action_1231 _ = happyReduce_60 action_1232 _ = happyReduce_356 action_1233 (267) = happyShift action_38 action_1233 (275) = happyShift action_41 action_1233 (287) = happyShift action_47 action_1233 (291) = happyShift action_260 action_1233 (293) = happyShift action_49 action_1233 (294) = happyShift action_50 action_1233 (295) = happyShift action_51 action_1233 (296) = happyShift action_231 action_1233 (297) = happyShift action_232 action_1233 (298) = happyShift action_233 action_1233 (302) = happyShift action_58 action_1233 (303) = happyShift action_59 action_1233 (304) = happyShift action_60 action_1233 (305) = happyShift action_61 action_1233 (306) = happyShift action_62 action_1233 (309) = happyShift action_64 action_1233 (323) = happyShift action_236 action_1233 (324) = happyShift action_237 action_1233 (346) = happyShift action_238 action_1233 (353) = happyShift action_239 action_1233 (357) = happyShift action_240 action_1233 (359) = happyShift action_241 action_1233 (361) = happyShift action_242 action_1233 (363) = happyShift action_243 action_1233 (370) = happyShift action_244 action_1233 (371) = happyShift action_245 action_1233 (372) = happyShift action_246 action_1233 (376) = happyShift action_247 action_1233 (380) = happyShift action_248 action_1233 (381) = happyShift action_87 action_1233 (383) = happyShift action_249 action_1233 (384) = happyShift action_250 action_1233 (403) = happyShift action_251 action_1233 (404) = happyShift action_252 action_1233 (408) = happyShift action_108 action_1233 (409) = happyShift action_109 action_1233 (107) = happyGoto action_1235 action_1233 (111) = happyGoto action_218 action_1233 (112) = happyGoto action_254 action_1233 (114) = happyGoto action_255 action_1233 (115) = happyGoto action_256 action_1233 (117) = happyGoto action_257 action_1233 (118) = happyGoto action_221 action_1233 (156) = happyGoto action_222 action_1233 (210) = happyGoto action_259 action_1233 (224) = happyGoto action_223 action_1233 (225) = happyGoto action_224 action_1233 (227) = happyGoto action_225 action_1233 (228) = happyGoto action_226 action_1233 (237) = happyGoto action_227 action_1233 (239) = happyGoto action_228 action_1233 (249) = happyGoto action_229 action_1233 _ = happyFail action_1234 _ = happyReduce_84 action_1235 _ = happyReduce_352 happyReduce_12 = happySpecReduce_1 15 happyReduction_12 happyReduction_12 (HappyAbsSyn75 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` (HappyAbsSyn257 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` (HappyAbsSyn257 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 _ (HappyAbsSyn98 happy_var_2) _ = HappyAbsSyn21 (Just (DeprecatedTxt $ unLoc happy_var_2) ) happyReduction_24 _ _ _ = notHappyAtAll happyReduce_25 = happySpecReduce_3 21 happyReduction_25 happyReduction_25 _ (HappyAbsSyn98 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` (HappyAbsSyn257 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 (fromOL 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 `appOL` 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` (HappyAbsSyn30 happy_var_2) `HappyStk` (HappyAbsSyn30 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn30 (happy_var_1 `appOL` happy_var_2 `appOL` happy_var_3 `appOL` happy_var_5 ) `HappyStk` happyRest happyReduce_46 = happySpecReduce_3 31 happyReduction_46 happyReduction_46 (HappyAbsSyn30 happy_var_3) (HappyAbsSyn30 happy_var_2) (HappyAbsSyn30 happy_var_1) = HappyAbsSyn30 (happy_var_1 `appOL` happy_var_2 `appOL` 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) (HappyAbsSyn30 happy_var_1) = HappyAbsSyn30 (happy_var_1 `appOL` happy_var_2 ) happyReduction_48 _ _ = notHappyAtAll happyReduce_49 = happySpecReduce_0 32 happyReduction_49 happyReduction_49 = HappyAbsSyn30 (nilOL ) happyReduce_50 = happySpecReduce_1 33 happyReduction_50 happyReduction_50 (HappyAbsSyn262 happy_var_1) = HappyAbsSyn30 (unitOL (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 (HappyAbsSyn261 happy_var_1) = HappyAbsSyn30 (unitOL (sL (getLoc happy_var_1) (IEDocNamed ((fst . unLoc) happy_var_1))) ) happyReduction_51 _ = notHappyAtAll happyReduce_52 = happySpecReduce_1 33 happyReduction_52 happyReduction_52 (HappyAbsSyn259 happy_var_1) = HappyAbsSyn30 (unitOL (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) = HappyAbsSyn30 (unitOL (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 (HappyAbsSyn257 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn30 (unitOL (sL (comb2 happy_var_1 happy_var_2) (IEModuleContents (unLoc happy_var_2))) ) happyReduction_54 _ _ = notHappyAtAll happyReduce_55 = happySpecReduce_2 34 happyReduction_55 happyReduction_55 (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn30 (unitOL (sL (comb2 happy_var_1 happy_var_2) (IEVar (unLoc happy_var_2))) ) happyReduction_55 _ _ = notHappyAtAll happyReduce_56 = happySpecReduce_0 35 happyReduction_56 happyReduction_56 = HappyAbsSyn35 (L noSrcSpan ImpExpAbs ) happyReduce_57 = happySpecReduce_3 35 happyReduction_57 happyReduction_57 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn35 (sL (comb2 happy_var_1 happy_var_3) ImpExpAll ) happyReduction_57 _ _ _ = notHappyAtAll happyReduce_58 = happySpecReduce_2 35 happyReduction_58 happyReduction_58 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn35 (sL (comb2 happy_var_1 happy_var_2) (ImpExpList []) ) happyReduction_58 _ _ = notHappyAtAll happyReduce_59 = happySpecReduce_3 35 happyReduction_59 happyReduction_59 (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_59 _ _ _ = notHappyAtAll happyReduce_60 = happySpecReduce_3 36 happyReduction_60 happyReduction_60 (HappyAbsSyn17 happy_var_3) _ (HappyAbsSyn36 happy_var_1) = HappyAbsSyn36 (unLoc happy_var_3 : happy_var_1 ) happyReduction_60 _ _ _ = notHappyAtAll happyReduce_61 = happySpecReduce_1 36 happyReduction_61 happyReduction_61 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn36 ([unLoc happy_var_1] ) happyReduction_61 _ = notHappyAtAll happyReduce_62 = happySpecReduce_1 37 happyReduction_62 happyReduction_62 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_62 _ = notHappyAtAll happyReduce_63 = happyMonadReduce 2 37 happyReduction_63 happyReduction_63 ((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_64 = happySpecReduce_1 38 happyReduction_64 happyReduction_64 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_64 _ = notHappyAtAll happyReduce_65 = happySpecReduce_1 38 happyReduction_65 happyReduction_65 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_65 _ = notHappyAtAll happyReduce_66 = happySpecReduce_3 39 happyReduction_66 happyReduction_66 (HappyAbsSyn40 happy_var_3) _ (HappyAbsSyn27 happy_var_1) = HappyAbsSyn27 (happy_var_3 : happy_var_1 ) happyReduction_66 _ _ _ = notHappyAtAll happyReduce_67 = happySpecReduce_2 39 happyReduction_67 happyReduction_67 _ (HappyAbsSyn27 happy_var_1) = HappyAbsSyn27 (happy_var_1 ) happyReduction_67 _ _ = notHappyAtAll happyReduce_68 = happySpecReduce_1 39 happyReduction_68 happyReduction_68 (HappyAbsSyn40 happy_var_1) = HappyAbsSyn27 ([ happy_var_1 ] ) happyReduction_68 _ = notHappyAtAll happyReduce_69 = happySpecReduce_0 39 happyReduction_69 happyReduction_69 = HappyAbsSyn27 ([] ) happyReduce_70 = happyReduce 8 40 happyReduction_70 happyReduction_70 ((HappyAbsSyn46 happy_var_8) `HappyStk` (HappyAbsSyn45 happy_var_7) `HappyStk` (HappyAbsSyn257 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_71 = happySpecReduce_2 41 happyReduction_71 happyReduction_71 _ _ = HappyAbsSyn41 (True ) happyReduce_72 = happySpecReduce_0 41 happyReduction_72 happyReduction_72 = HappyAbsSyn41 (False ) happyReduce_73 = happySpecReduce_1 42 happyReduction_73 happyReduction_73 _ = HappyAbsSyn42 (True ) happyReduce_74 = happySpecReduce_0 42 happyReduction_74 happyReduction_74 = HappyAbsSyn42 (False ) happyReduce_75 = happySpecReduce_1 43 happyReduction_75 happyReduction_75 (HappyTerminal happy_var_1) = HappyAbsSyn43 (Just (getSTRING happy_var_1) ) happyReduction_75 _ = notHappyAtAll happyReduce_76 = happySpecReduce_0 43 happyReduction_76 happyReduction_76 = HappyAbsSyn43 (Nothing ) happyReduce_77 = happySpecReduce_1 44 happyReduction_77 happyReduction_77 _ = HappyAbsSyn42 (True ) happyReduce_78 = happySpecReduce_0 44 happyReduction_78 happyReduction_78 = HappyAbsSyn42 (False ) happyReduce_79 = happySpecReduce_2 45 happyReduction_79 happyReduction_79 (HappyAbsSyn257 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn45 (sL (comb2 happy_var_1 happy_var_2) (Just (unLoc happy_var_2)) ) happyReduction_79 _ _ = notHappyAtAll happyReduce_80 = happySpecReduce_0 45 happyReduction_80 happyReduction_80 = HappyAbsSyn45 (noLoc Nothing ) happyReduce_81 = happySpecReduce_1 46 happyReduction_81 happyReduction_81 (HappyAbsSyn47 happy_var_1) = HappyAbsSyn46 (sL (getLoc happy_var_1) (Just (unLoc happy_var_1)) ) happyReduction_81 _ = notHappyAtAll happyReduce_82 = happySpecReduce_0 46 happyReduction_82 happyReduction_82 = HappyAbsSyn46 (noLoc Nothing ) happyReduce_83 = happySpecReduce_3 47 happyReduction_83 happyReduction_83 (HappyTerminal happy_var_3) (HappyAbsSyn30 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn47 (sL (comb2 happy_var_1 happy_var_3) (False, fromOL happy_var_2) ) happyReduction_83 _ _ _ = notHappyAtAll happyReduce_84 = happyReduce 4 47 happyReduction_84 happyReduction_84 ((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, fromOL happy_var_3) ) `HappyStk` happyRest happyReduce_85 = happySpecReduce_0 48 happyReduction_85 happyReduction_85 = HappyAbsSyn48 (9 ) happyReduce_86 = happyMonadReduce 1 48 happyReduction_86 happyReduction_86 ((HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkPrecP (sL (getLoc happy_var_1) (fromInteger (getINTEGER happy_var_1)))) ) (\r -> happyReturn (HappyAbsSyn48 r)) happyReduce_87 = happySpecReduce_1 49 happyReduction_87 happyReduction_87 (HappyTerminal happy_var_1) = HappyAbsSyn49 (sL (getLoc happy_var_1) InfixN ) happyReduction_87 _ = notHappyAtAll happyReduce_88 = happySpecReduce_1 49 happyReduction_88 happyReduction_88 (HappyTerminal happy_var_1) = HappyAbsSyn49 (sL (getLoc happy_var_1) InfixL ) happyReduction_88 _ = notHappyAtAll happyReduce_89 = happySpecReduce_1 49 happyReduction_89 happyReduction_89 (HappyTerminal happy_var_1) = HappyAbsSyn49 (sL (getLoc happy_var_1) InfixR ) happyReduction_89 _ = notHappyAtAll happyReduce_90 = happySpecReduce_3 50 happyReduction_90 happyReduction_90 (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_90 _ _ _ = notHappyAtAll happyReduce_91 = happySpecReduce_1 50 happyReduction_91 happyReduction_91 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn50 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_91 _ = notHappyAtAll happyReduce_92 = happySpecReduce_3 51 happyReduction_92 happyReduction_92 (HappyAbsSyn51 happy_var_3) _ (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 `appOL` happy_var_3 ) happyReduction_92 _ _ _ = notHappyAtAll happyReduce_93 = happySpecReduce_2 51 happyReduction_93 happyReduction_93 _ (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 ) happyReduction_93 _ _ = notHappyAtAll happyReduce_94 = happySpecReduce_1 51 happyReduction_94 happyReduction_94 (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (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 (HappyAbsSyn53 happy_var_1) = HappyAbsSyn51 (unitOL (sL (getLoc happy_var_1) (TyClD (unLoc happy_var_1))) ) happyReduction_96 _ = notHappyAtAll happyReduce_97 = happySpecReduce_1 52 happyReduction_97 happyReduction_97 (HappyAbsSyn55 happy_var_1) = HappyAbsSyn51 (unitOL (sL (getLoc happy_var_1) (InstD (unLoc happy_var_1))) ) happyReduction_97 _ = notHappyAtAll happyReduce_98 = happySpecReduce_1 52 happyReduction_98 happyReduction_98 (HappyAbsSyn67 happy_var_1) = HappyAbsSyn51 (unitOL (sL (comb2 happy_var_1 happy_var_1) (DerivD (unLoc happy_var_1))) ) happyReduction_98 _ = notHappyAtAll happyReduce_99 = happySpecReduce_1 52 happyReduction_99 happyReduction_99 (HappyAbsSyn68 happy_var_1) = HappyAbsSyn51 (unitOL (sL (getLoc happy_var_1) (RoleAnnotD (unLoc happy_var_1))) ) happyReduction_99 _ = notHappyAtAll happyReduce_100 = happyReduce 4 52 happyReduction_100 happyReduction_100 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn110 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_101 = happySpecReduce_2 52 happyReduction_101 happyReduction_101 (HappyAbsSyn15 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn51 (unitOL (sL (comb2 happy_var_1 happy_var_2) (unLoc 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 _ (HappyAbsSyn51 happy_var_2) _ = HappyAbsSyn51 (happy_var_2 ) happyReduction_103 _ _ _ = notHappyAtAll happyReduce_104 = happySpecReduce_3 52 happyReduction_104 happyReduction_104 _ (HappyAbsSyn51 happy_var_2) _ = HappyAbsSyn51 (happy_var_2 ) happyReduction_104 _ _ _ = notHappyAtAll happyReduce_105 = happyReduce 5 52 happyReduction_105 happyReduction_105 ((HappyTerminal happy_var_5) `HappyStk` (HappyAbsSyn157 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 happy_var_4) ) `HappyStk` happyRest happyReduce_106 = happySpecReduce_3 52 happyReduction_106 happyReduction_106 (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_106 _ _ _ = notHappyAtAll 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 False happy_var_3 Nothing) ) `HappyStk` happyRest happyReduce_108 = happyReduce 4 52 happyReduction_108 happyReduction_108 ((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_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 False happy_var_3 (Just happy_var_5)) ) `HappyStk` happyRest happyReduce_110 = happyReduce 6 52 happyReduction_110 happyReduction_110 ((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_111 = happyReduce 4 52 happyReduction_111 happyReduction_111 ((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_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 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn51 (unLoc happy_var_1 ) happyReduction_113 _ = notHappyAtAll happyReduce_114 = happySpecReduce_1 52 happyReduction_114 happyReduction_114 (HappyAbsSyn157 happy_var_1) = HappyAbsSyn51 (unitOL (sL (comb2 happy_var_1 happy_var_1) $ mkSpliceDecl happy_var_1) ) happyReduction_114 _ = notHappyAtAll happyReduce_115 = happyMonadReduce 4 53 happyReduction_115 happyReduction_115 ((HappyAbsSyn75 happy_var_4) `HappyStk` (HappyAbsSyn125 happy_var_3) `HappyStk` (HappyAbsSyn65 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_116 = happyMonadReduce 4 54 happyReduction_116 happyReduction_116 ((HappyAbsSyn107 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn107 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_117 = happyMonadReduce 5 54 happyReduction_117 happyReduction_117 ((HappyAbsSyn56 happy_var_5) `HappyStk` (HappyAbsSyn64 happy_var_4) `HappyStk` (HappyAbsSyn107 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkFamDecl (comb4 happy_var_1 happy_var_3 happy_var_4 happy_var_5) (unLoc happy_var_5) happy_var_3 (unLoc happy_var_4)) ) (\r -> happyReturn (HappyAbsSyn53 r)) happyReduce_118 = happyMonadReduce 5 54 happyReduction_118 happyReduction_118 ((HappyAbsSyn145 happy_var_5) `HappyStk` (HappyAbsSyn134 happy_var_4) `HappyStk` (HappyAbsSyn65 happy_var_3) `HappyStk` (HappyAbsSyn66 happy_var_2) `HappyStk` (HappyAbsSyn63 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_119 = happyMonadReduce 6 54 happyReduction_119 happyReduction_119 ((HappyAbsSyn145 happy_var_6) `HappyStk` (HappyAbsSyn134 happy_var_5) `HappyStk` (HappyAbsSyn64 happy_var_4) `HappyStk` (HappyAbsSyn65 happy_var_3) `HappyStk` (HappyAbsSyn66 happy_var_2) `HappyStk` (HappyAbsSyn63 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_120 = happyMonadReduce 4 54 happyReduction_120 happyReduction_120 ((HappyAbsSyn64 happy_var_4) `HappyStk` (HappyAbsSyn107 happy_var_3) `HappyStk` (HappyTerminal happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkFamDecl (comb3 happy_var_1 happy_var_2 happy_var_4) DataFamily happy_var_3 (unLoc happy_var_4)) ) (\r -> happyReturn (HappyAbsSyn53 r)) happyReduce_121 = happySpecReduce_3 55 happyReduction_121 happyReduction_121 (HappyAbsSyn75 happy_var_3) (HappyAbsSyn107 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn55 (let (binds, sigs, _, ats, adts, _) = cvBindsAndSigs (unLoc happy_var_3) in let cid = ClsInstDecl { cid_poly_ty = happy_var_2, cid_binds = binds , cid_sigs = sigs, cid_tyfam_insts = ats , cid_datafam_insts = adts } in L (comb3 happy_var_1 happy_var_2 happy_var_3) (ClsInstD { cid_inst = cid }) ) happyReduction_121 _ _ _ = notHappyAtAll happyReduce_122 = happyMonadReduce 3 55 happyReduction_122 happyReduction_122 ((HappyAbsSyn59 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkTyFamInst (comb2 happy_var_1 happy_var_3) happy_var_3) ) (\r -> happyReturn (HappyAbsSyn55 r)) happyReduce_123 = happyMonadReduce 6 55 happyReduction_123 happyReduction_123 ((HappyAbsSyn145 happy_var_6) `HappyStk` (HappyAbsSyn134 happy_var_5) `HappyStk` (HappyAbsSyn65 happy_var_4) `HappyStk` (HappyAbsSyn66 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn63 happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkDataFamInst (comb4 happy_var_1 happy_var_4 happy_var_5 happy_var_6) (unLoc happy_var_1) happy_var_3 happy_var_4 Nothing (reverse (unLoc happy_var_5)) (unLoc happy_var_6)) ) (\r -> happyReturn (HappyAbsSyn55 r)) happyReduce_124 = happyMonadReduce 7 55 happyReduction_124 happyReduction_124 ((HappyAbsSyn145 happy_var_7) `HappyStk` (HappyAbsSyn134 happy_var_6) `HappyStk` (HappyAbsSyn64 happy_var_5) `HappyStk` (HappyAbsSyn65 happy_var_4) `HappyStk` (HappyAbsSyn66 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn63 happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkDataFamInst (comb4 happy_var_1 happy_var_4 happy_var_6 happy_var_7) (unLoc happy_var_1) happy_var_3 happy_var_4 (unLoc happy_var_5) (unLoc happy_var_6) (unLoc happy_var_7)) ) (\r -> happyReturn (HappyAbsSyn55 r)) happyReduce_125 = happySpecReduce_0 56 happyReduction_125 happyReduction_125 = HappyAbsSyn56 (noLoc OpenTypeFamily ) happyReduce_126 = happySpecReduce_2 56 happyReduction_126 happyReduction_126 (HappyAbsSyn57 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn56 (sL (comb2 happy_var_1 happy_var_2) (ClosedTypeFamily (reverse (unLoc happy_var_2))) ) happyReduction_126 _ _ = notHappyAtAll happyReduce_127 = happySpecReduce_3 57 happyReduction_127 happyReduction_127 (HappyTerminal happy_var_3) (HappyAbsSyn57 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn57 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_127 _ _ _ = notHappyAtAll happyReduce_128 = happySpecReduce_3 57 happyReduction_128 happyReduction_128 _ (HappyAbsSyn57 happy_var_2) _ = HappyAbsSyn57 (happy_var_2 ) happyReduction_128 _ _ _ = notHappyAtAll happyReduce_129 = happySpecReduce_3 57 happyReduction_129 happyReduction_129 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn57 (sL (comb2 happy_var_1 happy_var_3) [] ) happyReduction_129 _ _ _ = notHappyAtAll happyReduce_130 = happySpecReduce_3 57 happyReduction_130 happyReduction_130 _ (HappyTerminal happy_var_2) _ = HappyAbsSyn57 (let L loc _ = happy_var_2 in L loc [] ) happyReduction_130 _ _ _ = notHappyAtAll happyReduce_131 = happySpecReduce_3 58 happyReduction_131 happyReduction_131 (HappyAbsSyn59 happy_var_3) _ (HappyAbsSyn57 happy_var_1) = HappyAbsSyn57 (sL (comb2 happy_var_1 happy_var_3) (happy_var_3 : unLoc happy_var_1) ) happyReduction_131 _ _ _ = notHappyAtAll happyReduce_132 = happySpecReduce_2 58 happyReduction_132 happyReduction_132 (HappyTerminal happy_var_2) (HappyAbsSyn57 happy_var_1) = HappyAbsSyn57 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_1) ) happyReduction_132 _ _ = notHappyAtAll happyReduce_133 = happySpecReduce_1 58 happyReduction_133 happyReduction_133 (HappyAbsSyn59 happy_var_1) = HappyAbsSyn57 (sL (comb2 happy_var_1 happy_var_1) [happy_var_1] ) happyReduction_133 _ = notHappyAtAll happyReduce_134 = happyMonadReduce 3 59 happyReduction_134 happyReduction_134 ((HappyAbsSyn107 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn107 happy_var_1) `HappyStk` happyRest) tk = happyThen (( do { eqn <- mkTyFamInstEqn happy_var_1 happy_var_3 ; return (sL (comb2 happy_var_1 happy_var_3) eqn) }) ) (\r -> happyReturn (HappyAbsSyn59 r)) happyReduce_135 = happyMonadReduce 4 60 happyReduction_135 happyReduction_135 ((HappyAbsSyn64 happy_var_4) `HappyStk` (HappyAbsSyn107 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( liftM mkTyClD (mkFamDecl (comb3 happy_var_1 happy_var_3 happy_var_4) DataFamily happy_var_3 (unLoc happy_var_4))) ) (\r -> happyReturn (HappyAbsSyn15 r)) happyReduce_136 = happyMonadReduce 3 60 happyReduction_136 happyReduction_136 ((HappyAbsSyn64 happy_var_3) `HappyStk` (HappyAbsSyn107 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( liftM mkTyClD (mkFamDecl (comb3 happy_var_1 happy_var_2 happy_var_3) OpenTypeFamily happy_var_2 (unLoc happy_var_3))) ) (\r -> happyReturn (HappyAbsSyn15 r)) happyReduce_137 = happyMonadReduce 4 60 happyReduction_137 happyReduction_137 ((HappyAbsSyn64 happy_var_4) `HappyStk` (HappyAbsSyn107 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( liftM mkTyClD (mkFamDecl (comb3 happy_var_1 happy_var_3 happy_var_4) OpenTypeFamily happy_var_3 (unLoc happy_var_4))) ) (\r -> happyReturn (HappyAbsSyn15 r)) happyReduce_138 = happyMonadReduce 2 60 happyReduction_138 happyReduction_138 ((HappyAbsSyn59 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( liftM mkInstD (mkTyFamInst (comb2 happy_var_1 happy_var_2) happy_var_2)) ) (\r -> happyReturn (HappyAbsSyn15 r)) happyReduce_139 = happyMonadReduce 3 60 happyReduction_139 happyReduction_139 ((HappyAbsSyn59 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( liftM mkInstD (mkTyFamInst (comb2 happy_var_1 happy_var_3) happy_var_3)) ) (\r -> happyReturn (HappyAbsSyn15 r)) happyReduce_140 = happySpecReduce_0 61 happyReduction_140 happyReduction_140 = HappyAbsSyn20 (() ) happyReduce_141 = happySpecReduce_1 61 happyReduction_141 happyReduction_141 _ = HappyAbsSyn20 (() ) happyReduce_142 = happyMonadReduce 2 62 happyReduction_142 happyReduction_142 ((HappyAbsSyn59 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkTyFamInst (comb2 happy_var_1 happy_var_2) happy_var_2) ) (\r -> happyReturn (HappyAbsSyn55 r)) happyReduce_143 = happyMonadReduce 5 62 happyReduction_143 happyReduction_143 ((HappyAbsSyn145 happy_var_5) `HappyStk` (HappyAbsSyn134 happy_var_4) `HappyStk` (HappyAbsSyn65 happy_var_3) `HappyStk` (HappyAbsSyn66 happy_var_2) `HappyStk` (HappyAbsSyn63 happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkDataFamInst (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 (HappyAbsSyn55 r)) happyReduce_144 = happyMonadReduce 6 62 happyReduction_144 happyReduction_144 ((HappyAbsSyn145 happy_var_6) `HappyStk` (HappyAbsSyn134 happy_var_5) `HappyStk` (HappyAbsSyn64 happy_var_4) `HappyStk` (HappyAbsSyn65 happy_var_3) `HappyStk` (HappyAbsSyn66 happy_var_2) `HappyStk` (HappyAbsSyn63 happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkDataFamInst (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 (HappyAbsSyn55 r)) happyReduce_145 = happySpecReduce_1 63 happyReduction_145 happyReduction_145 (HappyTerminal happy_var_1) = HappyAbsSyn63 (sL (getLoc happy_var_1) DataType ) happyReduction_145 _ = notHappyAtAll happyReduce_146 = happySpecReduce_1 63 happyReduction_146 happyReduction_146 (HappyTerminal happy_var_1) = HappyAbsSyn63 (sL (getLoc happy_var_1) NewType ) happyReduction_146 _ = notHappyAtAll happyReduce_147 = happySpecReduce_0 64 happyReduction_147 happyReduction_147 = HappyAbsSyn64 (noLoc Nothing ) happyReduce_148 = happySpecReduce_2 64 happyReduction_148 happyReduction_148 (HappyAbsSyn129 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn64 (sL (comb2 happy_var_1 happy_var_2) (Just happy_var_2) ) happyReduction_148 _ _ = notHappyAtAll happyReduce_149 = happySpecReduce_3 65 happyReduction_149 happyReduction_149 (HappyAbsSyn107 happy_var_3) _ (HappyAbsSyn114 happy_var_1) = HappyAbsSyn65 (sL (comb2 happy_var_1 happy_var_3) (Just happy_var_1, happy_var_3) ) happyReduction_149 _ _ _ = notHappyAtAll happyReduce_150 = happySpecReduce_1 65 happyReduction_150 happyReduction_150 (HappyAbsSyn107 happy_var_1) = HappyAbsSyn65 (sL (getLoc happy_var_1) (Nothing, happy_var_1) ) happyReduction_150 _ = notHappyAtAll happyReduce_151 = happyReduce 4 66 happyReduction_151 happyReduction_151 (_ `HappyStk` (HappyTerminal happy_var_3) `HappyStk` (HappyTerminal happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn66 (Just (CType (Just (Header (getSTRING happy_var_2))) (getSTRING happy_var_3)) ) `HappyStk` happyRest happyReduce_152 = happySpecReduce_3 66 happyReduction_152 happyReduction_152 _ (HappyTerminal happy_var_2) _ = HappyAbsSyn66 (Just (CType Nothing (getSTRING happy_var_2)) ) happyReduction_152 _ _ _ = notHappyAtAll happyReduce_153 = happySpecReduce_0 66 happyReduction_153 happyReduction_153 = HappyAbsSyn66 (Nothing ) happyReduce_154 = happySpecReduce_3 67 happyReduction_154 happyReduction_154 (HappyAbsSyn107 happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn67 (sL (comb2 happy_var_1 happy_var_3) (DerivDecl happy_var_3) ) happyReduction_154 _ _ _ = notHappyAtAll happyReduce_155 = happyMonadReduce 4 68 happyReduction_155 happyReduction_155 ((HappyAbsSyn69 happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkRoleAnnotDecl (comb3 happy_var_1 happy_var_3 happy_var_4) happy_var_3 (reverse (unLoc happy_var_4))) ) (\r -> happyReturn (HappyAbsSyn68 r)) happyReduce_156 = happySpecReduce_0 69 happyReduction_156 happyReduction_156 = HappyAbsSyn69 (noLoc [] ) happyReduce_157 = happySpecReduce_1 69 happyReduction_157 happyReduction_157 (HappyAbsSyn69 happy_var_1) = HappyAbsSyn69 (happy_var_1 ) happyReduction_157 _ = notHappyAtAll happyReduce_158 = happySpecReduce_1 70 happyReduction_158 happyReduction_158 (HappyAbsSyn71 happy_var_1) = HappyAbsSyn69 (sL (comb2 happy_var_1 happy_var_1) [happy_var_1] ) happyReduction_158 _ = notHappyAtAll happyReduce_159 = happySpecReduce_2 70 happyReduction_159 happyReduction_159 (HappyAbsSyn71 happy_var_2) (HappyAbsSyn69 happy_var_1) = HappyAbsSyn69 (sL (comb2 happy_var_1 happy_var_2) $ happy_var_2 : unLoc happy_var_1 ) happyReduction_159 _ _ = notHappyAtAll happyReduce_160 = happySpecReduce_1 71 happyReduction_160 happyReduction_160 (HappyTerminal happy_var_1) = HappyAbsSyn71 (sL (getLoc happy_var_1) $ Just $ getVARID happy_var_1 ) happyReduction_160 _ = notHappyAtAll happyReduce_161 = happySpecReduce_1 71 happyReduction_161 happyReduction_161 (HappyTerminal happy_var_1) = HappyAbsSyn71 (sL (getLoc happy_var_1) Nothing ) happyReduction_161 _ = notHappyAtAll happyReduce_162 = happyReduce 5 72 happyReduction_162 happyReduction_162 ((HappyAbsSyn195 happy_var_5) `HappyStk` (HappyAbsSyn74 happy_var_4) `HappyStk` (HappyAbsSyn73 happy_var_3) `HappyStk` (HappyAbsSyn17 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn15 (sL (comb2 happy_var_1 happy_var_5) . ValD $ mkPatSynBind happy_var_2 (PrefixPatSyn happy_var_3) happy_var_5 happy_var_4 ) `HappyStk` happyRest happyReduce_163 = happyReduce 6 72 happyReduction_163 happyReduction_163 ((HappyAbsSyn195 happy_var_6) `HappyStk` (HappyAbsSyn74 happy_var_5) `HappyStk` (HappyAbsSyn17 happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` (HappyAbsSyn17 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn15 (sL (comb2 happy_var_1 happy_var_6) . ValD $ mkPatSynBind happy_var_3 (InfixPatSyn happy_var_2 happy_var_4) happy_var_6 happy_var_5 ) `HappyStk` happyRest happyReduce_164 = happySpecReduce_0 73 happyReduction_164 happyReduction_164 = HappyAbsSyn73 ([] ) happyReduce_165 = happySpecReduce_2 73 happyReduction_165 happyReduction_165 (HappyAbsSyn73 happy_var_2) (HappyAbsSyn17 happy_var_1) = HappyAbsSyn73 (happy_var_1 : happy_var_2 ) happyReduction_165 _ _ = notHappyAtAll happyReduce_166 = happySpecReduce_1 74 happyReduction_166 happyReduction_166 _ = HappyAbsSyn74 (Unidirectional ) happyReduce_167 = happySpecReduce_1 74 happyReduction_167 happyReduction_167 _ = HappyAbsSyn74 (ImplicitBidirectional ) happyReduce_168 = happySpecReduce_1 75 happyReduction_168 happyReduction_168 (HappyAbsSyn15 happy_var_1) = HappyAbsSyn75 (sL (comb2 happy_var_1 happy_var_1) (unitOL happy_var_1) ) happyReduction_168 _ = notHappyAtAll happyReduce_169 = happySpecReduce_1 75 happyReduction_169 happyReduction_169 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (happy_var_1 ) happyReduction_169 _ = notHappyAtAll happyReduce_170 = happyMonadReduce 4 75 happyReduction_170 happyReduction_170 ((HappyAbsSyn107 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn157 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 (HappyAbsSyn75 r)) happyReduce_171 = happySpecReduce_3 76 happyReduction_171 happyReduction_171 (HappyAbsSyn75 happy_var_3) _ (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_1 `appOL` unLoc happy_var_3) ) happyReduction_171 _ _ _ = notHappyAtAll happyReduce_172 = happySpecReduce_2 76 happyReduction_172 happyReduction_172 (HappyTerminal happy_var_2) (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_1) ) happyReduction_172 _ _ = notHappyAtAll happyReduce_173 = happySpecReduce_1 76 happyReduction_173 happyReduction_173 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (happy_var_1 ) happyReduction_173 _ = notHappyAtAll happyReduce_174 = happySpecReduce_0 76 happyReduction_174 happyReduction_174 = HappyAbsSyn75 (noLoc nilOL ) happyReduce_175 = happySpecReduce_3 77 happyReduction_175 happyReduction_175 (HappyTerminal happy_var_3) (HappyAbsSyn75 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn75 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_175 _ _ _ = notHappyAtAll happyReduce_176 = happySpecReduce_3 77 happyReduction_176 happyReduction_176 _ (HappyAbsSyn75 happy_var_2) _ = HappyAbsSyn75 (happy_var_2 ) happyReduction_176 _ _ _ = notHappyAtAll happyReduce_177 = happySpecReduce_2 78 happyReduction_177 happyReduction_177 (HappyAbsSyn75 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn75 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_2) ) happyReduction_177 _ _ = notHappyAtAll happyReduce_178 = happySpecReduce_0 78 happyReduction_178 happyReduction_178 = HappyAbsSyn75 (noLoc nilOL ) happyReduce_179 = happySpecReduce_1 79 happyReduction_179 happyReduction_179 (HappyAbsSyn55 happy_var_1) = HappyAbsSyn75 (sL (comb2 happy_var_1 happy_var_1) (unitOL (sL (getLoc happy_var_1) (InstD (unLoc happy_var_1)))) ) happyReduction_179 _ = notHappyAtAll happyReduce_180 = happySpecReduce_1 79 happyReduction_180 happyReduction_180 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (happy_var_1 ) happyReduction_180 _ = notHappyAtAll happyReduce_181 = happySpecReduce_3 80 happyReduction_181 happyReduction_181 (HappyAbsSyn75 happy_var_3) _ (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_1 `appOL` unLoc happy_var_3) ) happyReduction_181 _ _ _ = notHappyAtAll happyReduce_182 = happySpecReduce_2 80 happyReduction_182 happyReduction_182 (HappyTerminal happy_var_2) (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_1) ) happyReduction_182 _ _ = notHappyAtAll happyReduce_183 = happySpecReduce_1 80 happyReduction_183 happyReduction_183 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (happy_var_1 ) happyReduction_183 _ = notHappyAtAll happyReduce_184 = happySpecReduce_0 80 happyReduction_184 happyReduction_184 = HappyAbsSyn75 (noLoc nilOL ) happyReduce_185 = happySpecReduce_3 81 happyReduction_185 happyReduction_185 (HappyTerminal happy_var_3) (HappyAbsSyn75 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn75 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_185 _ _ _ = notHappyAtAll happyReduce_186 = happySpecReduce_3 81 happyReduction_186 happyReduction_186 _ (HappyAbsSyn75 happy_var_2) _ = HappyAbsSyn75 (happy_var_2 ) happyReduction_186 _ _ _ = notHappyAtAll happyReduce_187 = happySpecReduce_2 82 happyReduction_187 happyReduction_187 (HappyAbsSyn75 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn75 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_2) ) happyReduction_187 _ _ = notHappyAtAll happyReduce_188 = happySpecReduce_0 82 happyReduction_188 happyReduction_188 = HappyAbsSyn75 (noLoc nilOL ) happyReduce_189 = happySpecReduce_3 83 happyReduction_189 happyReduction_189 (HappyAbsSyn75 happy_var_3) _ (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (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_189 _ _ _ = notHappyAtAll happyReduce_190 = happySpecReduce_2 83 happyReduction_190 happyReduction_190 (HappyTerminal happy_var_2) (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_1) ) happyReduction_190 _ _ = notHappyAtAll happyReduce_191 = happySpecReduce_1 83 happyReduction_191 happyReduction_191 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (happy_var_1 ) happyReduction_191 _ = notHappyAtAll happyReduce_192 = happySpecReduce_0 83 happyReduction_192 happyReduction_192 = HappyAbsSyn75 (noLoc nilOL ) happyReduce_193 = happySpecReduce_3 84 happyReduction_193 happyReduction_193 (HappyTerminal happy_var_3) (HappyAbsSyn75 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn75 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_193 _ _ _ = notHappyAtAll happyReduce_194 = happySpecReduce_3 84 happyReduction_194 happyReduction_194 _ (HappyAbsSyn75 happy_var_2) _ = HappyAbsSyn75 (happy_var_2 ) happyReduction_194 _ _ _ = notHappyAtAll happyReduce_195 = happySpecReduce_1 85 happyReduction_195 happyReduction_195 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn85 (sL (getLoc happy_var_1) (HsValBinds (cvBindGroup (unLoc happy_var_1))) ) happyReduction_195 _ = notHappyAtAll happyReduce_196 = happySpecReduce_3 85 happyReduction_196 happyReduction_196 (HappyTerminal happy_var_3) (HappyAbsSyn208 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn85 (sL (comb2 happy_var_1 happy_var_3) (HsIPBinds (IPBinds (unLoc happy_var_2) emptyTcEvBinds)) ) happyReduction_196 _ _ _ = notHappyAtAll happyReduce_197 = happySpecReduce_3 85 happyReduction_197 happyReduction_197 _ (HappyAbsSyn208 happy_var_2) _ = HappyAbsSyn85 (L (getLoc happy_var_2) (HsIPBinds (IPBinds (unLoc happy_var_2) emptyTcEvBinds)) ) happyReduction_197 _ _ _ = notHappyAtAll happyReduce_198 = happySpecReduce_2 86 happyReduction_198 happyReduction_198 (HappyAbsSyn85 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn85 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_2) ) happyReduction_198 _ _ = notHappyAtAll happyReduce_199 = happySpecReduce_0 86 happyReduction_199 happyReduction_199 = HappyAbsSyn85 (noLoc emptyLocalBinds ) happyReduce_200 = happySpecReduce_3 87 happyReduction_200 happyReduction_200 (HappyAbsSyn15 happy_var_3) _ (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 `snocOL` happy_var_3 ) happyReduction_200 _ _ _ = notHappyAtAll happyReduce_201 = happySpecReduce_2 87 happyReduction_201 happyReduction_201 _ (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 ) happyReduction_201 _ _ = notHappyAtAll happyReduce_202 = happySpecReduce_1 87 happyReduction_202 happyReduction_202 (HappyAbsSyn15 happy_var_1) = HappyAbsSyn51 (unitOL happy_var_1 ) happyReduction_202 _ = notHappyAtAll happyReduce_203 = happySpecReduce_0 87 happyReduction_203 happyReduction_203 = HappyAbsSyn51 (nilOL ) happyReduce_204 = happyReduce 6 88 happyReduction_204 happyReduction_204 ((HappyAbsSyn157 happy_var_6) `HappyStk` _ `HappyStk` (HappyAbsSyn157 happy_var_4) `HappyStk` (HappyAbsSyn91 happy_var_3) `HappyStk` (HappyAbsSyn89 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_205 = happySpecReduce_0 89 happyReduction_205 happyReduction_205 = HappyAbsSyn89 (Nothing ) happyReduce_206 = happySpecReduce_1 89 happyReduction_206 happyReduction_206 (HappyAbsSyn90 happy_var_1) = HappyAbsSyn89 (Just happy_var_1 ) happyReduction_206 _ = notHappyAtAll happyReduce_207 = happySpecReduce_3 90 happyReduction_207 happyReduction_207 _ (HappyTerminal happy_var_2) _ = HappyAbsSyn90 (ActiveAfter (fromInteger (getINTEGER happy_var_2)) ) happyReduction_207 _ _ _ = notHappyAtAll happyReduce_208 = happyReduce 4 90 happyReduction_208 happyReduction_208 (_ `HappyStk` (HappyTerminal happy_var_3) `HappyStk` _ `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn90 (ActiveBefore (fromInteger (getINTEGER happy_var_3)) ) `HappyStk` happyRest happyReduce_209 = happySpecReduce_3 90 happyReduction_209 happyReduction_209 _ _ _ = HappyAbsSyn90 (NeverActive ) happyReduce_210 = happySpecReduce_3 91 happyReduction_210 happyReduction_210 _ (HappyAbsSyn91 happy_var_2) _ = HappyAbsSyn91 (happy_var_2 ) happyReduction_210 _ _ _ = notHappyAtAll happyReduce_211 = happySpecReduce_0 91 happyReduction_211 happyReduction_211 = HappyAbsSyn91 ([] ) happyReduce_212 = happySpecReduce_1 92 happyReduction_212 happyReduction_212 (HappyAbsSyn93 happy_var_1) = HappyAbsSyn91 ([happy_var_1] ) happyReduction_212 _ = notHappyAtAll happyReduce_213 = happySpecReduce_2 92 happyReduction_213 happyReduction_213 (HappyAbsSyn91 happy_var_2) (HappyAbsSyn93 happy_var_1) = HappyAbsSyn91 (happy_var_1 : happy_var_2 ) happyReduction_213 _ _ = notHappyAtAll happyReduce_214 = happySpecReduce_1 93 happyReduction_214 happyReduction_214 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn93 (RuleBndr happy_var_1 ) happyReduction_214 _ = notHappyAtAll happyReduce_215 = happyReduce 5 93 happyReduction_215 happyReduction_215 (_ `HappyStk` (HappyAbsSyn107 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn17 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn93 (RuleBndrSig happy_var_2 (mkHsWithBndrs happy_var_4) ) `HappyStk` happyRest happyReduce_216 = happySpecReduce_3 94 happyReduction_216 happyReduction_216 (HappyAbsSyn51 happy_var_3) _ (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 `appOL` happy_var_3 ) happyReduction_216 _ _ _ = notHappyAtAll happyReduce_217 = happySpecReduce_2 94 happyReduction_217 happyReduction_217 _ (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 ) happyReduction_217 _ _ = notHappyAtAll happyReduce_218 = happySpecReduce_1 94 happyReduction_218 happyReduction_218 (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 ) happyReduction_218 _ = notHappyAtAll happyReduce_219 = happySpecReduce_0 94 happyReduction_219 happyReduction_219 = HappyAbsSyn51 (nilOL ) happyReduce_220 = happySpecReduce_2 95 happyReduction_220 happyReduction_220 (HappyAbsSyn98 happy_var_2) (HappyAbsSyn128 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_220 _ _ = notHappyAtAll happyReduce_221 = happySpecReduce_3 96 happyReduction_221 happyReduction_221 (HappyAbsSyn51 happy_var_3) _ (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 `appOL` happy_var_3 ) happyReduction_221 _ _ _ = notHappyAtAll happyReduce_222 = happySpecReduce_2 96 happyReduction_222 happyReduction_222 _ (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 ) happyReduction_222 _ _ = notHappyAtAll happyReduce_223 = happySpecReduce_1 96 happyReduction_223 happyReduction_223 (HappyAbsSyn51 happy_var_1) = HappyAbsSyn51 (happy_var_1 ) happyReduction_223 _ = notHappyAtAll happyReduce_224 = happySpecReduce_0 96 happyReduction_224 happyReduction_224 = HappyAbsSyn51 (nilOL ) happyReduce_225 = happySpecReduce_2 97 happyReduction_225 happyReduction_225 (HappyAbsSyn98 happy_var_2) (HappyAbsSyn128 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_225 _ _ = notHappyAtAll happyReduce_226 = happySpecReduce_1 98 happyReduction_226 happyReduction_226 (HappyTerminal happy_var_1) = HappyAbsSyn98 (sL (getLoc happy_var_1) [getSTRING happy_var_1] ) happyReduction_226 _ = notHappyAtAll happyReduce_227 = happySpecReduce_3 98 happyReduction_227 happyReduction_227 (HappyTerminal happy_var_3) (HappyAbsSyn99 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn98 (sL (comb2 happy_var_1 happy_var_3) $ fromOL (unLoc happy_var_2) ) happyReduction_227 _ _ _ = notHappyAtAll happyReduce_228 = happySpecReduce_3 99 happyReduction_228 happyReduction_228 (HappyTerminal happy_var_3) _ (HappyAbsSyn99 happy_var_1) = HappyAbsSyn99 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_1 `snocOL` getSTRING happy_var_3) ) happyReduction_228 _ _ _ = notHappyAtAll happyReduce_229 = happySpecReduce_1 99 happyReduction_229 happyReduction_229 (HappyTerminal happy_var_1) = HappyAbsSyn99 (sL (comb2 happy_var_1 happy_var_1) (unitOL (getSTRING happy_var_1)) ) happyReduction_229 _ = notHappyAtAll happyReduce_230 = happyReduce 4 100 happyReduction_230 happyReduction_230 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn157 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_231 = happyReduce 5 100 happyReduction_231 happyReduction_231 ((HappyTerminal happy_var_5) `HappyStk` (HappyAbsSyn157 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_232 = happyReduce 4 100 happyReduction_232 happyReduction_232 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn157 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_233 = happyMonadReduce 4 101 happyReduction_233 happyReduction_233 ((HappyAbsSyn104 happy_var_4) `HappyStk` (HappyAbsSyn103 happy_var_3) `HappyStk` (HappyAbsSyn102 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_234 = happyMonadReduce 3 101 happyReduction_234 happyReduction_234 ((HappyAbsSyn104 happy_var_3) `HappyStk` (HappyAbsSyn102 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_235 = happyMonadReduce 3 101 happyReduction_235 happyReduction_235 ((HappyAbsSyn104 happy_var_3) `HappyStk` (HappyAbsSyn102 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_236 = happySpecReduce_1 102 happyReduction_236 happyReduction_236 _ = HappyAbsSyn102 (StdCallConv ) happyReduce_237 = happySpecReduce_1 102 happyReduction_237 happyReduction_237 _ = HappyAbsSyn102 (CCallConv ) happyReduce_238 = happySpecReduce_1 102 happyReduction_238 happyReduction_238 _ = HappyAbsSyn102 (CApiConv ) happyReduce_239 = happySpecReduce_1 102 happyReduction_239 happyReduction_239 _ = HappyAbsSyn102 (PrimCallConv ) happyReduce_240 = happySpecReduce_1 102 happyReduction_240 happyReduction_240 _ = HappyAbsSyn102 (JavaScriptCallConv ) happyReduce_241 = happySpecReduce_1 103 happyReduction_241 happyReduction_241 _ = HappyAbsSyn103 (PlayRisky ) happyReduce_242 = happySpecReduce_1 103 happyReduction_242 happyReduction_242 _ = HappyAbsSyn103 (PlaySafe ) happyReduce_243 = happySpecReduce_1 103 happyReduction_243 happyReduction_243 _ = HappyAbsSyn103 (PlayInterruptible ) happyReduce_244 = happyReduce 4 104 happyReduction_244 happyReduction_244 ((HappyAbsSyn107 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn17 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn104 (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_245 = happySpecReduce_3 104 happyReduction_245 happyReduction_245 (HappyAbsSyn107 happy_var_3) _ (HappyAbsSyn17 happy_var_1) = HappyAbsSyn104 (sL (comb2 happy_var_1 happy_var_3) (noLoc nilFS, happy_var_1, happy_var_3) ) happyReduction_245 _ _ _ = notHappyAtAll happyReduce_246 = happySpecReduce_0 105 happyReduction_246 happyReduction_246 = HappyAbsSyn105 (Nothing ) happyReduce_247 = happySpecReduce_2 105 happyReduction_247 happyReduction_247 (HappyAbsSyn107 happy_var_2) _ = HappyAbsSyn105 (Just happy_var_2 ) happyReduction_247 _ _ = notHappyAtAll happyReduce_248 = happySpecReduce_0 106 happyReduction_248 happyReduction_248 = HappyAbsSyn105 (Nothing ) happyReduce_249 = happySpecReduce_2 106 happyReduction_249 happyReduction_249 (HappyAbsSyn107 happy_var_2) _ = HappyAbsSyn105 (Just happy_var_2 ) happyReduction_249 _ _ = notHappyAtAll happyReduce_250 = happySpecReduce_1 107 happyReduction_250 happyReduction_250 (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (sL (getLoc happy_var_1) (mkImplicitHsForAllTy (noLoc []) happy_var_1) ) happyReduction_250 _ = notHappyAtAll happyReduce_251 = happySpecReduce_1 108 happyReduction_251 happyReduction_251 (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (sL (getLoc happy_var_1) (mkImplicitHsForAllTy (noLoc []) happy_var_1) ) happyReduction_251 _ = notHappyAtAll happyReduce_252 = happySpecReduce_3 109 happyReduction_252 happyReduction_252 (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_252 _ _ _ = notHappyAtAll happyReduce_253 = happySpecReduce_1 109 happyReduction_253 happyReduction_253 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn50 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_253 _ = notHappyAtAll happyReduce_254 = happySpecReduce_1 110 happyReduction_254 happyReduction_254 (HappyAbsSyn107 happy_var_1) = HappyAbsSyn110 ([ happy_var_1 ] ) happyReduction_254 _ = notHappyAtAll happyReduce_255 = happySpecReduce_3 110 happyReduction_255 happyReduction_255 (HappyAbsSyn110 happy_var_3) _ (HappyAbsSyn107 happy_var_1) = HappyAbsSyn110 (happy_var_1 : happy_var_3 ) happyReduction_255 _ _ _ = notHappyAtAll happyReduce_256 = happySpecReduce_1 111 happyReduction_256 happyReduction_256 (HappyTerminal happy_var_1) = HappyAbsSyn111 (sL (getLoc happy_var_1) (HsUserBang Nothing True) ) happyReduction_256 _ = notHappyAtAll happyReduce_257 = happySpecReduce_2 111 happyReduction_257 happyReduction_257 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn111 (sL (comb2 happy_var_1 happy_var_2) (HsUserBang (Just True) False) ) happyReduction_257 _ _ = notHappyAtAll happyReduce_258 = happySpecReduce_2 111 happyReduction_258 happyReduction_258 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn111 (sL (comb2 happy_var_1 happy_var_2) (HsUserBang (Just False) True) ) happyReduction_258 _ _ = notHappyAtAll happyReduce_259 = happySpecReduce_3 111 happyReduction_259 happyReduction_259 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn111 (sL (comb2 happy_var_1 happy_var_3) (HsUserBang (Just True) True) ) happyReduction_259 _ _ _ = notHappyAtAll happyReduce_260 = happySpecReduce_3 111 happyReduction_260 happyReduction_260 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn111 (sL (comb2 happy_var_1 happy_var_3) (HsUserBang (Just False) True) ) happyReduction_260 _ _ _ = notHappyAtAll happyReduce_261 = happyMonadReduce 4 112 happyReduction_261 happyReduction_261 ((HappyAbsSyn107 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn123 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( hintExplicitForall (getLoc happy_var_1) >> return (sL (comb2 happy_var_1 happy_var_4) $ mkExplicitHsForAllTy happy_var_2 (noLoc []) happy_var_4)) ) (\r -> happyReturn (HappyAbsSyn107 r)) happyReduce_262 = happySpecReduce_3 112 happyReduction_262 happyReduction_262 (HappyAbsSyn107 happy_var_3) _ (HappyAbsSyn114 happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) $ mkImplicitHsForAllTy happy_var_1 happy_var_3 ) happyReduction_262 _ _ _ = notHappyAtAll happyReduce_263 = happySpecReduce_3 112 happyReduction_263 happyReduction_263 (HappyAbsSyn107 happy_var_3) _ (HappyAbsSyn210 happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) (HsIParamTy (unLoc happy_var_1) happy_var_3) ) happyReduction_263 _ _ _ = notHappyAtAll happyReduce_264 = happySpecReduce_1 112 happyReduction_264 happyReduction_264 (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (happy_var_1 ) happyReduction_264 _ = notHappyAtAll happyReduce_265 = happyMonadReduce 4 113 happyReduction_265 happyReduction_265 ((HappyAbsSyn107 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn123 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( hintExplicitForall (getLoc happy_var_1) >> return (sL (comb2 happy_var_1 happy_var_4) $ mkExplicitHsForAllTy happy_var_2 (noLoc []) happy_var_4)) ) (\r -> happyReturn (HappyAbsSyn107 r)) happyReduce_266 = happySpecReduce_3 113 happyReduction_266 happyReduction_266 (HappyAbsSyn107 happy_var_3) _ (HappyAbsSyn114 happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) $ mkImplicitHsForAllTy happy_var_1 happy_var_3 ) happyReduction_266 _ _ _ = notHappyAtAll happyReduce_267 = happySpecReduce_3 113 happyReduction_267 happyReduction_267 (HappyAbsSyn107 happy_var_3) _ (HappyAbsSyn210 happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) (HsIParamTy (unLoc happy_var_1) happy_var_3) ) happyReduction_267 _ _ _ = notHappyAtAll happyReduce_268 = happySpecReduce_1 113 happyReduction_268 happyReduction_268 (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (happy_var_1 ) happyReduction_268 _ = notHappyAtAll happyReduce_269 = happyMonadReduce 3 114 happyReduction_269 happyReduction_269 ((HappyAbsSyn107 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn107 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 (HappyAbsSyn114 r)) happyReduce_270 = happyMonadReduce 1 114 happyReduction_270 happyReduction_270 ((HappyAbsSyn107 happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkContext happy_var_1) ) (\r -> happyReturn (HappyAbsSyn114 r)) happyReduce_271 = happySpecReduce_1 115 happyReduction_271 happyReduction_271 (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (happy_var_1 ) happyReduction_271 _ = notHappyAtAll happyReduce_272 = happySpecReduce_3 115 happyReduction_272 happyReduction_272 (HappyAbsSyn107 happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) $ mkHsOpTy happy_var_1 happy_var_2 happy_var_3 ) happyReduction_272 _ _ _ = notHappyAtAll happyReduce_273 = happySpecReduce_3 115 happyReduction_273 happyReduction_273 (HappyAbsSyn107 happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) $ mkHsOpTy happy_var_1 happy_var_2 happy_var_3 ) happyReduction_273 _ _ _ = notHappyAtAll happyReduce_274 = happySpecReduce_3 115 happyReduction_274 happyReduction_274 (HappyAbsSyn107 happy_var_3) _ (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) $ HsFunTy happy_var_1 happy_var_3 ) happyReduction_274 _ _ _ = notHappyAtAll happyReduce_275 = happySpecReduce_3 115 happyReduction_275 happyReduction_275 (HappyAbsSyn107 happy_var_3) _ (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) $ HsEqTy happy_var_1 happy_var_3 ) happyReduction_275 _ _ _ = notHappyAtAll happyReduce_276 = happyReduce 4 115 happyReduction_276 happyReduction_276 ((HappyAbsSyn107 happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn107 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_4) $ mkHsOpTy happy_var_1 happy_var_3 happy_var_4 ) `HappyStk` happyRest happyReduce_277 = happyReduce 4 115 happyReduction_277 happyReduction_277 ((HappyAbsSyn107 happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn107 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_4) $ mkHsOpTy happy_var_1 happy_var_3 happy_var_4 ) `HappyStk` happyRest happyReduce_278 = happySpecReduce_1 116 happyReduction_278 happyReduction_278 (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (happy_var_1 ) happyReduction_278 _ = notHappyAtAll happyReduce_279 = happySpecReduce_2 116 happyReduction_279 happyReduction_279 (HappyAbsSyn259 happy_var_2) (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_2) $ HsDocTy happy_var_1 happy_var_2 ) happyReduction_279 _ _ = notHappyAtAll happyReduce_280 = happySpecReduce_3 116 happyReduction_280 happyReduction_280 (HappyAbsSyn107 happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) $ mkHsOpTy happy_var_1 happy_var_2 happy_var_3 ) happyReduction_280 _ _ _ = notHappyAtAll happyReduce_281 = happyReduce 4 116 happyReduction_281 happyReduction_281 ((HappyAbsSyn259 happy_var_4) `HappyStk` (HappyAbsSyn107 happy_var_3) `HappyStk` (HappyAbsSyn17 happy_var_2) `HappyStk` (HappyAbsSyn107 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn107 (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_282 = happySpecReduce_3 116 happyReduction_282 happyReduction_282 (HappyAbsSyn107 happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) $ mkHsOpTy happy_var_1 happy_var_2 happy_var_3 ) happyReduction_282 _ _ _ = notHappyAtAll happyReduce_283 = happyReduce 4 116 happyReduction_283 happyReduction_283 ((HappyAbsSyn259 happy_var_4) `HappyStk` (HappyAbsSyn107 happy_var_3) `HappyStk` (HappyAbsSyn17 happy_var_2) `HappyStk` (HappyAbsSyn107 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn107 (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_284 = happySpecReduce_3 116 happyReduction_284 happyReduction_284 (HappyAbsSyn107 happy_var_3) _ (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) $ HsFunTy happy_var_1 happy_var_3 ) happyReduction_284 _ _ _ = notHappyAtAll happyReduce_285 = happyReduce 4 116 happyReduction_285 happyReduction_285 ((HappyAbsSyn107 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn259 happy_var_2) `HappyStk` (HappyAbsSyn107 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn107 (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_286 = happySpecReduce_3 116 happyReduction_286 happyReduction_286 (HappyAbsSyn107 happy_var_3) _ (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) $ HsEqTy happy_var_1 happy_var_3 ) happyReduction_286 _ _ _ = notHappyAtAll happyReduce_287 = happyReduce 4 116 happyReduction_287 happyReduction_287 ((HappyAbsSyn107 happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn107 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_4) $ mkHsOpTy happy_var_1 happy_var_3 happy_var_4 ) `HappyStk` happyRest happyReduce_288 = happyReduce 4 116 happyReduction_288 happyReduction_288 ((HappyAbsSyn107 happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn107 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_4) $ mkHsOpTy happy_var_1 happy_var_3 happy_var_4 ) `HappyStk` happyRest happyReduce_289 = happySpecReduce_2 117 happyReduction_289 happyReduction_289 (HappyAbsSyn107 happy_var_2) (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_2) $ HsAppTy happy_var_1 happy_var_2 ) happyReduction_289 _ _ = notHappyAtAll happyReduce_290 = happySpecReduce_1 117 happyReduction_290 happyReduction_290 (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (happy_var_1 ) happyReduction_290 _ = notHappyAtAll happyReduce_291 = happySpecReduce_1 118 happyReduction_291 happyReduction_291 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn107 (sL (getLoc happy_var_1) (HsTyVar (unLoc happy_var_1)) ) happyReduction_291 _ = notHappyAtAll happyReduce_292 = happySpecReduce_1 118 happyReduction_292 happyReduction_292 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn107 (sL (getLoc happy_var_1) (HsTyVar (unLoc happy_var_1)) ) happyReduction_292 _ = notHappyAtAll happyReduce_293 = happySpecReduce_2 118 happyReduction_293 happyReduction_293 (HappyAbsSyn107 happy_var_2) (HappyAbsSyn111 happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_2) (HsBangTy (unLoc happy_var_1) happy_var_2) ) happyReduction_293 _ _ = notHappyAtAll happyReduce_294 = happyMonadReduce 3 118 happyReduction_294 happyReduction_294 ((HappyTerminal happy_var_3) `HappyStk` (HappyAbsSyn142 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 (HappyAbsSyn107 r)) happyReduce_295 = happySpecReduce_2 118 happyReduction_295 happyReduction_295 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_2) $ HsTupleTy HsBoxedOrConstraintTuple [] ) happyReduction_295 _ _ = notHappyAtAll happyReduce_296 = happyReduce 5 118 happyReduction_296 happyReduction_296 ((HappyTerminal happy_var_5) `HappyStk` (HappyAbsSyn110 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn107 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_5) $ HsTupleTy HsBoxedOrConstraintTuple (happy_var_2:happy_var_4) ) `HappyStk` happyRest happyReduce_297 = happySpecReduce_2 118 happyReduction_297 happyReduction_297 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_2) $ HsTupleTy HsUnboxedTuple [] ) happyReduction_297 _ _ = notHappyAtAll happyReduce_298 = happySpecReduce_3 118 happyReduction_298 happyReduction_298 (HappyTerminal happy_var_3) (HappyAbsSyn110 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) $ HsTupleTy HsUnboxedTuple happy_var_2 ) happyReduction_298 _ _ _ = notHappyAtAll happyReduce_299 = happySpecReduce_3 118 happyReduction_299 happyReduction_299 (HappyTerminal happy_var_3) (HappyAbsSyn107 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) $ HsListTy happy_var_2 ) happyReduction_299 _ _ _ = notHappyAtAll happyReduce_300 = happySpecReduce_3 118 happyReduction_300 happyReduction_300 (HappyTerminal happy_var_3) (HappyAbsSyn107 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) $ HsPArrTy happy_var_2 ) happyReduction_300 _ _ _ = notHappyAtAll happyReduce_301 = happySpecReduce_3 118 happyReduction_301 happyReduction_301 (HappyTerminal happy_var_3) (HappyAbsSyn107 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) $ HsParTy happy_var_2 ) happyReduction_301 _ _ _ = notHappyAtAll happyReduce_302 = happyReduce 5 118 happyReduction_302 happyReduction_302 ((HappyTerminal happy_var_5) `HappyStk` (HappyAbsSyn129 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn107 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_5) $ HsKindSig happy_var_2 happy_var_4 ) `HappyStk` happyRest happyReduce_303 = happySpecReduce_1 118 happyReduction_303 happyReduction_303 (HappyAbsSyn156 happy_var_1) = HappyAbsSyn107 (sL (getLoc happy_var_1) (HsQuasiQuoteTy (unLoc happy_var_1)) ) happyReduction_303 _ = notHappyAtAll happyReduce_304 = happySpecReduce_3 118 happyReduction_304 happyReduction_304 (HappyTerminal happy_var_3) (HappyAbsSyn157 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_3) $ mkHsSpliceTy happy_var_2 ) happyReduction_304 _ _ _ = notHappyAtAll happyReduce_305 = happySpecReduce_1 118 happyReduction_305 happyReduction_305 (HappyTerminal happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_1) $ mkHsSpliceTy $ sL (getLoc happy_var_1) $ HsVar $ mkUnqual varName (getTH_ID_SPLICE happy_var_1) ) happyReduction_305 _ = notHappyAtAll happyReduce_306 = happySpecReduce_2 118 happyReduction_306 happyReduction_306 (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_2) $ HsTyVar $ unLoc happy_var_2 ) happyReduction_306 _ _ = notHappyAtAll happyReduce_307 = happyReduce 6 118 happyReduction_307 happyReduction_307 ((HappyTerminal happy_var_6) `HappyStk` (HappyAbsSyn110 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn107 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_6) $ HsExplicitTupleTy [] (happy_var_3 : happy_var_5) ) `HappyStk` happyRest happyReduce_308 = happyReduce 4 118 happyReduction_308 happyReduction_308 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn110 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_4) $ HsExplicitListTy placeHolderKind happy_var_3 ) `HappyStk` happyRest happyReduce_309 = happySpecReduce_2 118 happyReduction_309 happyReduction_309 (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_2) $ HsTyVar $ unLoc happy_var_2 ) happyReduction_309 _ _ = notHappyAtAll happyReduce_310 = happyReduce 5 118 happyReduction_310 happyReduction_310 ((HappyTerminal happy_var_5) `HappyStk` (HappyAbsSyn110 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn107 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn107 (sL (comb2 happy_var_1 happy_var_5) $ HsExplicitListTy placeHolderKind (happy_var_2 : happy_var_4) ) `HappyStk` happyRest happyReduce_311 = happyMonadReduce 1 118 happyReduction_311 happyReduction_311 ((HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkTyLit $ sL (comb2 happy_var_1 happy_var_1) $ HsNumTy $ getINTEGER happy_var_1) ) (\r -> happyReturn (HappyAbsSyn107 r)) happyReduce_312 = happyMonadReduce 1 118 happyReduction_312 happyReduction_312 ((HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( mkTyLit $ sL (comb2 happy_var_1 happy_var_1) $ HsStrTy $ getSTRING happy_var_1) ) (\r -> happyReturn (HappyAbsSyn107 r)) happyReduce_313 = happySpecReduce_1 119 happyReduction_313 happyReduction_313 (HappyAbsSyn107 happy_var_1) = HappyAbsSyn107 (happy_var_1 ) happyReduction_313 _ = notHappyAtAll happyReduce_314 = happySpecReduce_1 120 happyReduction_314 happyReduction_314 (HappyAbsSyn107 happy_var_1) = HappyAbsSyn110 ([happy_var_1] ) happyReduction_314 _ = notHappyAtAll happyReduce_315 = happySpecReduce_3 120 happyReduction_315 happyReduction_315 (HappyAbsSyn110 happy_var_3) _ (HappyAbsSyn107 happy_var_1) = HappyAbsSyn110 (happy_var_1 : happy_var_3 ) happyReduction_315 _ _ _ = notHappyAtAll happyReduce_316 = happySpecReduce_1 121 happyReduction_316 happyReduction_316 (HappyAbsSyn110 happy_var_1) = HappyAbsSyn110 (happy_var_1 ) happyReduction_316 _ = notHappyAtAll happyReduce_317 = happySpecReduce_0 121 happyReduction_317 happyReduction_317 = HappyAbsSyn110 ([] ) happyReduce_318 = happySpecReduce_1 122 happyReduction_318 happyReduction_318 (HappyAbsSyn107 happy_var_1) = HappyAbsSyn110 ([happy_var_1] ) happyReduction_318 _ = notHappyAtAll happyReduce_319 = happySpecReduce_3 122 happyReduction_319 happyReduction_319 (HappyAbsSyn110 happy_var_3) _ (HappyAbsSyn107 happy_var_1) = HappyAbsSyn110 (happy_var_1 : happy_var_3 ) happyReduction_319 _ _ _ = notHappyAtAll happyReduce_320 = happySpecReduce_2 123 happyReduction_320 happyReduction_320 (HappyAbsSyn123 happy_var_2) (HappyAbsSyn124 happy_var_1) = HappyAbsSyn123 (happy_var_1 : happy_var_2 ) happyReduction_320 _ _ = notHappyAtAll happyReduce_321 = happySpecReduce_0 123 happyReduction_321 happyReduction_321 = HappyAbsSyn123 ([] ) happyReduce_322 = happySpecReduce_1 124 happyReduction_322 happyReduction_322 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn124 (sL (getLoc happy_var_1) (UserTyVar (unLoc happy_var_1)) ) happyReduction_322 _ = notHappyAtAll happyReduce_323 = happyReduce 5 124 happyReduction_323 happyReduction_323 ((HappyTerminal happy_var_5) `HappyStk` (HappyAbsSyn129 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn17 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn124 (sL (comb2 happy_var_1 happy_var_5) (KindedTyVar (unLoc happy_var_2) happy_var_4) ) `HappyStk` happyRest happyReduce_324 = happySpecReduce_0 125 happyReduction_324 happyReduction_324 = HappyAbsSyn125 (noLoc [] ) happyReduce_325 = happySpecReduce_2 125 happyReduction_325 happyReduction_325 (HappyAbsSyn125 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn125 (sL (comb2 happy_var_1 happy_var_2) (reverse (unLoc happy_var_2)) ) happyReduction_325 _ _ = notHappyAtAll happyReduce_326 = happySpecReduce_3 126 happyReduction_326 happyReduction_326 (HappyAbsSyn127 happy_var_3) _ (HappyAbsSyn125 happy_var_1) = HappyAbsSyn125 (sL (comb2 happy_var_1 happy_var_3) (happy_var_3 : unLoc happy_var_1) ) happyReduction_326 _ _ _ = notHappyAtAll happyReduce_327 = happySpecReduce_1 126 happyReduction_327 happyReduction_327 (HappyAbsSyn127 happy_var_1) = HappyAbsSyn125 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_327 _ = notHappyAtAll happyReduce_328 = happySpecReduce_3 127 happyReduction_328 happyReduction_328 (HappyAbsSyn128 happy_var_3) (HappyTerminal happy_var_2) (HappyAbsSyn128 happy_var_1) = HappyAbsSyn127 (L (comb3 happy_var_1 happy_var_2 happy_var_3) (reverse (unLoc happy_var_1), reverse (unLoc happy_var_3)) ) happyReduction_328 _ _ _ = notHappyAtAll happyReduce_329 = happySpecReduce_0 128 happyReduction_329 happyReduction_329 = HappyAbsSyn128 (noLoc [] ) happyReduce_330 = happySpecReduce_2 128 happyReduction_330 happyReduction_330 (HappyAbsSyn17 happy_var_2) (HappyAbsSyn128 happy_var_1) = HappyAbsSyn128 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_2 : unLoc happy_var_1) ) happyReduction_330 _ _ = notHappyAtAll happyReduce_331 = happySpecReduce_1 129 happyReduction_331 happyReduction_331 (HappyAbsSyn129 happy_var_1) = HappyAbsSyn129 (happy_var_1 ) happyReduction_331 _ = notHappyAtAll happyReduce_332 = happySpecReduce_3 129 happyReduction_332 happyReduction_332 (HappyAbsSyn129 happy_var_3) _ (HappyAbsSyn129 happy_var_1) = HappyAbsSyn129 (sL (comb2 happy_var_1 happy_var_3) $ HsFunTy happy_var_1 happy_var_3 ) happyReduction_332 _ _ _ = notHappyAtAll happyReduce_333 = happySpecReduce_1 130 happyReduction_333 happyReduction_333 (HappyAbsSyn129 happy_var_1) = HappyAbsSyn129 (happy_var_1 ) happyReduction_333 _ = notHappyAtAll happyReduce_334 = happySpecReduce_2 130 happyReduction_334 happyReduction_334 (HappyAbsSyn129 happy_var_2) (HappyAbsSyn129 happy_var_1) = HappyAbsSyn129 (sL (comb2 happy_var_1 happy_var_2) $ HsAppTy happy_var_1 happy_var_2 ) happyReduction_334 _ _ = notHappyAtAll happyReduce_335 = happySpecReduce_1 131 happyReduction_335 happyReduction_335 (HappyTerminal happy_var_1) = HappyAbsSyn129 (sL (getLoc happy_var_1) $ HsTyVar (nameRdrName liftedTypeKindTyConName) ) happyReduction_335 _ = notHappyAtAll happyReduce_336 = happySpecReduce_3 131 happyReduction_336 happyReduction_336 (HappyTerminal happy_var_3) (HappyAbsSyn129 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn129 (sL (comb2 happy_var_1 happy_var_3) $ HsParTy happy_var_2 ) happyReduction_336 _ _ _ = notHappyAtAll happyReduce_337 = happySpecReduce_1 131 happyReduction_337 happyReduction_337 (HappyAbsSyn129 happy_var_1) = HappyAbsSyn129 (happy_var_1 ) happyReduction_337 _ = notHappyAtAll happyReduce_338 = happySpecReduce_1 131 happyReduction_338 happyReduction_338 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn129 (sL (getLoc happy_var_1) $ HsTyVar (unLoc happy_var_1) ) happyReduction_338 _ = notHappyAtAll happyReduce_339 = happySpecReduce_1 132 happyReduction_339 happyReduction_339 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn129 (sL (getLoc happy_var_1) $ HsTyVar $ unLoc happy_var_1 ) happyReduction_339 _ = notHappyAtAll happyReduce_340 = happySpecReduce_2 132 happyReduction_340 happyReduction_340 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn129 (sL (comb2 happy_var_1 happy_var_2) $ HsTyVar $ getRdrName unitTyCon ) happyReduction_340 _ _ = notHappyAtAll happyReduce_341 = happyReduce 5 132 happyReduction_341 happyReduction_341 ((HappyTerminal happy_var_5) `HappyStk` (HappyAbsSyn133 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn129 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn129 (sL (comb2 happy_var_1 happy_var_5) $ HsTupleTy HsBoxedTuple (happy_var_2 : happy_var_4) ) `HappyStk` happyRest happyReduce_342 = happySpecReduce_3 132 happyReduction_342 happyReduction_342 (HappyTerminal happy_var_3) (HappyAbsSyn129 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn129 (sL (comb2 happy_var_1 happy_var_3) $ HsListTy happy_var_2 ) happyReduction_342 _ _ _ = notHappyAtAll happyReduce_343 = happySpecReduce_1 133 happyReduction_343 happyReduction_343 (HappyAbsSyn129 happy_var_1) = HappyAbsSyn133 ([happy_var_1] ) happyReduction_343 _ = notHappyAtAll happyReduce_344 = happySpecReduce_3 133 happyReduction_344 happyReduction_344 (HappyAbsSyn133 happy_var_3) _ (HappyAbsSyn129 happy_var_1) = HappyAbsSyn133 (happy_var_1 : happy_var_3 ) happyReduction_344 _ _ _ = notHappyAtAll happyReduce_345 = happyReduce 4 134 happyReduction_345 happyReduction_345 (_ `HappyStk` (HappyAbsSyn134 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn134 (L (comb2 happy_var_1 happy_var_3) (unLoc happy_var_3) ) `HappyStk` happyRest happyReduce_346 = happyReduce 4 134 happyReduction_346 happyReduction_346 (_ `HappyStk` (HappyAbsSyn134 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn134 (L (comb2 happy_var_1 happy_var_3) (unLoc happy_var_3) ) `HappyStk` happyRest happyReduce_347 = happySpecReduce_0 134 happyReduction_347 happyReduction_347 = HappyAbsSyn134 (noLoc [] ) happyReduce_348 = happySpecReduce_3 135 happyReduction_348 happyReduction_348 (HappyAbsSyn134 happy_var_3) _ (HappyAbsSyn136 happy_var_1) = HappyAbsSyn134 (L (comb2 (head happy_var_1) happy_var_3) (happy_var_1 ++ unLoc happy_var_3) ) happyReduction_348 _ _ _ = notHappyAtAll happyReduce_349 = happySpecReduce_1 135 happyReduction_349 happyReduction_349 (HappyAbsSyn136 happy_var_1) = HappyAbsSyn134 (L (getLoc (head happy_var_1)) happy_var_1 ) happyReduction_349 _ = notHappyAtAll happyReduce_350 = happySpecReduce_0 135 happyReduction_350 happyReduction_350 = HappyAbsSyn134 (noLoc [] ) happyReduce_351 = happySpecReduce_3 136 happyReduction_351 happyReduction_351 (HappyAbsSyn107 happy_var_3) _ (HappyAbsSyn50 happy_var_1) = HappyAbsSyn136 (map (sL (comb2 happy_var_1 happy_var_3)) (mkGadtDecl (unLoc happy_var_1) happy_var_3) ) happyReduction_351 _ _ _ = notHappyAtAll happyReduce_352 = happyMonadReduce 6 136 happyReduction_352 happyReduction_352 ((HappyAbsSyn107 happy_var_6) `HappyStk` _ `HappyStk` _ `HappyStk` (HappyAbsSyn142 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 (HappyAbsSyn136 r)) happyReduce_353 = happySpecReduce_3 137 happyReduction_353 happyReduction_353 (HappyAbsSyn134 happy_var_3) (HappyTerminal happy_var_2) (HappyAbsSyn19 happy_var_1) = HappyAbsSyn134 (L (comb2 happy_var_2 happy_var_3) (addConDocs (unLoc happy_var_3) happy_var_1) ) happyReduction_353 _ _ _ = notHappyAtAll happyReduce_354 = happyReduce 5 138 happyReduction_354 happyReduction_354 ((HappyAbsSyn139 happy_var_5) `HappyStk` (HappyAbsSyn19 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn19 happy_var_2) `HappyStk` (HappyAbsSyn134 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn134 (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_355 = happySpecReduce_1 138 happyReduction_355 happyReduction_355 (HappyAbsSyn139 happy_var_1) = HappyAbsSyn134 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_355 _ = notHappyAtAll happyReduce_356 = happyReduce 6 139 happyReduction_356 happyReduction_356 ((HappyAbsSyn19 happy_var_6) `HappyStk` (HappyAbsSyn141 happy_var_5) `HappyStk` (HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn114 happy_var_3) `HappyStk` (HappyAbsSyn140 happy_var_2) `HappyStk` (HappyAbsSyn19 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn139 (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_357 = happyReduce 4 139 happyReduction_357 happyReduction_357 ((HappyAbsSyn19 happy_var_4) `HappyStk` (HappyAbsSyn141 happy_var_3) `HappyStk` (HappyAbsSyn140 happy_var_2) `HappyStk` (HappyAbsSyn19 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn139 (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_358 = happySpecReduce_3 140 happyReduction_358 happyReduction_358 (HappyTerminal happy_var_3) (HappyAbsSyn123 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn140 (sL (comb2 happy_var_1 happy_var_3) happy_var_2 ) happyReduction_358 _ _ _ = notHappyAtAll happyReduce_359 = happySpecReduce_0 140 happyReduction_359 happyReduction_359 = HappyAbsSyn140 (noLoc [] ) happyReduce_360 = happyMonadReduce 1 141 happyReduction_360 happyReduction_360 ((HappyAbsSyn107 happy_var_1) `HappyStk` happyRest) tk = happyThen (( splitCon happy_var_1 >>= return.sL (comb2 happy_var_1 happy_var_1)) ) (\r -> happyReturn (HappyAbsSyn141 r)) happyReduce_361 = happySpecReduce_3 141 happyReduction_361 happyReduction_361 (HappyAbsSyn107 happy_var_3) (HappyAbsSyn17 happy_var_2) (HappyAbsSyn107 happy_var_1) = HappyAbsSyn141 (sL (comb2 happy_var_1 happy_var_3) (happy_var_2, InfixCon happy_var_1 happy_var_3) ) happyReduction_361 _ _ _ = notHappyAtAll happyReduce_362 = happySpecReduce_0 142 happyReduction_362 happyReduction_362 = HappyAbsSyn142 ([] ) happyReduce_363 = happySpecReduce_1 142 happyReduction_363 happyReduction_363 (HappyAbsSyn142 happy_var_1) = HappyAbsSyn142 (happy_var_1 ) happyReduction_363 _ = notHappyAtAll happyReduce_364 = happyReduce 5 143 happyReduction_364 happyReduction_364 ((HappyAbsSyn142 happy_var_5) `HappyStk` (HappyAbsSyn19 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn19 happy_var_2) `HappyStk` (HappyAbsSyn142 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn142 ([ addFieldDoc f happy_var_4 | f <- happy_var_1 ] ++ addFieldDocs happy_var_5 happy_var_2 ) `HappyStk` happyRest happyReduce_365 = happySpecReduce_1 143 happyReduction_365 happyReduction_365 (HappyAbsSyn142 happy_var_1) = HappyAbsSyn142 (happy_var_1 ) happyReduction_365 _ = notHappyAtAll happyReduce_366 = happyReduce 5 144 happyReduction_366 happyReduction_366 ((HappyAbsSyn19 happy_var_5) `HappyStk` (HappyAbsSyn107 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn50 happy_var_2) `HappyStk` (HappyAbsSyn19 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn142 ([ ConDeclField fld happy_var_4 (happy_var_1 `mplus` happy_var_5) | fld <- reverse (unLoc happy_var_2) ] ) `HappyStk` happyRest happyReduce_367 = happySpecReduce_0 145 happyReduction_367 happyReduction_367 = HappyAbsSyn145 (noLoc Nothing ) happyReduce_368 = happySpecReduce_2 145 happyReduction_368 happyReduction_368 (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn145 (let { L loc tv = happy_var_2 } in sL (comb2 happy_var_1 happy_var_2) (Just [L loc (HsTyVar tv)]) ) happyReduction_368 _ _ = notHappyAtAll happyReduce_369 = happySpecReduce_3 145 happyReduction_369 happyReduction_369 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn145 (sL (comb2 happy_var_1 happy_var_3) (Just []) ) happyReduction_369 _ _ _ = notHappyAtAll happyReduce_370 = happyReduce 4 145 happyReduction_370 happyReduction_370 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn110 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn145 (sL (comb2 happy_var_1 happy_var_4) (Just happy_var_3) ) `HappyStk` happyRest happyReduce_371 = happySpecReduce_1 146 happyReduction_371 happyReduction_371 (HappyAbsSyn147 happy_var_1) = HappyAbsSyn15 (sL (getLoc happy_var_1) (DocD (unLoc happy_var_1)) ) happyReduction_371 _ = notHappyAtAll happyReduce_372 = happySpecReduce_1 147 happyReduction_372 happyReduction_372 (HappyAbsSyn259 happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (DocCommentNext (unLoc happy_var_1)) ) happyReduction_372 _ = notHappyAtAll happyReduce_373 = happySpecReduce_1 147 happyReduction_373 happyReduction_373 (HappyAbsSyn259 happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (DocCommentPrev (unLoc happy_var_1)) ) happyReduction_373 _ = notHappyAtAll happyReduce_374 = happySpecReduce_1 147 happyReduction_374 happyReduction_374 (HappyAbsSyn261 happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (case (unLoc happy_var_1) of (n, doc) -> DocCommentNamed n doc) ) happyReduction_374 _ = notHappyAtAll happyReduce_375 = happySpecReduce_1 147 happyReduction_375 happyReduction_375 (HappyAbsSyn262 happy_var_1) = HappyAbsSyn147 (sL (getLoc happy_var_1) (case (unLoc happy_var_1) of (n, doc) -> DocGroup n doc) ) happyReduction_375 _ = notHappyAtAll happyReduce_376 = happySpecReduce_1 148 happyReduction_376 happyReduction_376 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (happy_var_1 ) happyReduction_376 _ = notHappyAtAll happyReduce_377 = happyMonadReduce 3 148 happyReduction_377 happyReduction_377 ((HappyAbsSyn150 happy_var_3) `HappyStk` (HappyAbsSyn157 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 empty 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 (HappyAbsSyn75 r)) happyReduce_378 = happyMonadReduce 3 148 happyReduction_378 happyReduction_378 ((HappyAbsSyn150 happy_var_3) `HappyStk` (HappyAbsSyn105 happy_var_2) `HappyStk` (HappyAbsSyn157 happy_var_1) `HappyStk` happyRest) tk = happyThen (( do { r <- checkValDef empty 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 (HappyAbsSyn75 r)) happyReduce_379 = happySpecReduce_1 148 happyReduction_379 happyReduction_379 (HappyAbsSyn15 happy_var_1) = HappyAbsSyn75 (sL (comb2 happy_var_1 happy_var_1) $ unitOL happy_var_1 ) happyReduction_379 _ = notHappyAtAll happyReduce_380 = happySpecReduce_1 148 happyReduction_380 happyReduction_380 (HappyAbsSyn15 happy_var_1) = HappyAbsSyn75 (sL (comb2 happy_var_1 happy_var_1) $ unitOL happy_var_1 ) happyReduction_380 _ = notHappyAtAll happyReduce_381 = happySpecReduce_1 149 happyReduction_381 happyReduction_381 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (happy_var_1 ) happyReduction_381 _ = notHappyAtAll happyReduce_382 = happySpecReduce_1 149 happyReduction_382 happyReduction_382 (HappyAbsSyn157 happy_var_1) = HappyAbsSyn75 (sL (comb2 happy_var_1 happy_var_1) $ unitOL (sL (comb2 happy_var_1 happy_var_1) $ mkSpliceDecl happy_var_1) ) happyReduction_382 _ = notHappyAtAll happyReduce_383 = happySpecReduce_3 150 happyReduction_383 happyReduction_383 (HappyAbsSyn85 happy_var_3) (HappyAbsSyn157 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn150 (sL (comb3 happy_var_1 happy_var_2 happy_var_3) $ GRHSs (unguardedRHS happy_var_2) (unLoc happy_var_3) ) happyReduction_383 _ _ _ = notHappyAtAll happyReduce_384 = happySpecReduce_2 150 happyReduction_384 happyReduction_384 (HappyAbsSyn85 happy_var_2) (HappyAbsSyn151 happy_var_1) = HappyAbsSyn150 (sL (comb2 happy_var_1 happy_var_2) $ GRHSs (reverse (unLoc happy_var_1)) (unLoc happy_var_2) ) happyReduction_384 _ _ = notHappyAtAll happyReduce_385 = happySpecReduce_2 151 happyReduction_385 happyReduction_385 (HappyAbsSyn152 happy_var_2) (HappyAbsSyn151 happy_var_1) = HappyAbsSyn151 (sL (comb2 happy_var_1 happy_var_2) (happy_var_2 : unLoc happy_var_1) ) happyReduction_385 _ _ = notHappyAtAll happyReduce_386 = happySpecReduce_1 151 happyReduction_386 happyReduction_386 (HappyAbsSyn152 happy_var_1) = HappyAbsSyn151 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_386 _ = notHappyAtAll happyReduce_387 = happyReduce 4 152 happyReduction_387 happyReduction_387 ((HappyAbsSyn157 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn178 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn152 (sL (comb2 happy_var_1 happy_var_4) $ GRHS (unLoc happy_var_2) happy_var_4 ) `HappyStk` happyRest happyReduce_388 = happyMonadReduce 3 153 happyReduction_388 happyReduction_388 ((HappyAbsSyn107 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn157 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 (HappyAbsSyn75 r)) happyReduce_389 = happyReduce 5 153 happyReduction_389 happyReduction_389 ((HappyAbsSyn107 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn50 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn17 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn75 (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_390 = happySpecReduce_3 153 happyReduction_390 happyReduction_390 (HappyAbsSyn50 happy_var_3) (HappyAbsSyn48 happy_var_2) (HappyAbsSyn49 happy_var_1) = HappyAbsSyn75 (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_390 _ _ _ = notHappyAtAll happyReduce_391 = happyReduce 4 153 happyReduction_391 happyReduction_391 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` (HappyAbsSyn89 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn75 (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_392 = happyReduce 6 153 happyReduction_392 happyReduction_392 ((HappyTerminal happy_var_6) `HappyStk` (HappyAbsSyn110 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` (HappyAbsSyn89 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn75 (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_393 = happyReduce 6 153 happyReduction_393 happyReduction_393 ((HappyTerminal happy_var_6) `HappyStk` (HappyAbsSyn110 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` (HappyAbsSyn89 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn75 (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_394 = happyReduce 4 153 happyReduction_394 happyReduction_394 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn107 happy_var_3) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn75 (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_395 = happySpecReduce_3 153 happyReduction_395 happyReduction_395 (HappyTerminal happy_var_3) (HappyAbsSyn211 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn75 (sL (comb2 happy_var_1 happy_var_3) $ unitOL (sL (comb2 happy_var_1 happy_var_3) $ SigD (MinimalSig happy_var_2)) ) happyReduction_395 _ _ _ = notHappyAtAll happyReduce_396 = happySpecReduce_0 154 happyReduction_396 happyReduction_396 = HappyAbsSyn89 (Nothing ) happyReduce_397 = happySpecReduce_1 154 happyReduction_397 happyReduction_397 (HappyAbsSyn90 happy_var_1) = HappyAbsSyn89 (Just happy_var_1 ) happyReduction_397 _ = notHappyAtAll happyReduce_398 = happySpecReduce_3 155 happyReduction_398 happyReduction_398 _ (HappyTerminal happy_var_2) _ = HappyAbsSyn90 (ActiveAfter (fromInteger (getINTEGER happy_var_2)) ) happyReduction_398 _ _ _ = notHappyAtAll happyReduce_399 = happyReduce 4 155 happyReduction_399 happyReduction_399 (_ `HappyStk` (HappyTerminal happy_var_3) `HappyStk` _ `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn90 (ActiveBefore (fromInteger (getINTEGER happy_var_3)) ) `HappyStk` happyRest happyReduce_400 = happySpecReduce_1 156 happyReduction_400 happyReduction_400 (HappyTerminal happy_var_1) = HappyAbsSyn156 (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_400 _ = notHappyAtAll happyReduce_401 = happySpecReduce_1 156 happyReduction_401 happyReduction_401 (HappyTerminal happy_var_1) = HappyAbsSyn156 (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_401 _ = notHappyAtAll happyReduce_402 = happySpecReduce_3 157 happyReduction_402 happyReduction_402 (HappyAbsSyn107 happy_var_3) _ (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ ExprWithTySig happy_var_1 happy_var_3 ) happyReduction_402 _ _ _ = notHappyAtAll happyReduce_403 = happySpecReduce_3 157 happyReduction_403 happyReduction_403 (HappyAbsSyn157 happy_var_3) _ (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ HsArrApp happy_var_1 happy_var_3 placeHolderType HsFirstOrderApp True ) happyReduction_403 _ _ _ = notHappyAtAll happyReduce_404 = happySpecReduce_3 157 happyReduction_404 happyReduction_404 (HappyAbsSyn157 happy_var_3) _ (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ HsArrApp happy_var_3 happy_var_1 placeHolderType HsFirstOrderApp False ) happyReduction_404 _ _ _ = notHappyAtAll happyReduce_405 = happySpecReduce_3 157 happyReduction_405 happyReduction_405 (HappyAbsSyn157 happy_var_3) _ (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ HsArrApp happy_var_1 happy_var_3 placeHolderType HsHigherOrderApp True ) happyReduction_405 _ _ _ = notHappyAtAll happyReduce_406 = happySpecReduce_3 157 happyReduction_406 happyReduction_406 (HappyAbsSyn157 happy_var_3) _ (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ HsArrApp happy_var_3 happy_var_1 placeHolderType HsHigherOrderApp False ) happyReduction_406 _ _ _ = notHappyAtAll happyReduce_407 = happySpecReduce_1 157 happyReduction_407 happyReduction_407 (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (happy_var_1 ) happyReduction_407 _ = notHappyAtAll happyReduce_408 = happySpecReduce_1 158 happyReduction_408 happyReduction_408 (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (happy_var_1 ) happyReduction_408 _ = notHappyAtAll happyReduce_409 = happySpecReduce_3 158 happyReduction_409 happyReduction_409 (HappyAbsSyn157 happy_var_3) (HappyAbsSyn157 happy_var_2) (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) (OpApp happy_var_1 happy_var_2 (panic "fixity") happy_var_3) ) happyReduction_409 _ _ _ = notHappyAtAll happyReduce_410 = happyReduce 6 159 happyReduction_410 happyReduction_410 ((HappyAbsSyn157 happy_var_6) `HappyStk` _ `HappyStk` (HappyAbsSyn105 happy_var_4) `HappyStk` (HappyAbsSyn198 happy_var_3) `HappyStk` (HappyAbsSyn195 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_6) $ HsLam (mkMatchGroup FromSource [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_411 = happyReduce 4 159 happyReduction_411 happyReduction_411 ((HappyAbsSyn157 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn85 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_4) $ HsLet (unLoc happy_var_2) happy_var_4 ) `HappyStk` happyRest happyReduce_412 = happySpecReduce_3 159 happyReduction_412 happyReduction_412 (HappyAbsSyn185 happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ HsLamCase placeHolderType (mkMatchGroup FromSource (unLoc happy_var_3)) ) happyReduction_412 _ _ _ = notHappyAtAll happyReduce_413 = happyMonadReduce 8 159 happyReduction_413 happyReduction_413 ((HappyAbsSyn157 happy_var_8) `HappyStk` _ `HappyStk` (HappyAbsSyn42 happy_var_6) `HappyStk` (HappyAbsSyn157 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn42 happy_var_3) `HappyStk` (HappyAbsSyn157 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 (HappyAbsSyn157 r)) happyReduce_414 = happyMonadReduce 2 159 happyReduction_414 happyReduction_414 ((HappyAbsSyn151 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 (HappyAbsSyn157 r)) happyReduce_415 = happyReduce 4 159 happyReduction_415 happyReduction_415 ((HappyAbsSyn185 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn157 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_4) $ HsCase happy_var_2 (mkMatchGroup FromSource (unLoc happy_var_4)) ) `HappyStk` happyRest happyReduce_416 = happySpecReduce_2 159 happyReduction_416 happyReduction_416 (HappyAbsSyn157 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_2) $ NegApp happy_var_2 noSyntaxExpr ) happyReduction_416 _ _ = notHappyAtAll happyReduce_417 = happySpecReduce_2 159 happyReduction_417 happyReduction_417 (HappyAbsSyn178 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (L (comb2 happy_var_1 happy_var_2) (mkHsDo DoExpr (unLoc happy_var_2)) ) happyReduction_417 _ _ = notHappyAtAll happyReduce_418 = happySpecReduce_2 159 happyReduction_418 happyReduction_418 (HappyAbsSyn178 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (L (comb2 happy_var_1 happy_var_2) (mkHsDo MDoExpr (unLoc happy_var_2)) ) happyReduction_418 _ _ = notHappyAtAll happyReduce_419 = happyMonadReduce 2 159 happyReduction_419 happyReduction_419 ((HappyAbsSyn157 happy_var_2) `HappyStk` (HappyAbsSyn161 happy_var_1) `HappyStk` happyRest) tk = happyThen (( do { on <- extension sccProfilingOn ; return $ sL (comb2 happy_var_1 happy_var_2) $ if on then HsSCC (unLoc happy_var_1) happy_var_2 else HsPar happy_var_2 }) ) (\r -> happyReturn (HappyAbsSyn157 r)) happyReduce_420 = happyMonadReduce 2 159 happyReduction_420 happyReduction_420 ((HappyAbsSyn157 happy_var_2) `HappyStk` (HappyAbsSyn162 happy_var_1) `HappyStk` happyRest) tk = happyThen (( do { on <- extension hpcEnabled ; return $ sL (comb2 happy_var_1 happy_var_2) $ if on then HsTickPragma (unLoc happy_var_1) happy_var_2 else HsPar happy_var_2 }) ) (\r -> happyReturn (HappyAbsSyn157 r)) happyReduce_421 = happyMonadReduce 4 159 happyReduction_421 happyReduction_421 ((HappyAbsSyn157 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn157 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkPattern empty happy_var_2 >>= \ p -> checkCommand happy_var_4 >>= \ cmd -> return (sL (comb2 happy_var_1 happy_var_4) $ HsProc p (sL (comb2 happy_var_1 happy_var_4) $ HsCmdTop cmd placeHolderType placeHolderType undefined))) ) (\r -> happyReturn (HappyAbsSyn157 r)) happyReduce_422 = happyReduce 4 159 happyReduction_422 happyReduction_422 ((HappyAbsSyn157 happy_var_4) `HappyStk` _ `HappyStk` (HappyTerminal happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_4) $ HsCoreAnn (getSTRING happy_var_2) happy_var_4 ) `HappyStk` happyRest happyReduce_423 = happySpecReduce_1 159 happyReduction_423 happyReduction_423 (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (happy_var_1 ) happyReduction_423 _ = notHappyAtAll happyReduce_424 = happySpecReduce_1 160 happyReduction_424 happyReduction_424 _ = HappyAbsSyn42 (True ) happyReduce_425 = happySpecReduce_0 160 happyReduction_425 happyReduction_425 = HappyAbsSyn42 (False ) happyReduce_426 = happyMonadReduce 3 161 happyReduction_426 happyReduction_426 ((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 (HappyAbsSyn161 r)) happyReduce_427 = happySpecReduce_3 161 happyReduction_427 happyReduction_427 (HappyTerminal happy_var_3) (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn161 (sL (comb2 happy_var_1 happy_var_3) (getVARID happy_var_2) ) happyReduction_427 _ _ _ = notHappyAtAll happyReduce_428 = happyReduce 10 162 happyReduction_428 happyReduction_428 ((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) = HappyAbsSyn162 (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_429 = happySpecReduce_2 163 happyReduction_429 happyReduction_429 (HappyAbsSyn157 happy_var_2) (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_2) $ HsApp happy_var_1 happy_var_2 ) happyReduction_429 _ _ = notHappyAtAll happyReduce_430 = happySpecReduce_1 163 happyReduction_430 happyReduction_430 (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (happy_var_1 ) happyReduction_430 _ = notHappyAtAll happyReduce_431 = happySpecReduce_3 164 happyReduction_431 happyReduction_431 (HappyAbsSyn157 happy_var_3) _ (HappyAbsSyn17 happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ EAsPat happy_var_1 happy_var_3 ) happyReduction_431 _ _ _ = notHappyAtAll happyReduce_432 = happySpecReduce_2 164 happyReduction_432 happyReduction_432 (HappyAbsSyn157 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_2) $ ELazyPat happy_var_2 ) happyReduction_432 _ _ = notHappyAtAll happyReduce_433 = happySpecReduce_1 164 happyReduction_433 happyReduction_433 (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (happy_var_1 ) happyReduction_433 _ = notHappyAtAll happyReduce_434 = happyMonadReduce 4 165 happyReduction_434 happyReduction_434 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn205 happy_var_3) `HappyStk` (HappyTerminal happy_var_2) `HappyStk` (HappyAbsSyn157 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 (HappyAbsSyn157 r)) happyReduce_435 = happySpecReduce_1 165 happyReduction_435 happyReduction_435 (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (happy_var_1 ) happyReduction_435 _ = notHappyAtAll happyReduce_436 = happySpecReduce_1 166 happyReduction_436 happyReduction_436 (HappyAbsSyn210 happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) (HsIPVar $! unLoc happy_var_1) ) happyReduction_436 _ = notHappyAtAll happyReduce_437 = happySpecReduce_1 166 happyReduction_437 happyReduction_437 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) (HsVar $! unLoc happy_var_1) ) happyReduction_437 _ = notHappyAtAll happyReduce_438 = happySpecReduce_1 166 happyReduction_438 happyReduction_438 (HappyAbsSyn255 happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) (HsLit $! unLoc happy_var_1) ) happyReduction_438 _ = notHappyAtAll happyReduce_439 = happySpecReduce_1 166 happyReduction_439 happyReduction_439 (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) (HsOverLit $! mkHsIntegral (getINTEGER happy_var_1) placeHolderType) ) happyReduction_439 _ = notHappyAtAll happyReduce_440 = happySpecReduce_1 166 happyReduction_440 happyReduction_440 (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) (HsOverLit $! mkHsFractional (getRATIONAL happy_var_1) placeHolderType) ) happyReduction_440 _ = notHappyAtAll happyReduce_441 = happySpecReduce_3 166 happyReduction_441 happyReduction_441 (HappyTerminal happy_var_3) (HappyAbsSyn157 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) (HsPar happy_var_2) ) happyReduction_441 _ _ _ = notHappyAtAll happyReduce_442 = happySpecReduce_3 166 happyReduction_442 happyReduction_442 (HappyTerminal happy_var_3) (HappyAbsSyn173 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) (ExplicitTuple happy_var_2 Boxed) ) happyReduction_442 _ _ _ = notHappyAtAll happyReduce_443 = happySpecReduce_3 166 happyReduction_443 happyReduction_443 (HappyTerminal happy_var_3) (HappyAbsSyn157 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) (ExplicitTuple [Present happy_var_2] Unboxed) ) happyReduction_443 _ _ _ = notHappyAtAll happyReduce_444 = happySpecReduce_3 166 happyReduction_444 happyReduction_444 (HappyTerminal happy_var_3) (HappyAbsSyn173 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) (ExplicitTuple happy_var_2 Unboxed) ) happyReduction_444 _ _ _ = notHappyAtAll happyReduce_445 = happySpecReduce_3 166 happyReduction_445 happyReduction_445 (HappyTerminal happy_var_3) (HappyAbsSyn157 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_445 _ _ _ = notHappyAtAll happyReduce_446 = happySpecReduce_3 166 happyReduction_446 happyReduction_446 (HappyTerminal happy_var_3) (HappyAbsSyn157 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_446 _ _ _ = notHappyAtAll happyReduce_447 = happySpecReduce_1 166 happyReduction_447 happyReduction_447 (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) EWildPat ) happyReduction_447 _ = notHappyAtAll happyReduce_448 = happySpecReduce_1 166 happyReduction_448 happyReduction_448 (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (happy_var_1 ) happyReduction_448 _ = notHappyAtAll happyReduce_449 = happySpecReduce_2 166 happyReduction_449 happyReduction_449 (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_2) $ HsBracket (VarBr True (unLoc happy_var_2)) ) happyReduction_449 _ _ = notHappyAtAll happyReduce_450 = happySpecReduce_2 166 happyReduction_450 happyReduction_450 (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_2) $ HsBracket (VarBr True (unLoc happy_var_2)) ) happyReduction_450 _ _ = notHappyAtAll happyReduce_451 = happySpecReduce_2 166 happyReduction_451 happyReduction_451 (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_2) $ HsBracket (VarBr False (unLoc happy_var_2)) ) happyReduction_451 _ _ = notHappyAtAll happyReduce_452 = happySpecReduce_2 166 happyReduction_452 happyReduction_452 (HappyAbsSyn17 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_2) $ HsBracket (VarBr False (unLoc happy_var_2)) ) happyReduction_452 _ _ = notHappyAtAll happyReduce_453 = happySpecReduce_3 166 happyReduction_453 happyReduction_453 (HappyTerminal happy_var_3) (HappyAbsSyn157 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ HsBracket (ExpBr happy_var_2) ) happyReduction_453 _ _ _ = notHappyAtAll happyReduce_454 = happySpecReduce_3 166 happyReduction_454 happyReduction_454 (HappyTerminal happy_var_3) (HappyAbsSyn157 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ HsBracket (TExpBr happy_var_2) ) happyReduction_454 _ _ _ = notHappyAtAll happyReduce_455 = happySpecReduce_3 166 happyReduction_455 happyReduction_455 (HappyTerminal happy_var_3) (HappyAbsSyn107 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ HsBracket (TypBr happy_var_2) ) happyReduction_455 _ _ _ = notHappyAtAll happyReduce_456 = happyMonadReduce 3 166 happyReduction_456 happyReduction_456 ((HappyTerminal happy_var_3) `HappyStk` (HappyAbsSyn157 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkPattern empty happy_var_2 >>= \p -> return (sL (comb2 happy_var_1 happy_var_3) $ HsBracket (PatBr p))) ) (\r -> happyReturn (HappyAbsSyn157 r)) happyReduce_457 = happySpecReduce_3 166 happyReduction_457 happyReduction_457 (HappyTerminal happy_var_3) (HappyAbsSyn25 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ HsBracket (DecBrL happy_var_2) ) happyReduction_457 _ _ _ = notHappyAtAll happyReduce_458 = happySpecReduce_1 166 happyReduction_458 happyReduction_458 (HappyAbsSyn156 happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) (HsQuasiQuoteE (unLoc happy_var_1)) ) happyReduction_458 _ = notHappyAtAll happyReduce_459 = happyReduce 4 166 happyReduction_459 happyReduction_459 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn168 happy_var_3) `HappyStk` (HappyAbsSyn157 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_4) $ HsArrForm happy_var_2 Nothing (reverse happy_var_3) ) `HappyStk` happyRest happyReduce_460 = happySpecReduce_1 167 happyReduction_460 happyReduction_460 (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) $ mkHsSpliceE (sL (getLoc happy_var_1) $ HsVar (mkUnqual varName (getTH_ID_SPLICE happy_var_1))) ) happyReduction_460 _ = notHappyAtAll happyReduce_461 = happySpecReduce_3 167 happyReduction_461 happyReduction_461 (HappyTerminal happy_var_3) (HappyAbsSyn157 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ mkHsSpliceE happy_var_2 ) happyReduction_461 _ _ _ = notHappyAtAll happyReduce_462 = happySpecReduce_1 167 happyReduction_462 happyReduction_462 (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) $ mkHsSpliceTE (sL (getLoc happy_var_1) $ HsVar (mkUnqual varName (getTH_ID_TY_SPLICE happy_var_1))) ) happyReduction_462 _ = notHappyAtAll happyReduce_463 = happySpecReduce_3 167 happyReduction_463 happyReduction_463 (HappyTerminal happy_var_3) (HappyAbsSyn157 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ mkHsSpliceTE happy_var_2 ) happyReduction_463 _ _ _ = notHappyAtAll happyReduce_464 = happySpecReduce_2 168 happyReduction_464 happyReduction_464 (HappyAbsSyn169 happy_var_2) (HappyAbsSyn168 happy_var_1) = HappyAbsSyn168 (happy_var_2 : happy_var_1 ) happyReduction_464 _ _ = notHappyAtAll happyReduce_465 = happySpecReduce_0 168 happyReduction_465 happyReduction_465 = HappyAbsSyn168 ([] ) happyReduce_466 = happyMonadReduce 1 169 happyReduction_466 happyReduction_466 ((HappyAbsSyn157 happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkCommand happy_var_1 >>= \ cmd -> return (sL (getLoc happy_var_1) $ HsCmdTop cmd placeHolderType placeHolderType undefined)) ) (\r -> happyReturn (HappyAbsSyn169 r)) happyReduce_467 = happySpecReduce_3 170 happyReduction_467 happyReduction_467 _ (HappyAbsSyn25 happy_var_2) _ = HappyAbsSyn25 (happy_var_2 ) happyReduction_467 _ _ _ = notHappyAtAll happyReduce_468 = happySpecReduce_3 170 happyReduction_468 happyReduction_468 _ (HappyAbsSyn25 happy_var_2) _ = HappyAbsSyn25 (happy_var_2 ) happyReduction_468 _ _ _ = notHappyAtAll happyReduce_469 = happySpecReduce_0 171 happyReduction_469 happyReduction_469 = HappyAbsSyn25 ([] ) happyReduce_470 = happySpecReduce_1 171 happyReduction_470 happyReduction_470 (HappyAbsSyn25 happy_var_1) = HappyAbsSyn25 (happy_var_1 ) happyReduction_470 _ = notHappyAtAll happyReduce_471 = happySpecReduce_1 172 happyReduction_471 happyReduction_471 (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (happy_var_1 ) happyReduction_471 _ = notHappyAtAll happyReduce_472 = happySpecReduce_2 172 happyReduction_472 happyReduction_472 (HappyAbsSyn157 happy_var_2) (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_2) $ SectionL happy_var_1 happy_var_2 ) happyReduction_472 _ _ = notHappyAtAll happyReduce_473 = happySpecReduce_2 172 happyReduction_473 happyReduction_473 (HappyAbsSyn157 happy_var_2) (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_2) $ SectionR happy_var_1 happy_var_2 ) happyReduction_473 _ _ = notHappyAtAll happyReduce_474 = happySpecReduce_3 172 happyReduction_474 happyReduction_474 (HappyAbsSyn157 happy_var_3) _ (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ EViewPat happy_var_1 happy_var_3 ) happyReduction_474 _ _ _ = notHappyAtAll happyReduce_475 = happySpecReduce_2 173 happyReduction_475 happyReduction_475 (HappyAbsSyn173 happy_var_2) (HappyAbsSyn157 happy_var_1) = HappyAbsSyn173 (Present happy_var_1 : happy_var_2 ) happyReduction_475 _ _ = notHappyAtAll happyReduce_476 = happySpecReduce_2 173 happyReduction_476 happyReduction_476 (HappyAbsSyn173 happy_var_2) (HappyAbsSyn48 happy_var_1) = HappyAbsSyn173 (replicate happy_var_1 missingTupArg ++ happy_var_2 ) happyReduction_476 _ _ = notHappyAtAll happyReduce_477 = happySpecReduce_2 174 happyReduction_477 happyReduction_477 (HappyAbsSyn173 happy_var_2) (HappyAbsSyn48 happy_var_1) = HappyAbsSyn173 (replicate (happy_var_1-1) missingTupArg ++ happy_var_2 ) happyReduction_477 _ _ = notHappyAtAll happyReduce_478 = happySpecReduce_2 175 happyReduction_478 happyReduction_478 (HappyAbsSyn173 happy_var_2) (HappyAbsSyn157 happy_var_1) = HappyAbsSyn173 (Present happy_var_1 : happy_var_2 ) happyReduction_478 _ _ = notHappyAtAll happyReduce_479 = happySpecReduce_1 175 happyReduction_479 happyReduction_479 (HappyAbsSyn157 happy_var_1) = HappyAbsSyn173 ([Present happy_var_1] ) happyReduction_479 _ = notHappyAtAll happyReduce_480 = happySpecReduce_0 175 happyReduction_480 happyReduction_480 = HappyAbsSyn173 ([missingTupArg] ) happyReduce_481 = happySpecReduce_1 176 happyReduction_481 happyReduction_481 (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) $ ExplicitList placeHolderType Nothing [happy_var_1] ) happyReduction_481 _ = notHappyAtAll happyReduce_482 = happySpecReduce_1 176 happyReduction_482 happyReduction_482 (HappyAbsSyn177 happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) $ ExplicitList placeHolderType Nothing (reverse (unLoc happy_var_1)) ) happyReduction_482 _ = notHappyAtAll happyReduce_483 = happySpecReduce_2 176 happyReduction_483 happyReduction_483 (HappyTerminal happy_var_2) (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_2) $ ArithSeq noPostTcExpr Nothing (From happy_var_1) ) happyReduction_483 _ _ = notHappyAtAll happyReduce_484 = happyReduce 4 176 happyReduction_484 happyReduction_484 ((HappyTerminal happy_var_4) `HappyStk` (HappyAbsSyn157 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn157 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_4) $ ArithSeq noPostTcExpr Nothing (FromThen happy_var_1 happy_var_3) ) `HappyStk` happyRest happyReduce_485 = happySpecReduce_3 176 happyReduction_485 happyReduction_485 (HappyAbsSyn157 happy_var_3) _ (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ ArithSeq noPostTcExpr Nothing (FromTo happy_var_1 happy_var_3) ) happyReduction_485 _ _ _ = notHappyAtAll happyReduce_486 = happyReduce 5 176 happyReduction_486 happyReduction_486 ((HappyAbsSyn157 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn157 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn157 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_5) $ ArithSeq noPostTcExpr Nothing (FromThenTo happy_var_1 happy_var_3 happy_var_5) ) `HappyStk` happyRest happyReduce_487 = happyMonadReduce 3 176 happyReduction_487 happyReduction_487 ((HappyAbsSyn178 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn157 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 (HappyAbsSyn157 r)) happyReduce_488 = happySpecReduce_3 177 happyReduction_488 happyReduction_488 (HappyAbsSyn157 happy_var_3) _ (HappyAbsSyn177 happy_var_1) = HappyAbsSyn177 (sL (comb2 happy_var_1 happy_var_3) (((:) $! happy_var_3) $! unLoc happy_var_1) ) happyReduction_488 _ _ _ = notHappyAtAll happyReduce_489 = happySpecReduce_3 177 happyReduction_489 happyReduction_489 (HappyAbsSyn157 happy_var_3) _ (HappyAbsSyn157 happy_var_1) = HappyAbsSyn177 (sL (comb2 happy_var_1 happy_var_3) [happy_var_3,happy_var_1] ) happyReduction_489 _ _ _ = notHappyAtAll happyReduce_490 = happySpecReduce_1 178 happyReduction_490 happyReduction_490 (HappyAbsSyn179 happy_var_1) = HappyAbsSyn178 (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_490 _ = notHappyAtAll happyReduce_491 = happySpecReduce_3 179 happyReduction_491 happyReduction_491 (HappyAbsSyn179 happy_var_3) (HappyTerminal happy_var_2) (HappyAbsSyn178 happy_var_1) = HappyAbsSyn179 (L (getLoc happy_var_2) (reverse (unLoc happy_var_1) : unLoc happy_var_3) ) happyReduction_491 _ _ _ = notHappyAtAll happyReduce_492 = happySpecReduce_1 179 happyReduction_492 happyReduction_492 (HappyAbsSyn178 happy_var_1) = HappyAbsSyn179 (L (getLoc happy_var_1) [reverse (unLoc happy_var_1)] ) happyReduction_492 _ = notHappyAtAll happyReduce_493 = happySpecReduce_3 180 happyReduction_493 happyReduction_493 (HappyAbsSyn181 happy_var_3) _ (HappyAbsSyn178 happy_var_1) = HappyAbsSyn178 (sL (comb2 happy_var_1 happy_var_3) [L (getLoc happy_var_3) ((unLoc happy_var_3) (reverse (unLoc happy_var_1)))] ) happyReduction_493 _ _ _ = notHappyAtAll happyReduce_494 = happySpecReduce_3 180 happyReduction_494 happyReduction_494 (HappyAbsSyn203 happy_var_3) _ (HappyAbsSyn178 happy_var_1) = HappyAbsSyn178 (sL (comb2 happy_var_1 happy_var_3) (happy_var_3 : unLoc happy_var_1) ) happyReduction_494 _ _ _ = notHappyAtAll happyReduce_495 = happySpecReduce_1 180 happyReduction_495 happyReduction_495 (HappyAbsSyn181 happy_var_1) = HappyAbsSyn178 (sL (comb2 happy_var_1 happy_var_1) [L (getLoc happy_var_1) ((unLoc happy_var_1) [])] ) happyReduction_495 _ = notHappyAtAll happyReduce_496 = happySpecReduce_1 180 happyReduction_496 happyReduction_496 (HappyAbsSyn203 happy_var_1) = HappyAbsSyn178 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_496 _ = notHappyAtAll happyReduce_497 = happySpecReduce_2 181 happyReduction_497 happyReduction_497 (HappyAbsSyn157 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn181 (sL (comb2 happy_var_1 happy_var_2) $ \ss -> (mkTransformStmt ss happy_var_2) ) happyReduction_497 _ _ = notHappyAtAll happyReduce_498 = happyReduce 4 181 happyReduction_498 happyReduction_498 ((HappyAbsSyn157 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn157 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn181 (sL (comb2 happy_var_1 happy_var_4) $ \ss -> (mkTransformByStmt ss happy_var_2 happy_var_4) ) `HappyStk` happyRest happyReduce_499 = happyReduce 4 181 happyReduction_499 happyReduction_499 ((HappyAbsSyn157 happy_var_4) `HappyStk` _ `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn181 (sL (comb2 happy_var_1 happy_var_4) $ \ss -> (mkGroupUsingStmt ss happy_var_4) ) `HappyStk` happyRest happyReduce_500 = happyReduce 6 181 happyReduction_500 happyReduction_500 ((HappyAbsSyn157 happy_var_6) `HappyStk` _ `HappyStk` (HappyAbsSyn157 happy_var_4) `HappyStk` _ `HappyStk` _ `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn181 (sL (comb2 happy_var_1 happy_var_6) $ \ss -> (mkGroupByUsingStmt ss happy_var_4 happy_var_6) ) `HappyStk` happyRest happyReduce_501 = happySpecReduce_0 182 happyReduction_501 happyReduction_501 = HappyAbsSyn157 (noLoc (ExplicitPArr placeHolderType []) ) happyReduce_502 = happySpecReduce_1 182 happyReduction_502 happyReduction_502 (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) $ ExplicitPArr placeHolderType [happy_var_1] ) happyReduction_502 _ = notHappyAtAll happyReduce_503 = happySpecReduce_1 182 happyReduction_503 happyReduction_503 (HappyAbsSyn177 happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) $ ExplicitPArr placeHolderType (reverse (unLoc happy_var_1)) ) happyReduction_503 _ = notHappyAtAll happyReduce_504 = happySpecReduce_3 182 happyReduction_504 happyReduction_504 (HappyAbsSyn157 happy_var_3) _ (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ PArrSeq noPostTcExpr (FromTo happy_var_1 happy_var_3) ) happyReduction_504 _ _ _ = notHappyAtAll happyReduce_505 = happyReduce 5 182 happyReduction_505 happyReduction_505 ((HappyAbsSyn157 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn157 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn157 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_5) $ PArrSeq noPostTcExpr (FromThenTo happy_var_1 happy_var_3 happy_var_5) ) `HappyStk` happyRest happyReduce_506 = happySpecReduce_3 182 happyReduction_506 happyReduction_506 (HappyAbsSyn178 happy_var_3) _ (HappyAbsSyn157 happy_var_1) = HappyAbsSyn157 (sL (comb2 happy_var_1 happy_var_3) $ mkHsComp PArrComp (unLoc happy_var_3) happy_var_1 ) happyReduction_506 _ _ _ = notHappyAtAll happyReduce_507 = happySpecReduce_1 183 happyReduction_507 happyReduction_507 (HappyAbsSyn178 happy_var_1) = HappyAbsSyn178 (L (getLoc happy_var_1) (reverse (unLoc happy_var_1)) ) happyReduction_507 _ = notHappyAtAll happyReduce_508 = happySpecReduce_3 184 happyReduction_508 happyReduction_508 (HappyAbsSyn203 happy_var_3) _ (HappyAbsSyn178 happy_var_1) = HappyAbsSyn178 (sL (comb2 happy_var_1 happy_var_3) (happy_var_3 : unLoc happy_var_1) ) happyReduction_508 _ _ _ = notHappyAtAll happyReduce_509 = happySpecReduce_1 184 happyReduction_509 happyReduction_509 (HappyAbsSyn203 happy_var_1) = HappyAbsSyn178 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_509 _ = notHappyAtAll happyReduce_510 = happySpecReduce_3 185 happyReduction_510 happyReduction_510 (HappyTerminal happy_var_3) (HappyAbsSyn185 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn185 (sL (comb2 happy_var_1 happy_var_3) (reverse (unLoc happy_var_2)) ) happyReduction_510 _ _ _ = notHappyAtAll happyReduce_511 = happySpecReduce_3 185 happyReduction_511 happyReduction_511 _ (HappyAbsSyn185 happy_var_2) _ = HappyAbsSyn185 (L (getLoc happy_var_2) (reverse (unLoc happy_var_2)) ) happyReduction_511 _ _ _ = notHappyAtAll happyReduce_512 = happySpecReduce_2 185 happyReduction_512 happyReduction_512 _ _ = HappyAbsSyn185 (noLoc [] ) happyReduce_513 = happySpecReduce_2 185 happyReduction_513 happyReduction_513 _ _ = HappyAbsSyn185 (noLoc [] ) happyReduce_514 = happySpecReduce_1 186 happyReduction_514 happyReduction_514 (HappyAbsSyn185 happy_var_1) = HappyAbsSyn185 (sL (getLoc happy_var_1) (unLoc happy_var_1) ) happyReduction_514 _ = notHappyAtAll happyReduce_515 = happySpecReduce_2 186 happyReduction_515 happyReduction_515 (HappyAbsSyn185 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn185 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_2) ) happyReduction_515 _ _ = notHappyAtAll happyReduce_516 = happySpecReduce_3 187 happyReduction_516 happyReduction_516 (HappyAbsSyn188 happy_var_3) _ (HappyAbsSyn185 happy_var_1) = HappyAbsSyn185 (sL (comb2 happy_var_1 happy_var_3) (happy_var_3 : unLoc happy_var_1) ) happyReduction_516 _ _ _ = notHappyAtAll happyReduce_517 = happySpecReduce_2 187 happyReduction_517 happyReduction_517 (HappyTerminal happy_var_2) (HappyAbsSyn185 happy_var_1) = HappyAbsSyn185 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_1) ) happyReduction_517 _ _ = notHappyAtAll happyReduce_518 = happySpecReduce_1 187 happyReduction_518 happyReduction_518 (HappyAbsSyn188 happy_var_1) = HappyAbsSyn185 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_518 _ = notHappyAtAll happyReduce_519 = happySpecReduce_3 188 happyReduction_519 happyReduction_519 (HappyAbsSyn150 happy_var_3) (HappyAbsSyn105 happy_var_2) (HappyAbsSyn195 happy_var_1) = HappyAbsSyn188 (sL (comb2 happy_var_1 happy_var_3) (Match [happy_var_1] happy_var_2 (unLoc happy_var_3)) ) happyReduction_519 _ _ _ = notHappyAtAll happyReduce_520 = happySpecReduce_2 189 happyReduction_520 happyReduction_520 (HappyAbsSyn85 happy_var_2) (HappyAbsSyn151 happy_var_1) = HappyAbsSyn150 (sL (comb2 happy_var_1 happy_var_2) (GRHSs (unLoc happy_var_1) (unLoc happy_var_2)) ) happyReduction_520 _ _ = notHappyAtAll happyReduce_521 = happySpecReduce_2 190 happyReduction_521 happyReduction_521 (HappyAbsSyn157 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn151 (sL (comb2 happy_var_1 happy_var_2) (unguardedRHS happy_var_2) ) happyReduction_521 _ _ = notHappyAtAll happyReduce_522 = happySpecReduce_1 190 happyReduction_522 happyReduction_522 (HappyAbsSyn151 happy_var_1) = HappyAbsSyn151 (sL (getLoc happy_var_1) (reverse (unLoc happy_var_1)) ) happyReduction_522 _ = notHappyAtAll happyReduce_523 = happySpecReduce_2 191 happyReduction_523 happyReduction_523 (HappyAbsSyn152 happy_var_2) (HappyAbsSyn151 happy_var_1) = HappyAbsSyn151 (sL (comb2 happy_var_1 happy_var_2) (happy_var_2 : unLoc happy_var_1) ) happyReduction_523 _ _ = notHappyAtAll happyReduce_524 = happySpecReduce_1 191 happyReduction_524 happyReduction_524 (HappyAbsSyn152 happy_var_1) = HappyAbsSyn151 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_524 _ = notHappyAtAll happyReduce_525 = happySpecReduce_3 192 happyReduction_525 happyReduction_525 _ (HappyAbsSyn152 happy_var_2) (HappyAbsSyn151 happy_var_1) = HappyAbsSyn151 (sL (comb2 happy_var_1 happy_var_2) (happy_var_2 : unLoc happy_var_1) ) happyReduction_525 _ _ _ = notHappyAtAll happyReduce_526 = happySpecReduce_2 192 happyReduction_526 happyReduction_526 _ (HappyAbsSyn152 happy_var_1) = HappyAbsSyn151 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_526 _ _ = notHappyAtAll happyReduce_527 = happySpecReduce_3 193 happyReduction_527 happyReduction_527 (HappyTerminal happy_var_3) (HappyAbsSyn151 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn151 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_527 _ _ _ = notHappyAtAll happyReduce_528 = happySpecReduce_2 193 happyReduction_528 happyReduction_528 _ (HappyAbsSyn151 happy_var_1) = HappyAbsSyn151 (happy_var_1 ) happyReduction_528 _ _ = notHappyAtAll happyReduce_529 = happyReduce 4 194 happyReduction_529 happyReduction_529 ((HappyAbsSyn157 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn178 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) = HappyAbsSyn152 (sL (comb2 happy_var_1 happy_var_4) $ GRHS (unLoc happy_var_2) happy_var_4 ) `HappyStk` happyRest happyReduce_530 = happyMonadReduce 1 195 happyReduction_530 happyReduction_530 ((HappyAbsSyn157 happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkPattern empty happy_var_1) ) (\r -> happyReturn (HappyAbsSyn195 r)) happyReduce_531 = happyMonadReduce 2 195 happyReduction_531 happyReduction_531 ((HappyAbsSyn157 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkPattern empty (sL (comb2 happy_var_1 happy_var_2) (SectionR (sL (getLoc happy_var_1) (HsVar bang_RDR)) happy_var_2))) ) (\r -> happyReturn (HappyAbsSyn195 r)) happyReduce_532 = happyMonadReduce 1 196 happyReduction_532 happyReduction_532 ((HappyAbsSyn157 happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkPattern (text "Possibly caused by a missing 'do'?") happy_var_1) ) (\r -> happyReturn (HappyAbsSyn195 r)) happyReduce_533 = happyMonadReduce 2 196 happyReduction_533 happyReduction_533 ((HappyAbsSyn157 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkPattern (text "Possibly caused by a missing 'do'?") (sL (comb2 happy_var_1 happy_var_2) (SectionR (sL (getLoc happy_var_1) (HsVar bang_RDR)) happy_var_2))) ) (\r -> happyReturn (HappyAbsSyn195 r)) happyReduce_534 = happyMonadReduce 1 197 happyReduction_534 happyReduction_534 ((HappyAbsSyn157 happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkPattern empty happy_var_1) ) (\r -> happyReturn (HappyAbsSyn195 r)) happyReduce_535 = happyMonadReduce 2 197 happyReduction_535 happyReduction_535 ((HappyAbsSyn157 happy_var_2) `HappyStk` (HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( checkPattern empty (sL (comb2 happy_var_1 happy_var_2) (SectionR (sL (getLoc happy_var_1) (HsVar bang_RDR)) happy_var_2))) ) (\r -> happyReturn (HappyAbsSyn195 r)) happyReduce_536 = happySpecReduce_2 198 happyReduction_536 happyReduction_536 (HappyAbsSyn198 happy_var_2) (HappyAbsSyn195 happy_var_1) = HappyAbsSyn198 (happy_var_1 : happy_var_2 ) happyReduction_536 _ _ = notHappyAtAll happyReduce_537 = happySpecReduce_0 198 happyReduction_537 happyReduction_537 = HappyAbsSyn198 ([] ) happyReduce_538 = happySpecReduce_3 199 happyReduction_538 happyReduction_538 (HappyTerminal happy_var_3) (HappyAbsSyn178 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn178 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_2) ) happyReduction_538 _ _ _ = notHappyAtAll happyReduce_539 = happySpecReduce_3 199 happyReduction_539 happyReduction_539 _ (HappyAbsSyn178 happy_var_2) _ = HappyAbsSyn178 (happy_var_2 ) happyReduction_539 _ _ _ = notHappyAtAll happyReduce_540 = happySpecReduce_2 200 happyReduction_540 happyReduction_540 (HappyAbsSyn178 happy_var_2) (HappyAbsSyn203 happy_var_1) = HappyAbsSyn178 (sL (comb2 happy_var_1 happy_var_2) (happy_var_1 : unLoc happy_var_2) ) happyReduction_540 _ _ = notHappyAtAll happyReduce_541 = happySpecReduce_2 200 happyReduction_541 happyReduction_541 (HappyAbsSyn178 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn178 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_2) ) happyReduction_541 _ _ = notHappyAtAll happyReduce_542 = happySpecReduce_0 200 happyReduction_542 happyReduction_542 = HappyAbsSyn178 (noLoc [] ) happyReduce_543 = happySpecReduce_2 201 happyReduction_543 happyReduction_543 (HappyAbsSyn178 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn178 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_2) ) happyReduction_543 _ _ = notHappyAtAll happyReduce_544 = happySpecReduce_0 201 happyReduction_544 happyReduction_544 = HappyAbsSyn178 (noLoc [] ) happyReduce_545 = happySpecReduce_1 202 happyReduction_545 happyReduction_545 (HappyAbsSyn203 happy_var_1) = HappyAbsSyn202 (Just happy_var_1 ) happyReduction_545 _ = notHappyAtAll happyReduce_546 = happySpecReduce_0 202 happyReduction_546 happyReduction_546 = HappyAbsSyn202 (Nothing ) happyReduce_547 = happySpecReduce_1 203 happyReduction_547 happyReduction_547 (HappyAbsSyn203 happy_var_1) = HappyAbsSyn203 (happy_var_1 ) happyReduction_547 _ = notHappyAtAll happyReduce_548 = happySpecReduce_2 203 happyReduction_548 happyReduction_548 (HappyAbsSyn178 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn203 (sL (comb2 happy_var_1 happy_var_2) $ mkRecStmt (unLoc happy_var_2) ) happyReduction_548 _ _ = notHappyAtAll happyReduce_549 = happySpecReduce_3 204 happyReduction_549 happyReduction_549 (HappyAbsSyn157 happy_var_3) _ (HappyAbsSyn195 happy_var_1) = HappyAbsSyn203 (sL (comb2 happy_var_1 happy_var_3) $ mkBindStmt happy_var_1 happy_var_3 ) happyReduction_549 _ _ _ = notHappyAtAll happyReduce_550 = happySpecReduce_1 204 happyReduction_550 happyReduction_550 (HappyAbsSyn157 happy_var_1) = HappyAbsSyn203 (sL (getLoc happy_var_1) $ mkBodyStmt happy_var_1 ) happyReduction_550 _ = notHappyAtAll happyReduce_551 = happySpecReduce_2 204 happyReduction_551 happyReduction_551 (HappyAbsSyn85 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn203 (sL (comb2 happy_var_1 happy_var_2) $ LetStmt (unLoc happy_var_2) ) happyReduction_551 _ _ = notHappyAtAll happyReduce_552 = happySpecReduce_1 205 happyReduction_552 happyReduction_552 (HappyAbsSyn205 happy_var_1) = HappyAbsSyn205 (happy_var_1 ) happyReduction_552 _ = notHappyAtAll happyReduce_553 = happySpecReduce_0 205 happyReduction_553 happyReduction_553 = HappyAbsSyn205 (([], False) ) happyReduce_554 = happySpecReduce_3 206 happyReduction_554 happyReduction_554 (HappyAbsSyn205 happy_var_3) _ (HappyAbsSyn207 happy_var_1) = HappyAbsSyn205 (case happy_var_3 of (flds, dd) -> (happy_var_1 : flds, dd) ) happyReduction_554 _ _ _ = notHappyAtAll happyReduce_555 = happySpecReduce_1 206 happyReduction_555 happyReduction_555 (HappyAbsSyn207 happy_var_1) = HappyAbsSyn205 (([happy_var_1], False) ) happyReduction_555 _ = notHappyAtAll happyReduce_556 = happySpecReduce_1 206 happyReduction_556 happyReduction_556 _ = HappyAbsSyn205 (([], True) ) happyReduce_557 = happySpecReduce_3 207 happyReduction_557 happyReduction_557 (HappyAbsSyn157 happy_var_3) _ (HappyAbsSyn17 happy_var_1) = HappyAbsSyn207 (HsRecField happy_var_1 happy_var_3 False ) happyReduction_557 _ _ _ = notHappyAtAll happyReduce_558 = happySpecReduce_1 207 happyReduction_558 happyReduction_558 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn207 (HsRecField happy_var_1 placeHolderPunRhs True ) happyReduction_558 _ = notHappyAtAll happyReduce_559 = happySpecReduce_3 208 happyReduction_559 happyReduction_559 (HappyAbsSyn209 happy_var_3) _ (HappyAbsSyn208 happy_var_1) = HappyAbsSyn208 (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_559 _ _ _ = notHappyAtAll happyReduce_560 = happySpecReduce_2 208 happyReduction_560 happyReduction_560 (HappyTerminal happy_var_2) (HappyAbsSyn208 happy_var_1) = HappyAbsSyn208 (sL (comb2 happy_var_1 happy_var_2) (unLoc happy_var_1) ) happyReduction_560 _ _ = notHappyAtAll happyReduce_561 = happySpecReduce_1 208 happyReduction_561 happyReduction_561 (HappyAbsSyn209 happy_var_1) = HappyAbsSyn208 (let this = happy_var_1 in this `seq` sL (getLoc happy_var_1) [this] ) happyReduction_561 _ = notHappyAtAll happyReduce_562 = happySpecReduce_3 209 happyReduction_562 happyReduction_562 (HappyAbsSyn157 happy_var_3) _ (HappyAbsSyn210 happy_var_1) = HappyAbsSyn209 (sL (comb2 happy_var_1 happy_var_3) (IPBind (Left (unLoc happy_var_1)) happy_var_3) ) happyReduction_562 _ _ _ = notHappyAtAll happyReduce_563 = happySpecReduce_1 210 happyReduction_563 happyReduction_563 (HappyTerminal happy_var_1) = HappyAbsSyn210 (sL (getLoc happy_var_1) (HsIPName (getIPDUPVARID happy_var_1)) ) happyReduction_563 _ = notHappyAtAll happyReduce_564 = happySpecReduce_1 211 happyReduction_564 happyReduction_564 (HappyAbsSyn211 happy_var_1) = HappyAbsSyn211 (happy_var_1 ) happyReduction_564 _ = notHappyAtAll happyReduce_565 = happySpecReduce_0 211 happyReduction_565 happyReduction_565 = HappyAbsSyn211 (mkTrue ) happyReduce_566 = happySpecReduce_1 212 happyReduction_566 happyReduction_566 (HappyAbsSyn211 happy_var_1) = HappyAbsSyn211 (happy_var_1 ) happyReduction_566 _ = notHappyAtAll happyReduce_567 = happySpecReduce_3 212 happyReduction_567 happyReduction_567 (HappyAbsSyn211 happy_var_3) _ (HappyAbsSyn211 happy_var_1) = HappyAbsSyn211 (mkOr [happy_var_1,happy_var_3] ) happyReduction_567 _ _ _ = notHappyAtAll happyReduce_568 = happySpecReduce_1 213 happyReduction_568 happyReduction_568 (HappyAbsSyn211 happy_var_1) = HappyAbsSyn211 (happy_var_1 ) happyReduction_568 _ = notHappyAtAll happyReduce_569 = happySpecReduce_3 213 happyReduction_569 happyReduction_569 (HappyAbsSyn211 happy_var_3) _ (HappyAbsSyn211 happy_var_1) = HappyAbsSyn211 (mkAnd [happy_var_1,happy_var_3] ) happyReduction_569 _ _ _ = notHappyAtAll happyReduce_570 = happySpecReduce_3 214 happyReduction_570 happyReduction_570 _ (HappyAbsSyn211 happy_var_2) _ = HappyAbsSyn211 (happy_var_2 ) happyReduction_570 _ _ _ = notHappyAtAll happyReduce_571 = happySpecReduce_1 214 happyReduction_571 happyReduction_571 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn211 (mkVar happy_var_1 ) happyReduction_571 _ = notHappyAtAll happyReduce_572 = happySpecReduce_1 215 happyReduction_572 happyReduction_572 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn128 (sL (getLoc happy_var_1) [unLoc happy_var_1] ) happyReduction_572 _ = notHappyAtAll happyReduce_573 = happySpecReduce_3 215 happyReduction_573 happyReduction_573 (HappyAbsSyn128 happy_var_3) _ (HappyAbsSyn17 happy_var_1) = HappyAbsSyn128 (sL (comb2 happy_var_1 happy_var_3) (unLoc happy_var_1 : unLoc happy_var_3) ) happyReduction_573 _ _ _ = notHappyAtAll happyReduce_574 = happySpecReduce_1 216 happyReduction_574 happyReduction_574 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_574 _ = notHappyAtAll happyReduce_575 = happySpecReduce_1 216 happyReduction_575 happyReduction_575 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_575 _ = notHappyAtAll happyReduce_576 = happySpecReduce_1 217 happyReduction_576 happyReduction_576 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_576 _ = notHappyAtAll happyReduce_577 = happySpecReduce_3 217 happyReduction_577 happyReduction_577 (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_577 _ _ _ = notHappyAtAll happyReduce_578 = happySpecReduce_1 217 happyReduction_578 happyReduction_578 (HappyAbsSyn220 happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ nameRdrName (dataConName (unLoc happy_var_1)) ) happyReduction_578 _ = notHappyAtAll happyReduce_579 = happySpecReduce_1 218 happyReduction_579 happyReduction_579 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_579 _ = notHappyAtAll happyReduce_580 = happySpecReduce_3 218 happyReduction_580 happyReduction_580 (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_580 _ _ _ = notHappyAtAll happyReduce_581 = happySpecReduce_1 218 happyReduction_581 happyReduction_581 (HappyAbsSyn220 happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ nameRdrName (dataConName (unLoc happy_var_1)) ) happyReduction_581 _ = notHappyAtAll happyReduce_582 = happySpecReduce_1 219 happyReduction_582 happyReduction_582 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn50 (sL (getLoc happy_var_1) [happy_var_1] ) happyReduction_582 _ = notHappyAtAll happyReduce_583 = happySpecReduce_3 219 happyReduction_583 happyReduction_583 (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_583 _ _ _ = notHappyAtAll happyReduce_584 = happySpecReduce_2 220 happyReduction_584 happyReduction_584 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn220 (sL (comb2 happy_var_1 happy_var_2) unitDataCon ) happyReduction_584 _ _ = notHappyAtAll happyReduce_585 = happySpecReduce_3 220 happyReduction_585 happyReduction_585 (HappyTerminal happy_var_3) (HappyAbsSyn48 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn220 (sL (comb2 happy_var_1 happy_var_3) $ tupleCon BoxedTuple (happy_var_2 + 1) ) happyReduction_585 _ _ _ = notHappyAtAll happyReduce_586 = happySpecReduce_2 220 happyReduction_586 happyReduction_586 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn220 (sL (comb2 happy_var_1 happy_var_2) $ unboxedUnitDataCon ) happyReduction_586 _ _ = notHappyAtAll happyReduce_587 = happySpecReduce_3 220 happyReduction_587 happyReduction_587 (HappyTerminal happy_var_3) (HappyAbsSyn48 happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn220 (sL (comb2 happy_var_1 happy_var_3) $ tupleCon UnboxedTuple (happy_var_2 + 1) ) happyReduction_587 _ _ _ = notHappyAtAll happyReduce_588 = happySpecReduce_2 220 happyReduction_588 happyReduction_588 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn220 (sL (comb2 happy_var_1 happy_var_2) nilDataCon ) happyReduction_588 _ _ = notHappyAtAll happyReduce_589 = happySpecReduce_1 221 happyReduction_589 happyReduction_589 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_589 _ = notHappyAtAll happyReduce_590 = happySpecReduce_3 221 happyReduction_590 happyReduction_590 (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_590 _ _ _ = notHappyAtAll happyReduce_591 = happySpecReduce_1 222 happyReduction_591 happyReduction_591 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_591 _ = notHappyAtAll happyReduce_592 = happySpecReduce_3 222 happyReduction_592 happyReduction_592 (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_592 _ _ _ = notHappyAtAll happyReduce_593 = happySpecReduce_1 223 happyReduction_593 happyReduction_593 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_593 _ = notHappyAtAll happyReduce_594 = happySpecReduce_2 223 happyReduction_594 happyReduction_594 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_2) $ getRdrName unitTyCon ) happyReduction_594 _ _ = notHappyAtAll happyReduce_595 = happySpecReduce_2 223 happyReduction_595 happyReduction_595 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_2) $ getRdrName unboxedUnitTyCon ) happyReduction_595 _ _ = notHappyAtAll happyReduce_596 = happySpecReduce_1 224 happyReduction_596 happyReduction_596 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_596 _ = notHappyAtAll happyReduce_597 = happySpecReduce_3 224 happyReduction_597 happyReduction_597 (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_597 _ _ _ = notHappyAtAll happyReduce_598 = happySpecReduce_3 224 happyReduction_598 happyReduction_598 (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_598 _ _ _ = notHappyAtAll happyReduce_599 = happySpecReduce_3 224 happyReduction_599 happyReduction_599 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) $ getRdrName funTyCon ) happyReduction_599 _ _ _ = notHappyAtAll happyReduce_600 = happySpecReduce_2 224 happyReduction_600 happyReduction_600 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_2) $ listTyCon_RDR ) happyReduction_600 _ _ = notHappyAtAll happyReduce_601 = happySpecReduce_2 224 happyReduction_601 happyReduction_601 (HappyTerminal happy_var_2) (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_2) $ parrTyCon_RDR ) happyReduction_601 _ _ = notHappyAtAll happyReduce_602 = happySpecReduce_3 224 happyReduction_602 happyReduction_602 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) $ getRdrName eqPrimTyCon ) happyReduction_602 _ _ _ = notHappyAtAll happyReduce_603 = happySpecReduce_1 225 happyReduction_603 happyReduction_603 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_603 _ = notHappyAtAll happyReduce_604 = happySpecReduce_3 225 happyReduction_604 happyReduction_604 (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_604 _ _ _ = notHappyAtAll happyReduce_605 = happySpecReduce_3 225 happyReduction_605 happyReduction_605 (HappyTerminal happy_var_3) _ (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (comb2 happy_var_1 happy_var_3) $ eqTyCon_RDR ) happyReduction_605 _ _ _ = notHappyAtAll happyReduce_606 = happySpecReduce_1 226 happyReduction_606 happyReduction_606 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_606 _ = notHappyAtAll happyReduce_607 = happySpecReduce_3 226 happyReduction_607 happyReduction_607 (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_607 _ _ _ = notHappyAtAll happyReduce_608 = happySpecReduce_1 227 happyReduction_608 happyReduction_608 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkQual tcClsName (getQCONID happy_var_1) ) happyReduction_608 _ = notHappyAtAll happyReduce_609 = happySpecReduce_1 227 happyReduction_609 happyReduction_609 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkQual tcClsName (getPREFIXQCONSYM happy_var_1) ) happyReduction_609 _ = notHappyAtAll happyReduce_610 = happySpecReduce_1 227 happyReduction_610 happyReduction_610 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_610 _ = notHappyAtAll happyReduce_611 = happySpecReduce_1 228 happyReduction_611 happyReduction_611 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tcClsName (getCONID happy_var_1) ) happyReduction_611 _ = notHappyAtAll happyReduce_612 = happySpecReduce_1 229 happyReduction_612 happyReduction_612 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkQual tcClsName (getQCONSYM happy_var_1) ) happyReduction_612 _ = notHappyAtAll happyReduce_613 = happySpecReduce_1 229 happyReduction_613 happyReduction_613 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkQual tcClsName (getQVARSYM happy_var_1) ) happyReduction_613 _ = notHappyAtAll happyReduce_614 = happySpecReduce_1 229 happyReduction_614 happyReduction_614 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_614 _ = notHappyAtAll happyReduce_615 = happySpecReduce_1 230 happyReduction_615 happyReduction_615 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tcClsName (getCONSYM happy_var_1) ) happyReduction_615 _ = notHappyAtAll happyReduce_616 = happySpecReduce_1 230 happyReduction_616 happyReduction_616 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tcClsName (getVARSYM happy_var_1) ) happyReduction_616 _ = notHappyAtAll happyReduce_617 = happySpecReduce_1 230 happyReduction_617 happyReduction_617 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tcClsName (fsLit "*") ) happyReduction_617 _ = notHappyAtAll happyReduce_618 = happySpecReduce_1 230 happyReduction_618 happyReduction_618 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tcClsName (fsLit "-") ) happyReduction_618 _ = notHappyAtAll happyReduce_619 = happySpecReduce_1 231 happyReduction_619 happyReduction_619 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_619 _ = notHappyAtAll happyReduce_620 = happySpecReduce_1 231 happyReduction_620 happyReduction_620 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_620 _ = notHappyAtAll happyReduce_621 = happySpecReduce_1 232 happyReduction_621 happyReduction_621 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_621 _ = notHappyAtAll happyReduce_622 = happySpecReduce_3 232 happyReduction_622 happyReduction_622 (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_622 _ _ _ = notHappyAtAll happyReduce_623 = happySpecReduce_1 233 happyReduction_623 happyReduction_623 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) $ HsVar (unLoc happy_var_1) ) happyReduction_623 _ = notHappyAtAll happyReduce_624 = happySpecReduce_1 233 happyReduction_624 happyReduction_624 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) $ HsVar (unLoc happy_var_1) ) happyReduction_624 _ = notHappyAtAll happyReduce_625 = happySpecReduce_1 234 happyReduction_625 happyReduction_625 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) $ HsVar (unLoc happy_var_1) ) happyReduction_625 _ = notHappyAtAll happyReduce_626 = happySpecReduce_1 234 happyReduction_626 happyReduction_626 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn157 (sL (getLoc happy_var_1) $ HsVar (unLoc happy_var_1) ) happyReduction_626 _ = notHappyAtAll happyReduce_627 = happySpecReduce_1 235 happyReduction_627 happyReduction_627 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_627 _ = notHappyAtAll happyReduce_628 = happySpecReduce_3 235 happyReduction_628 happyReduction_628 (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_628 _ _ _ = notHappyAtAll happyReduce_629 = happySpecReduce_1 236 happyReduction_629 happyReduction_629 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_629 _ = notHappyAtAll happyReduce_630 = happySpecReduce_3 236 happyReduction_630 happyReduction_630 (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_630 _ _ _ = notHappyAtAll happyReduce_631 = happySpecReduce_1 237 happyReduction_631 happyReduction_631 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_631 _ = notHappyAtAll happyReduce_632 = happySpecReduce_3 238 happyReduction_632 happyReduction_632 (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_632 _ _ _ = notHappyAtAll happyReduce_633 = happyMonadReduce 1 238 happyReduction_633 happyReduction_633 ((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 to use RankNTypes or a similar language"), ptext (sLit "extension to enable explicit-forall syntax: forall <tvs>. <type>")])) ) (\r -> happyReturn (HappyAbsSyn17 r)) happyReduce_634 = happySpecReduce_1 239 happyReduction_634 happyReduction_634 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tvName (getVARID happy_var_1) ) happyReduction_634 _ = notHappyAtAll happyReduce_635 = happySpecReduce_1 239 happyReduction_635 happyReduction_635 (HappyAbsSyn161 happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tvName (unLoc happy_var_1) ) happyReduction_635 _ = notHappyAtAll happyReduce_636 = happySpecReduce_1 239 happyReduction_636 happyReduction_636 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tvName (fsLit "unsafe") ) happyReduction_636 _ = notHappyAtAll happyReduce_637 = happySpecReduce_1 239 happyReduction_637 happyReduction_637 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tvName (fsLit "safe") ) happyReduction_637 _ = notHappyAtAll happyReduce_638 = happySpecReduce_1 239 happyReduction_638 happyReduction_638 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual tvName (fsLit "interruptible") ) happyReduction_638 _ = notHappyAtAll happyReduce_639 = happySpecReduce_1 240 happyReduction_639 happyReduction_639 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_639 _ = notHappyAtAll happyReduce_640 = happySpecReduce_3 240 happyReduction_640 happyReduction_640 (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_640 _ _ _ = notHappyAtAll happyReduce_641 = happySpecReduce_1 241 happyReduction_641 happyReduction_641 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_641 _ = notHappyAtAll happyReduce_642 = happySpecReduce_3 241 happyReduction_642 happyReduction_642 (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_642 _ _ _ = notHappyAtAll happyReduce_643 = happySpecReduce_3 241 happyReduction_643 happyReduction_643 (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_643 _ _ _ = notHappyAtAll happyReduce_644 = happySpecReduce_1 242 happyReduction_644 happyReduction_644 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_644 _ = notHappyAtAll happyReduce_645 = happySpecReduce_1 242 happyReduction_645 happyReduction_645 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkQual varName (getQVARID happy_var_1) ) happyReduction_645 _ = notHappyAtAll happyReduce_646 = happySpecReduce_1 242 happyReduction_646 happyReduction_646 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkQual varName (getPREFIXQVARSYM happy_var_1) ) happyReduction_646 _ = notHappyAtAll happyReduce_647 = happySpecReduce_1 243 happyReduction_647 happyReduction_647 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual varName (getVARID happy_var_1) ) happyReduction_647 _ = notHappyAtAll happyReduce_648 = happySpecReduce_1 243 happyReduction_648 happyReduction_648 (HappyAbsSyn161 happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual varName (unLoc happy_var_1) ) happyReduction_648 _ = notHappyAtAll happyReduce_649 = happySpecReduce_1 243 happyReduction_649 happyReduction_649 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual varName (fsLit "unsafe") ) happyReduction_649 _ = notHappyAtAll happyReduce_650 = happySpecReduce_1 243 happyReduction_650 happyReduction_650 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual varName (fsLit "safe") ) happyReduction_650 _ = notHappyAtAll happyReduce_651 = happySpecReduce_1 243 happyReduction_651 happyReduction_651 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual varName (fsLit "interruptible") ) happyReduction_651 _ = notHappyAtAll happyReduce_652 = happySpecReduce_1 243 happyReduction_652 happyReduction_652 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual varName (fsLit "forall") ) happyReduction_652 _ = notHappyAtAll happyReduce_653 = happySpecReduce_1 243 happyReduction_653 happyReduction_653 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual varName (fsLit "family") ) happyReduction_653 _ = notHappyAtAll happyReduce_654 = happySpecReduce_1 243 happyReduction_654 happyReduction_654 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkUnqual varName (fsLit "role") ) happyReduction_654 _ = notHappyAtAll happyReduce_655 = happySpecReduce_1 244 happyReduction_655 happyReduction_655 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_655 _ = notHappyAtAll happyReduce_656 = happySpecReduce_1 244 happyReduction_656 happyReduction_656 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_656 _ = notHappyAtAll happyReduce_657 = happySpecReduce_1 245 happyReduction_657 happyReduction_657 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_657 _ = notHappyAtAll happyReduce_658 = happySpecReduce_1 245 happyReduction_658 happyReduction_658 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_658 _ = notHappyAtAll happyReduce_659 = happySpecReduce_1 246 happyReduction_659 happyReduction_659 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ mkQual varName (getQVARSYM happy_var_1) ) happyReduction_659 _ = notHappyAtAll happyReduce_660 = happySpecReduce_1 247 happyReduction_660 happyReduction_660 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_660 _ = notHappyAtAll happyReduce_661 = happySpecReduce_1 247 happyReduction_661 happyReduction_661 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ mkUnqual varName (fsLit "-") ) happyReduction_661 _ = notHappyAtAll happyReduce_662 = happySpecReduce_1 248 happyReduction_662 happyReduction_662 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ mkUnqual varName (getVARSYM happy_var_1) ) happyReduction_662 _ = notHappyAtAll happyReduce_663 = happySpecReduce_1 248 happyReduction_663 happyReduction_663 (HappyAbsSyn161 happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ mkUnqual varName (unLoc happy_var_1) ) happyReduction_663 _ = notHappyAtAll happyReduce_664 = happySpecReduce_1 249 happyReduction_664 happyReduction_664 (HappyTerminal happy_var_1) = HappyAbsSyn161 (sL (getLoc happy_var_1) (fsLit "as") ) happyReduction_664 _ = notHappyAtAll happyReduce_665 = happySpecReduce_1 249 happyReduction_665 happyReduction_665 (HappyTerminal happy_var_1) = HappyAbsSyn161 (sL (getLoc happy_var_1) (fsLit "qualified") ) happyReduction_665 _ = notHappyAtAll happyReduce_666 = happySpecReduce_1 249 happyReduction_666 happyReduction_666 (HappyTerminal happy_var_1) = HappyAbsSyn161 (sL (getLoc happy_var_1) (fsLit "hiding") ) happyReduction_666 _ = notHappyAtAll happyReduce_667 = happySpecReduce_1 249 happyReduction_667 happyReduction_667 (HappyTerminal happy_var_1) = HappyAbsSyn161 (sL (getLoc happy_var_1) (fsLit "export") ) happyReduction_667 _ = notHappyAtAll happyReduce_668 = happySpecReduce_1 249 happyReduction_668 happyReduction_668 (HappyTerminal happy_var_1) = HappyAbsSyn161 (sL (getLoc happy_var_1) (fsLit "label") ) happyReduction_668 _ = notHappyAtAll happyReduce_669 = happySpecReduce_1 249 happyReduction_669 happyReduction_669 (HappyTerminal happy_var_1) = HappyAbsSyn161 (sL (getLoc happy_var_1) (fsLit "dynamic") ) happyReduction_669 _ = notHappyAtAll happyReduce_670 = happySpecReduce_1 249 happyReduction_670 happyReduction_670 (HappyTerminal happy_var_1) = HappyAbsSyn161 (sL (getLoc happy_var_1) (fsLit "stdcall") ) happyReduction_670 _ = notHappyAtAll happyReduce_671 = happySpecReduce_1 249 happyReduction_671 happyReduction_671 (HappyTerminal happy_var_1) = HappyAbsSyn161 (sL (getLoc happy_var_1) (fsLit "ccall") ) happyReduction_671 _ = notHappyAtAll happyReduce_672 = happySpecReduce_1 249 happyReduction_672 happyReduction_672 (HappyTerminal happy_var_1) = HappyAbsSyn161 (sL (getLoc happy_var_1) (fsLit "capi") ) happyReduction_672 _ = notHappyAtAll happyReduce_673 = happySpecReduce_1 249 happyReduction_673 happyReduction_673 (HappyTerminal happy_var_1) = HappyAbsSyn161 (sL (getLoc happy_var_1) (fsLit "prim") ) happyReduction_673 _ = notHappyAtAll happyReduce_674 = happySpecReduce_1 249 happyReduction_674 happyReduction_674 (HappyTerminal happy_var_1) = HappyAbsSyn161 (sL (getLoc happy_var_1) (fsLit "javascript") ) happyReduction_674 _ = notHappyAtAll happyReduce_675 = happySpecReduce_1 249 happyReduction_675 happyReduction_675 (HappyTerminal happy_var_1) = HappyAbsSyn161 (sL (getLoc happy_var_1) (fsLit "group") ) happyReduction_675 _ = notHappyAtAll happyReduce_676 = happySpecReduce_1 250 happyReduction_676 happyReduction_676 (HappyTerminal happy_var_1) = HappyAbsSyn161 (sL (getLoc happy_var_1) (fsLit "!") ) happyReduction_676 _ = notHappyAtAll happyReduce_677 = happySpecReduce_1 250 happyReduction_677 happyReduction_677 (HappyTerminal happy_var_1) = HappyAbsSyn161 (sL (getLoc happy_var_1) (fsLit ".") ) happyReduction_677 _ = notHappyAtAll happyReduce_678 = happySpecReduce_1 250 happyReduction_678 happyReduction_678 (HappyTerminal happy_var_1) = HappyAbsSyn161 (sL (getLoc happy_var_1) (fsLit "*") ) happyReduction_678 _ = notHappyAtAll happyReduce_679 = happySpecReduce_1 251 happyReduction_679 happyReduction_679 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_679 _ = notHappyAtAll happyReduce_680 = happySpecReduce_1 251 happyReduction_680 happyReduction_680 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkQual dataName (getQCONID happy_var_1) ) happyReduction_680 _ = notHappyAtAll happyReduce_681 = happySpecReduce_1 251 happyReduction_681 happyReduction_681 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $! mkQual dataName (getPREFIXQCONSYM happy_var_1) ) happyReduction_681 _ = notHappyAtAll happyReduce_682 = happySpecReduce_1 252 happyReduction_682 happyReduction_682 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ mkUnqual dataName (getCONID happy_var_1) ) happyReduction_682 _ = notHappyAtAll happyReduce_683 = happySpecReduce_1 253 happyReduction_683 happyReduction_683 (HappyAbsSyn17 happy_var_1) = HappyAbsSyn17 (happy_var_1 ) happyReduction_683 _ = notHappyAtAll happyReduce_684 = happySpecReduce_1 253 happyReduction_684 happyReduction_684 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ mkQual dataName (getQCONSYM happy_var_1) ) happyReduction_684 _ = notHappyAtAll happyReduce_685 = happySpecReduce_1 254 happyReduction_685 happyReduction_685 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ mkUnqual dataName (getCONSYM happy_var_1) ) happyReduction_685 _ = notHappyAtAll happyReduce_686 = happySpecReduce_1 254 happyReduction_686 happyReduction_686 (HappyTerminal happy_var_1) = HappyAbsSyn17 (sL (getLoc happy_var_1) $ consDataCon_RDR ) happyReduction_686 _ = notHappyAtAll happyReduce_687 = happySpecReduce_1 255 happyReduction_687 happyReduction_687 (HappyTerminal happy_var_1) = HappyAbsSyn255 (sL (getLoc happy_var_1) $ HsChar $ getCHAR happy_var_1 ) happyReduction_687 _ = notHappyAtAll happyReduce_688 = happySpecReduce_1 255 happyReduction_688 happyReduction_688 (HappyTerminal happy_var_1) = HappyAbsSyn255 (sL (getLoc happy_var_1) $ HsString $ getSTRING happy_var_1 ) happyReduction_688 _ = notHappyAtAll happyReduce_689 = happySpecReduce_1 255 happyReduction_689 happyReduction_689 (HappyTerminal happy_var_1) = HappyAbsSyn255 (sL (getLoc happy_var_1) $ HsIntPrim $ getPRIMINTEGER happy_var_1 ) happyReduction_689 _ = notHappyAtAll happyReduce_690 = happySpecReduce_1 255 happyReduction_690 happyReduction_690 (HappyTerminal happy_var_1) = HappyAbsSyn255 (sL (getLoc happy_var_1) $ HsWordPrim $ getPRIMWORD happy_var_1 ) happyReduction_690 _ = notHappyAtAll happyReduce_691 = happySpecReduce_1 255 happyReduction_691 happyReduction_691 (HappyTerminal happy_var_1) = HappyAbsSyn255 (sL (getLoc happy_var_1) $ HsCharPrim $ getPRIMCHAR happy_var_1 ) happyReduction_691 _ = notHappyAtAll happyReduce_692 = happySpecReduce_1 255 happyReduction_692 happyReduction_692 (HappyTerminal happy_var_1) = HappyAbsSyn255 (sL (getLoc happy_var_1) $ HsStringPrim $ getPRIMSTRING happy_var_1 ) happyReduction_692 _ = notHappyAtAll happyReduce_693 = happySpecReduce_1 255 happyReduction_693 happyReduction_693 (HappyTerminal happy_var_1) = HappyAbsSyn255 (sL (getLoc happy_var_1) $ HsFloatPrim $ getPRIMFLOAT happy_var_1 ) happyReduction_693 _ = notHappyAtAll happyReduce_694 = happySpecReduce_1 255 happyReduction_694 happyReduction_694 (HappyTerminal happy_var_1) = HappyAbsSyn255 (sL (getLoc happy_var_1) $ HsDoublePrim $ getPRIMDOUBLE happy_var_1 ) happyReduction_694 _ = notHappyAtAll happyReduce_695 = happySpecReduce_1 256 happyReduction_695 happyReduction_695 _ = HappyAbsSyn20 (() ) happyReduce_696 = happyMonadReduce 1 256 happyReduction_696 happyReduction_696 (_ `HappyStk` happyRest) tk = happyThen (( popContext) ) (\r -> happyReturn (HappyAbsSyn20 r)) happyReduce_697 = happySpecReduce_1 257 happyReduction_697 happyReduction_697 (HappyTerminal happy_var_1) = HappyAbsSyn257 (sL (getLoc happy_var_1) $ mkModuleNameFS (getCONID happy_var_1) ) happyReduction_697 _ = notHappyAtAll happyReduce_698 = happySpecReduce_1 257 happyReduction_698 happyReduction_698 (HappyTerminal happy_var_1) = HappyAbsSyn257 (sL (getLoc happy_var_1) $ let (mod,c) = getQCONID happy_var_1 in mkModuleNameFS (mkFastString (unpackFS mod ++ '.':unpackFS c)) ) happyReduction_698 _ = notHappyAtAll happyReduce_699 = happySpecReduce_2 258 happyReduction_699 happyReduction_699 _ (HappyAbsSyn48 happy_var_1) = HappyAbsSyn48 (happy_var_1 + 1 ) happyReduction_699 _ _ = notHappyAtAll happyReduce_700 = happySpecReduce_1 258 happyReduction_700 happyReduction_700 _ = HappyAbsSyn48 (1 ) happyReduce_701 = happyMonadReduce 1 259 happyReduction_701 happyReduction_701 ((HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( return (sL (getLoc happy_var_1) (HsDocString (mkFastString (getDOCNEXT happy_var_1))))) ) (\r -> happyReturn (HappyAbsSyn259 r)) happyReduce_702 = happyMonadReduce 1 260 happyReduction_702 happyReduction_702 ((HappyTerminal happy_var_1) `HappyStk` happyRest) tk = happyThen (( return (sL (getLoc happy_var_1) (HsDocString (mkFastString (getDOCPREV happy_var_1))))) ) (\r -> happyReturn (HappyAbsSyn259 r)) happyReduce_703 = happyMonadReduce 1 261 happyReduction_703 happyReduction_703 ((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 (HappyAbsSyn261 r)) happyReduce_704 = happyMonadReduce 1 262 happyReduction_704 happyReduction_704 ((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 (HappyAbsSyn262 r)) happyReduce_705 = happyMonadReduce 1 263 happyReduction_705 happyReduction_705 ((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_706 = happySpecReduce_1 264 happyReduction_706 happyReduction_706 (HappyAbsSyn259 happy_var_1) = HappyAbsSyn19 (Just happy_var_1 ) happyReduction_706 _ = notHappyAtAll happyReduce_707 = happySpecReduce_0 264 happyReduction_707 happyReduction_707 = HappyAbsSyn19 (Nothing ) happyReduce_708 = happySpecReduce_1 265 happyReduction_708 happyReduction_708 (HappyAbsSyn259 happy_var_1) = HappyAbsSyn19 (Just happy_var_1 ) happyReduction_708 _ = notHappyAtAll happyReduce_709 = happySpecReduce_0 265 happyReduction_709 happyReduction_709 = 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 410 410 tk (HappyState action) sts stk; L _ ITunderscore -> cont 266; L _ ITas -> cont 267; L _ ITcase -> cont 268; L _ ITclass -> cont 269; L _ ITdata -> cont 270; L _ ITdefault -> cont 271; L _ ITderiving -> cont 272; L _ ITdo -> cont 273; L _ ITelse -> cont 274; L _ IThiding -> cont 275; L _ ITif -> cont 276; L _ ITimport -> cont 277; L _ ITin -> cont 278; L _ ITinfix -> cont 279; L _ ITinfixl -> cont 280; L _ ITinfixr -> cont 281; L _ ITinstance -> cont 282; L _ ITlet -> cont 283; L _ ITmodule -> cont 284; L _ ITnewtype -> cont 285; L _ ITof -> cont 286; L _ ITqualified -> cont 287; L _ ITthen -> cont 288; L _ ITtype -> cont 289; L _ ITwhere -> cont 290; L _ ITforall -> cont 291; L _ ITforeign -> cont 292; L _ ITexport -> cont 293; L _ ITlabel -> cont 294; L _ ITdynamic -> cont 295; L _ ITsafe -> cont 296; L _ ITinterruptible -> cont 297; L _ ITunsafe -> cont 298; L _ ITmdo -> cont 299; L _ ITfamily -> cont 300; L _ ITrole -> cont 301; L _ ITstdcallconv -> cont 302; L _ ITccallconv -> cont 303; L _ ITcapiconv -> cont 304; L _ ITprimcallconv -> cont 305; L _ ITjavascriptcallconv -> cont 306; L _ ITproc -> cont 307; L _ ITrec -> cont 308; L _ ITgroup -> cont 309; L _ ITby -> cont 310; L _ ITusing -> cont 311; L _ ITpattern -> cont 312; L _ (ITinline_prag _ _) -> cont 313; L _ ITspec_prag -> cont 314; L _ (ITspec_inline_prag _) -> cont 315; L _ ITsource_prag -> cont 316; L _ ITrules_prag -> cont 317; L _ ITcore_prag -> cont 318; L _ ITscc_prag -> cont 319; L _ ITgenerated_prag -> cont 320; L _ ITdeprecated_prag -> cont 321; L _ ITwarning_prag -> cont 322; L _ ITunpack_prag -> cont 323; L _ ITnounpack_prag -> cont 324; L _ ITann_prag -> cont 325; L _ ITvect_prag -> cont 326; L _ ITvect_scalar_prag -> cont 327; L _ ITnovect_prag -> cont 328; L _ ITminimal_prag -> cont 329; L _ ITctype -> cont 330; L _ ITclose_prag -> cont 331; L _ ITdotdot -> cont 332; L _ ITcolon -> cont 333; L _ ITdcolon -> cont 334; L _ ITequal -> cont 335; L _ ITlam -> cont 336; L _ ITlcase -> cont 337; L _ ITvbar -> cont 338; L _ ITlarrow -> cont 339; L _ ITrarrow -> cont 340; L _ ITat -> cont 341; L _ ITtilde -> cont 342; L _ ITtildehsh -> cont 343; L _ ITdarrow -> cont 344; L _ ITminus -> cont 345; L _ ITbang -> cont 346; L _ ITstar -> cont 347; L _ ITlarrowtail -> cont 348; L _ ITrarrowtail -> cont 349; L _ ITLarrowtail -> cont 350; L _ ITRarrowtail -> cont 351; L _ ITdot -> cont 352; L _ ITocurly -> cont 353; L _ ITccurly -> cont 354; L _ ITvocurly -> cont 355; L _ ITvccurly -> cont 356; L _ ITobrack -> cont 357; L _ ITcbrack -> cont 358; L _ ITopabrack -> cont 359; L _ ITcpabrack -> cont 360; L _ IToparen -> cont 361; L _ ITcparen -> cont 362; L _ IToubxparen -> cont 363; L _ ITcubxparen -> cont 364; L _ IToparenbar -> cont 365; L _ ITcparenbar -> cont 366; L _ ITsemi -> cont 367; L _ ITcomma -> cont 368; L _ ITbackquote -> cont 369; L _ ITsimpleQuote -> cont 370; L _ (ITvarid _) -> cont 371; L _ (ITconid _) -> cont 372; L _ (ITvarsym _) -> cont 373; L _ (ITconsym _) -> cont 374; L _ (ITqvarid _) -> cont 375; L _ (ITqconid _) -> cont 376; L _ (ITqvarsym _) -> cont 377; L _ (ITqconsym _) -> cont 378; L _ (ITprefixqvarsym _) -> cont 379; L _ (ITprefixqconsym _) -> cont 380; L _ (ITdupipvarid _) -> cont 381; L _ (ITchar _) -> cont 382; L _ (ITstring _) -> cont 383; L _ (ITinteger _) -> cont 384; L _ (ITrational _) -> cont 385; L _ (ITprimchar _) -> cont 386; L _ (ITprimstring _) -> cont 387; L _ (ITprimint _) -> cont 388; L _ (ITprimword _) -> cont 389; L _ (ITprimfloat _) -> cont 390; L _ (ITprimdouble _) -> cont 391; L _ (ITdocCommentNext _) -> cont 392; L _ (ITdocCommentPrev _) -> cont 393; L _ (ITdocCommentNamed _) -> cont 394; L _ (ITdocSection _ _) -> cont 395; L _ ITopenExpQuote -> cont 396; L _ ITopenPatQuote -> cont 397; L _ ITopenTypQuote -> cont 398; L _ ITopenDecQuote -> cont 399; L _ ITcloseQuote -> cont 400; L _ ITopenTExpQuote -> cont 401; L _ ITcloseTExpQuote -> cont 402; L _ (ITidEscape _) -> cont 403; L _ ITparenEscape -> cont 404; L _ (ITidTyEscape _) -> cont 405; L _ ITparenTyEscape -> cont 406; L _ ITtyQuote -> cont 407; L _ (ITquasiQuote _) -> cont 408; L _ (ITqQuasiQuote _) -> cont 409; _ -> happyError' tk }) happyError_ 410 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 {HappyAbsSyn203 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 {HappyAbsSyn157 z -> happyReturn z; _other -> notHappyAtAll }) fullStatement = happySomeParser where happySomeParser = happyThen (happyParse action_6) (\x -> case x of {HappyAbsSyn203 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 {HappyAbsSyn157 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 getTH_ID_TY_SPLICE (L _ (ITidTyEscape 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 MultiWayIf turned on" -- Hint about explicit-forall, assuming UnicodeSyntax is on hintExplicitForall :: SrcSpan -> P () hintExplicitForall span = do forall <- extension explicitForallEnabled rulePrag <- extension inRulePrag unless (forall || rulePrag) $ parseErrorSDoc span $ vcat [ text "Illegal symbol '\x2200' in type" -- U+2200 FOR ALL , text "Perhaps you intended to use RankNTypes or a similar language" , text "extension to enable explicit-forall syntax: \x2200 <tvs>. <type>" ] {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "<built-in>" #-} {-# 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" #-} 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 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. {-# 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.
FranklinChen/IHaskell
ghc-parser/src-7.8.3/Language/Haskell/GHC/HappyParser.hs
mit
1,032,876
28,710
152
139,809
316,998
171,471
145,527
26,888
146
module PrimeList where data PrimeList = P2 | P3 | P5 | P7 deriving (Show, Eq, Read, Ord, Enum, Bounded) toPrime :: PrimeList -> Integer toPrime strP = read $ tail $ show $ strP :: Integer
mino2357/Hello_Haskell
vector2018-02-28.hsproj/PrimeList.hs
mit
191
0
7
40
79
44
35
5
1
{- | Module : ./CSMOF/Print.hs Description : pretty printing for CSMOF Copyright : (c) Daniel Calegari Universidad de la Republica, Uruguay 2013 License : GPLv2 or higher, see LICENSE.txt Maintainer : dcalegar@fing.edu.uy Stability : provisional Portability : portable -} module CSMOF.Print where import CSMOF.As import Common.Doc import Common.DocUtils instance Pretty Metamodel where pretty (Metamodel nam ele mode) = text "metamodel" <+> text nam <+> lbrace $++$ space <+> space <+> foldr (($++$) . pretty) empty ele $+$ rbrace $++$ foldr (($+$) . pretty) empty mode instance Show Metamodel where show m = show $ pretty m instance Pretty NamedElement where pretty (NamedElement _ _ nes) = pretty nes instance Show NamedElement where show m = show $ pretty m instance Pretty TypeOrTypedElement where pretty (TType typ) = pretty typ pretty (TTypedElement _) = empty -- Do not show properties at top level but inside classes instance Show TypeOrTypedElement where show m = show $ pretty m instance Pretty Type where pretty (Type _ sub) = pretty sub instance Show Type where show m = show $ pretty m instance Pretty DataTypeOrClass where pretty (DDataType dat) = pretty dat pretty (DClass cla) = pretty cla instance Show DataTypeOrClass where show m = show $ pretty m instance Pretty Datatype where pretty (Datatype sup) = text "datatype" <+> text (namedElementName (typeSuper sup)) instance Show Datatype where show m = show $ pretty m instance Pretty Class where pretty (Class sup isa supC own) = text (if isa then "abstract class" else "class") <+> text (namedElementName (typeSuper sup)) <+> (case supC of [] -> lbrace _ : _ -> text "extends" <+> foldr ( (<+>) . text . namedElementName . typeSuper . classSuperType) empty supC <+> lbrace) $+$ space <+> space <+> foldr (($+$) . pretty) empty own $+$ rbrace instance Show Class where show m = show $ pretty m instance Pretty TypedElement where pretty (TypedElement _ _ sub) = pretty sub instance Show TypedElement where show m = show $ pretty m instance Pretty Property where pretty (Property sup mul opp _) = text "property" <+> text (namedElementName (typedElementSuper sup)) <> pretty mul <+> colon <+> text (namedElementName (typeSuper (typedElementType sup))) <+> (case opp of Just n -> text "oppositeOf" <+> text (namedElementName (typedElementSuper (propertySuper n))) Nothing -> empty) instance Show Property where show m = show $ pretty m instance Pretty MultiplicityElement where pretty (MultiplicityElement low upp _) = lbrack <> pretty low <> comma <> (if upp == -1 then text "*" else pretty upp) <> rbrack instance Show MultiplicityElement where show m = show $ pretty m -- Model part of CSMOF instance Pretty Model where pretty (Model mon obj lin mode) = text "model" <+> text mon <+> text "conformsTo" <+> text (metamodelName mode) <+> lbrace $++$ space <+> space <+> foldr (($+$) . pretty) empty obj $++$ space <+> space <+> foldr (($+$) . pretty) empty lin $+$ rbrace instance Show Model where show m = show $ pretty m instance Pretty Object where pretty (Object on ot _) = text "object " <> text on <+> colon <+> text (namedElementName (typeSuper ot)) instance Show Object where show m = show $ pretty m instance Pretty Link where pretty (Link lt sou tar _) = text "link" <+> text (namedElementName (typedElementSuper (propertySuper lt))) <> lparen <> text (objectName sou) <> comma <> text (objectName tar) <> rparen $+$ empty instance Show Link where show m = show $ pretty m
spechub/Hets
CSMOF/Print.hs
gpl-2.0
3,779
0
22
904
1,273
627
646
92
0
module Language.Haskell.GhcMod.Cradle ( findCradle , findCradleWithoutSandbox ) where import Language.Haskell.GhcMod.Types import Language.Haskell.GhcMod.GhcPkg import Control.Applicative ((<$>)) import qualified Control.Exception as E import Control.Exception.IOChoice ((||>)) import Control.Monad (filterM) import Data.List (isSuffixOf) import System.Directory (getCurrentDirectory, getDirectoryContents, doesFileExist) import System.FilePath ((</>), takeDirectory) ---------------------------------------------------------------- -- | Finding 'Cradle'. -- Find a cabal file by tracing ancestor directories. -- Find a sandbox according to a cabal sandbox config -- in a cabal directory. findCradle :: IO Cradle findCradle = do wdir <- getCurrentDirectory cabalCradle wdir ||> sandboxCradle wdir ||> plainCradle wdir cabalCradle :: FilePath -> IO Cradle cabalCradle wdir = do (rdir,cfile) <- cabalDir wdir pkgDbStack <- getPackageDbStack rdir return Cradle { cradleCurrentDir = wdir , cradleRootDir = rdir , cradleCabalFile = Just cfile , cradlePkgDbStack = pkgDbStack } sandboxCradle :: FilePath -> IO Cradle sandboxCradle wdir = do rdir <- getSandboxDir wdir pkgDbStack <- getPackageDbStack rdir return Cradle { cradleCurrentDir = wdir , cradleRootDir = rdir , cradleCabalFile = Nothing , cradlePkgDbStack = pkgDbStack } plainCradle :: FilePath -> IO Cradle plainCradle wdir = return Cradle { cradleCurrentDir = wdir , cradleRootDir = wdir , cradleCabalFile = Nothing , cradlePkgDbStack = [GlobalDb] } -- Just for testing findCradleWithoutSandbox :: IO Cradle findCradleWithoutSandbox = do cradle <- findCradle return cradle { cradlePkgDbStack = [GlobalDb]} ---------------------------------------------------------------- cabalSuffix :: String cabalSuffix = ".cabal" cabalSuffixLength :: Int cabalSuffixLength = length cabalSuffix -- Finding a Cabal file up to the root directory -- Input: a directly to investigate -- Output: (the path to the directory containing a Cabal file -- ,the path to the Cabal file) cabalDir :: FilePath -> IO (FilePath,FilePath) cabalDir dir = do cnts <- getCabalFiles dir case cnts of [] | dir' == dir -> E.throwIO $ userError "cabal files not found" | otherwise -> cabalDir dir' cfile:_ -> return (dir,dir </> cfile) where dir' = takeDirectory dir getCabalFiles :: FilePath -> IO [FilePath] getCabalFiles dir = getFiles >>= filterM doesCabalFileExist where isCabal name = cabalSuffix `isSuffixOf` name && length name > cabalSuffixLength getFiles = filter isCabal <$> getDirectoryContents dir doesCabalFileExist file = doesFileExist $ dir </> file ---------------------------------------------------------------- getSandboxDir :: FilePath -> IO FilePath getSandboxDir dir = do exist <- doesFileExist sfile if exist then return dir else if dir == dir' then E.throwIO $ userError "sandbox not found" else getSandboxDir dir' where sfile = dir </> "cabal.sandbox.config" dir' = takeDirectory dir
carlohamalainen/ghc-mod
Language/Haskell/GhcMod/Cradle.hs
bsd-3-clause
3,246
0
13
708
721
389
332
72
3
{-# LANGUAGE OverloadedStrings, TypeFamilies, QuasiQuotes #-} module Papillon (parseAtts) where import Text.Papillon import Data.ByteString.Char8 (ByteString, pack) import qualified Data.ByteString as BS -- import qualified Data.ByteString.Char8 as BSC parseAtts :: BS.ByteString -> Maybe [(BS.ByteString, BS.ByteString)] parseAtts = either (const Nothing) (Just . fst) . runError . atts . parse isTextChar :: Char -> Bool isTextChar = (`elem` (['0' .. '9'] ++ ['a' .. 'z'] ++ ['A' .. 'Z'] ++ "-")) [papillon| source: ByteString atts :: [(ByteString, ByteString)] = a:att ',' as:atts { a : as } / a:att { [a] } att :: (ByteString, ByteString) = k:(<(`notElem` "=")>)+ '=' v:txt { (pack k, v) } txt :: ByteString = '"' t:(<(`notElem` "\"")>)* '"' { pack t } / t:(<isTextChar>)+ { pack t } |] {- instance Source ByteString where type Token ByteString = Char data Pos ByteString = NoPos getToken = BSC.uncons initialPos = NoPos updatePos _ _ = NoPos -}
YoshikuniJujo/forest
subprojects/xmpipe/Papillon.hs
bsd-3-clause
979
0
10
179
161
98
63
10
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} -- | Infrastructure for KURE-based rewrites on CL expressions module Database.DSH.CL.Kure ( -- * Re-export relevant KURE modules module Language.KURE , module Language.KURE.Lens -- * The KURE monad , RewriteM, RewriteStateM, TransformC, RewriteC, LensC , freshName, freshNameT, freshNameST -- * Setters and getters for the translation state , get, put, modify -- * Changing between stateful and non-stateful transforms , statefulT, liftstateT -- * The KURE context , CompCtx(..), CrumbC(..), PathC, initialCtx, freeIn, boundIn , inScopeNames, inScopeNamesT, bindQual, bindVar, withLocalPathT -- * Congruence combinators , tableT, appe1T, appe2T, binopT, ifT, litT, varT, compT, letT , tableR, appe1R, appe2R, binopR, ifR, litR, varR, compR, letR , unopR, unopT , bindQualT, guardQualT, bindQualR, guardQualR , qualsT, qualsR, qualsemptyT, qualsemptyR -- * The sum type , CL(..) ) where import Control.Monad import qualified Data.Foldable as F import qualified Data.Map as M import qualified Data.Set as S import Text.PrettyPrint.ANSI.Leijen (text) import Language.KURE import Language.KURE.Lens import Database.DSH.CL.Lang import Database.DSH.Common.Kure import qualified Database.DSH.Common.Lang as L import Database.DSH.Common.Pretty import Database.DSH.Common.RewriteM -------------------------------------------------------------------------------- -- Convenience type aliases type TransformC a b = Transform CompCtx (RewriteM Int RewriteLog) a b type RewriteC a = TransformC a a type LensC a b = Lens CompCtx (RewriteM Int RewriteLog) a b -------------------------------------------------------------------------------- data CrumbC = AppFun | AppArg | AppE1Arg | AppE2Arg1 | AppE2Arg2 | BinOpArg1 | BinOpArg2 | UnOpArg | LamBody | IfCond | IfThen | IfElse | CompHead | CompQuals | BindQualExpr | GuardQualExpr | QualsHead | QualsTail | QualsSingleton | NLConsTail -- One-based index into the list of element expressions | TupleElem Int | LetBind | LetBody deriving (Eq, Show) instance Pretty CrumbC where pretty c = text $ show c type AbsPathC = AbsolutePath CrumbC type PathC = Path CrumbC -- | The context for KURE-based CL rewrites data CompCtx = CompCtx { clBindings :: M.Map L.Ident Type , clPath :: AbsPathC } instance ExtendPath CompCtx CrumbC where c@@n = c { clPath = clPath c @@ n } instance ReadPath CompCtx CrumbC where absPath = clPath initialCtx :: CompCtx initialCtx = CompCtx { clBindings = M.empty, clPath = mempty } -- | Record a variable binding in the context bindVar :: L.Ident -> Type -> CompCtx -> CompCtx bindVar n ty ctx = ctx { clBindings = M.insert n ty (clBindings ctx) } -- | If the qualifier represents a generator, bind the variable in the context. bindQual :: CompCtx -> Qual -> CompCtx bindQual ctx (BindQ n e) = bindVar n (elemT $ typeOf e) ctx bindQual ctx _ = ctx inScopeNames :: CompCtx -> [L.Ident] inScopeNames = M.keys . clBindings inScopeNamesT :: Applicative m => Transform CompCtx m a (S.Set L.Ident) inScopeNamesT = contextonlyT (pure . M.keysSet . clBindings) boundIn :: L.Ident -> CompCtx -> Bool boundIn n ctx = n `M.member` clBindings ctx freeIn :: L.Ident -> CompCtx -> Bool freeIn n ctx = n `M.notMember` clBindings ctx freshNameST :: Monoid w => [L.Ident] -> Transform CompCtx (RewriteStateM s w) a L.Ident freshNameST avoidNames = do ctx <- contextT constT $ freshNameS (avoidNames ++ inScopeNames ctx) -- | Generate a fresh name that is not bound in the current context. freshNameT :: [L.Ident] -> TransformC a L.Ident freshNameT avoidNames = do ctx <- contextT constT $ freshName (avoidNames ++ inScopeNames ctx) -- | Perform a transform with an empty path, i.e. a path starting from -- the current node. withLocalPathT :: Transform CompCtx m a b -> Transform CompCtx m a b withLocalPathT t = transform $ \c a -> applyT t (c { clPath = SnocPath [] }) a -------------------------------------------------------------------------------- -- Support for stateful transforms -- | Run a stateful transform with an initial state and turn it into a regular -- (non-stateful) transform statefulT :: s -> Transform CompCtx (RewriteStateM s RewriteLog) a b -> TransformC a (s, b) statefulT s = resultT (stateful s) -- | Turn a regular rewrite into a stateful rewrite liftstateT :: Transform CompCtx (RewriteM Int w) a b -> Transform CompCtx (RewriteStateM s w) a b liftstateT = resultT liftstate -------------------------------------------------------------------------------- -- Congruence combinators for CL expressions tableT :: Monad m => (Type -> String -> L.BaseTableSchema -> b) -> Transform CompCtx m Expr b tableT f = contextfreeT $ \expr -> case expr of Table ty n schema -> return $ f ty n schema _ -> fail "not a table node" {-# INLINE tableT #-} tableR :: Monad m => Rewrite CompCtx m Expr tableR = tableT Table {-# INLINE tableR #-} appe1T :: Monad m => Transform CompCtx m Expr a -> (Type -> Prim1 -> a -> b) -> Transform CompCtx m Expr b appe1T t f = transform $ \c expr -> case expr of AppE1 ty p e -> f ty p <$> applyT t (c@@AppE1Arg) e _ -> fail "not a unary primitive application" {-# INLINE appe1T #-} appe1R :: Monad m => Rewrite CompCtx m Expr -> Rewrite CompCtx m Expr appe1R t = appe1T t AppE1 {-# INLINE appe1R #-} appe2T :: Monad m => Transform CompCtx m Expr a1 -> Transform CompCtx m Expr a2 -> (Type -> Prim2 -> a1 -> a2 -> b) -> Transform CompCtx m Expr b appe2T t1 t2 f = transform $ \c expr -> case expr of AppE2 ty p e1 e2 -> f ty p <$> applyT t1 (c@@AppE2Arg1) e1 <*> applyT t2 (c@@AppE2Arg2) e2 _ -> fail "not a binary primitive application" {-# INLINE appe2T #-} appe2R :: Monad m => Rewrite CompCtx m Expr -> Rewrite CompCtx m Expr -> Rewrite CompCtx m Expr appe2R t1 t2 = appe2T t1 t2 AppE2 {-# INLINE appe2R #-} binopT :: Monad m => Transform CompCtx m Expr a1 -> Transform CompCtx m Expr a2 -> (Type -> L.ScalarBinOp -> a1 -> a2 -> b) -> Transform CompCtx m Expr b binopT t1 t2 f = transform $ \c expr -> case expr of BinOp ty op e1 e2 -> f ty op <$> applyT t1 (c@@BinOpArg1) e1 <*> applyT t2 (c@@BinOpArg2) e2 _ -> fail "not a binary operator application" {-# INLINE binopT #-} binopR :: Monad m => Rewrite CompCtx m Expr -> Rewrite CompCtx m Expr -> Rewrite CompCtx m Expr binopR t1 t2 = binopT t1 t2 BinOp {-# INLINE binopR #-} unopT :: Monad m => Transform CompCtx m Expr a -> (Type -> L.ScalarUnOp -> a -> b) -> Transform CompCtx m Expr b unopT t f = transform $ \ctx expr -> case expr of UnOp ty op e -> f ty op <$> applyT t (ctx@@UnOpArg) e _ -> fail "not an unary operator application" {-# INLINE unopT #-} unopR :: Monad m => Rewrite CompCtx m Expr -> Rewrite CompCtx m Expr unopR t = unopT t UnOp {-# INLINE unopR #-} ifT :: Monad m => Transform CompCtx m Expr a1 -> Transform CompCtx m Expr a2 -> Transform CompCtx m Expr a3 -> (Type -> a1 -> a2 -> a3 -> b) -> Transform CompCtx m Expr b ifT t1 t2 t3 f = transform $ \c expr -> case expr of If ty e1 e2 e3 -> f ty <$> applyT t1 (c@@IfCond) e1 <*> applyT t2 (c@@IfThen) e2 <*> applyT t3 (c@@IfElse) e3 _ -> fail "not an if expression" {-# INLINE ifT #-} ifR :: Monad m => Rewrite CompCtx m Expr -> Rewrite CompCtx m Expr -> Rewrite CompCtx m Expr -> Rewrite CompCtx m Expr ifR t1 t2 t3 = ifT t1 t2 t3 If {-# INLINE ifR #-} litT :: Monad m => (Type -> L.Val -> b) -> Transform CompCtx m Expr b litT f = contextfreeT $ \expr -> case expr of Lit ty v -> return $ f ty v _ -> fail "not a constant" {-# INLINE litT #-} litR :: Monad m => Rewrite CompCtx m Expr litR = litT Lit {-# INLINE litR #-} varT :: Monad m => (Type -> L.Ident -> b) -> Transform CompCtx m Expr b varT f = contextfreeT $ \expr -> case expr of Var ty n -> return $ f ty n _ -> fail "not a variable" {-# INLINE varT #-} varR :: Monad m => Rewrite CompCtx m Expr varR = varT Var {-# INLINE varR #-} compT :: Monad m => Transform CompCtx m Expr a1 -> Transform CompCtx m (NL Qual) a2 -> (Type -> a1 -> a2 -> b) -> Transform CompCtx m Expr b compT t1 t2 f = transform $ \ctx expr -> case expr of Comp ty e qs -> f ty <$> applyT t1 (F.foldl' bindQual (ctx@@CompHead) qs) e <*> applyT t2 (ctx@@CompQuals) qs _ -> fail "not a comprehension" {-# INLINE compT #-} compR :: Monad m => Rewrite CompCtx m Expr -> Rewrite CompCtx m (NL Qual) -> Rewrite CompCtx m Expr compR t1 t2 = compT t1 t2 Comp {-# INLINE compR #-} mkTupleT :: Monad m => Transform CompCtx m Expr a -> (Type -> [a] -> b) -> Transform CompCtx m Expr b mkTupleT t f = transform $ \c expr -> case expr of MkTuple ty es -> f ty <$> zipWithM (\e i -> applyT t (c@@TupleElem i) e) es [1..] _ -> fail "not a tuple constructor" {-# INLINE mkTupleT #-} mkTupleR :: Monad m => Rewrite CompCtx m Expr -> Rewrite CompCtx m Expr mkTupleR r = mkTupleT r MkTuple letT :: Monad m => Transform CompCtx m Expr a1 -> Transform CompCtx m Expr a2 -> (Type -> L.Ident -> a1 -> a2 -> b) -> Transform CompCtx m Expr b letT t1 t2 f = transform $ \c expr -> case expr of Let ty x xs e -> f ty x <$> applyT t1 (c@@LetBind) xs <*> applyT t2 (bindVar x (typeOf xs) $ c@@LetBody) e _ -> fail "not a let expression" letR :: Monad m => Rewrite CompCtx m Expr -> Rewrite CompCtx m Expr -> Rewrite CompCtx m Expr letR r1 r2 = letT r1 r2 Let -------------------------------------------------------------------------------- -- Congruence combinators for qualifiers bindQualT :: Monad m => Transform CompCtx m Expr a -> (L.Ident -> a -> b) -> Transform CompCtx m Qual b bindQualT t f = transform $ \ctx expr -> case expr of BindQ n e -> f n <$> applyT t (ctx@@BindQualExpr) e _ -> fail "not a generator" {-# INLINE bindQualT #-} bindQualR :: Monad m => Rewrite CompCtx m Expr -> Rewrite CompCtx m Qual bindQualR t = bindQualT t BindQ {-# INLINE bindQualR #-} guardQualT :: Monad m => Transform CompCtx m Expr a -> (a -> b) -> Transform CompCtx m Qual b guardQualT t f = transform $ \ctx expr -> case expr of GuardQ e -> f <$> applyT t (ctx@@GuardQualExpr) e _ -> fail "not a guard" {-# INLINE guardQualT #-} guardQualR :: Monad m => Rewrite CompCtx m Expr -> Rewrite CompCtx m Qual guardQualR t = guardQualT t GuardQ {-# INLINE guardQualR #-} -------------------------------------------------------------------------------- -- Congruence combinator for a qualifier list qualsT :: Monad m => Transform CompCtx m Qual a1 -> Transform CompCtx m (NL Qual) a2 -> (a1 -> a2 -> b) -> Transform CompCtx m (NL Qual) b qualsT t1 t2 f = transform $ \ctx quals -> case quals of q :* qs -> f <$> applyT t1 (ctx@@QualsHead) q <*> applyT t2 (bindQual (ctx@@QualsTail) q) qs S _ -> fail "not a nonempty cons" {-# INLINE qualsT #-} qualsR :: Monad m => Rewrite CompCtx m Qual -> Rewrite CompCtx m (NL Qual) -> Rewrite CompCtx m (NL Qual) qualsR t1 t2 = qualsT t1 t2 (:*) {-# INLINE qualsR #-} qualsemptyT :: Monad m => Transform CompCtx m Qual a -> (a -> b) -> Transform CompCtx m (NL Qual) b qualsemptyT t f = transform $ \ctx quals -> case quals of S q -> f <$> applyT t (ctx@@QualsSingleton) q _ -> fail "not a nonempty singleton" {-# INLINE qualsemptyT #-} qualsemptyR :: Monad m => Rewrite CompCtx m Qual -> Rewrite CompCtx m (NL Qual) qualsemptyR t = qualsemptyT t S {-# INLINE qualsemptyR #-} -------------------------------------------------------------------------------- -- | The sum type of *nodes* considered for KURE traversals data CL = ExprCL Expr | QualCL Qual | QualsCL (NL Qual) instance Pretty CL where pretty (ExprCL e) = pretty e pretty (QualCL q) = pretty q pretty (QualsCL qs) = pretty qs instance Injection Expr CL where inject = ExprCL project (ExprCL expr) = Just expr project _ = Nothing instance Injection Qual CL where inject = QualCL project (QualCL q) = Just q project _ = Nothing instance Injection (NL Qual) CL where inject = QualsCL project (QualsCL qs) = Just qs project _ = Nothing -- FIXME putting an INLINE pragma on allR would propably lead to good -- things. However, with 7.6.3 it triggers a GHC panic. instance Walker CompCtx CL where allR :: forall m. MonadCatch m => Rewrite CompCtx m CL -> Rewrite CompCtx m CL allR r = rewrite $ \c cl -> case cl of ExprCL expr -> inject <$> applyT allRexpr c expr QualCL q -> inject <$> applyT allRqual c q QualsCL qs -> inject <$> applyT allRquals c qs where allRquals = readerT $ \qs -> case qs of S{} -> qualsemptyR (extractR r) (:*){} -> qualsR (extractR r) (extractR r) {-# INLINE allRquals #-} allRqual = readerT $ \q -> case q of GuardQ{} -> guardQualR (extractR r) BindQ{} -> bindQualR (extractR r) {-# INLINE allRqual #-} allRexpr = readerT $ \e -> case e of Table{} -> idR AppE1{} -> appe1R (extractR r) AppE2{} -> appe2R (extractR r) (extractR r) BinOp{} -> binopR (extractR r) (extractR r) UnOp{} -> unopR (extractR r) If{} -> ifR (extractR r) (extractR r) (extractR r) Lit{} -> idR Var{} -> idR Comp{} -> compR (extractR r) (extractR r) MkTuple{} -> mkTupleR (extractR r) Let{} -> letR (extractR r) (extractR r) {-# INLINE allRexpr #-} -------------------------------------------------------------------------------- -- A Walker instance for qualifier lists so that we can use the -- traversal infrastructure on lists. consT :: Monad m => Transform CompCtx m (NL Qual) b -> (Qual -> b -> c) -> Transform CompCtx m (NL Qual) c consT t f = transform $ \ctx nl -> case nl of a :* as -> f a <$> applyT t (bindQual (ctx@@NLConsTail) a) as S _ -> fail "not a nonempty cons" {-# INLINE consT #-} consR :: Monad m => Rewrite CompCtx m (NL Qual) -> Rewrite CompCtx m (NL Qual) consR t = consT t (:*) {-# INLINE consR #-} singletonT :: Monad m => (Qual -> c) -> Transform CompCtx m (NL Qual) c singletonT f = contextfreeT $ \nl -> case nl of S a -> return $ f a _ :* _ -> fail "not a nonempty singleton" {-# INLINE singletonT #-} singletonR :: Monad m => Rewrite CompCtx m (NL Qual) singletonR = singletonT S {-# INLINE singletonR #-} instance Walker CompCtx (NL Qual) where allR r = consR r <+ singletonR
ulricha/dsh
src/Database/DSH/CL/Kure.hs
bsd-3-clause
16,993
0
17
5,671
5,041
2,581
2,460
333
2
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 TcInstDecls: Typechecking instance declarations -} {-# LANGUAGE CPP #-} module TcInstDcls ( tcInstDecls1, tcInstDecls2 ) where #include "HsVersions.h" import HsSyn import TcBinds import TcTyClsDecls import TcClassDcl( tcClassDecl2, tcATDefault, HsSigFun, lookupHsSig, mkHsSigFun, findMethodBind, instantiateMethod ) import TcPat ( addInlinePrags, lookupPragEnv, emptyPragEnv ) import TcRnMonad import TcValidity import TcHsSyn ( zonkTcTypeToTypes, emptyZonkEnv ) import TcMType import TcType import BuildTyCl import Inst import InstEnv import FamInst import FamInstEnv import TcDeriv import TcEnv import TcHsType import TcUnify import MkCore ( nO_METHOD_BINDING_ERROR_ID ) import Type import TcEvidence import TyCon import CoAxiom import DataCon import Class import Var import VarEnv import VarSet import PrelNames ( typeableClassName, genericClassNames ) import Bag import BasicTypes import DynFlags import ErrUtils import FastString import HscTypes ( isHsBootOrSig ) import Id import MkId import Name import NameSet import Outputable import SrcLoc import Util import BooleanFormula ( isUnsatisfied, pprBooleanFormulaNice ) import qualified GHC.LanguageExtensions as LangExt import Control.Monad import Maybes import Data.List ( partition ) {- Typechecking instance declarations is done in two passes. The first pass, made by @tcInstDecls1@, collects information to be used in the second pass. This pre-processed info includes the as-yet-unprocessed bindings inside the instance declaration. These are type-checked in the second pass, when the class-instance envs and GVE contain all the info from all the instance and value decls. Indeed that's the reason we need two passes over the instance decls. Note [How instance declarations are translated] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is how we translate instance declarations into Core Running example: class C a where op1, op2 :: Ix b => a -> b -> b op2 = <dm-rhs> instance C a => C [a] {-# INLINE [2] op1 #-} op1 = <rhs> ===> -- Method selectors op1,op2 :: forall a. C a => forall b. Ix b => a -> b -> b op1 = ... op2 = ... -- Default methods get the 'self' dictionary as argument -- so they can call other methods at the same type -- Default methods get the same type as their method selector $dmop2 :: forall a. C a => forall b. Ix b => a -> b -> b $dmop2 = /\a. \(d:C a). /\b. \(d2: Ix b). <dm-rhs> -- NB: type variables 'a' and 'b' are *both* in scope in <dm-rhs> -- Note [Tricky type variable scoping] -- A top-level definition for each instance method -- Here op1_i, op2_i are the "instance method Ids" -- The INLINE pragma comes from the user pragma {-# INLINE [2] op1_i #-} -- From the instance decl bindings op1_i, op2_i :: forall a. C a => forall b. Ix b => [a] -> b -> b op1_i = /\a. \(d:C a). let this :: C [a] this = df_i a d -- Note [Subtle interaction of recursion and overlap] local_op1 :: forall b. Ix b => [a] -> b -> b local_op1 = <rhs> -- Source code; run the type checker on this -- NB: Type variable 'a' (but not 'b') is in scope in <rhs> -- Note [Tricky type variable scoping] in local_op1 a d op2_i = /\a \d:C a. $dmop2 [a] (df_i a d) -- The dictionary function itself {-# NOINLINE CONLIKE df_i #-} -- Never inline dictionary functions df_i :: forall a. C a -> C [a] df_i = /\a. \d:C a. MkC (op1_i a d) (op2_i a d) -- But see Note [Default methods in instances] -- We can't apply the type checker to the default-method call -- Use a RULE to short-circuit applications of the class ops {-# RULE "op1@C[a]" forall a, d:C a. op1 [a] (df_i d) = op1_i a d #-} Note [Instances and loop breakers] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Note that df_i may be mutually recursive with both op1_i and op2_i. It's crucial that df_i is not chosen as the loop breaker, even though op1_i has a (user-specified) INLINE pragma. * Instead the idea is to inline df_i into op1_i, which may then select methods from the MkC record, and thereby break the recursion with df_i, leaving a *self*-recurisve op1_i. (If op1_i doesn't call op at the same type, it won't mention df_i, so there won't be recursion in the first place.) * If op1_i is marked INLINE by the user there's a danger that we won't inline df_i in it, and that in turn means that (since it'll be a loop-breaker because df_i isn't), op1_i will ironically never be inlined. But this is OK: the recursion breaking happens by way of a RULE (the magic ClassOp rule above), and RULES work inside InlineRule unfoldings. See Note [RULEs enabled in SimplGently] in SimplUtils Note [ClassOp/DFun selection] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ One thing we see a lot is stuff like op2 (df d1 d2) where 'op2' is a ClassOp and 'df' is DFun. Now, we could inline *both* 'op2' and 'df' to get case (MkD ($cop1 d1 d2) ($cop2 d1 d2) ... of MkD _ op2 _ _ _ -> op2 And that will reduce to ($cop2 d1 d2) which is what we wanted. But it's tricky to make this work in practice, because it requires us to inline both 'op2' and 'df'. But neither is keen to inline without having seen the other's result; and it's very easy to get code bloat (from the big intermediate) if you inline a bit too much. Instead we use a cunning trick. * We arrange that 'df' and 'op2' NEVER inline. * We arrange that 'df' is ALWAYS defined in the sylised form df d1 d2 = MkD ($cop1 d1 d2) ($cop2 d1 d2) ... * We give 'df' a magical unfolding (DFunUnfolding [$cop1, $cop2, ..]) that lists its methods. * We make CoreUnfold.exprIsConApp_maybe spot a DFunUnfolding and return a suitable constructor application -- inlining df "on the fly" as it were. * ClassOp rules: We give the ClassOp 'op2' a BuiltinRule that extracts the right piece iff its argument satisfies exprIsConApp_maybe. This is done in MkId mkDictSelId * We make 'df' CONLIKE, so that shared uses still match; eg let d = df d1 d2 in ...(op2 d)...(op1 d)... Note [Single-method classes] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If the class has just one method (or, more accurately, just one element of {superclasses + methods}), then we use a different strategy. class C a where op :: a -> a instance C a => C [a] where op = <blah> We translate the class decl into a newtype, which just gives a top-level axiom. The "constructor" MkC expands to a cast, as does the class-op selector. axiom Co:C a :: C a ~ (a->a) op :: forall a. C a -> (a -> a) op a d = d |> (Co:C a) MkC :: forall a. (a->a) -> C a MkC = /\a.\op. op |> (sym Co:C a) The clever RULE stuff doesn't work now, because ($df a d) isn't a constructor application, so exprIsConApp_maybe won't return Just <blah>. Instead, we simply rely on the fact that casts are cheap: $df :: forall a. C a => C [a] {-# INLINE df #-} -- NB: INLINE this $df = /\a. \d. MkC [a] ($cop_list a d) = $cop_list |> forall a. C a -> (sym (Co:C [a])) $cop_list :: forall a. C a => [a] -> [a] $cop_list = <blah> So if we see (op ($df a d)) we'll inline 'op' and '$df', since both are simply casts, and good things happen. Why do we use this different strategy? Because otherwise we end up with non-inlined dictionaries that look like $df = $cop |> blah which adds an extra indirection to every use, which seems stupid. See Trac #4138 for an example (although the regression reported there wasn't due to the indirection). There is an awkward wrinkle though: we want to be very careful when we have instance C a => C [a] where {-# INLINE op #-} op = ... then we'll get an INLINE pragma on $cop_list but it's important that $cop_list only inlines when it's applied to *two* arguments (the dictionary and the list argument). So we must not eta-expand $df above. We ensure that this doesn't happen by putting an INLINE pragma on the dfun itself; after all, it ends up being just a cast. There is one more dark corner to the INLINE story, even more deeply buried. Consider this (Trac #3772): class DeepSeq a => C a where gen :: Int -> a instance C a => C [a] where gen n = ... class DeepSeq a where deepSeq :: a -> b -> b instance DeepSeq a => DeepSeq [a] where {-# INLINE deepSeq #-} deepSeq xs b = foldr deepSeq b xs That gives rise to these defns: $cdeepSeq :: DeepSeq a -> [a] -> b -> b -- User INLINE( 3 args )! $cdeepSeq a (d:DS a) b (x:[a]) (y:b) = ... $fDeepSeq[] :: DeepSeq a -> DeepSeq [a] -- DFun (with auto INLINE pragma) $fDeepSeq[] a d = $cdeepSeq a d |> blah $cp1 a d :: C a => DeepSep [a] -- We don't want to eta-expand this, lest -- $cdeepSeq gets inlined in it! $cp1 a d = $fDeepSep[] a (scsel a d) $fC[] :: C a => C [a] -- Ordinary DFun $fC[] a d = MkC ($cp1 a d) ($cgen a d) Here $cp1 is the code that generates the superclass for C [a]. The issue is this: we must not eta-expand $cp1 either, or else $fDeepSeq[] and then $cdeepSeq will inline there, which is definitely wrong. Like on the dfun, we solve this by adding an INLINE pragma to $cp1. Note [Subtle interaction of recursion and overlap] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider this class C a where { op1,op2 :: a -> a } instance C a => C [a] where op1 x = op2 x ++ op2 x op2 x = ... instance C [Int] where ... When type-checking the C [a] instance, we need a C [a] dictionary (for the call of op2). If we look up in the instance environment, we find an overlap. And in *general* the right thing is to complain (see Note [Overlapping instances] in InstEnv). But in *this* case it's wrong to complain, because we just want to delegate to the op2 of this same instance. Why is this justified? Because we generate a (C [a]) constraint in a context in which 'a' cannot be instantiated to anything that matches other overlapping instances, or else we would not be executing this version of op1 in the first place. It might even be a bit disguised: nullFail :: C [a] => [a] -> [a] nullFail x = op2 x ++ op2 x instance C a => C [a] where op1 x = nullFail x Precisely this is used in package 'regex-base', module Context.hs. See the overlapping instances for RegexContext, and the fact that they call 'nullFail' just like the example above. The DoCon package also does the same thing; it shows up in module Fraction.hs. Conclusion: when typechecking the methods in a C [a] instance, we want to treat the 'a' as an *existential* type variable, in the sense described by Note [Binding when looking up instances]. That is why isOverlappableTyVar responds True to an InstSkol, which is the kind of skolem we use in tcInstDecl2. Note [Tricky type variable scoping] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In our example class C a where op1, op2 :: Ix b => a -> b -> b op2 = <dm-rhs> instance C a => C [a] {-# INLINE [2] op1 #-} op1 = <rhs> note that 'a' and 'b' are *both* in scope in <dm-rhs>, but only 'a' is in scope in <rhs>. In particular, we must make sure that 'b' is in scope when typechecking <dm-rhs>. This is achieved by subFunTys, which brings appropriate tyvars into scope. This happens for both <dm-rhs> and for <rhs>, but that doesn't matter: the *renamer* will have complained if 'b' is mentioned in <rhs>. ************************************************************************ * * \subsection{Extracting instance decls} * * ************************************************************************ Gather up the instance declarations from their various sources -} tcInstDecls1 -- Deal with both source-code and imported instance decls :: [TyClGroup Name] -- For deriving stuff -> [LInstDecl Name] -- Source code instance decls -> [LDerivDecl Name] -- Source code stand-alone deriving decls -> TcM (TcGblEnv, -- The full inst env [InstInfo Name], -- Source-code instance decls to process; -- contains all dfuns for this module HsValBinds Name) -- Supporting bindings for derived instances tcInstDecls1 tycl_decls inst_decls deriv_decls = checkNoErrs $ do { -- Stop if addInstInfos etc discovers any errors -- (they recover, so that we get more than one error each -- round) -- Do class and family instance declarations ; stuff <- mapAndRecoverM tcLocalInstDecl inst_decls ; let (local_infos_s, fam_insts_s, datafam_deriv_infos) = unzip3 stuff fam_insts = concat fam_insts_s local_infos' = concat local_infos_s -- Handwritten instances of the poly-kinded Typeable class are -- forbidden, so we handle those separately (typeable_instances, local_infos) = partition bad_typeable_instance local_infos' ; addClsInsts local_infos $ addFamInsts fam_insts $ do { -- Compute instances from "deriving" clauses; -- This stuff computes a context for the derived instance -- decl, so it needs to know about all the instances possible -- NB: class instance declarations can contain derivings as -- part of associated data type declarations failIfErrsM -- If the addInsts stuff gave any errors, don't -- try the deriving stuff, because that may give -- more errors still ; traceTc "tcDeriving" Outputable.empty ; th_stage <- getStage -- See Note [Deriving inside TH brackets ] ; (gbl_env, deriv_inst_info, deriv_binds) <- if isBrackStage th_stage then do { gbl_env <- getGblEnv ; return (gbl_env, emptyBag, emptyValBindsOut) } else do { data_deriv_infos <- mkDerivInfos tycl_decls ; let deriv_infos = concat datafam_deriv_infos ++ data_deriv_infos ; tcDeriving deriv_infos deriv_decls } -- Fail if there are any handwritten instance of poly-kinded Typeable ; mapM_ typeable_err typeable_instances -- Check that if the module is compiled with -XSafe, there are no -- hand written instances of old Typeable as then unsafe casts could be -- performed. Derived instances are OK. ; dflags <- getDynFlags ; when (safeLanguageOn dflags) $ forM_ local_infos $ \x -> case x of _ | genInstCheck x -> addErrAt (getSrcSpan $ iSpec x) (genInstErr x) _ -> return () -- As above but for Safe Inference mode. ; when (safeInferOn dflags) $ forM_ local_infos $ \x -> case x of _ | genInstCheck x -> recordUnsafeInfer emptyBag _ -> return () ; return ( gbl_env , bagToList deriv_inst_info ++ local_infos , deriv_binds ) }} where -- Separate the Typeable instances from the rest bad_typeable_instance i = typeableClassName == is_cls_nm (iSpec i) -- Check for hand-written Generic instances (disallowed in Safe Haskell) genInstCheck ty = is_cls_nm (iSpec ty) `elem` genericClassNames genInstErr i = hang (text ("Generic instances can only be " ++ "derived in Safe Haskell.") $+$ text "Replace the following instance:") 2 (pprInstanceHdr (iSpec i)) -- Report an error or a warning for a Typeable instances. -- If we are working on an .hs-boot file, we just report a warning, -- and ignore the instance. We do this, to give users a chance to fix -- their code. typeable_err i = setSrcSpan (getSrcSpan (iSpec i)) $ do env <- getGblEnv if isHsBootOrSig (tcg_src env) then do warn <- woptM Opt_WarnDerivingTypeable when warn $ addWarnTc (Reason Opt_WarnDerivingTypeable) $ vcat [ ppTypeable <+> text "instances in .hs-boot files are ignored" , text "This warning will become an error in future versions of the compiler" ] else addErrTc $ text "Class" <+> ppTypeable <+> text "does not support user-specified instances" ppTypeable :: SDoc ppTypeable = quotes (ppr typeableClassName) addClsInsts :: [InstInfo Name] -> TcM a -> TcM a addClsInsts infos thing_inside = tcExtendLocalInstEnv (map iSpec infos) thing_inside addFamInsts :: [FamInst] -> TcM a -> TcM a -- Extend (a) the family instance envt -- (b) the type envt with stuff from data type decls addFamInsts fam_insts thing_inside = tcExtendLocalFamInstEnv fam_insts $ tcExtendGlobalEnv axioms $ tcExtendTyConEnv data_rep_tycons $ do { traceTc "addFamInsts" (pprFamInsts fam_insts) ; tcg_env <- tcAddImplicits data_rep_tycons -- Does not add its axiom; that comes from -- adding the 'axioms' above ; setGblEnv tcg_env thing_inside } where axioms = map (ACoAxiom . toBranchedAxiom . famInstAxiom) fam_insts data_rep_tycons = famInstsRepTyCons fam_insts -- The representation tycons for 'data instances' declarations {- Note [Deriving inside TH brackets] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Given a declaration bracket [d| data T = A | B deriving( Show ) |] there is really no point in generating the derived code for deriving( Show) and then type-checking it. This will happen at the call site anyway, and the type check should never fail! Moreover (Trac #6005) the scoping of the generated code inside the bracket does not seem to work out. The easy solution is simply not to generate the derived instances at all. (A less brutal solution would be to generate them with no bindings.) This will become moot when we shift to the new TH plan, so the brutal solution will do. -} tcLocalInstDecl :: LInstDecl Name -> TcM ([InstInfo Name], [FamInst], [DerivInfo]) -- A source-file instance declaration -- Type-check all the stuff before the "where" -- -- We check for respectable instance type, and context tcLocalInstDecl (L loc (TyFamInstD { tfid_inst = decl })) = do { fam_inst <- tcTyFamInstDecl Nothing (L loc decl) ; return ([], [fam_inst], []) } tcLocalInstDecl (L loc (DataFamInstD { dfid_inst = decl })) = do { (fam_inst, m_deriv_info) <- tcDataFamInstDecl Nothing (L loc decl) ; return ([], [fam_inst], maybeToList m_deriv_info) } tcLocalInstDecl (L loc (ClsInstD { cid_inst = decl })) = do { (insts, fam_insts, deriv_infos) <- tcClsInstDecl (L loc decl) ; return (insts, fam_insts, deriv_infos) } tcClsInstDecl :: LClsInstDecl Name -> TcM ([InstInfo Name], [FamInst], [DerivInfo]) -- the returned DerivInfos are for any associated data families tcClsInstDecl (L loc (ClsInstDecl { cid_poly_ty = poly_ty, cid_binds = binds , cid_sigs = uprags, cid_tyfam_insts = ats , cid_overlap_mode = overlap_mode , cid_datafam_insts = adts })) = setSrcSpan loc $ addErrCtxt (instDeclCtxt1 poly_ty) $ do { is_boot <- tcIsHsBootOrSig ; checkTc (not is_boot || (isEmptyLHsBinds binds && null uprags)) badBootDeclErr ; (tyvars, theta, clas, inst_tys) <- tcHsClsInstType InstDeclCtxt poly_ty ; let mini_env = mkVarEnv (classTyVars clas `zip` inst_tys) mini_subst = mkTvSubst (mkInScopeSet (mkVarSet tyvars)) mini_env mb_info = Just (clas, mini_env) -- Next, process any associated types. ; traceTc "tcLocalInstDecl" (ppr poly_ty) ; tyfam_insts0 <- tcExtendTyVarEnv tyvars $ mapAndRecoverM (tcTyFamInstDecl mb_info) ats ; datafam_stuff <- tcExtendTyVarEnv tyvars $ mapAndRecoverM (tcDataFamInstDecl mb_info) adts ; let (datafam_insts, m_deriv_infos) = unzip datafam_stuff deriv_infos = catMaybes m_deriv_infos -- Check for missing associated types and build them -- from their defaults (if available) ; let defined_ats = mkNameSet (map (tyFamInstDeclName . unLoc) ats) `unionNameSet` mkNameSet (map (unLoc . dfid_tycon . unLoc) adts) ; tyfam_insts1 <- mapM (tcATDefault True loc mini_subst defined_ats) (classATItems clas) -- Finally, construct the Core representation of the instance. -- (This no longer includes the associated types.) ; dfun_name <- newDFunName clas inst_tys (getLoc (hsSigType poly_ty)) -- Dfun location is that of instance *header* ; ispec <- newClsInst (fmap unLoc overlap_mode) dfun_name tyvars theta clas inst_tys ; let inst_info = InstInfo { iSpec = ispec , iBinds = InstBindings { ib_binds = binds , ib_tyvars = map Var.varName tyvars -- Scope over bindings , ib_pragmas = uprags , ib_extensions = [] , ib_derived = False } } ; return ( [inst_info], tyfam_insts0 ++ concat tyfam_insts1 ++ datafam_insts , deriv_infos ) } {- ************************************************************************ * * Type checking family instances * * ************************************************************************ Family instances are somewhat of a hybrid. They are processed together with class instance heads, but can contain data constructors and hence they share a lot of kinding and type checking code with ordinary algebraic data types (and GADTs). -} tcFamInstDeclCombined :: Maybe ClsInfo -> Located Name -> TcM TyCon tcFamInstDeclCombined mb_clsinfo fam_tc_lname = do { -- Type family instances require -XTypeFamilies -- and can't (currently) be in an hs-boot file ; traceTc "tcFamInstDecl" (ppr fam_tc_lname) ; type_families <- xoptM LangExt.TypeFamilies ; is_boot <- tcIsHsBootOrSig -- Are we compiling an hs-boot file? ; checkTc type_families $ badFamInstDecl fam_tc_lname ; checkTc (not is_boot) $ badBootFamInstDeclErr -- Look up the family TyCon and check for validity including -- check that toplevel type instances are not for associated types. ; fam_tc <- tcLookupLocatedTyCon fam_tc_lname ; when (isNothing mb_clsinfo && -- Not in a class decl isTyConAssoc fam_tc) -- but an associated type (addErr $ assocInClassErr fam_tc_lname) ; return fam_tc } tcTyFamInstDecl :: Maybe ClsInfo -> LTyFamInstDecl Name -> TcM FamInst -- "type instance" tcTyFamInstDecl mb_clsinfo (L loc decl@(TyFamInstDecl { tfid_eqn = eqn })) = setSrcSpan loc $ tcAddTyFamInstCtxt decl $ do { let fam_lname = tfe_tycon (unLoc eqn) ; fam_tc <- tcFamInstDeclCombined mb_clsinfo fam_lname -- (0) Check it's an open type family ; checkTc (isFamilyTyCon fam_tc) (notFamily fam_tc) ; checkTc (isTypeFamilyTyCon fam_tc) (wrongKindOfFamily fam_tc) ; checkTc (isOpenTypeFamilyTyCon fam_tc) (notOpenFamily fam_tc) -- (1) do the work of verifying the synonym group ; co_ax_branch <- tcTyFamInstEqn (famTyConShape fam_tc) mb_clsinfo eqn -- (2) check for validity ; checkValidCoAxBranch mb_clsinfo fam_tc co_ax_branch -- (3) construct coercion axiom ; rep_tc_name <- newFamInstAxiomName fam_lname [coAxBranchLHS co_ax_branch] ; let axiom = mkUnbranchedCoAxiom rep_tc_name fam_tc co_ax_branch ; newFamInst SynFamilyInst axiom } tcDataFamInstDecl :: Maybe ClsInfo -> LDataFamInstDecl Name -> TcM (FamInst, Maybe DerivInfo) -- "newtype instance" and "data instance" tcDataFamInstDecl mb_clsinfo (L loc decl@(DataFamInstDecl { dfid_pats = pats , dfid_tycon = fam_tc_name , dfid_defn = defn@HsDataDefn { dd_ND = new_or_data, dd_cType = cType , dd_ctxt = ctxt, dd_cons = cons , dd_derivs = derivs } })) = setSrcSpan loc $ tcAddDataFamInstCtxt decl $ do { fam_tc <- tcFamInstDeclCombined mb_clsinfo fam_tc_name -- Check that the family declaration is for the right kind ; checkTc (isFamilyTyCon fam_tc) (notFamily fam_tc) ; checkTc (isDataFamilyTyCon fam_tc) (wrongKindOfFamily fam_tc) -- Kind check type patterns ; tcFamTyPats (famTyConShape fam_tc) mb_clsinfo pats (kcDataDefn (unLoc fam_tc_name) pats defn) $ \tvs' pats' res_kind -> do { -- Check that left-hand sides are ok (mono-types, no type families, -- consistent instantiations, etc) ; checkValidFamPats mb_clsinfo fam_tc tvs' [] pats' -- Result kind must be '*' (otherwise, we have too few patterns) ; checkTc (isLiftedTypeKind res_kind) $ tooFewParmsErr (tyConArity fam_tc) ; stupid_theta <- solveEqualities $ tcHsContext ctxt ; stupid_theta <- zonkTcTypeToTypes emptyZonkEnv stupid_theta ; gadt_syntax <- dataDeclChecks (tyConName fam_tc) new_or_data stupid_theta cons -- Construct representation tycon ; rep_tc_name <- newFamInstTyConName fam_tc_name pats' ; axiom_name <- newFamInstAxiomName fam_tc_name [pats'] ; let (eta_pats, etad_tvs) = eta_reduce pats' eta_tvs = filterOut (`elem` etad_tvs) tvs' full_tvs = eta_tvs ++ etad_tvs -- Put the eta-removed tyvars at the end -- Remember, tvs' is in arbitrary order (except kind vars are -- first, so there is no reason to suppose that the etad_tvs -- (obtained from the pats) are at the end (Trac #11148) orig_res_ty = mkTyConApp fam_tc pats' ; (rep_tc, axiom) <- fixM $ \ ~(rec_rep_tc, _) -> do { data_cons <- tcConDecls new_or_data rec_rep_tc (full_tvs, orig_res_ty) cons ; tc_rhs <- case new_or_data of DataType -> return (mkDataTyConRhs data_cons) NewType -> ASSERT( not (null data_cons) ) mkNewTyConRhs rep_tc_name rec_rep_tc (head data_cons) -- freshen tyvars ; let axiom = mkSingleCoAxiom Representational axiom_name eta_tvs [] fam_tc eta_pats (mkTyConApp rep_tc (mkTyVarTys eta_tvs)) parent = DataFamInstTyCon axiom fam_tc pats' ty_binders = mkTyBindersPreferAnon full_tvs liftedTypeKind -- NB: Use the full_tvs from the pats. See bullet toward -- the end of Note [Data type families] in TyCon rep_tc = mkAlgTyCon rep_tc_name ty_binders liftedTypeKind full_tvs (map (const Nominal) full_tvs) (fmap unLoc cType) stupid_theta tc_rhs parent Recursive gadt_syntax -- We always assume that indexed types are recursive. Why? -- (1) Due to their open nature, we can never be sure that a -- further instance might not introduce a new recursive -- dependency. (2) They are always valid loop breakers as -- they involve a coercion. ; return (rep_tc, axiom) } -- Remember to check validity; no recursion to worry about here ; checkValidTyCon rep_tc ; let m_deriv_info = case derivs of Nothing -> Nothing Just (L _ preds) -> Just $ DerivInfo { di_rep_tc = rep_tc , di_preds = preds , di_ctxt = tcMkDataFamInstCtxt decl } ; fam_inst <- newFamInst (DataFamilyInst rep_tc) axiom ; return (fam_inst, m_deriv_info) } } where eta_reduce :: [Type] -> ([Type], [TyVar]) -- See Note [Eta reduction for data families] in FamInstEnv -- Splits the incoming patterns into two: the [TyVar] -- are the patterns that can be eta-reduced away. -- e.g. T [a] Int a d c ==> (T [a] Int a, [d,c]) -- -- NB: quadratic algorithm, but types are small here eta_reduce pats = go (reverse pats) [] go (pat:pats) etad_tvs | Just tv <- getTyVar_maybe pat , not (tv `elemVarSet` tyCoVarsOfTypes pats) = go pats (tv : etad_tvs) go pats etad_tvs = (reverse pats, etad_tvs) {- ********************************************************************* * * Type-checking instance declarations, pass 2 * * ********************************************************************* -} tcInstDecls2 :: [LTyClDecl Name] -> [InstInfo Name] -> TcM (LHsBinds Id) -- (a) From each class declaration, -- generate any default-method bindings -- (b) From each instance decl -- generate the dfun binding tcInstDecls2 tycl_decls inst_decls = do { -- (a) Default methods from class decls let class_decls = filter (isClassDecl . unLoc) tycl_decls ; dm_binds_s <- mapM tcClassDecl2 class_decls ; let dm_binds = unionManyBags dm_binds_s -- (b) instance declarations ; let dm_ids = collectHsBindsBinders dm_binds -- Add the default method Ids (again) -- See Note [Default methods and instances] ; inst_binds_s <- tcExtendLetEnv TopLevel dm_ids $ mapM tcInstDecl2 inst_decls -- Done ; return (dm_binds `unionBags` unionManyBags inst_binds_s) } {- See Note [Default methods and instances] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The default method Ids are already in the type environment (see Note [Default method Ids and Template Haskell] in TcTyClsDcls), BUT they don't have their InlinePragmas yet. Usually that would not matter, because the simplifier propagates information from binding site to use. But, unusually, when compiling instance decls we *copy* the INLINE pragma from the default method to the method for that particular operation (see Note [INLINE and default methods] below). So right here in tcInstDecls2 we must re-extend the type envt with the default method Ids replete with their INLINE pragmas. Urk. -} tcInstDecl2 :: InstInfo Name -> TcM (LHsBinds Id) -- Returns a binding for the dfun tcInstDecl2 (InstInfo { iSpec = ispec, iBinds = ibinds }) = recoverM (return emptyLHsBinds) $ setSrcSpan loc $ addErrCtxt (instDeclCtxt2 (idType dfun_id)) $ do { -- Instantiate the instance decl with skolem constants ; (inst_tyvars, dfun_theta, inst_head) <- tcSkolDFunType (idType dfun_id) ; dfun_ev_vars <- newEvVars dfun_theta -- We instantiate the dfun_id with superSkolems. -- See Note [Subtle interaction of recursion and overlap] -- and Note [Binding when looking up instances] ; let (clas, inst_tys) = tcSplitDFunHead inst_head (class_tyvars, sc_theta, _, op_items) = classBigSig clas sc_theta' = substTheta (zipTvSubst class_tyvars inst_tys) sc_theta ; traceTc "tcInstDecl2" (vcat [ppr inst_tyvars, ppr inst_tys, ppr dfun_theta, ppr sc_theta']) -- Deal with 'SPECIALISE instance' pragmas -- See Note [SPECIALISE instance pragmas] ; spec_inst_info@(spec_inst_prags,_) <- tcSpecInstPrags dfun_id ibinds -- Typecheck superclasses and methods -- See Note [Typechecking plan for instance declarations] ; dfun_ev_binds_var <- newTcEvBinds ; let dfun_ev_binds = TcEvBinds dfun_ev_binds_var ; ((sc_meth_ids, sc_meth_binds, sc_meth_implics), tclvl) <- pushTcLevelM $ do { fam_envs <- tcGetFamInstEnvs ; (sc_ids, sc_binds, sc_implics) <- tcSuperClasses dfun_id clas inst_tyvars dfun_ev_vars inst_tys dfun_ev_binds fam_envs sc_theta' -- Typecheck the methods ; (meth_ids, meth_binds, meth_implics) <- tcMethods dfun_id clas inst_tyvars dfun_ev_vars inst_tys dfun_ev_binds spec_inst_info op_items ibinds ; return ( sc_ids ++ meth_ids , sc_binds `unionBags` meth_binds , sc_implics `unionBags` meth_implics ) } ; env <- getLclEnv ; emitImplication $ Implic { ic_tclvl = tclvl , ic_skols = inst_tyvars , ic_no_eqs = False , ic_given = dfun_ev_vars , ic_wanted = mkImplicWC sc_meth_implics , ic_status = IC_Unsolved , ic_binds = Just dfun_ev_binds_var , ic_env = env , ic_info = InstSkol } -- Create the result bindings ; self_dict <- newDict clas inst_tys ; let class_tc = classTyCon clas [dict_constr] = tyConDataCons class_tc dict_bind = mkVarBind self_dict (L loc con_app_args) -- We don't produce a binding for the dict_constr; instead we -- rely on the simplifier to unfold this saturated application -- We do this rather than generate an HsCon directly, because -- it means that the special cases (e.g. dictionary with only one -- member) are dealt with by the common MkId.mkDataConWrapId -- code rather than needing to be repeated here. -- con_app_tys = MkD ty1 ty2 -- con_app_scs = MkD ty1 ty2 sc1 sc2 -- con_app_args = MkD ty1 ty2 sc1 sc2 op1 op2 con_app_tys = wrapId (mkWpTyApps inst_tys) (dataConWrapId dict_constr) -- NB: We *can* have covars in inst_tys, in the case of -- promoted GADT constructors. con_app_args = foldl app_to_meth con_app_tys sc_meth_ids app_to_meth :: HsExpr Id -> Id -> HsExpr Id app_to_meth fun meth_id = L loc fun `HsApp` L loc (wrapId arg_wrapper meth_id) inst_tv_tys = mkTyVarTys inst_tyvars arg_wrapper = mkWpEvVarApps dfun_ev_vars <.> mkWpTyApps inst_tv_tys -- Do not inline the dfun; instead give it a magic DFunFunfolding dfun_spec_prags | isNewTyCon class_tc = SpecPrags [] -- Newtype dfuns just inline unconditionally, -- so don't attempt to specialise them | otherwise = SpecPrags spec_inst_prags export = ABE { abe_wrap = idHsWrapper , abe_poly = dfun_id , abe_mono = self_dict, abe_prags = dfun_spec_prags } -- NB: see Note [SPECIALISE instance pragmas] main_bind = AbsBinds { abs_tvs = inst_tyvars , abs_ev_vars = dfun_ev_vars , abs_exports = [export] , abs_ev_binds = [] , abs_binds = unitBag dict_bind } ; return (unitBag (L loc main_bind) `unionBags` sc_meth_binds) } where dfun_id = instanceDFunId ispec loc = getSrcSpan dfun_id wrapId :: HsWrapper -> id -> HsExpr id wrapId wrapper id = mkHsWrap wrapper (HsVar (noLoc id)) {- Note [Typechecking plan for instance declarations] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For intance declarations we generate the following bindings and implication constraints. Example: instance Ord a => Ord [a] where compare = <compare-rhs> generates this: Bindings: -- Method bindings $ccompare :: forall a. Ord a => a -> a -> Ordering $ccompare = /\a \(d:Ord a). let <meth-ev-binds> in ... -- Superclass bindings $cp1Ord :: forall a. Ord a => Eq [a] $cp1Ord = /\a \(d:Ord a). let <sc-ev-binds> in dfEqList (dw :: Eq a) Constraints: forall a. Ord a => -- Method constraint (forall. (empty) => <constraints from compare-rhs>) -- Superclass constraint /\ (forall. (empty) => dw :: Eq a) Notice that * Per-meth/sc implication. There is one inner implication per superclass or method, with no skolem variables or givens. The only reason for this one is to gather the evidence bindings privately for this superclass or method. This implication is generated by checkInstConstraints. * Overall instance implication. There is an overall enclosing implication for the whole instance declaratation, with the expected skolems and givens. We need this to get the correct "redundant constraint" warnings, gathering all the uses from all the methods and superclasses. See TcSimplify Note [Tracking redundant constraints] * The given constraints in the outer implication may generate evidence, notably by superclass selection. Since the method and superclass bindings are top-level, we want that evidence copied into *every* method or superclass definition. (Some of it will be usused in some, but dead-code elimination will drop it.) We achieve this by putting the the evidence variable for the overall instance implicaiton into the AbsBinds for each method/superclass. Hence the 'dfun_ev_binds' passed into tcMethods and tcSuperClasses. (And that in turn is why the abs_ev_binds field of AbBinds is a [TcEvBinds] rather than simply TcEvBinds. This is a bit of a hack, but works very nicely in practice. * Note that if a method has a locally-polymorphic binding, there will be yet another implication for that, generated by tcPolyCheck in tcMethodBody. E.g. class C a where foo :: forall b. Ord b => blah ************************************************************************ * * Type-checking superclases * * ************************************************************************ -} tcSuperClasses :: DFunId -> Class -> [TcTyVar] -> [EvVar] -> [TcType] -> TcEvBinds -> FamInstEnvs -> TcThetaType -> TcM ([EvVar], LHsBinds Id, Bag Implication) -- Make a new top-level function binding for each superclass, -- something like -- $Ordp1 :: forall a. Ord a => Eq [a] -- $Ordp1 = /\a \(d:Ord a). dfunEqList a (sc_sel d) -- -- See Note [Recursive superclasses] for why this is so hard! -- In effect, be build a special-purpose solver for the first step -- of solving each superclass constraint tcSuperClasses dfun_id cls tyvars dfun_evs inst_tys dfun_ev_binds _fam_envs sc_theta = do { (ids, binds, implics) <- mapAndUnzip3M tc_super (zip sc_theta [fIRST_TAG..]) ; return (ids, listToBag binds, listToBag implics) } where loc = getSrcSpan dfun_id size = sizeTypes inst_tys tc_super (sc_pred, n) = do { (sc_implic, ev_binds_var, sc_ev_tm) <- checkInstConstraints $ emitWanted (ScOrigin size) sc_pred ; sc_top_name <- newName (mkSuperDictAuxOcc n (getOccName cls)) ; sc_ev_id <- newEvVar sc_pred ; addTcEvBind ev_binds_var $ mkWantedEvBind sc_ev_id sc_ev_tm ; let sc_top_ty = mkInvForAllTys tyvars (mkPiTypes dfun_evs sc_pred) sc_top_id = mkLocalId sc_top_name sc_top_ty export = ABE { abe_wrap = idHsWrapper , abe_poly = sc_top_id , abe_mono = sc_ev_id , abe_prags = noSpecPrags } local_ev_binds = TcEvBinds ev_binds_var bind = AbsBinds { abs_tvs = tyvars , abs_ev_vars = dfun_evs , abs_exports = [export] , abs_ev_binds = [dfun_ev_binds, local_ev_binds] , abs_binds = emptyBag } ; return (sc_top_id, L loc bind, sc_implic) } ------------------- checkInstConstraints :: TcM result -> TcM (Implication, EvBindsVar, result) -- See Note [Typechecking plan for instance declarations] checkInstConstraints thing_inside = do { (tclvl, wanted, result) <- pushLevelAndCaptureConstraints $ thing_inside ; ev_binds_var <- newTcEvBinds ; env <- getLclEnv ; let implic = Implic { ic_tclvl = tclvl , ic_skols = [] , ic_no_eqs = False , ic_given = [] , ic_wanted = wanted , ic_status = IC_Unsolved , ic_binds = Just ev_binds_var , ic_env = env , ic_info = InstSkol } ; return (implic, ev_binds_var, result) } {- Note [Recursive superclasses] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ See Trac #3731, #4809, #5751, #5913, #6117, #6161, which all describe somewhat more complicated situations, but ones encountered in practice. See also tests tcrun020, tcrun021, tcrun033, and Trac #11427. ----- THE PROBLEM -------- The problem is that it is all too easy to create a class whose superclass is bottom when it should not be. Consider the following (extreme) situation: class C a => D a where ... instance D [a] => D [a] where ... (dfunD) instance C [a] => C [a] where ... (dfunC) Although this looks wrong (assume D [a] to prove D [a]), it is only a more extreme case of what happens with recursive dictionaries, and it can, just about, make sense because the methods do some work before recursing. To implement the dfunD we must generate code for the superclass C [a], which we had better not get by superclass selection from the supplied argument: dfunD :: forall a. D [a] -> D [a] dfunD = \d::D [a] -> MkD (scsel d) .. Otherwise if we later encounter a situation where we have a [Wanted] dw::D [a] we might solve it thus: dw := dfunD dw Which is all fine except that now ** the superclass C is bottom **! The instance we want is: dfunD :: forall a. D [a] -> D [a] dfunD = \d::D [a] -> MkD (dfunC (scsel d)) ... ----- THE SOLUTION -------- The basic solution is simple: be very careful about using superclass selection to generate a superclass witness in a dictionary function definition. More precisely: Superclass Invariant: in every class dictionary, every superclass dictionary field is non-bottom To achieve the Superclass Invariant, in a dfun definition we can generate a guaranteed-non-bottom superclass witness from: (sc1) one of the dictionary arguments itself (all non-bottom) (sc2) an immediate superclass of a smaller dictionary (sc3) a call of a dfun (always returns a dictionary constructor) The tricky case is (sc2). We proceed by induction on the size of the (type of) the dictionary, defined by TcValidity.sizeTypes. Let's suppose we are building a dictionary of size 3, and suppose the Superclass Invariant holds of smaller dictionaries. Then if we have a smaller dictionary, its immediate superclasses will be non-bottom by induction. What does "we have a smaller dictionary" mean? It might be one of the arguments of the instance, or one of its superclasses. Here is an example, taken from CmmExpr: class Ord r => UserOfRegs r a where ... (i1) instance UserOfRegs r a => UserOfRegs r (Maybe a) where (i2) instance (Ord r, UserOfRegs r CmmReg) => UserOfRegs r CmmExpr where For (i1) we can get the (Ord r) superclass by selection from (UserOfRegs r a), since it is smaller than the thing we are building (UserOfRegs r (Maybe a). But for (i2) that isn't the case, so we must add an explicit, and perhaps surprising, (Ord r) argument to the instance declaration. Here's another example from Trac #6161: class Super a => Duper a where ... class Duper (Fam a) => Foo a where ... (i3) instance Foo a => Duper (Fam a) where ... (i4) instance Foo Float where ... It would be horribly wrong to define dfDuperFam :: Foo a -> Duper (Fam a) -- from (i3) dfDuperFam d = MkDuper (sc_sel1 (sc_sel2 d)) ... dfFooFloat :: Foo Float -- from (i4) dfFooFloat = MkFoo (dfDuperFam dfFooFloat) ... Now the Super superclass of Duper is definitely bottom! This won't happen because when processing (i3) we can use the superclasses of (Foo a), which is smaller, namely Duper (Fam a). But that is *not* smaller than the target so we can't take *its* superclasses. As a result the program is rightly rejected, unless you add (Super (Fam a)) to the context of (i3). Note [Solving superclass constraints] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ How do we ensure that every superclass witness is generated by one of (sc1) (sc2) or (sc3) in Note [Recursive superclases]. Answer: * Superclass "wanted" constraints have CtOrigin of (ScOrigin size) where 'size' is the size of the instance declaration. e.g. class C a => D a where... instance blah => D [a] where ... The wanted superclass constraint for C [a] has origin ScOrigin size, where size = size( D [a] ). * (sc1) When we rewrite such a wanted constraint, it retains its origin. But if we apply an instance declaration, we can set the origin to (ScOrigin infinity), thus lifting any restrictions by making prohibitedSuperClassSolve return False. * (sc2) ScOrigin wanted constraints can't be solved from a superclass selection, except at a smaller type. This test is implemented by TcInteract.prohibitedSuperClassSolve * The "given" constraints of an instance decl have CtOrigin GivenOrigin InstSkol. * When we make a superclass selection from InstSkol we use a SkolemInfo of (InstSC size), where 'size' is the size of the constraint whose superclass we are taking. An similarly when taking the superclass of an InstSC. This is implemented in TcCanonical.newSCWorkFromFlavored Note [Silent superclass arguments] (historical interest only) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NB1: this note describes our *old* solution to the recursive-superclass problem. I'm keeping the Note for now, just as institutional memory. However, the code for silent superclass arguments was removed in late Dec 2014 NB2: the silent-superclass solution introduced new problems of its own, in the form of instance overlap. Tests SilentParametersOverlapping, T5051, and T7862 are examples NB3: the silent-superclass solution also generated tons of extra dictionaries. For example, in monad-transformer code, when constructing a Monad dictionary you had to pass an Applicative dictionary; and to construct that you neede a Functor dictionary. Yet these extra dictionaries were often never used. Test T3064 compiled *far* faster after silent superclasses were eliminated. Our solution to this problem "silent superclass arguments". We pass to each dfun some ``silent superclass arguments’’, which are the immediate superclasses of the dictionary we are trying to construct. In our example: dfun :: forall a. C [a] -> D [a] -> D [a] dfun = \(dc::C [a]) (dd::D [a]) -> DOrd dc ... Notice the extra (dc :: C [a]) argument compared to the previous version. This gives us: ----------------------------------------------------------- DFun Superclass Invariant ~~~~~~~~~~~~~~~~~~~~~~~~ In the body of a DFun, every superclass argument to the returned dictionary is either * one of the arguments of the DFun, or * constant, bound at top level ----------------------------------------------------------- This net effect is that it is safe to treat a dfun application as wrapping a dictionary constructor around its arguments (in particular, a dfun never picks superclasses from the arguments under the dictionary constructor). No superclass is hidden inside a dfun application. The extra arguments required to satisfy the DFun Superclass Invariant always come first, and are called the "silent" arguments. You can find out how many silent arguments there are using Id.dfunNSilent; and then you can just drop that number of arguments to see the ones that were in the original instance declaration. DFun types are built (only) by MkId.mkDictFunId, so that is where we decide what silent arguments are to be added. -} {- ************************************************************************ * * Type-checking an instance method * * ************************************************************************ tcMethod - Make the method bindings, as a [(NonRec, HsBinds)], one per method - Remembering to use fresh Name (the instance method Name) as the binder - Bring the instance method Ids into scope, for the benefit of tcInstSig - Use sig_fn mapping instance method Name -> instance tyvars - Ditto prag_fn - Use tcValBinds to do the checking -} tcMethods :: DFunId -> Class -> [TcTyVar] -> [EvVar] -> [TcType] -> TcEvBinds -> ([Located TcSpecPrag], TcPragEnv) -> [ClassOpItem] -> InstBindings Name -> TcM ([Id], LHsBinds Id, Bag Implication) -- The returned inst_meth_ids all have types starting -- forall tvs. theta => ... tcMethods dfun_id clas tyvars dfun_ev_vars inst_tys dfun_ev_binds prags@(spec_inst_prags,_) op_items (InstBindings { ib_binds = binds , ib_tyvars = lexical_tvs , ib_pragmas = sigs , ib_extensions = exts , ib_derived = is_derived }) = tcExtendTyVarEnv2 (lexical_tvs `zip` tyvars) $ -- The lexical_tvs scope over the 'where' part do { traceTc "tcInstMeth" (ppr sigs $$ ppr binds) ; checkMinimalDefinition ; (ids, binds, mb_implics) <- set_exts exts $ mapAndUnzip3M tc_item op_items ; return (ids, listToBag binds, listToBag (catMaybes mb_implics)) } where set_exts :: [LangExt.Extension] -> TcM a -> TcM a set_exts es thing = foldr setXOptM thing es hs_sig_fn = mkHsSigFun sigs inst_loc = getSrcSpan dfun_id ---------------------- tc_item :: ClassOpItem -> TcM (Id, LHsBind Id, Maybe Implication) tc_item (sel_id, dm_info) | Just (user_bind, bndr_loc) <- findMethodBind (idName sel_id) binds = tcMethodBody clas tyvars dfun_ev_vars inst_tys dfun_ev_binds is_derived hs_sig_fn prags sel_id user_bind bndr_loc | otherwise = do { traceTc "tc_def" (ppr sel_id) ; tc_default sel_id dm_info } ---------------------- tc_default :: Id -> DefMethInfo -> TcM (TcId, LHsBind Id, Maybe Implication) tc_default sel_id (Just (dm_name, GenericDM {})) = do { meth_bind <- mkGenericDefMethBind clas inst_tys sel_id dm_name ; tcMethodBody clas tyvars dfun_ev_vars inst_tys dfun_ev_binds is_derived hs_sig_fn prags sel_id meth_bind inst_loc } tc_default sel_id Nothing -- No default method at all = do { traceTc "tc_def: warn" (ppr sel_id) ; (meth_id, _) <- mkMethIds clas tyvars dfun_ev_vars inst_tys sel_id ; dflags <- getDynFlags ; let meth_bind = mkVarBind meth_id $ mkLHsWrap lam_wrapper (error_rhs dflags) ; return (meth_id, meth_bind, Nothing) } where error_rhs dflags = L inst_loc $ HsApp error_fun (error_msg dflags) error_fun = L inst_loc $ wrapId (mkWpTyApps [ getRuntimeRep "tcInstanceMethods.tc_default" meth_tau , meth_tau]) nO_METHOD_BINDING_ERROR_ID error_msg dflags = L inst_loc (HsLit (HsStringPrim "" (unsafeMkByteString (error_string dflags)))) meth_tau = funResultTy (piResultTys (idType sel_id) inst_tys) error_string dflags = showSDoc dflags (hcat [ppr inst_loc, vbar, ppr sel_id ]) lam_wrapper = mkWpTyLams tyvars <.> mkWpLams dfun_ev_vars tc_default sel_id (Just (dm_name, VanillaDM)) -- A polymorphic default method = do { -- Build the typechecked version directly, -- without calling typecheck_method; -- see Note [Default methods in instances] -- Generate /\as.\ds. let self = df as ds -- in $dm inst_tys self -- The 'let' is necessary only because HsSyn doesn't allow -- you to apply a function to a dictionary *expression*. ; self_dict <- newDict clas inst_tys ; let ev_term = EvDFunApp dfun_id (mkTyVarTys tyvars) (map EvId dfun_ev_vars) self_ev_bind = mkWantedEvBind self_dict ev_term ; (meth_id, local_meth_id) <- mkMethIds clas tyvars dfun_ev_vars inst_tys sel_id ; dm_id <- tcLookupId dm_name ; let dm_inline_prag = idInlinePragma dm_id rhs = HsWrap (mkWpEvVarApps [self_dict] <.> mkWpTyApps inst_tys) $ HsVar (noLoc dm_id) meth_bind = mkVarBind local_meth_id (L inst_loc rhs) meth_id1 = meth_id `setInlinePragma` dm_inline_prag -- Copy the inline pragma (if any) from the default -- method to this version. Note [INLINE and default methods] export = ABE { abe_wrap = idHsWrapper , abe_poly = meth_id1 , abe_mono = local_meth_id , abe_prags = mk_meth_spec_prags meth_id1 spec_inst_prags [] } bind = AbsBinds { abs_tvs = tyvars, abs_ev_vars = dfun_ev_vars , abs_exports = [export] , abs_ev_binds = [EvBinds (unitBag self_ev_bind)] , abs_binds = unitBag meth_bind } -- Default methods in an instance declaration can't have their own -- INLINE or SPECIALISE pragmas. It'd be possible to allow them, but -- currently they are rejected with -- "INLINE pragma lacks an accompanying binding" ; return (meth_id1, L inst_loc bind, Nothing) } ---------------------- -- Check if one of the minimal complete definitions is satisfied checkMinimalDefinition = whenIsJust (isUnsatisfied methodExists (classMinimalDef clas)) $ warnUnsatisfiedMinimalDefinition where methodExists meth = isJust (findMethodBind meth binds) ------------------------ tcMethodBody :: Class -> [TcTyVar] -> [EvVar] -> [TcType] -> TcEvBinds -> Bool -> HsSigFun -> ([LTcSpecPrag], TcPragEnv) -> Id -> LHsBind Name -> SrcSpan -> TcM (TcId, LHsBind Id, Maybe Implication) tcMethodBody clas tyvars dfun_ev_vars inst_tys dfun_ev_binds is_derived sig_fn (spec_inst_prags, prag_fn) sel_id (L bind_loc meth_bind) bndr_loc = add_meth_ctxt $ do { traceTc "tcMethodBody" (ppr sel_id <+> ppr (idType sel_id)) ; (global_meth_id, local_meth_id) <- setSrcSpan bndr_loc $ mkMethIds clas tyvars dfun_ev_vars inst_tys sel_id ; let prags = lookupPragEnv prag_fn (idName sel_id) lm_bind = meth_bind { fun_id = L bndr_loc (idName local_meth_id) } -- Substitute the local_meth_name for the binder -- NB: the binding is always a FunBind ; global_meth_id <- addInlinePrags global_meth_id prags ; spec_prags <- tcSpecPrags global_meth_id prags -- taking instance signature into account might change the type of -- the local_meth_id ; (meth_implic, ev_binds_var, tc_bind) <- checkInstConstraints $ tcMethodBodyHelp sig_fn sel_id local_meth_id (L bind_loc lm_bind) ; let specs = mk_meth_spec_prags global_meth_id spec_inst_prags spec_prags export = ABE { abe_poly = global_meth_id , abe_mono = local_meth_id , abe_wrap = idHsWrapper , abe_prags = specs } local_ev_binds = TcEvBinds ev_binds_var full_bind = AbsBinds { abs_tvs = tyvars , abs_ev_vars = dfun_ev_vars , abs_exports = [export] , abs_ev_binds = [dfun_ev_binds, local_ev_binds] , abs_binds = tc_bind } ; return (global_meth_id, L bind_loc full_bind, Just meth_implic) } where -- For instance decls that come from deriving clauses -- we want to print out the full source code if there's an error -- because otherwise the user won't see the code at all add_meth_ctxt thing | is_derived = addLandmarkErrCtxt (derivBindCtxt sel_id clas inst_tys) thing | otherwise = thing tcMethodBodyHelp :: HsSigFun -> Id -> TcId -> LHsBind Name -> TcM (LHsBinds TcId) tcMethodBodyHelp sig_fn sel_id local_meth_id meth_bind | Just hs_sig_ty <- lookupHsSig sig_fn sel_name -- There is a signature in the instance -- See Note [Instance method signatures] = do { (sig_ty, hs_wrap) <- setSrcSpan (getLoc (hsSigType hs_sig_ty)) $ do { inst_sigs <- xoptM LangExt.InstanceSigs ; checkTc inst_sigs (misplacedInstSig sel_name hs_sig_ty) ; sig_ty <- tcHsSigType (FunSigCtxt sel_name False) hs_sig_ty ; let local_meth_ty = idType local_meth_id ; hs_wrap <- addErrCtxtM (methSigCtxt sel_name sig_ty local_meth_ty) $ tcSubType ctxt (Just sel_id) sig_ty (mkCheckExpType local_meth_ty) ; return (sig_ty, hs_wrap) } ; inner_meth_name <- newName (nameOccName sel_name) ; tc_sig <- instTcTySig ctxt hs_sig_ty sig_ty inner_meth_name ; (tc_bind, [inner_id]) <- tcPolyCheck NonRecursive no_prag_fn tc_sig meth_bind ; let export = ABE { abe_poly = local_meth_id , abe_mono = inner_id , abe_wrap = hs_wrap , abe_prags = noSpecPrags } ; return (unitBag $ L (getLoc meth_bind) $ AbsBinds { abs_tvs = [], abs_ev_vars = [] , abs_exports = [export] , abs_binds = tc_bind, abs_ev_binds = [] }) } | otherwise -- No instance signature = do { tc_sig <- instTcTySigFromId local_meth_id -- Absent a type sig, there are no new scoped type variables here -- Only the ones from the instance decl itself, which are already -- in scope. Example: -- class C a where { op :: forall b. Eq b => ... } -- instance C [c] where { op = <rhs> } -- In <rhs>, 'c' is scope but 'b' is not! ; (tc_bind, _) <- tcPolyCheck NonRecursive no_prag_fn tc_sig meth_bind ; return tc_bind } where ctxt = FunSigCtxt sel_name True sel_name = idName sel_id no_prag_fn = emptyPragEnv -- No pragmas for local_meth_id; -- they are all for meth_id ------------------------ mkMethIds :: Class -> [TcTyVar] -> [EvVar] -> [TcType] -> Id -> TcM (TcId, TcId) -- returns (poly_id, local_id), but ignoring any instance signature -- See Note [Instance method signatures] mkMethIds clas tyvars dfun_ev_vars inst_tys sel_id = do { poly_meth_name <- newName (mkClassOpAuxOcc sel_occ) ; local_meth_name <- newName sel_occ -- Base the local_meth_name on the selector name, because -- type errors from tcMethodBody come from here ; let poly_meth_id = mkLocalId poly_meth_name poly_meth_ty local_meth_id = mkLocalId local_meth_name local_meth_ty ; return (poly_meth_id, local_meth_id) } where sel_name = idName sel_id sel_occ = nameOccName sel_name local_meth_ty = instantiateMethod clas sel_id inst_tys poly_meth_ty = mkSpecSigmaTy tyvars theta local_meth_ty theta = map idType dfun_ev_vars methSigCtxt :: Name -> TcType -> TcType -> TidyEnv -> TcM (TidyEnv, MsgDoc) methSigCtxt sel_name sig_ty meth_ty env0 = do { (env1, sig_ty) <- zonkTidyTcType env0 sig_ty ; (env2, meth_ty) <- zonkTidyTcType env1 meth_ty ; let msg = hang (text "When checking that instance signature for" <+> quotes (ppr sel_name)) 2 (vcat [ text "is more general than its signature in the class" , text "Instance sig:" <+> ppr sig_ty , text " Class sig:" <+> ppr meth_ty ]) ; return (env2, msg) } misplacedInstSig :: Name -> LHsSigType Name -> SDoc misplacedInstSig name hs_ty = vcat [ hang (text "Illegal type signature in instance declaration:") 2 (hang (pprPrefixName name) 2 (dcolon <+> ppr hs_ty)) , text "(Use InstanceSigs to allow this)" ] {- Note [Instance method signatures] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ With -XInstanceSigs we allow the user to supply a signature for the method in an instance declaration. Here is an artificial example: data T a = MkT a instance Ord a => Ord (T a) where (>) :: forall b. b -> b -> Bool (>) = error "You can't compare Ts" The instance signature can be *more* polymorphic than the instantiated class method (in this case: Age -> Age -> Bool), but it cannot be less polymorphic. Moreover, if a signature is given, the implementation code should match the signature, and type variables bound in the singature should scope over the method body. We achieve this by building a TcSigInfo for the method, whether or not there is an instance method signature, and using that to typecheck the declaration (in tcMethodBody). That means, conveniently, that the type variables bound in the signature will scope over the body. What about the check that the instance method signature is more polymorphic than the instantiated class method type? We just do a tcSubType call in tcMethodBodyHelp, and generate a nested AbsBind, like this (for the example above AbsBind { abs_tvs = [a], abs_ev_vars = [d:Ord a] , abs_exports = ABExport { (>) :: forall a. Ord a => T a -> T a -> Bool , gr_lcl :: T a -> T a -> Bool } , abs_binds = AbsBind { abs_tvs = [], abs_ev_vars = [] , abs_exports = ABExport { gr_lcl :: T a -> T a -> Bool , gr_inner :: forall b. b -> b -> Bool } , abs_binds = AbsBind { abs_tvs = [b], abs_ev_vars = [] , ..etc.. } } } Wow! Three nested AbsBinds! * The outer one abstracts over the tyvars and dicts for the instance * The middle one is only present if there is an instance signature, and does the impedance matching for that signature * The inner one is for the method binding itself against either the signature from the class, or the the instance signature. -} ---------------------- mk_meth_spec_prags :: Id -> [LTcSpecPrag] -> [LTcSpecPrag] -> TcSpecPrags -- Adapt the 'SPECIALISE instance' pragmas to work for this method Id -- There are two sources: -- * spec_prags_for_me: {-# SPECIALISE op :: <blah> #-} -- * spec_prags_from_inst: derived from {-# SPECIALISE instance :: <blah> #-} -- These ones have the dfun inside, but [perhaps surprisingly] -- the correct wrapper. -- See Note [Handling SPECIALISE pragmas] in TcBinds mk_meth_spec_prags meth_id spec_inst_prags spec_prags_for_me = SpecPrags (spec_prags_for_me ++ spec_prags_from_inst) where spec_prags_from_inst | isInlinePragma (idInlinePragma meth_id) = [] -- Do not inherit SPECIALISE from the instance if the -- method is marked INLINE, because then it'll be inlined -- and the specialisation would do nothing. (Indeed it'll provoke -- a warning from the desugarer | otherwise = [ L inst_loc (SpecPrag meth_id wrap inl) | L inst_loc (SpecPrag _ wrap inl) <- spec_inst_prags] mkGenericDefMethBind :: Class -> [Type] -> Id -> Name -> TcM (LHsBind Name) mkGenericDefMethBind clas inst_tys sel_id dm_name = -- A generic default method -- If the method is defined generically, we only have to call the -- dm_name. do { dflags <- getDynFlags ; liftIO (dumpIfSet_dyn dflags Opt_D_dump_deriv "Filling in method body" (vcat [ppr clas <+> ppr inst_tys, nest 2 (ppr sel_id <+> equals <+> ppr rhs)])) ; return (noLoc $ mkTopFunBind Generated (noLoc (idName sel_id)) [mkSimpleMatch [] rhs]) } where rhs = nlHsVar dm_name ---------------------- derivBindCtxt :: Id -> Class -> [Type ] -> SDoc derivBindCtxt sel_id clas tys = vcat [ text "When typechecking the code for" <+> quotes (ppr sel_id) , nest 2 (text "in a derived instance for" <+> quotes (pprClassPred clas tys) <> colon) , nest 2 $ text "To see the code I am typechecking, use -ddump-deriv" ] warnUnsatisfiedMinimalDefinition :: ClassMinimalDef -> TcM () warnUnsatisfiedMinimalDefinition mindef = do { warn <- woptM Opt_WarnMissingMethods ; warnTc (Reason Opt_WarnMissingMethods) warn message } where message = vcat [text "No explicit implementation for" ,nest 2 $ pprBooleanFormulaNice mindef ] {- Note [Export helper functions] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We arrange to export the "helper functions" of an instance declaration, so that they are not subject to preInlineUnconditionally, even if their RHS is trivial. Reason: they are mentioned in the DFunUnfolding of the dict fun as Ids, not as CoreExprs, so we can't substitute a non-variable for them. We could change this by making DFunUnfoldings have CoreExprs, but it seems a bit simpler this way. Note [Default methods in instances] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider this class Baz v x where foo :: x -> x foo y = <blah> instance Baz Int Int From the class decl we get $dmfoo :: forall v x. Baz v x => x -> x $dmfoo y = <blah> Notice that the type is ambiguous. That's fine, though. The instance decl generates $dBazIntInt = MkBaz fooIntInt fooIntInt = $dmfoo Int Int $dBazIntInt BUT this does mean we must generate the dictionary translation of fooIntInt directly, rather than generating source-code and type-checking it. That was the bug in Trac #1061. In any case it's less work to generate the translated version! Note [INLINE and default methods] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Default methods need special case. They are supposed to behave rather like macros. For exmample class Foo a where op1, op2 :: Bool -> a -> a {-# INLINE op1 #-} op1 b x = op2 (not b) x instance Foo Int where -- op1 via default method op2 b x = <blah> The instance declaration should behave just as if 'op1' had been defined with the code, and INLINE pragma, from its original definition. That is, just as if you'd written instance Foo Int where op2 b x = <blah> {-# INLINE op1 #-} op1 b x = op2 (not b) x So for the above example we generate: {-# INLINE $dmop1 #-} -- $dmop1 has an InlineCompulsory unfolding $dmop1 d b x = op2 d (not b) x $fFooInt = MkD $cop1 $cop2 {-# INLINE $cop1 #-} $cop1 = $dmop1 $fFooInt $cop2 = <blah> Note carefully: * We *copy* any INLINE pragma from the default method $dmop1 to the instance $cop1. Otherwise we'll just inline the former in the latter and stop, which isn't what the user expected * Regardless of its pragma, we give the default method an unfolding with an InlineCompulsory source. That means that it'll be inlined at every use site, notably in each instance declaration, such as $cop1. This inlining must happen even though a) $dmop1 is not saturated in $cop1 b) $cop1 itself has an INLINE pragma It's vital that $dmop1 *is* inlined in this way, to allow the mutual recursion between $fooInt and $cop1 to be broken * To communicate the need for an InlineCompulsory to the desugarer (which makes the Unfoldings), we use the IsDefaultMethod constructor in TcSpecPrags. ************************************************************************ * * Specialise instance pragmas * * ************************************************************************ Note [SPECIALISE instance pragmas] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider instance (Ix a, Ix b) => Ix (a,b) where {-# SPECIALISE instance Ix (Int,Int) #-} range (x,y) = ... We make a specialised version of the dictionary function, AND specialised versions of each *method*. Thus we should generate something like this: $dfIxPair :: (Ix a, Ix b) => Ix (a,b) {-# DFUN [$crangePair, ...] #-} {-# SPECIALISE $dfIxPair :: Ix (Int,Int) #-} $dfIxPair da db = Ix ($crangePair da db) (...other methods...) $crange :: (Ix a, Ix b) -> ((a,b),(a,b)) -> [(a,b)] {-# SPECIALISE $crange :: ((Int,Int),(Int,Int)) -> [(Int,Int)] #-} $crange da db = <blah> The SPECIALISE pragmas are acted upon by the desugarer, which generate dii :: Ix Int dii = ... $s$dfIxPair :: Ix ((Int,Int),(Int,Int)) {-# DFUN [$crangePair di di, ...] #-} $s$dfIxPair = Ix ($crangePair di di) (...) {-# RULE forall (d1,d2:Ix Int). $dfIxPair Int Int d1 d2 = $s$dfIxPair #-} $s$crangePair :: ((Int,Int),(Int,Int)) -> [(Int,Int)] $c$crangePair = ...specialised RHS of $crangePair... {-# RULE forall (d1,d2:Ix Int). $crangePair Int Int d1 d2 = $s$crangePair #-} Note that * The specialised dictionary $s$dfIxPair is very much needed, in case we call a function that takes a dictionary, but in a context where the specialised dictionary can be used. See Trac #7797. * The ClassOp rule for 'range' works equally well on $s$dfIxPair, because it still has a DFunUnfolding. See Note [ClassOp/DFun selection] * A call (range ($dfIxPair Int Int d1 d2)) might simplify two ways: --> {ClassOp rule for range} $crangePair Int Int d1 d2 --> {SPEC rule for $crangePair} $s$crangePair or thus: --> {SPEC rule for $dfIxPair} range $s$dfIxPair --> {ClassOpRule for range} $s$crangePair It doesn't matter which way. * We want to specialise the RHS of both $dfIxPair and $crangePair, but the SAME HsWrapper will do for both! We can call tcSpecPrag just once, and pass the result (in spec_inst_info) to tcMethods. -} tcSpecInstPrags :: DFunId -> InstBindings Name -> TcM ([Located TcSpecPrag], TcPragEnv) tcSpecInstPrags dfun_id (InstBindings { ib_binds = binds, ib_pragmas = uprags }) = do { spec_inst_prags <- mapM (wrapLocM (tcSpecInst dfun_id)) $ filter isSpecInstLSig uprags -- The filter removes the pragmas for methods ; return (spec_inst_prags, mkPragEnv uprags binds) } ------------------------------ tcSpecInst :: Id -> Sig Name -> TcM TcSpecPrag tcSpecInst dfun_id prag@(SpecInstSig _ hs_ty) = addErrCtxt (spec_ctxt prag) $ do { (tyvars, theta, clas, tys) <- tcHsClsInstType SpecInstCtxt hs_ty ; let spec_dfun_ty = mkDictFunTy tyvars theta clas tys ; co_fn <- tcSpecWrapper SpecInstCtxt (idType dfun_id) spec_dfun_ty ; return (SpecPrag dfun_id co_fn defaultInlinePragma) } where spec_ctxt prag = hang (text "In the SPECIALISE pragma") 2 (ppr prag) tcSpecInst _ _ = panic "tcSpecInst" {- ************************************************************************ * * \subsection{Error messages} * * ************************************************************************ -} instDeclCtxt1 :: LHsSigType Name -> SDoc instDeclCtxt1 hs_inst_ty = inst_decl_ctxt (ppr (getLHsInstDeclHead hs_inst_ty)) instDeclCtxt2 :: Type -> SDoc instDeclCtxt2 dfun_ty = inst_decl_ctxt (ppr (mkClassPred cls tys)) where (_,_,cls,tys) = tcSplitDFunTy dfun_ty inst_decl_ctxt :: SDoc -> SDoc inst_decl_ctxt doc = hang (text "In the instance declaration for") 2 (quotes doc) badBootFamInstDeclErr :: SDoc badBootFamInstDeclErr = text "Illegal family instance in hs-boot file" notFamily :: TyCon -> SDoc notFamily tycon = vcat [ text "Illegal family instance for" <+> quotes (ppr tycon) , nest 2 $ parens (ppr tycon <+> text "is not an indexed type family")] tooFewParmsErr :: Arity -> SDoc tooFewParmsErr arity = text "Family instance has too few parameters; expected" <+> ppr arity assocInClassErr :: Located Name -> SDoc assocInClassErr name = text "Associated type" <+> quotes (ppr name) <+> text "must be inside a class instance" badFamInstDecl :: Located Name -> SDoc badFamInstDecl tc_name = vcat [ text "Illegal family instance for" <+> quotes (ppr tc_name) , nest 2 (parens $ text "Use TypeFamilies to allow indexed type families") ] notOpenFamily :: TyCon -> SDoc notOpenFamily tc = text "Illegal instance for closed family" <+> quotes (ppr tc)
oldmanmike/ghc
compiler/typecheck/TcInstDcls.hs
bsd-3-clause
77,420
5
25
23,694
8,645
4,567
4,078
656
5
-- | This module defines control flow graphs over the LLVM IR. module LLVM.Analysis.CFG ( -- * Types CFG, HasCFG(..), -- * Constructors controlFlowGraph, -- * Accessors basicBlockPredecessors, basicBlockSuccessors ) where import LLVM.Analysis.CFG.Internal
wangxiayang/llvm-analysis
src/LLVM/Analysis/CFG.hs
bsd-3-clause
275
0
5
52
39
28
11
7
0
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances, FlexibleContexts, EmptyDataDecls, ScopedTypeVariables, TypeOperators, TypeSynonymInstances #-} {- In this module we define the basic building blocks -} module Records where data EmptyRecord = EmptyRecord deriving (Show, Eq) data AddField e l = AddField e l deriving (Show, Eq) infixr 8 :* type e :* l = AddField e l class Record e instance Record EmptyRecord instance Record l => Record (AddField e l) data Z = Z data S a = S a class CNum e instance CNum Z instance CNum a => CNum (S a) class CNum n => HasField n e l where (.!) :: l -> n -> e (.@) :: (l,n) -> e -> l instance HasField Z e (e :* l) where (AddField e _) .! Z = e ((AddField e l),Z) .@ e' = (AddField e' l) instance HasField n e l => HasField (S n) e (e' :* l) where (AddField _ l) .! (S n) = l .! n ((AddField e l),(S n)) .@ e' = (AddField e ((l,n) .@ e')) class CNum n => Length n r instance Length Z EmptyRecord instance Length n r => Length (S n) (AddField e r) infixr 8 .* (.*) :: e -> r -> (e :* r) e .* r = AddField e r infixl 9 .= (.=) :: CNum n => n -> e -> e _ .= e = e firstLabel = Z nextLabel = S firstLabel' :: forall e l . HasField Z e l => (Z, l -> e, l -> e -> l) firstLabel' = (Z, (\s -> s .! Z), (\s -> \x -> (s,Z) .@ x)) nextLabel'' :: forall n' n e l . (CNum n,HasField (S n) e l) => n -> (S n, l -> e, l -> e -> l) nextLabel'' n = let n' = S n in (n', (\s -> s .! n'), (\s -> \x -> (s,n') .@ x)) nextLabel' (x,_,_) = nextLabel'' x {- Example key = firstLabel name = nextLabel key test :: Int :* String :* EmptyRecord test = key .= 10 .* name .= "Pippo" .* EmptyRecord res :: Int res = test .! key res1 :: Int :* String :* EmptyRecord res1 = (test,key) .@ 20 -}
vs-team/Papers
Before Giuseppe's PhD/Monads/ObjectiveMonad/MonadicObjects/trunk/Src/Records.hs
mit
1,896
0
12
525
790
423
367
-1
-1
{-# LANGUAGE RecursiveDo #-} module InnerEar.Widgets.Login where import Reflex import Reflex.Dom import Control.Monad import InnerEar.Types.Request import InnerEar.Types.Response import InnerEar.Types.Handle import InnerEar.Types.Utility import InnerEar.Types.User -- | A loginWidget appears as a single line in the interface. It displays a -- set of text fields and button if the user is not logged in. If the user -- is logged in it displays that, as well as a button to log out. -- needs to only rebuild when status changes!!! loginWidget :: MonadWidget t m => Event t [Response] -> m (Event t Request, Dynamic t (Maybe Role)) loginWidget responses = elClass "div" "loginWidget" $ mdo let initialWidget = notLoggedInWidget responses let p x = ( x == NotAuthenticated || isAuthenticated x) let newStatus = fmapMaybe (lastWithPredicate p) responses -- status <- updated <$> nubDyn <$> holdDyn NotAuthenticated newStatus let authEvents = fmapMaybe getHandleFromAuthenticated $ ffilter (isAuthenticated) status let buildLoggedIn = fmap (loggedInWidget responses) authEvents -- let notAuthEvents = ffilter (==NotAuthenticated) status let buildTryToLogIn = fmap (const $ tryToLoginWidget responses) goToLogin let deAuthEvents = ffilter (==Deauthenticate) r let buildNotLoggedIn = fmap (const $ notLoggedInWidget responses) deAuthEvents let rebuildEvents = leftmost [buildLoggedIn,buildNotLoggedIn,buildTryToLogIn] x <- widgetHold initialWidget rebuildEvents r <- switchPromptlyDyn <$> mapDyn fst x goToLogin <- switchPromptlyDyn <$> mapDyn snd x let newRole = fmap getRoleFromResponse newStatus currentRole <- holdDyn Nothing newRole -- areTheyAuthenticated <- holdDyn NotAuthenticated newStatus >>= mapDyn (not . (==NotAuthenticated)) return (r,currentRole) getRoleFromResponse :: Response -> Maybe Role getRoleFromResponse (Authenticated _ r) = Just r getRoleFromResponse (NotAuthenticated) = Nothing getRoleFromResponse _ = error "getRoleFromResponse shouldn't be called with anything other than Authenticated or NotAuthenticated" tryToLoginWidget :: MonadWidget t m => Event t [Response] -> m (Event t Request,Event t ()) tryToLoginWidget responses = do handleEntry <- do text "Username:" _textInput_value <$> (textInput $ def) passwordEntry <- do text "Password: " _textInput_value <$> (textInput $ def & textInputConfig_inputType .~ "password") loginButton <- button "Login" -- when they fail to authenticate, display a message to that effect let deauthEvent = fmapMaybe (lastWithPredicate (==NotAuthenticated)) responses deauthText <- holdDyn "" $ fmap (const " Incorrect login!") deauthEvent dynText deauthText loginValue <- combineDyn Authenticate handleEntry passwordEntry return (tagDyn loginValue loginButton,never) loggedInWidget :: MonadWidget t m => Event t [Response] -> Handle -> m (Event t Request,Event t ()) loggedInWidget _ h = do text $ "Logged in as " ++ h r <- (Deauthenticate <$) <$> button "Logout" return (r,never) notLoggedInWidget :: MonadWidget t m => Event t [Response] -> m (Event t Request,Event t ()) notLoggedInWidget _ = do r <- button "Login" return (never,r)
d0kt0r0/InnerEar
src/InnerEar/Widgets/Login.hs
gpl-3.0
3,187
0
14
514
863
419
444
56
1
{-# language TypeSynonymInstances, FlexibleInstances #-} module Base.Debugging ( DebuggingCommand, resetDebugging, addDebugging, getDebugging, debugPoint, debugLine, ) where import Data.Initial import Data.IORef import Data.Abelian import System.IO.Unsafe import Graphics.Qt import Physics.Chipmunk import Base.Types type DebuggingCommand = (Ptr QPainter -> Offset Double -> IO ()) instance Initial DebuggingCommand where initial _ _ = return () (<>) :: DebuggingCommand -> DebuggingCommand -> DebuggingCommand a <> b = \ ptr offset -> a ptr offset >> b ptr offset {-# NOINLINE debuggingCommandRef #-} debuggingCommandRef :: IORef DebuggingCommand debuggingCommandRef = unsafePerformIO $ newIORef initial resetDebugging :: IO () resetDebugging = writeIORef debuggingCommandRef initial addDebugging :: DebuggingCommand -> IO () addDebugging cmd = modifyIORef debuggingCommandRef (<> cmd) getDebugging :: IO DebuggingCommand getDebugging = readIORef debuggingCommandRef -- * convenience debugPoint :: Color -> Vector -> IO () debugPoint color p = addDebugging $ \ ptr offset -> do resetMatrix ptr translate ptr offset setPenColor ptr color 1 let point = vector2position p len = 5 slashDistance = Position len (- len) backSlashDistance = Position len len drawLine ptr (point -~ slashDistance) (point +~ slashDistance) drawLine ptr (point -~ backSlashDistance) (point +~ backSlashDistance) debugLine :: Color -> Vector -> Vector -> IO () debugLine color a b = addDebugging $ \ ptr offset -> do resetMatrix ptr translate ptr offset setPenColor ptr color 4 drawLine ptr (vector2position a) (vector2position b)
geocurnoff/nikki
src/Base/Debugging.hs
lgpl-3.0
1,717
0
14
333
495
252
243
46
1
{-# OPTIONS_GHC -fno-warn-unused-do-bind -fno-warn-missing-signatures #-} {-# LANGUAGE OverloadedStrings #-} module Main where import qualified Data.Text as T import Control.Concurrent (forkIO, threadDelay) import Control.Monad (forever) import System.Exit ( exitSuccess ) import Graphics.Vty import Graphics.Vty.Widgets.All -- Visual attributes. focAttr = black `on` green bodyAttr = brightGreen `on` black completeAttr = white `on` red incompleteAttr = red `on` white setupProgessBar :: IO (Widget ProgressBar) setupProgessBar = do pb <- newProgressBar completeAttr incompleteAttr setProgressTextAlignment pb AlignCenter pb `onProgressChange` \val -> setProgressText pb $ T.pack $ "Progress (" ++ show val ++ " %)" return pb setupProgressBarThread :: Widget ProgressBar -> IO () setupProgressBarThread pb = do forkIO $ forever $ do let act i = do threadDelay $ 1 * 1000 * 1000 schedule $ setProgress pb (i `mod` 101) act $ i + 4 act 0 return () setupDialog :: (Show a) => Widget a -> IO (Dialog, Widget FocusGroup) setupDialog ui = do (dlg, fg) <- newDialog ui "Progress Bar Demo" dlg `onDialogAccept` const exitSuccess dlg `onDialogCancel` const exitSuccess return (dlg, fg) main :: IO () main = do pb <- setupProgessBar setupProgressBarThread pb (dlg, dlgFg) <- setupDialog pb c <- newCollection _ <- addToCollection c (dialogWidget dlg) dlgFg runUi c $ defaultContext { normalAttr = bodyAttr , focusAttr = focAttr }
KommuSoft/vty-ui
demos/ProgressBarDemo.hs
bsd-3-clause
1,563
0
18
352
486
251
235
44
1
module Elm.Compiler.Imports (defaults) where import qualified AST.Module as Module import qualified AST.Variable as Var -- DEFAULT IMPORTS (==>) :: a -> b -> (a,b) (==>) = (,) defaults :: [Module.DefaultImport] defaults = [ ["Basics"] ==> Module.ImportMethod Nothing Var.openListing , ["Debug"] ==> Module.ImportMethod Nothing Var.closedListing , ["List"] ==> exposing [Var.Value "::"] , ["Maybe"] ==> exposing [Var.Union "Maybe" Var.openListing] , ["Result"] ==> exposing [Var.Union "Result" Var.openListing] , ["Signal"] ==> exposing [Var.Alias "Signal"] ] exposing :: [Var.Value] -> Module.ImportMethod exposing vars = Module.ImportMethod Nothing (Var.listing vars)
5outh/Elm
src/Elm/Compiler/Imports.hs
bsd-3-clause
707
0
10
121
244
138
106
16
1
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="ru-RU"> <title> AJAX Паук | ZAP-расширения </title> <maps> <homeID>top</homeID> <mapref location="map.jhm"/> </maps> <view> <name>TOC</name> <label>Содержание</label> <type>org.zaproxy.zap.extension.help.ZapTocView</type> <data>toc.xml</data> </view> <view> <name>Index</name> <label>Индекс</label> <type>javax.help.IndexView</type> <data>index.xml</data> </view> <view> <name>Search</name> <label>Поиск</label> <type>javax.help.SearchView</type> <data engine="com.sun.java.help.search.DefaultSearchEngine"> JavaHelpSearch </data> </view> <view> <name>Favorites</name> <label>Избранное</label> <type>javax.help.FavoritesView</type> </view> </helpset>
thc202/zap-extensions
addOns/spiderAjax/src/main/javahelp/org/zaproxy/zap/extension/spiderAjax/resources/help_ru_RU/helpset_ru_RU.hs
apache-2.0
1,019
78
67
160
496
248
248
-1
-1
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="hr-HR"> <title>Selenium add-on</title> <maps> <homeID>top</homeID> <mapref location="map.jhm"/> </maps> <view> <name>TOC</name> <label>Contents</label> <type>org.zaproxy.zap.extension.help.ZapTocView</type> <data>toc.xml</data> </view> <view> <name>Index</name> <label>Index</label> <type>javax.help.IndexView</type> <data>index.xml</data> </view> <view> <name>Search</name> <label>Search</label> <type>javax.help.SearchView</type> <data engine="com.sun.java.help.search.DefaultSearchEngine"> JavaHelpSearch </data> </view> <view> <name>Favorites</name> <label>Favorites</label> <type>javax.help.FavoritesView</type> </view> </helpset>
thc202/zap-extensions
addOns/selenium/src/main/javahelp/org/zaproxy/zap/extension/selenium/resources/help_hr_HR/helpset_hr_HR.hs
apache-2.0
960
77
67
156
411
208
203
-1
-1
-- -- Must have rules off to avoid them making it look lazy when it isn't really -- import Control.Monad import System.Exit import Test.HUnit import qualified Data.ByteString.Lazy as L ------------------------------------------------------------------------ -- The entry point main :: IO () main = do counts <- runTestTT tests when ((errors counts, failures counts) /= (0, 0)) $ exitWith (ExitFailure 1) tests :: Test tests = TestList [append_tests] append_tests :: Test append_tests = TestLabel "append" $ TestList [ TestLabel "lazy tail" $ TestCase $ L.head (L.pack [38] `L.append` error "Tail should be lazy") @=? 38 ]
meiersi/bytestring-builder
tests/Units.hs
bsd-3-clause
668
0
14
138
180
97
83
14
1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[NameEnv]{@NameEnv@: name environments} -} {-# LANGUAGE CPP #-} module NameEnv ( -- * Var, Id and TyVar environments (maps) NameEnv, -- ** Manipulating these environments mkNameEnv, emptyNameEnv, isEmptyNameEnv, unitNameEnv, nameEnvElts, extendNameEnv_C, extendNameEnv_Acc, extendNameEnv, extendNameEnvList, extendNameEnvList_C, filterNameEnv, anyNameEnv, plusNameEnv, plusNameEnv_C, alterNameEnv, lookupNameEnv, lookupNameEnv_NF, delFromNameEnv, delListFromNameEnv, elemNameEnv, mapNameEnv, disjointNameEnv, DNameEnv, emptyDNameEnv, lookupDNameEnv, mapDNameEnv, alterDNameEnv, -- ** Dependency analysis depAnal ) where #include "HsVersions.h" import GhcPrelude import Digraph import Name import UniqFM import UniqDFM import Maybes {- ************************************************************************ * * \subsection{Name environment} * * ************************************************************************ -} {- Note [depAnal determinism] ~~~~~~~~~~~~~~~~~~~~~~~~~~ depAnal is deterministic provided it gets the nodes in a deterministic order. The order of lists that get_defs and get_uses return doesn't matter, as these are only used to construct the edges, and stronglyConnCompFromEdgedVertices is deterministic even when the edges are not in deterministic order as explained in Note [Deterministic SCC] in Digraph. -} depAnal :: (node -> [Name]) -- Defs -> (node -> [Name]) -- Uses -> [node] -> [SCC node] -- Perform dependency analysis on a group of definitions, -- where each definition may define more than one Name -- -- The get_defs and get_uses functions are called only once per node depAnal get_defs get_uses nodes = stronglyConnCompFromEdgedVerticesUniq (map mk_node keyed_nodes) where keyed_nodes = nodes `zip` [(1::Int)..] mk_node (node, key) = DigraphNode node key (mapMaybe (lookupNameEnv key_map) (get_uses node)) key_map :: NameEnv Int -- Maps a Name to the key of the decl that defines it key_map = mkNameEnv [(name,key) | (node, key) <- keyed_nodes, name <- get_defs node] {- ************************************************************************ * * \subsection{Name environment} * * ************************************************************************ -} -- | Name Environment type NameEnv a = UniqFM a -- Domain is Name emptyNameEnv :: NameEnv a isEmptyNameEnv :: NameEnv a -> Bool mkNameEnv :: [(Name,a)] -> NameEnv a nameEnvElts :: NameEnv a -> [a] alterNameEnv :: (Maybe a-> Maybe a) -> NameEnv a -> Name -> NameEnv a extendNameEnv_C :: (a->a->a) -> NameEnv a -> Name -> a -> NameEnv a extendNameEnv_Acc :: (a->b->b) -> (a->b) -> NameEnv b -> Name -> a -> NameEnv b extendNameEnv :: NameEnv a -> Name -> a -> NameEnv a plusNameEnv :: NameEnv a -> NameEnv a -> NameEnv a plusNameEnv_C :: (a->a->a) -> NameEnv a -> NameEnv a -> NameEnv a extendNameEnvList :: NameEnv a -> [(Name,a)] -> NameEnv a extendNameEnvList_C :: (a->a->a) -> NameEnv a -> [(Name,a)] -> NameEnv a delFromNameEnv :: NameEnv a -> Name -> NameEnv a delListFromNameEnv :: NameEnv a -> [Name] -> NameEnv a elemNameEnv :: Name -> NameEnv a -> Bool unitNameEnv :: Name -> a -> NameEnv a lookupNameEnv :: NameEnv a -> Name -> Maybe a lookupNameEnv_NF :: NameEnv a -> Name -> a filterNameEnv :: (elt -> Bool) -> NameEnv elt -> NameEnv elt anyNameEnv :: (elt -> Bool) -> NameEnv elt -> Bool mapNameEnv :: (elt1 -> elt2) -> NameEnv elt1 -> NameEnv elt2 disjointNameEnv :: NameEnv a -> NameEnv a -> Bool nameEnvElts x = eltsUFM x emptyNameEnv = emptyUFM isEmptyNameEnv = isNullUFM unitNameEnv x y = unitUFM x y extendNameEnv x y z = addToUFM x y z extendNameEnvList x l = addListToUFM x l lookupNameEnv x y = lookupUFM x y alterNameEnv = alterUFM mkNameEnv l = listToUFM l elemNameEnv x y = elemUFM x y plusNameEnv x y = plusUFM x y plusNameEnv_C f x y = plusUFM_C f x y extendNameEnv_C f x y z = addToUFM_C f x y z mapNameEnv f x = mapUFM f x extendNameEnv_Acc x y z a b = addToUFM_Acc x y z a b extendNameEnvList_C x y z = addListToUFM_C x y z delFromNameEnv x y = delFromUFM x y delListFromNameEnv x y = delListFromUFM x y filterNameEnv x y = filterUFM x y anyNameEnv f x = foldUFM ((||) . f) False x disjointNameEnv x y = isNullUFM (intersectUFM x y) lookupNameEnv_NF env n = expectJust "lookupNameEnv_NF" (lookupNameEnv env n) -- | Deterministic Name Environment -- -- See Note [Deterministic UniqFM] in UniqDFM for explanation why we need -- DNameEnv. type DNameEnv a = UniqDFM a emptyDNameEnv :: DNameEnv a emptyDNameEnv = emptyUDFM lookupDNameEnv :: DNameEnv a -> Name -> Maybe a lookupDNameEnv = lookupUDFM mapDNameEnv :: (a -> b) -> DNameEnv a -> DNameEnv b mapDNameEnv = mapUDFM alterDNameEnv :: (Maybe a -> Maybe a) -> DNameEnv a -> Name -> DNameEnv a alterDNameEnv = alterUDFM
shlevy/ghc
compiler/basicTypes/NameEnv.hs
bsd-3-clause
5,538
0
11
1,473
1,327
698
629
89
1
----------------------------------------------------------------------------- -- | -- Module : Graphics.Plot -- Copyright : (c) Alberto Ruiz 2005-8 -- License : GPL-style -- -- Maintainer : Alberto Ruiz (aruiz at um dot es) -- Stability : provisional -- Portability : uses gnuplot and ImageMagick -- -- This module is deprecated. It can be replaced by improved drawing tools -- available in the plot\\plot-gtk packages by Vivian McPhail or Gnuplot by Henning Thielemann. ----------------------------------------------------------------------------- module Graphics.Plot( mplot, plot, parametricPlot, splot, mesh, meshdom, matrixToPGM, imshow, gnuplotX, gnuplotpdf, gnuplotWin ) where import Numeric.Container import Data.List(intersperse) import System.Process (system) -- | From vectors x and y, it generates a pair of matrices to be used as x and y arguments for matrix functions. meshdom :: Vector Double -> Vector Double -> (Matrix Double , Matrix Double) meshdom r1 r2 = (outer r1 (constant 1 (dim r2)), outer (constant 1 (dim r1)) r2) {- | Draws a 3D surface representation of a real matrix. > > mesh $ build (10,10) (\\i j -> i + (j-5)^2) In certain versions you can interactively rotate the graphic using the mouse. -} mesh :: Matrix Double -> IO () mesh m = gnuplotX (command++dat) where command = "splot "++datafollows++" matrix with lines\n" dat = prep $ toLists m {- | Draws the surface represented by the function f in the desired ranges and number of points, internally using 'mesh'. > > let f x y = cos (x + y) > > splot f (0,pi) (0,2*pi) 50 -} splot :: (Matrix Double->Matrix Double->Matrix Double) -> (Double,Double) -> (Double,Double) -> Int -> IO () splot f rx ry n = mesh z where (x,y) = meshdom (linspace n rx) (linspace n ry) z = f x y {- | plots several vectors against the first one > > let t = linspace 100 (-3,3) in mplot [t, sin t, exp (-t^2)] -} mplot :: [Vector Double] -> IO () mplot m = gnuplotX (commands++dats) where commands = if length m == 1 then command1 else commandmore command1 = "plot "++datafollows++" with lines\n" ++ dat commandmore = "plot " ++ plots ++ "\n" plots = concat $ intersperse ", " (map cmd [2 .. length m]) cmd k = datafollows++" using 1:"++show k++" with lines" dat = prep $ toLists $ fromColumns m dats = concat (replicate (length m-1) dat) {- | Draws a list of functions over a desired range and with a desired number of points > > plot [sin, cos, sin.(3*)] (0,2*pi) 1000 -} plot :: [Vector Double->Vector Double] -> (Double,Double) -> Int -> IO () plot fs rx n = mplot (x: mapf fs x) where x = linspace n rx mapf gs y = map ($ y) gs {- | Draws a parametric curve. For instance, to draw a spiral we can do something like: > > parametricPlot (\t->(t * sin t, t * cos t)) (0,10*pi) 1000 -} parametricPlot :: (Vector Double->(Vector Double,Vector Double)) -> (Double, Double) -> Int -> IO () parametricPlot f rt n = mplot [fx, fy] where t = linspace n rt (fx,fy) = f t -- | writes a matrix to pgm image file matrixToPGM :: Matrix Double -> String matrixToPGM m = header ++ unlines (map unwords ll) where c = cols m r = rows m header = "P2 "++show c++" "++show r++" "++show (round maxgray :: Int)++"\n" maxgray = 255.0 maxval = maxElement m minval = minElement m scale' = if maxval == minval then 0.0 else maxgray / (maxval - minval) f x = show ( round ( scale' *(x - minval) ) :: Int ) ll = map (map f) (toLists m) -- | imshow shows a representation of a matrix as a gray level image using ImageMagick's display. imshow :: Matrix Double -> IO () imshow m = do _ <- system $ "echo \""++ matrixToPGM m ++"\"| display -antialias -resize 300 - &" return () ---------------------------------------------------- gnuplotX :: String -> IO () gnuplotX command = do { _ <- system cmdstr; return()} where cmdstr = "echo \""++command++"\" | gnuplot -persist" datafollows = "\\\"-\\\"" prep = (++"e\n\n") . unlines . map (unwords . map show) gnuplotpdf :: String -> String -> [([[Double]], String)] -> IO () gnuplotpdf title command ds = gnuplot (prelude ++ command ++" "++ draw) >> postproc where prelude = "set terminal epslatex color; set output '"++title++".tex';" (dats,defs) = unzip ds draw = concat (intersperse ", " (map ("\"-\" "++) defs)) ++ "\n" ++ concatMap pr dats postproc = do _ <- system $ "epstopdf "++title++".eps" mklatex _ <- system $ "pdflatex "++title++"aux.tex > /dev/null" _ <- system $ "pdfcrop "++title++"aux.pdf > /dev/null" _ <- system $ "mv "++title++"aux-crop.pdf "++title++".pdf" _ <- system $ "rm "++title++"aux.* "++title++".eps "++title++".tex" return () mklatex = writeFile (title++"aux.tex") $ "\\documentclass{article}\n"++ "\\usepackage{graphics}\n"++ "\\usepackage{nopageno}\n"++ "\\usepackage{txfonts}\n"++ "\\renewcommand{\\familydefault}{phv}\n"++ "\\usepackage[usenames]{color}\n"++ "\\begin{document}\n"++ "\\begin{center}\n"++ " \\input{./"++title++".tex}\n"++ "\\end{center}\n"++ "\\end{document}" pr = (++"e\n") . unlines . map (unwords . map show) gnuplot cmd = do writeFile "gnuplotcommand" cmd _ <- system "gnuplot gnuplotcommand" _ <- system "rm gnuplotcommand" return () gnuplotWin :: String -> String -> [([[Double]], String)] -> IO () gnuplotWin title command ds = gnuplot (prelude ++ command ++" "++ draw) where (dats,defs) = unzip ds draw = concat (intersperse ", " (map ("\"-\" "++) defs)) ++ "\n" ++ concatMap pr dats pr = (++"e\n") . unlines . map (unwords . map show) prelude = "set title \""++title++"\";" gnuplot cmd = do writeFile "gnuplotcommand" cmd _ <- system "gnuplot -persist gnuplotcommand" _ <- system "rm gnuplotcommand" return ()
abakst/liquidhaskell
benchmarks/hmatrix-0.15.0.1/lib/Graphics/Plot.hs
bsd-3-clause
6,046
0
22
1,412
1,721
886
835
102
2
{-# LANGUAGE CPP #-} module Distribution.Compat.Exception ( catchIO, catchExit, tryIO, displayException, ) where import System.Exit import qualified Control.Exception as Exception #if __GLASGOW_HASKELL__ >= 710 import Control.Exception (displayException) #endif tryIO :: IO a -> IO (Either Exception.IOException a) tryIO = Exception.try catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a catchIO = Exception.catch catchExit :: IO a -> (ExitCode -> IO a) -> IO a catchExit = Exception.catch #if __GLASGOW_HASKELL__ < 710 displayException :: Exception.Exception e => e -> String displayException = show #endif
mydaum/cabal
Cabal/Distribution/Compat/Exception.hs
bsd-3-clause
631
0
9
101
179
100
79
16
1
-- Tests that subFunTys works when the argument is a type of form (a ty1 ty2) module ShouldCompile where newtype StreamArrow a b c = Str (a [b] [c]) foo = Str $ (\x -> x)
urbanslug/ghc
testsuite/tests/typecheck/should_compile/tc202.hs
bsd-3-clause
175
0
8
39
47
30
17
3
1
{-# LANGUAGE RankNTypes #-} module LayoutType (Layout(..) ,tabbedLayout ,horizontalLayout ,verticalLayout ,tallLayout ,wideLayout) where import Text.PrettyPrint.HughesPJClass import Foreign.C.Types import Tree import WLC data Layout = Layout {getLayout :: forall a. WLCSize -> ListZipper a -> [(a,WLCGeometry)] ,name :: String} instance Eq Layout where (Layout _ s) == (Layout _ s') = s == s' instance Show Layout where show (Layout _ s) = "Layout " ++ s instance Pretty Layout where pPrint (Layout _ s) = text "Layout " <+> text s tabbedLayout :: Layout tabbedLayout = Layout (\size' stack -> let stackList = integrate stack in zip stackList (repeat (WLCGeometry (WLCOrigin 0 0) size'))) "Tabbed" horizontalLayout :: Layout horizontalLayout = simpleLayout horizontalSplit "Horizontal" horizontalSplit :: CInt -> CInt -> WLCSize -> WLCGeometry horizontalSplit total i (WLCSize w h) | total == 0 = error "No windows found" | otherwise = WLCGeometry (WLCOrigin (i * fromIntegral deltaX) 0) (WLCSize deltaX h) where deltaX = w `div` fromIntegral total verticalLayout :: Layout verticalLayout = simpleLayout verticalSplit "Vertical" verticalSplit :: CInt -> CInt -> WLCSize -> WLCGeometry verticalSplit total i (WLCSize w h) | total == 0 = error "No windows found" | otherwise = WLCGeometry (WLCOrigin 0 (i * fromIntegral deltaY)) (WLCSize w deltaY) where deltaY = h `div` fromIntegral total tallLayout :: Layout tallLayout = simpleLayout tallSplit "Tall" tallSplit :: CInt -> CInt -> WLCSize -> WLCGeometry tallSplit total i (WLCSize w h) | total == 0 = error "No windows found" | i == 0 = WLCGeometry (WLCOrigin 0 0) (WLCSize (w `div` (if total == 1 then 1 else 2)) h) | otherwise = WLCGeometry (WLCOrigin w' ((i - 1) * fromIntegral deltaY)) (WLCSize (fromIntegral w') deltaY) where deltaY = h `div` (fromIntegral total - 1) w' = fromIntegral w `div` 2 wideLayout :: Layout wideLayout = simpleLayout wideSplit "Wide" wideSplit :: CInt -> CInt -> WLCSize -> WLCGeometry wideSplit total i (WLCSize w h) | total == 0 = error "No windows found" | i == 0 = WLCGeometry (WLCOrigin 0 0) (WLCSize w (h `div` (if total == 1 then 1 else 2))) | otherwise = WLCGeometry (WLCOrigin ((i-1) * fromIntegral deltaX) h') (WLCSize deltaX (fromIntegral h')) where deltaX = w `div` (fromIntegral total -1) h' = fromIntegral h `div` 2 simpleLayout :: (CInt -> CInt -> WLCSize -> WLCGeometry) -> String -> Layout simpleLayout f s = Layout (\size' stack -> let stackList = integrate stack in zip stackList (map (\i -> f (fromIntegral $ length stackList) i size') [0 ..])) s
cocreature/reactand
src/LayoutType.hs
isc
3,034
0
18
902
1,037
537
500
76
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Scaffolding.Scaffolder (scaffold) where import Control.Arrow ((&&&)) import qualified Data.ByteString.Char8 as S import Data.Conduit (runResourceT, yield, ($$)) import Data.FileEmbed (embedFile) import Data.String (fromString) import qualified Data.Text as T import qualified Data.Text.Lazy as LT import qualified Data.Text.Lazy.IO as TLIO import MultiFile (unpackMultiFile) import System.IO import Text.Shakespeare.Text (renderTextUrl, textFile) prompt :: (String -> Maybe a) -> IO a prompt f = do s <- getLine case f s of Just a -> return a Nothing -> do putStr "That was not a valid entry, please try again: " hFlush stdout prompt f data Backend = Sqlite | Postgresql | Mysql | MongoDB | Simple deriving (Eq, Read, Show, Enum, Bounded) puts :: LT.Text -> IO () puts s = TLIO.putStr (LT.init s) >> hFlush stdout backends :: [Backend] backends = [minBound .. maxBound] showBackend :: Backend -> String showBackend Sqlite = "s" showBackend Postgresql = "p" showBackend Mysql = "mysql" showBackend MongoDB = "mongo" showBackend Simple = "simple" readBackend :: String -> Maybe Backend readBackend s = lookup s $ map (showBackend &&& id) backends backendBS :: Backend -> S.ByteString backendBS Sqlite = $(embedFile "hsfiles/sqlite.hsfiles") backendBS Postgresql = $(embedFile "hsfiles/postgres.hsfiles") backendBS Mysql = $(embedFile "hsfiles/mysql.hsfiles") backendBS MongoDB = $(embedFile "hsfiles/mongo.hsfiles") backendBS Simple = $(embedFile "hsfiles/simple.hsfiles") -- | Is the character valid for a project name? validPN :: Char -> Bool validPN c | 'A' <= c && c <= 'Z' = True | 'a' <= c && c <= 'z' = True | '0' <= c && c <= '9' = True validPN '-' = True validPN _ = False scaffold :: IO () scaffold = do puts $ renderTextUrl undefined $(textFile "input/welcome.cg") project <- prompt $ \s -> if all validPN s && not (null s) && s /= "test" then Just s else Nothing let dir = project puts $ renderTextUrl undefined $(textFile "input/database.cg") backend <- prompt readBackend putStrLn "That's it! I'm creating your files now..." let sink = unpackMultiFile (fromString project) (T.replace "PROJECTNAME" (T.pack project)) runResourceT $ yield (backendBS backend) $$ sink TLIO.putStr $ LT.replace "PROJECTNAME" (LT.pack project) $ renderTextUrl undefined $(textFile "input/done.cg")
piyush-kurur/yesod
yesod/Scaffolding/Scaffolder.hs
mit
2,693
0
16
682
811
415
396
66
2
{-# LANGUAGE BangPatterns, TypeFamilies #-} {-| Module : Rhodium.Contextual Description : Contextual Categories Copyright : (c) Nicolas Godbout, 2015 License : BSD-3 Maintainer : nicolas.godbout@gmail.com Stability : Experimental A Contextual Category is a Category with, in addition: 1) grade :: Ob C -> Nat 2) one :: Ob C such that @grade one == 0@ 3) ft :: Ob C -> Ob C such that @(grade (ft ob) + 1 == grade ob)@ 4) proj :: Ob C -> Hom C 5) pullback :: Ob C -> Hom C -> (Ob C, Hom C) -} module Rhodium.Contextual where import Control.Exception.Base (assert) import Data.Bool (Bool) import Data.Eq (Eq(..)) import Data.Functor (Functor(..)) import Data.Int (Int) import Data.String (String) import Prelude (($), ($!), (+), (-), error) type Label = String data Types var = TyNil | TyCons (Type var) (Types var) deriving (Eq) data Type var = TyVar var | TyAtom Label (Terms var) | TyUniverse -- | TyPi (Type var) (Type var) -- ^ product types deriving (Eq) data Terms var = TmNil | TmCons (Term var) (Terms var) deriving (Eq) data Term var = TmVar var | TmAtom Label (Terms var) | TmType (Type var) -- | TmLambda (Term var) | TmApp (Term var) (Term var) -- ^ product types deriving (Eq) data ObC = ObC (Types Int) deriving (Eq) data HomC = HomC { source :: Types Int, target :: Types Int, morph :: Terms Int } deriving (Eq) infixr 9 <.> (<.>) :: HomC -> HomC -> HomC g <.> f = comp $ Hom2C g f ----- -- Structural rules ----- -- | Identity morphism. unit :: ObC -> HomC unit (ObC obs) = HomC { source = obs, target = obs, morph = mkId 0 obs } where mkId :: Int -> Types Int -> Terms Int mkId _ TyNil = TmNil mkId n (TyCons _ typs) = TmCons (TmVar n) (mkId (n + 1) typs) -- | Composition of morphisms. comp :: Hom2C -> HomC comp (Hom2C g f) = -- pre-condition assert (target f == source g) $ -- code HomC { source = source f, target = target g, morph = map (substTerm $ morph f) (morph g) } data Hom2C = Hom2C { lpart :: HomC, rpart :: HomC } deriving (Eq) pullback :: HomC -> ObC -> ObC pullback f (ObC obs) = -- pre-condition assert (tail obs == target f) $ -- code ObC $ TyCons (substType (morph f) (head obs)) (source f) qullback :: HomC -> ObC -> HomC qullback f ob@(ObC obs) = let ObC fstar = pullback f ob in HomC { source = fstar, target = obs, morph = TmCons (TmVar 0) (offset 1 $ morph f) } ----- -- Helper functions ----- isSection :: HomC -> Bool isSection m = source m == tail (target m) substType :: Terms Int -> Type Int -> Type Int substType trms (TyVar n) = case trms !! n of TmType typ -> typ substType trms (TyAtom a as) = TyAtom a (map (substTerm trms) as) substType trms TyUniverse = TyUniverse substType trms (TyPi a b) = TyPi (substType trms a) (substType trms b) -- ^ not a total function, some terms are not liftable into types substTerm :: Terms Int -> Term Int -> Term Int substTerm trms (TmVar n) = trms !! n substTerm trms (TmAtom a as) = TmAtom a (map (substTerm trms) as) substTerm trms (TmLambda f) = TmLambda (substTerm trms f) substTerm trms (TmApp f x) = TmApp (substTerm (TmCons x trms) f) (substTerm trms x) offset :: Int -> Terms Int -> Terms Int offset n = map (fmap $ \m -> let !r = n + m in r) ----- -- Instances ----- class Scope t where type Members t :: * -> * -- List-like (!!) :: t a -> Int -> Members t a length :: t a -> Int head :: t a -> Members t a tail :: t a -> t a -- Functor-like map :: (Members t a -> Members t b) -> t a -> t b ----- instance Scope Types where type Members Types = Type TyNil !! idx = error "index too large" TyCons typ typs !! 0 = typ TyCons typ typs !! n = typs !! (n - 1) length = foldlS (\n _ -> n + 1) 0 where foldlS :: (a -> Type b -> a) -> a -> Types b -> a foldlS f x TyNil = x foldlS f x (TyCons typ typs) = let !x' = f x typ in foldlS f x' typs head TyNil = error "empty Types" head (TyCons trm _) = trm tail TyNil = error "empty Types" tail (TyCons _ trms) = trms map f TyNil = TyNil map f (TyCons typ typs) = TyCons (f typ) (map f typs) instance Scope Terms where type Members Terms = Term TmNil !! idx = error "Index out of range" TmCons (TmApp f _) trms !! 0 = f TmCons (TmApp _ x) trms !! 1 = x TmCons (TmApp _ _) trms !! n = trms !! (n - 2) TmCons trm trms !! 0 = trm TmCons trm trms !! n = trms !! (n - 1) length = foldlS (\n _ -> n + 1) 0 where foldlS :: (a -> Term b -> a) -> a -> Terms b -> a foldlS f x TmNil = x foldlS f x (TmCons trm trms) = let !x' = f x trm in foldlS f x' trms head TmNil = error "empty Terms" head (TmCons (TmApp k _) _) = k head (TmCons trm _) = trm tail TmNil = error "empty Terms" tail (TmCons (TmApp _ x) trms) = TmCons x trms tail (TmCons _ trms) = trms map f TmNil = TmNil map f (TmCons (TmApp k x) trms) = TmCons (TmApp (f k) (f x)) (map f trms) map f (TmCons trm trms) = TmCons (f trm) (map f trms) instance Functor Type where fmap f (TyVar v) = TyVar (f v) fmap f (TyAtom a as) = TyAtom a (map (fmap f) as) fmap f (TyUniverse) = TyUniverse fmap f (TyPi a b) = TyPi (fmap f a) (fmap f b) instance Functor Term where fmap f (TmVar v) = TmVar (f v) fmap f (TmAtom a as) = TmAtom a (map (fmap f) as) fmap f (TmType v) = TmType (fmap f v) fmap f (TmLambda k) = TmLambda (fmap f k) fmap f (TmApp k x) = TmApp (fmap f k) (fmap f x)
DrNico/rhodium
tools/rhc-strap/Rhodium/Contextual.hs
mit
5,531
70
17
1,478
2,439
1,253
1,186
151
2
{-# LANGUAGE DeriveGeneric, TemplateHaskell #-} module Network.Protocol.Message where import Control.DeepSeq import Data.DeriveTH import Data.Int import Data.Serialize import Data.Serialize.Text() import Data.Text (Text) import GHC.Generics (Generic) import TextShow import TextShow.Generic import Util.Vec() protocolVersion :: Int32 protocolVersion = 100000 data NetworkMessage = HandshakeMsg !Int32 -- ^ Carry protocol version | LoginMsg !Text !Text -- ^ Carry login and password hash | LoginAccepted -- ^ Message that ackes login | TerminationMsg !Text -- ^ Carry description of error | DebugMsg !Text -- ^ Debug info message | PlayerRequestWorld -- ^ Request world id and name from client | PlayerRequestEnviroment -- ^ Request player properties and list of boxed models around | PlayerWorld !Int !Text -- ^ Server responds with that to PlayerRequestWorld to inform about world id | PlayerData !Int -- ^ Server sends that to update client player info (currently only id) respond to PlayerRequestEnviroment deriving (Generic, Show) instance Serialize NetworkMessage instance NFData NetworkMessage instance TextShow NetworkMessage where showbPrec = genericShowbPrec $(derive makeIs ''NetworkMessage) -- | Makes handshake message handshakeMsg :: NetworkMessage handshakeMsg = HandshakeMsg protocolVersion -- | Returns true if the message is handshake and carry right version checkHandshake :: NetworkMessage -> Bool checkHandshake (HandshakeMsg v) = v == protocolVersion checkHandshake _ = False
NCrashed/sinister
src/shared/Network/Protocol/Message.hs
mit
1,532
0
8
237
249
141
108
51
1
-- | The simplest, stupidest possible simplex algorithm. -- The idea here is to be slow, but "obviously correct" so other algorithms -- can be verified against it. -- -- That's the plan, at least. For now this is just a first cut of trying to implement simplex. -- module Numeric.Limp.Solve.Simplex.Maps where import Numeric.Limp.Rep import Numeric.Limp.Solve.Simplex.StandardForm import Control.Arrow import qualified Data.Map as M import Data.Function (on) import Data.List (minimumBy, sortBy) -- | Result of a single pivot attempt data IterateResult z r c -- | Maximum reached! = Done -- | Pivot was made | Progress (Standard z r c) -- | No progress can be made: unbounded along the objective | Stuck deriving instance (Show z, Show r, Show (R c)) => Show (IterateResult z r c) -- | Try to find a pivot and then perform it. -- We're assuming, at this stage, that the existing solution is feasible. simplex1 :: (Ord z, Ord r, Rep c) => Standard z r c -> IterateResult z r c simplex1 s -- Check if there are any positive columns in the objective: = case pivotCols of -- if there are none, we are already at the maximum [] -> Done -- there are some; try to find the first pivot row that works _ -> go pivotCols where -- Check if there's any row worth pivoting on for this column. -- We're trying to see if we can increase the value of this -- column's variable from zero. go ((pc,_):pcs) = case pivotRowForCol s pc of Nothing -> go pcs Just pr -> Progress -- Perform the pivot. -- This moves the variable pr out of the basis, and pc into the basis. $ pivot s (pr,pc) -- We've tried all the pivot columns and failed. -- This means there's no edge we can take to increase our objective, -- so it must be unbounded. go [] = Stuck -- We want to find some positive column from the objective. -- In fact, find all of them and order descending. pivotCols = let ls = M.toList $ fst $ _objective s kvs = sortBy (compare `on` (negate . snd)) ls in filter ((>0) . snd) kvs -- | Find pivot row for given column. -- We're trying to find a way to increase the value of -- column from zero, and the returned row will be decreased to zero. -- Since all variables are >= 0, we cannot return a row that would set the column to negative. pivotRowForCol :: (Ord z, Ord r, Rep c) => Standard z r c -> StandardVar z r -> Maybe (StandardVar z r) pivotRowForCol s col = fmap fst $ minBy' (compare `on` snd) $ concatMap (\(n,r) -> let rv = lookupRow r col o = objOfRow r in if rv > 0 then [(n, o / rv)] else []) $ M.toList $ _constraints s -- | Find minimum, or nothing if empty minBy' :: (a -> a -> Ordering) -> [a] -> Maybe a minBy' _ [] = Nothing minBy' f ls = Just $ minimumBy f ls -- | Perform pivot for given row and column. -- We normalise row so that row.column = 1 -- -- > norm = row / row[column] -- -- Then, for all other rows including the objective, -- we want to make sure its column entry is zero: -- -- > row' = row - row[column]*norm -- -- In the end, this means "column" will be an identity column, or a basis column. -- pivot :: (Ord z, Ord r, Rep c) => Standard z r c -> (StandardVar z r, StandardVar z r) -> Standard z r c pivot s (pr,pc) = let norm = normaliseRow -- All other rows rest = filter ((/=pr) . fst) $ M.toList $ _constraints s in Standard { _constraints = M.fromList ((pc, norm) : map (id *** fixup norm) rest) , _objective = fixup norm $ _objective s , _substs = _substs s } where -- norm = row / row[column] normaliseRow | Just row@(rm, ro) <- M.lookup pr $ _constraints s = let c' = lookupRow row pc in (M.map (/c') rm, ro / c') -- Pivot would not be chosen if row doesn't exist.. | otherwise = (M.empty, 0) -- row' = row - row[column]*norm fixup (nm,no) row@(rm,ro) = let co = lookupRow row pc in {- row' = row - co*norm -} ( M.unionWith (+) rm (M.map ((-co)*) nm) , ro - co * no ) -- | Single phase of simplex. -- Keep repeating until no progress can be made. single_simplex :: (Ord z, Ord r, Rep c) => Standard z r c -> Maybe (Standard z r c) single_simplex s = case simplex1 s of Done -> Just s Progress s' -> single_simplex s' Stuck -> Nothing -- | Two phase: -- first, find a satisfying solution. -- then, solve simplex as normal. simplex :: (Ord z, Ord r, Rep c) => Standard z r c -> Maybe (Standard z r c) simplex s = find_initial_sat s >>= single_simplex -- | Find a satisfying solution. -- if there are any rows with negative values, this means their basic values are negative -- (which is not satisfying the x >= 0 constraint) -- these negative-valued rows must be pivoted around using modified pivot criteria find_initial_sat :: (Ord z, Ord r, Rep c) => Standard z r c -> Maybe (Standard z r c) find_initial_sat s = case negative_val_rows of [] -> Just s rs -> go rs where -- Find all rows with negative values -- because their current value is not feasible negative_val_rows = filter ((<0) . objOfRow . snd) $ M.toList $ _constraints s -- Find largest negative (closest to zero) to pivot on: -- pivoting on a negative will negate the value, setting it to positive min_of_row (_,(rm,_)) = minBy' (compare `on` (negate . snd)) $ filter ((<0) . snd) $ M.toList rm -- There is no feasible solution go [] = Nothing -- Try pivoting on the rows go (r:rs) | Just (pc,_) <- min_of_row r , Just pr <- pivotRowForNegatives pc = simplex $ pivot s (pr, pc) | otherwise = go rs -- opposite of pivotRowForCol... pivotRowForNegatives col = fmap fst $ minBy' (compare `on` (negate . snd)) $ concatMap (\(n,r) -> let rv = lookupRow r col o = objOfRow r in if rv < 0 then [(n, o / rv)] else []) $ M.toList $ _constraints s -- Get map of each constraint's value assignmentAll :: (Rep c) => Standard z r c -> (M.Map (StandardVar z r) (R c), R c) assignmentAll s = ( M.map val (_constraints s) , objOfRow (_objective s)) where val (_, v) = v -- Perform reverse substitution on constraint values -- to get original values (see StandardForm) assignment :: (Ord z, Ord r, Rep c) => Standard z r c -> (Assignment () (Either z r) c, R c) assignment s = ( Assignment M.empty $ M.union vs' rs' , o ) where (vs, o) = assignmentAll s vs' = M.fromList $ concatMap only_svs $ M.toList vs rs' = M.map eval $ _substs s eval (lin,co) = M.foldr (+) co $ M.mapWithKey (\k r -> r * (maybe 0 id $ M.lookup k vs)) $ lin only_svs (SV v, val) = [(v, val)] only_svs _ = [] -- Junk --------------- -- | Minimise whatever variables are 'basic' in given standard -- input must not already have an objective row "SVO", -- because the existing objective is added as a new row with that name minimise_basics :: (Ord z, Ord r, Rep c) => Standard z r c -> Standard z r c minimise_basics s = s { _objective = (M.map (const (1)) $ _constraints s, 0) , _constraints = M.insert SVO (_objective s) (_constraints s) } -- | Find the basic variables and "price them out" of the objective function, -- by subtracting multiples of the basic row from objective pricing_out :: (Ord z, Ord r, Rep c) => Standard z r c -> Standard z r c pricing_out s = s { _objective = M.foldrWithKey go (_objective s) (_constraints s) } where go v row@(rm,ro) obj@(om,oo) | coeff <- lookupRow obj v , coeff /= 0 , rowv <- lookupRow row v , mul <- -(coeff / rowv) = -- rowv = 1 -- obj' = obj - (coeff/rowv)*row ( M.unionWith (+) om (M.map (mul*) rm) , oo + mul*ro ) | otherwise = obj -- | Pull the previously-hidden objective out of constraints, and use it drop_fake_objective :: (Ord z, Ord r, Rep c) => Standard z r c -> Standard z r c drop_fake_objective s | cs <- _constraints s , Just o <- M.lookup SVO cs = s { _objective = o , _constraints = M.delete SVO cs } | otherwise = s
amosr/limp
src/Numeric/Limp/Solve/Simplex/Maps.hs
mit
8,545
0
18
2,497
2,380
1,268
1,112
-1
-1
module Sgd.Num.VectorT (main) where import Test.HUnit import qualified Data.Vector.Unboxed as VU import qualified Sgd.Num.Vector as V dot = TestCase $ do assertEqual "dotFS Should work" 10 (V.dotFS (fromList [0, 1,2,3,4]) [(1, 1.0), (3, 3.0)]) assertEqual "dot Should work" 40 (V.dot (fromList [0, 1,2,3,4]) (fromList [1,2,3,4,5])) addFS = TestCase $ do assertEqual "addFS Should work" (fromList [0, 2, 2, 6, 4]) (V.addFS (fromList [0, 1,2,3,4]) [(1, 1.0), (3, 3.0)]) dim = TestCase $ do assertEqual "dim should work" 100 (V.dim [(1,1.0), (5, 5.0), (100, 100)]) --norm = TestCase $ do -- "normalizeL2 should work" fromList :: [Double] -> V.FullVector fromList x = VU.fromList x :: V.FullVector main :: IO Counts main = runTestTT $ TestList [dot, addFS, dim]
daz-li/svm_sgd_haskell
test/Sgd/Num/VectorT.hs
mit
848
0
13
207
371
217
154
28
1
{-# LANGUAGE QuasiQuotes, TypeFamilies, TemplateHaskell, MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} module YesodCoreTest.Exceptions (exceptionsTest, Widget) where import Test.Hspec import Yesod.Core hiding (Request) import Network.Wai import Network.Wai.Test import Network.HTTP.Types (status301) data Y = Y mkYesod "Y" [parseRoutes| / RootR GET /redirect RedirR GET |] instance Yesod Y where approot = ApprootStatic "http://test" errorHandler (InternalError e) = return $ chooseRep $ RepPlain $ toContent e errorHandler x = defaultErrorHandler x getRootR :: Handler () getRootR = error "FOOBAR" >> return () getRedirR :: Handler () getRedirR = do setHeader "foo" "bar" redirectWith status301 RootR exceptionsTest :: Spec exceptionsTest = describe "Test.Exceptions" $ do it "500" case500 it "redirect keeps headers" caseRedirect runner :: Session () -> IO () runner f = toWaiApp Y >>= runSession f case500 :: IO () case500 = runner $ do res <- request defaultRequest assertStatus 500 res assertBody "FOOBAR" res caseRedirect :: IO () caseRedirect = runner $ do res <- request defaultRequest { pathInfo = ["redirect"] } assertStatus 301 res assertHeader "foo" "bar" res
piyush-kurur/yesod
yesod-core/test/YesodCoreTest/Exceptions.hs
mit
1,288
0
12
238
361
181
180
37
1
module Triangle (TriangleType(..), triangleType) where import qualified Data.Set as S import Data.List (sort) data TriangleType = Equilateral | Isosceles | Scalene | Illegal deriving (Eq, Read, Show) triangleType :: (Num a, Ord a) => a -> a -> a -> TriangleType triangleType a b c | any (<=0) [a, b, c] || s1 + s2 <= s3 = Illegal | otherwise = [Equilateral, Isosceles, Scalene] !! pred uniqueSides where sortedSides = sort [a, b, c] [s1, s2, s3] = sortedSides uniqueSides = S.size (S.fromAscList sortedSides)
exercism/xhaskell
exercises/practice/triangle/.meta/examples/success-standard/src/Triangle.hs
mit
607
0
12
183
222
125
97
15
1
module FPGrowth.Transaction (permuteTransaction) where import qualified Data.Set as Set import qualified Data.HashMap.Strict as H import qualified Data.List as List import FPGrowth.Types buildHeaderTable :: Count -> [Transaction] -> Punchcard buildHeaderTable minsup = H.filter (>= minsup) . List.foldl' accumulateSet H.empty -- Accumulates the occurence of items accumulate :: Item -> Punchcard -> Punchcard accumulate a = H.insertWith (\_ n -> n + 1) a 1 accumulateSet :: Punchcard -> Transaction -> Punchcard accumulateSet = Set.foldl' (flip accumulate) reorderTransaction :: Punchcard -> [Transaction] -> [OrderedTransaction] reorderTransaction punchcard = filter (not . null) . map (sort . reorder) where reorder = Set.foldl' tag [] tag xs a = case H.lookup a punchcard of Just x -> (ItemC a x):xs Nothing -> xs sort = List.sort permuteTransaction :: Count -> [Transaction] -> (Punchcard, [OrderedTransaction]) permuteTransaction minsup transactions = (punchcard, reorderTransaction punchcard transactions) where punchcard = buildHeaderTable minsup transactions
DM2014/homework2-hs
src/FPGrowth/Transaction.hs
mit
1,163
0
12
239
341
186
155
21
2
module Grails.Parser.PluginDesc ( parse ) where import Text.ParserCombinators.Parsec hiding (parse) import Grails.Parser.Common import Grails.Types (EIO) parse :: FilePath -> EIO String parse = parseFile onlyVersion onlyVersion :: Parser String onlyVersion = try defVersion <|> (anyToken >> onlyVersion) <|> return [] defVersion :: Parser String defVersion = do symbol $ string "def" symbol $ string "version" symbol equal quoted version version :: Parser String version = many1 (alphaNum <|> oneOf "_-.")
mbezjak/grailsproject
src/Grails/Parser/PluginDesc.hs
mit
547
0
8
111
167
86
81
18
1
{-# LANGUAGE TypeOperators , FlexibleContexts #-} module Calculus.Connectives.Simple where import Calculus.Expr import Auxiliary.List import Auxiliary.NameSource import Data.Functor import Data.List import Control.Monad.State type Formula = Expr {- Terms. Func - functional symbol Var - variable symbol Constant is a function from zero arguments -} data Term = Func String [Term] | Var String constant :: String -> Term constant name = Func name [] showArgs :: [Term] -> String showArgs = between "(" ")" . intercalate ", " . map showTerm showTerm (Func name []) = name showTerm (Func name args) = name ++ showArgs args showTerm (Var name) = name instance Show Term where show = showTerm supplyTerm :: NameState ns m => m Term supplyTerm = supplyName >>= return . constant renderQuantifier :: (NameState ns m, Render f) => String -> (Term -> Expr f) -> m String renderQuantifier q f = do name <- supplyName ns <- get let term = constant name return $ q ++ " " ++ name ++ " . " ++ between "[" "]" (pretty ns $ f term) {- Simple connectives. -} data Atom f = Atom String [Term] {- Quantifiers (HOAS style) -} data Exists f = Exists (Term -> f) data ForAll f = ForAll (Term -> f) {- SimpleInput - list of simple connectives defined above. SimpleFormula - formula which is built from these connectives. I use `...Input` 'cause it's a commopent which one should feed to `Expr` in order to make a complete type. -} type SimpleInput = Atom :+: Exists :+: ForAll type SimpleFormula = Formula SimpleInput {- Functor instances. -} instance Functor Atom where fmap _ (Atom name args) = (Atom name args) instance Functor Exists where fmap f (Exists g) = Exists (f . g) instance Functor ForAll where fmap f (ForAll g) = ForAll (f . g) {- Smart constructors. -} atom :: (Atom :<: f) => String -> [Term] -> Expr f atom name = inject . Atom name exists :: (Exists :<: f) => (Term -> Expr f) -> Expr f exists = inject . Exists forAll :: (ForAll :<: f) => (Term -> Expr f) -> Expr f forAll = inject . ForAll {- Render -} instance Render Atom where render (Atom name args) = return $ name ++ showArgs args instance Render Exists where render (Exists f) = renderQuantifier "exists" f instance Render ForAll where render (ForAll f) = renderQuantifier "forAll" f
wowofbob/calculus
Calculus/Connectives/Simple.hs
mit
2,418
0
11
579
743
387
356
-1
-1
{-# LANGUAGE InstanceSigs #-} module Ch26.StateT where newtype StateT s m a = StateT { runStateT :: s -> m (a, s) } instance Functor m => Functor (StateT s m) where fmap f (StateT sma) = StateT $ \s -> fmap (\(a, s') -> (f a, s')) $ sma s instance Monad m => Applicative (StateT s m) where pure a = StateT $ \s -> pure (a, s) (<*>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b (<*>) (StateT smab) (StateT sma) = StateT $ \s -> do (ab, s') <- smab s fmap (\(a, s'') -> (ab a, s'')) $ sma s' instance Monad m => Monad (StateT s m) where return = pure (>>=) :: StateT s m a -> (a -> StateT s m b) -> StateT s m b (>>=) (StateT sma) f = StateT $ \s -> do (a, s') <- sma s runStateT (f a) s'
andrewMacmurray/haskell-book-solutions
src/ch26/StateT.hs
mit
739
0
15
205
422
223
199
19
0
module CFDI.Types.Custom where import CFDI.Types.Type import Control.Error.Safe (justErr) import Data.Set (fromList, member) import Text.Read (readMaybe) newtype Custom = Custom Int deriving (Eq, Show) instance Type Custom where parseExpr c = justErr NotInCatalog maybeCustom where maybeCustom = Custom <$> (readMaybe c >>= isValid) isValid x | x `member` validCodes = Just x | otherwise = Nothing validCodes = fromList [ 1, 2, 5, 6, 7, 8, 11, 12, 14, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26 , 27, 28, 30, 31, 33, 34, 37, 38, 39, 40, 42, 43, 44, 46, 47, 48, 50 , 51, 52, 53, 64, 65, 67, 73, 75, 80, 81, 82, 83, 84 ] render (Custom x) = replicate (2 - length xStr) '0' ++ xStr where xStr = show x
yusent/cfdis
src/CFDI/Types/Custom.hs
mit
802
0
11
235
338
200
138
18
0
module Data.Logger where -- Logging functionality import Prelude hiding (mod) import Control.Monad.Writer import qualified Data.Map as Map -- below imports available via 1HaskellADay git repository import Control.DList import Data.LookupTable (LookupTable) type Logger m a = WriterT (DList LogEntry) m a say :: Monad m => LogEntry -> Logger m () say = tell . dl' data Severity = TRACE | DEBUG | INFO | WARN | ERROR | FATAL deriving (Eq, Ord, Show, Read) data LogEntry = Entry { sev :: Severity,app,mod,msg :: String } deriving (Eq, Show) data LogEntry' = LE' { ent :: LogEntry, lk :: LookupTable } deriving Eq instance Show LogEntry' where show (LE' (Entry sev app mod msg) lk) = "Entry' { sev :: " ++ show sev ++ ('/':show (lk Map.! show sev)) ++ concat (zipWith (\ a b -> ", " ++ a ++ " :: \"" ++ b ++ "\"") (words "app mod msg") [app, mod, msg]) ++ " }" -- and that's all you need for generic logging functionality ... although -- we can add a date-stamp and logging levels (debug, info, critical, error) -- We'll also need to add formatting messages for log entries.
geophf/1HaskellADay
exercises/HAD/Data/Logger.hs
mit
1,128
0
16
251
334
191
143
20
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE ViewPatterns #-} -- | This module implements the Patience Diff algorithm. -- -- The code here is heavily based on the "patience" package by -- Keegan McAllister <https://hackage.haskell.org/package/patience> module Control.Biegunka.Patience ( Judgement(..) , judgement , diff , FileDiff , Hunk(..) , fileDiff ) where import Control.Applicative import Data.Foldable (foldr, toList) import Data.Function (on) import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map import Data.IntMap.Strict (IntMap) import qualified Data.IntMap.Strict as IntMap import Data.List (sortBy, foldl') import Data.List.NonEmpty (NonEmpty) import qualified Data.List.NonEmpty as NonEmpty import Data.Ord (comparing) import Data.Sequence (Seq, ViewL(..), ViewR(..), (<|), (|>), (><)) import qualified Data.Sequence as Seq import Data.Text.Lazy (Text) import qualified Data.Text.Lazy as Text import qualified Data.Text.Lazy.IO as Text import Prelude hiding (foldr) -- | Every element in a diff can be either removed, added, or matched data Judgement a = Removed a | Added a | Matched a deriving (Show, Eq, Functor) -- | Eliminator for 'Judgement's. judgement :: (a -> b) -> (a -> b) -> (a -> b) -> Judgement a -> b judgement f _ _ (Removed a) = f a judgement _ g _ (Added a) = g a judgement _ _ h (Matched a) = h a type FileDiff = [Hunk Text] fileDiff :: FilePath -> FilePath -> IO [Hunk Text] fileDiff x y = liftA2 (fromDiff .: diff) (fmap Text.lines (Text.readFile x)) (fmap Text.lines (Text.readFile y)) -- | Compute the diff between two lists. A diff is an ordered sequence of "judgements" -- on whether to remove, to add, or to leave an element alone. diff :: Ord a => [a] -> [a] -> [Judgement a] diff = toList .: go `on` Seq.fromList where -- Match equal elements on the left side of the sequence go (Seq.viewl -> x :< xs) (Seq.viewl -> y :< ys) | x == y = Matched x <| go xs ys -- Match equal elements on the right side of the sequence go (Seq.viewr -> xs :> x) (Seq.viewr -> ys :> y) | x == y = go xs ys |> Matched x -- Compute the longest common subsequence of unique elements, split on its elements, -- decide whether they match or not and recurse into subproblems go xs ys = case parts (lcs xs ys) xs ys of [Diff as bs] -> fmap Removed as >< fmap Added bs zs -> loop zs loop [] = Seq.empty loop (Same x : zs) = loop zs |> Matched x loop (Diff as bs : zs) = loop zs >< go as bs lcs :: Ord a => Seq a -> Seq a -> [(Int, Int)] lcs = patiently . sortBy (comparing snd) . Map.elems .: (Map.intersectionWith (,) `on` unique . enumerate) infixr 8 .: (.:) :: (a -> b) -> (e -> e' -> a) -> e -> e' -> b (.:) = (.) . (.) -- Zip-with-index operation for Seq enumerate :: Seq a -> Seq (Int, a) enumerate xs = Seq.zip (Seq.fromList [0 .. Seq.length xs]) xs -- Compute the mapping of unique elements of the indexed Seq into their index unique :: Ord k => Seq (v, k) -> Map k v unique = Map.mapMaybe id . foldr go Map.empty where go (v, k) = Map.insertWith (\_ _ -> Nothing) k (Just v) data Card a = Card Int a (Maybe (Card a)) type Piles a = IntMap (NonEmpty (Card a)) patiently :: [(Int, a)] -> [(Int, a)] patiently = extract . populate populate :: [(Int, a)] -> Piles a populate = foldl' go IntMap.empty where go m (x, a) = let (lt, gt) = IntMap.split x m new = Card x a (NonEmpty.head . fst <$> IntMap.maxView lt) in case IntMap.minViewWithKey gt of Nothing -> IntMap.insert x (return new) m Just ((k, _), _) -> adjustMove (NonEmpty.cons new) k x m extract :: Piles t -> [(Int, t)] extract = maybe [] (walk . NonEmpty.head . fst) . IntMap.maxView where walk (Card x a c) = (x, a) : maybe [] walk c adjustMove :: (a -> a) -> Int -> Int -> IntMap a -> IntMap a adjustMove f k1 k2 m = case IntMap.updateLookupWithKey (\_ _ -> Nothing) k1 m of (Just v, m') -> IntMap.insert k2 (f v) m' (Nothing, _) -> m data Part a = Same a | Diff (Seq a) (Seq a) deriving (Show, Eq) parts :: [(Int, Int)] -> Seq a -> Seq a -> [Part a] parts [] (Seq.viewl -> EmptyL) (Seq.viewl -> EmptyL) = [] parts [] xs ys = [Diff xs ys] parts ((n, m) : is) xs ys = Diff xs' ys' : Same x' : parts is xs'' ys'' where (xs'', Seq.viewl -> x' :< xs') = Seq.splitAt n xs (ys'', Seq.viewl -> _ :< ys') = Seq.splitAt m ys data Hunk a = Hunk !Int !Int !Int !Int [Judgement a] deriving (Show, Eq, Functor) fromDiff :: [Judgement a] -> [Hunk a] fromDiff = boring 1 1 where boring !n !m (Matched _ : xs@(Matched _ : Matched _ : Matched _ : _)) = boring (n + 1) (m + 1) xs boring _ _ [Matched _, Matched _, Matched _] = [] boring _ _ [Matched _, Matched _] = [] boring _ _ [Matched _] = [] boring n m xs = exciting n m [] xs exciting n m = go 0 0 where go !i !j acc (Matched a : Matched b : Matched c : xs@(Matched _ : Matched _ : Matched _ : _)) = let i' = i + 3 j' = j + 3 in Hunk n i' m j' (reverse (Matched c : Matched b : Matched a : acc)) : boring (n + i') (m + j') xs go i j acc (x@(Added _) : xs) = go i (j + 1) (x : acc) xs go i j acc (x@(Removed _) : xs) = go (i + 1) j (x : acc) xs go i j acc (x@(Matched _) : xs) = go (i + 1) (j + 1) (x : acc) xs go _ _ [] [] = [] go i j acc [] = [Hunk n i m j (reverse acc)]
biegunka/biegunka
src/Control/Biegunka/Patience.hs
mit
5,646
0
19
1,546
2,438
1,297
1,141
-1
-1
import Utils.Prime (isPrime, primeGen) main = print problem46Value -- the first positive odd composite integer that is rejected by the conjecture problem46Value :: Integer problem46Value = head [n | n <- [3..], n `mod` 2 == 1, not $ isPrime n, rejected n] -- a number is rejected if there are no primes p <n where (n-p)/2 is a perfect square rejected :: Integer -> Bool rejected n = length [1 | p <- takeWhile (<n) primeGen, (n-p) `mod` 2 == 0, isPerfectSquare ((n-p) `div` 2)] == 0 -- an integer n is a perfect square if the square of the floor of its square root is equal to n isPerfectSquare :: Integer -> Bool isPerfectSquare n = (root ^ 2) == n where root = floor $ sqrt $ fromIntegral n
jchitel/ProjectEuler.hs
Problems/Problem0046.hs
mit
701
0
13
140
218
118
100
9
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-model.html module Stratosphere.Resources.SageMakerModel where import Stratosphere.ResourceImports import Stratosphere.ResourceProperties.SageMakerModelContainerDefinition import Stratosphere.ResourceProperties.Tag import Stratosphere.ResourceProperties.SageMakerModelVpcConfig -- | Full data type definition for SageMakerModel. See 'sageMakerModel' for a -- more convenient constructor. data SageMakerModel = SageMakerModel { _sageMakerModelContainers :: Maybe [SageMakerModelContainerDefinition] , _sageMakerModelExecutionRoleArn :: Val Text , _sageMakerModelModelName :: Maybe (Val Text) , _sageMakerModelPrimaryContainer :: Maybe SageMakerModelContainerDefinition , _sageMakerModelTags :: Maybe [Tag] , _sageMakerModelVpcConfig :: Maybe SageMakerModelVpcConfig } deriving (Show, Eq) instance ToResourceProperties SageMakerModel where toResourceProperties SageMakerModel{..} = ResourceProperties { resourcePropertiesType = "AWS::SageMaker::Model" , resourcePropertiesProperties = hashMapFromList $ catMaybes [ fmap (("Containers",) . toJSON) _sageMakerModelContainers , (Just . ("ExecutionRoleArn",) . toJSON) _sageMakerModelExecutionRoleArn , fmap (("ModelName",) . toJSON) _sageMakerModelModelName , fmap (("PrimaryContainer",) . toJSON) _sageMakerModelPrimaryContainer , fmap (("Tags",) . toJSON) _sageMakerModelTags , fmap (("VpcConfig",) . toJSON) _sageMakerModelVpcConfig ] } -- | Constructor for 'SageMakerModel' containing required fields as arguments. sageMakerModel :: Val Text -- ^ 'smmExecutionRoleArn' -> SageMakerModel sageMakerModel executionRoleArnarg = SageMakerModel { _sageMakerModelContainers = Nothing , _sageMakerModelExecutionRoleArn = executionRoleArnarg , _sageMakerModelModelName = Nothing , _sageMakerModelPrimaryContainer = Nothing , _sageMakerModelTags = Nothing , _sageMakerModelVpcConfig = Nothing } -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-model.html#cfn-sagemaker-model-containers smmContainers :: Lens' SageMakerModel (Maybe [SageMakerModelContainerDefinition]) smmContainers = lens _sageMakerModelContainers (\s a -> s { _sageMakerModelContainers = a }) -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-model.html#cfn-sagemaker-model-executionrolearn smmExecutionRoleArn :: Lens' SageMakerModel (Val Text) smmExecutionRoleArn = lens _sageMakerModelExecutionRoleArn (\s a -> s { _sageMakerModelExecutionRoleArn = a }) -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-model.html#cfn-sagemaker-model-modelname smmModelName :: Lens' SageMakerModel (Maybe (Val Text)) smmModelName = lens _sageMakerModelModelName (\s a -> s { _sageMakerModelModelName = a }) -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-model.html#cfn-sagemaker-model-primarycontainer smmPrimaryContainer :: Lens' SageMakerModel (Maybe SageMakerModelContainerDefinition) smmPrimaryContainer = lens _sageMakerModelPrimaryContainer (\s a -> s { _sageMakerModelPrimaryContainer = a }) -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-model.html#cfn-sagemaker-model-tags smmTags :: Lens' SageMakerModel (Maybe [Tag]) smmTags = lens _sageMakerModelTags (\s a -> s { _sageMakerModelTags = a }) -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-model.html#cfn-sagemaker-model-vpcconfig smmVpcConfig :: Lens' SageMakerModel (Maybe SageMakerModelVpcConfig) smmVpcConfig = lens _sageMakerModelVpcConfig (\s a -> s { _sageMakerModelVpcConfig = a })
frontrowed/stratosphere
library-gen/Stratosphere/Resources/SageMakerModel.hs
mit
3,940
0
15
453
624
359
265
53
1
-- Copyright 2015 Mitchell Kember. Subject to the MIT License. -- Project Euler: Problem 7 -- 10001st prime module Problem07 where import Common (primes) solve :: Int solve = primes !! 10000
mk12/euler
haskell/Problem07.hs
mit
194
0
5
35
29
19
10
4
1
{-# LANGUAGE TupleSections #-} {-# OPTIONS -Wall #-} import Control.Concurrent import Control.Exception (catch, throwIO, SomeException(..)) import Control.Monad import Data.List (stripPrefix, sort) import Data.Maybe (fromMaybe, mapMaybe) import Data.Monoid ((<>)) import Data.Time.Clock (NominalDiffTime) import GHC.Stack (whoCreated) import qualified Git.CLI as Git import Opts (parseOpts, Opts(..)) -- TODO: configurable remote name remoteName :: Git.Remote remoteName = "origin" filterBranchesByPrefix :: Git.RepoPath -> String -> Git.BranchLocation -> IO [(String, Git.Branch)] filterBranchesByPrefix repoPath prefix branchPos = do refs <- Git.listBranches repoPath branchPos return (mapMaybe pair refs) where pair name = (, name) <$> stripPrefix prefix name testingBranchSplitName :: String -> Maybe (Int, String) testingBranchSplitName str = case break (=='/') str of (_, "") -> Nothing (numStr, '/':name) -> case reads numStr of [(num, "")] -> Just (num, name) _ -> Nothing _ -> error "break returns non-empty snd that doesn't match the break predicate?" getTestingBranches :: Git.RepoPath -> IO [(Int, String, Git.Branch)] getTestingBranches repoPath = do branches <- map extractPrefix <$> filterBranchesByPrefix repoPath "testing/" Git.LocalBranch return $ sort branches where extractPrefix (fullName, branch) = (num, name, branch) where (num, name) = fromMaybe err $ testingBranchSplitName fullName err = error $ "/testing/* branch format should be <num>-<name>" reject :: Git.RepoPath -> String -> Git.RefSpec -> String -> IO () reject repoPath name refSpec msg = do putStrLn $ "rejecting " ++ name ++ ":\n" ++ msg newRejectBranch `catch` \failure -> putStrLn $ "Failed to reject branch, git output:\n" ++ Git.gitCommandStderr failure where newRejectBranch = do Git.branchNewCheckout repoPath ("rejected/" ++ name) refSpec Git.commit repoPath msg -- | Rebase an orig/<name> branch on top of the given point into testing/<name> -- Returns the new result commit (tip of rebased) attemptRebase :: Git.RepoPath -> (String, Git.Branch) -> String -> IO (Maybe Git.CommitID) attemptRebase repoPath (name, testingBranch) base = do Git.branchCheckout repoPath base Git.ignoreError (Git.branchDelete repoPath testingBranch) Git.branchNewCheckout repoPath testingBranch origBranch (Just testingBranch <$ Git.rebaseOnto repoPath base base) `Git.onFail` do Git.branchCheckout repoPath origBranch Git.branchDelete repoPath testingBranch baseCommitId <- Git.revParse repoPath base reject repoPath name "HEAD" $ concat [ "Rejected due to rebase failure (on " , base, "[", baseCommitId, "])" ] Git.branchCheckout repoPath base Git.branchDelete repoPath origBranch return Nothing where origBranch = "orig/" ++ name -- | Rebase all testing branches to be fast-forwards of one another rebaseTestingBranches :: Git.RepoPath -> IO Git.Branch rebaseTestingBranches repoPath = do branches <- getTestingBranches repoPath (rebased, attempted, res) <- loop 0 0 "master" branches putStrLn $ concat [ show (length branches), " testing branches exists (successfully rebased " , show rebased, " of ", show attempted, ")"] return res where loop :: Int -> Int -> Git.RefSpec -> [(Int, String, Git.RefSpec)] -> IO (Int, Int, Git.RefSpec) loop rebased attempted prev [] = return (rebased, attempted, prev) loop rebased attempted prev ((_num, name, branch):nexts) = do divergence <- Git.commitsBetween repoPath branch prev (onRebased, onAttempted, newPos) <- if null divergence then return (id, id, branch) else maybe (id, (+1), prev) ((,,) (+1) (+1)) <$> attemptRebase repoPath (name, branch) prev loop (onRebased rebased) (onAttempted attempted) newPos nexts poll :: Git.RepoPath -> IO () poll repoPath = do Git.fetch repoPath remoteName proposed <- filterBranchesByPrefix repoPath (remoteName <> "/q/") Git.RemoteBranch base <- rebaseTestingBranches repoPath let nextId = maybe 1 fst $ testingBranchSplitName base unless (null proposed) $ do putStrLn $ "Rebasing proposed branches on top of " ++ show base ++ ":" mapM_ (putStrLn . fst) proposed loop nextId base proposed where loop _ _ [] = return () loop nextId prev ((name, branch):nexts) = do q <- Git.revParse repoPath branch Git.branchDeleteRemote repoPath remoteName ("q/" ++ name) success <- True <$ Git.branchNewCheckout repoPath ("orig/" ++ name) q `Git.onFail` False <$ ( reject repoPath name q $ concat ["Rejected, test of ", show name, " already in progress!"] ) when success $ do let newTestingBranch = "testing/" ++ show nextId ++ "/" ++ name newBase <- fromMaybe prev <$> attemptRebase repoPath (name, newTestingBranch) prev loop (nextId+1) newBase nexts sleep :: NominalDiffTime -> IO () sleep = threadDelay . truncate . (1000000 *) run :: Opts -> IO () run (Opts interval repoPath) = forever $ do poll repoPath sleep interval main :: IO () main = do opts <- parseOpts run opts `catch` \e@SomeException {} -> do mapM_ putStrLn =<< whoCreated e throwIO e
Peaker/git-pushq
PushQ.hs
gpl-2.0
6,113
0
18
1,908
1,691
865
826
123
4
-------------------------------------------------------------------------------- -- Copyright (C) 1997, 1998, 2008 Joern Dinkla, www.dinkla.net -------------------------------------------------------------------------------- -- -- see -- Joern Dinkla, Geometrische Algorithmen in Haskell, Diploma Thesis, -- University of Bonn, Germany, 1998. -- module RBox ( readPoints1, readPoints2, readPoints3, readPoints4, readPointsN, readWith, writePoints ) where import Point ( Point (..), Point1 (..), Point2 (..), Point3 (..), Point4 (..), PointN, pointN, toList ) import System.IO ( hPutStrLn, stdout, IOMode (WriteMode), openFile, hClose ) readP :: (Read a, Num a) => String -> IO (Int, Int, [[a]]) readP name = do xs <- readFile name let (d:n:ys) = lines xs return (read (head (words d)), read n, map (map read . words) ys) readWith :: (Num a, Read a) => ([a] -> b) -> String -> IO (Int,Int,[b]) readWith f name = do (d, n, xs) <- readP name; return (d, n, map f xs) readPoints1 :: (Read a, Num a) => String -> IO (Int,Int,[Point1 a]) readPoints1 = readWith (\ [x] -> Point1 x) readPoints2 :: (Read a, Num a, Eq a) => String -> IO (Int,Int,[Point2 a]) readPoints2 = readWith (\ [x,y] -> Point2 (x,y)) readPoints3 :: (Read a, Num a, Eq a) => String -> IO (Int,Int,[Point3 a]) readPoints3 = readWith (\ [x,y,z] -> Point3 (x,y,z)) readPoints4 :: (Read a, Num a) => String -> IO (Int,Int,[Point4 a]) readPoints4 = readWith (\ [w,x,y,z] -> Point4 (w,x,y,z)) readPointsN :: (Read a, Num a) => String -> IO (Int,Int,[PointN a]) readPointsN = readWith pointN -- Wir brauchen nur eine Ausgabefunktion writePoints :: (Num a, Eq a, Point p, Show a) => String -> [p a] -> IO () writePoints name ps = do h <- openFile name WriteMode let dim = dimension (head ps) hPutStrLn h (show dim) let xs = map toList ps hPutStrLn h (show (length xs)) sequence_ (map (hPutStrLn h . cnc . (map show)) xs) hClose h where cnc = foldr (\ s r -> s ++ ' ':r) ""
smoothdeveloper/GeoAlgLib
src/RBox.hs
gpl-3.0
2,043
0
13
435
918
502
416
34
1
module GameLogic where import Model movePlayer :: Player -> Coord -> Player movePlayer p newPos = p {pPos = newPos} levelPlayer :: Player -> Player levelPlayer p = p { pLevelLimit = newLevelLimit, pExp = newExp, pLevel = newLevel, pMaxHealth = newMaxHp , pHealth = newMaxHp} where newExp = (pExp p) - (pLevelLimit p) newMaxHp = (pMaxHealth p) + 10 newLevelLimit = (pLevelLimit p) + 10 newLevel = (pLevel p) + 1 handleLevelUp :: GameState -> GameState handleLevelUp gs | pExp p >= pLevelLimit p = handleLevelUp gs { gPlayer = levelPlayer $ gPlayer gs } | otherwise = gs where p = gPlayer gs checkEnemiesLeft ::GameState -> GameState checkEnemiesLeft gs | (length $ enemies gs) == 0 = gs {gWin = True } | otherwise = gs
Spacejoker/DDclone
src/GameLogic.hs
gpl-3.0
763
0
11
173
279
148
131
19
1
{-# LANGUAGE ViewPatterns #-} -- https://ghc.haskell.org/trac/ghc/wiki/ViewPatterns module TB.Language.Extensions.ViewPatterns ( Record (..), viewRecCChar, recTest, factorial, searchList ) where import Data.List -- Factorial example viewFactorial :: Int -> Maybe Int viewFactorial n = if n > 0 then Just n else Nothing factorial :: Int -> Int factorial (viewFactorial -> Just n) = n * factorial (n-1) factorial _ = 1 -- List/Map lookup example searchList :: Eq a => a -> [a] -> Either String a searchList a (find (== a) -> Just x) = Right x searchList _ _ = Left "not found" -- Record data Record = RecA Int | RecB Bool Bool | RecC Int Bool Char deriving (Show) viewRecCChar :: Record -> Maybe Char viewRecCChar (RecC _ _ c) = Just c viewRecCChar _ = Nothing recTest :: Record -> (Char, String) recTest (viewRecCChar -> Just c) = (c, "boom") recTest _ = ('!', "bang")
adarqui/ToyBox
haskell/haskell/language-extensions/src/TB/Language/Extensions/ViewPatterns.hs
gpl-3.0
900
0
9
180
320
174
146
27
2
{-# OPTIONS_GHC -F -pgmF htfpp #-} {- | Module : UtilTest Description : Tests 'Diffr.Util'. Since : 0.1 Authors : William Martin, Jakub Kozlowski License : This file is part of diffr-h. diffr-h 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. diffr-h 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 diffr-h. If not, see <http://www.gnu.org/licenses/>. -} module Diffr.UtilTest where import qualified Diffr.Util as DU import Test.Framework import Test.Framework.TestManager -- | Example QuickCheck test prop_config :: FilePath -> FilePath -> FilePath -> Bool prop_config base new out = config == config where config = DU.Diff { DU.baseFile = base, DU.newFile = new, DU.dOutFile = Just out} -- | Test fixture defaultConfig :: DU.DConfig defaultConfig = DU.Diff { DU.baseFile = "original.txt", DU.newFile = "original-1.txt", DU.dOutFile = Nothing} -- | Example assertion test test_oddSquareSum :: Assertion test_oddSquareSum = do assertEqual defaultConfig defaultConfig assertEqual True True
diffr/diffr-h
test/Diffr/UtilTest.hs
gpl-3.0
1,527
0
9
326
167
97
70
13
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.UserRolePermissionGroups.Get -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Gets one user role permission group by ID. -- -- /See:/ <https://developers.google.com/doubleclick-advertisers/ Campaign Manager 360 API Reference> for @dfareporting.userRolePermissionGroups.get@. module Network.Google.Resource.DFAReporting.UserRolePermissionGroups.Get ( -- * REST Resource UserRolePermissionGroupsGetResource -- * Creating a Request , userRolePermissionGroupsGet , UserRolePermissionGroupsGet -- * Request Lenses , urpggXgafv , urpggUploadProtocol , urpggAccessToken , urpggUploadType , urpggProFileId , urpggId , urpggCallback ) where import Network.Google.DFAReporting.Types import Network.Google.Prelude -- | A resource alias for @dfareporting.userRolePermissionGroups.get@ method which the -- 'UserRolePermissionGroupsGet' request conforms to. type UserRolePermissionGroupsGetResource = "dfareporting" :> "v3.5" :> "userprofiles" :> Capture "profileId" (Textual Int64) :> "userRolePermissionGroups" :> Capture "id" (Textual Int64) :> QueryParam "$.xgafv" Xgafv :> QueryParam "upload_protocol" Text :> QueryParam "access_token" Text :> QueryParam "uploadType" Text :> QueryParam "callback" Text :> QueryParam "alt" AltJSON :> Get '[JSON] UserRolePermissionGroup -- | Gets one user role permission group by ID. -- -- /See:/ 'userRolePermissionGroupsGet' smart constructor. data UserRolePermissionGroupsGet = UserRolePermissionGroupsGet' { _urpggXgafv :: !(Maybe Xgafv) , _urpggUploadProtocol :: !(Maybe Text) , _urpggAccessToken :: !(Maybe Text) , _urpggUploadType :: !(Maybe Text) , _urpggProFileId :: !(Textual Int64) , _urpggId :: !(Textual Int64) , _urpggCallback :: !(Maybe Text) } deriving (Eq, Show, Data, Typeable, Generic) -- | Creates a value of 'UserRolePermissionGroupsGet' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'urpggXgafv' -- -- * 'urpggUploadProtocol' -- -- * 'urpggAccessToken' -- -- * 'urpggUploadType' -- -- * 'urpggProFileId' -- -- * 'urpggId' -- -- * 'urpggCallback' userRolePermissionGroupsGet :: Int64 -- ^ 'urpggProFileId' -> Int64 -- ^ 'urpggId' -> UserRolePermissionGroupsGet userRolePermissionGroupsGet pUrpggProFileId_ pUrpggId_ = UserRolePermissionGroupsGet' { _urpggXgafv = Nothing , _urpggUploadProtocol = Nothing , _urpggAccessToken = Nothing , _urpggUploadType = Nothing , _urpggProFileId = _Coerce # pUrpggProFileId_ , _urpggId = _Coerce # pUrpggId_ , _urpggCallback = Nothing } -- | V1 error format. urpggXgafv :: Lens' UserRolePermissionGroupsGet (Maybe Xgafv) urpggXgafv = lens _urpggXgafv (\ s a -> s{_urpggXgafv = a}) -- | Upload protocol for media (e.g. \"raw\", \"multipart\"). urpggUploadProtocol :: Lens' UserRolePermissionGroupsGet (Maybe Text) urpggUploadProtocol = lens _urpggUploadProtocol (\ s a -> s{_urpggUploadProtocol = a}) -- | OAuth access token. urpggAccessToken :: Lens' UserRolePermissionGroupsGet (Maybe Text) urpggAccessToken = lens _urpggAccessToken (\ s a -> s{_urpggAccessToken = a}) -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). urpggUploadType :: Lens' UserRolePermissionGroupsGet (Maybe Text) urpggUploadType = lens _urpggUploadType (\ s a -> s{_urpggUploadType = a}) -- | User profile ID associated with this request. urpggProFileId :: Lens' UserRolePermissionGroupsGet Int64 urpggProFileId = lens _urpggProFileId (\ s a -> s{_urpggProFileId = a}) . _Coerce -- | User role permission group ID. urpggId :: Lens' UserRolePermissionGroupsGet Int64 urpggId = lens _urpggId (\ s a -> s{_urpggId = a}) . _Coerce -- | JSONP urpggCallback :: Lens' UserRolePermissionGroupsGet (Maybe Text) urpggCallback = lens _urpggCallback (\ s a -> s{_urpggCallback = a}) instance GoogleRequest UserRolePermissionGroupsGet where type Rs UserRolePermissionGroupsGet = UserRolePermissionGroup type Scopes UserRolePermissionGroupsGet = '["https://www.googleapis.com/auth/dfatrafficking"] requestClient UserRolePermissionGroupsGet'{..} = go _urpggProFileId _urpggId _urpggXgafv _urpggUploadProtocol _urpggAccessToken _urpggUploadType _urpggCallback (Just AltJSON) dFAReportingService where go = buildClient (Proxy :: Proxy UserRolePermissionGroupsGetResource) mempty
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/UserRolePermissionGroups/Get.hs
mpl-2.0
5,592
0
19
1,298
821
474
347
121
1
{-# LANGUAGE OverloadedStrings, TemplateHaskell, QuasiQuotes, RecordWildCards, DataKinds #-} module Model.AssetSlot ( module Model.AssetSlot.Types , lookupAssetSlot , lookupOrigAssetSlot , lookupAssetAssetSlot , lookupSlotAssets , lookupOrigSlotAssets , lookupContainerAssets , lookupOrigContainerAssets , lookupVolumeAssetSlots -- , lookupOrigVolumeAssetSlots , lookupOrigVolumeAssetSlots' , lookupVolumeAssetSlotIds -- , lookupOrigVolumeAssetSlotIds , changeAssetSlot , changeAssetSlotDuration , fixAssetSlotDuration , findAssetContainerEnd , assetSlotName , assetSlotJSON ) where import Control.Monad (when, guard) import qualified Data.ByteString import Data.Maybe (fromMaybe, isNothing) import Data.Monoid ((<>)) import Data.Maybe (fromJust, catMaybes) import Data.String import qualified Data.Text as T -- import Database.PostgreSQL.Typed (pgSQL) import Database.PostgreSQL.Typed.Types import Ops import Has (peek, view) import qualified JSON import Service.DB import Model.Offset import Model.Permission import Model.Segment import Model.Id import Model.Party.Types import Model.Identity.Types import Model.Volume.Types import Model.Container.Types import Model.Slot.Types import Model.Asset import Model.Audit import Model.SQL import Model.AssetSlot.Types import Model.AssetSlot.SQL import Model.Format.Types import Model.Format (getFormat') import Model.PermissionUtil (maskRestrictedString) lookupAssetSlot :: (MonadHasIdentity c m, MonadDB c m) => Id Asset -> m (Maybe AssetSlot) lookupAssetSlot ai = do ident <- peek dbQuery1 $(selectQuery (selectAssetSlot 'ident) "$WHERE asset.id = ${ai}") lookupOrigAssetSlot :: (MonadHasIdentity c m, MonadDB c m) => Id Asset -> m (Maybe AssetSlot) lookupOrigAssetSlot ai = do initAsset <- lookupAssetSlot ai let format = formatName . assetFormat . assetRow . slotAsset $ fromJust initAsset case format of ".pdf" -> lookupAssetSlot ai --TODO format name should support all doc types _ -> do ident <- peek dbQuery1 $(selectQuery (selectAssetSlot 'ident) "$left join transcode tc on tc.orig = asset.id WHERE tc.asset = ${ai}") lookupAssetAssetSlot :: (MonadDB c m) => Asset -> m AssetSlot lookupAssetAssetSlot a = fromMaybe assetNoSlot <$> dbQuery1 $(selectQuery selectAssetSlotAsset "$WHERE slot_asset.asset = ${assetId $ assetRow a} AND container.volume = ${volumeId $ volumeRow $ assetVolume a}") <*> return a lookupSlotAssets :: (MonadDB c m) => Slot -> m [AssetSlot] lookupSlotAssets (Slot c s) = dbQuery $ ($ c) <$> $(selectQuery selectContainerSlotAsset "$WHERE slot_asset.container = ${containerId $ containerRow c} AND slot_asset.segment && ${s} AND asset.volume = ${volumeId $ volumeRow $ containerVolume c}") lookupOrigSlotAssets :: (MonadDB c m) => Slot -> m [AssetSlot] lookupOrigSlotAssets slot@(Slot c _) = do let _tenv_ablno = unknownPGTypeEnv xs <- dbQuery {- [pgSQL| SELECT asset.id,asset.format,output_asset.release,asset.duration,asset.name,asset.sha1,asset.size FROM slot_asset INNER JOIN transcode ON slot_asset.asset = transcode.asset INNER JOIN asset ON transcode.orig = asset.id INNER JOIN asset output_asset ON transcode.asset = output_asset.id WHERE slot_asset.container = ${containerId $ containerRow c} |] -} (mapQuery2 ((\ _p_ablnp -> Data.ByteString.concat [fromString "\n\ \ SELECT asset.id,asset.format,output_asset.release,asset.duration,asset.name,asset.sha1,asset.size \n\ \ FROM slot_asset \n\ \ INNER JOIN transcode ON slot_asset.asset = transcode.asset\n\ \ INNER JOIN asset ON transcode.orig = asset.id\n\ \ INNER JOIN asset output_asset ON transcode.asset = output_asset.id\n\ \ WHERE slot_asset.container = ", pgEscapeParameter _tenv_ablno (PGTypeProxy :: PGTypeName "integer") _p_ablnp, fromString "\n\ \ "]) (containerId $ containerRow c)) (\ [_cid_ablnq, _cformat_ablnr, _crelease_ablns, _cduration_ablnt, _cname_ablnu, _csha1_ablnv, _csize_ablnw] -> (pgDecodeColumnNotNull _tenv_ablno (PGTypeProxy :: PGTypeName "integer") _cid_ablnq, pgDecodeColumnNotNull _tenv_ablno (PGTypeProxy :: PGTypeName "smallint") _cformat_ablnr, pgDecodeColumn _tenv_ablno (PGTypeProxy :: PGTypeName "release") _crelease_ablns, pgDecodeColumn _tenv_ablno (PGTypeProxy :: PGTypeName "interval") _cduration_ablnt, pgDecodeColumn _tenv_ablno (PGTypeProxy :: PGTypeName "text") _cname_ablnu, pgDecodeColumn _tenv_ablno (PGTypeProxy :: PGTypeName "bytea") _csha1_ablnv, pgDecodeColumn _tenv_ablno (PGTypeProxy :: PGTypeName "bigint") _csize_ablnw))) return $ flip fmap xs $ \(assetId,formatId,release,duration,name,sha1,size) -> -- this format value is only used to differentiate between audio/video or not -- so it is okay that it is hardcoded to mp4, under the assumption that everything with an original -- was an audio/video file that went through transcoding let format = getFormat' formatId -- Format (Id (-800)) "video/mp4" [] "" {-fromJust . getFormatByExtension $ encodeUtf8 $ fromJust name-} assetRow = AssetRow (Id assetId) format release duration name sha1 size in AssetSlot (Asset assetRow (containerVolume c)) (Just slot) lookupContainerAssets :: (MonadDB c m) => Container -> m [AssetSlot] lookupContainerAssets = lookupSlotAssets . containerSlot lookupOrigContainerAssets :: (MonadDB c m) => Container -> m [AssetSlot] lookupOrigContainerAssets = lookupOrigSlotAssets . containerSlot lookupVolumeAssetSlots :: (MonadDB c m) => Volume -> Bool -> m [AssetSlot] lookupVolumeAssetSlots v top = dbQuery $ ($ v) <$> $(selectQuery selectVolumeSlotAsset "$WHERE asset.volume = ${volumeId $ volumeRow v} AND (container.top OR ${not top}) ORDER BY container.id") {- lookupOrigVolumeAssetSlots :: (MonadDB c m, MonadHasIdentity c m) => Volume -> Bool -> m [AssetSlot] lookupOrigVolumeAssetSlots v top = do fromVol <- lookupVolumeAssetSlots v top lookupOrigVolumeAssetSlots' fromVol -} lookupOrigVolumeAssetSlots' :: (MonadDB c m, MonadHasIdentity c m) => [AssetSlot] -> m [AssetSlot] lookupOrigVolumeAssetSlots' slotList = catMaybes <$> mapM originFinder slotList where originFinder AssetSlot { slotAsset = Asset {assetRow = AssetRow { assetId = aid }}} = lookupOrigAssetSlot aid lookupVolumeAssetSlotIds :: (MonadDB c m) => Volume -> m [(Asset, SlotId)] lookupVolumeAssetSlotIds v = dbQuery $ ($ v) <$> $(selectQuery selectVolumeSlotIdAsset "$WHERE asset.volume = ${volumeId $ volumeRow v} ORDER BY container") {- lookupOrigVolumeAssetSlotIds :: (MonadDB c m) => Volume -> m [(Asset, SlotId)] lookupOrigVolumeAssetSlotIds v = dbQuery $ ($ v) <$> $(selectQuery selectVolumeSlotIdAsset "$left join asset_revision ar on ar.orig = asset.id WHERE asset.volume = ${volumeId $ volumeRow v} ORDER BY container") -} changeAssetSlot :: (MonadAudit c m) => AssetSlot -> m Bool changeAssetSlot as = do ident <- getAuditIdentity let _tenv_a8II3 = unknownPGTypeEnv if isNothing (assetSlot as) then dbExecute1 -- (deleteSlotAsset 'ident 'as) (mapQuery2 ((\ _p_a8II4 _p_a8II5 _p_a8II6 -> (Data.ByteString.concat [Data.String.fromString "WITH audit_row AS (DELETE FROM slot_asset WHERE asset=", Database.PostgreSQL.Typed.Types.pgEscapeParameter _tenv_a8II3 (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "integer") _p_a8II4, Data.String.fromString " RETURNING *) INSERT INTO audit.slot_asset SELECT CURRENT_TIMESTAMP, ", Database.PostgreSQL.Typed.Types.pgEscapeParameter _tenv_a8II3 (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "integer") _p_a8II5, Data.String.fromString ", ", Database.PostgreSQL.Typed.Types.pgEscapeParameter _tenv_a8II3 (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "inet") _p_a8II6, Data.String.fromString ", 'remove'::audit.action, * FROM audit_row"])) (assetId $ assetRow $ slotAsset as) (auditWho ident) (auditIp ident)) (\ [] -> ())) else do let _tenv_a8IMD = unknownPGTypeEnv _tenv_a8IPn = unknownPGTypeEnv (r, _) <- updateOrInsert -- (updateSlotAsset 'ident 'as) (mapQuery2 ((\ _p_a8IME _p_a8IMF _p_a8IMG _p_a8IMH _p_a8IMI -> (Data.ByteString.concat [Data.String.fromString "WITH audit_row AS (UPDATE slot_asset SET container=", Database.PostgreSQL.Typed.Types.pgEscapeParameter _tenv_a8IMD (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "integer") _p_a8IME, Data.String.fromString ",segment=", Database.PostgreSQL.Typed.Types.pgEscapeParameter _tenv_a8IMD (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "segment") _p_a8IMF, Data.String.fromString " WHERE asset=", Database.PostgreSQL.Typed.Types.pgEscapeParameter _tenv_a8IMD (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "integer") _p_a8IMG, Data.String.fromString " RETURNING *) INSERT INTO audit.slot_asset SELECT CURRENT_TIMESTAMP, ", Database.PostgreSQL.Typed.Types.pgEscapeParameter _tenv_a8IMD (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "integer") _p_a8IMH, Data.String.fromString ", ", Database.PostgreSQL.Typed.Types.pgEscapeParameter _tenv_a8IMD (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "inet") _p_a8IMI, Data.String.fromString ", 'change'::audit.action, * FROM audit_row"])) (containerId . containerRow . slotContainer <$> assetSlot as) (slotSegment <$> assetSlot as) (assetId $ assetRow $ slotAsset as) (auditWho ident) (auditIp ident)) (\[] -> ())) -- (insertSlotAsset 'ident 'as) (mapQuery2 ((\ _p_a8IPo _p_a8IPp _p_a8IPq _p_a8IPr _p_a8IPs -> (Data.ByteString.concat [Data.String.fromString "WITH audit_row AS (INSERT INTO slot_asset (asset,container,segment) VALUES (", Database.PostgreSQL.Typed.Types.pgEscapeParameter _tenv_a8IPn (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "integer") _p_a8IPo, Data.String.fromString ",", Database.PostgreSQL.Typed.Types.pgEscapeParameter _tenv_a8IPn (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "integer") _p_a8IPp, Data.String.fromString ",", Database.PostgreSQL.Typed.Types.pgEscapeParameter _tenv_a8IPn (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "segment") _p_a8IPq, Data.String.fromString ") RETURNING *) INSERT INTO audit.slot_asset SELECT CURRENT_TIMESTAMP, ", Database.PostgreSQL.Typed.Types.pgEscapeParameter _tenv_a8IPn (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "integer") _p_a8IPr, Data.String.fromString ", ", Database.PostgreSQL.Typed.Types.pgEscapeParameter _tenv_a8IPn (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "inet") _p_a8IPs, Data.String.fromString ", 'add'::audit.action, * FROM audit_row"])) (assetId $ assetRow $ slotAsset as) (containerId . containerRow . slotContainer <$> assetSlot as) (slotSegment <$> assetSlot as) (auditWho ident) (auditIp ident)) (\[] -> ())) when (r /= 1) $ fail $ "changeAssetSlot: " ++ show r ++ " rows" return True changeAssetSlotDuration :: MonadDB c m => Asset -> m Bool changeAssetSlotDuration a | Just dur <- assetDuration $ assetRow a = do let _tenv_ablLj = unknownPGTypeEnv dbExecute1 -- [pgSQL|UPDATE slot_asset SET segment = segment(lower(segment), lower(segment) + ${dur}) WHERE asset = ${assetId $ assetRow a}|] (mapQuery2 ((\ _p_ablLk _p_ablLl -> (Data.ByteString.concat [fromString "UPDATE slot_asset SET segment = segment(lower(segment), lower(segment) + ", pgEscapeParameter _tenv_ablLj (PGTypeProxy :: PGTypeName "interval") _p_ablLk, fromString ") WHERE asset = ", pgEscapeParameter _tenv_ablLj (PGTypeProxy :: PGTypeName "integer") _p_ablLl])) dur (assetId $ assetRow a)) (\[] -> ())) | otherwise = return False fixAssetSlotDuration :: AssetSlot -> AssetSlot fixAssetSlotDuration as | Just dur <- assetDuration $ assetRow $ slotAsset as = as{ assetSlot = (\s -> s{ slotSegment = segmentSetDuration dur (slotSegment s) }) <$> assetSlot as } | otherwise = as findAssetContainerEnd :: MonadDB c m => Container -> m Offset findAssetContainerEnd c = do let _tenv_ablQT = unknownPGTypeEnv fromMaybe 0 <$> dbQuery1' -- [pgSQL|SELECT max(upper(segment))+'1s' FROM slot_asset WHERE container = ${containerId $ containerRow c}|] (mapQuery2 ((\ _p_ablQU -> Data.ByteString.concat [fromString "SELECT max(upper(segment))+'1s' FROM slot_asset WHERE container = ", pgEscapeParameter _tenv_ablQT (PGTypeProxy :: PGTypeName "integer") _p_ablQU]) (containerId $ containerRow c)) (\[_ccolumn_ablQV] -> (pgDecodeColumn _tenv_ablQT (PGTypeProxy :: PGTypeName "interval") _ccolumn_ablQV))) assetSlotName :: AssetSlot -> Maybe T.Text assetSlotName a = guard (any (containerTop . containerRow . slotContainer) (assetSlot a) || canReadData2 getAssetSlotRelease2 getAssetSlotVolumePermission2 a) >> assetName (assetRow $ slotAsset a) assetSlotJSON :: JSON.ToObject o => Bool -> AssetSlot -> JSON.Record (Id Asset) o assetSlotJSON publicRestricted as@AssetSlot{..} = assetJSON publicRestricted slotAsset `JSON.foldObjectIntoRec` (foldMap (segmentJSON . slotSegment) assetSlot -- "release" `JSON.kvObjectOrEmpty` (view as :: Maybe Release) <> "name" `JSON.kvObjectOrEmpty` (if publicRestricted then fmap maskRestrictedString (assetSlotName as) else assetSlotName as) <> "permission" JSON..= p <> "size" `JSON.kvObjectOrEmpty` (z `useWhen` (p > PermissionNONE && any (0 <=) z))) where p = dataPermission4 getAssetSlotRelease2 getAssetSlotVolumePermission2 as z = assetSize $ assetRow slotAsset {- assetSlotJSONRestricted :: JSON.ToObject o => AssetSlot -> JSON.Record (Id Asset) o assetSlotJSONRestricted as@AssetSlot{..} = assetJSONRestricted slotAsset JSON..<> foldMap (segmentJSON . slotSegment) assetSlot -- "release" `JSON.kvObjectOrEmpty` (view as :: Maybe Release) <> "name" `JSON.kvObjectOrEmpty` (fmap maskRestrictedString (assetSlotName as)) <> "permission" JSON..= p <> "size" `JSON.kvObjectOrEmpty` (z <? p > PermissionNONE && any (0 <=) z) where p = dataPermission as z = assetSize $ assetRow slotAsset -}
databrary/databrary
src/Model/AssetSlot.hs
agpl-3.0
18,813
0
24
6,371
3,029
1,659
1,370
304
2
binsearch :: Ord a => a -> [a] -> Int binsearch x [] = error "Empty list" binsearch x [y] = 0 binsearch x xs = case (x `elem` xs) of True -> search x 0 (length xs) xs False -> error "Element not in list" -- search -- It takes the element e, lower i and upper boundary j of the list xs -- and returns the index of the given element e. search :: Ord a => a -> Int -> Int -> [a] -> Int search e i j [] = error "empty list" search e i j [x] = 0 search e i j xs | e > li = search e m l xs | e < li = search e 0 m xs | otherwise = m where m = (i + ((j - i) `div` 2)) l = length xs li = head (drop m xs)
romanofski/codesnippets
binSearch/binsearch.hs
unlicense
689
3
12
245
325
152
173
15
2
module Handler.Book where import Import postBookR :: Handler Value postBookR = do book <- (requireJsonBody :: Handler Book) maybeCurrentUserId <- requireAuthId now <- lift getCurrentTime let book' = book { bookCreatedBy = maybeCurrentUserId , bookDateCreated = now } insertedBook <- runDB $ insertEntity book' returnJson insertedBook
PKAuth/pkcloud-accounts
src/Handler/Book.hs
apache-2.0
380
0
11
92
98
49
49
11
1
champernowne :: String champernowne = let cnext n = (show n) ++ cnext (n+1) in cnext 1 -- Champernowne digit n cnum :: Int -> Int cnum n = read [champernowne !! (n - 1)] main = do print $ product $ map cnum [1, 10, 100, 1000, 10000, 100000, 1000000]
ulikoehler/ProjectEuler
Euler40.hs
apache-2.0
265
1
12
66
139
68
71
8
1
module Main where import Api (api) import Api.V1 (v1) import Api.V1.Packages (packages) import Services.Packages (listPackages, readPackage, savePackage) import Network.Wai.Handler.Warp (run) main :: IO () main = run 8080 (api $ v1 $ packages listPackages readPackage savePackage)
haskell-serverless/management
app/Main.hs
apache-2.0
283
0
8
38
99
58
41
8
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module PolyCInfer ( Constraint, TypeError(..), Subst(..), inferTop, --constraintsExpr ) where import PolyCEnv import PolyType import PolySyntax import Control.Monad.Except import Control.Monad.State import Control.Monad.Reader import Control.Monad.Identity import Data.List (nub) import qualified Data.Map as Map import qualified Data.Set as Set data InferState = InferState { count :: Int } type Constraint = (Type, Type) data TypeError = UnificationFail Type Type | InfiniteType TVar Type | UnboundVariable String | Ambigious [Constraint] | UnificationMismatch [Type] [Type] type Infer a = (ReaderT Env (StateT InferState (Except TypeError)) a) inEnv :: (Name, Scheme) -> Infer a -> Infer a inEnv (x, sc) m = do let scope e = remove e x `extend` (x, sc) local scope m newtype Subst = Subst (Map.Map TVar Type) deriving (Eq, Ord, Show, Monoid) class Substitutable a where apply :: Subst -> a -> a ftv :: a -> Set.Set TVar instance Substitutable Type where apply _ (TCon a) = TCon a apply (Subst s) t@(TVar a) = Map.findWithDefault t a s apply s (t1 `TArr` t2) = apply s t1 `TArr` apply s t2 ftv TCon{} = Set.empty ftv (TVar a) = Set.singleton a ftv (t1 `TArr` t2) = ftv t1 `Set.union` ftv t2 instance Substitutable Scheme where apply (Subst s) (Forall as t) = Forall as $ apply s' t where s' = Subst $ foldr Map.delete s as ftv (Forall as t) = ftv t `Set.difference` Set.fromList as instance Substitutable Constraint where apply s (t1, t2) = (apply s t1, apply s t2) ftv (t1, t2) = ftv t1 `Set.union` ftv t2 instance Substitutable a => Substitutable [a] where apply = map . apply ftv = foldr (Set.union . ftv) Set.empty instance Substitutable Env where apply s (TypeEnv env) = TypeEnv $ Map.map (apply s) env ftv (TypeEnv env) = ftv $ Map.elems env letters :: [String] letters = [1..] >>= flip replicateM ['a'..'z'] fresh :: Infer Type fresh = do s <- get put s{count = count s + 1} return $ TVar $ TV (letters !! count s) instantiate :: Scheme -> Infer Type instantiate (Forall as t) = do as' <- mapM (const fresh) as let s = Subst $ Map.fromList $ zip as as' return $ apply s t lookupEnv :: Name -> Infer Type lookupEnv x = do (TypeEnv env) <- ask case Map.lookup x env of Nothing -> throwError $ UnboundVariable x Just s -> instantiate s generalize :: Env -> Type -> Scheme generalize env t = Forall as t where as = Set.toList $ ftv t `Set.difference` ftv env emptySubst :: Subst emptySubst = mempty type Unifier = (Subst, [Constraint]) type Solve a = ExceptT TypeError Identity a occursCheck :: Substitutable a => TVar -> a -> Bool occursCheck a t = a `Set.member` ftv t bind :: TVar -> Type -> Solve Subst bind a t | t == TVar a = return emptySubst | occursCheck a t = throwError $ InfiniteType a t | otherwise = return (Subst $ Map.singleton a t) unifyMany :: [Type] -> [Type] -> Solve Subst unifyMany [] [] = return emptySubst unifyMany (t1 : ts1) (t2 : ts2) = do su1 <- unifies t1 t2 su2 <- unifyMany (apply su1 ts1) (apply su1 ts2) return (su2 `compose` su1) unifyMany t1 t2 = throwError $ UnificationMismatch t1 t2 unifies :: Type -> Type -> Solve Subst unifies t1 t2 | t1 == t2 = return emptySubst unifies (TVar v) t = v `bind` t unifies t (TVar v) = v `bind` t unifies (TArr t1 t2) (TArr t3 t4) = unifyMany [t1, t2] [t3, t4] unifies t1 t2 = throwError $ UnificationFail t1 t2 compose :: Subst -> Subst -> Subst (Subst s1) `compose` (Subst s2) = Subst $ Map.map (apply (Subst s1)) s2 `Map.union` s1 solver :: Unifier -> Solve Subst solver (su, cs) = case cs of [] -> return su ((t1, t2): cs0) -> do su1 <- unifies t1 t2 solver (su1 `compose` su, apply su1 cs0) runSolve :: [Constraint] -> Either TypeError Subst runSolve cs = runIdentity $ runExceptT $ solver st where st = (emptySubst, cs) ops :: Binop -> Type ops Add = typeInt `TArr` (typeInt `TArr` typeInt) ops Mul = typeInt `TArr` (typeInt `TArr` typeInt) ops Sub = typeInt `TArr` (typeInt `TArr` typeInt) ops Eql = typeInt `TArr` (typeInt `TArr` typeBool) infer :: Expr -> Infer (Type, [Constraint]) infer expr = case expr of Lit (LInt _) -> return (typeInt, []) Lit (LBool _) -> return (typeBool, []) Var x -> do t <- lookupEnv x return (t, []) Lam x e -> do tv <- fresh (t, c) <- inEnv (x, Forall [] tv) (infer e) return (tv `TArr` t, c) App e1 e2 -> do (t1, c1, t2, c2, tv) <- inferIndependentAndFresh e1 e2 return (tv, c1 ++ c2 ++ [(t1, t2 `TArr` tv)]) Let x e1 e2 -> do env <- ask (t1, c1) <- infer e1 case runSolve c1 of Left err -> throwError err Right sub -> do let sc = generalize env t1 (t2, c2) <- inEnv (x, sc) (infer e2) return (t2, c1 ++ c2) Fix e1 -> do (t1, c1) <- infer e1 tv <- fresh return (tv, c1 ++ [(tv `TArr` tv, t1)]) Op op e1 e2 -> do (t1, c1, t2, c2, tv) <- inferIndependentAndFresh e1 e2 let u1 = t1 `TArr` (t2 `TArr` tv) u2 = ops op return (tv, c1 ++ c2 ++ [(u1, u2)]) If cond tr fl -> do (t1, c1) <- infer cond (t2, c2) <- infer tr (t3, c3) <- infer fl return (t2, c1 ++ c2 ++ c3 ++ [(t1, typeBool), (t2, t3)]) where inferIndependentAndFresh e1 e2 = do (t1, c1) <- infer e1 (t2, c2) <- infer e2 tv <- fresh return (t1, c1, t2, c2, tv) initInfer :: InferState initInfer = InferState { count = 0 } normalize :: Scheme -> Scheme normalize (Forall _ body) = Forall (map snd ord) (normtype body) where ord = zip (nub $ fv body) (map TV letters) fv (TVar a) = [a] fv (TArr a b) = fv a ++ fv b fv (TCon _) = [] normtype (TArr a b) = TArr (normtype a) (normtype b) normtype (TCon a) = TCon a normtype (TVar a) = case Prelude.lookup a ord of Just x -> TVar x Nothing -> error "type variable not in signature" closeOver :: Type -> Scheme closeOver = normalize . generalize PolyCEnv.empty runInfer :: Env -> Infer (Type, [Constraint]) -> Either TypeError (Type, [Constraint]) runInfer env m = runExcept $ evalStateT (runReaderT m env) initInfer inferExpr :: Env -> Expr -> Either TypeError Scheme inferExpr env ex = case runInfer env (infer ex) of Left err -> Left err Right (ty, cs) -> case runSolve cs of Left err -> Left err Right subst -> Right $ closeOver $ apply subst ty inferTop :: Env -> [(String, Expr)] -> Either TypeError Env inferTop env [] = Right env inferTop env ((name, ex):xs) = case inferExpr env ex of Left err -> Left err Right ty -> inferTop (extend env (name, ty)) xs
toonn/wyah
src/PolyCInfer.hs
bsd-2-clause
6,924
0
18
1,816
3,141
1,623
1,518
193
10
-- | -- Module : Text.Megaparsec.Char -- Copyright : © 2015–2017 Megaparsec contributors -- © 2007 Paolo Martini -- © 1999–2001 Daan Leijen -- License : FreeBSD -- -- Maintainer : Mark Karpov <markkarpov92@gmail.com> -- Stability : experimental -- Portability : non-portable -- -- Commonly used character parsers. {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} module Text.Megaparsec.Char ( -- * Simple parsers newline , crlf , eol , tab , space , space1 -- * Categories of characters , controlChar , spaceChar , upperChar , lowerChar , letterChar , alphaNumChar , printChar , digitChar , octDigitChar , hexDigitChar , markChar , numberChar , punctuationChar , symbolChar , separatorChar , asciiChar , latin1Char , charCategory , categoryName -- * More general parsers , char , char' , anyChar , notChar , oneOf , noneOf , satisfy -- * Sequence of characters , string , string' ) where import Control.Applicative import Data.Char import Data.Function (on) import Data.Functor (void) import Data.List.NonEmpty (NonEmpty (..)) import Data.Proxy import Text.Megaparsec import qualified Data.CaseInsensitive as CI import qualified Data.Set as E #if !MIN_VERSION_base(4,8,0) import Data.Foldable (Foldable (), elem, notElem) import Prelude hiding (elem, notElem) #endif ---------------------------------------------------------------------------- -- Simple parsers -- | Parse a newline character. newline :: (MonadParsec e s m, Token s ~ Char) => m (Token s) newline = char '\n' {-# INLINE newline #-} -- | Parse a carriage return character followed by a newline character. -- Return the sequence of characters parsed. crlf :: forall e s m. (MonadParsec e s m, Token s ~ Char) => m (Tokens s) crlf = string (tokensToChunk (Proxy :: Proxy s) "\r\n") {-# INLINE crlf #-} -- | Parse a CRLF (see 'crlf') or LF (see 'newline') end of line. Return the -- sequence of characters parsed. eol :: forall e s m. (MonadParsec e s m, Token s ~ Char) => m (Tokens s) eol = (tokenToChunk (Proxy :: Proxy s) <$> newline) <|> crlf <?> "end of line" {-# INLINE eol #-} -- | Parse a tab character. tab :: (MonadParsec e s m, Token s ~ Char) => m (Token s) tab = char '\t' {-# INLINE tab #-} -- | Skip /zero/ or more white space characters. -- -- See also: 'skipMany' and 'spaceChar'. space :: (MonadParsec e s m, Token s ~ Char) => m () space = void $ takeWhileP (Just "white space") isSpace {-# INLINE space #-} -- | Skip /one/ or more white space characters. -- -- See also: 'skipSome' and 'spaceChar'. -- -- @since 6.0.0 space1 :: (MonadParsec e s m, Token s ~ Char) => m () space1 = void $ takeWhile1P (Just "white space") isSpace {-# INLINE space1 #-} ---------------------------------------------------------------------------- -- Categories of characters -- | Parse a control character (a non-printing character of the Latin-1 -- subset of Unicode). controlChar :: (MonadParsec e s m, Token s ~ Char) => m (Token s) controlChar = satisfy isControl <?> "control character" {-# INLINE controlChar #-} -- | Parse a Unicode space character, and the control characters: tab, -- newline, carriage return, form feed, and vertical tab. spaceChar :: (MonadParsec e s m, Token s ~ Char) => m (Token s) spaceChar = satisfy isSpace <?> "white space" {-# INLINE spaceChar #-} -- | Parse an upper-case or title-case alphabetic Unicode character. Title -- case is used by a small number of letter ligatures like the -- single-character form of Lj. upperChar :: (MonadParsec e s m, Token s ~ Char) => m (Token s) upperChar = satisfy isUpper <?> "uppercase letter" {-# INLINE upperChar #-} -- | Parse a lower-case alphabetic Unicode character. lowerChar :: (MonadParsec e s m, Token s ~ Char) => m (Token s) lowerChar = satisfy isLower <?> "lowercase letter" {-# INLINE lowerChar #-} -- | Parse an alphabetic Unicode character: lower-case, upper-case, or -- title-case letter, or a letter of case-less scripts\/modifier letter. letterChar :: (MonadParsec e s m, Token s ~ Char) => m (Token s) letterChar = satisfy isLetter <?> "letter" {-# INLINE letterChar #-} -- | Parse an alphabetic or numeric digit Unicode characters. -- -- Note that the numeric digits outside the ASCII range are parsed by this -- parser but not by 'digitChar'. Such digits may be part of identifiers but -- are not used by the printer and reader to represent numbers. alphaNumChar :: (MonadParsec e s m, Token s ~ Char) => m (Token s) alphaNumChar = satisfy isAlphaNum <?> "alphanumeric character" {-# INLINE alphaNumChar #-} -- | Parse a printable Unicode character: letter, number, mark, punctuation, -- symbol or space. printChar :: (MonadParsec e s m, Token s ~ Char) => m (Token s) printChar = satisfy isPrint <?> "printable character" {-# INLINE printChar #-} -- | Parse an ASCII digit, i.e between “0” and “9”. digitChar :: (MonadParsec e s m, Token s ~ Char) => m (Token s) digitChar = satisfy isDigit <?> "digit" {-# INLINE digitChar #-} -- | Parse an octal digit, i.e. between “0” and “7”. octDigitChar :: (MonadParsec e s m, Token s ~ Char) => m (Token s) octDigitChar = satisfy isOctDigit <?> "octal digit" {-# INLINE octDigitChar #-} -- | Parse a hexadecimal digit, i.e. between “0” and “9”, or “a” and “f”, or -- “A” and “F”. hexDigitChar :: (MonadParsec e s m, Token s ~ Char) => m (Token s) hexDigitChar = satisfy isHexDigit <?> "hexadecimal digit" {-# INLINE hexDigitChar #-} -- | Parse a Unicode mark character (accents and the like), which combines -- with preceding characters. markChar :: (MonadParsec e s m, Token s ~ Char) => m (Token s) markChar = satisfy isMark <?> "mark character" {-# INLINE markChar #-} -- | Parse a Unicode numeric character, including digits from various -- scripts, Roman numerals, etc. numberChar :: (MonadParsec e s m, Token s ~ Char) => m (Token s) numberChar = satisfy isNumber <?> "numeric character" {-# INLINE numberChar #-} -- | Parse a Unicode punctuation character, including various kinds of -- connectors, brackets and quotes. punctuationChar :: (MonadParsec e s m, Token s ~ Char) => m (Token s) punctuationChar = satisfy isPunctuation <?> "punctuation" {-# INLINE punctuationChar #-} -- | Parse a Unicode symbol characters, including mathematical and currency -- symbols. symbolChar :: (MonadParsec e s m, Token s ~ Char) => m (Token s) symbolChar = satisfy isSymbol <?> "symbol" {-# INLINE symbolChar #-} -- | Parse a Unicode space and separator characters. separatorChar :: (MonadParsec e s m, Token s ~ Char) => m (Token s) separatorChar = satisfy isSeparator <?> "separator" {-# INLINE separatorChar #-} -- | Parse a character from the first 128 characters of the Unicode -- character set, corresponding to the ASCII character set. asciiChar :: (MonadParsec e s m, Token s ~ Char) => m (Token s) asciiChar = satisfy isAscii <?> "ASCII character" {-# INLINE asciiChar #-} -- | Parse a character from the first 256 characters of the Unicode -- character set, corresponding to the ISO 8859-1 (Latin-1) character set. latin1Char :: (MonadParsec e s m, Token s ~ Char) => m (Token s) latin1Char = satisfy isLatin1 <?> "Latin-1 character" {-# INLINE latin1Char #-} -- | @'charCategory' cat@ parses character in Unicode General Category -- @cat@, see 'Data.Char.GeneralCategory'. charCategory :: (MonadParsec e s m, Token s ~ Char) => GeneralCategory -> m (Token s) charCategory cat = satisfy ((== cat) . generalCategory) <?> categoryName cat {-# INLINE charCategory #-} -- | Return the human-readable name of Unicode General Category. categoryName :: GeneralCategory -> String categoryName = \case UppercaseLetter -> "uppercase letter" LowercaseLetter -> "lowercase letter" TitlecaseLetter -> "titlecase letter" ModifierLetter -> "modifier letter" OtherLetter -> "other letter" NonSpacingMark -> "non-spacing mark" SpacingCombiningMark -> "spacing combining mark" EnclosingMark -> "enclosing mark" DecimalNumber -> "decimal number character" LetterNumber -> "letter number character" OtherNumber -> "other number character" ConnectorPunctuation -> "connector punctuation" DashPunctuation -> "dash punctuation" OpenPunctuation -> "open punctuation" ClosePunctuation -> "close punctuation" InitialQuote -> "initial quote" FinalQuote -> "final quote" OtherPunctuation -> "other punctuation" MathSymbol -> "math symbol" CurrencySymbol -> "currency symbol" ModifierSymbol -> "modifier symbol" OtherSymbol -> "other symbol" Space -> "white space" LineSeparator -> "line separator" ParagraphSeparator -> "paragraph separator" Control -> "control character" Format -> "format character" Surrogate -> "surrogate character" PrivateUse -> "private-use Unicode character" NotAssigned -> "non-assigned Unicode character" ---------------------------------------------------------------------------- -- More general parsers -- | @'char' c@ parses a single character @c@. -- -- > semicolon = char ';' char :: MonadParsec e s m => Token s -> m (Token s) char c = token testChar (Just c) where f x = Tokens (x:|[]) testChar x = if x == c then Right x else Left (pure (f x), E.singleton (f c)) {-# INLINE char #-} -- | The same as 'char' but case-insensitive. This parser returns the -- actually parsed character preserving its case. -- -- >>> parseTest (char' 'e') "E" -- 'E' -- >>> parseTest (char' 'e') "G" -- 1:1: -- unexpected 'G' -- expecting 'E' or 'e' char' :: (MonadParsec e s m, Token s ~ Char) => Token s -> m (Token s) char' c = choice [char c, char (swapCase c)] where swapCase x | isUpper x = toLower x | isLower x = toUpper x | otherwise = x {-# INLINE char' #-} -- | This parser succeeds for any character. Returns the parsed character. anyChar :: MonadParsec e s m => m (Token s) anyChar = satisfy (const True) <?> "character" {-# INLINE anyChar #-} -- | Match any character but the given one. It's a good idea to attach a -- 'label' to this parser manually. -- -- @since 6.0.0 notChar :: MonadParsec e s m => Token s -> m (Token s) notChar c = satisfy (/= c) {-# INLINE notChar #-} -- | @'oneOf' cs@ succeeds if the current character is in the supplied -- collection of characters @cs@. Returns the parsed character. Note that -- this parser cannot automatically generate the “expected” component of -- error message, so usually you should label it manually with 'label' or -- ('<?>'). -- -- See also: 'satisfy'. -- -- > digit = oneOf ['0'..'9'] <?> "digit" -- -- __Performance note__: prefer 'satisfy' when you can because it's faster -- when you have only a couple of tokens to compare to: -- -- > quoteFast = satisfy (\x -> x == '\'' || x == '\"') -- > quoteSlow = oneOf "'\"" oneOf :: (Foldable f, MonadParsec e s m) => f (Token s) -> m (Token s) oneOf cs = satisfy (`elem` cs) {-# INLINE oneOf #-} -- | As the dual of 'oneOf', @'noneOf' cs@ succeeds if the current character -- /not/ in the supplied list of characters @cs@. Returns the parsed -- character. Note that this parser cannot automatically generate the -- “expected” component of error message, so usually you should label it -- manually with 'label' or ('<?>'). -- -- See also: 'satisfy'. -- -- __Performance note__: prefer 'satisfy' and 'notChar' when you can because -- it's faster. noneOf :: (Foldable f, MonadParsec e s m) => f (Token s) -> m (Token s) noneOf cs = satisfy (`notElem` cs) {-# INLINE noneOf #-} -- | The parser @'satisfy' f@ succeeds for any character for which the -- supplied function @f@ returns 'True'. Returns the character that is -- actually parsed. -- -- > digitChar = satisfy isDigit <?> "digit" -- > oneOf cs = satisfy (`elem` cs) satisfy :: MonadParsec e s m => (Token s -> Bool) -- ^ Predicate to apply -> m (Token s) satisfy f = token testChar Nothing where testChar x = if f x then Right x else Left (pure (Tokens (x:|[])), E.empty) {-# INLINE satisfy #-} ---------------------------------------------------------------------------- -- Sequence of characters -- | @'string' s@ parses a sequence of characters given by @s@. Returns the -- parsed string (i.e. @s@). -- -- > divOrMod = string "div" <|> string "mod" string :: MonadParsec e s m => Tokens s -> m (Tokens s) string = tokens (==) {-# INLINE string #-} -- | The same as 'string', but case-insensitive. On success returns string -- cased as actually parsed input. -- -- >>> parseTest (string' "foobar") "foObAr" -- "foObAr" string' :: (MonadParsec e s m, CI.FoldCase (Tokens s)) => Tokens s -> m (Tokens s) string' = tokens ((==) `on` CI.mk) {-# INLINE string' #-}
recursion-ninja/megaparsec
Text/Megaparsec/Char.hs
bsd-2-clause
13,126
0
15
2,711
2,527
1,387
1,140
210
30
{-# LANGUAGE BangPatterns #-} -- --------------------------------------------------------------------------- -- | -- Module : Data.Vector.Algorithms.Tim -- Copyright : (c) 2013-2015 Dan Doel, 2015 Tim Baumann -- Maintainer : Dan Doel <dan.doel@gmail.com> -- Stability : Experimental -- Portability : Non-portable (bang patterns) -- -- Timsort is a complex, adaptive, bottom-up merge sort. It is designed to -- minimize comparisons as much as possible, even at some cost in overhead. -- Thus, it may not be ideal for sorting simple primitive types, for which -- comparison is cheap. It may, however, be significantly faster for sorting -- arrays of complex values (strings would be an example, though an algorithm -- not based on comparison would probably be superior in that particular -- case). -- -- For more information on the details of the algorithm, read on. -- -- The first step of the algorithm is to identify runs of elements. These can -- either be non-decreasing or strictly decreasing sequences of elements in -- the input. Strictly decreasing sequences are used rather than -- non-increasing so that they can be easily reversed in place without the -- sort becoming unstable. -- -- If the natural runs are too short, they are padded to a minimum value. The -- minimum is chosen based on the length of the array, and padded runs are put -- in order using insertion sort. The length of the minimum run size is -- determined as follows: -- -- * If the length of the array is less than 64, the minimum size is the -- length of the array, and insertion sort is used for the entirety -- -- * Otherwise, a value between 32 and 64 is chosen such that N/min is -- either equal to or just below a power of two. This avoids having a -- small chunk left over to merge into much larger chunks at the end. -- -- This is accomplished by taking the the mininum to be the lowest six bits -- containing the highest set bit, and adding one if any other bits are set. -- For instance: -- -- length: 00000000 00000000 00000000 00011011 = 25 -- min: 00000000 00000000 00000000 00011011 = 25 -- -- length: 00000000 11111100 00000000 00000000 = 63 * 2^18 -- min: 00000000 00000000 00000000 00111111 = 63 -- -- length: 00000000 11111100 00000000 00000001 = 63 * 2^18 + 1 -- min: 00000000 00000000 00000000 01000000 = 64 -- -- Once chunks can be produced, the next step is merging them. The indices of -- all runs are stored in a stack. When we identify a new run, we push it onto -- the stack. However, certain invariants are maintained of the stack entries. -- Namely: -- -- if stk = _ :> z :> y :> x -- length x + length y < length z -- -- if stk = _ :> y :> x -- length x < length y -- -- This ensures that the chunks stored are decreasing, and that the chunk -- sizes follow something like the fibonacci sequence, ensuring there at most -- log-many chunks at any time. If pushing a new chunk on the stack would -- violate either of the invariants, we first perform a merge. -- -- If length x + length y >= length z, then y is merged with the smaller of x -- and z (if they are tied, x is chosen, because it is more likely to be -- cached). If, further, length x >= length y then they are merged. These steps -- are repeated until the invariants are established. -- -- The last important piece of the algorithm is the merging. At first, two -- chunks are merged element-wise. However, while doing so, counts are kept of -- the number of elements taken from one chunk without any from its partner. If -- this count exceeds a threshold, the merge switches to searching for elements -- from one chunk in the other, and copying chunks at a time. If these chunks -- start falling below the threshold, the merge switches back to element-wise. -- -- The search used in the merge is also special. It uses a galloping strategy, -- where exponentially increasing indices are tested, and once two such indices -- are determined to bracket the desired value, binary search is used to find -- the exact index within that range. This is asymptotically the same as simply -- using binary search, but is likely to do fewer comparisons than binary search -- would. -- -- One aspect that is not yet implemented from the original Tim sort is the -- adjustment of the above threshold. When galloping saves time, the threshold -- is lowered, and when it doesn't, it is raised. This may be implemented in the -- future. module Data.Vector.Algorithms.Tim ( sort , sortBy ) where import Prelude hiding (length, reverse) import Control.Monad.Primitive import Control.Monad (when) import Data.Bits import Data.Vector.Generic.Mutable import Data.Vector.Algorithms.Search ( gallopingSearchRightPBounds , gallopingSearchLeftPBounds ) import Data.Vector.Algorithms.Insertion (sortByBounds', Comparison) -- | Sorts an array using the default comparison. sort :: (PrimMonad m, MVector v e, Ord e) => v (PrimState m) e -> m () sort = sortBy compare {-# INLINABLE sort #-} -- | Sorts an array using a custom comparison. sortBy :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -> m () sortBy cmp vec | mr == len = iter [0] 0 (error "no merge buffer needed!") | otherwise = new 256 >>= iter [] 0 where len = length vec mr = minrun len iter s i tmpBuf | i >= len = performRemainingMerges s tmpBuf | otherwise = do (order, runLen) <- nextRun cmp vec i len when (order == Descending) $ reverse $ unsafeSlice i runLen vec let runEnd = min len (i + max runLen mr) sortByBounds' cmp vec i (i+runLen) runEnd (s', tmpBuf') <- performMerges (i : s) runEnd tmpBuf iter s' runEnd tmpBuf' runLengthInvariantBroken a b c i = (b - a <= i - b) || (c - b <= i - c) performMerges [b,a] i tmpBuf | i - b >= b - a = merge cmp vec a b i tmpBuf >>= performMerges [a] i performMerges (c:b:a:ss) i tmpBuf | runLengthInvariantBroken a b c i = if i - c <= b - a then merge cmp vec b c i tmpBuf >>= performMerges (b:a:ss) i else do tmpBuf' <- merge cmp vec a b c tmpBuf (ass', tmpBuf'') <- performMerges (a:ss) c tmpBuf' performMerges (c:ass') i tmpBuf'' performMerges s _ tmpBuf = return (s, tmpBuf) performRemainingMerges (b:a:ss) tmpBuf = merge cmp vec a b len tmpBuf >>= performRemainingMerges (a:ss) performRemainingMerges _ _ = return () {-# INLINE sortBy #-} -- | Computes the minimum run size for the sort. The goal is to choose a size -- such that there are almost if not exactly 2^n chunks of that size in the -- array. minrun :: Int -> Int minrun n0 = (n0 `unsafeShiftR` extra) + if (lowMask .&. n0) > 0 then 1 else 0 where -- smear the bits down from the most significant bit !n1 = n0 .|. unsafeShiftR n0 1 !n2 = n1 .|. unsafeShiftR n1 2 !n3 = n2 .|. unsafeShiftR n2 4 !n4 = n3 .|. unsafeShiftR n3 8 !n5 = n4 .|. unsafeShiftR n4 16 !n6 = n5 .|. unsafeShiftR n5 32 -- mask for the bits lower than the 6 highest bits !lowMask = n6 `unsafeShiftR` 6 !extra = popCount lowMask {-# INLINE minrun #-} data Order = Ascending | Descending deriving (Eq, Show) -- | Identify the next run (that is a monotonically increasing or strictly -- decreasing sequence) in the slice [l,u) in vec. Returns the order and length -- of the run. nextRun :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -> Int -- ^ l -> Int -- ^ u -> m (Order, Int) nextRun _ _ i len | i+1 >= len = return (Ascending, 1) nextRun cmp vec i len = do x <- unsafeRead vec i y <- unsafeRead vec (i+1) if x `gt` y then desc y 2 else asc y 2 where gt a b = cmp a b == GT desc _ !k | i + k >= len = return (Descending, k) desc x !k = do y <- unsafeRead vec (i+k) if x `gt` y then desc y (k+1) else return (Descending, k) asc _ !k | i + k >= len = return (Ascending, k) asc x !k = do y <- unsafeRead vec (i+k) if x `gt` y then return (Ascending, k) else asc y (k+1) {-# INLINE nextRun #-} -- | Tests if a temporary buffer has a given size. If not, allocates a new -- buffer and returns it instead of the old temporary buffer. ensureCapacity :: (PrimMonad m, MVector v e) => Int -> v (PrimState m) e -> m (v (PrimState m) e) ensureCapacity l tmpBuf | l <= length tmpBuf = return tmpBuf | otherwise = new (2*l) {-# INLINE ensureCapacity #-} -- | Copy the slice [i,i+len) from vec to tmpBuf. If tmpBuf is not large enough, -- a new buffer is allocated and used. Returns the buffer. cloneSlice :: (PrimMonad m, MVector v e) => Int -- ^ i -> Int -- ^ len -> v (PrimState m) e -- ^ vec -> v (PrimState m) e -- ^ tmpBuf -> m (v (PrimState m) e) cloneSlice i len vec tmpBuf = do tmpBuf' <- ensureCapacity len tmpBuf unsafeCopy (unsafeSlice 0 len tmpBuf') (unsafeSlice i len vec) return tmpBuf' {-# INLINE cloneSlice #-} -- | Number of consecutive times merge chooses the element from the same run -- before galloping mode is activated. minGallop :: Int minGallop = 7 {-# INLINE minGallop #-} -- | Merge the adjacent sorted slices [l,m) and [m,u) in vec. This is done by -- copying the slice [l,m) to a temporary buffer. Returns the (enlarged) -- temporary buffer. mergeLo :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -- ^ vec -> Int -- ^ l -> Int -- ^ m -> Int -- ^ u -> v (PrimState m) e -- ^ tmpBuf -> m (v (PrimState m) e) mergeLo cmp vec l m u tempBuf' = do tmpBuf <- cloneSlice l tmpBufLen vec tempBuf' vi <- unsafeRead tmpBuf 0 vj <- unsafeRead vec m iter tmpBuf 0 m l vi vj minGallop minGallop return tmpBuf where gt a b = cmp a b == GT gte a b = cmp a b /= LT tmpBufLen = m - l iter _ i _ _ _ _ _ _ | i >= tmpBufLen = return () iter tmpBuf i j k _ _ _ _ | j >= u = do let from = unsafeSlice i (tmpBufLen-i) tmpBuf to = unsafeSlice k (tmpBufLen-i) vec unsafeCopy to from iter tmpBuf i j k _ vj 0 _ = do i' <- gallopingSearchLeftPBounds (`gt` vj) tmpBuf i tmpBufLen let gallopLen = i' - i from = unsafeSlice i gallopLen tmpBuf to = unsafeSlice k gallopLen vec unsafeCopy to from vi' <- unsafeRead tmpBuf i' iter tmpBuf i' j (k+gallopLen) vi' vj minGallop minGallop iter tmpBuf i j k vi _ _ 0 = do j' <- gallopingSearchLeftPBounds (`gte` vi) vec j u let gallopLen = j' - j from = slice j gallopLen vec to = slice k gallopLen vec unsafeMove to from vj' <- unsafeRead vec j' iter tmpBuf i j' (k+gallopLen) vi vj' minGallop minGallop iter tmpBuf i j k vi vj ga gb | vj `gte` vi = do unsafeWrite vec k vi vi' <- unsafeRead tmpBuf (i+1) iter tmpBuf (i+1) j (k+1) vi' vj (ga-1) minGallop | otherwise = do unsafeWrite vec k vj vj' <- unsafeRead vec (j+1) iter tmpBuf i (j+1) (k+1) vi vj' minGallop (gb-1) {-# INLINE mergeLo #-} -- | Merge the adjacent sorted slices [l,m) and [m,u) in vec. This is done by -- copying the slice [j,k) to a temporary buffer. Returns the (enlarged) -- temporary buffer. mergeHi :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -- ^ vec -> Int -- ^ l -> Int -- ^ m -> Int -- ^ u -> v (PrimState m) e -- ^ tmpBuf -> m (v (PrimState m) e) mergeHi cmp vec l m u tmpBuf' = do tmpBuf <- cloneSlice m tmpBufLen vec tmpBuf' vi <- unsafeRead vec (m-1) vj <- unsafeRead tmpBuf (tmpBufLen-1) iter tmpBuf (m-1) (tmpBufLen-1) (u-1) vi vj minGallop minGallop return tmpBuf where gt a b = cmp a b == GT gte a b = cmp a b /= LT tmpBufLen = u - m iter _ _ j _ _ _ _ _ | j < 0 = return () iter tmpBuf i j _ _ _ _ _ | i < l = do let from = unsafeSlice 0 (j+1) tmpBuf to = unsafeSlice l (j+1) vec unsafeCopy to from iter tmpBuf i j k _ vj 0 _ = do i' <- gallopingSearchRightPBounds (`gt` vj) vec l i let gallopLen = i - i' from = slice (i'+1) gallopLen vec to = slice (k-gallopLen+1) gallopLen vec unsafeMove to from vi' <- unsafeRead vec i' iter tmpBuf i' j (k-gallopLen) vi' vj minGallop minGallop iter tmpBuf i j k vi _ _ 0 = do j' <- gallopingSearchRightPBounds (`gte` vi) tmpBuf 0 j let gallopLen = j - j' from = slice (j'+1) gallopLen tmpBuf to = slice (k-gallopLen+1) gallopLen vec unsafeCopy to from vj' <- unsafeRead tmpBuf j' iter tmpBuf i j' (k-gallopLen) vi vj' minGallop minGallop iter tmpBuf i j k vi vj ga gb | vi `gt` vj = do unsafeWrite vec k vi vi' <- unsafeRead vec (i-1) iter tmpBuf (i-1) j (k-1) vi' vj (ga-1) minGallop | otherwise = do unsafeWrite vec k vj vj' <- unsafeRead tmpBuf (j-1) iter tmpBuf i (j-1) (k-1) vi vj' minGallop (gb-1) {-# INLINE mergeHi #-} -- | Merge the adjacent sorted slices A=[l,m) and B=[m,u) in vec. This begins -- with galloping searches to find the index of vec[m] in A and the index of -- vec[m-1] in B to reduce the sizes of A and B. Then it uses `mergeHi` or -- `mergeLo` depending on whether A or B is larger. Returns the (enlarged) -- temporary buffer. merge :: (PrimMonad m, MVector v e) => Comparison e -> v (PrimState m) e -- ^ vec -> Int -- ^ l -> Int -- ^ m -> Int -- ^ u -> v (PrimState m) e -- ^ tmpBuf -> m (v (PrimState m) e) merge cmp vec l m u tmpBuf = do vm <- unsafeRead vec m l' <- gallopingSearchLeftPBounds (`gt` vm) vec l m if l' >= m then return tmpBuf else do vn <- unsafeRead vec (m-1) u' <- gallopingSearchRightPBounds (`gte` vn) vec m u if u' <= m then return tmpBuf else (if (m-l') <= (u'-m) then mergeLo else mergeHi) cmp vec l' m u' tmpBuf where gt a b = cmp a b == GT gte a b = cmp a b /= LT {-# INLINE merge #-}
tolysz/vector-algorithms
src/Data/Vector/Algorithms/Tim.hs
bsd-3-clause
14,174
0
16
3,761
3,701
1,893
1,808
209
6
{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE MultiWayIf #-} {-| Module : Servant.Server.Auth.Token.Model Description : Internal operations with RDBMS Copyright : (c) Anton Gushcha, 2016 License : MIT Maintainer : ncrashed@gmail.com Stability : experimental Portability : Portable -} module Servant.Server.Auth.Token.Model( -- * DB entities UserImpl(..) , UserPerm(..) , AuthToken(..) , UserRestore(..) , AuthUserGroup(..) , AuthUserGroupUsers(..) , AuthUserGroupPerms(..) , UserSingleUseCode(..) -- * IDs of entities , UserImplId , UserPermId , AuthTokenId , UserRestoreId , AuthUserGroupId , AuthUserGroupUsersId , AuthUserGroupPermsId , UserSingleUseCodeId -- * DB interface , HasStorage(..) -- * Operations , passToByteString , byteStringToPass -- ** User , userToUserInfo , readUserInfo , readUserInfoByLogin , getUserPermissions , setUserPermissions , createUser , hasPerms , createAdmin , ensureAdmin , patchUser , setUserPassword' -- ** User groups , getUserGroups , setUserGroups , validateGroups , getGroupPermissions , getUserGroupPermissions , getUserAllPermissions , readUserGroup , toAuthUserGroup , insertUserGroup , updateUserGroup , deleteUserGroup , patchUserGroup -- * Low-level , makeUserInfo , readPwHash ) where import Control.Monad import Control.Monad.Cont (ContT) import Control.Monad.Except (ExceptT) import Control.Monad.IO.Class import Control.Monad.Reader (ReaderT) import Control.Monad.Trans.Class (MonadTrans(lift)) import Crypto.PasswordStore import Data.Aeson.WithField import Data.ByteString (ByteString) import Data.Int import Data.Maybe import Data.Monoid import Data.Text (Text) import Data.Time import GHC.Generics import qualified Control.Monad.RWS.Lazy as LRWS import qualified Control.Monad.RWS.Strict as SRWS import qualified Control.Monad.State.Lazy as LS import qualified Control.Monad.State.Strict as SS import qualified Control.Monad.Writer.Lazy as LW import qualified Control.Monad.Writer.Strict as SW import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as BC import qualified Data.Foldable as F import qualified Data.List as L import qualified Data.Sequence as S import qualified Data.Text.Encoding as TE import Servant.API.Auth.Token import Servant.API.Auth.Token.Pagination import Servant.Server.Auth.Token.Common import Servant.Server.Auth.Token.Patch -- | ID of user newtype UserImplId = UserImplId { unUserImplId :: Int64 } deriving (Generic, Show, Eq, Ord) instance ConvertableKey UserImplId where toKey = UserImplId . fromIntegral fromKey = fromIntegral . unUserImplId {-# INLINE toKey #-} {-# INLINE fromKey #-} -- | Internal user implementation data UserImpl = UserImpl { userImplLogin :: !Login -- ^ Unique user login , userImplPassword :: !Password -- ^ Password encrypted with salt , userImplEmail :: !Email -- ^ User email } deriving (Generic, Show) -- | ID of user permission newtype UserPermId = UserPermId { unUserPermId :: Int64 } deriving (Generic, Show, Eq, Ord) instance ConvertableKey UserPermId where toKey = UserPermId . fromIntegral fromKey = fromIntegral . unUserPermId {-# INLINE toKey #-} {-# INLINE fromKey #-} -- | Internal implementation of permission (1-M) data UserPerm = UserPerm { userPermUser :: !UserImplId -- ^ Reference to user , userPermPermission :: !Permission -- ^ Permission tag } deriving (Generic, Show) -- | ID of authorisation token newtype AuthTokenId = AuthTokenId { unAuthTokenId :: Int64 } deriving (Generic, Show, Eq, Ord) instance ConvertableKey AuthTokenId where toKey = AuthTokenId . fromIntegral fromKey = fromIntegral . unAuthTokenId {-# INLINE toKey #-} {-# INLINE fromKey #-} -- | Internal implementation of authorisation token data AuthToken = AuthToken { authTokenValue :: !SimpleToken -- ^ Value of token , authTokenUser :: !UserImplId -- ^ Reference to user of the token , authTokenExpire :: !UTCTime -- ^ When the token expires } deriving (Generic, Show) -- | ID of restoration code newtype UserRestoreId = UserRestoreId { unUserRestoreId :: Int64 } deriving (Generic, Show, Eq, Ord) instance ConvertableKey UserRestoreId where toKey = UserRestoreId . fromIntegral fromKey = fromIntegral . unUserRestoreId {-# INLINE toKey #-} {-# INLINE fromKey #-} -- | Internal implementation of restoration code data UserRestore = UserRestore { userRestoreValue :: !RestoreCode -- ^ Code value , userRestoreUser :: !UserImplId -- ^ Reference to user that the code restores , userRestoreExpire :: !UTCTime -- ^ When the code expires } deriving (Generic, Show) -- | ID of single use code newtype UserSingleUseCodeId = UserSingleUseCodeId { unUserSingleUseCodeId :: Int64 } deriving (Generic, Show, Eq, Ord) instance ConvertableKey UserSingleUseCodeId where toKey = UserSingleUseCodeId . fromIntegral fromKey = fromIntegral . unUserSingleUseCodeId {-# INLINE toKey #-} {-# INLINE fromKey #-} -- | Internal implementation of single use code data UserSingleUseCode = UserSingleUseCode { userSingleUseCodeValue :: !SingleUseCode -- ^ Value of single use code , userSingleUseCodeUser :: !UserImplId -- ^ Reference to user the code is owned by , userSingleUseCodeExpire :: !(Maybe UTCTime) -- ^ When the code expires, 'Nothing' is code that never expires , userSingleUseCodeUsed :: !(Maybe UTCTime) -- ^ When the code was used } deriving (Generic, Show) -- | ID of user group newtype AuthUserGroupId = AuthUserGroupId { unAuthUserGroupId :: Int64 } deriving (Generic, Show, Eq, Ord) instance ConvertableKey AuthUserGroupId where toKey = AuthUserGroupId . fromIntegral fromKey = fromIntegral . unAuthUserGroupId {-# INLINE toKey #-} {-# INLINE fromKey #-} -- | Internal implementation of user group data AuthUserGroup = AuthUserGroup { authUserGroupName :: !Text -- ^ Name of group , authUserGroupParent :: !(Maybe AuthUserGroupId) -- ^ Can be a child of another group } deriving (Generic, Show) -- | ID of user-group binding newtype AuthUserGroupUsersId = AuthUserGroupUsersId { unAuthUserGroupUsersId :: Int64 } deriving (Generic, Show, Eq, Ord) instance ConvertableKey AuthUserGroupUsersId where toKey = AuthUserGroupUsersId . fromIntegral fromKey = fromIntegral . unAuthUserGroupUsersId {-# INLINE toKey #-} {-# INLINE fromKey #-} -- | Implementation of M-M between user and group data AuthUserGroupUsers = AuthUserGroupUsers { authUserGroupUsersGroup :: !AuthUserGroupId , authUserGroupUsersUser :: !UserImplId } deriving (Generic, Show) -- | ID of permission-group binding newtype AuthUserGroupPermsId = AuthUserGroupPermsId { unAuthUserGroupPermsId :: Int64 } deriving (Generic, Show, Eq, Ord) instance ConvertableKey AuthUserGroupPermsId where toKey = AuthUserGroupPermsId . fromIntegral fromKey = fromIntegral . unAuthUserGroupPermsId {-# INLINE toKey #-} {-# INLINE fromKey #-} -- | Implementation of M-M between permission and group data AuthUserGroupPerms = AuthUserGroupPerms { authUserGroupPermsGroup :: AuthUserGroupId , authUserGroupPermsPermission :: Permission } deriving (Generic, Show) -- | Abstract storage interface. External libraries can implement this in terms -- of PostgreSQL or acid-state. class MonadIO m => HasStorage m where -- | Getting user from storage getUserImpl :: UserImplId -> m (Maybe UserImpl) default getUserImpl :: (m ~ t n, MonadTrans t, HasStorage n) => UserImplId -> m (Maybe UserImpl) getUserImpl = lift . getUserImpl -- | Getting user from storage by login getUserImplByLogin :: Login -> m (Maybe (WithId UserImplId UserImpl)) default getUserImplByLogin :: (m ~ t n, MonadTrans t, HasStorage n) => Login -> m (Maybe (WithId UserImplId UserImpl)) getUserImplByLogin = lift . getUserImplByLogin -- | Get paged list of users and total count of users listUsersPaged :: Page -> PageSize -> m ([WithId UserImplId UserImpl], Word) default listUsersPaged :: (m ~ t n, MonadTrans t, HasStorage n) => Page -> PageSize -> m ([WithId UserImplId UserImpl], Word) listUsersPaged = (lift .) . listUsersPaged -- | Get user permissions, ascending by tag getUserImplPermissions :: UserImplId -> m [WithId UserPermId UserPerm] default getUserImplPermissions :: (m ~ t n, MonadTrans t, HasStorage n) => UserImplId -> m [WithId UserPermId UserPerm] getUserImplPermissions = lift . getUserImplPermissions -- | Delete user permissions deleteUserPermissions :: UserImplId -> m () default deleteUserPermissions :: (m ~ t n, MonadTrans t, HasStorage n) => UserImplId -> m () deleteUserPermissions = lift . deleteUserPermissions -- | Insertion of new user permission insertUserPerm :: UserPerm -> m UserPermId default insertUserPerm :: (m ~ t n, MonadTrans t, HasStorage n) => UserPerm -> m UserPermId insertUserPerm = lift . insertUserPerm -- | Insertion of new user insertUserImpl :: UserImpl -> m UserImplId default insertUserImpl :: (m ~ t n, MonadTrans t, HasStorage n) => UserImpl -> m UserImplId insertUserImpl = lift . insertUserImpl -- | Replace user with new value replaceUserImpl :: UserImplId -> UserImpl -> m () default replaceUserImpl :: (m ~ t n, MonadTrans t, HasStorage n) => UserImplId -> UserImpl -> m () replaceUserImpl = (lift .) . replaceUserImpl -- | Delete user by id deleteUserImpl :: UserImplId -> m () default deleteUserImpl :: (m ~ t n, MonadTrans t, HasStorage n) => UserImplId -> m () deleteUserImpl = lift . deleteUserImpl -- | Check whether the user has particular permission hasPerm :: UserImplId -> Permission -> m Bool default hasPerm :: (m ~ t n, MonadTrans t, HasStorage n) => UserImplId -> Permission -> m Bool hasPerm = (lift .) . hasPerm -- | Get any user with given permission getFirstUserByPerm :: Permission -> m (Maybe (WithId UserImplId UserImpl)) default getFirstUserByPerm :: (m ~ t n, MonadTrans t, HasStorage n) => Permission -> m (Maybe (WithId UserImplId UserImpl)) getFirstUserByPerm = lift . getFirstUserByPerm -- | Select user groups and sort them by ascending name selectUserImplGroups :: UserImplId -> m [WithId AuthUserGroupUsersId AuthUserGroupUsers] default selectUserImplGroups :: (m ~ t n, MonadTrans t, HasStorage n) => UserImplId -> m [WithId AuthUserGroupUsersId AuthUserGroupUsers] selectUserImplGroups = lift . selectUserImplGroups -- | Remove user from all groups clearUserImplGroups :: UserImplId -> m () default clearUserImplGroups :: (m ~ t n, MonadTrans t, HasStorage n) => UserImplId -> m () clearUserImplGroups = lift . clearUserImplGroups -- | Add new user group insertAuthUserGroup :: AuthUserGroup -> m AuthUserGroupId default insertAuthUserGroup :: (m ~ t n, MonadTrans t, HasStorage n) => AuthUserGroup -> m AuthUserGroupId insertAuthUserGroup = lift . insertAuthUserGroup -- | Add user to given group insertAuthUserGroupUsers :: AuthUserGroupUsers -> m AuthUserGroupUsersId default insertAuthUserGroupUsers :: (m ~ t n, MonadTrans t, HasStorage n) => AuthUserGroupUsers -> m AuthUserGroupUsersId insertAuthUserGroupUsers = lift . insertAuthUserGroupUsers -- | Add permission to given group insertAuthUserGroupPerms :: AuthUserGroupPerms -> m AuthUserGroupPermsId default insertAuthUserGroupPerms :: (m ~ t n, MonadTrans t, HasStorage n) => AuthUserGroupPerms -> m AuthUserGroupPermsId insertAuthUserGroupPerms = lift . insertAuthUserGroupPerms -- | Find user group by id getAuthUserGroup :: AuthUserGroupId -> m (Maybe AuthUserGroup) default getAuthUserGroup :: (m ~ t n, MonadTrans t, HasStorage n) => AuthUserGroupId -> m (Maybe AuthUserGroup) getAuthUserGroup = lift . getAuthUserGroup -- | Get list of permissions of given group listAuthUserGroupPermissions :: AuthUserGroupId -> m [WithId AuthUserGroupPermsId AuthUserGroupPerms] default listAuthUserGroupPermissions :: (m ~ t n, MonadTrans t, HasStorage n) => AuthUserGroupId -> m [WithId AuthUserGroupPermsId AuthUserGroupPerms] listAuthUserGroupPermissions = lift . listAuthUserGroupPermissions -- | Get list of all users of the group listAuthUserGroupUsers :: AuthUserGroupId -> m [WithId AuthUserGroupUsersId AuthUserGroupUsers] default listAuthUserGroupUsers :: (m ~ t n, MonadTrans t, HasStorage n) => AuthUserGroupId -> m [WithId AuthUserGroupUsersId AuthUserGroupUsers] listAuthUserGroupUsers = lift . listAuthUserGroupUsers -- | Replace record of user group replaceAuthUserGroup :: AuthUserGroupId -> AuthUserGroup -> m () default replaceAuthUserGroup :: (m ~ t n, MonadTrans t, HasStorage n) => AuthUserGroupId -> AuthUserGroup -> m () replaceAuthUserGroup = (lift .) . replaceAuthUserGroup -- | Remove all users from group clearAuthUserGroupUsers :: AuthUserGroupId -> m () default clearAuthUserGroupUsers :: (m ~ t n, MonadTrans t, HasStorage n) => AuthUserGroupId -> m () clearAuthUserGroupUsers = lift . clearAuthUserGroupUsers -- | Remove all permissions from group clearAuthUserGroupPerms :: AuthUserGroupId -> m () default clearAuthUserGroupPerms :: (m ~ t n, MonadTrans t, HasStorage n) => AuthUserGroupId -> m () clearAuthUserGroupPerms = lift . clearAuthUserGroupPerms -- | Delete user group from storage deleteAuthUserGroup :: AuthUserGroupId -> m () default deleteAuthUserGroup :: (m ~ t n, MonadTrans t, HasStorage n) => AuthUserGroupId -> m () deleteAuthUserGroup = lift . deleteAuthUserGroup -- | Get paged list of user groups with total count listGroupsPaged :: Page -> PageSize -> m ([WithId AuthUserGroupId AuthUserGroup], Word) default listGroupsPaged :: (m ~ t n, MonadTrans t, HasStorage n) => Page -> PageSize -> m ([WithId AuthUserGroupId AuthUserGroup], Word) listGroupsPaged = (lift .) . listGroupsPaged -- | Set group name setAuthUserGroupName :: AuthUserGroupId -> Text -> m () default setAuthUserGroupName :: (m ~ t n, MonadTrans t, HasStorage n) => AuthUserGroupId -> Text -> m () setAuthUserGroupName = (lift .) . setAuthUserGroupName -- | Set group parent setAuthUserGroupParent :: AuthUserGroupId -> Maybe AuthUserGroupId -> m () default setAuthUserGroupParent :: (m ~ t n, MonadTrans t, HasStorage n) => AuthUserGroupId -> Maybe AuthUserGroupId -> m () setAuthUserGroupParent = (lift .) . setAuthUserGroupParent -- | Add new single use code insertSingleUseCode :: UserSingleUseCode -> m UserSingleUseCodeId default insertSingleUseCode :: (m ~ t n, MonadTrans t, HasStorage n) => UserSingleUseCode -> m UserSingleUseCodeId insertSingleUseCode = lift . insertSingleUseCode -- | Set usage time of the single use code setSingleUseCodeUsed :: UserSingleUseCodeId -> Maybe UTCTime -> m () default setSingleUseCodeUsed :: (m ~ t n, MonadTrans t, HasStorage n) => UserSingleUseCodeId -> Maybe UTCTime -> m () setSingleUseCodeUsed = (lift .) . setSingleUseCodeUsed -- | Find unused code for the user and expiration time greater than the given time getUnusedCode :: SingleUseCode -> UserImplId -> UTCTime -> m (Maybe (WithId UserSingleUseCodeId UserSingleUseCode)) default getUnusedCode :: (m ~ t n, MonadTrans t, HasStorage n) => SingleUseCode -> UserImplId -> UTCTime -> m (Maybe (WithId UserSingleUseCodeId UserSingleUseCode)) getUnusedCode suc = (lift .) . getUnusedCode suc -- | Invalidate all permanent codes for user and set use time for them invalidatePermanentCodes :: UserImplId -> UTCTime -> m () default invalidatePermanentCodes :: (m ~ t n, MonadTrans t, HasStorage n) => UserImplId -> UTCTime -> m () invalidatePermanentCodes = (lift .) . invalidatePermanentCodes -- | Select last valid restoration code by the given current time selectLastRestoreCode :: UserImplId -> UTCTime -> m (Maybe (WithId UserRestoreId UserRestore)) default selectLastRestoreCode :: (m ~ t n, MonadTrans t, HasStorage n) => UserImplId -> UTCTime -> m (Maybe (WithId UserRestoreId UserRestore)) selectLastRestoreCode = (lift .) . selectLastRestoreCode -- | Insert new restore code insertUserRestore :: UserRestore -> m UserRestoreId default insertUserRestore :: (m ~ t n, MonadTrans t, HasStorage n) => UserRestore -> m UserRestoreId insertUserRestore = lift . insertUserRestore -- | Find unexpired by the time restore code findRestoreCode :: UserImplId -> RestoreCode -> UTCTime -> m (Maybe (WithId UserRestoreId UserRestore)) default findRestoreCode :: (m ~ t n, MonadTrans t, HasStorage n) => UserImplId -> RestoreCode -> UTCTime -> m (Maybe (WithId UserRestoreId UserRestore)) findRestoreCode uid = (lift .) . findRestoreCode uid -- | Replace restore code with new value replaceRestoreCode :: UserRestoreId -> UserRestore -> m () default replaceRestoreCode :: (m ~ t n, MonadTrans t, HasStorage n) => UserRestoreId -> UserRestore -> m () replaceRestoreCode = (lift .) . replaceRestoreCode -- | Find first non-expired by the time token for user findAuthToken :: UserImplId -> UTCTime -> m (Maybe (WithId AuthTokenId AuthToken)) default findAuthToken :: (m ~ t n, MonadTrans t, HasStorage n) => UserImplId -> UTCTime -> m (Maybe (WithId AuthTokenId AuthToken)) findAuthToken = (lift .) . findAuthToken -- | Find token by value findAuthTokenByValue :: SimpleToken -> m (Maybe (WithId AuthTokenId AuthToken)) default findAuthTokenByValue :: (m ~ t n, MonadTrans t, HasStorage n) => SimpleToken -> m (Maybe (WithId AuthTokenId AuthToken)) findAuthTokenByValue = lift . findAuthTokenByValue -- | Insert new token insertAuthToken :: AuthToken -> m AuthTokenId default insertAuthToken :: (m ~ t n, MonadTrans t, HasStorage n) => AuthToken -> m AuthTokenId insertAuthToken = lift . insertAuthToken -- | Replace auth token with new value replaceAuthToken :: AuthTokenId -> AuthToken -> m () default replaceAuthToken :: (m ~ t n, MonadTrans t, HasStorage n) => AuthTokenId -> AuthToken -> m () replaceAuthToken = (lift .) . replaceAuthToken instance HasStorage m => HasStorage (ContT r m) instance HasStorage m => HasStorage (ExceptT e m) instance HasStorage m => HasStorage (ReaderT r m) instance (HasStorage m, Monoid w) => HasStorage (LRWS.RWST r w s m) instance (HasStorage m, Monoid w) => HasStorage (SRWS.RWST r w s m) instance HasStorage m => HasStorage (LS.StateT s m) instance HasStorage m => HasStorage (SS.StateT s m) instance (HasStorage m, Monoid w) => HasStorage (LW.WriterT w m) instance (HasStorage m, Monoid w) => HasStorage (SW.WriterT w m) -- | Convert password to bytestring passToByteString :: Password -> BS.ByteString passToByteString = TE.encodeUtf8 -- | Convert bytestring into password byteStringToPass :: BS.ByteString -> Password byteStringToPass = TE.decodeUtf8 -- | Helper to convert user to response userToUserInfo :: WithId UserImplId UserImpl -> [Permission] -> [UserGroupId] -> RespUserInfo userToUserInfo (WithField uid UserImpl{..}) perms groups = RespUserInfo { respUserId = fromKey uid , respUserLogin = userImplLogin , respUserEmail = userImplEmail , respUserPermissions = perms , respUserGroups = groups } -- | Low level operation for collecting info about user makeUserInfo :: HasStorage m => WithId UserImplId UserImpl -> m RespUserInfo makeUserInfo euser@(WithField uid _) = do perms <- getUserPermissions uid groups <- getUserGroups uid return $ userToUserInfo euser perms groups -- | Get user by id readUserInfo :: HasStorage m => UserId -> m (Maybe RespUserInfo) readUserInfo uid' = do let uid = toKey uid' muser <- getUserImpl uid maybe (return Nothing) (fmap Just . makeUserInfo . WithField uid) $ muser -- | Get user by login readUserInfoByLogin :: HasStorage m => Login -> m (Maybe RespUserInfo) readUserInfoByLogin login = do muser <- getUserImplByLogin login maybe (return Nothing) (fmap Just . makeUserInfo) muser -- | Return list of permissions for the given user (only permissions that are assigned to him directly) getUserPermissions :: HasStorage m => UserImplId -> m [Permission] getUserPermissions uid = do perms <- getUserImplPermissions uid return $ userPermPermission . (\(WithField _ v) -> v) <$> perms -- | Return list of permissions for the given user setUserPermissions :: HasStorage m => UserImplId -> [Permission] -> m () setUserPermissions uid perms = do deleteUserPermissions uid forM_ perms $ void . insertUserPerm . UserPerm uid -- | Try to parse a password hash. readPwHash :: BC.ByteString -> Maybe (Int, BC.ByteString, BC.ByteString) readPwHash pw | length broken /= 4 || algorithm /= "sha256" || BC.length hash /= 44 = Nothing | otherwise = case BC.readInt strBS of Just (strength, _) -> Just (strength, salt, hash) Nothing -> Nothing where broken = BC.split '|' pw [algorithm, strBS, salt, hash] = broken -- | Hash password with given strengh, you can pass already hashed password -- to specified strength makeHashedPassword :: MonadIO m => Int -> Password -> m Password makeHashedPassword strength pass =liftIO $ case readPwHash . passToByteString $ pass of Nothing -> fmap byteStringToPass $ makePassword (passToByteString pass) strength Just (passStrength, passSalt, passHash) -> if | passStrength >= strength -> pure pass | otherwise -> pure $ byteStringToPass $ strengthenPassword (passToByteString pass) strength -- | Creation of new user createUser :: HasStorage m => Int -> Login -> Password -> Email -> [Permission] -> m UserImplId createUser strength login pass email perms = do pass' <- makeHashedPassword strength pass i <- insertUserImpl UserImpl { userImplLogin = login , userImplPassword = pass' , userImplEmail = email } forM_ perms $ void . insertUserPerm . UserPerm i return i -- | Check whether the user has particular permissions hasPerms :: HasStorage m => UserImplId -> [Permission] -> m Bool hasPerms _ [] = return True hasPerms i perms = do perms' <- getUserAllPermissions i return $ and $ (`elem` perms') <$> perms -- | Creates user with admin privileges createAdmin :: HasStorage m => Int -> Login -> Password -> Email -> m UserImplId createAdmin strength login pass email = createUser strength login pass email [adminPerm] -- | Ensures that DB has at leas one admin, if not, creates a new one -- with specified info. ensureAdmin :: HasStorage m => Int -> Login -> Password -> Email -> m () ensureAdmin strength login pass email = do madmin <- getFirstUserByPerm adminPerm whenNothing madmin $ void $ createAdmin strength login pass email -- | Apply patches for user patchUser :: HasStorage m => Int -- ^ Password strength -> PatchUser -> WithId UserImplId UserImpl -> m (WithId UserImplId UserImpl) patchUser strength PatchUser{..} = withPatch patchUserLogin (\l (WithField i u) -> pure $ WithField i u { userImplLogin = l }) >=> withPatch patchUserPassword patchPassword >=> withPatch patchUserEmail (\e (WithField i u) -> pure $ WithField i u { userImplEmail = e }) >=> withPatch patchUserPermissions patchPerms >=> withPatch patchUserGroups patchGroups where patchPassword ps (WithField i u) = WithField <$> pure i <*> setUserPassword' strength ps u patchPerms ps (WithField i u) = do setUserPermissions i ps return $ WithField i u patchGroups gs (WithField i u) = do setUserGroups i gs return $ WithField i u -- | Update password of user setUserPassword' :: MonadIO m => Int -- ^ Password strength -> Password -> UserImpl -> m UserImpl setUserPassword' strength pass user = do pass' <- makeHashedPassword strength pass return $ user { userImplPassword = pass' } -- | Get all groups the user belongs to getUserGroups :: HasStorage m => UserImplId -> m [UserGroupId] getUserGroups i = fmap (fromKey . authUserGroupUsersGroup . (\(WithField _ v) -> v)) <$> selectUserImplGroups i -- | Rewrite all user groups setUserGroups :: HasStorage m => UserImplId -> [UserGroupId] -> m () setUserGroups i gs = do clearUserImplGroups i gs' <- validateGroups gs forM_ gs' $ \g -> void $ insertAuthUserGroupUsers $ AuthUserGroupUsers g i -- | Leave only existing groups validateGroups :: HasStorage m => [UserGroupId] -> m [AuthUserGroupId] validateGroups is = do pairs <- mapM ((\i -> (i,) <$> getAuthUserGroup i) . toKey) is return $ fmap fst . filter (isJust . snd) $ pairs -- | Getting permission of a group and all it parent groups getGroupPermissions :: HasStorage m => UserGroupId -> m [Permission] getGroupPermissions = go S.empty S.empty . toKey where go !visited !perms !i = do mg <- getAuthUserGroup i case mg of Nothing -> return $ F.toList perms Just AuthUserGroup{..} -> do curPerms <- fmap (authUserGroupPermsPermission . (\(WithField _ v) -> v)) <$> listAuthUserGroupPermissions i let perms' = perms <> S.fromList curPerms case authUserGroupParent of Nothing -> return $ F.toList perms' Just pid -> if isJust $ pid `S.elemIndexL` visited then fail $ "Recursive user group graph: " <> show (visited S.|> pid) else go (visited S.|> pid) perms' pid -- | Get user permissions that are assigned to him/her via groups only getUserGroupPermissions :: HasStorage m => UserImplId -> m [Permission] getUserGroupPermissions i = do groups <- getUserGroups i perms <- mapM getGroupPermissions groups return $ L.sort . L.nub . concat $ perms -- | Get user permissions that are assigned to him/her either by direct -- way or by his/her groups. getUserAllPermissions :: HasStorage m => UserImplId -> m [Permission] getUserAllPermissions i = do permsDr <- getUserPermissions i permsGr <- getUserGroupPermissions i return $ L.sort . L.nub $ permsDr <> permsGr -- | Collect full info about user group from RDBMS readUserGroup :: HasStorage m => UserGroupId -> m (Maybe UserGroup) readUserGroup i = do let i' = toKey $ i mu <- getAuthUserGroup i' case mu of Nothing -> return Nothing Just AuthUserGroup{..} -> do users <- fmap (authUserGroupUsersUser . (\(WithField _ v) -> v)) <$> listAuthUserGroupUsers i' perms <- fmap (authUserGroupPermsPermission . (\(WithField _ v) -> v)) <$> listAuthUserGroupPermissions i' return $ Just UserGroup { userGroupName = authUserGroupName , userGroupUsers = fromKey <$> users , userGroupPermissions = perms , userGroupParent = fromKey <$> authUserGroupParent } -- | Helper to convert user group into values of several tables toAuthUserGroup :: UserGroup -> (AuthUserGroup, AuthUserGroupId -> [AuthUserGroupUsers], AuthUserGroupId -> [AuthUserGroupPerms]) toAuthUserGroup UserGroup{..} = (ag, users, perms) where ag = AuthUserGroup { authUserGroupName = userGroupName , authUserGroupParent = toKey <$> userGroupParent } users i = (\ui -> AuthUserGroupUsers i (toKey $ ui)) <$> userGroupUsers perms i = (\perm -> AuthUserGroupPerms i perm) <$> userGroupPermissions -- | Insert user group into RDBMS insertUserGroup :: HasStorage m => UserGroup -> m UserGroupId insertUserGroup u = do let (ag, users, perms) = toAuthUserGroup u i <- insertAuthUserGroup ag forM_ (users i) $ void . insertAuthUserGroupUsers forM_ (perms i) $ void . insertAuthUserGroupPerms return $ fromKey $ i -- | Replace user group with new value updateUserGroup :: HasStorage m => UserGroupId -> UserGroup -> m () updateUserGroup i u = do let i' = toKey $ i let (ag, users, perms) = toAuthUserGroup u replaceAuthUserGroup i' ag clearAuthUserGroupUsers i' clearAuthUserGroupPerms i' forM_ (users i') $ void . insertAuthUserGroupUsers forM_ (perms i') $ void . insertAuthUserGroupPerms -- | Erase user group from RDBMS, cascade deleteUserGroup :: HasStorage m => UserGroupId -> m () deleteUserGroup i = do let i' = toKey $ i clearAuthUserGroupUsers i' clearAuthUserGroupPerms i' deleteAuthUserGroup i' -- | Partial update of user group patchUserGroup :: HasStorage m => UserGroupId -> PatchUserGroup -> m () patchUserGroup i PatchUserGroup{..} = do let i' = toKey i whenJust patchUserGroupName $ setAuthUserGroupName i' whenJust patchUserGroupParent $ setAuthUserGroupParent i' . Just . toKey whenJust patchUserGroupNoParent $ const $ setAuthUserGroupParent i' Nothing whenJust patchUserGroupUsers $ \uids -> do clearAuthUserGroupUsers i' forM_ uids $ insertAuthUserGroupUsers . AuthUserGroupUsers i' . toKey whenJust patchUserGroupPermissions $ \perms -> do clearAuthUserGroupPerms i' forM_ perms $ insertAuthUserGroupPerms . AuthUserGroupPerms i'
NCrashed/servant-auth-token
src/Servant/Server/Auth/Token/Model.hs
bsd-3-clause
28,643
0
22
5,218
7,510
3,941
3,569
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TypeOperators #-} module CommonServer where import Data.Aeson import GHC.Generics ------------------------------ -- File Structure ------------------------------ data File = File { fileName :: FilePath, fileContent :: String } deriving (Eq, Show, Generic) instance ToJSON File instance FromJSON File ------------------------------ -- Server Identity ------------------------------ data Identity = Identity { address :: String, port :: String, serverType :: ServerType } deriving (Eq, Show, Generic) instance ToJSON Identity instance FromJSON Identity ------------------------------ -- Registered Server Types ------------------------------ data ServerType = FileServer | DirectoryServer | ProxyServer | SecurityServer | TransactionServer | IdentityServer | ReplicationServer deriving(Eq, Show, Generic) instance ToJSON ServerType instance FromJSON ServerType ------------------------------ -- Resources Directory ------------------------------ data Resources = Resources { path :: String } deriving (Eq, Show, Generic) instance ToJSON Resources instance FromJSON Resources ------------------------------ -- Client Data ------------------------------ data Client = Client { username :: String, password :: String } deriving (Eq, Show, Generic) instance ToJSON Client instance FromJSON Client ------------------------------ -- Security Token ------------------------------ data Token = Token { sessionId :: String, sessionKey :: String, ticket :: String, client :: Identity } deriving (Eq, Show, Generic) instance ToJSON Token instance FromJSON Token ------------------------------ -- Response Packet ------------------------------ data Response = Response { code :: ResponseCode, server :: Identity } deriving (Eq, Show, Generic) instance ToJSON Response instance FromJSON Response ------------------------------ -- Response Codes ------------------------------ data ResponseCode = FileUploadComplete | FileUploadError | HandshakeSuccessful | HandshakeError | IdentityFound | IdentityNotFound | IdentityReceived deriving(Eq, Show, Generic) instance ToJSON ResponseCode instance FromJSON ResponseCode -- | URI scheme to use data Scheme = Http -- ^ http:// | Https -- ^ https:// deriving() -- | Simple data type to represent the target of HTTP requests -- for servant's automatically-generated clients. data BaseUrl = BaseUrl { baseUrlScheme :: Scheme -- ^ URI scheme to use , baseUrlHost :: String -- ^ host (eg "haskell.org") , baseUrlPort :: Int -- ^ port (eg 80) }
Coggroach/Gluon
.stack-work/intero/intero3163SqV.hs
bsd-3-clause
2,761
0
8
517
511
301
210
75
0
-------------------------------------------------------------------------------- -- | Provides an easy way to combine several items in a list. The applications -- are obvious: -- -- * A post list on a blog -- -- * An image list in a gallery -- -- * A sitemap {-# LANGUAGE TupleSections #-} module Hakyll.Web.Template.List ( applyTemplateList , applyJoinTemplateList , chronological , recentFirst ) where -------------------------------------------------------------------------------- import Control.Monad (liftM) import Data.List (intersperse, sortBy) import Data.Ord (comparing) import System.Locale (defaultTimeLocale) -------------------------------------------------------------------------------- import Hakyll.Core.Compiler import Hakyll.Core.Item import Hakyll.Core.Metadata import Hakyll.Web.Template import Hakyll.Web.Template.Context -------------------------------------------------------------------------------- -- | Generate a string of a listing of pages, after applying a template to each -- page. applyTemplateList :: Template -> Context a -> [Item a] -> Compiler String applyTemplateList = applyJoinTemplateList "" -------------------------------------------------------------------------------- -- | Join a listing of pages with a string in between, after applying a template -- to each page. applyJoinTemplateList :: String -> Template -> Context a -> [Item a] -> Compiler String applyJoinTemplateList delimiter tpl context items = do items' <- mapM (applyTemplate tpl context) items return $ concat $ intersperse delimiter $ map itemBody items' -------------------------------------------------------------------------------- -- | Sort pages chronologically. Uses the same method as 'dateField' for -- extracting the date. chronological :: MonadMetadata m => [Item a] -> m [Item a] chronological = sortByM $ getItemUTC defaultTimeLocale . itemIdentifier where sortByM :: (Monad m, Ord k) => (a -> m k) -> [a] -> m [a] sortByM f xs = liftM (map fst . sortBy (comparing snd)) $ mapM (\x -> liftM (x,) (f x)) xs -------------------------------------------------------------------------------- -- | The reverse of 'chronological' recentFirst :: (MonadMetadata m, Functor m) => [Item a] -> m [Item a] recentFirst = fmap reverse . chronological
freizl/freizl.github.com-old
src/Hakyll/Web/Template/List.hs
bsd-3-clause
2,630
0
13
645
457
252
205
36
1
{-# LANGUAGE LambdaCase #-} module Syntax.Parser where import Syntax.Ast import Bound import Control.Applicative import Data.Attoparsec.Text as Attoparsec import Data.Char import Data.List import Data.Monoid import Data.String import qualified Data.Text as Text par :: String -> Either String (Exp Int Identifier) par str = parseOnly (expression Nothing) (fromString str) ser :: Exp Int Identifier -> String ser = ser' 0 where ser' n = \case Lam ls e -> "(\\" <> intercalate " " (map (\i -> Text.unpack (ls !! i) <> show (n + i)) [0 .. length ls - 1]) <> ". " <> ser' (n + length ls) (instantiate (\i -> Var $ ls !! i <> (Text.pack $ show (n + i))) e) <> ")" Var x -> Text.unpack x App a b -> "(" <> ser' n a <> " " <> ser' n b <> ")" Lit num -> show num identifier :: Parser Identifier identifier = Text.pack <$> do liftA2 (:) (satisfy firstChar) $ many (satisfy consequentChar) where firstChar = liftA2 (||) isAlpha (`elem` "_#") consequentChar = or <$> sequence [firstChar, isNumber, (`elem` "-")] declaration :: Parser Declaration declaration = do ident <- identifier skipSpace _ <- char '=' skipSpace expr <- expression Nothing skipSpace <* char ';' return $ FunctionDeclaration ident expr toplevel :: Parser [Declaration] toplevel = skipSpace *> many (declaration <* skipSpace) <* endOfInput inParen :: Parser a -> Parser a inParen p = char '(' *> p <* char ')' literal :: Parser Int literal = signed decimal expression :: Maybe (Exp Int Identifier) -> Parser (Exp Int Identifier) expression lhs = choice [ do expr <- char '(' *> skipSpace *> expression Nothing <* skipSpace <* char ')' skipSpace expression $ Just (appOrNot expr) , do idents <- char '\\' *> skipSpace *> many1 (identifier <* skipSpace) <* string (fromString "->") skipSpace expr <- expression Nothing return . appOrNot $ Lam idents $ abstract (\i -> elemIndex i idents) expr , do ident <- identifier skipSpace expression $ Just (appOrNot (Var ident)) , do lit <- literal skipSpace expression $ Just (appOrNot (Lit lit)) , case lhs of Nothing -> empty Just l -> return l ] where appOrNot e = case lhs of Nothing -> e Just l -> App l e
exFalso/lambda
src/lib/Syntax/Parser.hs
bsd-3-clause
2,406
0
22
671
919
455
464
66
4
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 Handles @deriving@ clauses on @data@ declarations. -} {-# LANGUAGE CPP #-} module TcDeriv ( tcDeriving, DerivInfo(..), mkDerivInfos ) where #include "HsVersions.h" import HsSyn import DynFlags import TcRnMonad import FamInst import TcDerivInfer import TcDerivUtils import TcValidity( allDistinctTyVars ) import TcClassDcl( tcATDefault, tcMkDeclCtxt ) import TcEnv import TcGenDeriv -- Deriv stuff import InstEnv import Inst import FamInstEnv import TcHsType import TcMType import RnNames( extendGlobalRdrEnvRn ) import RnBinds import RnEnv import RnSource ( addTcgDUs ) import Avail import Unify( tcUnifyTy ) import BasicTypes ( DerivStrategy(..) ) import Class import Type import ErrUtils import DataCon import Maybes import RdrName import Name import NameSet import TyCon import TcType import Var import VarEnv import VarSet import PrelNames import SrcLoc import Util import Outputable import FastString import Bag import Pair import FV (fvVarList, unionFV, mkFVs) import qualified GHC.LanguageExtensions as LangExt import Control.Monad import Data.List {- ************************************************************************ * * Overview * * ************************************************************************ Overall plan ~~~~~~~~~~~~ 1. Convert the decls (i.e. data/newtype deriving clauses, plus standalone deriving) to [EarlyDerivSpec] 2. Infer the missing contexts for the InferTheta's 3. Add the derived bindings, generating InstInfos -} data EarlyDerivSpec = InferTheta (DerivSpec ThetaOrigin) | GivenTheta (DerivSpec ThetaType) -- InferTheta ds => the context for the instance should be inferred -- In this case ds_theta is the list of all the constraints -- needed, such as (Eq [a], Eq a), together with a suitable CtLoc -- to get good error messages. -- The inference process is to reduce this to a -- simpler form (e.g. Eq a) -- -- GivenTheta ds => the exact context for the instance is supplied -- by the programmer; it is ds_theta -- See Note [Inferring the instance context] in TcDerivInfer earlyDSLoc :: EarlyDerivSpec -> SrcSpan earlyDSLoc (InferTheta spec) = ds_loc spec earlyDSLoc (GivenTheta spec) = ds_loc spec splitEarlyDerivSpec :: [EarlyDerivSpec] -> ([DerivSpec ThetaOrigin], [DerivSpec ThetaType]) splitEarlyDerivSpec [] = ([],[]) splitEarlyDerivSpec (InferTheta spec : specs) = case splitEarlyDerivSpec specs of (is, gs) -> (spec : is, gs) splitEarlyDerivSpec (GivenTheta spec : specs) = case splitEarlyDerivSpec specs of (is, gs) -> (is, spec : gs) instance Outputable EarlyDerivSpec where ppr (InferTheta spec) = ppr spec <+> text "(Infer)" ppr (GivenTheta spec) = ppr spec <+> text "(Given)" {- Note [Data decl contexts] ~~~~~~~~~~~~~~~~~~~~~~~~~ Consider data (RealFloat a) => Complex a = !a :+ !a deriving( Read ) We will need an instance decl like: instance (Read a, RealFloat a) => Read (Complex a) where ... The RealFloat in the context is because the read method for Complex is bound to construct a Complex, and doing that requires that the argument type is in RealFloat. But this ain't true for Show, Eq, Ord, etc, since they don't construct a Complex; they only take them apart. Our approach: identify the offending classes, and add the data type context to the instance decl. The "offending classes" are Read, Enum? FURTHER NOTE ADDED March 2002. In fact, Haskell98 now requires that pattern matching against a constructor from a data type with a context gives rise to the constraints for that context -- or at least the thinned version. So now all classes are "offending". Note [Newtype deriving] ~~~~~~~~~~~~~~~~~~~~~~~ Consider this: class C a b instance C [a] Char newtype T = T Char deriving( C [a] ) Notice the free 'a' in the deriving. We have to fill this out to newtype T = T Char deriving( forall a. C [a] ) And then translate it to: instance C [a] Char => C [a] T where ... Note [Newtype deriving superclasses] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (See also Trac #1220 for an interesting exchange on newtype deriving and superclasses.) The 'tys' here come from the partial application in the deriving clause. The last arg is the new instance type. We must pass the superclasses; the newtype might be an instance of them in a different way than the representation type E.g. newtype Foo a = Foo a deriving( Show, Num, Eq ) Then the Show instance is not done via Coercible; it shows Foo 3 as "Foo 3" The Num instance is derived via Coercible, but the Show superclass dictionary must the Show instance for Foo, *not* the Show dictionary gotten from the Num dictionary. So we must build a whole new dictionary not just use the Num one. The instance we want is something like: instance (Num a, Show (Foo a), Eq (Foo a)) => Num (Foo a) where (+) = ((+)@a) ...etc... There may be a coercion needed which we get from the tycon for the newtype when the dict is constructed in TcInstDcls.tcInstDecl2 Note [Unused constructors and deriving clauses] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ See Trac #3221. Consider data T = T1 | T2 deriving( Show ) Are T1 and T2 unused? Well, no: the deriving clause expands to mention both of them. So we gather defs/uses from deriving just like anything else. -} -- | Stuff needed to process a datatype's `deriving` clauses data DerivInfo = DerivInfo { di_rep_tc :: TyCon -- ^ The data tycon for normal datatypes, -- or the *representation* tycon for data families , di_clauses :: [LHsDerivingClause Name] , di_ctxt :: SDoc -- ^ error context } -- | Extract `deriving` clauses of proper data type (skips data families) mkDerivInfos :: [LTyClDecl Name] -> TcM [DerivInfo] mkDerivInfos decls = concatMapM (mk_deriv . unLoc) decls where mk_deriv decl@(DataDecl { tcdLName = L _ data_name , tcdDataDefn = HsDataDefn { dd_derivs = L _ clauses } }) = do { tycon <- tcLookupTyCon data_name ; return [DerivInfo { di_rep_tc = tycon, di_clauses = clauses , di_ctxt = tcMkDeclCtxt decl }] } mk_deriv _ = return [] {- ************************************************************************ * * \subsection[TcDeriv-driver]{Top-level function for \tr{derivings}} * * ************************************************************************ -} tcDeriving :: [DerivInfo] -- All `deriving` clauses -> [LDerivDecl Name] -- All stand-alone deriving declarations -> TcM (TcGblEnv, Bag (InstInfo Name), HsValBinds Name) tcDeriving deriv_infos deriv_decls = recoverM (do { g <- getGblEnv ; return (g, emptyBag, emptyValBindsOut)}) $ do { -- Fish the "deriving"-related information out of the TcEnv -- And make the necessary "equations". is_boot <- tcIsHsBootOrSig ; traceTc "tcDeriving" (ppr is_boot) ; early_specs <- makeDerivSpecs is_boot deriv_infos deriv_decls ; traceTc "tcDeriving 1" (ppr early_specs) ; let (infer_specs, given_specs) = splitEarlyDerivSpec early_specs ; insts1 <- mapM genInst given_specs ; insts2 <- mapM genInst infer_specs ; let (_, deriv_stuff, maybe_fvs) = unzip3 (insts1 ++ insts2) ; loc <- getSrcSpanM ; let (binds, famInsts) = genAuxBinds loc (unionManyBags deriv_stuff) ; dflags <- getDynFlags ; let mk_inst_infos1 = map fstOf3 insts1 ; inst_infos1 <- apply_inst_infos mk_inst_infos1 given_specs -- We must put all the derived type family instances (from both -- infer_specs and given_specs) in the local instance environment -- before proceeding, or else simplifyInstanceContexts might -- get stuck if it has to reason about any of those family instances. -- See Note [Staging of tcDeriving] ; tcExtendLocalFamInstEnv (bagToList famInsts) $ -- NB: only call tcExtendLocalFamInstEnv once, as it performs -- validity checking for all of the family instances you give it. -- If the family instances have errors, calling it twice will result -- in duplicate error messages! do { -- the stand-alone derived instances (@inst_infos1@) are used when -- inferring the contexts for "deriving" clauses' instances -- (@infer_specs@) ; final_specs <- extendLocalInstEnv (map iSpec inst_infos1) $ simplifyInstanceContexts infer_specs ; let mk_inst_infos2 = map fstOf3 insts2 ; inst_infos2 <- apply_inst_infos mk_inst_infos2 final_specs ; let inst_infos = inst_infos1 ++ inst_infos2 ; (inst_info, rn_binds, rn_dus) <- renameDeriv is_boot inst_infos binds ; unless (isEmptyBag inst_info) $ liftIO (dumpIfSet_dyn dflags Opt_D_dump_deriv "Derived instances" (ddump_deriving inst_info rn_binds famInsts)) ; gbl_env <- tcExtendLocalInstEnv (map iSpec (bagToList inst_info)) getGblEnv ; let all_dus = rn_dus `plusDU` usesOnly (NameSet.mkFVs $ catMaybes maybe_fvs) ; return (addTcgDUs gbl_env all_dus, inst_info, rn_binds) } } where ddump_deriving :: Bag (InstInfo Name) -> HsValBinds Name -> Bag FamInst -- ^ Rep type family instances -> SDoc ddump_deriving inst_infos extra_binds repFamInsts = hang (text "Derived class instances:") 2 (vcat (map (\i -> pprInstInfoDetails i $$ text "") (bagToList inst_infos)) $$ ppr extra_binds) $$ hangP "Derived type family instances:" (vcat (map pprRepTy (bagToList repFamInsts))) hangP s x = text "" $$ hang (ptext (sLit s)) 2 x -- Apply the suspended computations given by genInst calls. -- See Note [Staging of tcDeriving] apply_inst_infos :: [ThetaType -> TcM (InstInfo RdrName)] -> [DerivSpec ThetaType] -> TcM [InstInfo RdrName] apply_inst_infos = zipWithM (\f ds -> f (ds_theta ds)) -- Prints the representable type family instance pprRepTy :: FamInst -> SDoc pprRepTy fi@(FamInst { fi_tys = lhs }) = text "type" <+> ppr (mkTyConApp (famInstTyCon fi) lhs) <+> equals <+> ppr rhs where rhs = famInstRHS fi renameDeriv :: Bool -> [InstInfo RdrName] -> Bag (LHsBind RdrName, LSig RdrName) -> TcM (Bag (InstInfo Name), HsValBinds Name, DefUses) renameDeriv is_boot inst_infos bagBinds | is_boot -- If we are compiling a hs-boot file, don't generate any derived bindings -- The inst-info bindings will all be empty, but it's easier to -- just use rn_inst_info to change the type appropriately = do { (rn_inst_infos, fvs) <- mapAndUnzipM rn_inst_info inst_infos ; return ( listToBag rn_inst_infos , emptyValBindsOut, usesOnly (plusFVs fvs)) } | otherwise = discardWarnings $ -- Discard warnings about unused bindings etc setXOptM LangExt.EmptyCase $ -- Derived decls (for empty types) can have -- case x of {} setXOptM LangExt.ScopedTypeVariables $ setXOptM LangExt.KindSignatures $ -- Derived decls (for newtype-deriving) can use ScopedTypeVariables & -- KindSignatures unsetXOptM LangExt.RebindableSyntax $ -- See Note [Avoid RebindableSyntax when deriving] do { -- Bring the extra deriving stuff into scope -- before renaming the instances themselves ; traceTc "rnd" (vcat (map (\i -> pprInstInfoDetails i $$ text "") inst_infos)) ; (aux_binds, aux_sigs) <- mapAndUnzipBagM return bagBinds ; let aux_val_binds = ValBindsIn aux_binds (bagToList aux_sigs) ; rn_aux_lhs <- rnTopBindsLHS emptyFsEnv aux_val_binds ; let bndrs = collectHsValBinders rn_aux_lhs ; envs <- extendGlobalRdrEnvRn (map avail bndrs) emptyFsEnv ; ; setEnvs envs $ do { (rn_aux, dus_aux) <- rnValBindsRHS (TopSigCtxt (mkNameSet bndrs)) rn_aux_lhs ; (rn_inst_infos, fvs_insts) <- mapAndUnzipM rn_inst_info inst_infos ; return (listToBag rn_inst_infos, rn_aux, dus_aux `plusDU` usesOnly (plusFVs fvs_insts)) } } where rn_inst_info :: InstInfo RdrName -> TcM (InstInfo Name, FreeVars) rn_inst_info inst_info@(InstInfo { iSpec = inst , iBinds = InstBindings { ib_binds = binds , ib_tyvars = tyvars , ib_pragmas = sigs , ib_extensions = exts -- Only for type-checking , ib_derived = sa } }) = ASSERT( null sigs ) bindLocalNamesFV tyvars $ do { (rn_binds,_, fvs) <- rnMethodBinds False (is_cls_nm inst) [] binds [] ; let binds' = InstBindings { ib_binds = rn_binds , ib_tyvars = tyvars , ib_pragmas = [] , ib_extensions = exts , ib_derived = sa } ; return (inst_info { iBinds = binds' }, fvs) } {- Note [Newtype deriving and unused constructors] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider this (see Trac #1954): module Bug(P) where newtype P a = MkP (IO a) deriving Monad If you compile with -Wunused-binds you do not expect the warning "Defined but not used: data constructor MkP". Yet the newtype deriving code does not explicitly mention MkP, but it should behave as if you had written instance Monad P where return x = MkP (return x) ...etc... So we want to signal a user of the data constructor 'MkP'. This is the reason behind the (Maybe Name) part of the return type of genInst. Note [Staging of tcDeriving] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here's a tricky corner case for deriving (adapted from Trac #2721): class C a where type T a foo :: a -> T a instance C Int where type T Int = Int foo = id newtype N = N Int deriving C This will produce an instance something like this: instance C N where type T N = T Int foo = coerce (foo :: Int -> T Int) :: N -> T N We must be careful in order to typecheck this code. When determining the context for the instance (in simplifyInstanceContexts), we need to determine that T N and T Int have the same representation, but to do that, the T N instance must be in the local family instance environment. Otherwise, GHC would be unable to conclude that T Int is representationally equivalent to T Int, and simplifyInstanceContexts would get stuck. Previously, tcDeriving would defer adding any derived type family instances to the instance environment until the very end, which meant that simplifyInstanceContexts would get called without all the type family instances it needed in the environment in order to properly simplify instance like the C N instance above. To avoid this scenario, we carefully structure the order of events in tcDeriving. We first call genInst on the standalone derived instance specs and the instance specs obtained from deriving clauses. Note that the return type of genInst is a triple: TcM (ThetaType -> TcM (InstInfo RdrName), BagDerivStuff, Maybe Name) The type family instances are in the BagDerivStuff. The first field of the triple is a suspended computation which, given an instance context, produces the rest of the instance. The fact that it is suspended is important, because right now, we don't have ThetaTypes for the instances that use deriving clauses (only the standalone-derived ones). Now we can can collect the type family instances and extend the local instance environment. At this point, it is safe to run simplifyInstanceContexts on the deriving-clause instance specs, which gives us the ThetaTypes for the deriving-clause instances. Now we can feed all the ThetaTypes to the suspended computations and obtain our InstInfos, at which point tcDeriving is done. An alternative design would be to split up genInst so that the family instances are generated separately from the InstInfos. But this would require carving up a lot of the GHC deriving internals to accommodate the change. On the other hand, we can keep all of the InstInfo and type family instance logic together in genInst simply by converting genInst to continuation-returning style, so we opt for that route. Note [Why we don't pass rep_tc into deriveTyData] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Down in the bowels of mkEqnHelp, we need to convert the fam_tc back into the rep_tc by means of a lookup. And yet we have the rep_tc right here! Why look it up again? Answer: it's just easier this way. We drop some number of arguments from the end of the datatype definition in deriveTyData. The arguments are dropped from the fam_tc. This action may drop a *different* number of arguments passed to the rep_tc, depending on how many free variables, etc., the dropped patterns have. Also, this technique carries over the kind substitution from deriveTyData nicely. Note [Avoid RebindableSyntax when deriving] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The RebindableSyntax extension interacts awkwardly with the derivation of any stock class whose methods require the use of string literals. The Show class is a simple example (see Trac #12688): {-# LANGUAGE RebindableSyntax, OverloadedStrings #-} newtype Text = Text String fromString :: String -> Text fromString = Text data Foo = Foo deriving Show This will generate code to the effect of: instance Show Foo where showsPrec _ Foo = showString "Foo" But because RebindableSyntax and OverloadedStrings are enabled, the "Foo" string literal is now of type Text, not String, which showString doesn't accept! This causes the generated Show instance to fail to typecheck. To avoid this kind of scenario, we simply turn off RebindableSyntax entirely in derived code. ************************************************************************ * * From HsSyn to DerivSpec * * ************************************************************************ @makeDerivSpecs@ fishes around to find the info about needed derived instances. -} makeDerivSpecs :: Bool -> [DerivInfo] -> [LDerivDecl Name] -> TcM [EarlyDerivSpec] makeDerivSpecs is_boot deriv_infos deriv_decls = do { eqns1 <- concatMapM (recoverM (return []) . deriveDerivInfo) deriv_infos ; eqns2 <- concatMapM (recoverM (return []) . deriveStandalone) deriv_decls ; let eqns = eqns1 ++ eqns2 ; if is_boot then -- No 'deriving' at all in hs-boot files do { unless (null eqns) (add_deriv_err (head eqns)) ; return [] } else return eqns } where add_deriv_err eqn = setSrcSpan (earlyDSLoc eqn) $ addErr (hang (text "Deriving not permitted in hs-boot file") 2 (text "Use an instance declaration instead")) ------------------------------------------------------------------ -- | Process a `deriving` clause deriveDerivInfo :: DerivInfo -> TcM [EarlyDerivSpec] deriveDerivInfo (DerivInfo { di_rep_tc = rep_tc, di_clauses = clauses , di_ctxt = err_ctxt }) = addErrCtxt err_ctxt $ concatMapM (deriveForClause . unLoc) clauses where tvs = tyConTyVars rep_tc (tc, tys) = case tyConFamInstSig_maybe rep_tc of -- data family: Just (fam_tc, pats, _) -> (fam_tc, pats) -- NB: deriveTyData wants the *user-specified* -- name. See Note [Why we don't pass rep_tc into deriveTyData] _ -> (rep_tc, mkTyVarTys tvs) -- datatype deriveForClause :: HsDerivingClause Name -> TcM [EarlyDerivSpec] deriveForClause (HsDerivingClause { deriv_clause_strategy = dcs , deriv_clause_tys = L _ preds }) = concatMapM (deriveTyData tvs tc tys (fmap unLoc dcs)) preds ------------------------------------------------------------------ deriveStandalone :: LDerivDecl Name -> TcM [EarlyDerivSpec] -- Standalone deriving declarations -- e.g. deriving instance Show a => Show (T a) -- Rather like tcLocalInstDecl deriveStandalone (L loc (DerivDecl deriv_ty deriv_strat' overlap_mode)) = setSrcSpan loc $ addErrCtxt (standaloneCtxt deriv_ty) $ do { traceTc "Standalone deriving decl for" (ppr deriv_ty) ; let deriv_strat = fmap unLoc deriv_strat' ; traceTc "Deriving strategy (standalone deriving)" $ vcat [ppr deriv_strat, ppr deriv_ty] ; (tvs, theta, cls, inst_tys) <- tcHsClsInstType TcType.InstDeclCtxt deriv_ty ; traceTc "Standalone deriving;" $ vcat [ text "tvs:" <+> ppr tvs , text "theta:" <+> ppr theta , text "cls:" <+> ppr cls , text "tys:" <+> ppr inst_tys ] -- C.f. TcInstDcls.tcLocalInstDecl1 ; checkTc (not (null inst_tys)) derivingNullaryErr ; let cls_tys = take (length inst_tys - 1) inst_tys inst_ty = last inst_tys ; traceTc "Standalone deriving:" $ vcat [ text "class:" <+> ppr cls , text "class types:" <+> ppr cls_tys , text "type:" <+> ppr inst_ty ] ; let bale_out msg = failWithTc (derivingThingErr False cls cls_tys inst_ty deriv_strat msg) ; case tcSplitTyConApp_maybe inst_ty of Just (tc, tc_args) | className cls == typeableClassName -> do warnUselessTypeable return [] | isUnboxedTupleTyCon tc -> bale_out $ unboxedTyConErr "tuple" | isUnboxedSumTyCon tc -> bale_out $ unboxedTyConErr "sum" | isAlgTyCon tc || isDataFamilyTyCon tc -- All other classes -> do { spec <- mkEqnHelp (fmap unLoc overlap_mode) tvs cls cls_tys tc tc_args (Just theta) deriv_strat ; return [spec] } _ -> -- Complain about functions, primitive types, etc, bale_out $ text "The last argument of the instance must be a data or newtype application" } warnUselessTypeable :: TcM () warnUselessTypeable = do { warn <- woptM Opt_WarnDerivingTypeable ; when warn $ addWarnTc (Reason Opt_WarnDerivingTypeable) $ text "Deriving" <+> quotes (ppr typeableClassName) <+> text "has no effect: all types now auto-derive Typeable" } ------------------------------------------------------------------ deriveTyData :: [TyVar] -> TyCon -> [Type] -- LHS of data or data instance -- Can be a data instance, hence [Type] args -> Maybe DerivStrategy -- The optional deriving strategy -> LHsSigType Name -- The deriving predicate -> TcM [EarlyDerivSpec] -- The deriving clause of a data or newtype declaration -- I.e. not standalone deriving deriveTyData tvs tc tc_args deriv_strat deriv_pred = setSrcSpan (getLoc (hsSigType deriv_pred)) $ -- Use loc of the 'deriving' item do { (deriv_tvs, cls, cls_tys, cls_arg_kinds) <- tcExtendTyVarEnv tvs $ tcHsDeriv deriv_pred -- Deriving preds may (now) mention -- the type variables for the type constructor, hence tcExtendTyVarenv -- The "deriv_pred" is a LHsType to take account of the fact that for -- newtype deriving we allow deriving (forall a. C [a]). -- Typeable is special, because Typeable :: forall k. k -> Constraint -- so the argument kind 'k' is not decomposable by splitKindFunTys -- as is the case for all other derivable type classes ; when (length cls_arg_kinds /= 1) $ failWithTc (nonUnaryErr deriv_pred) ; let [cls_arg_kind] = cls_arg_kinds ; if className cls == typeableClassName then do warnUselessTypeable return [] else do { -- Given data T a b c = ... deriving( C d ), -- we want to drop type variables from T so that (C d (T a)) is well-kinded let (arg_kinds, _) = splitFunTys cls_arg_kind n_args_to_drop = length arg_kinds n_args_to_keep = tyConArity tc - n_args_to_drop (tc_args_to_keep, args_to_drop) = splitAt n_args_to_keep tc_args inst_ty_kind = typeKind (mkTyConApp tc tc_args_to_keep) -- Match up the kinds, and apply the resulting kind substitution -- to the types. See Note [Unify kinds in deriving] -- We are assuming the tycon tyvars and the class tyvars are distinct mb_match = tcUnifyTy inst_ty_kind cls_arg_kind enough_args = n_args_to_keep >= 0 -- Check that the result really is well-kinded ; checkTc (enough_args && isJust mb_match) (derivingKindErr tc cls cls_tys cls_arg_kind enough_args) ; let Just kind_subst = mb_match ki_subst_range = getTCvSubstRangeFVs kind_subst all_tkvs = toposortTyVars $ fvVarList $ unionFV (tyCoFVsOfTypes tc_args_to_keep) (FV.mkFVs deriv_tvs) -- See Note [Unification of two kind variables in deriving] unmapped_tkvs = filter (\v -> v `notElemTCvSubst` kind_subst && not (v `elemVarSet` ki_subst_range)) all_tkvs (subst, _) = mapAccumL substTyVarBndr kind_subst unmapped_tkvs final_tc_args = substTys subst tc_args_to_keep final_cls_tys = substTys subst cls_tys tkvs = tyCoVarsOfTypesWellScoped $ final_cls_tys ++ final_tc_args ; traceTc "Deriving strategy (deriving clause)" $ vcat [ppr deriv_strat, ppr deriv_pred] ; traceTc "derivTyData1" (vcat [ pprTyVars tvs, ppr tc, ppr tc_args , ppr deriv_pred , pprTyVars (tyCoVarsOfTypesList tc_args) , ppr n_args_to_keep, ppr n_args_to_drop , ppr inst_ty_kind, ppr cls_arg_kind, ppr mb_match , ppr final_tc_args, ppr final_cls_tys ]) ; traceTc "derivTyData2" (vcat [ ppr tkvs ]) ; checkTc (allDistinctTyVars (mkVarSet tkvs) args_to_drop) -- (a, b, c) (derivingEtaErr cls final_cls_tys (mkTyConApp tc final_tc_args)) -- Check that -- (a) The args to drop are all type variables; eg reject: -- data instance T a Int = .... deriving( Monad ) -- (b) The args to drop are all *distinct* type variables; eg reject: -- class C (a :: * -> * -> *) where ... -- data instance T a a = ... deriving( C ) -- (c) The type class args, or remaining tycon args, -- do not mention any of the dropped type variables -- newtype T a s = ... deriving( ST s ) -- newtype instance K a a = ... deriving( Monad ) -- -- It is vital that the implementation of allDistinctTyVars -- expand any type synonyms. -- See Note [Eta-reducing type synonyms] ; spec <- mkEqnHelp Nothing tkvs cls final_cls_tys tc final_tc_args Nothing deriv_strat ; traceTc "derivTyData" (ppr spec) ; return [spec] } } {- Note [Unify kinds in deriving] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider (Trac #8534) data T a b = MkT a deriving( Functor ) -- where Functor :: (*->*) -> Constraint So T :: forall k. * -> k -> *. We want to get instance Functor (T * (a:*)) where ... Notice the '*' argument to T. Moreover, as well as instantiating T's kind arguments, we may need to instantiate C's kind args. Consider (Trac #8865): newtype T a b = MkT (Either a b) deriving( Category ) where Category :: forall k. (k -> k -> *) -> Constraint We need to generate the instance instance Category * (Either a) where ... Notice the '*' argument to Category. So we need to * drop arguments from (T a b) to match the number of arrows in the (last argument of the) class; * and then *unify* kind of the remaining type against the expected kind, to figure out how to instantiate C's and T's kind arguments. In the two examples, * we unify kind-of( T k (a:k) ) ~ kind-of( Functor ) i.e. (k -> *) ~ (* -> *) to find k:=*. yielding k:=* * we unify kind-of( Either ) ~ kind-of( Category ) i.e. (* -> * -> *) ~ (k -> k -> k) yielding k:=* Now we get a kind substitution. We then need to: 1. Remove the substituted-out kind variables from the quantified kind vars 2. Apply the substitution to the kinds of quantified *type* vars (and extend the substitution to reflect this change) 3. Apply that extended substitution to the non-dropped args (types and kinds) of the type and class Forgetting step (2) caused Trac #8893: data V a = V [a] deriving Functor data P (x::k->*) (a:k) = P (x a) deriving Functor data C (x::k->*) (a:k) = C (V (P x a)) deriving Functor When deriving Functor for P, we unify k to *, but we then want an instance $df :: forall (x:*->*). Functor x => Functor (P * (x:*->*)) and similarly for C. Notice the modified kind of x, both at binding and occurrence sites. This can lead to some surprising results when *visible* kind binder is unified (in contrast to the above examples, in which only non-visible kind binders were considered). Consider this example from Trac #11732: data T k (a :: k) = MkT deriving Functor Since unification yields k:=*, this results in a generated instance of: instance Functor (T *) where ... which looks odd at first glance, since one might expect the instance head to be of the form Functor (T k). Indeed, one could envision an alternative generated instance of: instance (k ~ *) => Functor (T k) where But this does not typecheck as the result of a -XTypeInType design decision: kind equalities are not allowed to be bound in types, only terms. But in essence, the two instance declarations are entirely equivalent, since even though (T k) matches any kind k, the only possibly value for k is *, since anything else is ill-typed. As a result, we can just as comfortably use (T *). Another way of thinking about is: deriving clauses often infer constraints. For example: data S a = S a deriving Eq infers an (Eq a) constraint in the derived instance. By analogy, when we are deriving Functor, we might infer an equality constraint (e.g., k ~ *). The only distinction is that GHC instantiates equality constraints directly during the deriving process. Another quirk of this design choice manifests when typeclasses have visible kind parameters. Consider this code (also from Trac #11732): class Cat k (cat :: k -> k -> *) where catId :: cat a a catComp :: cat b c -> cat a b -> cat a c instance Cat * (->) where catId = id catComp = (.) newtype Fun a b = Fun (a -> b) deriving (Cat k) Even though we requested an derived instance of the form (Cat k Fun), the kind unification will actually generate (Cat * Fun) (i.e., the same thing as if the user wrote deriving (Cat *)). Note [Unification of two kind variables in deriving] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ As a special case of the Note above, it is possible to derive an instance of a poly-kinded typeclass for a poly-kinded datatype. For example: class Category (cat :: k -> k -> *) where newtype T (c :: k -> k -> *) a b = MkT (c a b) deriving Category This case is suprisingly tricky. To see why, let's write out what instance GHC will attempt to derive (using -fprint-explicit-kinds syntax): instance Category k1 (T k2 c) where ... GHC will attempt to unify k1 and k2, which produces a substitution (kind_subst) that looks like [k2 :-> k1]. Importantly, we need to apply this substitution to the type variable binder for c, since its kind is (k2 -> k2 -> *). We used to accomplish this by doing the following: unmapped_tkvs = filter (`notElemTCvSubst` kind_subst) all_tkvs (subst, _) = mapAccumL substTyVarBndr kind_subst unmapped_tkvs Where all_tkvs contains all kind variables in the class and instance types (in this case, all_tkvs = [k1,k2]). But since kind_subst only has one mapping, this results in unmapped_tkvs being [k1], and as a consequence, k1 gets mapped to another kind variable in subst! That is, subst = [k2 :-> k1, k1 :-> k_new]. This is bad, because applying that substitution yields the following instance: instance Category k_new (T k1 c) where ... In other words, keeping k1 in unmapped_tvks taints the substitution, resulting in an ill-kinded instance (this caused Trac #11837). To prevent this, we need to filter out any variable from all_tkvs which either 1. Appears in the domain of kind_subst. notElemTCvSubst checks this. 2. Appears in the range of kind_subst. To do this, we compute the free variable set of the range of kind_subst with getTCvSubstRangeFVs, and check if a kind variable appears in that set. Note [Eta-reducing type synonyms] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ One can instantiate a type in a data family instance with a type synonym that mentions other type variables: type Const a b = a data family Fam (f :: * -> *) (a :: *) newtype instance Fam f (Const a f) = Fam (f a) deriving Functor With -XTypeInType, it is also possible to define kind synonyms, and they can mention other types in a datatype declaration. For example, type Const a b = a newtype T f (a :: Const * f) = T (f a) deriving Functor When deriving, we need to perform eta-reduction analysis to ensure that none of the eta-reduced type variables are mentioned elsewhere in the declaration. But we need to be careful, because if we don't expand through the Const type synonym, we will mistakenly believe that f is an eta-reduced type variable and fail to derive Functor, even though the code above is correct (see Trac #11416, where this was first noticed). For this reason, we expand the type synonyms in the eta-reduced types before doing any analysis. -} mkEqnHelp :: Maybe OverlapMode -> [TyVar] -> Class -> [Type] -> TyCon -> [Type] -> DerivContext -- Just => context supplied (standalone deriving) -- Nothing => context inferred (deriving on data decl) -> Maybe DerivStrategy -> TcRn EarlyDerivSpec -- Make the EarlyDerivSpec for an instance -- forall tvs. theta => cls (tys ++ [ty]) -- where the 'theta' is optional (that's the Maybe part) -- Assumes that this declaration is well-kinded mkEqnHelp overlap_mode tvs cls cls_tys tycon tc_args mtheta deriv_strat = do { -- Find the instance of a data family -- Note [Looking up family instances for deriving] fam_envs <- tcGetFamInstEnvs ; let (rep_tc, rep_tc_args, _co) = tcLookupDataFamInst fam_envs tycon tc_args -- If it's still a data family, the lookup failed; i.e no instance exists ; when (isDataFamilyTyCon rep_tc) (bale_out (text "No family instance for" <+> quotes (pprTypeApp tycon tc_args))) ; dflags <- getDynFlags ; if isDataTyCon rep_tc then mkDataTypeEqn dflags overlap_mode tvs cls cls_tys tycon tc_args rep_tc rep_tc_args mtheta deriv_strat else mkNewTypeEqn dflags overlap_mode tvs cls cls_tys tycon tc_args rep_tc rep_tc_args mtheta deriv_strat } where bale_out msg = failWithTc (derivingThingErr False cls cls_tys (mkTyConApp tycon tc_args) deriv_strat msg) {- Note [Looking up family instances for deriving] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tcLookupFamInstExact is an auxiliary lookup wrapper which requires that looked-up family instances exist. If called with a vanilla tycon, the old type application is simply returned. If we have data instance F () = ... deriving Eq data instance F () = ... deriving Eq then tcLookupFamInstExact will be confused by the two matches; but that can't happen because tcInstDecls1 doesn't call tcDeriving if there are any overlaps. There are two other things that might go wrong with the lookup. First, we might see a standalone deriving clause deriving Eq (F ()) when there is no data instance F () in scope. Note that it's OK to have data instance F [a] = ... deriving Eq (F [(a,b)]) where the match is not exact; the same holds for ordinary data types with standalone deriving declarations. Note [Deriving, type families, and partial applications] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When there are no type families, it's quite easy: newtype S a = MkS [a] -- :CoS :: S ~ [] -- Eta-reduced instance Eq [a] => Eq (S a) -- by coercion sym (Eq (:CoS a)) : Eq [a] ~ Eq (S a) instance Monad [] => Monad S -- by coercion sym (Monad :CoS) : Monad [] ~ Monad S When type familes are involved it's trickier: data family T a b newtype instance T Int a = MkT [a] deriving( Eq, Monad ) -- :RT is the representation type for (T Int a) -- :Co:RT :: :RT ~ [] -- Eta-reduced! -- :CoF:RT a :: T Int a ~ :RT a -- Also eta-reduced! instance Eq [a] => Eq (T Int a) -- easy by coercion -- d1 :: Eq [a] -- d2 :: Eq (T Int a) = d1 |> Eq (sym (:Co:RT a ; :coF:RT a)) instance Monad [] => Monad (T Int) -- only if we can eta reduce??? -- d1 :: Monad [] -- d2 :: Monad (T Int) = d1 |> Monad (sym (:Co:RT ; :coF:RT)) Note the need for the eta-reduced rule axioms. After all, we can write it out instance Monad [] => Monad (T Int) -- only if we can eta reduce??? return x = MkT [x] ... etc ... See Note [Eta reduction for data families] in FamInstEnv %************************************************************************ %* * Deriving data types * * ************************************************************************ -} mkDataTypeEqn :: DynFlags -> Maybe OverlapMode -> [TyVar] -- Universally quantified type variables in the instance -> Class -- Class for which we need to derive an instance -> [Type] -- Other parameters to the class except the last -> TyCon -- Type constructor for which the instance is requested -- (last parameter to the type class) -> [Type] -- Parameters to the type constructor -> TyCon -- rep of the above (for type families) -> [Type] -- rep of the above -> DerivContext -- Context of the instance, for standalone deriving -> Maybe DerivStrategy -- 'Just' if user requests a particular -- deriving strategy. -- Otherwise, 'Nothing'. -> TcRn EarlyDerivSpec -- Return 'Nothing' if error mkDataTypeEqn dflags overlap_mode tvs cls cls_tys tycon tc_args rep_tc rep_tc_args mtheta deriv_strat = case deriv_strat of Just DerivStock -> mk_eqn_stock dflags mtheta cls cls_tys rep_tc go_for_it bale_out Just DerivAnyclass -> mk_eqn_anyclass dflags rep_tc cls go_for_it bale_out -- GeneralizedNewtypeDeriving makes no sense for non-newtypes Just DerivNewtype -> bale_out gndNonNewtypeErr -- Lacking a user-requested deriving strategy, we will try to pick -- between the stock or anyclass strategies Nothing -> mk_eqn_no_mechanism dflags tycon mtheta cls cls_tys rep_tc go_for_it bale_out where go_for_it = mk_data_eqn overlap_mode tvs cls cls_tys tycon tc_args rep_tc rep_tc_args mtheta (isJust deriv_strat) bale_out msg = failWithTc (derivingThingErr False cls cls_tys (mkTyConApp tycon tc_args) deriv_strat msg) mk_data_eqn :: Maybe OverlapMode -> [TyVar] -> Class -> [Type] -> TyCon -> [TcType] -> TyCon -> [TcType] -> DerivContext -> Bool -- True if an explicit deriving strategy keyword was -- provided -> DerivSpecMechanism -- How GHC should proceed attempting to -- derive this instance, determined in -- mkDataTypeEqn/mkNewTypeEqn -> TcM EarlyDerivSpec mk_data_eqn overlap_mode tvs cls cls_tys tycon tc_args rep_tc rep_tc_args mtheta strat_used mechanism = do doDerivInstErrorChecks1 cls cls_tys tycon tc_args rep_tc mtheta strat_used mechanism loc <- getSrcSpanM dfun_name <- newDFunName' cls tycon case mtheta of Nothing -> -- Infer context inferConstraints tvs cls cls_tys inst_ty rep_tc rep_tc_args $ \inferred_constraints tvs' inst_tys' -> return $ InferTheta $ DS { ds_loc = loc , ds_name = dfun_name, ds_tvs = tvs' , ds_cls = cls, ds_tys = inst_tys' , ds_tc = rep_tc , ds_theta = inferred_constraints , ds_overlap = overlap_mode , ds_mechanism = mechanism } Just theta -> do -- Specified context return $ GivenTheta $ DS { ds_loc = loc , ds_name = dfun_name, ds_tvs = tvs , ds_cls = cls, ds_tys = inst_tys , ds_tc = rep_tc , ds_theta = theta , ds_overlap = overlap_mode , ds_mechanism = mechanism } where inst_ty = mkTyConApp tycon tc_args inst_tys = cls_tys ++ [inst_ty] mk_eqn_stock :: DynFlags -> DerivContext -> Class -> [Type] -> TyCon -> (DerivSpecMechanism -> TcRn EarlyDerivSpec) -> (SDoc -> TcRn EarlyDerivSpec) -> TcRn EarlyDerivSpec mk_eqn_stock dflags mtheta cls cls_tys rep_tc go_for_it bale_out = case checkSideConditions dflags mtheta cls cls_tys rep_tc of CanDerive -> mk_eqn_stock' cls go_for_it DerivableClassError msg -> bale_out msg _ -> bale_out (nonStdErr cls) mk_eqn_stock' :: Class -> (DerivSpecMechanism -> TcRn EarlyDerivSpec) -> TcRn EarlyDerivSpec mk_eqn_stock' cls go_for_it = go_for_it $ case hasStockDeriving cls of Just gen_fn -> DerivSpecStock gen_fn Nothing -> pprPanic "mk_eqn_stock': Not a stock class!" (ppr cls) mk_eqn_anyclass :: DynFlags -> TyCon -> Class -> (DerivSpecMechanism -> TcRn EarlyDerivSpec) -> (SDoc -> TcRn EarlyDerivSpec) -> TcRn EarlyDerivSpec mk_eqn_anyclass dflags rep_tc cls go_for_it bale_out = case canDeriveAnyClass dflags rep_tc cls of Nothing -> go_for_it DerivSpecAnyClass Just msg -> bale_out msg mk_eqn_no_mechanism :: DynFlags -> TyCon -> DerivContext -> Class -> [Type] -> TyCon -> (DerivSpecMechanism -> TcRn EarlyDerivSpec) -> (SDoc -> TcRn EarlyDerivSpec) -> TcRn EarlyDerivSpec mk_eqn_no_mechanism dflags tc mtheta cls cls_tys rep_tc go_for_it bale_out = case checkSideConditions dflags mtheta cls cls_tys rep_tc of -- NB: pass the *representation* tycon to checkSideConditions NonDerivableClass msg -> bale_out (dac_error msg) DerivableClassError msg -> bale_out msg CanDerive -> mk_eqn_stock' cls go_for_it DerivableViaInstance -> go_for_it DerivSpecAnyClass where -- See Note [Deriving instances for classes themselves] dac_error msg | isClassTyCon rep_tc = quotes (ppr tc) <+> text "is a type class," <+> text "and can only have a derived instance" $+$ text "if DeriveAnyClass is enabled" | otherwise = nonStdErr cls $$ msg {- ************************************************************************ * * Deriving newtypes * * ************************************************************************ -} mkNewTypeEqn :: DynFlags -> Maybe OverlapMode -> [TyVar] -> Class -> [Type] -> TyCon -> [Type] -> TyCon -> [Type] -> DerivContext -> Maybe DerivStrategy -> TcRn EarlyDerivSpec mkNewTypeEqn dflags overlap_mode tvs cls cls_tys tycon tc_args rep_tycon rep_tc_args mtheta deriv_strat -- Want: instance (...) => cls (cls_tys ++ [tycon tc_args]) where ... = ASSERT( length cls_tys + 1 == classArity cls ) case deriv_strat of Just DerivStock -> mk_eqn_stock dflags mtheta cls cls_tys rep_tycon go_for_it_other bale_out Just DerivAnyclass -> mk_eqn_anyclass dflags rep_tycon cls go_for_it_other bale_out Just DerivNewtype -> -- Since the user explicitly asked for GeneralizedNewtypeDeriving, we -- don't need to perform all of the checks we normally would, such as -- if the class being derived is known to produce ill-roled coercions -- (e.g., Traversable), since we can just derive the instance and let -- it error if need be. -- See Note [Determining whether newtype-deriving is appropriate] if coercion_looks_sensible && newtype_deriving then go_for_it_gnd else bale_out (cant_derive_err $$ if newtype_deriving then empty else suggest_gnd) Nothing | might_derive_via_coercible && ((newtype_deriving && not deriveAnyClass) || std_class_via_coercible cls) -> go_for_it_gnd | otherwise -> case checkSideConditions dflags mtheta cls cls_tys rep_tycon of DerivableClassError msg -- There's a particular corner case where -- -- 1. -XGeneralizedNewtypeDeriving and -XDeriveAnyClass are both -- enabled at the same time -- 2. We're deriving a particular stock derivable class -- (such as Functor) -- -- and the previous cases won't catch it. This fixes the bug -- reported in Trac #10598. | might_derive_via_coercible && newtype_deriving -> go_for_it_gnd -- Otherwise, throw an error for a stock class | might_derive_via_coercible && not newtype_deriving -> bale_out (msg $$ suggest_gnd) | otherwise -> bale_out msg -- Must use newtype deriving or DeriveAnyClass NonDerivableClass _msg -- Too hard, even with newtype deriving | newtype_deriving -> bale_out cant_derive_err -- Try newtype deriving! -- Here we suggest GeneralizedNewtypeDeriving even in cases where -- it may not be applicable. See Trac #9600. | otherwise -> bale_out (non_std $$ suggest_gnd) -- DerivableViaInstance DerivableViaInstance -> do -- If both DeriveAnyClass and GeneralizedNewtypeDeriving are -- enabled, we take the diplomatic approach of defaulting to -- DeriveAnyClass, but emitting a warning about the choice. -- See Note [Deriving strategies] when (newtype_deriving && deriveAnyClass) $ addWarnTc NoReason $ sep [ text "Both DeriveAnyClass and" <+> text "GeneralizedNewtypeDeriving are enabled" , text "Defaulting to the DeriveAnyClass strategy" <+> text "for instantiating" <+> ppr cls ] go_for_it_other DerivSpecAnyClass -- CanDerive CanDerive -> mk_eqn_stock' cls go_for_it_other where newtype_deriving = xopt LangExt.GeneralizedNewtypeDeriving dflags deriveAnyClass = xopt LangExt.DeriveAnyClass dflags go_for_it_gnd = do traceTc "newtype deriving:" $ ppr tycon <+> ppr rep_tys <+> ppr all_preds let mechanism = DerivSpecNewtype rep_inst_ty doDerivInstErrorChecks1 cls cls_tys tycon tc_args rep_tycon mtheta strat_used mechanism dfun_name <- newDFunName' cls tycon loc <- getSrcSpanM case mtheta of Just theta -> return $ GivenTheta $ DS { ds_loc = loc , ds_name = dfun_name, ds_tvs = dfun_tvs , ds_cls = cls, ds_tys = inst_tys , ds_tc = rep_tycon , ds_theta = theta , ds_overlap = overlap_mode , ds_mechanism = mechanism } Nothing -> return $ InferTheta $ DS { ds_loc = loc , ds_name = dfun_name, ds_tvs = dfun_tvs , ds_cls = cls, ds_tys = inst_tys , ds_tc = rep_tycon , ds_theta = all_preds , ds_overlap = overlap_mode , ds_mechanism = mechanism } go_for_it_other = mk_data_eqn overlap_mode tvs cls cls_tys tycon tc_args rep_tycon rep_tc_args mtheta strat_used bale_out = bale_out' newtype_deriving bale_out' b = failWithTc . derivingThingErr b cls cls_tys inst_ty deriv_strat strat_used = isJust deriv_strat non_std = nonStdErr cls suggest_gnd = text "Try GeneralizedNewtypeDeriving for GHC's newtype-deriving extension" -- Here is the plan for newtype derivings. We see -- newtype T a1...an = MkT (t ak+1...an) deriving (.., C s1 .. sm, ...) -- where t is a type, -- ak+1...an is a suffix of a1..an, and are all tyvars -- ak+1...an do not occur free in t, nor in the s1..sm -- (C s1 ... sm) is a *partial applications* of class C -- with the last parameter missing -- (T a1 .. ak) matches the kind of C's last argument -- (and hence so does t) -- The latter kind-check has been done by deriveTyData already, -- and tc_args are already trimmed -- -- We generate the instance -- instance forall ({a1..ak} u fvs(s1..sm)). -- C s1 .. sm t => C s1 .. sm (T a1...ak) -- where T a1...ap is the partial application of -- the LHS of the correct kind and p >= k -- -- NB: the variables below are: -- tc_tvs = [a1, ..., an] -- tyvars_to_keep = [a1, ..., ak] -- rep_ty = t ak .. an -- deriv_tvs = fvs(s1..sm) \ tc_tvs -- tys = [s1, ..., sm] -- rep_fn' = t -- -- Running example: newtype T s a = MkT (ST s a) deriving( Monad ) -- We generate the instance -- instance Monad (ST s) => Monad (T s) where nt_eta_arity = newTyConEtadArity rep_tycon -- For newtype T a b = MkT (S a a b), the TyCon machinery already -- eta-reduces the representation type, so we know that -- T a ~ S a a -- That's convenient here, because we may have to apply -- it to fewer than its original complement of arguments -- Note [Newtype representation] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Need newTyConRhs (*not* a recursive representation finder) -- to get the representation type. For example -- newtype B = MkB Int -- newtype A = MkA B deriving( Num ) -- We want the Num instance of B, *not* the Num instance of Int, -- when making the Num instance of A! rep_inst_ty = newTyConInstRhs rep_tycon rep_tc_args rep_tys = cls_tys ++ [rep_inst_ty] rep_pred = mkClassPred cls rep_tys rep_pred_o = mkPredOrigin DerivOrigin TypeLevel rep_pred -- rep_pred is the representation dictionary, from where -- we are gong to get all the methods for the newtype -- dictionary -- Next we figure out what superclass dictionaries to use -- See Note [Newtype deriving superclasses] above sc_theta :: [PredOrigin] cls_tyvars = classTyVars cls dfun_tvs = tyCoVarsOfTypesWellScoped inst_tys inst_ty = mkTyConApp tycon tc_args inst_tys = cls_tys ++ [inst_ty] sc_theta = mkThetaOrigin DerivOrigin TypeLevel $ substTheta (zipTvSubst cls_tyvars inst_tys) $ classSCTheta cls -- Next we collect constraints for the class methods -- If there are no methods, we don't need any constraints -- Otherwise we need (C rep_ty), for the representation methods, -- and constraints to coerce each individual method meth_theta :: [PredOrigin] meths = classMethods cls meth_theta | null meths = [] -- No methods => no constraints -- (Trac #12814) | otherwise = rep_pred_o : coercible_constraints coercible_constraints = [ mkPredOrigin (DerivOriginCoerce meth t1 t2) TypeLevel (mkReprPrimEqPred t1 t2) | meth <- meths , let (Pair t1 t2) = mkCoerceClassMethEqn cls dfun_tvs inst_tys rep_inst_ty meth ] all_preds :: [PredOrigin] all_preds = meth_theta ++ sc_theta ------------------------------------------------------------------- -- Figuring out whether we can only do this newtype-deriving thing -- See Note [Determining whether newtype-deriving is appropriate] might_derive_via_coercible = not (non_coercible_class cls) && coercion_looks_sensible -- && not (isRecursiveTyCon tycon) -- Note [Recursive newtypes] coercion_looks_sensible = eta_ok -- Check (a) from Note [GND and associated type families] && ats_ok -- Check (b) from Note [GND and associated type families] && isNothing at_without_last_cls_tv -- Check that eta reduction is OK eta_ok = nt_eta_arity <= length rep_tc_args -- The newtype can be eta-reduced to match the number -- of type argument actually supplied -- newtype T a b = MkT (S [a] b) deriving( Monad ) -- Here the 'b' must be the same in the rep type (S [a] b) -- And the [a] must not mention 'b'. That's all handled -- by nt_eta_rity. (adf_tcs, atf_tcs) = partition isDataFamilyTyCon at_tcs ats_ok = null adf_tcs -- We cannot newtype-derive data family instances at_without_last_cls_tv = find (\tc -> last_cls_tv `notElem` tyConTyVars tc) atf_tcs at_tcs = classATs cls last_cls_tv = ASSERT( notNull cls_tyvars ) last cls_tyvars cant_derive_err = vcat [ ppUnless eta_ok eta_msg , ppUnless ats_ok ats_msg , maybe empty at_tv_msg at_without_last_cls_tv] eta_msg = text "cannot eta-reduce the representation type enough" ats_msg = text "the class has associated data types" at_tv_msg at_tc = hang (text "the associated type" <+> quotes (ppr at_tc) <+> text "is not parameterized over the last type variable") 2 (text "of the class" <+> quotes (ppr cls)) {- Note [Recursive newtypes] ~~~~~~~~~~~~~~~~~~~~~~~~~ Newtype deriving works fine, even if the newtype is recursive. e.g. newtype S1 = S1 [T1 ()] newtype T1 a = T1 (StateT S1 IO a ) deriving( Monad ) Remember, too, that type families are currently (conservatively) given a recursive flag, so this also allows newtype deriving to work for type famillies. We used to exclude recursive types, because we had a rather simple minded way of generating the instance decl: newtype A = MkA [A] instance Eq [A] => Eq A -- Makes typechecker loop! But now we require a simple context, so it's ok. Note [Determining whether newtype-deriving is appropriate] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When we see newtype NT = MkNT Foo deriving C we have to decide how to perform the deriving. Do we do newtype deriving, or do we do normal deriving? In general, we prefer to do newtype deriving wherever possible. So, we try newtype deriving unless there's a glaring reason not to. "Glaring reasons not to" include trying to derive a class for which a coercion-based instance doesn't make sense. These classes are listed in the definition of non_coercible_class. They include Show (since it must show the name of the datatype) and Traversable (since a coercion-based Traversable instance is ill-roled). However, non_coercible_class is ignored if the user explicitly requests to derive an instance with GeneralizedNewtypeDeriving using the newtype deriving strategy. In such a scenario, GHC will unquestioningly try to derive the instance via coercions (even if the final generated code is ill-roled!). See Note [Deriving strategies]. Note that newtype deriving might fail, even after we commit to it. This is because the derived instance uses `coerce`, which must satisfy its `Coercible` constraint. This is different than other deriving scenarios, where we're sure that the resulting instance will type-check. Note [GND and associated type families] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It's possible to use GeneralizedNewtypeDeriving (GND) to derive instances for classes with associated type families. A general recipe is: class C x y z where type T y z x op :: x -> [y] -> z newtype N a = MkN <rep-type> deriving( C ) =====> instance C x y <rep-type> => C x y (N a) where type T y (N a) x = T y <rep-type> x op = coerce (op :: x -> [y] -> <rep-type>) However, we must watch out for three things: (a) The class must not contain any data families. If it did, we'd have to generate a fresh data constructor name for the derived data family instance, and it's not clear how to do this. (b) Each associated type family's type variables must mention the last type variable of the class. As an example, you wouldn't be able to use GND to derive an instance of this class: class C a b where type T a But you would be able to derive an instance of this class: class C a b where type T b The difference is that in the latter T mentions the last parameter of C (i.e., it mentions b), but the former T does not. If you tried, e.g., newtype Foo x = Foo x deriving (C a) with the former definition of C, you'd end up with something like this: instance C a (Foo x) where type T a = T ??? This T family instance doesn't mention the newtype (or its representation type) at all, so we disallow such constructions with GND. (c) UndecidableInstances might need to be enabled. Here's a case where it is most definitely necessary: class C a where type T a newtype Loop = Loop MkLoop deriving C =====> instance C Loop where type T Loop = T Loop Obviously, T Loop would send the typechecker into a loop. Unfortunately, you might even need UndecidableInstances even in cases where the typechecker would be guaranteed to terminate. For example: instance C Int where type C Int = Int newtype MyInt = MyInt Int deriving C =====> instance C MyInt where type T MyInt = T Int GHC's termination checker isn't sophisticated enough to conclude that the definition of T MyInt terminates, so UndecidableInstances is required. ************************************************************************ * * \subsection[TcDeriv-normal-binds]{Bindings for the various classes} * * ************************************************************************ After all the trouble to figure out the required context for the derived instance declarations, all that's left is to chug along to produce them. They will then be shoved into @tcInstDecls2@, which will do all its usual business. There are lots of possibilities for code to generate. Here are various general remarks. PRINCIPLES: \begin{itemize} \item We want derived instances of @Eq@ and @Ord@ (both v common) to be ``you-couldn't-do-better-by-hand'' efficient. \item Deriving @Show@---also pretty common--- should also be reasonable good code. \item Deriving for the other classes isn't that common or that big a deal. \end{itemize} PRAGMATICS: \begin{itemize} \item Deriving @Ord@ is done mostly with the 1.3 @compare@ method. \item Deriving @Eq@ also uses @compare@, if we're deriving @Ord@, too. \item We {\em normally} generate code only for the non-defaulted methods; there are some exceptions for @Eq@ and (especially) @Ord@... \item Sometimes we use a @_con2tag_<tycon>@ function, which returns a data constructor's numeric (@Int#@) tag. These are generated by @gen_tag_n_con_binds@, and the heuristic for deciding if one of these is around is given by @hasCon2TagFun@. The examples under the different sections below will make this clearer. \item Much less often (really just for deriving @Ix@), we use a @_tag2con_<tycon>@ function. See the examples. \item We use the renamer!!! Reason: we're supposed to be producing @LHsBinds Name@ for the methods, but that means producing correctly-uniquified code on the fly. This is entirely possible (the @TcM@ monad has a @UniqueSupply@), but it is painful. So, instead, we produce @MonoBinds RdrName@ then heave 'em through the renamer. What a great hack! \end{itemize} -} -- Generate the InstInfo for the required instance paired with the -- *representation* tycon for that instance, -- plus any auxiliary bindings required -- -- Representation tycons differ from the tycon in the instance signature in -- case of instances for indexed families. -- genInst :: DerivSpec theta -> TcM (ThetaType -> TcM (InstInfo RdrName), BagDerivStuff, Maybe Name) -- We must use continuation-returning style here to get the order in which we -- typecheck family instances and derived instances right. -- See Note [Staging of tcDeriving] genInst spec@(DS { ds_tvs = tvs, ds_tc = rep_tycon , ds_mechanism = mechanism, ds_tys = tys , ds_cls = clas, ds_loc = loc }) = do (meth_binds, deriv_stuff) <- genDerivStuff mechanism loc clas rep_tycon tys tvs let mk_inst_info theta = do inst_spec <- newDerivClsInst theta spec doDerivInstErrorChecks2 clas inst_spec mechanism traceTc "newder" (ppr inst_spec) return $ InstInfo { iSpec = inst_spec , iBinds = InstBindings { ib_binds = meth_binds , ib_tyvars = map Var.varName tvs , ib_pragmas = [] , ib_extensions = extensions , ib_derived = True } } return (mk_inst_info, deriv_stuff, unusedConName) where unusedConName :: Maybe Name unusedConName | isDerivSpecNewtype mechanism -- See Note [Newtype deriving and unused constructors] = Just $ getName $ head $ tyConDataCons rep_tycon | otherwise = Nothing extensions :: [LangExt.Extension] extensions | isDerivSpecNewtype mechanism -- Both these flags are needed for higher-rank uses of coerce -- See Note [Newtype-deriving instances] in TcGenDeriv = [LangExt.ImpredicativeTypes, LangExt.RankNTypes] | otherwise = [] doDerivInstErrorChecks1 :: Class -> [Type] -> TyCon -> [Type] -> TyCon -> DerivContext -> Bool -> DerivSpecMechanism -> TcM () doDerivInstErrorChecks1 cls cls_tys tc tc_args rep_tc mtheta strat_used mechanism = do -- For standalone deriving (mtheta /= Nothing), -- check that all the data constructors are in scope... rdr_env <- getGlobalRdrEnv let data_con_names = map dataConName (tyConDataCons rep_tc) hidden_data_cons = not (isWiredInName (tyConName rep_tc)) && (isAbstractTyCon rep_tc || any not_in_scope data_con_names) not_in_scope dc = isNothing (lookupGRE_Name rdr_env dc) addUsedDataCons rdr_env rep_tc -- ...however, we don't perform this check if we're using DeriveAnyClass, -- since it doesn't generate any code that requires use of a data -- constructor. unless (anyclass_strategy || isNothing mtheta || not hidden_data_cons) $ bale_out $ derivingHiddenErr tc where anyclass_strategy = isDerivSpecAnyClass mechanism bale_out msg = failWithTc (derivingThingErrMechanism cls cls_tys (mkTyConApp tc tc_args) strat_used mechanism msg) doDerivInstErrorChecks2 :: Class -> ClsInst -> DerivSpecMechanism -> TcM () doDerivInstErrorChecks2 clas clas_inst mechanism = do { traceTc "doDerivInstErrorChecks2" (ppr clas_inst) ; dflags <- getDynFlags -- Check for Generic instances that are derived with an exotic -- deriving strategy like DAC -- See Note [Deriving strategies] ; when (exotic_mechanism && className clas `elem` genericClassNames) $ do { failIfTc (safeLanguageOn dflags) gen_inst_err ; when (safeInferOn dflags) (recordUnsafeInfer emptyBag) } } where exotic_mechanism = case mechanism of DerivSpecStock{} -> False _ -> True gen_inst_err = hang (text ("Generic instances can only be derived in " ++ "Safe Haskell using the stock strategy.") $+$ text "In the following instance:") 2 (pprInstanceHdr clas_inst) genDerivStuff :: DerivSpecMechanism -> SrcSpan -> Class -> TyCon -> [Type] -> [TyVar] -> TcM (LHsBinds RdrName, BagDerivStuff) genDerivStuff mechanism loc clas tycon inst_tys tyvars = case mechanism of -- See Note [Bindings for Generalised Newtype Deriving] DerivSpecNewtype rhs_ty -> gen_Newtype_binds loc clas tyvars inst_tys rhs_ty -- Try a stock deriver DerivSpecStock gen_fn -> gen_fn loc tycon inst_tys -- If there isn't a stock deriver, our last resort is -XDeriveAnyClass -- (since -XGeneralizedNewtypeDeriving fell through). DerivSpecAnyClass -> do let mini_env = mkVarEnv (classTyVars clas `zip` inst_tys) mini_subst = mkTvSubst (mkInScopeSet (mkVarSet tyvars)) mini_env dflags <- getDynFlags tyfam_insts <- ASSERT2( isNothing (canDeriveAnyClass dflags tycon clas) , ppr "genDerivStuff: bad derived class" <+> ppr clas ) mapM (tcATDefault False loc mini_subst emptyNameSet) (classATItems clas) return ( emptyBag -- No method bindings are needed... , listToBag (map DerivFamInst (concat tyfam_insts)) -- ...but we may need to generate binding for associated type -- family default instances. -- See Note [DeriveAnyClass and default family instances] ) {- Note [Bindings for Generalised Newtype Deriving] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider class Eq a => C a where f :: a -> a newtype N a = MkN [a] deriving( C ) instance Eq (N a) where ... The 'deriving C' clause generates, in effect instance (C [a], Eq a) => C (N a) where f = coerce (f :: [a] -> [a]) This generates a cast for each method, but allows the superclasse to be worked out in the usual way. In this case the superclass (Eq (N a)) will be solved by the explicit Eq (N a) instance. We do *not* create the superclasses by casting the superclass dictionaries for the representation type. See the paper "Safe zero-cost coercions for Haskell". Note [DeriveAnyClass and default family instances] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When a class has a associated type family with a default instance, e.g.: class C a where type T a type T a = Char then there are a couple of scenarios in which a user would expect T a to default to Char. One is when an instance declaration for C is given without an implementation for T: instance C Int Another scenario in which this can occur is when the -XDeriveAnyClass extension is used: data Example = Example deriving (C, Generic) In the latter case, we must take care to check if C has any associated type families with default instances, because -XDeriveAnyClass will never provide an implementation for them. We "fill in" the default instances using the tcATDefault function from TcClsDcl (which is also used in TcInstDcls to handle the empty instance declaration case). Note [Deriving strategies] ~~~~~~~~~~~~~~~~~~~~~~~~~~ GHC has a notion of deriving strategies, which allow the user to explicitly request which approach to use when deriving an instance (enabled with the -XDerivingStrategies language extension). For more information, refer to the original Trac ticket (#10598) or the associated wiki page: https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/DerivingStrategies A deriving strategy can be specified in a deriving clause: newtype Foo = MkFoo Bar deriving newtype C Or in a standalone deriving declaration: deriving anyclass instance C Foo -XDerivingStrategies also allows the use of multiple deriving clauses per data declaration so that a user can derive some instance with one deriving strategy and other instances with another deriving strategy. For example: newtype Baz = Baz Quux deriving (Eq, Ord) deriving stock (Read, Show) deriving newtype (Num, Floating) deriving anyclass C Currently, the deriving strategies are: * stock: Have GHC implement a "standard" instance for a data type, if possible (e.g., Eq, Ord, Generic, Data, Functor, etc.) * anyclass: Use -XDeriveAnyClass * newtype: Use -XGeneralizedNewtypeDeriving If an explicit deriving strategy is not given, GHC has an algorithm it uses to determine which strategy it will actually use. The algorithm is quite long, so it lives in the Haskell wiki at https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/DerivingStrategies ("The deriving strategy resolution algorithm" section). Internally, GHC uses the DerivStrategy datatype to denote a user-requested deriving strategy, and it uses the DerivSpecMechanism datatype to denote what GHC will use to derive the instance after taking the above steps. In other words, GHC will always settle on a DerivSpecMechnism, even if the user did not ask for a particular DerivStrategy (using the algorithm linked to above). Note [Deriving instances for classes themselves] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Much of the code in TcDeriv assumes that deriving only works on data types. But this assumption doesn't hold true for DeriveAnyClass, since it's perfectly reasonable to do something like this: {-# LANGUAGE DeriveAnyClass #-} class C1 (a :: Constraint) where class C2 where deriving instance C1 C2 -- This is equivalent to `instance C1 C2` If DeriveAnyClass isn't enabled in the code above (i.e., it defaults to stock deriving), we throw a special error message indicating that DeriveAnyClass is the only way to go. We don't bother throwing this error if an explicit 'stock' or 'newtype' keyword is used, since both options have their own perfectly sensible error messages in the case of the above code (as C1 isn't a stock derivable class, and C2 isn't a newtype). ************************************************************************ * * \subsection[TcDeriv-taggery-Names]{What con2tag/tag2con functions are available?} * * ************************************************************************ -} nonUnaryErr :: LHsSigType Name -> SDoc nonUnaryErr ct = quotes (ppr ct) <+> text "is not a unary constraint, as expected by a deriving clause" nonStdErr :: Class -> SDoc nonStdErr cls = quotes (ppr cls) <+> text "is not a stock derivable class (Eq, Show, etc.)" gndNonNewtypeErr :: SDoc gndNonNewtypeErr = text "GeneralizedNewtypeDeriving cannot be used on non-newtypes" derivingNullaryErr :: MsgDoc derivingNullaryErr = text "Cannot derive instances for nullary classes" derivingKindErr :: TyCon -> Class -> [Type] -> Kind -> Bool -> MsgDoc derivingKindErr tc cls cls_tys cls_kind enough_args = sep [ hang (text "Cannot derive well-kinded instance of form" <+> quotes (pprClassPred cls cls_tys <+> parens (ppr tc <+> text "..."))) 2 gen1_suggestion , nest 2 (text "Class" <+> quotes (ppr cls) <+> text "expects an argument of kind" <+> quotes (pprKind cls_kind)) ] where gen1_suggestion | cls `hasKey` gen1ClassKey && enough_args = text "(Perhaps you intended to use PolyKinds)" | otherwise = Outputable.empty derivingEtaErr :: Class -> [Type] -> Type -> MsgDoc derivingEtaErr cls cls_tys inst_ty = sep [text "Cannot eta-reduce to an instance of form", nest 2 (text "instance (...) =>" <+> pprClassPred cls (cls_tys ++ [inst_ty]))] derivingThingErr :: Bool -> Class -> [Type] -> Type -> Maybe DerivStrategy -> MsgDoc -> MsgDoc derivingThingErr newtype_deriving clas tys ty deriv_strat why = derivingThingErr' newtype_deriving clas tys ty (isJust deriv_strat) (maybe empty ppr deriv_strat) why derivingThingErrMechanism :: Class -> [Type] -> Type -> Bool -- True if an explicit deriving strategy -- keyword was provided -> DerivSpecMechanism -> MsgDoc -> MsgDoc derivingThingErrMechanism clas tys ty strat_used mechanism why = derivingThingErr' (isDerivSpecNewtype mechanism) clas tys ty strat_used (ppr mechanism) why derivingThingErr' :: Bool -> Class -> [Type] -> Type -> Bool -> MsgDoc -> MsgDoc -> MsgDoc derivingThingErr' newtype_deriving clas tys ty strat_used strat_msg why = sep [(hang (text "Can't make a derived instance of") 2 (quotes (ppr pred) <+> via_mechanism) $$ nest 2 extra) <> colon, nest 2 why] where extra | not strat_used, newtype_deriving = text "(even with cunning GeneralizedNewtypeDeriving)" | otherwise = empty pred = mkClassPred clas (tys ++ [ty]) via_mechanism | strat_used = text "with the" <+> strat_msg <+> text "strategy" | otherwise = empty derivingHiddenErr :: TyCon -> SDoc derivingHiddenErr tc = hang (text "The data constructors of" <+> quotes (ppr tc) <+> ptext (sLit "are not all in scope")) 2 (text "so you cannot derive an instance for it") standaloneCtxt :: LHsSigType Name -> SDoc standaloneCtxt ty = hang (text "In the stand-alone deriving instance for") 2 (quotes (ppr ty)) unboxedTyConErr :: String -> MsgDoc unboxedTyConErr thing = text "The last argument of the instance cannot be an unboxed" <+> text thing
mettekou/ghc
compiler/typecheck/TcDeriv.hs
bsd-3-clause
78,905
3
20
23,397
8,623
4,484
4,139
-1
-1
-- To make GHC stop warning about the Prelude {-# OPTIONS_GHC -Wall -fwarn-tabs -fno-warn-unused-imports #-} {-# LANGUAGE NoImplicitPrelude #-} -- For list fusion on toListBy, and for applicative hiding {-# LANGUAGE CPP #-} ---------------------------------------------------------------- -- ~ 2014.10.09 -- | -- Module : Data.Trie.Internal -- Copyright : Copyright (c) 2008--2015 wren gayle romano -- License : BSD3 -- Maintainer : wren@community.haskell.org -- Stability : provisional -- Portability : portable (with CPP) -- -- Internal definition of the 'Trie' data type and generic functions -- for manipulating them. Almost everything here is re-exported -- from "Data.Trie", which is the preferred API for users. This -- module is for developers who need deeper (and potentially fragile) -- access to the abstract type. ---------------------------------------------------------------- module Data.Trie.Internal ( -- * Data types Trie(), showTrie -- * Functions for 'ByteString's , breakMaximalPrefix -- * Basic functions , empty, null, singleton, size -- * Conversion and folding functions , foldrWithKey, toListBy -- * Query functions , lookupBy_, submap , match_, matches_ -- * Single-value modification , alterBy, alterBy_, adjustBy -- * Combining tries , mergeBy , intersectBy -- * Mapping functions , mapBy , filterMap , contextualMap , contextualMap' , contextualFilterMap , contextualMapBy -- * Priority-queue functions , minAssoc, maxAssoc , updateMinViewBy, updateMaxViewBy ) where import Prelude hiding (lookup, null) import qualified Prelude (lookup, null) import qualified Data.ByteString as S import Data.Trie.BitTwiddle import Data.Trie.ByteStringInternal import Data.Binary import Data.Monoid (Monoid (..)) #if MIN_VERSION_base(4,9,0) import Data.Semigroup (Semigroup (..)) #endif import Control.Monad (liftM, liftM3, liftM4) #ifdef APPLICATIVE_IN_BASE import Control.Applicative (Applicative (..), (<$>)) import Control.Monad (ap) import Data.Foldable (Foldable (foldMap)) import Data.Traversable (Traversable (traverse)) #endif #ifdef __GLASGOW_HASKELL__ import GHC.Exts (build) #endif ---------------------------------------------------------------- ---------------------------------------------------------------- {--------------------------------------------------------------- -- ByteString Big-endian Patricia Trie datatype ---------------------------------------------------------------} {- In our idealized representation, we use a (directed) discrete graph to represent our finite state machine. To organize the set of outgoing arcs from a given Node we have ArcSet be a big-endian patricia tree like Data.IntMap. In order to simplify things we then go through a series of derivations. data Node a = Accept a (ArcSet a) | Reject (Branch a) -- Invariant: Must be Branch data Arc a = Arc ByteString (Node a) -- Invariant: never empty string data ArcSet a = None | One {KeyElem} (Arc a) | Branch {Prefix} {Mask} (ArcSet a) (ArcSet a) data Trie a = Empty | Start ByteString (Node a) -- Maybe empty string [1] [1] If we maintain the invariants on how Nodes recurse, then we can't simply have Start(Node a) because we may have a shared prefix where the prefix itself is not Accept'ed. -- Squash Arc into One: -- (pure good) data Node a = Accept a (ArcSet a) | Reject (Branch a) data ArcSet a = None | Arc ByteString (Node a) | Branch {Prefix} {Mask} (ArcSet a) (ArcSet a) data Trie a = Empty | Start ByteString (Node a) -- Squash Node together: -- (most likely good) data Node a = Node (Maybe a) (ArcSet a) data ArcSet a = None | Arc ByteString (Node a) | Branch {Prefix} {Mask} (ArcSet a) (ArcSet a) data Trie a = Empty | Start ByteString (Node a) -- Squash Empty/None and Arc/Start together: -- (This complicates invariants about non-empty strings and Node's -- recursion, but those can be circumvented by using smart -- constructors.) data Node a = Node (Maybe a) (ArcSet a) data Trie a = Empty | Arc ByteString (Node a) | Branch {Prefix} {Mask} (Trie a) (Trie a) -- Squash Node into Arc: -- (By this point, pure good) -- Unseen invariants: -- * ByteString non-empty, unless Arc is absolute root of tree -- * If (Maybe a) is Nothing, then (Trie a) is Branch -- * With views, we could re-expand Arc into accepting and -- nonaccepting variants -- -- [2] Maybe we shouldn't unpack the ByteString. We could specialize -- or inline the breakMaximalPrefix function to prevent constructing -- a new ByteString from the parts... -} -- | A map from 'ByteString's to @a@. For all the generic functions, -- note that tries are strict in the @Maybe@ but not in @a@. -- -- The 'Monad' instance is strange. If a key @k1@ is a prefix of -- other keys, then results from binding the value at @k1@ will -- override values from longer keys when they collide. If this is -- useful for anything, or if there's a more sensible instance, I'd -- be curious to know. data Trie a = Empty | Arc {-# UNPACK #-} !ByteString !(Maybe a) !(Trie a) | Branch {-# UNPACK #-} !Prefix {-# UNPACK #-} !Mask !(Trie a) !(Trie a) deriving Eq -- Prefix/Mask should be deterministic regardless of insertion order -- TODO: prove this is so. -- TODO? add Ord instance like Data.Map? {--------------------------------------------------------------- -- Trie instances: serialization et cetera ---------------------------------------------------------------} -- This instance does not unveil the innards of our abstract type. -- It doesn't emit truly proper Haskell code though, since ByteStrings -- are printed as (ASCII) Strings, but that's not our fault. (Also -- 'fromList' is in "Data.Trie" instead of here.) instance (Show a) => Show (Trie a) where showsPrec p t = showParen (p > 10) $ ("Data.Trie.fromList "++) . shows (toListBy (,) t) -- | Visualization fuction for debugging. showTrie :: (Show a) => Trie a -> String showTrie t = shows' id t "" where spaces f = map (const ' ') (f "") shows' _ Empty = (".\n"++) shows' ss (Branch p m l r) = let s' = ("--"++) . shows p . (","++) . shows m . ("-+"++) ss' = ss . (tail (spaces s') ++) in s' . shows' (ss' . ("|"++)) l . ss' . ("|\n"++) . ss' . ("`"++) . shows' (ss' . (" "++)) r shows' ss (Arc k mv t') = let s' = ("--"++) . shows k . maybe id (\v -> ("-("++) . shows v . (")"++)) mv . ("--"++) in s' . shows' (ss . (spaces s' ++)) t' -- TODO?? a Read instance? hrm... should I? -- TODO: consider an instance more like the new one for Data.Map. Better? instance (Binary a) => Binary (Trie a) where put Empty = do put (0 :: Word8) put (Arc k m t) = do put (1 :: Word8); put k; put m; put t put (Branch p m l r) = do put (2 :: Word8); put p; put m; put l; put r get = do tag <- get :: Get Word8 case tag of 0 -> return Empty 1 -> liftM3 Arc get get get _ -> liftM4 Branch get get get get {--------------------------------------------------------------- -- Trie instances: Abstract Nonsense ---------------------------------------------------------------} instance Functor Trie where fmap f = go where go Empty = Empty go (Arc k Nothing t) = Arc k Nothing (go t) go (Arc k (Just v) t) = Arc k (Just (f v)) (go t) go (Branch p m l r) = Branch p m (go l) (go r) #ifdef APPLICATIVE_IN_BASE instance Foldable Trie where -- If our definition of foldr is so much faster than the Endo -- default, then maybe we should remove this and use the default -- foldMap based on foldr foldMap f = go where go Empty = mempty go (Arc _ Nothing t) = go t go (Arc _ (Just v) t) = f v `mappend` go t go (Branch _ _ l r) = go l `mappend` go r {- This definition is much faster, but it's also wrong -- (or at least different than foldrWithKey) foldr f = \z t -> go t id z where go Empty k x = k x go (Branch _ _ l r) k x = go r (go l k) x go (Arc _ Nothing t) k x = go t k x go (Arc _ (Just v) t) k x = go t k (f v x) foldl f = \z t -> go t id z where go Empty k x = k x go (Branch _ _ l r) k x = go l (go r k) x go (Arc _ Nothing t) k x = go t k x go (Arc _ (Just v) t) k x = go t k (f x v) -} -- TODO: newtype Keys = K Trie ; instance Foldable Keys -- TODO: newtype Assoc = A Trie ; instance Foldable Assoc instance Traversable Trie where traverse f = go where go Empty = pure Empty go (Arc k Nothing t) = Arc k Nothing <$> go t go (Arc k (Just v) t) = Arc k . Just <$> f v <*> go t go (Branch p m l r) = Branch p m <$> go l <*> go r instance Applicative Trie where pure = return (<*>) = ap #endif -- Does this even make sense? It's not nondeterminism like lists -- and sets. If no keys were prefixes of other keys it'd make sense -- as a decision-tree; but since keys /can/ prefix, tries formed -- from shorter keys can shadow the results from longer keys due -- to the 'unionL'. It does seem to follow the laws though... What -- computation could this possibly represent? -- -- 1. return x >>= f == f x -- 2. m >>= return == m -- 3. (m >>= f) >>= g == m >>= (\x -> f x >>= g) instance Monad Trie where return = singleton S.empty (>>=) Empty _ = empty (>>=) (Branch p m l r) f = branch p m (l >>= f) (r >>= f) (>>=) (Arc k Nothing t) f = arc k Nothing (t >>= f) (>>=) (Arc k (Just v) t) f = arc k Nothing (f v `unionL` (t >>= f)) where unionL = mergeBy (\x _ -> Just x) #if MIN_VERSION_base(4,9,0) instance (Semigroup a) => Semigroup (Trie a) where (<>) = mergeBy $ \x y -> Just (x <> y) #endif -- This instance is more sensible than Data.IntMap and Data.Map's instance (Monoid a) => Monoid (Trie a) where mempty = empty #if !(MIN_VERSION_base(4,11,0)) mappend = mergeBy $ \x y -> Just (x `mappend` y) #endif -- Since the Monoid instance isn't natural in @a@, I can't think -- of any other sensible instance for MonadPlus. It's as specious -- as Maybe, IO, and STM's instances though. -- -- MonadPlus laws: <http://www.haskell.org/haskellwiki/MonadPlus> -- 1. <Trie a, mzero, mplus> forms a monoid -- 2. mzero >>= f === mzero -- 3. m >> mzero === mzero -- 4. mplus m n >>= k === mplus (m >>= k) (n >>= k) -- 4' mplus (return a) n === return a {- -- Follows #1, #1, and #3. But it does something like 4' instead -- of actually doing #4 (since we'd merge the trees generated by -- @k@ for conflicting values) -- -- TODO: cf Control.Applicative.Alternative (base-4, but not Hugs). -- But (<*>) gets odd when the function is not 'pure'... maybe -- helpful though. instance MonadPlus Trie where mzero = empty mplus = unionL where unionL = mergeBy (\x _ -> Just x) -} {--------------------------------------------------------------- -- Extra mapping functions ---------------------------------------------------------------} -- | Apply a function to all values, potentially removing them. filterMap :: (a -> Maybe b) -> Trie a -> Trie b filterMap f = go where go Empty = empty go (Arc k Nothing t) = arc k Nothing (go t) go (Arc k (Just v) t) = arc k (f v) (go t) go (Branch p m l r) = branch p m (go l) (go r) -- | Generic version of 'fmap'. This function is notably more -- expensive than 'fmap' or 'filterMap' because we have to reconstruct -- the keys. mapBy :: (ByteString -> a -> Maybe b) -> Trie a -> Trie b mapBy f = go S.empty where go _ Empty = empty go q (Arc k Nothing t) = arc k Nothing (go q' t) where q' = S.append q k go q (Arc k (Just v) t) = arc k (f q' v) (go q' t) where q' = S.append q k go q (Branch p m l r) = branch p m (go q l) (go q r) -- | A variant of 'fmap' which provides access to the subtrie rooted -- at each value. contextualMap :: (a -> Trie a -> b) -> Trie a -> Trie b contextualMap f = go where go Empty = Empty go (Arc k Nothing t) = Arc k Nothing (go t) go (Arc k (Just v) t) = Arc k (Just (f v t)) (go t) go (Branch p m l r) = Branch p m (go l) (go r) -- | A variant of 'contextualMap' which applies the function strictly. contextualMap' :: (a -> Trie a -> b) -> Trie a -> Trie b contextualMap' f = go where go Empty = Empty go (Arc k Nothing t) = Arc k Nothing (go t) go (Arc k (Just v) t) = Arc k (Just $! f v t) (go t) go (Branch p m l r) = Branch p m (go l) (go r) -- | A contextual variant of 'filterMap'. contextualFilterMap :: (a -> Trie a -> Maybe b) -> Trie a -> Trie b contextualFilterMap f = go where go Empty = empty go (Arc k Nothing t) = arc k Nothing (go t) go (Arc k (Just v) t) = arc k (f v t) (go t) go (Branch p m l r) = branch p m (go l) (go r) -- | A contextual variant of 'mapBy'. Again note that this is -- expensive since we must reconstruct the keys. contextualMapBy :: (ByteString -> a -> Trie a -> Maybe b) -> Trie a -> Trie b contextualMapBy f = go S.empty where go _ Empty = empty go q (Arc k Nothing t) = arc k Nothing (go (S.append q k) t) go q (Arc k (Just v) t) = let q' = S.append q k in arc k (f q' v t) (go q' t) go q (Branch p m l r) = branch p m (go q l) (go q r) {--------------------------------------------------------------- -- Smart constructors and helper functions for building tries ---------------------------------------------------------------} -- | Smart constructor to prune @Empty@ from @Branch@es. branch :: Prefix -> Mask -> Trie a -> Trie a -> Trie a {-# INLINE branch #-} branch _ _ Empty r = r branch _ _ l Empty = l branch p m l r = Branch p m l r -- | Smart constructor to prune @Arc@s that lead nowhere. -- N.B if mv=Just then doesn't check whether t=epsilon. It's up to callers to ensure that invariant isn't broken. arc :: ByteString -> Maybe a -> Trie a -> Trie a {-# INLINE arc #-} arc k mv@(Just _) t = Arc k mv t arc _ Nothing Empty = Empty arc k Nothing t@(Branch _ _ _ _) | S.null k = t | otherwise = Arc k Nothing t arc k Nothing (Arc k' mv' t') = Arc (S.append k k') mv' t' -- | Smart constructor to join two tries into a @Branch@ with maximal -- prefix sharing. Requires knowing the prefixes, but can combine -- either @Branch@es or @Arc@s. -- -- N.B. /do not/ use if prefixes could match entirely! branchMerge :: Prefix -> Trie a -> Prefix -> Trie a -> Trie a {-# INLINE branchMerge #-} branchMerge _ Empty _ t2 = t2 branchMerge _ t1 _ Empty = t1 branchMerge p1 t1 p2 t2 | zero p1 m = Branch p m t1 t2 | otherwise = Branch p m t2 t1 where m = branchMask p1 p2 p = mask p1 m -- It would be better if Arc used -- Data.ByteString.TrieInternal.wordHead somehow, that way -- we can see 4/8/?*Word8 at a time instead of just one. -- But that makes maintaining invariants ...difficult :( getPrefix :: Trie a -> Prefix {-# INLINE getPrefix #-} getPrefix (Branch p _ _ _) = p getPrefix (Arc k _ _) | S.null k = 0 -- for lack of a better value | otherwise = S.head k getPrefix Empty = error "getPrefix: no Prefix of Empty" {--------------------------------------------------------------- -- Error messages ---------------------------------------------------------------} -- TODO: shouldn't we inline the logic and just NOINLINE the string constant? There are only three use sites, which themselves aren't inlined... errorLogHead :: String -> ByteString -> ByteStringElem {-# NOINLINE errorLogHead #-} errorLogHead fn q | S.null q = error $ "Data.Trie.Internal." ++ fn ++": found null subquery" | otherwise = S.head q ---------------------------------------------------------------- ---------------------------------------------------------------- {--------------------------------------------------------------- -- Basic functions ---------------------------------------------------------------} -- | /O(1)/, Construct the empty trie. empty :: Trie a {-# INLINE empty #-} empty = Empty -- | /O(1)/, Is the trie empty? null :: Trie a -> Bool {-# INLINE null #-} null Empty = True null _ = False -- | /O(1)/, Construct a singleton trie. singleton :: ByteString -> a -> Trie a {-# INLINE singleton #-} singleton k v = Arc k (Just v) Empty -- For singletons, don't need to verify invariant on arc length >0 -- | /O(n)/, Get count of elements in trie. size :: Trie a -> Int {-# INLINE size #-} size t = size' t id 0 -- | /O(n)/, CPS accumulator helper for calculating 'size'. size' :: Trie a -> (Int -> Int) -> Int -> Int size' Empty f n = f n size' (Branch _ _ l r) f n = size' l (size' r f) n size' (Arc _ Nothing t) f n = size' t f n size' (Arc _ (Just _) t) f n = size' t f $! n + 1 {--------------------------------------------------------------- -- Conversion functions ---------------------------------------------------------------} -- Still rather inefficient -- -- TODO: rewrite list-catenation to be lazier (real CPS instead of -- function building? is the function building really better than -- (++) anyways?) -- N.B. If our manual definition of foldr/foldl (using function -- application) is so much faster than the default Endo definition -- (using function composition), then we should make this use -- application instead too. -- -- TODO: the @q@ accumulator should be lazy ByteString and only -- forced by @fcons@. It's already non-strict, but we should ensure -- O(n) not O(n^2) when it's forced. -- -- BUG: not safe for deep strict @fcons@, only for WHNF-strict like (:) -- Where to put the strictness to amortize it? -- -- | Convert a trie into a list (in key-sorted order) using a -- function, folding the list as we go. foldrWithKey :: (ByteString -> a -> b -> b) -> b -> Trie a -> b foldrWithKey fcons nil = \t -> go S.empty t nil where go _ Empty = id go q (Branch _ _ l r) = go q l . go q r go q (Arc k mv t) = case mv of Nothing -> rest Just v -> fcons k' v . rest where rest = go k' t k' = S.append q k -- cf Data.ByteString.unpack -- <http://hackage.haskell.org/packages/archive/bytestring/0.9.1.4/doc/html/src/Data-ByteString.html> -- -- | Convert a trie into a list using a function. Resulting values -- are in key-sorted order. toListBy :: (ByteString -> a -> b) -> Trie a -> [b] {-# INLINE toListBy #-} #if !defined(__GLASGOW_HASKELL__) -- TODO: should probably inline foldrWithKey -- TODO: compare performance of that vs both this and the GHC version toListBy f t = foldrWithKey (((:) .) . f) [] t #else -- Written with 'build' to enable the build\/foldr fusion rules. toListBy f t = build (toListByFB f t) -- TODO: should probably have a specialized version for strictness, -- and a rule to rewrite generic lazy version into it. As per -- Data.ByteString.unpack and the comments there about strictness -- and fusion. toListByFB :: (ByteString -> a -> b) -> Trie a -> (b -> c -> c) -> c -> c {-# INLINE [0] toListByFB #-} toListByFB f t cons nil = foldrWithKey ((cons .) . f) nil t #endif {--------------------------------------------------------------- -- Query functions (just recurse) ---------------------------------------------------------------} -- | Generic function to find a value (if it exists) and the subtrie -- rooted at the prefix. The first function argument is called if and -- only if a node is exactly reachable by the query; if no node is -- exactly reachable the default value is used; if the middle of -- an arc is reached, the second function argument is used. -- -- This function is intended for internal use. For the public-facing -- version, see @lookupBy@ in "Data.Trie". lookupBy_ :: (Maybe a -> Trie a -> b) -> b -> (Trie a -> b) -> ByteString -> Trie a -> b lookupBy_ f z a = lookupBy_' where -- | Deal with epsilon query (when there is no epsilon value) lookupBy_' q t@(Branch _ _ _ _) | S.null q = f Nothing t lookupBy_' q t = go q t -- | The main recursion go _ Empty = z go q (Arc k mv t) = let (_,k',q') = breakMaximalPrefix k q in case (not $ S.null k', S.null q') of (True, True) -> a (Arc k' mv t) (True, False) -> z (False, True) -> f mv t (False, False) -> go q' t go q t_@(Branch _ _ _ _) = findArc t_ where qh = errorLogHead "lookupBy_" q -- | /O(min(m,W))/, where /m/ is number of @Arc@s in this -- branching, and /W/ is the word size of the Prefix,Mask type. findArc (Branch p m l r) | nomatch qh p m = z | zero qh m = findArc l | otherwise = findArc r findArc t@(Arc _ _ _) = go q t findArc Empty = z -- This function needs to be here, not in "Data.Trie", because of -- 'arc' which isn't exported. We could use the monad instance -- instead, though it'd be far more circuitous. -- arc k Nothing t === singleton k () >> t -- arc k (Just v) t === singleton k v >>= unionR t . singleton S.empty -- (...except 'arc' doesn't do the invariant correction -- of (>>=) for epsilon`elem`t) -- -- | Return the subtrie containing all keys beginning with a prefix. submap :: ByteString -> Trie a -> Trie a {-# INLINE submap #-} submap q = lookupBy_ (arc q) empty (arc q Nothing) q {- -- Disable superfluous error checking. -- @submap'@ would replace the first argument to @lookupBy_@ where submap' Nothing Empty = errorEmptyAfterNothing "submap" submap' Nothing (Arc _ _ _) = errorArcAfterNothing "submap" submap' mx t = Arc q mx t errorInvariantBroken :: String -> String -> a {-# NOINLINE errorInvariantBroken #-} errorInvariantBroken s e = error (s ++ ": Invariant was broken" ++ e') where e' = if Prelude.null e then e else ", found: " ++ e errorArcAfterNothing :: String -> a {-# NOINLINE errorArcAfterNothing #-} errorArcAfterNothing s = errorInvariantBroken s "Arc after Nothing" errorEmptyAfterNothing :: String -> a {-# NOINLINE errorEmptyAfterNothing #-} errorEmptyAfterNothing s = errorInvariantBroken s "Empty after Nothing" -- -} -- TODO: would it be worth it to have a variant like 'lookupBy_' which takes the three continuations? -- | Given a query, find the longest prefix with an associated value -- in the trie, returning the length of that prefix and the associated -- value. -- -- This function may not have the most useful return type. For a -- version that returns the prefix itself as well as the remaining -- string, see @match@ in "Data.Trie". match_ :: Trie a -> ByteString -> Maybe (Int, a) match_ = flip start where -- | Deal with epsilon query (when there is no epsilon value) start q (Branch _ _ _ _) | S.null q = Nothing start q t = goNothing 0 q t -- | The initial recursion goNothing _ _ Empty = Nothing goNothing n q (Arc k mv t) = let (p,k',q') = breakMaximalPrefix k q n' = n + S.length p in n' `seq` if S.null k' then if S.null q' then (,) n' <$> mv else case mv of Nothing -> goNothing n' q' t Just v -> goJust n' v n' q' t else Nothing goNothing n q t_@(Branch _ _ _ _) = findArc t_ where qh = errorLogHead "match_" q -- | /O(min(m,W))/, where /m/ is number of @Arc@s in this -- branching, and /W/ is the word size of the Prefix,Mask type. findArc (Branch p m l r) | nomatch qh p m = Nothing | zero qh m = findArc l | otherwise = findArc r findArc t@(Arc _ _ _) = goNothing n q t findArc Empty = Nothing -- | The main recursion goJust n0 v0 _ _ Empty = Just (n0,v0) goJust n0 v0 n q (Arc k mv t) = let (p,k',q') = breakMaximalPrefix k q n' = n + S.length p in n' `seq` if S.null k' then if S.null q' then case mv of Nothing -> Just (n0,v0) Just v -> Just (n',v) else case mv of Nothing -> goJust n0 v0 n' q' t Just v -> goJust n' v n' q' t else Just (n0,v0) goJust n0 v0 n q t_@(Branch _ _ _ _) = findArc t_ where qh = errorLogHead "match_" q -- | /O(min(m,W))/, where /m/ is number of @Arc@s in this -- branching, and /W/ is the word size of the Prefix,Mask type. findArc (Branch p m l r) | nomatch qh p m = Just (n0,v0) | zero qh m = findArc l | otherwise = findArc r findArc t@(Arc _ _ _) = goJust n0 v0 n q t findArc Empty = Just (n0,v0) -- | Given a query, find all prefixes with associated values in the -- trie, returning their lengths and values. This function is a -- good producer for list fusion. -- -- This function may not have the most useful return type. For a -- version that returns the prefix itself as well as the remaining -- string, see @matches@ in "Data.Trie". matches_ :: Trie a -> ByteString -> [(Int,a)] matches_ t q = #if !defined(__GLASGOW_HASKELL__) matchFB_ t q (((:) .) . (,)) [] #else build (\cons nil -> matchFB_ t q ((cons .) . (,)) nil) {-# INLINE matches_ #-} #endif matchFB_ :: Trie a -> ByteString -> (Int -> a -> r -> r) -> r -> r matchFB_ = \t q cons nil -> matchFB_' cons q t nil where matchFB_' cons = start where -- | Deal with epsilon query (when there is no epsilon value) start q (Branch _ _ _ _) | S.null q = id start q t = go 0 q t -- | The main recursion go _ _ Empty = id go n q (Arc k mv t) = let (p,k',q') = breakMaximalPrefix k q n' = n + S.length p in n' `seq` if S.null k' then case mv of { Nothing -> id; Just v -> cons n' v} . if S.null q' then id else go n' q' t else id go n q t_@(Branch _ _ _ _) = findArc t_ where qh = errorLogHead "matches_" q -- | /O(min(m,W))/, where /m/ is number of @Arc@s in this -- branching, and /W/ is the word size of the Prefix,Mask type. findArc (Branch p m l r) | nomatch qh p m = id | zero qh m = findArc l | otherwise = findArc r findArc t@(Arc _ _ _) = go n q t findArc Empty = id {--------------------------------------------------------------- -- Single-value modification functions (recurse and clone spine) ---------------------------------------------------------------} -- TODO: We should CPS on Empty to avoid cloning spine if no change. -- Difficulties arise with the calls to 'branch' and 'arc'. Will -- have to create a continuation chain, so no savings on memory -- allocation; but would have savings on held memory, if they're -- still holding the old one... -- -- | Generic function to alter a trie by one element with a function -- to resolve conflicts (or non-conflicts). alterBy :: (ByteString -> a -> Maybe a -> Maybe a) -> ByteString -> a -> Trie a -> Trie a alterBy f = alterBy_ (\k v mv t -> (f k v mv, t)) -- TODO: use GHC's 'inline' function so that this gets specialized away. -- TODO: benchmark to be sure that this doesn't introduce unforseen performance costs because of the uncurrying etc. -- | A variant of 'alterBy' which also allows modifying the sub-trie. alterBy_ :: (ByteString -> a -> Maybe a -> Trie a -> (Maybe a, Trie a)) -> ByteString -> a -> Trie a -> Trie a alterBy_ f_ q_ x_ | S.null q_ = alterEpsilon | otherwise = go q_ where f = f_ q_ x_ nothing q = uncurry (arc q) (f Nothing Empty) alterEpsilon t_@Empty = uncurry (arc q_) (f Nothing t_) alterEpsilon t_@(Branch _ _ _ _) = uncurry (arc q_) (f Nothing t_) alterEpsilon t_@(Arc k mv t) | S.null k = uncurry (arc q_) (f mv t) | otherwise = uncurry (arc q_) (f Nothing t_) go q Empty = nothing q go q t@(Branch p m l r) | nomatch qh p m = branchMerge p t qh (nothing q) | zero qh m = branch p m (go q l) r | otherwise = branch p m l (go q r) where qh = errorLogHead "alterBy" q go q t_@(Arc k mv t) = let (p,k',q') = breakMaximalPrefix k q in case (not $ S.null k', S.null q') of (True, True) -> -- add node to middle of arc uncurry (arc p) (f Nothing (Arc k' mv t)) (True, False) -> case nothing q' of Empty -> t_ -- Nothing to add, reuse old arc l -> arc' (branchMerge (getPrefix l) l (getPrefix r) r) where r = Arc k' mv t -- inlined version of 'arc' arc' | S.null p = id | otherwise = Arc p Nothing (False, True) -> uncurry (arc k) (f mv t) (False, False) -> arc k mv (go q' t) -- | Alter the value associated with a given key. If the key is not -- present, then the trie is returned unaltered. See 'alterBy' if -- you are interested in inserting new keys or deleting old keys. -- Because this function does not need to worry about changing the -- trie structure, it is somewhat faster than 'alterBy'. adjustBy :: (ByteString -> a -> a -> a) -> ByteString -> a -> Trie a -> Trie a adjustBy f_ q_ x_ | S.null q_ = adjustEpsilon | otherwise = go q_ where f = f_ q_ x_ adjustEpsilon (Arc k (Just v) t) | S.null k = Arc k (Just (f v)) t adjustEpsilon t_ = t_ go _ Empty = Empty go q t@(Branch p m l r) | nomatch qh p m = t | zero qh m = Branch p m (go q l) r | otherwise = Branch p m l (go q r) where qh = errorLogHead "adjustBy" q go q t_@(Arc k mv t) = let (_,k',q') = breakMaximalPrefix k q in case (not $ S.null k', S.null q') of (True, True) -> t_ -- don't break arc inline (True, False) -> t_ -- don't break arc branching (False, True) -> Arc k (liftM f mv) t (False, False) -> Arc k mv (go q' t) {--------------------------------------------------------------- -- Trie-combining functions ---------------------------------------------------------------} -- TEST CASES: foldr (unionL . uncurry singleton) empty t -- foldr (uncurry insert) empty t -- where t = map (\s -> (pk s, 0)) -- ["heat","hello","hoi","apple","appa","hell","appb","appc"] -- -- | Combine two tries, using a function to resolve collisions. -- This can only define the space of functions between union and -- symmetric difference but, with those two, all set operations can -- be defined (albeit inefficiently). mergeBy :: (a -> a -> Maybe a) -> Trie a -> Trie a -> Trie a mergeBy f = mergeBy' where -- | Deals with epsilon entries, before recursing into @go@ mergeBy' t0_@(Arc k0 mv0 t0) t1_@(Arc k1 mv1 t1) | S.null k0 && S.null k1 = arc k0 (mergeMaybe f mv0 mv1) (go t0 t1) | S.null k0 = arc k0 mv0 (go t0 t1_) | S.null k1 = arc k1 mv1 (go t1 t0_) mergeBy' (Arc k0 mv0@(Just _) t0) t1_@(Branch _ _ _ _) | S.null k0 = arc k0 mv0 (go t0 t1_) mergeBy' t0_@(Branch _ _ _ _) (Arc k1 mv1@(Just _) t1) | S.null k1 = arc k1 mv1 (go t1 t0_) mergeBy' t0_ t1_ = go t0_ t1_ -- | The main recursion go Empty t1 = t1 go t0 Empty = t0 -- /O(n+m)/ for this part where /n/ and /m/ are sizes of the branchings go t0@(Branch p0 m0 l0 r0) t1@(Branch p1 m1 l1 r1) | shorter m0 m1 = union0 | shorter m1 m0 = union1 | p0 == p1 = branch p0 m0 (go l0 l1) (go r0 r1) | otherwise = branchMerge p0 t0 p1 t1 where union0 | nomatch p1 p0 m0 = branchMerge p0 t0 p1 t1 | zero p1 m0 = branch p0 m0 (go l0 t1) r0 | otherwise = branch p0 m0 l0 (go r0 t1) union1 | nomatch p0 p1 m1 = branchMerge p0 t0 p1 t1 | zero p0 m1 = branch p1 m1 (go t0 l1) r1 | otherwise = branch p1 m1 l1 (go t0 r1) -- We combine these branches of 'go' in order to clarify where the definitions of 'p0', 'p1', 'm'', 'p'' are relevant. However, this may introduce inefficiency in the pattern matching automaton... -- TODO: check. And get rid of 'go'' if it does. go t0_ t1_ = go' t0_ t1_ where p0 = getPrefix t0_ p1 = getPrefix t1_ m' = branchMask p0 p1 p' = mask p0 m' go' (Arc k0 mv0 t0) (Arc k1 mv1 t1) | m' == 0 = let (pre,k0',k1') = breakMaximalPrefix k0 k1 in if S.null pre then error "mergeBy: no mask, but no prefix string" else let {-# INLINE arcMerge #-} arcMerge mv' t1' t2' = arc pre mv' (go t1' t2') in case (S.null k0', S.null k1') of (True, True) -> arcMerge (mergeMaybe f mv0 mv1) t0 t1 (True, False) -> arcMerge mv0 t0 (Arc k1' mv1 t1) (False,True) -> arcMerge mv1 (Arc k0' mv0 t0) t1 (False,False) -> arcMerge Nothing (Arc k0' mv0 t0) (Arc k1' mv1 t1) go' (Arc _ _ _) (Branch _p1 m1 l r) | nomatch p0 p1 m1 = branchMerge p1 t1_ p0 t0_ | zero p0 m1 = branch p1 m1 (go t0_ l) r | otherwise = branch p1 m1 l (go t0_ r) go' (Branch _p0 m0 l r) (Arc _ _ _) | nomatch p1 p0 m0 = branchMerge p0 t0_ p1 t1_ | zero p1 m0 = branch p0 m0 (go l t1_) r | otherwise = branch p0 m0 l (go r t1_) -- Inlined branchMerge. Both tries are disjoint @Arc@s now. go' _ _ | zero p0 m' = Branch p' m' t0_ t1_ go' _ _ = Branch p' m' t1_ t0_ mergeMaybe :: (a -> a -> Maybe a) -> Maybe a -> Maybe a -> Maybe a {-# INLINE mergeMaybe #-} mergeMaybe _ Nothing Nothing = Nothing mergeMaybe _ Nothing mv1@(Just _) = mv1 mergeMaybe _ mv0@(Just _) Nothing = mv0 mergeMaybe f (Just v0) (Just v1) = f v0 v1 intersectBy :: (a -> a -> Maybe a) -> Trie a -> Trie a -> Trie a intersectBy f = intersectBy' where -- | Deals with epsilon entries, before recursing into @go@ intersectBy' t0_@(Arc k0 mv0 t0) t1_@(Arc k1 mv1 t1) | S.null k0 && S.null k1 = arc k0 (intersectMaybe f mv0 mv1) (go t0 t1) | S.null k0 = arc k0 mv0 (go t0 t1_) | S.null k1 = arc k1 mv1 (go t1 t0_) intersectBy' (Arc k0 mv0@(Just _) t0) t1_@(Branch _ _ _ _) | S.null k0 = arc k0 mv0 (go t0 t1_) intersectBy' t0_@(Branch _ _ _ _) (Arc k1 mv1@(Just _) t1) | S.null k1 = arc k1 mv1 (go t1 t0_) intersectBy' t0_ t1_ = go t0_ t1_ -- | The main recursion go Empty _ = Empty go _ Empty = Empty -- mergeBy had /O(n+m)/ for this part where /n/ and /m/ are sizes of the branchings go t0@(Branch p0 m0 l0 r0) t1@(Branch p1 m1 l1 r1) | shorter m0 m1 = union0 | shorter m1 m0 = union1 | p0 == p1 = branch p0 m0 (go l0 l1) (go r0 r1) | otherwise = Empty where union0 | nomatch p1 p0 m0 = Empty | zero p1 m0 = branch p0 m0 (go l0 t1) Empty | otherwise = branch p0 m0 Empty (go r0 t1) union1 | nomatch p0 p1 m1 = Empty | zero p0 m1 = branch p1 m1 (go t0 l1) Empty | otherwise = branch p1 m1 Empty (go t0 r1) go t0_@(Arc k0 mv0 t0) t1_@(Arc k1 mv1 t1) | m' == 0 = let (pre,k0',k1') = breakMaximalPrefix k0 k1 in if S.null pre then error "intersectBy: no mask, but no prefix string" else let {-# INLINE arcIntersect #-} arcIntersect mv' t1' t2' = arc pre mv' (go t1' t2') in case (S.null k0', S.null k1') of (True, True) -> arcIntersect (intersectMaybe f mv0 mv1) t0 t1 (True, False) -> arcIntersect Nothing t0 (Arc k1' mv1 t1) (False,True) -> arcIntersect Nothing (Arc k0' mv0 t0) t1 (False,False) -> arcIntersect Nothing (Arc k0' mv0 t0) (Arc k1' mv1 t1) where p0 = getPrefix t0_ p1 = getPrefix t1_ m' = branchMask p0 p1 go t0_@(Arc _ _ _) t1_@(Branch _p1 m1 l r) | nomatch p0 p1 m1 = Empty | zero p0 m1 = branch p1 m1 (go t0_ l) Empty | otherwise = branch p1 m1 Empty (go t0_ r) where p0 = getPrefix t0_ p1 = getPrefix t1_ go t0_@(Branch _p0 m0 l r) t1_@(Arc _ _ _) | nomatch p1 p0 m0 = Empty | zero p1 m0 = branch p0 m0 (go l t1_) Empty | otherwise = branch p0 m0 Empty (go r t1_) where p0 = getPrefix t0_ p1 = getPrefix t1_ go _ _ = Empty intersectMaybe :: (a -> a -> Maybe a) -> Maybe a -> Maybe a -> Maybe a {-# INLINE intersectMaybe #-} intersectMaybe f (Just v0) (Just v1) = f v0 v1 intersectMaybe _ _ _ = Nothing {--------------------------------------------------------------- -- Priority-queue functions ---------------------------------------------------------------} minAssoc :: Trie a -> Maybe (ByteString, a) minAssoc = go S.empty where go _ Empty = Nothing go q (Arc k (Just v) _) = Just (S.append q k,v) go q (Arc k Nothing t) = go (S.append q k) t go q (Branch _ _ l _) = go q l maxAssoc :: Trie a -> Maybe (ByteString, a) maxAssoc = go S.empty where go _ Empty = Nothing go q (Arc k (Just v) Empty) = Just (S.append q k,v) go q (Arc k _ t) = go (S.append q k) t go q (Branch _ _ _ r) = go q r mapView :: (Trie a -> Trie a) -> Maybe (ByteString, a, Trie a) -> Maybe (ByteString, a, Trie a) mapView _ Nothing = Nothing mapView f (Just (k,v,t)) = Just (k,v, f t) updateMinViewBy :: (ByteString -> a -> Maybe a) -> Trie a -> Maybe (ByteString, a, Trie a) updateMinViewBy f = go S.empty where go _ Empty = Nothing go q (Arc k (Just v) t) = let q' = S.append q k in Just (q',v, arc k (f q' v) t) go q (Arc k Nothing t) = mapView (arc k Nothing) (go (S.append q k) t) go q (Branch p m l r) = mapView (\l' -> branch p m l' r) (go q l) updateMaxViewBy :: (ByteString -> a -> Maybe a) -> Trie a -> Maybe (ByteString, a, Trie a) updateMaxViewBy f = go S.empty where go _ Empty = Nothing go q (Arc k (Just v) Empty) = let q' = S.append q k in Just (q',v, arc k (f q' v) Empty) go q (Arc k mv t) = mapView (arc k mv) (go (S.append q k) t) go q (Branch p m l r) = mapView (branch p m l) (go q r) ---------------------------------------------------------------- ----------------------------------------------------------- fin.
unhammer/bytestring-trie-0.2.4
src/Data/Trie/Internal.hs
bsd-3-clause
41,507
0
21
13,377
10,484
5,319
5,165
510
17
---------------------------------------------------------------------------- -- | -- Module : E -- Copyright : (c) Sergey Vinokurov 2016 -- License : BSD3-style (see LICENSE) -- Maintainer : serg.foo@gmail.com -- Created : Sunday, 23 October 2016 ---------------------------------------------------------------------------- module E where import F (FooTyp(..), BarTyp(..)) foo :: Int -> Int foo x = x + x bar :: Int -> Int bar x = x * x baz :: Int -> Int baz x = x ^ x
sergv/tags-server
test-data/0007resolvable_import_cycle/E.hs
bsd-3-clause
496
0
6
99
94
57
37
8
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} module Clicklac.Application ( -- * App Monad App , runApp -- * Data types , AppConfig(..) ) where import Control.Monad.Base (MonadBase (..)) import Control.Monad.Catch (MonadCatch, MonadThrow) import Control.Monad.Error.Class (MonadError (..)) import Control.Monad.IO.Class (MonadIO (..)) import Control.Monad.Reader.Class (MonadReader, asks, local) import Control.Monad.Trans.Control (MonadBaseControl (..)) import Control.Monad.Trans.Except (ExceptT) import Control.Monad.Trans.Reader (ReaderT (..)) import Data.Composition ((.**)) import qualified Data.Text as T import Crypto.Nonce (Generator) import qualified Crypto.Nonce as N import Crypto.PasswordStore (makePasswordWith) import qualified Data.Time.Clock as Clock (getCurrentTime) import qualified Data.Time.Clock.POSIX as POSIX (getPOSIXTime) import qualified Data.UUID.V1 as UUIDv1 import qualified Data.UUID.V4 as UUIDv4 import qualified Data.Vault.Lazy as VT import Database.CQL.IO ( ClientState , MonadClient (..) , runClient ) import Database.PostgreSQL.Simple.Lifted (PostgresClient (..)) import Database.PostgreSQL.Simple.Pool (PostgresPool, withConnPool) import qualified Network.HostName as NH (getHostName) import Servant.Server.Internal.ServantErr (ServantErr) import System.Logger (Logger) import qualified System.Logger as L import System.Logger.Class (MonadLogger (..)) import qualified Web.ClientSession as WCS import Clicklac.Types ( CassClient (..) , CookieEncryption (..) , HostnameGetter (..) , NonceGenerator (..) , PasswordEncryptor (..) , TimeGetter (..) , UUIDGenerator (..) , UserId ) import Clicklac.Environment data AppConfig = AppConfig { csState :: ClientState , logger :: Logger , nonceGen :: Generator -- ^ used to generate hard-to-predict session IDs , clientSessKey :: WCS.Key -- ^ cookie encryption key , vaultKey :: VT.Key UserId , psgConnPool :: PostgresPool } newtype App a = A { runA :: ReaderT AppConfig (ExceptT ServantErr IO) a } deriving (Monad, Functor, Applicative, MonadIO, MonadReader AppConfig, MonadError ServantErr, MonadCatch, MonadThrow, MonadBase IO) -- Deriving MonadMask is not possible here because of ExceptT. instance MonadBaseControl IO App where -- type StM App a = StM (ReaderT AppConfig (ExceptT ServantErr IO)) a type StM App a = Either ServantErr a liftBaseWith f = A $ liftBaseWith $ \q -> f (q . runA) restoreM = A . restoreM instance CookieEncryption App where encryptCookie content = liftIO . flip WCS.encryptIO content =<< asks clientSessKey decryptCookie dataBS64 = flip WCS.decrypt dataBS64 <$> asks clientSessKey instance NonceGenerator App where generateNonce = N.nonce128urlT =<< asks nonceGen instance UUIDGenerator App where generateUUIDv1 = liftIO UUIDv1.nextUUID generateUUIDv4 = liftIO UUIDv4.nextRandom instance HostnameGetter App where getHostname = T.pack `fmap` liftIO NH.getHostName instance CassClient App where runCassOp cl = flip runClient cl =<< asks csState instance TimeGetter App where getPosixTime = liftIO POSIX.getPOSIXTime getCurrentTime = liftIO Clock.getCurrentTime instance PasswordEncryptor App where encryptPassword = liftIO .** makePasswordWith instance PostgresClient App where liftPSGClient f = flip withConnPool f =<< asks psgConnPool instance EnvLookup App where lookupEnvVar = lookupEnvVar' instance MonadClient App where liftClient a = flip runClient a =<< asks csState localState f app = flip local app $ \conf -> conf {csState = f $ csState conf} instance MonadLogger App where log l m = asks logger >>= \g -> L.log g l m runApp :: App a -> AppConfig -> ExceptT ServantErr IO a runApp a = runReaderT (runA a)
onurzdg/clicklac
src/Clicklac/Application.hs
bsd-3-clause
3,945
0
11
706
1,024
603
421
97
1
{-# OPTIONS_HADDOCK show-extensions #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE BangPatterns #-} module Control.THEff.Reader.Strict ( -- * Overview -- | -- This version builds its output strictly; for a lazy version with -- the same interface, see "Control.THEff.Reader". -- -- > {-# LANGUAGE KindSignatures #-} -- > {-# LANGUAGE FlexibleInstances #-} -- > {-# LANGUAGE MultiParamTypeClasses #-} -- > {-# LANGUAGE TemplateHaskell #-} -- > -- > import Control.THEff -- > import Control.THEff.Reader.Strict -- > -- > mkEff "CharReader" ''Reader ''Char ''NoEff -- > mkEff "StrReader" ''Reader ''String ''CharReader -- > -- > main:: IO () -- > main = putStrLn $ runCharReader 'T' $ runStrReader "est" $ do -- > c <- ask -- > s <- ask -- > return $ c:s -- -- __/Output :/__ \"Test\" -- * Types and functions used in mkEff Reader' , Reader(..) , ReaderArgT , ReaderResT , effReader , runEffReader -- * Functions that use this effect , ask , asks ) where import Control.THEff -- | Actually, the effect type -- - __/v/__ - Type - the parameter of the effect. -- - __/e/__ - mkEff generated type. newtype Reader' v e = Reader' (v -> e) -- | Type implements link in the chain of effects. -- Constructors must be named __/{EffectName}{Outer|WriterAction|WriterResult}/__ -- and have a specified types of fields. -- - __/m/__ - Or Monad (if use the 'Lift') or phantom type - stub (if used 'NoEff'). -- - __/o/__ - Type of outer effect. -- - __/a/__ - The result of mkEff generated runEEEE... function. data Reader (m:: * -> *) e o v a = ReaderOuter (o m e) | ReaderAction (Reader' v e) | ReaderResult a -- | Type of fourth argument of runEffReader and first argument of runEEEE. type ReaderArgT v = v -- | Result type of runEEEE. type ReaderResT r = r -- | This function is used in the 'mkEff' generated runEEEE functions and typically -- in effect action functions. Calling the effect action. effReader:: EffClass Reader' v e => Reader' v r -> Eff e r effReader (Reader' g) = effAction $ \k -> Reader' (k . g) -- | The main function of the effect implementing. -- This function is used in the 'mkEff' generated runEEEE functions. runEffReader :: forall (t :: * -> *) (u :: (* -> *) -> * -> *) (m :: * -> *) a v (m1 :: * -> *) e (o :: (* -> *) -> * -> *) w a1 r. Monad m => (u t r -> (r -> m (ReaderResT a)) -> m (ReaderResT a)) -- ^ The outer effect function -> (Reader m1 e o w a1 -> r) -- ^ The chain of effects link wrapper. -> (r -> Reader t r u v a) -- ^ The chain of effects link unwrapper. -> ReaderArgT v -- ^ The initial value of argument of effect. -> Eff r a1 -> m (ReaderResT a) runEffReader outer to un !v m = loop $ runEff m (to . ReaderResult) where loop = select . un select (ReaderOuter f) = outer f loop select (ReaderAction (Reader' g)) = loop $ g v select (ReaderResult r) = return r -- | Get reader value ask :: EffClass Reader' v e => Eff e v ask = effReader $ Reader' id -- | Get and convert the value of the reader asks :: EffClass Reader' r e => (r -> v) -> Eff e v asks f = effReader $ Reader' f
KolodeznyDiver/THEff
src/Control/THEff/Reader/Strict.hs
bsd-3-clause
3,637
0
15
1,156
638
369
269
40
3
{-# LANGUAGE OverloadedStrings #-} module Scoutess.Core where import Control.Arrow hiding ((<+>)) import Control.Applicative ((<$>)) import Control.Monad.Trans.Maybe import Control.Monad.Writer hiding ((<>)) import Data.List (isPrefixOf) import qualified Data.Map as M import Data.Maybe (mapMaybe, isJust, fromJust) import Data.Monoid ((<>)) import Data.Set (Set) import qualified Data.Set as S import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.IO as T import Data.Version (parseVersion, showVersion) import System.Directory (createDirectoryIfMissing) import System.FilePath ((</>), (<.>)) import System.FilePath.Find (find, fileName, extension, (==?), depth) import Text.ParserCombinators.ReadP import Text.PrettyPrint hiding ((<>)) -- import Prelude hiding ((++)) import Distribution.Package import Distribution.PackageDescription import Distribution.PackageDescription.PrettyPrint (writeGenericPackageDescription) import Distribution.PackageDescription.Parse (readPackageDescription) import Distribution.Verbosity (silent) import Distribution.Version (Version) import Scoutess.Types import Scoutess.Utils.Archives -------------------- -- Scoutess arrow -- -------------------- runScoutess :: Scoutess a b -> a -> IO (Maybe b, [ComponentReport]) runScoutess = runWriterT . runMaybeT .: runKleisli . unScoutess liftScoutess :: (a -> Scoutess' b) -> Scoutess a b liftScoutess = Scoutess . Kleisli ppScoutessResult :: (Maybe BuildReport, [ComponentReport]) -> String ppScoutessResult (mBuildReport, reports) = renderStyle (style{lineLength = 80}) (pBReport $+$ pCReports) where pBReport = case mBuildReport of Nothing -> text "Scoutess failed with these component reports:" Just report -> text "Scoutess successfully built" -- <+> text (brName report) <> text "-" <> text (showVersion (brVersion report)) <+> pVersionInfos (bsTargetInfo $ brBuildSpec report) <+> text "with these component reports:" pVersionInfos vis = vcat $ map pVersionInfo vis pVersionInfo vi = text (viName vi) <> text "-" <> text (showVersion $ viVersion vi) pCReports = sep (map ppComponentReport reports) ppComponentReport :: ComponentReport -> Doc ppComponentReport (ComponentReport name success extra) -- TODO: don't show the "and:" if 'extra' is empty = (text "The component \"" <+> text (T.unpack name) <+> text "\" returned" <+> text (show success) <+> text "and:") $+$ (text (T.unpack extra)) ---------------- -- Components -- ---------------- withComponent :: Text -> (a -> Component b) -> Scoutess a b withComponent name action = liftScoutess ((extractReportValue =<<) . (lift . lift . runWriterT . runMaybeT . (label action))) where label action = \a -> do report $ name <> " begin." b <- action a report $ name <> " end." return b extractReportValue :: (Maybe (Bool, b), [Text]) -> Scoutess' b extractReportValue (Nothing, cLog) = do tell [ComponentReport name False (T.unlines cLog)] mzero extractReportValue (Just (success, value), cLog) = do tell [ComponentReport name success (T.unlines cLog)] return value report :: Text -> Component () report text = do liftIO $ T.putStrLn text tell [text] componentPass () componentPass, componentFail :: a -> Component a componentPass value = return (True, value) componentFail value = return (False, value) componentFinish :: Bool -> a -> Component a componentFinish True = componentPass componentFinish False = componentFail componentFatal :: Component a componentFatal = mzero --------------------- -- Container types -- --------------------- filterSourceSpec :: (SourceLocation -> Bool) -> SourceSpec -> SourceSpec filterSourceSpec p = SourceSpec . S.filter p . ssLocations filterVersionSpec :: (VersionInfo -> Bool) -> VersionSpec -> VersionSpec filterVersionSpec p vs = VersionSpec (S.filter p (vsVersions vs)) (vsPreferences vs) -- TODO: write out the versionPreferences createPackageIndexWith :: (VersionInfo -> VersionInfo -> VersionInfo) -> VersionSpec -> FilePath -> IO FilePath createPackageIndexWith conflict vs baseDir = do mapM_ (\((name, version), vi) -> writeCabal (baseDir </> name </> version) vi) versions' tarFiles (map (\((name, version),_) -> name </> version) versions') baseDir archiveLoc return archiveLoc where archiveLoc = baseDir </> "00-index.tar" versions' = M.toList $ M.fromListWith conflict [((viName vi, showVersion (viVersion vi)), vi) | vi <- S.toList (vsVersions vs)] parsePackageDescription :: VersionInfo -> IO GenericPackageDescription parsePackageDescription versionInfo = do readPackageDescription silent (viCabalPath versionInfo) writeCabal :: FilePath -> VersionInfo -> IO FilePath writeCabal dir versionInfo = do createDirectoryIfMissing True dir gpd <- parsePackageDescription versionInfo writeGenericPackageDescription dir' gpd return dir' where name = viName versionInfo dir' = dir </> name <.> ".cabal" findIn :: [PackageIdentifier] -> Set VersionInfo -> [VersionInfo] findIn pkgIdens vis = mapMaybe (\pkgIden -> fst <$> S.maxView (S.filter ((pkgIden ==) . viPackageIden) vis)) pkgIdens {- brName :: BuildReport -> String brName = viName . bsTargetInfo . brBuildSpec brVersion :: BuildReport -> Version brVersion = viVersion . bsTargetInfo . brBuildSpec -} ----------- -- Other -- ----------- -- | return a human readable error message sourceErrorMsg :: SourceException -- ^ error -> Text -- ^ error message sourceErrorMsg (SourceErrorOther txt) = txt sourceErrorMsg (SourceErrorUnknown) = "unknown source error" {- toPriorRun :: BuildReport -> PriorRun toPriorRun br = PriorRun (bsTargetInfo buildSpec) (S.fromList (bsDependencies buildSpec)) where buildSpec = brBuildSpec br -- | If the target of the 'PriorRun' is -- different to that of the 'BuildReport', return Nothing. -- Otherwise, return a pair the two differences e.g.: -- "findDifference buildReport priorRun -- = (deps buildReport \\ deps priorRun, depsPriorRun \\ deps buildReport)" findDifference :: BuildReport -> PriorRun -> Maybe (Set VersionInfo, Set VersionInfo) findDifference buildReport priorRun | bsTargetInfo buildSpec == prTarget priorRun = Just (deps S.\\ deps', deps' S.\\ deps) | otherwise = Nothing where buildSpec = brBuildSpec buildReport deps = S.fromList (bsDependencies buildSpec) deps' = prDependencies priorRun noDifference :: BuildReport -> PriorRun -> Bool noDifference br pr = case findDifference br pr of Just (diff1, diff2) | S.null diff1 && S.null diff2 -> True _ -> False -} ---------------------- -- Helper functions -- ---------------------- (.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d (.:) = (.) . (.) infixr 8 .: viName :: VersionInfo -> String viName = (\(PackageName n) -> n) . pkgName . viPackageIden viVersion :: VersionInfo -> Version viVersion = pkgVersion . viPackageIden srcName :: SourceInfo -> String srcName = viName . siVersionInfo srcVersion :: SourceInfo -> Version srcVersion = viVersion . siVersionInfo -- srcDependencies :: SourceInfo -> [Dependency] -- srcDependencies = viDependencies . siVersionInfo -- | Finds a 'VersionInfo' for a package from a 'VersionSpec' findVersion :: Text -- ^ package name -> Maybe Text -- ^ package version -> Maybe SourceLocation -- ^ package location -> VersionSpec -- ^ VersionSpec to search in -> Maybe VersionInfo findVersion name mversion mlocation vs = (fst <$>) . S.maxView . S.filter isTarget . vsVersions $ vs where isTarget vi = T.unpack name == viName vi && (case mversion of (Just version) -> T.unpack version == showVersion (viVersion vi) Nothing -> True) && (case mlocation of (Just location) -> location == viSourceLocation vi Nothing -> True) createVersionInfo :: SourceLocation -> FilePath -> GenericPackageDescription -> VersionInfo createVersionInfo sourceLocation cabalPath gpd = versionInfo where packageIdent = package $ packageDescription gpd name = let (PackageName n) = pkgName packageIdent in n version = pkgVersion packageIdent versionInfo = VersionInfo { viCabalPath = cabalPath , viPackageIden = package $ packageDescription gpd -- , viDependencies = [] -- buildDepends $ packageDescription gpd , viVersionTag = T.pack (name ++ "-" ++ showVersion version) , viSourceLocation = sourceLocation} -- | looks for all .cabal files in the provided directory and its subdirectories findCabalFiles :: FilePath -- ^ where to start looking (recursively) -> IO [FilePath] -- ^ the file paths to the .cabal files findCabalFiles = find recPred (extension ==? ".cabal") where recPred = (`notElem` ["_darcs", ".git", "src", "tests", "test", "examples", "Data", "Control", "data"]) <$> fileName -- | looks for a single .cabal file in the given directory and returns its filepath findCabalFile :: FilePath -> IO (Maybe FilePath) findCabalFile fp = do cabals <- find (depth ==? 0) (extension ==? ".cabal") fp return $ case cabals of [] -> Nothing [x] -> Just x _ -> Nothing -- | parse the output of cabal-install --dry-run -- TODO: check what error message we get if cabal can't find the dependencies parseDependencies :: String -> [PackageIdentifier] -- look for the line "In order, the following would be installed" -- then parse until we can't find a valid name-version parseDependencies = safeInit . map fromJust . takeWhile isJust . map parsePackageId . drop 1 . dropWhile (not . isPrefixOf "In order, the following") . lines where safeInit [] = [] safeInit xs = init xs parsePackageId :: String -> Maybe PackageIdentifier parsePackageId = uncurry toPackageIden . first (T.dropWhileEnd (=='-')) . T.breakOnEnd "-" . T.pack . takeWhile (/= ' ') -- | parses text of the form "package-name-1.2.3.4" toPackageIden :: Text -> Text -> Maybe PackageIdentifier toPackageIden name version = do let name' = PackageName (T.unpack name) versions = readP_to_S parseVersion (T.unpack version) guard . not . null $ versions Just . PackageIdentifier name' . fst . last $ versions
cartazio/scoutess
Scoutess/Core.hs
bsd-3-clause
10,852
0
16
2,483
2,511
1,345
1,166
163
3
-- | Generating C symbol names emitted by the compiler. module CPrim ( atomicReadLabel , atomicWriteLabel , atomicRMWLabel , cmpxchgLabel , popCntLabel , pdepLabel , pextLabel , bSwapLabel , bRevLabel , clzLabel , ctzLabel , word2FloatLabel ) where import GhcPrelude import GHC.Cmm.Type import GHC.Cmm.MachOp import Outputable popCntLabel :: Width -> String popCntLabel w = "hs_popcnt" ++ pprWidth w where pprWidth W8 = "8" pprWidth W16 = "16" pprWidth W32 = "32" pprWidth W64 = "64" pprWidth w = pprPanic "popCntLabel: Unsupported word width " (ppr w) pdepLabel :: Width -> String pdepLabel w = "hs_pdep" ++ pprWidth w where pprWidth W8 = "8" pprWidth W16 = "16" pprWidth W32 = "32" pprWidth W64 = "64" pprWidth w = pprPanic "pdepLabel: Unsupported word width " (ppr w) pextLabel :: Width -> String pextLabel w = "hs_pext" ++ pprWidth w where pprWidth W8 = "8" pprWidth W16 = "16" pprWidth W32 = "32" pprWidth W64 = "64" pprWidth w = pprPanic "pextLabel: Unsupported word width " (ppr w) bSwapLabel :: Width -> String bSwapLabel w = "hs_bswap" ++ pprWidth w where pprWidth W16 = "16" pprWidth W32 = "32" pprWidth W64 = "64" pprWidth w = pprPanic "bSwapLabel: Unsupported word width " (ppr w) bRevLabel :: Width -> String bRevLabel w = "hs_bitrev" ++ pprWidth w where pprWidth W8 = "8" pprWidth W16 = "16" pprWidth W32 = "32" pprWidth W64 = "64" pprWidth w = pprPanic "bRevLabel: Unsupported word width " (ppr w) clzLabel :: Width -> String clzLabel w = "hs_clz" ++ pprWidth w where pprWidth W8 = "8" pprWidth W16 = "16" pprWidth W32 = "32" pprWidth W64 = "64" pprWidth w = pprPanic "clzLabel: Unsupported word width " (ppr w) ctzLabel :: Width -> String ctzLabel w = "hs_ctz" ++ pprWidth w where pprWidth W8 = "8" pprWidth W16 = "16" pprWidth W32 = "32" pprWidth W64 = "64" pprWidth w = pprPanic "ctzLabel: Unsupported word width " (ppr w) word2FloatLabel :: Width -> String word2FloatLabel w = "hs_word2float" ++ pprWidth w where pprWidth W32 = "32" pprWidth W64 = "64" pprWidth w = pprPanic "word2FloatLabel: Unsupported word width " (ppr w) atomicRMWLabel :: Width -> AtomicMachOp -> String atomicRMWLabel w amop = "hs_atomic_" ++ pprFunName amop ++ pprWidth w where pprWidth W8 = "8" pprWidth W16 = "16" pprWidth W32 = "32" pprWidth W64 = "64" pprWidth w = pprPanic "atomicRMWLabel: Unsupported word width " (ppr w) pprFunName AMO_Add = "add" pprFunName AMO_Sub = "sub" pprFunName AMO_And = "and" pprFunName AMO_Nand = "nand" pprFunName AMO_Or = "or" pprFunName AMO_Xor = "xor" cmpxchgLabel :: Width -> String cmpxchgLabel w = "hs_cmpxchg" ++ pprWidth w where pprWidth W8 = "8" pprWidth W16 = "16" pprWidth W32 = "32" pprWidth W64 = "64" pprWidth w = pprPanic "cmpxchgLabel: Unsupported word width " (ppr w) atomicReadLabel :: Width -> String atomicReadLabel w = "hs_atomicread" ++ pprWidth w where pprWidth W8 = "8" pprWidth W16 = "16" pprWidth W32 = "32" pprWidth W64 = "64" pprWidth w = pprPanic "atomicReadLabel: Unsupported word width " (ppr w) atomicWriteLabel :: Width -> String atomicWriteLabel w = "hs_atomicwrite" ++ pprWidth w where pprWidth W8 = "8" pprWidth W16 = "16" pprWidth W32 = "32" pprWidth W64 = "64" pprWidth w = pprPanic "atomicWriteLabel: Unsupported word width " (ppr w)
sdiehl/ghc
compiler/nativeGen/CPrim.hs
bsd-3-clause
3,584
0
9
927
1,022
515
507
104
10
{-# OPTIONS_GHC -Wall #-} import Language.Haskell.Exts.Annotated import Language.Haskell.Suite.Preprocessor import Language.Haskell.Suite.Transformer import qualified QuickWeave.TransformationsList as TS import Control.Monad import Data.Generics.Uniplate.Data main :: IO () main = preprocess tM "qweave" tM :: PTransformer Module tM opts m = foldM (executeTrans opts) m (filter (\tr-> (optionName tr) `elem` opts) TS.transformations) executeTrans :: [String] -> Module SrcSpanInfo -> Transformation -> Either String (Module SrcSpanInfo) executeTrans opts m t = do tImport <- case importedModule t of Just is -> foldM (\m' (i,i') -> addImport i i' m') m is Nothing -> return m tMod <- transformBiM (transMod t opts) tImport tDec <- transformBiM (transDec t opts) tMod tTyp <- transformBiM (transTyp t opts) tDec tPat <- transformBiM (transPat t opts) tTyp transformBiM (transExp t opts) tPat
shayan-najd/QuickWeave
QuickWeave/Preprocessor.hs
bsd-3-clause
969
0
14
200
344
171
173
22
2
-- | This module contains combinators for creating DOM React elements. -- -- The design of creating 'ReactElement's is loosly based on -- <https://hackage.haskell.org/package/lucid lucid>. -- Most of the combinators in this module have a type: -- -- @ -- p_ :: 'Term' eventHandler arg result => arg -> result -- @ -- -- but you should interpret this as 'p_' having either of the following two types: -- -- @ -- p_ :: ['PropertyOrHandler' eventHandler] -> 'ReactElementM' eventHandler a -> 'ReactElementM' eventHandler a -- p_ :: 'ReactElementM' eventHandler a -> 'ReactElementM' eventHandler a -- @ -- -- In the first, 'p_' takes a list of properties and handlers plus the child element(s). In the -- second, the list of properties and handlers is omitted. The 'Term' class allows GHC to -- automatically select the appropriate type. -- -- Be aware that in React, there are some -- <https://facebook.github.io/react/docs/dom-differences.html differences> between the browser DOM -- objects/properties and the properties and attributes you pass to React, as well as React only -- supports <https://facebook.github.io/react/docs/tags-and-attributes.html certian attributes>. -- Event handlers can be created by the combinators in "React.Flux.PropertiesAndEvents". -- -- Elements not covered by this module can be created manually using 'el'. But React -- only supports <https://facebook.github.io/react/docs/tags-and-attributes.html certian elements> -- and they should all be covered by this module. -- -- >ul_ $ do li_ (b_ "Hello") -- > li_ "World" -- > li_ $ -- > ul_ (li_ "Nested" <> li_ "List") -- -- would build something like -- -- ><ul> -- > <li><b>Hello</b><li> -- > <li>World</li> -- > <li><ul> -- > <li>Nested</li> -- > <li>List</li> -- > </ul></li> -- ></ul> module React.Flux.DOM where import React.Flux.Internal -- | This class allows the DOM combinators to optionally take a list of properties or handlers, or -- for the list to be omitted. class Term eventHandler arg result | result -> arg, result -> eventHandler where term :: String -> arg -> result instance (child ~ ReactElementM eventHandler a) => Term eventHandler [PropertyOrHandler eventHandler] (child -> ReactElementM eventHandler a) where term name props = el name props instance Term eventHandler (ReactElementM eventHandler a) (ReactElementM eventHandler a) where term name child = el name [] child {- #define node(name) name ## _ :: Term eventHandler arg result => arg -> result; name ## _ = term #name #define elem(name) name ## _ :: [PropertyOrHandler eventHandler] -> ReactElementM eventHandler (); name ## _ p = el #name p mempty -- Copy the elements from react documentation and use :s/ /)^v^Mnode(/g -- HTML node(a) node(abbr) node(address) node(area) node(article) node(aside) node(audio) node(b) node(base) node(bdi) node(bdo) node(big) node(blockquote) node(body) elem(br) node(button) node(canvas) node(caption) node(cite) node(code) node(col) node(colgroup) node(data) node(datalist) node(dd) node(del) node(details) node(dfn) node(dialog) node(div) node(dl) node(dt) node(em) node(embed) node(fieldset) node(figcaption) node(figure) node(footer) node(form) node(h1) node(h2) node(h3) node(h4) node(h5) node(h6) node(head) node(header) elem(hr) node(html) node(i) node(iframe) node(img) elem(input) node(ins) node(kbd) node(keygen) node(label) node(legend) node(li) node(link) node(main) node(map) node(mark) node(menu) node(menuitem) node(meta) node(meter) node(nav) node(noscript) node(object) node(ol) node(optgroup) node(option) node(output) node(p) node(param) node(picture) node(pre) node(progress) node(q) node(rp) node(rt) node(ruby) node(s) node(samp) node(script) node(section) node(select) node(small) node(source) node(span) node(strong) node(style) node(sub) node(summary) node(sup) node(table) node(tbody) node(td) node(textarea) node(tfoot) node(th) node(thead) node(time) node(title) node(tr) node(track) node(u) node(ul) node(var) node(video) node(wbr) -- SVG node(circle) node(clipPath) node(defs) node(ellipse) node(g) node(image) node(line) node(linearGradient) node(mask) node(path) node(pattern) node(polygon) node(polyline) node(radialGradient) node(rect) node(stop) node(svg) node(text) node(tspan) -} -- HTML a_ :: Term eventHandler arg result => arg -> result; a_ = term "a" abbr_ :: Term eventHandler arg result => arg -> result; abbr_ = term "abbr" address_ :: Term eventHandler arg result => arg -> result; address_ = term "address" area_ :: Term eventHandler arg result => arg -> result; area_ = term "area" article_ :: Term eventHandler arg result => arg -> result; article_ = term "article" aside_ :: Term eventHandler arg result => arg -> result; aside_ = term "aside" audio_ :: Term eventHandler arg result => arg -> result; audio_ = term "audio" b_ :: Term eventHandler arg result => arg -> result; b_ = term "b" base_ :: Term eventHandler arg result => arg -> result; base_ = term "base" bdi_ :: Term eventHandler arg result => arg -> result; bdi_ = term "bdi" bdo_ :: Term eventHandler arg result => arg -> result; bdo_ = term "bdo" big_ :: Term eventHandler arg result => arg -> result; big_ = term "big" blockquote_ :: Term eventHandler arg result => arg -> result; blockquote_ = term "blockquote" body_ :: Term eventHandler arg result => arg -> result; body_ = term "body" br_ :: [PropertyOrHandler eventHandler] -> ReactElementM eventHandler (); br_ p = el "br" p mempty button_ :: Term eventHandler arg result => arg -> result; button_ = term "button" canvas_ :: Term eventHandler arg result => arg -> result; canvas_ = term "canvas" caption_ :: Term eventHandler arg result => arg -> result; caption_ = term "caption" cite_ :: Term eventHandler arg result => arg -> result; cite_ = term "cite" code_ :: Term eventHandler arg result => arg -> result; code_ = term "code" col_ :: Term eventHandler arg result => arg -> result; col_ = term "col" colgroup_ :: Term eventHandler arg result => arg -> result; colgroup_ = term "colgroup" data_ :: Term eventHandler arg result => arg -> result; data_ = term "data" datalist_ :: Term eventHandler arg result => arg -> result; datalist_ = term "datalist" dd_ :: Term eventHandler arg result => arg -> result; dd_ = term "dd" del_ :: Term eventHandler arg result => arg -> result; del_ = term "del" details_ :: Term eventHandler arg result => arg -> result; details_ = term "details" dfn_ :: Term eventHandler arg result => arg -> result; dfn_ = term "dfn" dialog_ :: Term eventHandler arg result => arg -> result; dialog_ = term "dialog" div_ :: Term eventHandler arg result => arg -> result; div_ = term "div" dl_ :: Term eventHandler arg result => arg -> result; dl_ = term "dl" dt_ :: Term eventHandler arg result => arg -> result; dt_ = term "dt" em_ :: Term eventHandler arg result => arg -> result; em_ = term "em" embed_ :: Term eventHandler arg result => arg -> result; embed_ = term "embed" fieldset_ :: Term eventHandler arg result => arg -> result; fieldset_ = term "fieldset" figcaption_ :: Term eventHandler arg result => arg -> result; figcaption_ = term "figcaption" figure_ :: Term eventHandler arg result => arg -> result; figure_ = term "figure" footer_ :: Term eventHandler arg result => arg -> result; footer_ = term "footer" form_ :: Term eventHandler arg result => arg -> result; form_ = term "form" h1_ :: Term eventHandler arg result => arg -> result; h1_ = term "h1" h2_ :: Term eventHandler arg result => arg -> result; h2_ = term "h2" h3_ :: Term eventHandler arg result => arg -> result; h3_ = term "h3" h4_ :: Term eventHandler arg result => arg -> result; h4_ = term "h4" h5_ :: Term eventHandler arg result => arg -> result; h5_ = term "h5" h6_ :: Term eventHandler arg result => arg -> result; h6_ = term "h6" head_ :: Term eventHandler arg result => arg -> result; head_ = term "head" header_ :: Term eventHandler arg result => arg -> result; header_ = term "header" hr_ :: [PropertyOrHandler eventHandler] -> ReactElementM eventHandler (); hr_ p = el "hr" p mempty html_ :: Term eventHandler arg result => arg -> result; html_ = term "html" i_ :: Term eventHandler arg result => arg -> result; i_ = term "i" iframe_ :: Term eventHandler arg result => arg -> result; iframe_ = term "iframe" img_ :: Term eventHandler arg result => arg -> result; img_ = term "img" input_ :: [PropertyOrHandler eventHandler] -> ReactElementM eventHandler (); input_ p = el "input" p mempty ins_ :: Term eventHandler arg result => arg -> result; ins_ = term "ins" kbd_ :: Term eventHandler arg result => arg -> result; kbd_ = term "kbd" keygen_ :: Term eventHandler arg result => arg -> result; keygen_ = term "keygen" label_ :: Term eventHandler arg result => arg -> result; label_ = term "label" legend_ :: Term eventHandler arg result => arg -> result; legend_ = term "legend" li_ :: Term eventHandler arg result => arg -> result; li_ = term "li" link_ :: Term eventHandler arg result => arg -> result; link_ = term "link" main_ :: Term eventHandler arg result => arg -> result; main_ = term "main" map_ :: Term eventHandler arg result => arg -> result; map_ = term "map" mark_ :: Term eventHandler arg result => arg -> result; mark_ = term "mark" menu_ :: Term eventHandler arg result => arg -> result; menu_ = term "menu" menuitem_ :: Term eventHandler arg result => arg -> result; menuitem_ = term "menuitem" meta_ :: Term eventHandler arg result => arg -> result; meta_ = term "meta" meter_ :: Term eventHandler arg result => arg -> result; meter_ = term "meter" nav_ :: Term eventHandler arg result => arg -> result; nav_ = term "nav" noscript_ :: Term eventHandler arg result => arg -> result; noscript_ = term "noscript" object_ :: Term eventHandler arg result => arg -> result; object_ = term "object" ol_ :: Term eventHandler arg result => arg -> result; ol_ = term "ol" optgroup_ :: Term eventHandler arg result => arg -> result; optgroup_ = term "optgroup" option_ :: Term eventHandler arg result => arg -> result; option_ = term "option" output_ :: Term eventHandler arg result => arg -> result; output_ = term "output" p_ :: Term eventHandler arg result => arg -> result; p_ = term "p" param_ :: Term eventHandler arg result => arg -> result; param_ = term "param" picture_ :: Term eventHandler arg result => arg -> result; picture_ = term "picture" pre_ :: Term eventHandler arg result => arg -> result; pre_ = term "pre" progress_ :: Term eventHandler arg result => arg -> result; progress_ = term "progress" q_ :: Term eventHandler arg result => arg -> result; q_ = term "q" rp_ :: Term eventHandler arg result => arg -> result; rp_ = term "rp" rt_ :: Term eventHandler arg result => arg -> result; rt_ = term "rt" ruby_ :: Term eventHandler arg result => arg -> result; ruby_ = term "ruby" s_ :: Term eventHandler arg result => arg -> result; s_ = term "s" samp_ :: Term eventHandler arg result => arg -> result; samp_ = term "samp" script_ :: Term eventHandler arg result => arg -> result; script_ = term "script" section_ :: Term eventHandler arg result => arg -> result; section_ = term "section" select_ :: Term eventHandler arg result => arg -> result; select_ = term "select" small_ :: Term eventHandler arg result => arg -> result; small_ = term "small" source_ :: Term eventHandler arg result => arg -> result; source_ = term "source" span_ :: Term eventHandler arg result => arg -> result; span_ = term "span" strong_ :: Term eventHandler arg result => arg -> result; strong_ = term "strong" style_ :: Term eventHandler arg result => arg -> result; style_ = term "style" sub_ :: Term eventHandler arg result => arg -> result; sub_ = term "sub" summary_ :: Term eventHandler arg result => arg -> result; summary_ = term "summary" sup_ :: Term eventHandler arg result => arg -> result; sup_ = term "sup" table_ :: Term eventHandler arg result => arg -> result; table_ = term "table" tbody_ :: Term eventHandler arg result => arg -> result; tbody_ = term "tbody" td_ :: Term eventHandler arg result => arg -> result; td_ = term "td" textarea_ :: Term eventHandler arg result => arg -> result; textarea_ = term "textarea" tfoot_ :: Term eventHandler arg result => arg -> result; tfoot_ = term "tfoot" th_ :: Term eventHandler arg result => arg -> result; th_ = term "th" thead_ :: Term eventHandler arg result => arg -> result; thead_ = term "thead" time_ :: Term eventHandler arg result => arg -> result; time_ = term "time" title_ :: Term eventHandler arg result => arg -> result; title_ = term "title" tr_ :: Term eventHandler arg result => arg -> result; tr_ = term "tr" track_ :: Term eventHandler arg result => arg -> result; track_ = term "track" u_ :: Term eventHandler arg result => arg -> result; u_ = term "u" ul_ :: Term eventHandler arg result => arg -> result; ul_ = term "ul" var_ :: Term eventHandler arg result => arg -> result; var_ = term "var" video_ :: Term eventHandler arg result => arg -> result; video_ = term "video" wbr_ :: Term eventHandler arg result => arg -> result; wbr_ = term "wbr" -- SVG circle_ :: Term eventHandler arg result => arg -> result; circle_ = term "circle" clipPath_ :: Term eventHandler arg result => arg -> result; clipPath_ = term "clipPath" defs_ :: Term eventHandler arg result => arg -> result; defs_ = term "defs" ellipse_ :: Term eventHandler arg result => arg -> result; ellipse_ = term "ellipse" g_ :: Term eventHandler arg result => arg -> result; g_ = term "g" image_ :: Term eventHandler arg result => arg -> result; image_ = term "image" line_ :: Term eventHandler arg result => arg -> result; line_ = term "line" linearGradient_ :: Term eventHandler arg result => arg -> result; linearGradient_ = term "linearGradient" mask_ :: Term eventHandler arg result => arg -> result; mask_ = term "mask" path_ :: Term eventHandler arg result => arg -> result; path_ = term "path" pattern_ :: Term eventHandler arg result => arg -> result; pattern_ = term "pattern" polygon_ :: Term eventHandler arg result => arg -> result; polygon_ = term "polygon" polyline_ :: Term eventHandler arg result => arg -> result; polyline_ = term "polyline" radialGradient_ :: Term eventHandler arg result => arg -> result; radialGradient_ = term "radialGradient" rect_ :: Term eventHandler arg result => arg -> result; rect_ = term "rect" stop_ :: Term eventHandler arg result => arg -> result; stop_ = term "stop" svg_ :: Term eventHandler arg result => arg -> result; svg_ = term "svg" text_ :: Term eventHandler arg result => arg -> result; text_ = term "text" tspan_ :: Term eventHandler arg result => arg -> result; tspan_ = term "tspan"
nrolland/react-flux
src/React/Flux/DOM.hs
bsd-3-clause
14,560
0
8
2,463
4,035
2,111
1,924
-1
-1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverlappingInstances #-} -- Needed to check (SafeCast to from) in the instance constraints for -- RuntimeCast. {-# LANGUAGE UndecidableInstances #-} -- | Safe casting. We assume Floats have 32 bits and Doubles have 64. module Ivory.Language.Cast ( safeCast , ivoryCast -- do not export from "Ivory.Language" , castWith , castDefault , signCast , SafeCast(), RuntimeCast(), Default(), SignCast() , toMaxSize , toMinSize ) where import Ivory.Language.Float import Ivory.Language.IBool import Ivory.Language.IChar import Ivory.Language.IIntegral import Ivory.Language.Proxy import Ivory.Language.Sint import Ivory.Language.Type import Ivory.Language.Uint import qualified Ivory.Language.Syntax as AST import Data.Word import Data.Int -------------------------------------------------------------------------------- -- Interface functions and methods. -- | Statically safe casts. class (IvoryExpr from, IvoryExpr to) => SafeCast from to where safeCast :: from -> to safeCast = ivoryCast -- | Cast with a default value if the casted value is too large. castWith :: RuntimeCast from to => to -> from -> to castWith deflt from = inBounds deflt from ? (ivoryCast from, deflt) -- | `CastWith 0` for types for which 0 is defined. castDefault :: (Default to, RuntimeCast from to) => from -> to castDefault = castWith defaultVal -- | SignCast takes a unsigned number into its signed form iff safe, -- otherwise 0, and same with signed into unsigned class (IvoryExpr from, IvoryExpr to) => SignCast from to where signCast :: from -> to -- | upperBoundCast implements signCast from unsigned to signed integers upperBoundCast :: forall from to . (IvoryOrd from, IvoryExpr from, IvoryExpr to, Num to, Bounded to) => from -> to upperBoundCast f = (f <=? bound) ? (ivoryCast f, 0) where bound = ivoryCast (maxBound :: to) -- | lowerBoundCast implements signCast from signed to unsigned integers lowerBoundCast :: forall from to . (IvoryOrd from, IvoryExpr from, IvoryExpr to, Num to, Bounded to) => from -> to lowerBoundCast f = (f >? bound) ? (ivoryCast f, 0) where bound = ivoryCast (minBound :: to) -------------------------------------------------------------------------------- -- | Casts requiring runtime checks. class (IvoryExpr from, IvoryExpr to, Default to) => RuntimeCast from to where -- Does the from value fit within the to type? inBounds :: to -> from -> IBool -------------------------------------------------------------------------------- -- Statically safe instances. -- Booleans. instance SafeCast IBool IBool where safeCast = id instance SafeCast IBool IChar instance SafeCast IBool Uint16 instance SafeCast IBool Uint8 instance SafeCast IBool Uint32 instance SafeCast IBool Uint64 instance SafeCast IBool Sint8 instance SafeCast IBool Sint16 instance SafeCast IBool Sint32 instance SafeCast IBool Sint64 instance SafeCast IBool IFloat instance SafeCast IBool IDouble -- Uint8. instance SafeCast Uint8 Uint8 where safeCast = id instance SafeCast Uint8 Uint16 instance SafeCast Uint8 Uint32 instance SafeCast Uint8 Uint64 instance SafeCast Uint8 Sint16 instance SafeCast Uint8 Sint32 instance SafeCast Uint8 Sint64 instance SafeCast Uint8 IFloat instance SafeCast Uint8 IDouble instance SignCast Uint8 Sint8 where signCast = upperBoundCast -- Uint16. instance SafeCast Uint16 Uint16 where safeCast = id instance SafeCast Uint16 Uint32 instance SafeCast Uint16 Uint64 instance SafeCast Uint16 Sint32 instance SafeCast Uint16 Sint64 instance SafeCast Uint16 IFloat instance SafeCast Uint16 IDouble instance SignCast Uint16 Sint16 where signCast = upperBoundCast -- Uint32. instance SafeCast Uint32 Uint32 where safeCast = id instance SafeCast Uint32 Uint64 instance SafeCast Uint32 Sint64 instance SafeCast Uint32 IFloat instance SafeCast Uint32 IDouble instance SignCast Uint32 Sint32 where signCast = upperBoundCast -- Uint64. instance SafeCast Uint64 Uint64 where safeCast = id instance SafeCast Uint64 IDouble instance SignCast Uint64 Sint64 where signCast = upperBoundCast -- Sint8. instance SafeCast Sint8 Sint8 where safeCast = id instance SafeCast Sint8 Sint16 instance SafeCast Sint8 Sint32 instance SafeCast Sint8 Sint64 instance SafeCast Sint8 IFloat instance SafeCast Sint8 IDouble instance SignCast Sint8 Uint8 where signCast = lowerBoundCast -- Sint16. instance SafeCast Sint16 Sint16 where safeCast = id instance SafeCast Sint16 Sint32 instance SafeCast Sint16 Sint64 instance SafeCast Sint16 IFloat instance SafeCast Sint16 IDouble instance SignCast Sint16 Uint16 where signCast = lowerBoundCast -- Sint32. instance SafeCast Sint32 Sint32 where safeCast = id instance SafeCast Sint32 Sint64 instance SafeCast Sint32 IFloat instance SafeCast Sint32 IDouble instance SignCast Sint32 Uint32 where signCast = lowerBoundCast -- Sint64. instance SafeCast Sint64 Sint64 where safeCast = id instance SafeCast Sint64 IDouble instance SignCast Sint64 Uint64 where signCast = lowerBoundCast -- IFloat. instance SafeCast IFloat IFloat where safeCast = id instance SafeCast IFloat IDouble -- IDouble. instance SafeCast IDouble IDouble where safeCast = id -- IChar. instance SafeCast IChar IChar where safeCast = id -- By the C standard, we can't assume they're unsigned or how big they are (we -- just know they're at least 8 bits). So this is the only cast for Char. -------------------------------------------------------------------------------- -- Runtime check instances. -- All other casts, for going to a Num type. instance ( Bounded from, Bounded to , IvoryOrd from, IvoryOrd to , IvoryExpr from, IvoryExpr to , Default from, Default to -- Important constraint! This means we can compare the values in the -- `from` type, since it must be able to hold all the values of the -- `to` type. Alas, it requires undeciable instances.... , SafeCast to from ) => RuntimeCast from to where -- We can assume that comparison in the `from` type is safe due to the above -- constraint. inBounds = boundPred -------------------------------------------------------------------------------- -- | Default values for expression types. class Default a where defaultVal :: a instance Default Uint8 where defaultVal = 0 instance Default Uint16 where defaultVal = 0 instance Default Uint32 where defaultVal = 0 instance Default Uint64 where defaultVal = 0 instance Default Sint8 where defaultVal = 0 instance Default Sint16 where defaultVal = 0 instance Default Sint32 where defaultVal = 0 instance Default Sint64 where defaultVal = 0 instance Default IFloat where defaultVal = 0 instance Default IDouble where defaultVal = 0 -------------------------------------------------------------------------------- -- Floating -- Have to define instances for Float and Double separately or you'll get -- overlapping instances. -- | Casting from a floating to a `Integral` type always results in truncation. instance ( Default to , Bounded to , IvoryIntegral to -- Important constraint! This means we can compare the values in the -- `from` type, since it must be able to hold all the values of the -- `to` type. Alas, it requires undeciable instances.... , SafeCast to IFloat ) => RuntimeCast IFloat to where inBounds to from = iNot (isnan from) .&& boundPred to from instance ( Default to , Bounded to , IvoryIntegral to -- Important constraint! This means we can compare the values in the -- `from` type, since it must be able to hold all the values of the -- `to` type. Alas, it requires undeciable instances.... , SafeCast to IDouble ) => RuntimeCast IDouble to where inBounds to from = iNot (isnan from) .&& boundPred to from -------------------------------------------------------------------------------- -- Utils. boundPred :: forall from to . ( IvoryExpr from , IvoryExpr to , Bounded to , IvoryOrd from ) => to -> from -> IBool boundPred _ from = (from <=? ivoryCast (maxBound :: to)) .&& (from >=? ivoryCast (minBound :: to)) -- XXX Don't export. -- Type is what we're casting from. ivoryCast :: forall a b. (IvoryExpr a, IvoryExpr b) => a -> b ivoryCast x = wrapExpr (AST.ExpSafeCast ty (unwrapExpr x)) where ty = ivoryType (Proxy :: Proxy a) toMaxSize :: AST.Type -> Maybe Integer toMaxSize ty = case ty of AST.TyInt i -> Just $ case i of AST.Int8 -> fromIntegral (maxBound :: Int8) AST.Int16 -> fromIntegral (maxBound :: Int16) AST.Int32 -> fromIntegral (maxBound :: Int32) AST.Int64 -> fromIntegral (maxBound :: Int64) AST.TyWord w -> Just $ case w of AST.Word8 -> fromIntegral (maxBound :: Word8) AST.Word16 -> fromIntegral (maxBound :: Word16) AST.Word32 -> fromIntegral (maxBound :: Word32) AST.Word64 -> fromIntegral (maxBound :: Word64) AST.TyIndex n -> Just n _ -> Nothing toMinSize :: AST.Type -> Maybe Integer toMinSize ty = case ty of AST.TyInt i -> Just $ case i of AST.Int8 -> fromIntegral (minBound :: Int8) AST.Int16 -> fromIntegral (minBound :: Int16) AST.Int32 -> fromIntegral (minBound :: Int32) AST.Int64 -> fromIntegral (minBound :: Int64) AST.TyWord w -> Just $ case w of AST.Word8 -> fromIntegral (minBound :: Word8) AST.Word16 -> fromIntegral (minBound :: Word16) AST.Word32 -> fromIntegral (minBound :: Word32) AST.Word64 -> fromIntegral (minBound :: Word64) AST.TyIndex _ -> Just 0 _ -> Nothing --------------------------------------------------------------------------------
Hodapp87/ivory
ivory/src/Ivory/Language/Cast.hs
bsd-3-clause
10,214
0
13
2,257
2,228
1,180
1,048
-1
-1
{- THMain.hs -} {-# LANGUAGE TemplateHaskell #-} module THMain where -- Import our template "pr" import THPrintf (pr) -- The splice operator $ takes the Haskell source code -- generated at compile time by "pr" and splices it into -- the argument of "putStrLn". main :: IO () main = putStrLn ( $(pr "Hello") )
notae/haskell-exercise
th/THMain.hs
bsd-3-clause
313
0
9
59
46
28
18
5
1
module Main where import Synth.Synth import Analysis.FFT import Settings import Control.Monad import System.Console.CmdArgs import Utils import System.Directory import System.Timeout import Types.Common import Types.Filter import Codec.Wav import Data.List results_file = "trumpet_sounds_results.txt" main = do writeHeader results_file let dir = "Sounds/SynthesisBenchmarks/Recordings/TrumpetSounds/" input = dir++"mute_00_none.wav" trumpetConfig = defaultOptions { inputExample = input } allMuteSounds <- listDirectory dir let allMuteSounds' = map (dir++) $ sort allMuteSounds oneSecond = 1000000 runOne fp = runBenchmarkTimed (7 * 60 * oneSecond) results_file $ trumpetConfig { outputExample = dir++fp , smartStructuralRefinement = True , thetaLogSizeTimeout = 4 , filterLogSizeTimeout = 5 , epsilon = 10 } -- allMuteAudio <- mapM getFile allMuteSounds' -- let as = zip allMuteSounds' allMuteAudio -- mapM (\a -> auralDistance (head as) a >>= (\x -> print ((fst a)++" "++show x)) ) as -- mapM_ runOne allMuteSounds runOne "mute_01_hat.wav" getFile :: FilePath -> IO(AudioFormat) getFile filepath = do let f x = either (error "failed") id x w <- importFile $ filepath :: IO(Either String (AudioFormat)) return $ f w
aedanlombardo/HaskellPS
DSP-PBE/Executables/TrumpetSounds.hs
bsd-3-clause
1,397
0
14
346
306
165
141
39
1
{-# LANGUAGE DataKinds, TypeOperators, QuasiQuotes #-} import Data.Record import Text.Read (readMaybe) import Control.Applicative import Control.Monad.State import Control.Arrow import Data.Monoid type Coord2D = '[ "x" := Double , "y" := Double ] type Coord3D = Coord2D ++ '[ "z" := Double ] writeM :: (Monad m, Update r k a) => Key k -> a -> RecordT m r -> RecordT m r writeM k x = write k (return x) main :: IO () main = do let point2D = 0 & 0.5 & nil :: Record Coord2D point3D = union point2D (3 & nil) :: Record Coord3D print $ access [key|x|] point2D print $ access [key|y|] point2D print point3D [x,y,z] <- replicateM 3 (readMaybe <$> getLine) let pointy3D = x &. y &. z &. nil :: RecordT Maybe Coord3D pointm3D = transform (Just . runIdentity) point3D let mf :: StateT (RecordT Maybe Coord3D) IO () mf = do xm <- fields [key|x|] liftIO (print xm) [key|x|] =: Just 100 [key|y|] ~: fmap (maybe 0 id xm +) [key|z|] =: Just 32 print =<< runStateT mf pointy3D print . ($ (rempty :: RecordT Maybe Coord3D)) $ write [key|x|] (Just (sqrt 2)) >>> write [key|y|] (Just (sqrt 3)) >>> write [key|z|] (Just (sqrt 4)) print (combineWith (<|>) pointy3D pointm3D)
mikeplus64/record
Example.hs
bsd-3-clause
1,362
2
15
416
570
298
272
38
1
------------------------------------------------------------ -- | -- Module : Cycle -- copyright : Kotaro Ohsugi -- License : BSD-style (see the LICENSE file in the distribution) -- -- Cyclic group maker ------------------------------------------------------------ module Cycle (cycle') where -- A wrapper of cycle''. -- This function organize the order of a brand-new cyclic group. -- | cycle' creates a cyclic group from a given op, generator and -- an order. -- -- For instance, -- -- >>> cycle' (.) rotl1 5 -- [(0 1 2 3 4),(1 2 3 4 0),(2 3 4 0 1),(3 4 0 1 2),(4 0 1 2 3)] -- -- __where__ (nums) notates the permutation. cycle' :: (a -> a -> a) -> a -> Int -> [a] cycle' f _ 0 = [] cycle' f gen order = last group : init group where group = cycle'' f gen gen order -- | cycle'' actually creates a cyclic group from a given op, -- a generator and an order. cycle'' :: (a -> a -> a) -> a -> a -> Int -> [a] cycle'' _ _ _ 0 = [] cycle'' f gen p order = p : cycle'' f gen (p `f` gen) (order-1)
pythonissam/Cyclic
src/Cycle.hs
bsd-3-clause
1,011
0
9
215
207
119
88
8
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Network.Monitoring.RiemannT where import Network.Monitoring.Riemann import Data.Functor.Identity import Control.Monad.IO.Class import Control.Applicative import Control.Proxy hiding (Client) type Prx = ProxyFast -- | A monad transformer layer which allows for the observation of -- Riemann 'Event's. newtype RiemannT m a = RiemannT (Prx () () () Event m a) deriving (Functor, Applicative, Monad, MonadTrans, MonadIO) -- | This is written separately so that GeneralizedNewtypeDeriving can -- do its magic. unRiemannT :: RiemannT m a -> () -> Prx () () () Event m a unRiemannT (RiemannT m) () = m -- | A monad allowing the observation of Riemann 'Event's. Equivalent -- to 'RiemannT Identity'. type Riemann = RiemannT Identity -- | Observes an 'Event' in the 'RiemannT' monad. obs :: Monad m => Event -> RiemannT m () obs = RiemannT . runIdentityP . respond -- | 'runRiemannT c' is for any 'MonadIO m' a natural transformation -- from 'RiemannT m' to 'm', delivering the events raised in 'RiemannT -- m' to the 'Client' 'c'. runRiemannT :: MonadIO m => Client -> RiemannT m a -> m a runRiemannT client rmt = runProxy (unRiemannT rmt >-> mapMD (liftIO . sendEvent client)) -- | Extracts the observed events from a 'Riemann' monad observed :: Riemann a -> (a, [Event]) observed = runIdentity . observedT -- | Extracts the observed events from a 'RiemannT' monad -- -- If the monad below is 'IO' then this does not lazily produce -- values; however, 'runRiemannT' does, so perhaps it has something to -- do with the 'WriterT'. observedT :: Monad m => RiemannT m a -> m (a, [Event]) observedT rmt = runWriterT $ runProxy (raiseK (unRiemannT rmt) >-> toListD)
telser/riemann-hs
src/Network/Monitoring/RiemannT.hs
mit
1,721
0
11
296
380
209
171
23
1
{-# LANGUAGE DeriveDataTypeable #-} {- | Module : $Header$ Description : abstract syntax of CASL architectural specifications Copyright : (c) Klaus Luettich, Uni Bremen 2002-2006 License : GPLv2 or higher, see LICENSE.txt Maintainer : till@informatik.uni-bremen.de Stability : provisional Portability : non-portable(imports Syntax.AS_Structured) Abstract syntax of (Het)CASL architectural specifications Follows Sect. II:2.2.4 of the CASL Reference Manual. -} module Syntax.AS_Architecture where -- DrIFT command: {-! global: GetRange !-} import Common.Id import Common.IRI import Common.AS_Annotation import Syntax.AS_Structured import Data.Typeable -- for arch-spec-defn and unit-spec-defn see AS_Library data ARCH_SPEC = Basic_arch_spec [Annoted UNIT_DECL_DEFN] (Annoted UNIT_EXPRESSION) Range -- pos: "unit","result" | Arch_spec_name ARCH_SPEC_NAME | Group_arch_spec (Annoted ARCH_SPEC) Range -- pos: "{","}" deriving (Show, Typeable) data UNIT_DECL_DEFN = Unit_decl UNIT_NAME REF_SPEC [Annoted UNIT_TERM] Range -- pos: ":", opt ("given"; Annoted holds pos of commas) | Unit_defn UNIT_NAME UNIT_EXPRESSION Range -- pos: "=" deriving (Show, Typeable) data UNIT_SPEC = Unit_type [Annoted SPEC] (Annoted SPEC) Range -- pos: opt "*"s , "->" | Spec_name SPEC_NAME | Closed_unit_spec UNIT_SPEC Range -- pos: "closed" deriving (Show, Typeable) data REF_SPEC = Unit_spec UNIT_SPEC | Refinement Bool UNIT_SPEC [G_mapping] REF_SPEC Range -- false means "behaviourally" | Arch_unit_spec (Annoted ARCH_SPEC) Range {- pos: "arch","spec" The ARCH_SPEC has to be surrounded with braces and after the opening brace is a [Annotation] allowed -} | Compose_ref [REF_SPEC] Range -- pos: "then" | Component_ref [UNIT_REF] Range -- pos "{", commas and "}" deriving (Show, Typeable) data UNIT_REF = Unit_ref UNIT_NAME REF_SPEC Range -- pos: ":" deriving (Show, Typeable) data UNIT_EXPRESSION = Unit_expression [UNIT_BINDING] (Annoted UNIT_TERM) Range -- pos: opt "lambda",semi colons, "." deriving (Show, Typeable) data UNIT_BINDING = Unit_binding UNIT_NAME UNIT_SPEC Range -- pos: ":" deriving (Show, Typeable) data UNIT_TERM = Unit_reduction (Annoted UNIT_TERM) RESTRICTION | Unit_translation (Annoted UNIT_TERM) RENAMING | Amalgamation [Annoted UNIT_TERM] Range -- pos: "and"s | Local_unit [Annoted UNIT_DECL_DEFN] (Annoted UNIT_TERM) Range -- pos: "local", "within" | Unit_appl UNIT_NAME [FIT_ARG_UNIT] Range -- pos: many of "[","]" | Group_unit_term (Annoted UNIT_TERM) Range -- pos: "{","}" deriving (Show, Typeable) data FIT_ARG_UNIT = Fit_arg_unit (Annoted UNIT_TERM) [G_mapping] Range -- pos: opt "fit" deriving (Show, Typeable) type ARCH_SPEC_NAME = IRI type UNIT_NAME = IRI
mariefarrell/Hets
Syntax/AS_Architecture.der.hs
gpl-2.0
3,482
0
8
1,164
492
282
210
42
0
{-# 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.Glacier.DeleteVault -- Copyright : (c) 2013-2015 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- This operation deletes a vault. Amazon Glacier will delete a vault only -- if there are no archives in the vault as of the last inventory and there -- have been no writes to the vault since the last inventory. If either of -- these conditions is not satisfied, the vault deletion fails (that is, -- the vault is not removed) and Amazon Glacier returns an error. You can -- use DescribeVault to return the number of archives in a vault, and you -- can use -- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-initiate-job-post.html Initiate a Job (POST jobs)> -- to initiate a new inventory retrieval for a vault. The inventory -- contains the archive IDs you use to delete archives using -- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-archive-delete.html Delete Archive (DELETE archive)>. -- -- This operation is idempotent. -- -- An AWS account has full permission to perform all operations (actions). -- However, AWS Identity and Access Management (IAM) users don\'t have any -- permissions by default. You must grant them explicit permission to -- perform specific actions. For more information, see -- <http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html Access Control Using AWS Identity and Access Management (IAM)>. -- -- For conceptual information and underlying REST API, go to -- <http://docs.aws.amazon.com/amazonglacier/latest/dev/deleting-vaults.html Deleting a Vault in Amazon Glacier> -- and -- <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-delete.html Delete Vault> -- in the /Amazon Glacier Developer Guide/. -- -- /See:/ <http://docs.aws.amazon.com/amazonglacier/latest/dev/api-DeleteVault.html AWS API Reference> for DeleteVault. module Network.AWS.Glacier.DeleteVault ( -- * Creating a Request deleteVault , DeleteVault -- * Request Lenses , dAccountId , dVaultName -- * Destructuring the Response , deleteVaultResponse , DeleteVaultResponse ) where import Network.AWS.Glacier.Types import Network.AWS.Glacier.Types.Product import Network.AWS.Prelude import Network.AWS.Request import Network.AWS.Response -- | Provides options for deleting a vault from Amazon Glacier. -- -- /See:/ 'deleteVault' smart constructor. data DeleteVault = DeleteVault' { _dAccountId :: !Text , _dVaultName :: !Text } deriving (Eq,Read,Show,Data,Typeable,Generic) -- | Creates a value of 'DeleteVault' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'dAccountId' -- -- * 'dVaultName' deleteVault :: Text -- ^ 'dAccountId' -> Text -- ^ 'dVaultName' -> DeleteVault deleteVault pAccountId_ pVaultName_ = DeleteVault' { _dAccountId = pAccountId_ , _dVaultName = pVaultName_ } -- | The 'AccountId' value is the AWS account ID of the account that owns the -- vault. You can either specify an AWS account ID or optionally a single -- apos'-'apos (hyphen), in which case Amazon Glacier uses the AWS account -- ID associated with the credentials used to sign the request. If you use -- an account ID, do not include any hyphens (apos-apos) in the ID. dAccountId :: Lens' DeleteVault Text dAccountId = lens _dAccountId (\ s a -> s{_dAccountId = a}); -- | The name of the vault. dVaultName :: Lens' DeleteVault Text dVaultName = lens _dVaultName (\ s a -> s{_dVaultName = a}); instance AWSRequest DeleteVault where type Rs DeleteVault = DeleteVaultResponse request = delete glacier response = receiveNull DeleteVaultResponse' instance ToHeaders DeleteVault where toHeaders = const mempty instance ToPath DeleteVault where toPath DeleteVault'{..} = mconcat ["/", toBS _dAccountId, "/vaults/", toBS _dVaultName] instance ToQuery DeleteVault where toQuery = const mempty -- | /See:/ 'deleteVaultResponse' smart constructor. data DeleteVaultResponse = DeleteVaultResponse' deriving (Eq,Read,Show,Data,Typeable,Generic) -- | Creates a value of 'DeleteVaultResponse' with the minimum fields required to make a request. -- deleteVaultResponse :: DeleteVaultResponse deleteVaultResponse = DeleteVaultResponse'
fmapfmapfmap/amazonka
amazonka-glacier/gen/Network/AWS/Glacier/DeleteVault.hs
mpl-2.0
4,951
0
9
898
446
281
165
59
1
-- Copyright 2014 by Mark Watson. All rights reserved. The software and data in this project can be used under the terms of the GPL version 3 license. module Categorize (bestCategories, splitWords, bigram) where import qualified Data.Map as M import Data.List (sortBy) import Category1Gram (onegrams) import Category2Gram (twograms) import Sentence (segment) import Stemmer (stem) import Utils (splitWords, bigram, bigram_s) catnames1 = map fst onegrams catnames2 = map fst twograms stemWordsInString s = init $ concat $ map (\x -> x ++ " ") $ map stem (splitWords s) stemScoredWordList swl = map (\(str,score) -> (stemWordsInString str, score)) swl stem2 = map (\(category, swl) -> (category, M.fromList (stemScoredWordList (M.toList swl)))) twograms -- note: the following does extra, uneeded work: stem1 = map (\(category, swl) -> (category, M.fromList (stemScoredWordList (M.toList swl)))) onegrams scoreCat wrds amap = foldl (+) 0 $ map (\x -> M.findWithDefault 0.0 x amap) wrds score wrds amap = filter (\(a, b) -> b > 0.9) $ zip [0..] $ map (\(s, m) -> scoreCat wrds m) amap cmpScore (a1, b1) (a2, b2) = compare b2 b1 bestCategoriesHelper wrds ngramMap categoryNames= let tg = bigram_s wrds in map (\(a, b) -> (categoryNames !! a, b)) $ sortBy cmpScore $ score wrds ngramMap bestCategories1 wrds = take 3 $ bestCategoriesHelper wrds onegrams catnames1 bestCategories2 wrds = take 3 $ bestCategoriesHelper (bigram_s wrds) twograms catnames2 bestCategories1stem wrds = take 3 $ bestCategoriesHelper wrds stem1 catnames1 bestCategories2stem wrds = take 3 $ bestCategoriesHelper (bigram_s wrds) stem2 catnames2 bestCategories :: [[Char]] -> [([Char], Double)] bestCategories wrds = let sum1 = (M.unionWith (+) (M.fromList $ bestCategories1 wrds) ( M.fromList $ bestCategories2 wrds)); sum2 = (M.unionWith (+) (M.fromList $ bestCategories1stem wrds) ( M.fromList $ bestCategories2stem wrds)) in sortBy cmpScore $ M.toList $ M.unionWith (+) sum1 sum2 main = do let s = "The sport of hocky is about 100 years old by ahdi dates. American Football is a newer sport. Programming is fun. Congress passed a new budget that might help the economy. The frontier initially was a value path. The ai research of john mccarthy." print $ bestCategories1 (splitWords s) print $ bestCategories1stem (splitWords s) print $ score (splitWords s) onegrams print $ score (bigram_s (splitWords s)) twograms print $ bestCategories2 (splitWords s) print $ bestCategories2stem (splitWords s) print $ bestCategories (splitWords s)
mark-watson/kbnlp.hs
Categorize.hs
agpl-3.0
2,644
0
14
516
877
458
419
44
1
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="es-ES"> <title>Forced Browse Add-On</title> <maps> <homeID>top</homeID> <mapref location="map.jhm"/> </maps> <view> <name>TOC</name> <label>Contents</label> <type>org.zaproxy.zap.extension.help.ZapTocView</type> <data>toc.xml</data> </view> <view> <name>Index</name> <label>Índice</label> <type>javax.help.IndexView</type> <data>index.xml</data> </view> <view> <name>Search</name> <label>Buscar</label> <type>javax.help.SearchView</type> <data engine="com.sun.java.help.search.DefaultSearchEngine"> JavaHelpSearch </data> </view> <view> <name>Favorites</name> <label>Favorites</label> <type>javax.help.FavoritesView</type> </view> </helpset>
veggiespam/zap-extensions
addOns/bruteforce/src/main/javahelp/org/zaproxy/zap/extension/bruteforce/resources/help_es_ES/helpset_es_ES.hs
apache-2.0
968
101
29
158
411
213
198
-1
-1
-- QC tests for random number generators -- -- Require QuickCheck >= 2.2 module MWC.QC ( tests ) where import Control.Applicative import Data.Word (Word8,Word16,Word32,Word64,Word) import Data.Int (Int8, Int16, Int32, Int64 ) import Test.QuickCheck import Test.QuickCheck.Monadic import Test.Framework import Test.Framework.Providers.QuickCheck2 import System.Random.MWC ---------------------------------------------------------------- tests :: GenIO -> Test tests g = testGroup "Range" [ testProperty "Int8" $ (prop_InRange g :: InRange Int8) , testProperty "Int16" $ (prop_InRange g :: InRange Int16) , testProperty "Int32" $ (prop_InRange g :: InRange Int32) , testProperty "Int64" $ (prop_InRange g :: InRange Int64) , testProperty "Word8" $ (prop_InRange g :: InRange Word8) , testProperty "Word16" $ (prop_InRange g :: InRange Word16) , testProperty "Word32" $ (prop_InRange g :: InRange Word32) , testProperty "Word64" $ (prop_InRange g :: InRange Word64) , testProperty "Int" $ (prop_InRange g :: InRange Int) , testProperty "Word64" $ (prop_InRange g :: InRange Word) , testProperty "Float" $ (prop_InRange g :: InRange Float) , testProperty "Double" $ (prop_InRange g :: InRange Double) ] ---------------------------------------------------------------- -- Test that values generated with uniformR never lie outside range. prop_InRange :: (Variate a, Ord a,Num a) => GenIO -> OrderedPair a -> Property prop_InRange g (OrderedPair (x1,x2)) = monadicIO $ do r <- run $ uniformR (x1,x2) g assert (x1 <= r && r <= x2) type InRange a = OrderedPair a -> Property -- Ordered pair (x,y) for which x <= y newtype OrderedPair a = OrderedPair (a,a) deriving Show instance (Ord a, Arbitrary a) => Arbitrary (OrderedPair a) where arbitrary = OrderedPair <$> suchThat arbitrary (uncurry (<=))
bos/mwc-random
mwc-random-bench/test/MWC/QC.hs
bsd-2-clause
1,874
0
12
338
568
306
262
33
1
{-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} -- {-# LANGUAGE FlexibleInstances, OverlappingInstances, IncoherentInstances #-} -- {-# LANGUAGE OverloadedStrings #-} module Hayoo.ParseSignature ( SignatureT (..) , Signature , parseSignature , prettySignature , normalizeSignature , expand , expandNormalized , modifySignatureWith , processSignatureWith , parseNormSignature , subSignatures , normSignatures , normSignature , isComplex , complexSignatures , buildConstructorSignature -- for Hayoo indexer ) where import Control.Applicative ((*>), (<$>), (<*), (<*>)) import Control.Monad.Identity (Identity) import Control.Monad.State (State, get, put, runState) import Data.Char.Properties.UnicodeCharProps (isUnicodeLl, isUnicodeLt, isUnicodeLu, isUnicodeN, isUnicodeP, isUnicodeS) import Data.Foldable (Foldable) import Data.List (intercalate, nub) import Data.String (IsString, fromString) import Data.Traversable (Traversable, mapM) import Prelude hiding (mapM, sequence) import Text.Parsec (ParseError, ParsecT, char, eof, many, many1, parse, satisfy, sepBy, spaces, string, (<?>), (<|>)) -- ------------------------------------------------------------ data SignatureT a = VarSym { getSymbol :: a } | TypeSym { getTypeSym :: String } -- String is important here (*) | TypeApp { getTypes :: [SignatureT a] } | Tuple { getElements :: [SignatureT a] } | Function { getParameter :: SignatureT a, getResult :: SignatureT a } | Context { getContext :: SignatureT a, getType :: SignatureT a } | Equiv { getLeft :: SignatureT a, getRight :: SignatureT a } | ExType { getLocals :: [SignatureT a], getType :: SignatureT a } deriving (Eq, Functor, Foldable, Traversable, Show) -- (*) it changes the semantics of Functor and the other derived instances -- when renaming variables in @normalizeSignature@ only the @VarSym@ nodes are -- mapped, the @TypeSym@s remain constant type Signature = SignatureT String type StringParsec r = ParsecT String () Identity r type SignatureParser = StringParsec Signature type StringParser = StringParsec String type CharParser = StringParsec Char -- -------------------- -- Char parser idChar' :: (Char -> Bool) -> CharParser idChar' p = satisfy (\ c -> isUnicodeLl c -- lowercase letter || isUnicodeLu c -- uppercase letter || isUnicodeLt c -- titlecase letter || isUnicodeN c -- digit || p c ) idChar :: CharParser idChar = idChar' (`elem` "_'") idCharDot :: CharParser idCharDot = idChar' (`elem` "_'.") -- "." is included for qualified names symChar :: CharParser symChar = satisfy (\ c -> ( c < '\128' && ( c `elem` "!#$%&*+./<=>?@\\^|-~" || c == ':' ) ) || ( c >= '\128' && ( isUnicodeS c || isUnicodeP c ) ) ) -- -------------------- -- String parser idSuffix :: StringParser idSuffix = many idChar idSuffixDot :: StringParser idSuffixDot = many idCharDot varId :: StringParser varId = (:) <$> satisfy (\ c -> isUnicodeLl c || c == '_') <*> idSuffix typeId :: StringParser typeId = (:) <$> satisfy (\ c -> isUnicodeLu c || isUnicodeLt c) <*> idSuffixDot -- type names may be qualified conOp :: StringParser -- infix type def, e.g "a :+: b" conOp = (:) <$> char ':' <*> many symChar -- -------------------- -- Signature parser varSy :: SignatureParser varSy = VarSym <$> (varId <* spaces) typeSy :: SignatureParser typeSy = TypeSym <$> (typeId <* spaces) conSy :: SignatureParser conSy = (TypeSym <$> (conOp <* spaces)) -- <|> -- (VarSym <$> (varOp <* spaces)) -- TODO: pretty of type variables as operators infixIdSy :: SignatureParser infixIdSy = char '`' *> ((TypeSym <$> typeId) <|> (VarSym <$> varId )) <* (char '`' <* spaces) infixSy :: SignatureParser infixSy = conSy <|> infixIdSy prim :: SignatureParser prim = typeSy <|> varSy' <|> tuple <|> list <?> "primitive type" where varSy' = do sy <- varSy case sy of VarSym "forall" -- check for reserved word "forall" -> existentialType _ -> return sy typeApp :: SignatureParser typeApp = do ts <- many1 prim case ts of [t] -> return t _ -> return $ TypeApp ts typeInfix :: SignatureParser typeInfix = do t1 <- typeApp typeOp t1 <|> return t1 where typeOp t1 = (\ op t2 -> TypeApp [op, t1, t2]) <$> infixSy <*> typeApp -- or typeInfix ? expr :: SignatureParser expr = do btype <- typeInfix -- exprBranch ( Function btype <$> (sarrow *> spaces *> expr)) <|> (Context btype <$> (darrow *> spaces *> expr)) <|> (Equiv btype <$> (string "~" *> spaces *> expr)) <|> return btype where sarrow = string "->" <|> string "\8594" -- unicode -> darrow = string "=>" <|> string "\8658" -- unicode => list :: SignatureParser list = (TypeApp . (TypeSym "[]" :) . (:[])) <$> brackets expr tuple :: SignatureParser tuple = do elems <- (parens $ sepBy expr $ (char ',' *> spaces)) case elems of [] -> return $ TypeSym "()" [e] -> return e _ -> return $ Tuple elems existentialType :: SignatureParser existentialType = ExType <$> many1 varSy <*> (string "." *> spaces *> expr) brackets :: SignatureParser -> SignatureParser brackets sub = (char '[' *> spaces) *> sub <* (char ']' *> spaces) parens :: StringParsec a -> StringParsec a parens sub = (char '(' *> spaces) *> sub <* (char ')' *> spaces) withEof :: SignatureParser -> SignatureParser withEof content = content <* eof parseSignature :: String -> Either ParseError Signature parseSignature = parse (withEof expr) "<signature>" instance IsString Signature where fromString s = either (error . show) id $ parseSignature s -- ---------------------- isInfixType :: Signature -> Bool isInfixType (TypeSym (':' : _)) = True isInfixType _ = False addParens :: Signature -> String addParens s = "(" ++ (pretty s) ++ ")" checkParens :: Signature -> String checkParens s@TypeSym{} = pretty s checkParens s@VarSym{} = pretty s checkParens s@Tuple{} = pretty s checkParens s@(TypeApp (TypeSym "[]" : _)) = pretty s checkParens s@(TypeApp (t:_)) | isInfixType t = pretty s checkParens s = addParens s checkParensf :: Signature -> String -- checkParensf s@(TypeApp (t:_)) -- | isInfixType t = checkParens s checkParensf s@(TypeApp _) = pretty s checkParensf s = checkParens s pretty :: Signature -> String pretty (TypeSym i) = i pretty (VarSym i) = i pretty (TypeApp [TypeSym "[]", c]) = "[" ++ (pretty c) ++ "]" pretty (TypeApp [t, t1, t2]) | isInfixType t = checkParensf t1 ++ pretty t ++ checkParensf t2 pretty (TypeApp cs) = intercalate " " $ map checkParens cs pretty (Tuple cs) = "(" ++ (intercalate "," $ map pretty cs) ++ ")" pretty (Function p r) = checkParensf p ++ "->" ++ pretty r pretty (Context c t) = checkParensf c ++ "=>" ++ pretty t pretty (Equiv l r) = pretty l ++ "~" ++ pretty r pretty (ExType ls t) = "forall " ++ (intercalate " " $ map pretty ls) ++ "." ++ pretty t prettySignature :: Signature -> String prettySignature = pretty -- ---------------------- children :: Signature -> [Signature] children = nub . children' where children' :: Signature -> [Signature] children' TypeSym{} = [] children' VarSym{} = [] children' (TypeApp cs) = cs children' (Tuple e) = e ++ (concatMap children' e) children' (Function param result) = param : result : children' param ++ children' result children' (Context cx ty ) = ty : cxElems cx ++ children' ty children' (Equiv l r ) = l : r : children' l ++ children' r children' (ExType _ls ty ) = ty : children' ty -- @childen'@ called instead of @childen@, else @nub@ is called more than once cxElems :: Signature -> [Signature] cxElems (Tuple cxs) = cxs cxElems cx = [cx] nextKey :: [(String, String)] -> String nextKey [] = "a" nextKey ((_, k) : _) = nextKey' k where nextKey' :: String -> String nextKey' k' = head $ tail $ dropWhile (/= k') $ (map return ['a'..'z']) ++ [x:y:[] | x <- ['a'..'z'], y <- ['a'..'z']] normalizeSignature :: Signature -> (Signature, [(String, String)]) normalizeSignature sig = runState (mapM norm sig) [] -- visit all VarSym nodes and rename ids into standard names where norm :: String -> State [(String, String)] String norm sym = do st <- get case lookup sym st of Just s -> return s Nothing -> let s = nextKey st in do put $ (sym, s) : st return s parents :: Signature -> Signature parents s@TypeSym{} = s parents s@VarSym{} = s parents (TypeApp [_, s@TypeSym{}]) = s -- drop the topmost type id parents (TypeApp [_, s@VarSym{} ]) = s -- drop the topmost type id parents (TypeApp cs) = TypeApp $ parents <$> cs -- simplify inner types parents (Tuple e) = Tuple $ map parents e parents (Function param result) = Function (parents param) (parents result) parents (Context cx ty ) = Context cx (parents ty ) parents e@Equiv{} = e parents (ExType ls ty ) = ExType ls (parents ty ) parents' :: Signature -> [Signature] parents' s | s == s' = [] | otherwise = [s'] where s' = parents s countComplex :: Signature -> Int countComplex VarSym{} = 0 -- var ids don't carry any information countComplex TypeSym{} = 1 -- type ids do countComplex (TypeApp cs) = 0 + (sum $ countComplex <$> cs) countComplex (Tuple e) = 1 + (sum $ map countComplex e) countComplex (Function param result) = 1 + countComplex param + countComplex result countComplex (Context cx ty ) = 1 + countComplex cx + countComplex ty countComplex (Equiv l r ) = 1 + countComplex l + countComplex r countComplex (ExType ls ty ) = length ls + countComplex ty isComplex :: Int -> Signature -> Bool isComplex c s = countComplex s >= c expand' :: Signature -> [Signature] expand' s = ps1 ++ ps2 ++ children s where ps1 = parents' s ps2 = concatMap parents' ps1 (<$$>) :: (Functor f, Functor f1) => (a -> b) -> f (f1 a) -> f (f1 b) (<$$>) f x = (fmap.fmap) f x normSignatures :: [Signature] -> [Signature] normSignatures = nub . concatMap normSignature -- | Normalize names of var ids -- -- If nothing is renamed, the empty list is returned normSignature :: Signature -> [Signature] normSignature s | noRename = [] | otherwise = [s'] where (s', xs) = normalizeSignature s noRename = null $ filter (\ (x, y) -> x /= y) xs -- ------------------------------------------------------------ -- | Compute all normalized sub signatures, -- no filter by complexity is done, this can be done with 'complexSignatures' subSignatures :: Signature -> [Signature] subSignatures = nub . map (fst . normalizeSignature) . subs where subs (Context cx ty) = cxElems cx ++ [ty] ++ subs ty subs Equiv{} = [] subs s = expand' s -- | Filter signatures by complexity. -- -- Every type name counts 1, every type construtor ("->", "[.]", "(,)", ...) counts 1. -- All signatures with complexity @< c@ is removed complexSignatures :: Int -> [Signature] -> [Signature] complexSignatures c = filter (isComplex c) -- | Parse a signature and rename variables by using a,b,c,... parseNormSignature :: String -> Either ParseError Signature parseNormSignature = either Left (Right . fst . normalizeSignature) . parse (withEof expr) "<signature>" -- | Parse a signature, normalize it, transform it and convert is back to a string processSignatureWith :: (Signature -> [Signature]) -> String -> String processSignatureWith func sig = either (const "") (intercalate "\n") $ pretty <$$> (func <$> parseNormSignature sig) buildConstructorSignature :: String -> String buildConstructorSignature s = either (const "") editSig $ parseSignature ("XXX " ++ s) where editSig (TypeApp (_ : cs)) = pretty $ foldr1 Function cs editSig _ = "" -- ------------------------------------------------------------ expand :: Signature -> [Signature] expand s = nub $ s : (filter (isComplex 3) $ expand' s) {-# DEPRECATED expand "Use subSignatures instead" #-} expandNormalized :: Signature -> [Signature] expandNormalized = map (fst . normalizeSignature) . expand {-# DEPRECATED expandNormalized "Use subSignatures, normSignature or normSignatures and complexSignatures instead" #-} modifySignatureWith :: (Signature -> [Signature]) -> String -> String modifySignatureWith func sig = either (const sig) (intercalate "\n") $ pretty <$$> (func <$> parseSignature sig) {-# DEPRECATED modifySignatureWith "Use processSignatureWith instead" #-} -- ------------------------------------------------------------
erantapaa/simple-hunt
src/Hayoo/ParseSignature.hs
bsd-3-clause
15,106
0
18
5,043
4,063
2,157
1,906
300
8
{-# LANGUAGE TemplateHaskell #-} module Foo where import Language.Haskell.TH import Text.Printf -- | Report an error. -- -- >>> :set -XTemplateHaskell -- >>> $(logError "Something bad happened!") -- ERROR <interactive>: Something bad happened! logError :: String -> Q Exp logError msg = do loc <- location let s = (printf "ERROR %s: %s" (loc_filename loc) msg) :: String [| putStrLn s |]
sol/doctest
test/integration/template-haskell/Foo.hs
mit
396
0
13
70
82
47
35
9
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- Module : Network.AWS.SQS.PurgeQueue -- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com> -- 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 <brendan.g.hay@gmail.com> -- Stability : experimental -- Portability : non-portable (GHC extensions) -- -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | Deletes the messages in a queue specified by the queue URL. -- -- When you use the 'PurgeQueue' API, the deleted messages in the queue cannot be -- retrieved. When you purge a queue, the message deletion process takes up to -- 60 seconds. All messages sent to the queue before calling 'PurgeQueue' will be -- deleted; messages sent to the queue while it is being purged may be deleted. -- While the queue is being purged, messages sent to the queue before 'PurgeQueue' -- was called may be received, but will be deleted within the next minute. -- -- <http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_PurgeQueue.html> module Network.AWS.SQS.PurgeQueue ( -- * Request PurgeQueue -- ** Request constructor , purgeQueue -- ** Request lenses , pqQueueUrl -- * Response , PurgeQueueResponse -- ** Response constructor , purgeQueueResponse ) where import Network.AWS.Prelude import Network.AWS.Request.Query import Network.AWS.SQS.Types import qualified GHC.Exts newtype PurgeQueue = PurgeQueue { _pqQueueUrl :: Text } deriving (Eq, Ord, Read, Show, Monoid, IsString) -- | 'PurgeQueue' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'pqQueueUrl' @::@ 'Text' -- purgeQueue :: Text -- ^ 'pqQueueUrl' -> PurgeQueue purgeQueue p1 = PurgeQueue { _pqQueueUrl = p1 } -- | The queue URL of the queue to delete the messages from when using the 'PurgeQueue' API. pqQueueUrl :: Lens' PurgeQueue Text pqQueueUrl = lens _pqQueueUrl (\s a -> s { _pqQueueUrl = a }) data PurgeQueueResponse = PurgeQueueResponse deriving (Eq, Ord, Read, Show, Generic) -- | 'PurgeQueueResponse' constructor. purgeQueueResponse :: PurgeQueueResponse purgeQueueResponse = PurgeQueueResponse instance ToPath PurgeQueue where toPath = const "/" instance ToQuery PurgeQueue where toQuery PurgeQueue{..} = mconcat [ "QueueUrl" =? _pqQueueUrl ] instance ToHeaders PurgeQueue instance AWSRequest PurgeQueue where type Sv PurgeQueue = SQS type Rs PurgeQueue = PurgeQueueResponse request = post "PurgeQueue" response = nullResponse PurgeQueueResponse
kim/amazonka
amazonka-sqs/gen/Network/AWS/SQS/PurgeQueue.hs
mpl-2.0
3,227
0
9
719
336
209
127
45
1
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} module Test.Mockery.Action ( Dummy (..) , dummy , dummy_ , Stub (..) , Mockable (..) ) where import Control.Monad.IO.Class import Control.Monad import Data.IORef import Data.List import Test.Hspec failure :: HasCallStack => String -> IO a failure err = expectationFailure err >> return undefined dummy :: HasCallStack => Dummy a => String -> a dummy = dummyNamed . Just dummy_ :: HasCallStack => Dummy a => a dummy_ = dummyNamed Nothing class Dummy a where dummyNamed :: HasCallStack => Maybe String -> a instance Dummy (IO r) where dummyNamed name = dummyNamed name () instance Dummy (a -> IO r) where dummyNamed name = dummyNamed name () instance Dummy (a -> b -> IO r) where dummyNamed name = dummyNamed name () instance Dummy (a -> b -> c -> IO r) where dummyNamed name = dummyNamed name () instance Dummy (a -> b -> c -> d -> IO r) where dummyNamed name = dummyNamed name () instance Dummy (a -> b -> c -> d -> e -> IO r) where dummyNamed name = dummyNamed name () instance Dummy (a -> b -> c -> d -> e -> f -> IO r) where dummyNamed name _ _ _ _ _ _ = do let err = "Unexpected call to dummy action" ++ maybe "!" (": " ++) name failure err class Stub a where type Action_ a stub :: HasCallStack => a -> Action_ a instance (MonadIO m, Eq a, Show a) => Stub (a, m r) where type Action_ (a, m r) = (a -> m r) stub option = stub [option] instance (MonadIO m, Eq a, Show a, Eq b, Show b) => Stub (a, b, m r) where type Action_ (a, b, m r) = (a -> b -> m r) stub option = stub [option] instance (MonadIO m, Eq a, Show a, Eq b, Show b, Eq c, Show c) => Stub (a, b, c, m r) where type Action_ (a, b, c, m r) = (a -> b -> c -> m r) stub option = stub [option] instance (MonadIO m, Eq a, Show a) => Stub [(a, m r)] where type Action_ [(a, m r)] = a -> m r stub expected actual = case lookup actual expected of Just r -> r _ -> unexpectedParameters False (map fst expected) actual instance (MonadIO m, Eq a, Show a, Eq b, Show b) => Stub [(a, b, m r)] where type Action_ [(a, b, m r)] = (a -> b -> m r) stub options a1 b1 = case lookup actual expected of Just r -> r _ -> unexpectedParameters True (map fst expected) actual where actual = (a1, b1) expected = map (\(a, b, r) -> ((a, b), r)) options instance (MonadIO m, Eq a, Show a, Eq b, Show b, Eq c, Show c) => Stub [(a, b, c, m r)] where type Action_ [(a, b, c, m r)] = (a -> b -> c -> m r) stub options a1 b1 c1 = case lookup actual expected of Just r -> r _ -> unexpectedParameters True (map fst expected) actual where actual = (a1, b1, c1) expected = map (\(a, b, c, r) -> ((a, b, c), r)) options unexpectedParameters :: HasCallStack => (MonadIO m, Show a) => Bool -> [a] -> a -> m r unexpectedParameters plural expected actual = do liftIO . failure . unlines $ [ message , expectedMessage , actualMessage ] where message | plural = "Unexected parameters to stubbed action!" | otherwise = "Unexected parameter to stubbed action!" expectedMessage = case expected of [x] -> "expected: " ++ show x _ -> "expected one of: " ++ (intercalate ", " $ map show expected) actualMessage = case expected of [_] -> " but got: " ++ show actual _ -> " but got: " ++ show actual class Mockable a where withMock :: HasCallStack => a -> (a -> IO x) -> IO x mockChain :: HasCallStack => [a] -> (a -> IO x) -> IO x instance Mockable (a -> IO r) where withMock action inner = withMock (\() -> action) $ inner . ($ ()) mockChain options inner = mockChain (map const options) $ inner . ($ ()) instance Mockable (a -> b -> IO r) where withMock action inner = withMock (\() -> action) $ inner . ($ ()) mockChain options inner = mockChain (map const options) $ inner . ($ ()) instance Mockable (a -> b -> c -> IO r) where withMock action inner = withMock (\() -> action) $ inner . ($ ()) mockChain options inner = mockChain (map const options) $ inner . ($ ()) instance Mockable (a -> b -> c -> d -> IO r) where withMock action inner = withMock (\() -> action) $ inner . ($ ()) mockChain options inner = mockChain (map const options) $ inner . ($ ()) instance Mockable (a -> b -> c -> d -> e -> IO r) where withMock action inner = withMock (\() -> action) $ inner . ($ ()) mockChain options inner = mockChain (map const options) $ inner . ($ ()) instance Mockable (a -> b -> c -> d -> e -> f -> IO r) where withMock action inner = do ref <- newIORef (0 :: Integer) let wrapped a b c d e f = action a b c d e f <* modifyIORef ref succ inner wrapped <* do n <- readIORef ref unless (n == 1) $ do failure ("Expected to be called once, but it was called " ++ show n ++ " times instead!") mockChain options inner = do let n = length options ref <- newIORef options let takeOption xs = case xs of y : ys -> (ys, Just y) [] -> ([], Nothing) wrapped a b c d e f = do option <- atomicModifyIORef ref takeOption case option of Just action -> action a b c d e f Nothing -> failure ("Expected to be called only " ++ pluralize n "time" ++ ", but it received an additional call!") inner wrapped <* do leftover <- readIORef ref case leftover of [] -> return () xs -> failure ("Expected to be called " ++ pluralize n "time" ++ ", but it was called " ++ pluralize (n - length xs) "time" ++ " instead!") pluralize :: Int -> String -> String pluralize 1 s = "1 " ++ s pluralize n s = show n ++ " " ++ s ++ "s"
haskell-tinc/tinc
test/Test/Mockery/Action.hs
bsd-3-clause
5,757
3
21
1,542
2,619
1,335
1,284
-1
-1
{-# OPTIONS_GHC -cpp -fglasgow-exts -fno-warn-orphans #-} -- | -- Module : Data.ByteString.Fusion -- License : BSD-style -- Maintainer : dons@cse.unsw.edu.au -- Stability : experimental -- Portability : portable -- -- Functional array fusion for ByteStrings. -- -- Originally based on code from the Data Parallel Haskell project, -- <http://www.cse.unsw.edu.au/~chak/project/dph> -- -- #hide module Data.ByteString.Fusion ( liquidCanaryFusion, -- * Fusion utilities loopU, loopL, fuseEFL, NoAcc(NoAcc), loopArr, loopAcc, loopSndAcc, unSP, mapEFL, filterEFL, foldEFL, foldEFL', scanEFL, mapAccumEFL, mapIndexEFL, -- ** Alternative Fusion stuff -- | This replaces 'loopU' with 'loopUp' -- and adds several further special cases of loops. loopUp, loopDown, loopNoAcc, loopMap, loopFilter, loopWrapper, loopWrapperLE, sequenceLoops, doUpLoop, doDownLoop, doNoAccLoop, doMapLoop, doFilterLoop, -- | These are the special fusion cases for combining each loop form perfectly. fuseAccAccEFL, fuseAccNoAccEFL, fuseNoAccAccEFL, fuseNoAccNoAccEFL, fuseMapAccEFL, fuseAccMapEFL, fuseMapNoAccEFL, fuseNoAccMapEFL, fuseMapMapEFL, fuseAccFilterEFL, fuseFilterAccEFL, fuseNoAccFilterEFL, fuseFilterNoAccEFL, fuseFilterFilterEFL, fuseMapFilterEFL, fuseFilterMapEFL, -- * Strict pairs and sums PairS(..), MaybeS(..) ) where import Data.ByteString.Internal import qualified Data.ByteString.Lazy.Internal as L import Foreign.ForeignPtr import Foreign.Ptr import Foreign.Storable (Storable(..)) import Data.Word (Word8) import System.IO.Unsafe (unsafePerformIO) -- LIQUID import Language.Haskell.Liquid.Prelude (liquidAssume, liquidAssert) {-@ qualif PlusOnePos(v: int): 0 <= (v + 1) @-} {-@ qualif LePlusOne(v: int, x: int): v <= (x + 1) @-} {-@ qualif LeDiff(v: a, x: a, y:a): v <= (x - y) @-} {-@ qualif PlenEq(v: Ptr a, x: int): x <= (plen v) @-} {-@ qualif BlenEq(v: int, x:ByteString): v = (bLength x) @-} {-@ qualif PSnd(v: a, x:b): v = (psnd x) @-} {-@ data PairS a b <p :: x0:a -> b -> Prop> = (:*:) (x::a) (y::b<p x>) @-} {-@ measure pfst :: (PairS a b) -> a pfst ((:*:) x y) = x @-} {-@ measure psnd :: (PairS a b) -> b psnd ((:*:) x y) = y @-} {-@ measure isJustS :: (MaybeS a) -> Prop isJustS (JustS x) = true isJustS (NothingS) = false @-} {-@ qualif PlusOne(v:a, x:a): v = x + 1 @-} {-@ type MaybeSJ a = {v: MaybeS a | (isJustS v)} @-} {-@ type AccEFLJ acc = acc -> Word8 -> (PairS acc (MaybeSJ Word8)) @-} {-@ type NoAccEFLJ = Word8 -> (MaybeSJ Word8) @-} {- liquidCanaryFusion :: x:Int -> {v: Int | v > x} @-} liquidCanaryFusion :: Int -> Int liquidCanaryFusion x = x - 1 -- ----------------------------------------------------------------------------- -- -- Useful macros, until we have bang patterns -- #define STRICT1(f) f a | a `seq` False = undefined #define STRICT2(f) f a b | a `seq` b `seq` False = undefined #define STRICT3(f) f a b c | a `seq` b `seq` c `seq` False = undefined #define STRICT4(f) f a b c d | a `seq` b `seq` c `seq` d `seq` False = undefined #define STRICT5(f) f a b c d e | a `seq` b `seq` c `seq` d `seq` e `seq` False = undefined infixl 2 :*: -- |Strict pair data PairS a b = !a :*: !b deriving (Eq,Ord,Show) -- |Strict Maybe data MaybeS a = NothingS | JustS !a deriving (Eq,Ord,Show) -- |Data type for accumulators which can be ignored. The rewrite rules rely on -- the fact that no bottoms of this type are ever constructed; hence, we can -- assume @(_ :: NoAcc) `seq` x = x@. -- data NoAcc = NoAcc -- |Type of loop functions type AccEFL acc = acc -> Word8 -> (PairS acc (MaybeS Word8)) type NoAccEFL = Word8 -> MaybeS Word8 type MapEFL = Word8 -> Word8 type FilterEFL = Word8 -> Bool infixr 9 `fuseEFL` -- |Fuse to flat loop functions fuseEFL :: AccEFL acc1 -> AccEFL acc2 -> AccEFL (PairS acc1 acc2) fuseEFL f g (acc1 :*: acc2) e1 = case f acc1 e1 of acc1' :*: NothingS -> (acc1' :*: acc2) :*: NothingS acc1' :*: JustS e2 -> case g acc2 e2 of acc2' :*: res -> (acc1' :*: acc2') :*: res #if defined(__GLASGOW_HASKELL__) {-# INLINE [1] fuseEFL #-} #endif -- | Special forms of loop arguments -- -- * These are common special cases for the three function arguments of gen -- and loop; we give them special names to make it easier to trigger RULES -- applying in the special cases represented by these arguments. The -- "INLINE [1]" makes sure that these functions are only inlined in the last -- two simplifier phases. -- -- * In the case where the accumulator is not needed, it is better to always -- explicitly return a value `()', rather than just copy the input to the -- output, as the former gives GHC better local information. -- -- | Element function expressing a mapping only #if !defined(LOOPNOACC_FUSION) mapEFL :: (Word8 -> Word8) -> AccEFL NoAcc mapEFL f = \_ e -> (NoAcc :*: (JustS $ f e)) #else mapEFL :: (Word8 -> Word8) -> NoAccEFL mapEFL f = \e -> JustS (f e) #endif #if defined(__GLASGOW_HASKELL__) {-# INLINE [1] mapEFL #-} #endif -- | Element function implementing a filter function only #if !defined(LOOPNOACC_FUSION) filterEFL :: (Word8 -> Bool) -> AccEFL NoAcc filterEFL p = \_ e -> if p e then (NoAcc :*: JustS e) else (NoAcc :*: NothingS) #else filterEFL :: (Word8 -> Bool) -> NoAccEFL filterEFL p = \e -> if p e then JustS e else NothingS #endif #if defined(__GLASGOW_HASKELL__) {-# INLINE [1] filterEFL #-} #endif -- |Element function expressing a reduction only foldEFL :: (acc -> Word8 -> acc) -> AccEFL acc foldEFL f = \a e -> (f a e :*: NothingS) #if defined(__GLASGOW_HASKELL__) {-# INLINE [1] foldEFL #-} #endif -- | A strict foldEFL. foldEFL' :: (acc -> Word8 -> acc) -> AccEFL acc foldEFL' f = \a e -> let a' = f a e in a' `seq` (a' :*: NothingS) #if defined(__GLASGOW_HASKELL__) {-# INLINE [1] foldEFL' #-} #endif -- | Element function expressing a prefix reduction only -- {-@ scanEFL :: (Word8 -> Word8 -> Word8) -> AccEFLJ Word8 @-} scanEFL :: (Word8 -> Word8 -> Word8) -> AccEFL Word8 scanEFL f = \a e -> (f a e :*: JustS a) #if defined(__GLASGOW_HASKELL__) {-# INLINE [1] scanEFL #-} #endif -- | Element function implementing a map and fold -- {-@ mapAccumEFL :: (acc -> Word8 -> (acc, Word8)) -> AccEFLJ acc @-} mapAccumEFL :: (acc -> Word8 -> (acc, Word8)) -> AccEFL acc mapAccumEFL f = \a e -> case f a e of (a', e') -> (a' :*: JustS e') #if defined(__GLASGOW_HASKELL__) {-# INLINE [1] mapAccumEFL #-} #endif -- | Element function implementing a map with index -- {-@ mapIndexEFL :: (Int -> Word8 -> Word8) -> AccEFLJ Int @-} mapIndexEFL :: (Int -> Word8 -> Word8) -> AccEFL Int mapIndexEFL f = \i e -> let i' = i+1 in i' `seq` (i' :*: JustS (f i e)) #if defined(__GLASGOW_HASKELL__) {-# INLINE [1] mapIndexEFL #-} #endif -- | Projection functions that are fusion friendly (as in, we determine when -- they are inlined) {-@ loopArr :: p:(PairS acc arr) -> {v:arr | v = (psnd p)} @-} loopArr :: (PairS acc arr) -> arr loopArr (_ :*: arr) = arr #if defined(__GLASGOW_HASKELL__) {-# INLINE [1] loopArr #-} #endif {-@ loopAcc :: p:(PairS acc arr) -> {v:acc | v = (pfst p)} @-} loopAcc :: (PairS acc arr) -> acc loopAcc (acc :*: _) = acc #if defined(__GLASGOW_HASKELL__) {-# INLINE [1] loopAcc #-} #endif loopSndAcc :: (PairS (PairS acc1 acc2) arr) -> (PairS acc2 arr) loopSndAcc ((_ :*: acc) :*: arr) = (acc :*: arr) #if defined(__GLASGOW_HASKELL__) {-# INLINE [1] loopSndAcc #-} #endif {-@ unSP :: p:(PairS acc arr) -> ({v:acc | v = (pfst p)}, {v:arr | v = (psnd p)}) @-} unSP :: (PairS acc arr) -> (acc, arr) unSP (acc :*: arr) = (acc, arr) #if defined(__GLASGOW_HASKELL__) {-# INLINE [1] unSP #-} #endif ------------------------------------------------------------------------ -- -- Loop combinator and fusion rules for flat arrays -- |Iteration over over ByteStrings -- | Iteration over over ByteStrings loopU :: AccEFL acc -- ^ mapping & folding, once per elem -> acc -- ^ initial acc value -> ByteString -- ^ input ByteString -> (PairS acc ByteString) {-@ loopU :: AccEFLJ acc -> acc -> b:ByteString -> (PairS acc (ByteStringSZ b)) @-} loopU f start (PS z s i) = unsafePerformIO $ withForeignPtr z $ \a -> do (ps, acc) <- createAndTrimEQ i $ \p -> do (acc' :*: i') <- go (a `plusPtr` s) p start return (0 :: Int, i', acc') return (acc :*: ps) where go p ma = trans i 0 0 where STRICT4(trans) {- LIQUID WITNESS -} trans (d :: Int) a_off ma_off acc | a_off >= i = return (acc :*: ma_off) | otherwise = do x <- peekByteOff p a_off let (acc' :*: oe) = f acc x ma_off' <- case oe of NothingS -> return ma_off JustS e -> do pokeByteOff ma ma_off e return $ ma_off + 1 trans (d-1) (a_off+1) ma_off' acc' -- a_off = i - d {-@ qualif Decr(v:Int, x: Int, y:Int): v = x - y @-} #if defined(__GLASGOW_HASKELL__) {-# INLINE [1] loopU #-} #endif {- RULES "FPS loop/loop fusion!" forall em1 em2 start1 start2 arr. loopU em2 start2 (loopArr (loopU em1 start1 arr)) = loopSndAcc (loopU (em1 `fuseEFL` em2) (start1 :*: start2) arr) #-} -- Functional list/array fusion for lazy ByteStrings. -- {-@ loopL :: (AccEFLJ acc) -> acc -> b:L.ByteString -> (PairS acc (LByteStringSZ b)) @-} loopL :: AccEFL acc -- ^ mapping & folding, once per elem -> acc -- ^ initial acc value -> L.ByteString -- ^ input ByteString -> PairS acc L.ByteString loopL f = loop where loop s L.Empty = (s :*: L.Empty) loop s (L.Chunk x xs) | l == 0 = (s'' :*: ys) | otherwise = (s'' :*: L.Chunk y ys) where (s' :*: y@(PS _ _ l)) = loopU f s x -- avoid circular dep on S.null (s'' :*: ys) = loop s' xs #if defined(__GLASGOW_HASKELL__) {-# INLINE [1] loopL #-} #endif {- RULES "FPS lazy loop/loop fusion!" forall em1 em2 start1 start2 arr. loopL em2 start2 (loopArr (loopL em1 start1 arr)) = loopSndAcc (loopL (em1 `fuseEFL` em2) (start1 :*: start2) arr) #-} {- Alternate experimental formulation of loopU which partitions it into an allocating wrapper and an imperitive array-mutating loop. The point in doing this split is that we might be able to fuse multiple loops into a single wrapper. This would save reallocating another buffer. It should also give better cache locality by reusing the buffer. Note that this stuff needs ghc-6.5 from May 26 or later for the RULES to really work reliably. -} {-@ loopUp :: AccEFLJ acc -> acc -> b:ByteString -> (PairS acc (ByteStringSZ b)) @-} loopUp :: AccEFL acc -> acc -> ByteString -> PairS acc ByteString loopUp f a arr = loopWrapper (doUpLoop f a) arr {-# INLINE loopUp #-} {-@ loopDown :: AccEFLJ acc -> acc -> b:ByteString -> (PairS acc (ByteStringSZ b)) @-} loopDown :: AccEFL acc -> acc -> ByteString -> PairS acc ByteString loopDown f a arr = loopWrapper (doDownLoop f a) arr {-# INLINE loopDown #-} {-@ loopNoAcc :: NoAccEFLJ -> b:ByteString -> (PairS NoAcc (ByteStringSZ b)) @-} loopNoAcc :: NoAccEFL -> ByteString -> PairS NoAcc ByteString loopNoAcc f arr = loopWrapper (doNoAccLoop f NoAcc) arr {-# INLINE loopNoAcc #-} {-@ loopMap :: MapEFL -> b:ByteString -> (PairS NoAcc (ByteStringSZ b)) @-} loopMap :: MapEFL -> ByteString -> PairS NoAcc ByteString loopMap f arr = loopWrapper (doMapLoop f NoAcc) arr {-# INLINE loopMap #-} {-@ loopFilter :: FilterEFL -> b:ByteString -> (PairS NoAcc (ByteStringLE b)) @-} loopFilter :: FilterEFL -> ByteString -> PairS NoAcc ByteString loopFilter f arr = loopWrapperLE (doFilterLoop f NoAcc) arr {-# INLINE loopFilter #-} -- The type of imperitive loops that fill in a destination array by -- reading a source array. They may not fill in the whole of the dest -- array if the loop is behaving as a filter, this is why we return -- the length that was filled in. The loop may also accumulate some -- value as it loops over the source array. {-@ type TripleSLE a N = PairS <{\z v -> v <= (N - (psnd z))}> (PairS <{\x y -> true}> a Nat) {v:Nat | v <= N} @-} {-@ type TripleS a N = PairS <{\z v -> v <= (N - (psnd z))}> (PairS <{\x y -> true}> a Nat) {v:Nat | v = N} @-} {-@ type ImperativeLoopLE acc = s:(PtrV Word8) -> d:(PtrV Word8) -> n:{v: Nat | ((v <= (plen d)) && (v <= (plen s))) } -> IO (TripleSLE acc n) @-} {-@ type ImperativeLoop acc = s:(PtrV Word8) -> d:(PtrV Word8) -> n:{v: Nat | ((v <= (plen d)) && (v <= (plen s))) } -> IO (TripleS acc n) @-} type ImperativeLoop acc = Ptr Word8 -- pointer to the start of the source byte array -> Ptr Word8 -- pointer to ther start of the destination byte array -> Int -- length of the source byte array -> IO (PairS (PairS acc Int) Int) -- result and offset, length of dest that was filled {-@ loopWrapperLE :: ImperativeLoopLE acc -> b:ByteString -> PairS acc (ByteStringLE b) @-} loopWrapperLE :: ImperativeLoop acc -> ByteString -> PairS acc ByteString loopWrapperLE body (PS srcFPtr srcOffset srcLen) = unsafePerformIO $ withForeignPtr srcFPtr $ \srcPtr -> do (ps, acc) <- createAndTrim' srcLen $ \destPtr -> do (acc :*: destOffset :*: destLen) <- body (srcPtr `plusPtr` srcOffset) destPtr srcLen return $ (destOffset, destLen, acc) return (acc :*: ps) -- LIQUID DUPLICATECODE {-@ loopWrapper :: ImperativeLoop acc -> b:ByteString -> PairS acc (ByteStringSZ b) @-} loopWrapper :: ImperativeLoop acc -> ByteString -> PairS acc ByteString loopWrapper body (PS srcFPtr srcOffset srcLen) = unsafePerformIO $ withForeignPtr srcFPtr $ \srcPtr -> do (ps, acc) <- createAndTrimEQ srcLen $ \destPtr -> do (acc :*: destOffset :*: destLen) <- body (srcPtr `plusPtr` srcOffset) destPtr srcLen return $ (destOffset, id destLen, acc) return (acc :*: ps) {-@ doUpLoop :: AccEFLJ acc -> acc -> ImperativeLoop acc @-} doUpLoop :: AccEFL acc -> acc -> ImperativeLoop acc doUpLoop f acc0 src dest len = loop len 0 0 acc0 {-@ Decrease loop 1 @-} -- LIQUID TRANSFORMATION where STRICT4(loop) {- LIQUID WITNESS -} loop (d :: Int) src_off dest_off acc | src_off >= len = return (acc :*: (0 :: Int) {- LIQUID CAST -} :*: dest_off) | otherwise = do x <- peekByteOff src src_off case f acc x of (acc' :*: NothingS) -> loop (d-1) (src_off+1) dest_off acc' (acc' :*: JustS x') -> pokeByteOff dest dest_off x' >> loop (d-1) (src_off+1) (dest_off+1) acc' {-@ doDownLoop :: AccEFLJ acc -> acc -> ImperativeLoop acc @-} doDownLoop :: AccEFL acc -> acc -> ImperativeLoop acc doDownLoop f acc0 src dest len = loop len (len-1) (len-1) acc0 {-@ Decrease loop 1 @-} -- LIQUID TRANSFORMATION where STRICT4(loop) {- LIQUID WITNESS -} loop (d :: Int) src_offDOWN dest_offDOWN acc | src_offDOWN < 0 = return (acc :*: dest_offDOWN + 1 :*: len - (dest_offDOWN + 1)) | otherwise = do x <- peekByteOff src src_offDOWN case f acc x of (acc' :*: NothingS) -> loop (d-1) (src_offDOWN - 1) dest_offDOWN acc' (acc' :*: JustS x') -> pokeByteOff dest dest_offDOWN x' >> loop (d-1) (src_offDOWN - 1) (dest_offDOWN - 1) acc' {-@ doNoAccLoop :: NoAccEFLJ -> noAcc -> ImperativeLoop noAcc @-} doNoAccLoop :: NoAccEFL -> noAcc -> ImperativeLoop noAcc doNoAccLoop f noAcc src dest len = loop len 0 0 {-@ Decrease loop 1 @-} -- LIQUID TRANSFORMATION where STRICT3(loop) {- LIQUID WITNESS -} loop (d :: Int) src_off dest_off | src_off >= len = return (noAcc :*: (0 :: Int) {- LIQUID CAST -} :*: dest_off) | otherwise = do x <- peekByteOff src src_off case f x of NothingS -> loop (d-1) (src_off+1) dest_off JustS x' -> pokeByteOff dest dest_off x' >> loop (d-1) (src_off+1) (dest_off+1) {-@ doMapLoop :: MapEFL -> noAcc -> ImperativeLoop noAcc @-} doMapLoop :: MapEFL -> noAcc -> ImperativeLoop noAcc doMapLoop f noAcc src dest len = loop len 0 {-@ Decrease loop 1 @-} -- LIQUID TRANSFORMATION where STRICT2(loop) {- LIQUID WITNESS -} loop (d :: Int) n | n >= len = return (noAcc :*: (0 :: Int) {- LIQUID CAST -} :*: len) | otherwise = do x <- peekByteOff src n pokeByteOff dest n (f x) loop (d-1) (n+1) -- offset always the same, only pass 1 arg {-@ doFilterLoop :: FilterEFL -> noAcc -> ImperativeLoopLE noAcc @-} doFilterLoop :: FilterEFL -> noAcc -> ImperativeLoop noAcc doFilterLoop f noAcc src dest len = loop len 0 0 {-@ Decrease loop 1 @-} -- LIQUID TRANSFORMATION where STRICT3(loop) {- LIQUID WITNESS -} loop (d :: Int) src_off dest_off | src_off >= len = return (noAcc :*: (0 :: Int) {- LIQUID CAST -} :*: dest_off) | otherwise = do x <- peekByteOff src src_off if f x then pokeByteOff dest dest_off x >> loop (d-1) (src_off+1) (dest_off+1) else loop (d-1) (src_off+1) dest_off -- LIQUID -- run two loops in sequence, -- think of it as: loop1 >> loop2 {-@ sequenceLoops :: ImperativeLoop acc1 -> ImperativeLoop acc2 -> ImperativeLoop (PairS acc1 acc2) @-} sequenceLoops :: ImperativeLoop acc1 -> ImperativeLoop acc2 -> ImperativeLoop (PairS acc1 acc2) sequenceLoops loop1 loop2 src dest len0 = do (acc1 :*: off1 :*: len1) <- loop1 src dest len0 (acc2 :*: off2 :*: len2) <- let src' = dest `plusPtr` off1 dest' = src' -- note that we are using dest == src -- for the second loop as we are -- mutating the dest array in-place! in loop2 src' dest' len1 return ((acc1 :*: acc2) :*: off1 + off2 :*: len2) -- TODO: prove that this is associative! (I think it is) -- since we can't be sure how the RULES will combine loops. #if defined(__GLASGOW_HASKELL__) {-# INLINE [1] doUpLoop #-} {-# INLINE [1] doDownLoop #-} {-# INLINE [1] doNoAccLoop #-} {-# INLINE [1] doMapLoop #-} {-# INLINE [1] doFilterLoop #-} {-# INLINE [1] loopWrapper #-} {-# INLINE [1] sequenceLoops #-} {-# INLINE [1] fuseAccAccEFL #-} {-# INLINE [1] fuseAccNoAccEFL #-} {-# INLINE [1] fuseNoAccAccEFL #-} {-# INLINE [1] fuseNoAccNoAccEFL #-} {-# INLINE [1] fuseMapAccEFL #-} {-# INLINE [1] fuseAccMapEFL #-} {-# INLINE [1] fuseMapNoAccEFL #-} {-# INLINE [1] fuseNoAccMapEFL #-} {-# INLINE [1] fuseMapMapEFL #-} {-# INLINE [1] fuseAccFilterEFL #-} {-# INLINE [1] fuseFilterAccEFL #-} {-# INLINE [1] fuseNoAccFilterEFL #-} {-# INLINE [1] fuseFilterNoAccEFL #-} {-# INLINE [1] fuseFilterFilterEFL #-} {-# INLINE [1] fuseMapFilterEFL #-} {-# INLINE [1] fuseFilterMapEFL #-} #endif {- RULES "FPS loopArr/loopSndAcc" forall x. loopArr (loopSndAcc x) = loopArr x "FPS seq/NoAcc" forall (u::NoAcc) e. u `seq` e = e "FPS loop/loop wrapper elimination" forall loop1 loop2 arr. loopWrapper loop2 (loopArr (loopWrapper loop1 arr)) = loopSndAcc (loopWrapper (sequenceLoops loop1 loop2) arr) -- -- n.b in the following, when reading n/m fusion, recall sequenceLoops -- is monadic, so its really n >> m fusion (i.e. m.n), not n . m fusion. -- "FPS up/up loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doUpLoop f1 acc1) (doUpLoop f2 acc2) = doUpLoop (f1 `fuseAccAccEFL` f2) (acc1 :*: acc2) "FPS map/map loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doMapLoop f1 acc1) (doMapLoop f2 acc2) = doMapLoop (f1 `fuseMapMapEFL` f2) (acc1 :*: acc2) "FPS filter/filter loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doFilterLoop f1 acc1) (doFilterLoop f2 acc2) = doFilterLoop (f1 `fuseFilterFilterEFL` f2) (acc1 :*: acc2) "FPS map/filter loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doMapLoop f1 acc1) (doFilterLoop f2 acc2) = doNoAccLoop (f1 `fuseMapFilterEFL` f2) (acc1 :*: acc2) "FPS filter/map loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doFilterLoop f1 acc1) (doMapLoop f2 acc2) = doNoAccLoop (f1 `fuseFilterMapEFL` f2) (acc1 :*: acc2) "FPS map/up loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doMapLoop f1 acc1) (doUpLoop f2 acc2) = doUpLoop (f1 `fuseMapAccEFL` f2) (acc1 :*: acc2) "FPS up/map loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doUpLoop f1 acc1) (doMapLoop f2 acc2) = doUpLoop (f1 `fuseAccMapEFL` f2) (acc1 :*: acc2) "FPS filter/up loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doFilterLoop f1 acc1) (doUpLoop f2 acc2) = doUpLoop (f1 `fuseFilterAccEFL` f2) (acc1 :*: acc2) "FPS up/filter loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doUpLoop f1 acc1) (doFilterLoop f2 acc2) = doUpLoop (f1 `fuseAccFilterEFL` f2) (acc1 :*: acc2) "FPS down/down loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doDownLoop f1 acc1) (doDownLoop f2 acc2) = doDownLoop (f1 `fuseAccAccEFL` f2) (acc1 :*: acc2) "FPS map/down fusion" forall f1 f2 acc1 acc2. sequenceLoops (doMapLoop f1 acc1) (doDownLoop f2 acc2) = doDownLoop (f1 `fuseMapAccEFL` f2) (acc1 :*: acc2) "FPS down/map loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doDownLoop f1 acc1) (doMapLoop f2 acc2) = doDownLoop (f1 `fuseAccMapEFL` f2) (acc1 :*: acc2) "FPS filter/down fusion" forall f1 f2 acc1 acc2. sequenceLoops (doFilterLoop f1 acc1) (doDownLoop f2 acc2) = doDownLoop (f1 `fuseFilterAccEFL` f2) (acc1 :*: acc2) "FPS down/filter loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doDownLoop f1 acc1) (doFilterLoop f2 acc2) = doDownLoop (f1 `fuseAccFilterEFL` f2) (acc1 :*: acc2) "FPS noAcc/noAcc loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doNoAccLoop f1 acc1) (doNoAccLoop f2 acc2) = doNoAccLoop (f1 `fuseNoAccNoAccEFL` f2) (acc1 :*: acc2) "FPS noAcc/up loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doNoAccLoop f1 acc1) (doUpLoop f2 acc2) = doUpLoop (f1 `fuseNoAccAccEFL` f2) (acc1 :*: acc2) "FPS up/noAcc loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doUpLoop f1 acc1) (doNoAccLoop f2 acc2) = doUpLoop (f1 `fuseAccNoAccEFL` f2) (acc1 :*: acc2) "FPS map/noAcc loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doMapLoop f1 acc1) (doNoAccLoop f2 acc2) = doNoAccLoop (f1 `fuseMapNoAccEFL` f2) (acc1 :*: acc2) "FPS noAcc/map loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doNoAccLoop f1 acc1) (doMapLoop f2 acc2) = doNoAccLoop (f1 `fuseNoAccMapEFL` f2) (acc1 :*: acc2) "FPS filter/noAcc loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doFilterLoop f1 acc1) (doNoAccLoop f2 acc2) = doNoAccLoop (f1 `fuseFilterNoAccEFL` f2) (acc1 :*: acc2) "FPS noAcc/filter loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doNoAccLoop f1 acc1) (doFilterLoop f2 acc2) = doNoAccLoop (f1 `fuseNoAccFilterEFL` f2) (acc1 :*: acc2) "FPS noAcc/down loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doNoAccLoop f1 acc1) (doDownLoop f2 acc2) = doDownLoop (f1 `fuseNoAccAccEFL` f2) (acc1 :*: acc2) "FPS down/noAcc loop fusion" forall f1 f2 acc1 acc2. sequenceLoops (doDownLoop f1 acc1) (doNoAccLoop f2 acc2) = doDownLoop (f1 `fuseAccNoAccEFL` f2) (acc1 :*: acc2) #-} {- up = up loop down = down loop map = map special case filter = filter special case noAcc = noAcc undirectional loop (unused) heirarchy: up down ^ ^ \ / noAcc ^ ^ / \ map filter each is a special case of the things above so we get rules that combine things on the same level and rules that combine things on different levels to get something on the higher level so all the cases: up/up --> up fuseAccAccEFL down/down --> down fuseAccAccEFL noAcc/noAcc --> noAcc fuseNoAccNoAccEFL noAcc/up --> up fuseNoAccAccEFL up/noAcc --> up fuseAccNoAccEFL noAcc/down --> down fuseNoAccAccEFL down/noAcc --> down fuseAccNoAccEFL and if we do the map, filter special cases then it adds a load more: map/map --> map fuseMapMapEFL filter/filter --> filter fuseFilterFilterEFL map/filter --> noAcc fuseMapFilterEFL filter/map --> noAcc fuseFilterMapEFL map/noAcc --> noAcc fuseMapNoAccEFL noAcc/map --> noAcc fuseNoAccMapEFL map/up --> up fuseMapAccEFL up/map --> up fuseAccMapEFL map/down --> down fuseMapAccEFL down/map --> down fuseAccMapEFL filter/noAcc --> noAcc fuseNoAccFilterEFL noAcc/filter --> noAcc fuseFilterNoAccEFL filter/up --> up fuseFilterAccEFL up/filter --> up fuseAccFilterEFL filter/down --> down fuseFilterAccEFL down/filter --> down fuseAccFilterEFL -} fuseAccAccEFL :: AccEFL acc1 -> AccEFL acc2 -> AccEFL (PairS acc1 acc2) fuseAccAccEFL f g (acc1 :*: acc2) e1 = case f acc1 e1 of acc1' :*: NothingS -> (acc1' :*: acc2) :*: NothingS acc1' :*: JustS e2 -> case g acc2 e2 of acc2' :*: res -> (acc1' :*: acc2') :*: res fuseAccNoAccEFL :: AccEFL acc -> NoAccEFL -> AccEFL (PairS acc noAcc) fuseAccNoAccEFL f g (acc :*: noAcc) e1 = case f acc e1 of acc' :*: NothingS -> (acc' :*: noAcc) :*: NothingS acc' :*: JustS e2 -> (acc' :*: noAcc) :*: g e2 fuseNoAccAccEFL :: NoAccEFL -> AccEFL acc -> AccEFL (PairS noAcc acc) fuseNoAccAccEFL f g (noAcc :*: acc) e1 = case f e1 of NothingS -> (noAcc :*: acc) :*: NothingS JustS e2 -> case g acc e2 of acc' :*: res -> (noAcc :*: acc') :*: res fuseNoAccNoAccEFL :: NoAccEFL -> NoAccEFL -> NoAccEFL fuseNoAccNoAccEFL f g e1 = case f e1 of NothingS -> NothingS JustS e2 -> g e2 fuseMapAccEFL :: MapEFL -> AccEFL acc -> AccEFL (PairS noAcc acc) fuseMapAccEFL f g (noAcc :*: acc) e1 = case g acc (f e1) of (acc' :*: res) -> (noAcc :*: acc') :*: res fuseAccMapEFL :: AccEFL acc -> MapEFL -> AccEFL (PairS acc noAcc) fuseAccMapEFL f g (acc :*: noAcc) e1 = case f acc e1 of (acc' :*: NothingS) -> (acc' :*: noAcc) :*: NothingS (acc' :*: JustS e2) -> (acc' :*: noAcc) :*: JustS (g e2) fuseMapMapEFL :: MapEFL -> MapEFL -> MapEFL fuseMapMapEFL f g e1 = g (f e1) -- n.b. perfect fusion fuseMapNoAccEFL :: MapEFL -> NoAccEFL -> NoAccEFL fuseMapNoAccEFL f g e1 = g (f e1) fuseNoAccMapEFL :: NoAccEFL -> MapEFL -> NoAccEFL fuseNoAccMapEFL f g e1 = case f e1 of NothingS -> NothingS JustS e2 -> JustS (g e2) fuseAccFilterEFL :: AccEFL acc -> FilterEFL -> AccEFL (PairS acc noAcc) fuseAccFilterEFL f g (acc :*: noAcc) e1 = case f acc e1 of acc' :*: NothingS -> (acc' :*: noAcc) :*: NothingS acc' :*: JustS e2 -> case g e2 of False -> (acc' :*: noAcc) :*: NothingS True -> (acc' :*: noAcc) :*: JustS e2 fuseFilterAccEFL :: FilterEFL -> AccEFL acc -> AccEFL (PairS noAcc acc) fuseFilterAccEFL f g (noAcc :*: acc) e1 = case f e1 of False -> (noAcc :*: acc) :*: NothingS True -> case g acc e1 of acc' :*: res -> (noAcc :*: acc') :*: res fuseNoAccFilterEFL :: NoAccEFL -> FilterEFL -> NoAccEFL fuseNoAccFilterEFL f g e1 = case f e1 of NothingS -> NothingS JustS e2 -> case g e2 of False -> NothingS True -> JustS e2 fuseFilterNoAccEFL :: FilterEFL -> NoAccEFL -> NoAccEFL fuseFilterNoAccEFL f g e1 = case f e1 of False -> NothingS True -> g e1 fuseFilterFilterEFL :: FilterEFL -> FilterEFL -> FilterEFL fuseFilterFilterEFL f g e1 = f e1 && g e1 fuseMapFilterEFL :: MapEFL -> FilterEFL -> NoAccEFL fuseMapFilterEFL f g e1 = case f e1 of e2 -> case g e2 of False -> NothingS True -> JustS e2 fuseFilterMapEFL :: FilterEFL -> MapEFL -> NoAccEFL fuseFilterMapEFL f g e1 = case f e1 of False -> NothingS True -> JustS (g e1)
mightymoose/liquidhaskell
benchmarks/bytestring-0.9.2.1/Data/ByteString/Fusion.T.hs
bsd-3-clause
28,869
0
19
7,478
4,848
2,589
2,259
-1
-1
{-# OPTIONS -cpp -fglasgow-exts #-} -- The record update triggered a kind error in GHC 6.2 module Foo where data HT (ref :: * -> *) = HT { kcount :: Int } set_kcount :: Int -> HT s -> HT s set_kcount kc ht = ht{kcount=kc}
hvr/jhc
regress/tests/1_typecheck/2_pass/ghc/uncat/tc190.hs
mit
239
0
8
64
69
40
29
-1
-1
module Main where import API (network, simulation, configuration, matlabExtras, constructable) import qualified Matlab (generate) import qualified Latex (generate) -- import qualified Haskell (generate) import qualified Python (generate) main = do -- Latex.generate True api "tmp/fnref.tex" -- Latex.generate False api "../../doc/latex/fnref.tex" Matlab.generate (api ++ [matlabExtras]) constructable -- Haskell.generate api Python.generate api constructable where api = [network, configuration, simulation]
nico202/NeMosim
src/api/autogen/Main.hs
gpl-2.0
542
0
10
91
106
65
41
9
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} module Hoopl.Block ( C , O , MaybeO(..) , IndexedCO , Block(..) , blockAppend , blockCons , blockFromList , blockJoin , blockJoinHead , blockJoinTail , blockSnoc , blockSplit , blockSplitHead , blockSplitTail , blockToList , emptyBlock , firstNode , foldBlockNodesB , foldBlockNodesB3 , foldBlockNodesF , isEmptyBlock , lastNode , mapBlock , mapBlock' , mapBlock3' , replaceFirstNode , replaceLastNode ) where import GhcPrelude -- ----------------------------------------------------------------------------- -- Shapes: Open and Closed -- | Used at the type level to indicate an "open" structure with -- a unique, unnamed control-flow edge flowing in or out. -- "Fallthrough" and concatenation are permitted at an open point. data O -- | Used at the type level to indicate a "closed" structure which -- supports control transfer only through the use of named -- labels---no "fallthrough" is permitted. The number of control-flow -- edges is unconstrained. data C -- | Either type indexed by closed/open using type families type family IndexedCO ex a b :: * type instance IndexedCO C a _b = a type instance IndexedCO O _a b = b -- | Maybe type indexed by open/closed data MaybeO ex t where JustO :: t -> MaybeO O t NothingO :: MaybeO C t -- | Maybe type indexed by closed/open data MaybeC ex t where JustC :: t -> MaybeC C t NothingC :: MaybeC O t instance Functor (MaybeO ex) where fmap _ NothingO = NothingO fmap f (JustO a) = JustO (f a) instance Functor (MaybeC ex) where fmap _ NothingC = NothingC fmap f (JustC a) = JustC (f a) -- ----------------------------------------------------------------------------- -- The Block type -- | A sequence of nodes. May be any of four shapes (O/O, O/C, C/O, C/C). -- Open at the entry means single entry, mutatis mutandis for exit. -- A closed/closed block is a /basic/ block and can't be extended further. -- Clients should avoid manipulating blocks and should stick to either nodes -- or graphs. data Block n e x where BlockCO :: n C O -> Block n O O -> Block n C O BlockCC :: n C O -> Block n O O -> n O C -> Block n C C BlockOC :: Block n O O -> n O C -> Block n O C BNil :: Block n O O BMiddle :: n O O -> Block n O O BCat :: Block n O O -> Block n O O -> Block n O O BSnoc :: Block n O O -> n O O -> Block n O O BCons :: n O O -> Block n O O -> Block n O O -- ----------------------------------------------------------------------------- -- Simple operations on Blocks -- Predicates isEmptyBlock :: Block n e x -> Bool isEmptyBlock BNil = True isEmptyBlock (BCat l r) = isEmptyBlock l && isEmptyBlock r isEmptyBlock _ = False -- Building emptyBlock :: Block n O O emptyBlock = BNil blockCons :: n O O -> Block n O x -> Block n O x blockCons n b = case b of BlockOC b l -> (BlockOC $! (n `blockCons` b)) l BNil{} -> BMiddle n BMiddle{} -> n `BCons` b BCat{} -> n `BCons` b BSnoc{} -> n `BCons` b BCons{} -> n `BCons` b blockSnoc :: Block n e O -> n O O -> Block n e O blockSnoc b n = case b of BlockCO f b -> BlockCO f $! (b `blockSnoc` n) BNil{} -> BMiddle n BMiddle{} -> b `BSnoc` n BCat{} -> b `BSnoc` n BSnoc{} -> b `BSnoc` n BCons{} -> b `BSnoc` n blockJoinHead :: n C O -> Block n O x -> Block n C x blockJoinHead f (BlockOC b l) = BlockCC f b l blockJoinHead f b = BlockCO f BNil `cat` b blockJoinTail :: Block n e O -> n O C -> Block n e C blockJoinTail (BlockCO f b) t = BlockCC f b t blockJoinTail b t = b `cat` BlockOC BNil t blockJoin :: n C O -> Block n O O -> n O C -> Block n C C blockJoin f b t = BlockCC f b t blockAppend :: Block n e O -> Block n O x -> Block n e x blockAppend = cat -- Taking apart firstNode :: Block n C x -> n C O firstNode (BlockCO n _) = n firstNode (BlockCC n _ _) = n lastNode :: Block n x C -> n O C lastNode (BlockOC _ n) = n lastNode (BlockCC _ _ n) = n blockSplitHead :: Block n C x -> (n C O, Block n O x) blockSplitHead (BlockCO n b) = (n, b) blockSplitHead (BlockCC n b t) = (n, BlockOC b t) blockSplitTail :: Block n e C -> (Block n e O, n O C) blockSplitTail (BlockOC b n) = (b, n) blockSplitTail (BlockCC f b t) = (BlockCO f b, t) -- | Split a closed block into its entry node, open middle block, and -- exit node. blockSplit :: Block n C C -> (n C O, Block n O O, n O C) blockSplit (BlockCC f b t) = (f, b, t) blockToList :: Block n O O -> [n O O] blockToList b = go b [] where go :: Block n O O -> [n O O] -> [n O O] go BNil r = r go (BMiddle n) r = n : r go (BCat b1 b2) r = go b1 $! go b2 r go (BSnoc b1 n) r = go b1 (n:r) go (BCons n b1) r = n : go b1 r blockFromList :: [n O O] -> Block n O O blockFromList = foldr BCons BNil -- Modifying replaceFirstNode :: Block n C x -> n C O -> Block n C x replaceFirstNode (BlockCO _ b) f = BlockCO f b replaceFirstNode (BlockCC _ b n) f = BlockCC f b n replaceLastNode :: Block n x C -> n O C -> Block n x C replaceLastNode (BlockOC b _) n = BlockOC b n replaceLastNode (BlockCC l b _) n = BlockCC l b n -- ----------------------------------------------------------------------------- -- General concatenation cat :: Block n e O -> Block n O x -> Block n e x cat x y = case x of BNil -> y BlockCO l b1 -> case y of BlockOC b2 n -> (BlockCC l $! (b1 `cat` b2)) n BNil -> x BMiddle _ -> BlockCO l $! (b1 `cat` y) BCat{} -> BlockCO l $! (b1 `cat` y) BSnoc{} -> BlockCO l $! (b1 `cat` y) BCons{} -> BlockCO l $! (b1 `cat` y) BMiddle n -> case y of BlockOC b2 n2 -> (BlockOC $! (x `cat` b2)) n2 BNil -> x BMiddle{} -> BCons n y BCat{} -> BCons n y BSnoc{} -> BCons n y BCons{} -> BCons n y BCat{} -> case y of BlockOC b3 n2 -> (BlockOC $! (x `cat` b3)) n2 BNil -> x BMiddle n -> BSnoc x n BCat{} -> BCat x y BSnoc{} -> BCat x y BCons{} -> BCat x y BSnoc{} -> case y of BlockOC b2 n2 -> (BlockOC $! (x `cat` b2)) n2 BNil -> x BMiddle n -> BSnoc x n BCat{} -> BCat x y BSnoc{} -> BCat x y BCons{} -> BCat x y BCons{} -> case y of BlockOC b2 n2 -> (BlockOC $! (x `cat` b2)) n2 BNil -> x BMiddle n -> BSnoc x n BCat{} -> BCat x y BSnoc{} -> BCat x y BCons{} -> BCat x y -- ----------------------------------------------------------------------------- -- Mapping -- | map a function over the nodes of a 'Block' mapBlock :: (forall e x. n e x -> n' e x) -> Block n e x -> Block n' e x mapBlock f (BlockCO n b ) = BlockCO (f n) (mapBlock f b) mapBlock f (BlockOC b n) = BlockOC (mapBlock f b) (f n) mapBlock f (BlockCC n b m) = BlockCC (f n) (mapBlock f b) (f m) mapBlock _ BNil = BNil mapBlock f (BMiddle n) = BMiddle (f n) mapBlock f (BCat b1 b2) = BCat (mapBlock f b1) (mapBlock f b2) mapBlock f (BSnoc b n) = BSnoc (mapBlock f b) (f n) mapBlock f (BCons n b) = BCons (f n) (mapBlock f b) -- | A strict 'mapBlock' mapBlock' :: (forall e x. n e x -> n' e x) -> (Block n e x -> Block n' e x) mapBlock' f = mapBlock3' (f, f, f) -- | map over a block, with different functions to apply to first nodes, -- middle nodes and last nodes respectively. The map is strict. -- mapBlock3' :: forall n n' e x . ( n C O -> n' C O , n O O -> n' O O, n O C -> n' O C) -> Block n e x -> Block n' e x mapBlock3' (f, m, l) b = go b where go :: forall e x . Block n e x -> Block n' e x go (BlockOC b y) = (BlockOC $! go b) $! l y go (BlockCO x b) = (BlockCO $! f x) $! (go b) go (BlockCC x b y) = ((BlockCC $! f x) $! go b) $! (l y) go BNil = BNil go (BMiddle n) = BMiddle $! m n go (BCat x y) = (BCat $! go x) $! (go y) go (BSnoc x n) = (BSnoc $! go x) $! (m n) go (BCons n x) = (BCons $! m n) $! (go x) -- ----------------------------------------------------------------------------- -- Folding -- | Fold a function over every node in a block, forward or backward. -- The fold function must be polymorphic in the shape of the nodes. foldBlockNodesF3 :: forall n a b c . ( n C O -> a -> b , n O O -> b -> b , n O C -> b -> c) -> (forall e x . Block n e x -> IndexedCO e a b -> IndexedCO x c b) foldBlockNodesF :: forall n a . (forall e x . n e x -> a -> a) -> (forall e x . Block n e x -> IndexedCO e a a -> IndexedCO x a a) foldBlockNodesB3 :: forall n a b c . ( n C O -> b -> c , n O O -> b -> b , n O C -> a -> b) -> (forall e x . Block n e x -> IndexedCO x a b -> IndexedCO e c b) foldBlockNodesB :: forall n a . (forall e x . n e x -> a -> a) -> (forall e x . Block n e x -> IndexedCO x a a -> IndexedCO e a a) foldBlockNodesF3 (ff, fm, fl) = block where block :: forall e x . Block n e x -> IndexedCO e a b -> IndexedCO x c b block (BlockCO f b ) = ff f `cat` block b block (BlockCC f b l) = ff f `cat` block b `cat` fl l block (BlockOC b l) = block b `cat` fl l block BNil = id block (BMiddle node) = fm node block (b1 `BCat` b2) = block b1 `cat` block b2 block (b1 `BSnoc` n) = block b1 `cat` fm n block (n `BCons` b2) = fm n `cat` block b2 cat :: forall a b c. (a -> b) -> (b -> c) -> a -> c cat f f' = f' . f foldBlockNodesF f = foldBlockNodesF3 (f, f, f) foldBlockNodesB3 (ff, fm, fl) = block where block :: forall e x . Block n e x -> IndexedCO x a b -> IndexedCO e c b block (BlockCO f b ) = ff f `cat` block b block (BlockCC f b l) = ff f `cat` block b `cat` fl l block (BlockOC b l) = block b `cat` fl l block BNil = id block (BMiddle node) = fm node block (b1 `BCat` b2) = block b1 `cat` block b2 block (b1 `BSnoc` n) = block b1 `cat` fm n block (n `BCons` b2) = fm n `cat` block b2 cat :: forall a b c. (b -> c) -> (a -> b) -> a -> c cat f f' = f . f' foldBlockNodesB f = foldBlockNodesB3 (f, f, f)
shlevy/ghc
compiler/cmm/Hoopl/Block.hs
bsd-3-clause
11,235
0
15
3,982
4,431
2,283
2,148
-1
-1
{-# LANGUAGE CPP, MagicHash #-} -- | -- Module : Data.Text.UnsafeChar -- Copyright : (c) 2008, 2009 Tom Harper, -- (c) 2009, 2010 Bryan O'Sullivan, -- (c) 2009 Duncan Coutts -- -- License : BSD-style -- Maintainer : bos@serpentine.com, rtomharper@googlemail.com, -- duncan@haskell.org -- Stability : experimental -- Portability : GHC -- -- Fast character manipulation functions. module Data.Text.UnsafeChar ( ord , unsafeChr , unsafeChr8 , unsafeChr32 , unsafeWrite -- , unsafeWriteRev ) where #ifdef ASSERTS import Control.Exception (assert) #endif import Control.Monad.ST (ST) import Data.Bits ((.&.)) import Data.Text.UnsafeShift (shiftR) import GHC.Exts (Char(..), Int(..), chr#, ord#, word2Int#) import GHC.Word (Word8(..), Word16(..), Word32(..)) import qualified Data.Text.Array as A --LIQUID import Language.Haskell.Liquid.Prelude {-@ measure ord :: Char -> Int @-} {-@ predicate One C = ((ord C) < 65536) @-} {-@ predicate Two C = ((ord C) >= 65536) @-} {-@ qualif OneC(v:Char) : ((ord v) < 65536) @-} {-@ qualif TwoC(v:Char) : ((ord v) >= 65536) @-} {-@ predicate Room MA I C = (((One C) => (MAValidIN MA I 1)) && ((Two C) => (MAValidIN MA I 2))) @-} {-@ predicate MAValidIN MA I N = (BtwnI I 0 ((malen MA) - N)) @-} {- predicate RoomFront MA I N = (BtwnI I N (malen MA)) @-} {-@ ord :: c:Char -> {v:Int | v = (ord c)} @-} ord :: Char -> Int ord c@(C# c#) = let i = I# (ord# c#) in liquidAssume (axiom_ord c i) i {-@ axiom_ord :: c:Char -> i:Int -> {v:Bool | ((Prop v) <=> (i = (ord c)))} @-} axiom_ord :: Char -> Int -> Bool axiom_ord = undefined {-# INLINE ord #-} unsafeChr :: Word16 -> Char unsafeChr (W16# w#) = C# (chr# (word2Int# w#)) {-# INLINE unsafeChr #-} unsafeChr8 :: Word8 -> Char unsafeChr8 (W8# w#) = C# (chr# (word2Int# w#)) {-# INLINE unsafeChr8 #-} unsafeChr32 :: Word32 -> Char unsafeChr32 (W32# w#) = C# (chr# (word2Int# w#)) {-# INLINE unsafeChr32 #-} -- | Write a character into the array at the given offset. Returns -- the number of 'Word16's written. {-@ unsafeWrite :: ma:A.MArray s -> i:Nat -> {v:Char | (Room ma i v)} -> ST s {v:(MAValidL i ma) | (BtwnI v 1 2)} @-} unsafeWrite :: A.MArray s -> Int -> Char -> ST s Int unsafeWrite marr i c | n < 0x10000 = do -- #if defined(ASSERTS) liquidAssert (i >= 0) . liquidAssert (i < A.maLen marr) $ return () -- #endif A.unsafeWrite marr i (fromIntegral n) return 1 | otherwise = do -- #if defined(ASSERTS) liquidAssert (i >= 0) . liquidAssert (i < A.maLen marr - 1) $ return () -- #endif A.unsafeWrite marr i lo A.unsafeWrite marr (i+1) hi return 2 where n = ord c m = n - 0x10000 lo = fromIntegral $ (m `shiftR` 10) + 0xD800 hi = fromIntegral $ (m .&. 0x3FF) + 0xDC00 {-# INLINE unsafeWrite #-} {- unsafeWriteRev :: A.MArray s Word16 -> Int -> Char -> ST s Int unsafeWriteRev marr i c | n < 0x10000 = do assert (i >= 0) . assert (i < A.length marr) $ A.unsafeWrite marr i (fromIntegral n) return (i-1) | otherwise = do assert (i >= 1) . assert (i < A.length marr) $ A.unsafeWrite marr (i-1) lo A.unsafeWrite marr i hi return (i-2) where n = ord c m = n - 0x10000 lo = fromIntegral $ (m `shiftR` 10) + 0xD800 hi = fromIntegral $ (m .&. 0x3FF) + 0xDC00 {-# INLINE unsafeWriteRev #-} -}
mightymoose/liquidhaskell
benchmarks/text-0.11.2.3/Data/Text/UnsafeChar.hs
bsd-3-clause
3,534
0
15
945
640
359
281
46
1
module Main where import Criterion.Main import qualified Snap.Internal.Http.Parser.Benchmark as PB main :: IO () main = defaultMain [ PB.benchmarks ]
beni55/snap-server
test/benchmark/Benchmark.hs
bsd-3-clause
162
0
7
32
43
27
16
5
1
module Test3 () where {-@ expression CyclicD1 Q = CyclicD2 Q @-} {-@ expression CyclicD2 Q = CyclicD3 Q @-} {-@ expression CyclicD3 Q = CyclicD1 Q @-}
mightymoose/liquidhaskell
tests/crash/CyclicExprAlias3.hs
bsd-3-clause
153
0
3
30
10
8
2
1
0
{-# LANGUAGE CPP #-} module Distribution.Client.Dependency.Modular.Builder (buildTree) where -- Building the search tree. -- -- In this phase, we build a search tree that is too large, i.e, it contains -- invalid solutions. We keep track of the open goals at each point. We -- nondeterministically pick an open goal (via a goal choice node), create -- subtrees according to the index and the available solutions, and extend the -- set of open goals by superficially looking at the dependencies recorded in -- the index. -- -- For each goal, we keep track of all the *reasons* why it is being -- introduced. These are for debugging and error messages, mainly. A little bit -- of care has to be taken due to the way we treat flags. If a package has -- flag-guarded dependencies, we cannot introduce them immediately. Instead, we -- store the entire dependency. import Data.List as L import Data.Map as M import Prelude hiding (sequence, mapM) import Distribution.Client.Dependency.Modular.Dependency import Distribution.Client.Dependency.Modular.Flag import Distribution.Client.Dependency.Modular.Index import Distribution.Client.Dependency.Modular.Package import Distribution.Client.Dependency.Modular.PSQ as P import Distribution.Client.Dependency.Modular.Tree import Distribution.Client.ComponentDeps (Component) -- | The state needed during the build phase of the search tree. data BuildState = BS { index :: Index, -- ^ information about packages and their dependencies rdeps :: RevDepMap, -- ^ set of all package goals, completed and open, with reverse dependencies open :: PSQ (OpenGoal ()) (), -- ^ set of still open goals (flag and package goals) next :: BuildType, -- ^ kind of node to generate next qualifyOptions :: QualifyOptions -- ^ qualification options } -- | Extend the set of open goals with the new goals listed. -- -- We also adjust the map of overall goals, and keep track of the -- reverse dependencies of each of the goals. extendOpen :: QPN -> [OpenGoal Component] -> BuildState -> BuildState extendOpen qpn' gs s@(BS { rdeps = gs', open = o' }) = go gs' o' gs where go :: RevDepMap -> PSQ (OpenGoal ()) () -> [OpenGoal Component] -> BuildState go g o [] = s { rdeps = g, open = o } go g o (ng@(OpenGoal (Flagged _ _ _ _) _gr) : ngs) = go g (cons' ng () o) ngs -- Note: for 'Flagged' goals, we always insert, so later additions win. -- This is important, because in general, if a goal is inserted twice, -- the later addition will have better dependency information. go g o (ng@(OpenGoal (Stanza _ _ ) _gr) : ngs) = go g (cons' ng () o) ngs go g o (ng@(OpenGoal (Simple (Dep qpn _) c) _gr) : ngs) | qpn == qpn' = go g o ngs -- we ignore self-dependencies at this point; TODO: more care may be needed | qpn `M.member` g = go (M.adjust ((c, qpn'):) qpn g) o ngs | otherwise = go (M.insert qpn [(c, qpn')] g) (cons' ng () o) ngs -- code above is correct; insert/adjust have different arg order cons' = cons . forgetCompOpenGoal -- | Given the current scope, qualify all the package names in the given set of -- dependencies and then extend the set of open goals accordingly. scopedExtendOpen :: QPN -> I -> QGoalReasonChain -> FlaggedDeps Component PN -> FlagInfo -> BuildState -> BuildState scopedExtendOpen qpn i gr fdeps fdefs s = extendOpen qpn gs s where -- Qualify all package names qfdeps = qualifyDeps (qualifyOptions s) qpn fdeps -- Introduce all package flags qfdefs = L.map (\ (fn, b) -> Flagged (FN (PI qpn i) fn) b [] []) $ M.toList fdefs -- Combine new package and flag goals gs = L.map (flip OpenGoal gr) (qfdefs ++ qfdeps) -- NOTE: -- -- In the expression @qfdefs ++ qfdeps@ above, flags occur potentially -- multiple times, both via the flag declaration and via dependencies. -- The order is potentially important, because the occurrences via -- dependencies may record flag-dependency information. After a number -- of bugs involving computing this information incorrectly, however, -- we're currently not using carefully computed inter-flag dependencies -- anymore, but instead use 'simplifyVar' when computing conflict sets -- to map all flags of one package to a single flag for conflict set -- purposes, thereby treating them all as interdependent. -- -- If we ever move to a more clever algorithm again, then the line above -- needs to be looked at very carefully, and probably be replaced by -- more systematically computed flag dependency information. -- | Datatype that encodes what to build next data BuildType = Goals -- ^ build a goal choice node | OneGoal (OpenGoal ()) -- ^ build a node for this goal | Instance QPN I PInfo QGoalReasonChain -- ^ build a tree for a concrete instance deriving Show build :: BuildState -> Tree QGoalReasonChain build = ana go where go :: BuildState -> TreeF QGoalReasonChain BuildState -- If we have a choice between many goals, we just record the choice in -- the tree. We select each open goal in turn, and before we descend, remove -- it from the queue of open goals. go bs@(BS { rdeps = rds, open = gs, next = Goals }) | P.null gs = DoneF rds | otherwise = GoalChoiceF (P.mapWithKey (\ g (_sc, gs') -> bs { next = OneGoal g, open = gs' }) (P.splits gs)) -- If we have already picked a goal, then the choice depends on the kind -- of goal. -- -- For a package, we look up the instances available in the global info, -- and then handle each instance in turn. go bs@(BS { index = idx, next = OneGoal (OpenGoal (Simple (Dep qpn@(Q _ pn) _) _) gr) }) = case M.lookup pn idx of Nothing -> FailF (toConflictSet (Goal (P qpn) gr)) (BuildFailureNotInIndex pn) Just pis -> PChoiceF qpn gr (P.fromList (L.map (\ (i, info) -> (POption i Nothing, bs { next = Instance qpn i info gr })) (M.toList pis))) -- TODO: data structure conversion is rather ugly here -- For a flag, we create only two subtrees, and we create them in the order -- that is indicated by the flag default. -- -- TODO: Should we include the flag default in the tree? go bs@(BS { next = OneGoal (OpenGoal (Flagged qfn@(FN (PI qpn _) _) (FInfo b m w) t f) gr) }) = FChoiceF qfn gr (w || trivial) m (P.fromList (reorder b [(True, (extendOpen qpn (L.map (flip OpenGoal (FDependency qfn True : gr)) t) bs) { next = Goals }), (False, (extendOpen qpn (L.map (flip OpenGoal (FDependency qfn False : gr)) f) bs) { next = Goals })])) where reorder True = id reorder False = reverse trivial = L.null t && L.null f go bs@(BS { next = OneGoal (OpenGoal (Stanza qsn@(SN (PI qpn _) _) t) gr) }) = SChoiceF qsn gr trivial (P.fromList [(False, bs { next = Goals }), (True, (extendOpen qpn (L.map (flip OpenGoal (SDependency qsn : gr)) t) bs) { next = Goals })]) where trivial = L.null t -- For a particular instance, we change the state: we update the scope, -- and furthermore we update the set of goals. -- -- TODO: We could inline this above. go bs@(BS { next = Instance qpn i (PInfo fdeps fdefs _) gr }) = go ((scopedExtendOpen qpn i (PDependency (PI qpn i) : gr) fdeps fdefs bs) { next = Goals }) -- | Interface to the tree builder. Just takes an index and a list of package names, -- and computes the initial state and then the tree from there. buildTree :: Index -> Bool -> [PN] -> Tree QGoalReasonChain buildTree idx ind igs = build BS { index = idx , rdeps = M.fromList (L.map (\ qpn -> (qpn, [])) qpns) , open = P.fromList (L.map (\ qpn -> (topLevelGoal qpn, ())) qpns) , next = Goals , qualifyOptions = defaultQualifyOptions idx } where topLevelGoal qpn = OpenGoal (Simple (Dep qpn (Constrained [])) ()) [UserGoal] qpns | ind = makeIndependent igs | otherwise = L.map (Q None) igs
gridaphobe/cabal
cabal-install/Distribution/Client/Dependency/Modular/Builder.hs
bsd-3-clause
8,526
0
23
2,347
1,923
1,063
860
79
7
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} {-# LANGUAGE FlexibleInstances, UndecidableInstances, MultiParamTypeClasses, FunctionalDependencies #-} {-# LANGUAGE AllowAmbiguousTypes #-} -- 'x' and 'v' are ambiguous -- Trac #1564 module Foo where import Text.PrettyPrint import Prelude hiding(head,tail) class FooBar m k l | m -> k l where a :: m graphtype instance FooBar [] Bool Bool where a = error "urk" instance FooBar Maybe Int Int where a = error "urk" class (Monad m)=>Gr g ep m where x:: m Int v:: m Int instance (Monad m, FooBar m x z) => Gr g ep m where x = error "urk" v = error "urk" -- Old GHC claims for y: y :: (Monad m, FooBar m GHC.Prim.Any GHC.Prim.Any) -- => m Int (which is wrong) -- The uses in foo and bar show if that happens y () = x foo :: [Int] foo = y () bar :: Maybe Int bar = y ()
urbanslug/ghc
testsuite/tests/typecheck/should_compile/tc235.hs
bsd-3-clause
872
0
7
207
230
125
105
24
1
-- This only typechecks if forall-hoisting works ok when -- importing from an interface file. The type of Twins.gzipWithQ -- is this: -- type GenericQ r = forall a. Data a => a -> r -- gzipWithQ :: GenericQ (GenericQ r) -> GenericQ (GenericQ [r]) -- It's kept this way in the interface file for brevity and documentation, -- but when the type synonym is expanded, the foralls need expanding module Foo where import Data.Generics.Basics import Data.Generics.Aliases import Data.Generics.Twins(gzipWithQ) -- | Generic equality: an alternative to \deriving Eq\ geq :: Data a => a -> a -> Bool geq x y = geq' x y where -- This type signature no longer works, because it is -- insufficiently polymoprhic. -- geq' :: forall a b. (Data a, Data b) => a -> b -> Bool geq' :: GenericQ (GenericQ Bool) geq' x y = (toConstr x == toConstr y) && and (gzipWithQ geq' x y)
urbanslug/ghc
testsuite/tests/typecheck/should_compile/tc191.hs
bsd-3-clause
909
0
10
205
129
73
56
9
1
{-# LANGUAGE MagicHash #-} module Main (main) where import GHC.Exts (Double(D#), Float(F#), word2Double#, word2Float#) main :: IO () main = do print (D# (word2Double# 0##)) -- 9007199254740992 is 2^53, which is the largest integer which -- can be stored in a 64-bit IEEE floating-point value without -- loss of precision. print (D# (word2Double# 9007199254740992##)) print (F# (word2Float# 0##)) -- 16777216 is 2^24, which is the largest integer which can be -- stored in a 32-bit IEEE floating-point value without loss of -- precision print (F# (word2Float# 16777216##))
urbanslug/ghc
testsuite/tests/codeGen/should_run/Word2Float64.hs
bsd-3-clause
614
0
11
129
130
71
59
9
1
{-# OPTIONS -fvia-C #-} {-# LANGUAGE DeriveDataTypeable #-} module Language.Haskell.Pointfree.Common ( Fixity(..), Expr(..), Pattern(..), Decl(..), TopLevel(..), bt, sizeExpr, mapTopLevel, mapTopLevel', getExpr, operators, opchars, reservedOps, lookupOp, lookupFix, minPrec, maxPrec, comp, flip', id', const', scomb, cons, nil, fix', if', readM, makeList, getList, Assoc(..), module Data.Maybe, module Control.Arrow, module Data.List, module Control.Monad, module GHC.Base ) where import Data.Maybe (isJust, fromJust) import Data.List (intersperse, minimumBy) import qualified Data.Map as M import Control.Monad import Control.Arrow (first, second, (***), (&&&), (|||), (+++)) import Text.ParserCombinators.Parsec.Expr (Assoc(..)) import GHC.Base (assert) import Data.Data (Data(..)) import Data.Typeable (Typeable(..)) -- The rewrite rules can be found at the end of the file Rules.hs -- Not sure if passing the information if it was used as infix or prefix -- is worth threading through the whole thing is worth the effort, -- but it stays that way until the prettyprinting algorithm gets more -- sophisticated. data Fixity = Pref | Inf deriving (Show, Data, Typeable) instance Eq Fixity where _ == _ = True instance Ord Fixity where compare _ _ = EQ data Expr = Var Fixity String | Lambda Pattern Expr | App Expr Expr | Let [Decl] Expr deriving (Eq, Ord, Data, Typeable) data Pattern = PVar String | PCons Pattern Pattern | PTuple Pattern Pattern deriving (Eq, Ord, Data, Typeable) data Decl = Define { declName :: String, declExpr :: Expr } deriving (Eq, Ord, Data, Typeable) data TopLevel = TLD Bool Decl | TLE Expr deriving (Eq, Ord, Data, Typeable) mapTopLevel :: (Expr -> Expr) -> TopLevel -> TopLevel mapTopLevel f tl = case getExpr tl of (e, c) -> c $ f e mapTopLevel' :: Functor f => (Expr -> f Expr) -> TopLevel -> f TopLevel mapTopLevel' f tl = case getExpr tl of (e, c) -> fmap c $ f e getExpr :: TopLevel -> (Expr, Expr -> TopLevel) getExpr (TLD True (Define foo e)) = (Let [Define foo e] (Var Pref foo), \e' -> TLD False $ Define foo e') getExpr (TLD False (Define foo e)) = (e, \e' -> TLD False $ Define foo e') getExpr (TLE e) = (e, TLE) sizeExpr :: Expr -> Int sizeExpr (Var _ _) = 1 sizeExpr (App e1 e2) = sizeExpr e1 + sizeExpr e2 + 1 sizeExpr (Lambda _ e) = 1 + sizeExpr e sizeExpr (Let ds e) = 1 + sum (map sizeDecl ds) + sizeExpr e where sizeDecl (Define _ e') = 1 + sizeExpr e' comp, flip', id', const', scomb, cons, nil, fix', if' :: Expr comp = Var Inf "." flip' = Var Pref "flip" id' = Var Pref "id" const' = Var Pref "const" scomb = Var Pref "ap" cons = Var Inf ":" nil = Var Pref "[]" fix' = Var Pref "fix" if' = Var Pref "if'" makeList :: [Expr] -> Expr makeList = foldr (\e1 e2 -> cons `App` e1 `App` e2) nil -- Modularity is a drag getList :: Expr -> ([Expr], Expr) getList (c `App` x `App` tl) | c == cons = first (x:) $ getList tl getList e = ([],e) bt :: a bt = undefined shift, minPrec, maxPrec :: Int shift = 0 maxPrec = shift + 10 minPrec = 0 -- operator precedences are needed both for parsing and prettyprinting operators :: [[(String, (Assoc, Int))]] operators = (map . map . second . second $ (+shift)) [[inf "." AssocRight 9, inf "!!" AssocLeft 9], [inf name AssocRight 8 | name <- ["^", "^^", "**"]], [inf name AssocLeft 7 | name <- ["*", "/", "`quot`", "`rem`", "`div`", "`mod`", ":%", "%"]], [inf name AssocLeft 6 | name <- ["+", "-"]], [inf name AssocRight 5 | name <- [":", "++"]], [inf name AssocNone 4 | name <- ["==", "/=", "<", "<=", ">=", ">", "`elem`", "`notElem`"]], [inf "&&" AssocRight 3], [inf "||" AssocRight 2], [inf ">>" AssocLeft 1, inf ">>=" AssocLeft 1, inf "=<<" AssocRight 1], [inf name AssocRight 0 | name <- ["$", "$!", "`seq`"]] ] where inf name assoc fx = (name, (assoc, fx)) opchars :: [Char] opchars = "!@#$%^*./|=-+:?<>&" reservedOps :: [String] reservedOps = ["->", "..", "="] opFM :: M.Map String (Assoc, Int) opFM = (M.fromList $ concat operators) lookupOp :: String -> Maybe (Assoc, Int) lookupOp k = M.lookup k opFM lookupFix :: String -> (Assoc, Int) lookupFix str = case lookupOp $ str of Nothing -> (AssocLeft, 9 + shift) Just x -> x readM :: (Monad m, Read a) => String -> m a readM s = case [x | (x,t) <- reads s, ("","") <- lex t] of [x] -> return x [] -> fail "readM: No parse." _ -> fail "readM: Ambiguous parse."
substack/hs-disappoint
src/Language/Haskell/Pointfree/Common.hs
mit
4,610
0
10
1,077
1,852
1,047
805
113
3
module Anagram (anagramsFor) where import Data.Char (toLower) import Data.List (sort) anagramsFor :: String -> [String] -> [String] anagramsFor word = filter (isAnagram word) isAnagram :: String -> String -> Bool isAnagram a b = sort (normalize a) == sort (normalize b) normalize :: String -> String normalize = map toLower
tfausak/exercism-solutions
haskell/anagram/Anagram.hs
mit
328
0
8
54
127
68
59
9
1