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
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. ----------------------------------------------------------------- -- Auto-generated by regenClassifiers -- -- DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -- @generated ----------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} module Duckling.Ranking.Classifiers.NL_XX (classifiers) where import Data.String import Prelude import qualified Data.HashMap.Strict as HashMap import Duckling.Ranking.Types classifiers :: Classifiers classifiers = HashMap.fromList [("Kerstmis", Classifier{okData = ClassData{prior = 0.0, unseen = -1.791759469228055, likelihoods = HashMap.fromList [("", 0.0)], n = 4}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("<time> timezone", Classifier{okData = ClassData{prior = 0.0, unseen = -2.3978952727983707, likelihoods = HashMap.fromList [("<time-of-day> o'clock", -1.6094379124341003), ("hh:mm", -1.2039728043259361), ("hour", -1.6094379124341003), ("minute", -1.2039728043259361)], n = 3}, koData = ClassData{prior = -infinity, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [], n = 0}}), ("integer (numeric)", Classifier{okData = ClassData{prior = -0.6300464741920015, unseen = -4.948759890378168, likelihoods = HashMap.fromList [("", 0.0)], n = 139}, koData = ClassData{prior = -0.7604993625894368, unseen = -4.820281565605037, likelihoods = HashMap.fromList [("", 0.0)], n = 122}}), ("exactly <time-of-day>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.0794415416798357, likelihoods = HashMap.fromList [("<time-of-day> o'clock", -1.252762968495368), ("time-of-day (latent)", -1.252762968495368), ("hour", -0.8472978603872037)], n = 2}, koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}), ("<duration> hence|ago", Classifier{okData = ClassData{prior = 0.0, unseen = -2.995732273553991, likelihoods = HashMap.fromList [("week", -1.55814461804655), ("day", -1.845826690498331), ("year", -2.2512917986064953), ("<integer> <unit-of-duration>", -0.8649974374866046), ("month", -2.2512917986064953)], n = 7}, koData = ClassData{prior = -infinity, unseen = -1.791759469228055, likelihoods = HashMap.fromList [], n = 0}}), ("thursday", Classifier{okData = ClassData{prior = 0.0, unseen = -2.4849066497880004, likelihoods = HashMap.fromList [("", 0.0)], n = 10}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("integer (20..90)", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("<time> <part-of-day>", Classifier{okData = ClassData{prior = -0.15415067982725836, unseen = -5.030437921392435, likelihoods = HashMap.fromList [("<time-of-day> o'clockmorning", -3.077970371790963), ("until <time-of-day>afternoon", -4.330733340286331), ("dayhour", -2.9444389791664407), ("todayevening", -4.330733340286331), ("on <date>evening", -3.925268232178167), ("thursdaymorning", -4.330733340286331), ("intersectevening", -2.384823191231018), ("tomorrowafternoon", -3.925268232178167), ("half to|till|before <integer> (hour-of-day)afternoon", -4.330733340286331), ("hourhour", -1.1737329191362178), ("<day-of-month> (non ordinal) <named-month>morning", -3.925268232178167), ("at <time-of-day>afternoon", -4.330733340286331), ("todayafternoon", -4.330733340286331), ("<time-of-day> o'clockafternoon", -3.2321210516182215), ("<time-of-day> o'clocknight", -4.330733340286331), ("until <time-of-day>morning", -3.925268232178167), ("minutehour", -2.9444389791664407), ("<time-of-day> am|pmmorning", -3.925268232178167), ("hh:mmmorning", -3.925268232178167), ("about <time-of-day>evening", -4.330733340286331), ("<time-of-day> o'clockevening", -3.6375861597263857), ("<hour-of-day> <integer> (as relative minutes)afternoon", -3.925268232178167), ("intersectmorning", -3.077970371790963), ("about <time-of-day>afternoon", -4.330733340286331), ("hh:mmafternoon", -4.330733340286331), ("on <date>morning", -3.925268232178167), ("at <time-of-day>morning", -4.330733340286331)], n = 60}, koData = ClassData{prior = -1.9459101490553135, unseen = -3.970291913552122, likelihoods = HashMap.fromList [("<time-of-day> o'clockmorning", -3.258096538021482), ("yearhour", -3.258096538021482), ("intersectevening", -2.5649493574615367), ("monthhour", -2.8526314299133175), ("hourhour", -1.8718021769015913), ("year (latent)afternoon", -3.258096538021482), ("Februarymorning", -2.8526314299133175), ("<time-of-day> o'clockevening", -3.258096538021482), ("time-of-day (latent)afternoon", -2.8526314299133175)], n = 10}}), ("dd/mm", Classifier{okData = ClassData{prior = -0.5108256237659907, unseen = -2.639057329615259, likelihoods = HashMap.fromList [("", 0.0)], n = 12}, koData = ClassData{prior = -0.916290731874155, unseen = -2.3025850929940455, likelihoods = HashMap.fromList [("", 0.0)], n = 8}}), ("today", Classifier{okData = ClassData{prior = 0.0, unseen = -2.0794415416798357, likelihoods = HashMap.fromList [("", 0.0)], n = 6}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("at <time-of-day>", Classifier{okData = ClassData{prior = -0.19237189264745613, unseen = -4.31748811353631, likelihoods = HashMap.fromList [("<time-of-day> o'clock", -1.739115735742633), ("half to|till|before <integer> (hour-of-day)", -3.6109179126442243), ("about <time-of-day>", -2.6946271807700692), ("time-of-day (latent)", -1.906169820405799), ("hh:mm", -2.512305623976115), ("hour", -1.0082282271998406), ("minute", -2.2246235515243336), ("<hour-of-day> <integer> (as relative minutes)", -3.6109179126442243)], n = 33}, koData = ClassData{prior = -1.742969305058623, unseen = -3.1354942159291497, likelihoods = HashMap.fromList [("<time-of-day> o'clock", -2.3978952727983707), ("time-of-day (latent)", -1.1451323043030026), ("hour", -1.0116009116784799)], n = 7}}), ("absorption of , after named day", Classifier{okData = ClassData{prior = 0.0, unseen = -2.995732273553991, likelihoods = HashMap.fromList [("wednesday", -2.2512917986064953), ("monday", -1.845826690498331), ("friday", -1.55814461804655), ("day", -0.8649974374866046), ("sunday", -2.2512917986064953)], n = 7}, koData = ClassData{prior = -infinity, unseen = -1.791759469228055, likelihoods = HashMap.fromList [], n = 0}}), ("September", Classifier{okData = ClassData{prior = 0.0, unseen = -1.791759469228055, likelihoods = HashMap.fromList [("", 0.0)], n = 4}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("on <date>", Classifier{okData = ClassData{prior = -8.338160893905101e-2, unseen = -4.672828834461907, likelihoods = HashMap.fromList [("thursday", -3.2771447329921766), ("<time> <part-of-day>", -3.054001181677967), ("dd/mm", -3.054001181677967), ("saturday", -3.970291913552122), ("intersect", -1.367602228107738), ("<day-of-month>(ordinal) <named-month>", -3.970291913552122), ("friday", -3.970291913552122), ("day", -1.8302257500558512), ("hh:mm", -3.970291913552122), ("<day-of-month> (ordinal)", -3.2771447329921766), ("hour", -1.8302257500558512), ("<datetime> - <datetime> (interval)", -3.970291913552122), ("<day-of-month> (non ordinal) <named-month>", -3.970291913552122), ("minute", -1.955388893009857)], n = 46}, koData = ClassData{prior = -2.5257286443082556, unseen = -3.1354942159291497, likelihoods = HashMap.fromList [("intersect", -1.7047480922384253), ("day", -2.3978952727983707), ("<day-of-month> (ordinal)", -2.3978952727983707), ("hour", -1.9924301646902063), ("minute", -2.3978952727983707)], n = 4}}), ("integer (0..19)", Classifier{okData = ClassData{prior = -5.5569851154810765e-2, unseen = -3.6109179126442243, likelihoods = HashMap.fromList [("", 0.0)], n = 35}, koData = ClassData{prior = -2.917770732084279, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [("", 0.0)], n = 2}}), ("between <time-of-day> and <time-of-day> (interval)", Classifier{okData = ClassData{prior = 0.0, unseen = -2.1972245773362196, likelihoods = HashMap.fromList [("hh:mmtime-of-day (latent)", -1.3862943611198906), ("minuteminute", -1.3862943611198906), ("hh:mmhh:mm", -1.3862943611198906), ("minutehour", -1.3862943611198906)], n = 2}, koData = ClassData{prior = -infinity, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [], n = 0}}), ("Halloween", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("between <datetime> and <datetime> (interval)", Classifier{okData = ClassData{prior = 0.0, unseen = -2.1972245773362196, likelihoods = HashMap.fromList [("hh:mmtime-of-day (latent)", -1.3862943611198906), ("minuteminute", -1.3862943611198906), ("hh:mmhh:mm", -1.3862943611198906), ("minutehour", -1.3862943611198906)], n = 2}, koData = ClassData{prior = -infinity, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [], n = 0}}), ("October", Classifier{okData = ClassData{prior = 0.0, unseen = -2.3025850929940455, likelihoods = HashMap.fromList [("", 0.0)], n = 8}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("month (grain)", Classifier{okData = ClassData{prior = 0.0, unseen = -2.1972245773362196, likelihoods = HashMap.fromList [("", 0.0)], n = 7}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("on a named-day", Classifier{okData = ClassData{prior = 0.0, unseen = -2.70805020110221, likelihoods = HashMap.fromList [("thursday", -1.252762968495368), ("saturday", -1.9459101490553135), ("friday", -1.9459101490553135), ("day", -0.8472978603872037)], n = 5}, koData = ClassData{prior = -infinity, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [], n = 0}}), ("yesterday/tomorrow night", Classifier{okData = ClassData{prior = 0.0, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [("", 0.0)], n = 2}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("wednesday", Classifier{okData = ClassData{prior = 0.0, unseen = -2.3025850929940455, likelihoods = HashMap.fromList [("", 0.0)], n = 8}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("<time-of-day> o'clock", Classifier{okData = ClassData{prior = -0.14107859825990549, unseen = -4.955827057601261, likelihoods = HashMap.fromList [("exactly <time-of-day>", -4.255612709818223), ("at <time-of-day>", -2.3838105329166317), ("about <time-of-day>", -2.8693183486983322), ("time-of-day (latent)", -1.259880436264232), ("quarter after|past <integer> (hour-of-day)", -4.255612709818223), ("until <time-of-day>", -3.339321977944068), ("hour", -0.7591051483517427), ("minute", -4.255612709818223), ("after <time-of-day>", -3.8501476017100584)], n = 66}, koData = ClassData{prior = -2.0281482472922856, unseen = -3.4011973816621555, likelihoods = HashMap.fromList [("at <time-of-day>", -2.6741486494265287), ("time-of-day (latent)", -1.0647107369924282), ("hour", -0.9694005571881036)], n = 10}}), ("<integer> + '\"", Classifier{okData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}, koData = ClassData{prior = 0.0, unseen = -1.9459101490553135, likelihoods = HashMap.fromList [("integer (numeric)", -0.40546510810816444), ("integer (0..19)", -1.0986122886681098)], n = 4}}), ("July", Classifier{okData = ClassData{prior = 0.0, unseen = -2.3978952727983707, likelihoods = HashMap.fromList [("", 0.0)], n = 9}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("hour (grain)", Classifier{okData = ClassData{prior = -1.9661128563728327, unseen = -2.1972245773362196, likelihoods = HashMap.fromList [("", 0.0)], n = 7}, koData = ClassData{prior = -0.15082288973458366, unseen = -3.8066624897703196, likelihoods = HashMap.fromList [("", 0.0)], n = 43}}), ("<ordinal> quarter", Classifier{okData = ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055, likelihoods = HashMap.fromList [("ordinals (first..19th)quarter (grain)", -0.916290731874155), ("quarter", -0.916290731874155)], n = 1}, koData = ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055, likelihoods = HashMap.fromList [("ordinal (digits)quarter (grain)", -0.916290731874155), ("quarter", -0.916290731874155)], n = 1}}), ("saturday", Classifier{okData = ClassData{prior = 0.0, unseen = -1.9459101490553135, likelihoods = HashMap.fromList [("", 0.0)], n = 5}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("intersect", Classifier{okData = ClassData{prior = -0.17538912001830978, unseen = -6.263398262591624, likelihoods = HashMap.fromList [("last <cycle>sunday", -5.568344503761097), ("Koningsdagyear", -4.064267106984823), ("hourday", -4.4697322150929875), ("on a named-day<day-of-month> (non ordinal) <named-month>", -5.568344503761097), ("<day-of-month> (non ordinal) <named-month><time-of-day> o'clock", -5.568344503761097), ("dayhour", -2.4328502878319473), ("daymonth", -4.6520537718869415), ("next <cycle>friday", -5.568344503761097), ("monthyear", -3.9589065913269965), ("friday<day-of-month> (non ordinal) <named-month>", -5.162879395652933), ("yearhour", -5.568344503761097), ("intersect<time-of-day> o'clock", -4.875197323201151), ("tuesdaythis <cycle>", -5.568344503761097), ("on a named-dayfrom <time-of-day> - <time-of-day> (interval)", -4.6520537718869415), ("saturday<time-of-day> o'clock", -5.568344503761097), ("absorption of , after named daydd/mm/yyyy", -5.162879395652933), ("<time-of-day> am|pmintersect", -5.568344503761097), ("intersect<time> <part-of-day>", -4.875197323201151), ("Marchyear", -5.568344503761097), ("saturdayat <time-of-day>", -5.162879395652933), ("saturday<time> <part-of-day>", -5.162879395652933), ("dd/mm<time-of-day> o'clock", -5.568344503761097), ("on a named-dayat <time-of-day>", -4.875197323201151), ("today<time-of-day> o'clock", -5.568344503761097), ("at <time-of-day>on a named-day", -5.568344503761097), ("on a named-daybetween <datetime> and <datetime> (interval)", -5.162879395652933), ("intersect by ','year", -5.568344503761097), ("on <date><time-of-day> o'clock", -4.875197323201151), ("next <cycle>monday", -5.568344503761097), ("on a named-daybetween <time-of-day> and <time-of-day> (interval)", -5.162879395652933), ("exactly <time-of-day>tomorrow", -5.568344503761097), ("on a named-day<time> <part-of-day>", -5.162879395652933), ("monthhour", -4.6520537718869415), ("on <date>between <datetime> and <datetime> (interval)", -5.162879395652933), ("last <day-of-week> of <time>year", -5.568344503761097), ("on a named-day<time-of-day> o'clock", -5.568344503761097), ("next <cycle>March", -5.568344503761097), ("todayat <time-of-day>", -4.875197323201151), ("on <date>between <time-of-day> and <time-of-day> (interval)", -5.162879395652933), ("on <date>at <time-of-day>", -4.875197323201151), ("thursday<time> timezone", -5.162879395652933), ("on <date>about <time-of-day>", -4.875197323201151), ("dayday", -3.265759410767051), ("on <date><time> <part-of-day>", -4.6520537718869415), ("dd/mmabout <time-of-day>", -5.162879395652933), ("<day-of-month> (ordinal)intersect", -5.568344503761097), ("hourhour", -4.4697322150929875), ("saturday<day-of-month> (non ordinal) <named-month>", -5.568344503761097), ("thursdayat <time-of-day>", -5.568344503761097), ("today/tomorrow/yesterday afternoon<hour-of-day> <integer> (as relative minutes)", -5.162879395652933), ("intersect<day-of-month> (non ordinal) <named-month>", -4.4697322150929875), ("dayyear", -3.1704492309627264), ("tuesdayafter <duration>", -5.568344503761097), ("tomorrow<time-of-day> o'clock", -5.568344503761097), ("<time-of-day> o'clocktomorrow", -4.875197323201151), ("<day-of-month> (non ordinal) <named-month>intersect", -5.568344503761097), ("thursdaybetween <time-of-day> and <time-of-day> (interval)", -5.162879395652933), ("thursdaybetween <datetime> and <datetime> (interval)", -5.162879395652933), ("<day-of-month>(ordinal) <named-month>year", -5.568344503761097), ("<day-of-month> (ordinal)tuesday", -5.568344503761097), ("hourminute", -4.875197323201151), ("thursdayhh:mm", -5.568344503761097), ("this <cycle>wednesday", -5.568344503761097), ("absorption of , after named day<named-month> <day-of-month> (non ordinal)", -5.568344503761097), ("<day-of-month> (non ordinal) <named-month><time> <part-of-day>", -5.162879395652933), ("on <date><day-of-month> (non ordinal) <named-month>", -5.568344503761097), ("Aprilabout <time-of-day>", -5.568344503761097), ("thursdayfrom <datetime> - <datetime> (interval)", -5.162879395652933), ("<day-of-month> (ordinal)February", -5.568344503761097), ("thursdayfrom <time-of-day> - <time-of-day> (interval)", -4.3155815352657285), ("absorption of , after named day<day-of-month> (non ordinal) <named-month>", -4.6520537718869415), ("today/tomorrow/yesterday evening<time-of-day> o'clock", -5.568344503761097), ("fridayintersect", -4.875197323201151), ("on <date><time-of-day> - <time-of-day> (interval)", -5.162879395652933), ("on <date><datetime> - <datetime> (interval)", -5.568344503761097), ("this <cycle>monday", -5.568344503761097), ("April<time-of-day> o'clock", -5.568344503761097), ("next <cycle>wednesday", -5.568344503761097), ("hh:mmintersect", -5.162879395652933), ("thursday<datetime> - <datetime> (interval)", -5.162879395652933), ("<day-of-month> (ordinal)July", -5.568344503761097), ("thursday<time-of-day> - <time-of-day> (interval)", -4.6520537718869415), ("yearmonth", -5.568344503761097), ("at <time-of-day>intersect", -5.162879395652933), ("on <date>from <time-of-day> - <time-of-day> (interval)", -4.6520537718869415), ("<time> <part-of-day>from <time-of-day> - <time-of-day> (interval)", -5.568344503761097), ("dayminute", -2.3902906734131513), ("<time> <part-of-day>from <datetime> - <datetime> (interval)", -5.568344503761097), ("intersectyear", -4.875197323201151), ("<time-of-day> am|pmsaturday", -5.568344503761097), ("<ordinal> <cycle> of <time>year", -5.568344503761097), ("minuteday", -3.3711199264248775), ("absorption of , after named dayintersect", -5.568344503761097), ("Julyyear", -5.568344503761097), ("year<time-of-day> o'clock", -5.568344503761097), ("Octoberyear", -4.4697322150929875), ("hh:mmon <date>", -5.162879395652933), ("today/tomorrow/yesterday afternoonat <time-of-day>", -5.568344503761097), ("tuesdayin <duration>", -5.568344503761097), ("Septemberyear", -5.162879395652933), ("at <time-of-day>on <date>", -5.162879395652933), ("absorption of , after named daydd/mm", -5.162879395652933), ("intersectintersect", -5.568344503761097), ("hh:mmon a named-day", -5.568344503761097), ("weekday", -4.182050142641207), ("dayweek", -4.875197323201151), ("weekyear", -5.162879395652933), ("on <date>February", -5.568344503761097), ("Kerstmisyear", -5.568344503761097), ("<month> dd-dd (interval)year", -5.568344503761097), ("tomorrowat <time-of-day>", -5.162879395652933), ("next <cycle>tuesday", -5.568344503761097), ("monday<day-of-month> (non ordinal) <named-month>", -5.568344503761097), ("at <time-of-day>tomorrow", -5.568344503761097), ("monday<named-month> <day-of-month> (non ordinal)", -5.568344503761097), ("<day-of-month> (non ordinal) <named-month>about <time-of-day>", -5.568344503761097), ("on a named-day<time-of-day> - <time-of-day> (interval)", -5.162879395652933), ("today/tomorrow/yesterday eveningat <time-of-day>", -5.162879395652933), ("last <cycle> of <time>year", -5.162879395652933), ("on a named-day<datetime> - <datetime> (interval)", -5.568344503761097), ("<day-of-month> (non ordinal) <named-month>year", -4.6520537718869415), ("April<time> <part-of-day>", -5.162879395652933)], n = 193}, koData = ClassData{prior = -1.827161396278971, unseen = -5.3612921657094255, likelihoods = HashMap.fromList [("dayhour", -3.2771447329921766), ("on a named-dayafter <time-of-day>", -4.663439094112067), ("daymonth", -4.257973986003902), ("monthyear", -3.5648268054439574), ("yearhour", -4.663439094112067), ("intersect<time-of-day> o'clock", -4.663439094112067), ("<day-of-month> (ordinal)wednesday", -4.257973986003902), ("Julyintersect", -4.663439094112067), ("thursdayafter <time-of-day>", -4.663439094112067), ("intersect<time> <part-of-day>", -4.663439094112067), ("Marchyear", -4.663439094112067), ("<day-of-month> (ordinal)year", -4.663439094112067), ("on a named-dayat <time-of-day>", -4.663439094112067), ("tuesdayafter <time-of-day>", -4.663439094112067), ("monthhour", -3.747148362237912), ("todayat <time-of-day>", -4.663439094112067), ("on <date>at <time-of-day>", -4.663439094112067), ("on <date>about <time-of-day>", -4.663439094112067), ("dayday", -3.5648268054439574), ("hourhour", -3.970291913552122), ("thursdayat <time-of-day>", -4.663439094112067), ("dayyear", -3.970291913552122), ("<day-of-month> (ordinal)tuesday", -4.257973986003902), ("thursdayhh:mm", -4.257973986003902), ("Aprilabout <time-of-day>", -4.663439094112067), ("Aprilyear", -4.663439094112067), ("mondayFebruary", -4.663439094112067), ("yearuntil <time-of-day>", -4.257973986003902), ("dayminute", -3.5648268054439574), ("thursday<part-of-day> of <time>", -4.663439094112067), ("Julyyear", -4.257973986003902), ("Octoberyear", -4.663439094112067), ("today/tomorrow/yesterday afternoonat <time-of-day>", -4.257973986003902), ("year<time> <part-of-day>", -4.663439094112067), ("today/tomorrow/yesterday afternoon<time-of-day> o'clock", -4.663439094112067), ("yearday", -4.257973986003902), ("absorption of , after named dayFebruary", -4.663439094112067), ("<day-of-month> (non ordinal) <named-month>about <time-of-day>", -4.663439094112067), ("after <time-of-day>year", -4.663439094112067), ("on <date>after <time-of-day>", -4.663439094112067), ("<day-of-month> (non ordinal) <named-month>year", -4.663439094112067)], n = 37}}), ("<ordinal> <cycle> of <time>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.4849066497880004, likelihoods = HashMap.fromList [("daymonth", -1.7047480922384253), ("ordinals (first..19th)week (grain)intersect", -1.7047480922384253), ("weekmonth", -1.2992829841302609), ("ordinals (first..19th)day (grain)October", -1.7047480922384253), ("ordinals (first..19th)week (grain)October", -1.7047480922384253)], n = 3}, koData = ClassData{prior = -infinity, unseen = -1.791759469228055, likelihoods = HashMap.fromList [], n = 0}}), ("year (grain)", Classifier{okData = ClassData{prior = 0.0, unseen = -2.5649493574615367, likelihoods = HashMap.fromList [("", 0.0)], n = 11}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("from <datetime> - <datetime> (interval)", Classifier{okData = ClassData{prior = -0.1823215567939546, unseen = -3.0910424533583156, likelihoods = HashMap.fromList [("dd/mm/yyyydd/mm", -2.3513752571634776), ("hh:mmtime-of-day (latent)", -2.3513752571634776), ("minuteminute", -2.3513752571634776), ("time-of-day (latent)time-of-day (latent)", -2.3513752571634776), ("hh:mmhh:mm", -2.3513752571634776), ("dayday", -1.9459101490553135), ("dd/mm/yyyydd/mm/yyyy", -2.3513752571634776), ("hourhour", -2.3513752571634776), ("minutehour", -2.3513752571634776)], n = 5}, koData = ClassData{prior = -1.791759469228055, unseen = -2.639057329615259, likelihoods = HashMap.fromList [("dayhour", -1.8718021769015913), ("dd/mm/yyyytime-of-day (latent)", -1.8718021769015913)], n = 1}}), ("after tomorrow", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("next <cycle>", Classifier{okData = ClassData{prior = 0.0, unseen = -3.295836866004329, likelihoods = HashMap.fromList [("week", -1.466337068793427), ("month (grain)", -2.5649493574615367), ("year (grain)", -2.159484249353372), ("week (grain)", -1.466337068793427), ("quarter", -2.5649493574615367), ("year", -2.159484249353372), ("month", -2.5649493574615367), ("quarter (grain)", -2.5649493574615367)], n = 9}, koData = ClassData{prior = -infinity, unseen = -2.1972245773362196, likelihoods = HashMap.fromList [], n = 0}}), ("from <time-of-day> - <time-of-day> (interval)", Classifier{okData = ClassData{prior = 0.0, unseen = -3.044522437723423, likelihoods = HashMap.fromList [("hh:mmtime-of-day (latent)", -1.6094379124341003), ("minuteminute", -1.6094379124341003), ("time-of-day (latent)time-of-day (latent)", -2.3025850929940455), ("hh:mmhh:mm", -1.6094379124341003), ("hourhour", -2.3025850929940455), ("minutehour", -1.6094379124341003)], n = 7}, koData = ClassData{prior = -infinity, unseen = -1.9459101490553135, likelihoods = HashMap.fromList [], n = 0}}), ("yyyy-mm-dd", Classifier{okData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}, koData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("year (latent)", Classifier{okData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}, koData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("integer (numeric)", 0.0)], n = 1}}), ("couple", Classifier{okData = ClassData{prior = 0.0, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [("", 0.0)], n = 2}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("dd/mm/yyyy", Classifier{okData = ClassData{prior = 0.0, unseen = -2.3025850929940455, likelihoods = HashMap.fromList [("", 0.0)], n = 8}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("yesterday", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("<ordinal> quarter <year>", Classifier{okData = ClassData{prior = 0.0, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [("quarteryear", -0.6931471805599453), ("ordinal (digits)quarter (grain)year", -0.6931471805599453)], n = 1}, koData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}}), ("today/tomorrow/yesterday morning", Classifier{okData = ClassData{prior = 0.0, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [("", 0.0)], n = 3}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("after lunch", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("monday", Classifier{okData = ClassData{prior = 0.0, unseen = -2.70805020110221, likelihoods = HashMap.fromList [("", 0.0)], n = 13}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("quarter to|till|before <integer> (hour-of-day)", Classifier{okData = ClassData{prior = 0.0, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [("time-of-day (latent)", -0.6931471805599453), ("hour", -0.6931471805599453)], n = 1}, koData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}}), ("Allerheiligen", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("nth <time> of <time>", Classifier{okData = ClassData{prior = -0.5596157879354228, unseen = -2.70805020110221, likelihoods = HashMap.fromList [("daymonth", -1.0296194171811581), ("ordinals (first..19th)tuesdayOctober", -1.9459101490553135), ("ordinals (first..19th)wednesdayintersect", -1.540445040947149), ("ordinals (first..19th)tuesdayintersect", -1.9459101490553135)], n = 4}, koData = ClassData{prior = -0.8472978603872037, unseen = -2.5649493574615367, likelihoods = HashMap.fromList [("daymonth", -1.0986122886681098), ("ordinals (first..19th)wednesdayOctober", -1.3862943611198906), ("ordinals (first..19th)tuesdaySeptember", -1.791759469228055)], n = 3}}), ("the <day-of-month> (non ordinal)", Classifier{okData = ClassData{prior = 0.0, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [("integer (numeric)", 0.0)], n = 2}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("April", Classifier{okData = ClassData{prior = 0.0, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [("", 0.0)], n = 3}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("today/tomorrow/yesterday evening", Classifier{okData = ClassData{prior = 0.0, unseen = -1.9459101490553135, likelihoods = HashMap.fromList [("", 0.0)], n = 5}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("week (grain)", Classifier{okData = ClassData{prior = 0.0, unseen = -3.2188758248682006, likelihoods = HashMap.fromList [("", 0.0)], n = 23}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("<part-of-day> of <time>", Classifier{okData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}, koData = ClassData{prior = 0.0, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [("hourhour", -0.6931471805599453), ("morningtime-of-day (latent)", -0.6931471805599453)], n = 1}}), ("Vaderdag", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("now", Classifier{okData = ClassData{prior = 0.0, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [("", 0.0)], n = 3}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("number,number uur", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("this <part-of-day>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.0794415416798357, likelihoods = HashMap.fromList [("afternoon", -1.252762968495368), ("hour", -0.8472978603872037), ("evening", -1.252762968495368)], n = 2}, koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}), ("<day-of-month>(ordinal) <named-month>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.0794415416798357, likelihoods = HashMap.fromList [("ordinal (digits)July", -1.252762968495368), ("ordinal (digits)February", -1.252762968495368), ("month", -0.8472978603872037)], n = 2}, koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}), ("numbers prefix with -, negative or minus", Classifier{okData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}, koData = ClassData{prior = 0.0, unseen = -3.1354942159291497, likelihoods = HashMap.fromList [("integer (numeric)", -9.53101798043249e-2), ("fractional number", -2.3978952727983707)], n = 20}}), ("Nieuwjaarsdag", Classifier{okData = ClassData{prior = 0.0, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [("", 0.0)], n = 2}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("tomorrow", Classifier{okData = ClassData{prior = -0.2876820724517809, unseen = -2.0794415416798357, likelihoods = HashMap.fromList [("", 0.0)], n = 6}, koData = ClassData{prior = -1.3862943611198906, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [("", 0.0)], n = 2}}), ("friday", Classifier{okData = ClassData{prior = 0.0, unseen = -2.3025850929940455, likelihoods = HashMap.fromList [("", 0.0)], n = 8}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("half to|till|before <integer> (hour-of-day)", Classifier{okData = ClassData{prior = 0.0, unseen = -2.5649493574615367, likelihoods = HashMap.fromList [("time-of-day (latent)", -0.6931471805599453), ("hour", -0.6931471805599453)], n = 5}, koData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}}), ("half an hour", Classifier{okData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}, koData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("fractional number", Classifier{okData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}, koData = ClassData{prior = 0.0, unseen = -2.0794415416798357, likelihoods = HashMap.fromList [("", 0.0)], n = 6}}), ("afternoon", Classifier{okData = ClassData{prior = 0.0, unseen = -2.5649493574615367, likelihoods = HashMap.fromList [("", 0.0)], n = 11}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("February", Classifier{okData = ClassData{prior = 0.0, unseen = -2.5649493574615367, likelihoods = HashMap.fromList [("", 0.0)], n = 11}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("this <cycle>", Classifier{okData = ClassData{prior = 0.0, unseen = -3.1354942159291497, likelihoods = HashMap.fromList [("week", -1.4816045409242156), ("year (grain)", -2.3978952727983707), ("week (grain)", -1.4816045409242156), ("day", -2.3978952727983707), ("quarter", -2.3978952727983707), ("year", -2.3978952727983707), ("quarter (grain)", -2.3978952727983707), ("day (grain)", -2.3978952727983707)], n = 7}, koData = ClassData{prior = -infinity, unseen = -2.1972245773362196, likelihoods = HashMap.fromList [], n = 0}}), ("minute (grain)", Classifier{okData = ClassData{prior = 0.0, unseen = -2.639057329615259, likelihoods = HashMap.fromList [("", 0.0)], n = 12}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("night", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("sunday", Classifier{okData = ClassData{prior = 0.0, unseen = -2.1972245773362196, likelihoods = HashMap.fromList [("", 0.0)], n = 7}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("about <time-of-day>", Classifier{okData = ClassData{prior = 0.0, unseen = -3.58351893845611, likelihoods = HashMap.fromList [("<time-of-day> o'clock", -1.4759065198095778), ("time-of-day (latent)", -1.4759065198095778), ("quarter after|past <integer> (hour-of-day)", -2.8622008809294686), ("hour", -0.8472978603872037), ("minute", -2.8622008809294686)], n = 15}, koData = ClassData{prior = -infinity, unseen = -1.791759469228055, likelihoods = HashMap.fromList [], n = 0}}), ("time-of-day (latent)", Classifier{okData = ClassData{prior = -0.24946085963158313, unseen = -4.1588830833596715, likelihoods = HashMap.fromList [("integer (numeric)", -0.2113090936672069), ("integer (0..19)", -1.7452394535931621)], n = 60}, koData = ClassData{prior = -1.5105920777974677, unseen = -3.044522437723423, likelihoods = HashMap.fromList [("integer (numeric)", -0.35667494393873245), ("integer (0..19)", -1.6094379124341003), ("couple", -2.3025850929940455)], n = 17}}), ("year", Classifier{okData = ClassData{prior = -0.1823215567939546, unseen = -3.295836866004329, likelihoods = HashMap.fromList [("integer (numeric)", 0.0)], n = 25}, koData = ClassData{prior = -1.791759469228055, unseen = -1.9459101490553135, likelihoods = HashMap.fromList [("integer (numeric)", 0.0)], n = 5}}), ("last <day-of-week> of <time>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.3978952727983707, likelihoods = HashMap.fromList [("daymonth", -0.916290731874155), ("sundayMarch", -1.6094379124341003), ("mondayMarch", -1.6094379124341003), ("sundayintersect", -1.6094379124341003)], n = 3}, koData = ClassData{prior = -infinity, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [], n = 0}}), ("<integer> <unit-of-duration>", Classifier{okData = ClassData{prior = -1.207415148516909, unseen = -4.406719247264253, likelihoods = HashMap.fromList [("week", -2.315007612992603), ("integer (0..19)year (grain)", -3.295836866004329), ("integer (numeric)day (grain)", -2.7850112422383386), ("couplehour (grain)", -3.7013019741124937), ("integer (0..19)second (grain) ", -3.7013019741124937), ("integer (0..19)hour (grain)", -3.0081547935525483), ("second", -3.7013019741124937), ("integer (numeric)year (grain)", -3.7013019741124937), ("day", -2.7850112422383386), ("year", -3.0081547935525483), ("integer (numeric)week (grain)", -3.295836866004329), ("integer (0..19)month (grain)", -3.7013019741124937), ("hour", -2.6026896854443837), ("month", -3.7013019741124937), ("integer (numeric)minute (grain)", -2.4485390056171257), ("integer (0..19)minute (grain)", -3.295836866004329), ("minute", -2.1972245773362196), ("integer (numeric)hour (grain)", -3.7013019741124937), ("integer (0..19)week (grain)", -2.6026896854443837)], n = 29}, koData = ClassData{prior = -0.3552032733272762, unseen = -5.075173815233827, likelihoods = HashMap.fromList [("week", -3.6826098411003407), ("integer (0..19)year (grain)", -3.970291913552122), ("integer (numeric)day (grain)", -3.6826098411003407), ("integer (0..19)second (grain) ", -4.375757021660286), ("integer (0..19)hour (grain)", -2.871679624884012), ("second", -3.6826098411003407), ("integer (numeric)second (grain) ", -3.970291913552122), ("integer (numeric)year (grain)", -3.970291913552122), ("day", -3.2771447329921766), ("year", -3.459466289786131), ("integer (numeric)week (grain)", -3.970291913552122), ("integer (0..19)month (grain)", -3.970291913552122), ("hour", -1.2402628057311365), ("month", -3.459466289786131), ("integer (numeric)minute (grain)", -3.970291913552122), ("integer (0..19)minute (grain)", -3.970291913552122), ("integer (numeric)month (grain)", -3.970291913552122), ("minute", -3.459466289786131), ("coupleday (grain)", -4.375757021660286), ("integer (numeric)hour (grain)", -1.4313180424938456), ("integer (0..19)day (grain)", -4.375757021660286), ("integer (0..19)week (grain)", -4.375757021660286)], n = 68}}), ("ordinals (first..19th)", Classifier{okData = ClassData{prior = 0.0, unseen = -2.3978952727983707, likelihoods = HashMap.fromList [("", 0.0)], n = 9}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("<time-of-day> am|pm", Classifier{okData = ClassData{prior = 0.0, unseen = -2.4849066497880004, likelihoods = HashMap.fromList [("time-of-day (latent)", -1.7047480922384253), ("hh:mm", -1.7047480922384253), ("until <time-of-day>", -1.7047480922384253), ("hour", -1.2992829841302609), ("minute", -1.7047480922384253)], n = 3}, koData = ClassData{prior = -infinity, unseen = -1.791759469228055, likelihoods = HashMap.fromList [], n = 0}}), ("<duration> after <time>", Classifier{okData = ClassData{prior = 0.0, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [("yearday", -0.6931471805599453), ("<integer> <unit-of-duration>Kerstmis", -0.6931471805599453)], n = 1}, koData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}}), ("today/tomorrow/yesterday afternoon", Classifier{okData = ClassData{prior = 0.0, unseen = -2.0794415416798357, likelihoods = HashMap.fromList [("", 0.0)], n = 6}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("hh:mm", Classifier{okData = ClassData{prior = 0.0, unseen = -3.6888794541139363, likelihoods = HashMap.fromList [("", 0.0)], n = 38}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("quarter after|past <integer> (hour-of-day)", Classifier{okData = ClassData{prior = 0.0, unseen = -2.3025850929940455, likelihoods = HashMap.fromList [("<time-of-day> o'clock", -1.5040773967762742), ("time-of-day (latent)", -1.0986122886681098), ("hour", -0.8109302162163288)], n = 3}, koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}), ("<duration> before <time>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.1972245773362196, likelihoods = HashMap.fromList [("minuteminute", -1.3862943611198906), ("<integer> <unit-of-duration>time-of-day (latent)", -1.3862943611198906), ("minutehour", -1.3862943611198906), ("<integer> <unit-of-duration>half to|till|before <integer> (hour-of-day)", -1.3862943611198906)], n = 2}, koData = ClassData{prior = -infinity, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [], n = 0}}), ("quarter of an hour", Classifier{okData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}, koData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("intersect by ','", Classifier{okData = ClassData{prior = -8.701137698962981e-2, unseen = -3.5553480614894135, likelihoods = HashMap.fromList [("wednesday<day-of-month> (non ordinal) <named-month>", -2.833213344056216), ("friday<day-of-month> (non ordinal) <named-month>", -2.833213344056216), ("dayday", -1.128465251817791), ("dayyear", -2.833213344056216), ("fridaydd/mm", -2.4277482359480516), ("fridaydd/mm/yyyy", -2.4277482359480516), ("fridayintersect", -2.833213344056216), ("sunday<named-month> <day-of-month> (non ordinal)", -2.833213344056216), ("monday<day-of-month> (non ordinal) <named-month>", -2.4277482359480516), ("<named-month> <day-of-month> (non ordinal)year", -2.833213344056216)], n = 11}, koData = ClassData{prior = -2.4849066497880004, unseen = -2.70805020110221, likelihoods = HashMap.fromList [("daymonth", -1.9459101490553135), ("sundayFebruary", -1.9459101490553135)], n = 1}}), ("second (grain) ", Classifier{okData = ClassData{prior = 0.0, unseen = -1.791759469228055, likelihoods = HashMap.fromList [("", 0.0)], n = 4}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("last <time>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.3025850929940455, likelihoods = HashMap.fromList [("day", -0.8109302162163288), ("sunday", -1.5040773967762742), ("tuesday", -1.0986122886681098)], n = 3}, koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}), ("EOM|End of month", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("March", Classifier{okData = ClassData{prior = 0.0, unseen = -2.1972245773362196, likelihoods = HashMap.fromList [("", 0.0)], n = 7}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("<day-of-month> (ordinal)", Classifier{okData = ClassData{prior = -1.2809338454620642, unseen = -2.0794415416798357, likelihoods = HashMap.fromList [("ordinals (first..19th)", -0.8472978603872037), ("ordinal (digits)", -0.5596157879354228)], n = 5}, koData = ClassData{prior = -0.325422400434628, unseen = -2.772588722239781, likelihoods = HashMap.fromList [("ordinals (first..19th)", -0.6286086594223742), ("ordinal (digits)", -0.7621400520468967)], n = 13}}), ("Valentijnsdag", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("until <time-of-day>", Classifier{okData = ClassData{prior = -0.40546510810816444, unseen = -3.7376696182833684, likelihoods = HashMap.fromList [("<time> <part-of-day>", -2.327277705584417), ("<time-of-day> o'clock", -2.1041341542702074), ("time-of-day (latent)", -1.9218125974762528), ("<time-of-day> am|pm", -3.0204248861443626), ("EOM|End of month", -3.0204248861443626), ("hour", -1.074514737089049), ("month", -3.0204248861443626)], n = 14}, koData = ClassData{prior = -1.0986122886681098, unseen = -3.332204510175204, likelihoods = HashMap.fromList [("dd/mm", -2.6026896854443837), ("dd/mm/yyyy", -2.6026896854443837), ("half to|till|before <integer> (hour-of-day)", -2.1972245773362196), ("day", -2.1972245773362196), ("hh:mm", -1.9095425048844386), ("minute", -1.5040773967762742)], n = 7}}), ("after <duration>", Classifier{okData = ClassData{prior = -0.10536051565782628, unseen = -3.258096538021482, likelihoods = HashMap.fromList [("week", -2.120263536200091), ("second", -2.5257286443082556), ("day", -2.5257286443082556), ("<integer> <unit-of-duration>", -1.0216512475319814), ("hour", -1.8325814637483102), ("minute", -2.120263536200091), ("<integer> kwartier", -2.5257286443082556)], n = 9}, koData = ClassData{prior = -2.3025850929940455, unseen = -2.3025850929940455, likelihoods = HashMap.fromList [("<integer> <unit-of-duration>", -1.5040773967762742), ("hour", -1.5040773967762742)], n = 1}}), ("evening", Classifier{okData = ClassData{prior = 0.0, unseen = -1.9459101490553135, likelihoods = HashMap.fromList [("", 0.0)], n = 5}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("decimal number", Classifier{okData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}, koData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("<time-of-day> until", Classifier{okData = ClassData{prior = 0.0, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [("<time-of-day> o'clock", -0.6931471805599453), ("hour", -0.6931471805599453)], n = 1}, koData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}}), ("next <time>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.639057329615259, likelihoods = HashMap.fromList [("wednesday", -1.8718021769015913), ("monday", -1.466337068793427), ("day", -1.1786549963416462), ("hour", -1.8718021769015913), ("week-end", -1.8718021769015913)], n = 4}, koData = ClassData{prior = -infinity, unseen = -1.791759469228055, likelihoods = HashMap.fromList [], n = 0}}), ("last <cycle>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.70805020110221, likelihoods = HashMap.fromList [("week", -1.540445040947149), ("month (grain)", -1.9459101490553135), ("year (grain)", -1.9459101490553135), ("week (grain)", -1.540445040947149), ("year", -1.9459101490553135), ("month", -1.9459101490553135)], n = 4}, koData = ClassData{prior = -infinity, unseen = -1.9459101490553135, likelihoods = HashMap.fromList [], n = 0}}), ("Sinterklaas", Classifier{okData = ClassData{prior = 0.0, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [("", 0.0)], n = 3}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("next n <cycle>", Classifier{okData = ClassData{prior = 0.0, unseen = -3.828641396489095, likelihoods = HashMap.fromList [("week", -3.1135153092103742), ("integer (0..19)year (grain)", -3.1135153092103742), ("integer (numeric)day (grain)", -3.1135153092103742), ("integer (0..19)second (grain) ", -3.1135153092103742), ("second", -3.1135153092103742), ("integer (numeric)year (grain)", -3.1135153092103742), ("day", -2.4203681286504293), ("year", -2.70805020110221), ("integer (numeric)week (grain)", -3.1135153092103742), ("integer (0..19)month (grain)", -3.1135153092103742), ("hour", -2.70805020110221), ("month", -2.70805020110221), ("integer (numeric)minute (grain)", -3.1135153092103742), ("integer (0..19)minute (grain)", -3.1135153092103742), ("integer (numeric)month (grain)", -3.1135153092103742), ("minute", -2.70805020110221), ("coupleday (grain)", -3.1135153092103742), ("integer (numeric)hour (grain)", -2.70805020110221), ("integer (0..19)day (grain)", -3.1135153092103742)], n = 13}, koData = ClassData{prior = -infinity, unseen = -2.995732273553991, likelihoods = HashMap.fromList [], n = 0}}), ("tuesday", Classifier{okData = ClassData{prior = 0.0, unseen = -2.4849066497880004, likelihoods = HashMap.fromList [("", 0.0)], n = 10}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("about|exactly <duration>", Classifier{okData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}, koData = ClassData{prior = 0.0, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [("<integer> <unit-of-duration>", -0.6931471805599453), ("hour", -0.6931471805599453)], n = 1}}), ("Koningsdag", Classifier{okData = ClassData{prior = 0.0, unseen = -2.3025850929940455, likelihoods = HashMap.fromList [("", 0.0)], n = 8}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("in <duration>", Classifier{okData = ClassData{prior = -4.652001563489282e-2, unseen = -3.970291913552122, likelihoods = HashMap.fromList [("week", -2.5649493574615367), ("second", -3.258096538021482), ("number,number uur", -3.258096538021482), ("day", -2.8526314299133175), ("year", -3.258096538021482), ("<integer> <unit-of-duration>", -1.006804739414987), ("hour", -2.159484249353372), ("<integer> and an half hour", -3.258096538021482), ("minute", -1.6486586255873816), ("<integer> kwartier", -3.258096538021482)], n = 21}, koData = ClassData{prior = -3.0910424533583156, unseen = -2.5649493574615367, likelihoods = HashMap.fromList [("<integer> <unit-of-duration>", -1.791759469228055), ("hour", -1.791759469228055)], n = 1}}), ("<datetime> - <datetime> (interval)", Classifier{okData = ClassData{prior = -0.2076393647782445, unseen = -3.6375861597263857, likelihoods = HashMap.fromList [("intersecthh:mm", -2.001480000210124), ("on <date>hh:mm", -2.917770732084279), ("at <time-of-day>hh:mm", -2.917770732084279), ("minuteminute", -1.213022639845854), ("hh:mmhh:mm", -2.001480000210124), ("dayday", -2.2246235515243336), ("<named-month> <day-of-month> (non ordinal)<named-month> <day-of-month> (non ordinal)", -2.512305623976115), ("dd/mmdd/mm", -2.917770732084279)], n = 13}, koData = ClassData{prior = -1.6739764335716716, unseen = -2.890371757896165, likelihoods = HashMap.fromList [("<named-month> <day-of-month> (non ordinal)July", -2.1400661634962708), ("daymonth", -1.7346010553881064), ("minuteminute", -2.1400661634962708), ("hh:mmhh:mm", -2.1400661634962708), ("<named-month> <day-of-month> (non ordinal)August", -2.1400661634962708)], n = 3}}), ("<integer> and an half hour", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("integer (0..19)", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("relative minutes to|till|before|after <integer> (time-of-day)", Classifier{okData = ClassData{prior = 0.0, unseen = -2.4849066497880004, likelihoods = HashMap.fromList [("hour", -1.2992829841302609), ("integer (numeric)half to|till|before <integer> (hour-of-day)", -1.7047480922384253), ("integer (numeric)time-of-day (latent)", -1.7047480922384253), ("integer (20..90)time-of-day (latent)", -1.7047480922384253), ("minute", -1.7047480922384253)], n = 3}, koData = ClassData{prior = -infinity, unseen = -1.791759469228055, likelihoods = HashMap.fromList [], n = 0}}), ("<time-of-day> - <time-of-day> (interval)", Classifier{okData = ClassData{prior = -0.3746934494414107, unseen = -3.367295829986474, likelihoods = HashMap.fromList [("hh:mmtime-of-day (latent)", -1.7227665977411035), ("at <time-of-day>hh:mm", -2.639057329615259), ("minuteminute", -1.3862943611198906), ("hh:mmhh:mm", -1.540445040947149), ("minutehour", -1.540445040947149), ("at <time-of-day>time-of-day (latent)", -2.639057329615259)], n = 11}, koData = ClassData{prior = -1.1631508098056809, unseen = -2.833213344056216, likelihoods = HashMap.fromList [("hh:mmtime-of-day (latent)", -1.3862943611198906), ("minuteminute", -1.6739764335716716), ("hh:mmhh:mm", -1.6739764335716716), ("minutehour", -1.3862943611198906)], n = 5}}), ("winter", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("last n <cycle>", Classifier{okData = ClassData{prior = 0.0, unseen = -3.713572066704308, likelihoods = HashMap.fromList [("week", -2.5902671654458267), ("integer (0..19)year (grain)", -2.995732273553991), ("integer (numeric)day (grain)", -2.5902671654458267), ("second", -2.5902671654458267), ("integer (numeric)second (grain) ", -2.5902671654458267), ("integer (numeric)year (grain)", -2.995732273553991), ("day", -2.5902671654458267), ("year", -2.5902671654458267), ("integer (numeric)week (grain)", -2.995732273553991), ("integer (0..19)month (grain)", -2.995732273553991), ("month", -2.5902671654458267), ("integer (numeric)minute (grain)", -2.995732273553991), ("integer (0..19)minute (grain)", -2.995732273553991), ("integer (numeric)month (grain)", -2.995732273553991), ("minute", -2.5902671654458267), ("integer (0..19)week (grain)", -2.995732273553991)], n = 12}, koData = ClassData{prior = -infinity, unseen = -2.833213344056216, likelihoods = HashMap.fromList [], n = 0}}), ("nth <time> after <time>", Classifier{okData = ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055, likelihoods = HashMap.fromList [("dayday", -0.916290731874155), ("ordinals (first..19th)tuesdayintersect", -0.916290731874155)], n = 1}, koData = ClassData{prior = -0.6931471805599453, unseen = -1.791759469228055, likelihoods = HashMap.fromList [("dayday", -0.916290731874155), ("ordinals (first..19th)tuesdayKerstmis", -0.916290731874155)], n = 1}}), ("<named-month> <day-of-month> (non ordinal)", Classifier{okData = ClassData{prior = 0.0, unseen = -3.1780538303479458, likelihoods = HashMap.fromList [("Augustinteger (numeric)", -1.749199854809259), ("Aprilinteger (numeric)", -2.4423470353692043), ("month", -0.832909122935104), ("Februaryinteger (numeric)", -1.749199854809259), ("Julyinteger (numeric)", -2.03688192726104)], n = 9}, koData = ClassData{prior = -infinity, unseen = -1.791759469228055, likelihoods = HashMap.fromList [], n = 0}}), ("<day-of-month> (non ordinal) <named-month>", Classifier{okData = ClassData{prior = -0.2578291093020998, unseen = -3.7612001156935624, likelihoods = HashMap.fromList [("integer (numeric)September", -2.639057329615259), ("integer (numeric)April", -2.639057329615259), ("integer (numeric)August", -3.044522437723423), ("integer (numeric)February", -1.6582280766035324), ("month", -0.8472978603872037), ("integer (numeric)July", -2.639057329615259), ("integer (numeric)March", -2.3513752571634776)], n = 17}, koData = ClassData{prior = -1.4816045409242156, unseen = -2.9444389791664407, likelihoods = HashMap.fromList [("month", -1.0986122886681098), ("integer (numeric)October", -2.1972245773362196), ("integer (numeric)July", -1.2809338454620642)], n = 5}}), ("this|next <day-of-week>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.639057329615259, likelihoods = HashMap.fromList [("wednesday", -1.8718021769015913), ("monday", -0.9555114450274363), ("day", -0.7731898882334817)], n = 5}, koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}), ("<time-of-day> after", Classifier{okData = ClassData{prior = 0.0, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [("<time-of-day> o'clock", -0.6931471805599453), ("hour", -0.6931471805599453)], n = 1}, koData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}}), ("ordinal (digits)", Classifier{okData = ClassData{prior = -0.8109302162163288, unseen = -1.791759469228055, likelihoods = HashMap.fromList [("", 0.0)], n = 4}, koData = ClassData{prior = -0.587786664902119, unseen = -1.9459101490553135, likelihoods = HashMap.fromList [("", 0.0)], n = 5}}), ("quarter (grain)", Classifier{okData = ClassData{prior = 0.0, unseen = -1.791759469228055, likelihoods = HashMap.fromList [("", 0.0)], n = 4}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("last <cycle> of <time>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.70805020110221, likelihoods = HashMap.fromList [("day (grain)October", -1.9459101490553135), ("daymonth", -1.540445040947149), ("day (grain)intersect", -1.9459101490553135), ("weekmonth", -1.540445040947149), ("week (grain)intersect", -1.9459101490553135), ("week (grain)September", -1.9459101490553135)], n = 4}, koData = ClassData{prior = -infinity, unseen = -1.9459101490553135, likelihoods = HashMap.fromList [], n = 0}}), ("<day-of-month>(ordinal) <named-month> year", Classifier{okData = ClassData{prior = 0.0, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [("ordinal (digits)July", -0.6931471805599453), ("month", -0.6931471805599453)], n = 1}, koData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}}), ("morning", Classifier{okData = ClassData{prior = 0.0, unseen = -2.5649493574615367, likelihoods = HashMap.fromList [("", 0.0)], n = 11}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("week-end", Classifier{okData = ClassData{prior = 0.0, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [("", 0.0)], n = 2}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("Oudjaar", Classifier{okData = ClassData{prior = 0.0, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [("", 0.0)], n = 2}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("after <time-of-day>", Classifier{okData = ClassData{prior = -0.587786664902119, unseen = -2.995732273553991, likelihoods = HashMap.fromList [("at <time-of-day>", -1.845826690498331), ("<time-of-day> o'clock", -1.845826690498331), ("time-of-day (latent)", -2.2512917986064953), ("hour", -1.1526795099383855)], n = 5}, koData = ClassData{prior = -0.8109302162163288, unseen = -2.890371757896165, likelihoods = HashMap.fromList [("Kerstmis", -1.7346010553881064), ("intersect", -2.1400661634962708), ("day", -1.4469189829363254), ("hh:mm", -2.1400661634962708), ("minute", -2.1400661634962708)], n = 4}}), ("day (grain)", Classifier{okData = ClassData{prior = 0.0, unseen = -2.639057329615259, likelihoods = HashMap.fromList [("", 0.0)], n = 12}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("Moederdag", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("<month> dd-dd (interval)", Classifier{okData = ClassData{prior = 0.0, unseen = -2.639057329615259, likelihoods = HashMap.fromList [("October", -1.8718021769015913), ("July", -0.9555114450274363), ("month", -0.7731898882334817)], n = 5}, koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}), ("composite <duration>", Classifier{okData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}, koData = ClassData{prior = 0.0, unseen = -1.9459101490553135, likelihoods = HashMap.fromList [("integer (numeric)hour (grain)<integer> + '\"", -0.6931471805599453), ("hourminute", -0.6931471805599453)], n = 2}}), ("summer", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("<hour-of-day> <integer> (as relative minutes)", Classifier{okData = ClassData{prior = 0.0, unseen = -2.890371757896165, likelihoods = HashMap.fromList [("hour", -0.7537718023763802), ("at <time-of-day>integer (numeric)", -2.1400661634962708), ("<time-of-day> o'clockinteger (numeric)", -0.8873031950009028)], n = 7}, koData = ClassData{prior = -infinity, unseen = -1.3862943611198906, likelihoods = HashMap.fromList [], n = 0}}), ("<integer> kwartier", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("integer (0..19)", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("this <time>", Classifier{okData = ClassData{prior = 0.0, unseen = -2.4849066497880004, likelihoods = HashMap.fromList [("day", -1.2992829841302609), ("hour", -1.7047480922384253), ("winter", -1.7047480922384253), ("week-end", -1.7047480922384253), ("summer", -1.7047480922384253)], n = 3}, koData = ClassData{prior = -infinity, unseen = -1.791759469228055, likelihoods = HashMap.fromList [], n = 0}}), ("within <duration>", Classifier{okData = ClassData{prior = 0.0, unseen = -1.6094379124341003, likelihoods = HashMap.fromList [("week", -0.6931471805599453), ("<integer> <unit-of-duration>", -0.6931471805599453)], n = 1}, koData = ClassData{prior = -infinity, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [], n = 0}}), ("before yesterday", Classifier{okData = ClassData{prior = 0.0, unseen = -1.0986122886681098, likelihoods = HashMap.fromList [("", 0.0)], n = 1}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), ("August", Classifier{okData = ClassData{prior = 0.0, unseen = -1.791759469228055, likelihoods = HashMap.fromList [("", 0.0)], n = 4}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}})]
facebookincubator/duckling
Duckling/Ranking/Classifiers/NL_XX.hs
bsd-3-clause
110,957
0
15
53,565
19,751
12,303
7,448
1,770
1
module Text.Html.Entity.Data where import Data.Map (Map) import qualified Data.Map as M import Data.Set (Set) import qualified Data.Set as S import Data.Text (Text, pack) entityMap :: Map Text [Int] entitySet :: Set Text entityMap = M.fromList [(pack "&intlarhk;", [10775]), (pack "&male;", [9794]), (pack "&not;", [172]), (pack "&clubs;", [9827]), (pack "&cudarrl;", [10552]), (pack "&IJlig;", [306]), (pack "&rdldhar;", [10601]), (pack "&Zcaron;", [381]), (pack "&Lcedil;", [315]), (pack "&ltrif;", [9666]), (pack "&subE;", [10949]), (pack "&prcue;", [8828]), (pack "&NotGreaterSlantEqual;", [10878, 824]), (pack "&nharr;", [8622]), (pack "&nsupe;", [8841]), (pack "&searrow;", [8600]), (pack "&siml;", [10909]), (pack "&ocy;", [1086]), (pack "&varpropto;", [8733]), (pack "&mp;", [8723]), (pack "&jcirc;", [309]), (pack "&AMP", [38]), (pack "&gesdoto;", [10882]), (pack "&upsi;", [965]), (pack "&lstrok;", [322]), (pack "&triangleleft;", [9667]), (pack "&aacute;", [225]), (pack "&PrecedesEqual;", [10927]), (pack "&ges;", [10878]), (pack "&half;", [189]), (pack "&fopf;", [120151]), (pack "&divide;", [247]), (pack "&bprime;", [8245]), (pack "&Jcirc;", [308]), (pack "&NotTilde;", [8769]), (pack "&Qscr;", [119980]), (pack "&nsupE;", [10950, 824]), (pack "&hercon;", [8889]), (pack "&Ocy;", [1054]), (pack "&emsp13;", [8196]), (pack "&tbrk;", [9140]), (pack "&gjcy;", [1107]), (pack "&vArr;", [8661]), (pack "&NotCupCap;", [8813]), (pack "&varepsilon;", [1013]), (pack "&DownArrow;", [8595]), (pack "&amp", [38]), (pack "&rsaquo;", [8250]), (pack "&downarrow;", [8595]), (pack "&wedbar;", [10847]), (pack "&csub;", [10959]), (pack "&ascr;", [119990]), (pack "&nlsim;", [8820]), (pack "&olt;", [10688]), (pack "&preccurlyeq;", [8828]), (pack "&LeftUpTeeVector;", [10592]), (pack "&nhpar;", [10994]), (pack "&rlarr;", [8644]), (pack "&wr;", [8768]), (pack "&ni;", [8715]), (pack "&leqq;", [8806]), (pack "&Kfr;", [120078]), (pack "&rarrlp;", [8620]), (pack "&epsi;", [949]), (pack "&Ascr;", [119964]), (pack "&diamondsuit;", [9830]), (pack "&zcaron;", [382]), (pack "&lcedil;", [316]), (pack "&Ccedil", [199]), (pack "&leftrightsquigarrow;", [8621]), (pack "&vsubne;", [8842, 65024]), (pack "&hearts;", [9829]), (pack "&block;", [9608]), (pack "&natural;", [9838]), (pack "&Vopf;", [120141]), (pack "&Bernoullis;", [8492]), (pack "&GJcy;", [1027]), (pack "&bsim;", [8765]), (pack "&ijlig;", [307]), (pack "&angsph;", [8738]), (pack "&Otimes;", [10807]), (pack "&seswar;", [10537]), (pack "&Ograve", [210]), (pack "&sup2", [178]), (pack "&maltese;", [10016]), (pack "&xoplus;", [10753]), (pack "&Not;", [10988]), (pack "&eqslantgtr;", [10902]), (pack "&prnap;", [10937]), (pack "&NotTildeTilde;", [8777]), (pack "&sce;", [10928]), (pack "&lceil;", [8968]), (pack "&DownRightVector;", [8641]), (pack "&notinvc;", [8950]), (pack "&qscr;", [120006]), (pack "&sube;", [8838]), (pack "&range;", [10661]), (pack "&frac18;", [8539]), (pack "&lagran;", [8466]), (pack "&conint;", [8750]), (pack "&kfr;", [120104]), (pack "&scE;", [10932]), (pack "&NotLeftTriangleBar;", [10703, 824]), (pack "&ccedil", [231]), (pack "&RightCeiling;", [8969]), (pack "&Fopf;", [120125]), (pack "&Aacute;", [193]), (pack "&awconint;", [8755]), (pack "&vsubnE;", [10955, 65024]), (pack "&Upsi;", [978]), (pack "&NotGreaterGreater;", [8811, 824]), (pack "&Lstrok;", [321]), (pack "&cuepr;", [8926]), (pack "&NotExists;", [8708]), (pack "&DoubleUpArrow;", [8657]), (pack "&planck;", [8463]), (pack "&varr;", [8597]), (pack "&Conint;", [8751]), (pack "&precneqq;", [10933]), (pack "&xdtri;", [9661]), (pack "&SquareSubset;", [8847]), (pack "&VerticalSeparator;", [10072]), (pack "&nvap;", [8781, 8402]), (pack "&ocir;", [8858]), (pack "&lesges;", [10899]), (pack "&vopf;", [120167]), (pack "&gtcc;", [10919]), (pack "&ograve", [242]), (pack "&nhArr;", [8654]), (pack "&lesg;", [8922, 65024]), (pack "&triplus;", [10809]), (pack "&DiacriticalAcute;", [180]), (pack "&succsim;", [8831]), (pack "&NotHumpEqual;", [8783, 824]), (pack "&otimes;", [8855]), (pack "&Downarrow;", [8659]), (pack "&utri;", [9653]), (pack "&primes;", [8473]), (pack "&smile;", [8995]), (pack "&OElig;", [338]), (pack "&Scaron;", [352]), (pack "&Dcy;", [1044]), (pack "&ouml", [246]), (pack "&ac;", [8766]), (pack "&dwangle;", [10662]), (pack "&propto;", [8733]), (pack "&Vvdash;", [8874]), (pack "&Ucirc;", [219]), (pack "&aleph;", [8501]), (pack "&zeetrf;", [8488]), (pack "&ecirc;", [234]), (pack "&ImaginaryI;", [8520]), (pack "&ApplyFunction;", [8289]), (pack "&Yacute", [221]), (pack "&ang;", [8736]), (pack "&hfr;", [120101]), (pack "&topbot;", [9014]), (pack "&digamma;", [989]), (pack "&lessgtr;", [8822]), (pack "&iacute", [237]), (pack "&yen;", [165]), (pack "&IOcy;", [1025]), (pack "&ffllig;", [64260]), (pack "&drcrop;", [8972]), (pack "&csube;", [10961]), (pack "&solb;", [10692]), (pack "&NJcy;", [1034]), (pack "&lmoust;", [9136]), (pack "&agrave;", [224]), (pack "&jmath;", [567]), (pack "&quot", [34]), (pack "&spar;", [8741]), (pack "&strns;", [175]), (pack "&sext;", [10038]), (pack "&rarrhk;", [8618]), (pack "&eqvparsl;", [10725]), (pack "&Ecirc;", [202]), (pack "&Hfr;", [8460]), (pack "&gE;", [8807]), (pack "&nleftarrow;", [8602]), (pack "&mumap;", [8888]), (pack "&Otilde", [213]), (pack "&copf;", [120148]), (pack "&frac35;", [8535]), (pack "&Dscr;", [119967]), (pack "&eDDot;", [10871]), (pack "&udhar;", [10606]), (pack "&utdot;", [8944]), (pack "&iiota;", [8489]), (pack "&Tscr;", [119983]), (pack "&ast;", [42]), (pack "&nmid;", [8740]), (pack "&OpenCurlyDoubleQuote;", [8220]), (pack "&hookrightarrow;", [8618]), (pack "&Sopf;", [120138]), (pack "&trisb;", [10701]), (pack "&ssetmn;", [8726]), (pack "&uhblk;", [9600]), (pack "&emsp14;", [8197]), (pack "&Copf;", [8450]), (pack "&aring", [229]), (pack "&Tcy;", [1058]), (pack "&xfr;", [120117]), (pack "&submult;", [10945]), (pack "&bsime;", [8909]), (pack "&scaron;", [353]), (pack "&notnivb;", [8958]), (pack "&orarr;", [8635]), (pack "&micro;", [181]), (pack "&LongLeftRightArrow;", [10231]), (pack "&fork;", [8916]), (pack "&blacksquare;", [9642]), (pack "&COPY", [169]), (pack "&ccaron;", [269]), (pack "&yacute", [253]), (pack "&acute;", [180]), (pack "&congdot;", [10861]), (pack "&QUOT", [34]), (pack "&Aring", [197]), (pack "&thksim;", [8764]), (pack "&LessLess;", [10913]), (pack "&leg;", [8922]), (pack "&ldca;", [10550]), (pack "&gsim;", [8819]), (pack "&Xfr;", [120091]), (pack "&Jsercy;", [1032]), (pack "&sup3", [179]), (pack "&angmsdag;", [10670]), (pack "&gvnE;", [8809, 65024]), (pack "&dscr;", [119993]), (pack "&Ccaron;", [268]), (pack "&otilde", [245]), (pack "&minus;", [8722]), (pack "&CirclePlus;", [8853]), (pack "&tscr;", [120009]), (pack "&apid;", [8779]), (pack "&njcy;", [1114]), (pack "&NotLeftTriangle;", [8938]), (pack "&timesb;", [8864]), (pack "&sopf;", [120164]), (pack "&eta;", [951]), (pack "&straightepsilon;", [1013]), (pack "&sqsubseteq;", [8849]), (pack "&Ouml", [214]), (pack "&iocy;", [1105]), (pack "&DoubleVerticalBar;", [8741]), (pack "&tcy;", [1090]), (pack "&longleftrightarrow;", [10231]), (pack "&xwedge;", [8896]), (pack "&simlE;", [10911]), (pack "&copy", [169]), (pack "&xvee;", [8897]), (pack "&Iacute", [205]), (pack "&harrw;", [8621]), (pack "&Agrave;", [192]), (pack "&precnapprox;", [10937]), (pack "&THORN", [222]), (pack "&rsqb;", [93]), (pack "&Eta;", [919]), (pack "&midcir;", [10992]), (pack "&oelig;", [339]), (pack "&numero;", [8470]), (pack "&capcup;", [10823]), (pack "&rightthreetimes;", [8908]), (pack "&Cayleys;", [8493]), (pack "&middot", [183]), (pack "&nLeftarrow;", [8653]), (pack "&Longleftrightarrow;", [10234]), (pack "&bsemi;", [8271]), (pack "&ge;", [8805]), (pack "&minusd;", [8760]), (pack "&gap;", [10886]), (pack "&isins;", [8948]), (pack "&nedot;", [8784, 824]), (pack "&risingdotseq;", [8787]), (pack "&LeftUpVectorBar;", [10584]), (pack "&cedil", [184]), (pack "&NotTildeFullEqual;", [8775]), (pack "&thorn", [254]), (pack "&thkap;", [8776]), (pack "&DiacriticalGrave;", [96]), (pack "&jsercy;", [1112]), (pack "&xsqcup;", [10758]), (pack "&RightArrowBar;", [8677]), (pack "&twixt;", [8812]), (pack "&nvlt;", [60, 8402]), (pack "&dcy;", [1076]), (pack "&rsquor;", [8217]), (pack "&acd;", [8767]), (pack "&ucirc;", [251]), (pack "&lEg;", [10891]), (pack "&Dcaron;", [270]), (pack "&Gammad;", [988]), (pack "&NotDoubleVerticalBar;", [8742]), (pack "&hArr;", [8660]), (pack "&nsccue;", [8929]), (pack "&udblac;", [369]), (pack "&imof;", [8887]), (pack "&timesbar;", [10801]), (pack "&nges;", [10878, 824]), (pack "&Hopf;", [8461]), (pack "&blacktriangleright;", [9656]), (pack "&Auml;", [196]), (pack "&imped;", [437]), (pack "&ggg;", [8921]), (pack "&rcedil;", [343]), (pack "&leftthreetimes;", [8907]), (pack "&lE;", [8806]), (pack "&SHcy;", [1064]), (pack "&Gscr;", [119970]), (pack "&xopf;", [120169]), (pack "&equest;", [8799]), (pack "&frac38;", [8540]), (pack "&scnE;", [10934]), (pack "&gacute;", [501]), (pack "&pi;", [960]), (pack "&chcy;", [1095]), (pack "&frac12;", [189]), (pack "&prnsim;", [8936]), (pack "&curren;", [164]), (pack "&Afr;", [120068]), (pack "&Udblac;", [368]), (pack "&swarrow;", [8601]), (pack "&squf;", [9642]), (pack "&Acy;", [1040]), (pack "&vprop;", [8733]), (pack "&Rcedil;", [342]), (pack "&acirc", [226]), (pack "&Xopf;", [120143]), (pack "&larrpl;", [10553]), (pack "&curlyvee;", [8910]), (pack "&NotRightTriangleEqual;", [8941]), (pack "&wscr;", [120012]), (pack "&brvbar;", [166]), (pack "&lbbrk;", [10098]), (pack "&sup1;", [185]), (pack "&supdot;", [10942]), (pack "&Acirc", [194]), (pack "&UpperRightArrow;", [8599]), (pack "&CloseCurlyQuote;", [8217]), (pack "&boxH;", [9552]), (pack "&macr;", [175]), (pack "&sqsupe;", [8850]), (pack "&nvsim;", [8764, 8402]), (pack "&ordf;", [170]), (pack "&rrarr;", [8649]), (pack "&gammad;", [989]), (pack "&subne;", [8842]), (pack "&Wscr;", [119986]), (pack "&hopf;", [120153]), (pack "&dcaron;", [271]), (pack "&andd;", [10844]), (pack "&raquo", [187]), (pack "&cupdot;", [8845]), (pack "&plusmn;", [177]), (pack "&Mellintrf;", [8499]), (pack "&RBarr;", [10512]), (pack "&top;", [8868]), (pack "&Ntilde", [209]), (pack "&auml;", [228]), (pack "&Qfr;", [120084]), (pack "&plussim;", [10790]), (pack "&gscr;", [8458]), (pack "&Itilde;", [296]), (pack "&flat;", [9837]), (pack "&solbar;", [9023]), (pack "&lsaquo;", [8249]), (pack "&ssmile;", [8995]), (pack "&RightArrowLeftArrow;", [8644]), (pack "&afr;", [120094]), (pack "&SupersetEqual;", [8839]), (pack "&lneqq;", [8808]), (pack "&rBarr;", [10511]), (pack "&acy;", [1072]), (pack "&parallel;", [8741]), (pack "&mldr;", [8230]), (pack "&simgE;", [10912]), (pack "&shcy;", [1096]), (pack "&caron;", [711]), (pack "&CHcy;", [1063]), (pack "&LT", [60]), (pack "&rhard;", [8641]), (pack "&intcal;", [8890]), (pack "&oline;", [8254]), (pack "&ncong;", [8775]), (pack "&lHar;", [10594]), (pack "&PartialD;", [8706]), (pack "&le;", [8804]), (pack "&SucceedsEqual;", [10928]), (pack "&Pi;", [928]), (pack "&subnE;", [10955]), (pack "&par;", [8741]), (pack "&nless;", [8814]), (pack "&lparlt;", [10643]), (pack "&qfr;", [120110]), (pack "&lbrace;", [123]), (pack "&circledcirc;", [8858]), (pack "&npre;", [10927, 824]), (pack "&curlywedge;", [8911]), (pack "&tshcy;", [1115]), (pack "&ntilde", [241]), (pack "&tcaron;", [357]), (pack "&harr;", [8596]), (pack "&upsih;", [978]), (pack "&bigtriangleup;", [9651]), (pack "&ufisht;", [10622]), (pack "&lt", [60]), (pack "&itilde;", [297]), (pack "&bemptyv;", [10672]), (pack "&gesles;", [10900]), (pack "&ominus;", [8854]), (pack "&planckh;", [8462]), (pack "&toea;", [10536]), (pack "&dharr;", [8642]), (pack "&Tcaron;", [356]), (pack "&supsim;", [10952]), (pack "&boxh;", [9472]), (pack "&div;", [247]), (pack "&TSHcy;", [1035]), (pack "&nap;", [8777]), (pack "&rbarr;", [10509]), (pack "&isindot;", [8949]), (pack "&veeeq;", [8794]), (pack "&Laplacetrf;", [8466]), (pack "&gtdot;", [8919]), (pack "&ordm;", [186]), (pack "&AElig;", [198]), (pack "&pr;", [8826]), (pack "&Vcy;", [1042]), (pack "&tau;", [964]), (pack "&rightsquigarrow;", [8605]), (pack "&rppolint;", [10770]), (pack "&models;", [8871]), (pack "&angmsdaa;", [10664]), (pack "&pitchfork;", [8916]), (pack "&bsolhsub;", [10184]), (pack "&kcedil;", [311]), (pack "&DoubleLeftTee;", [10980]), (pack "&NotSucceedsTilde;", [8831, 824]), (pack "&rarrw;", [8605]), (pack "&ultri;", [9720]), (pack "&DDotrahd;", [10513]), (pack "&curren", [164]), (pack "&timesd;", [10800]), (pack "&doublebarwedge;", [8966]), (pack "&simrarr;", [10610]), (pack "&Vfr;", [120089]), (pack "&frac12", [189]), (pack "&laemptyv;", [10676]), (pack "&nltrie;", [8940]), (pack "&Kcedil;", [310]), (pack "&dlcrop;", [8973]), (pack "&plusmn", [177]), (pack "&auml", [228]), (pack "&Pr;", [10939]), (pack "&uml;", [168]), (pack "&Uparrow;", [8657]), (pack "&Ocirc;", [212]), (pack "&notinvb;", [8951]), (pack "&dagger;", [8224]), (pack "&Vdashl;", [10982]), (pack "&boxUR;", [9562]), (pack "&NotPrecedes;", [8832]), (pack "&dlcorn;", [8990]), (pack "&rarrfs;", [10526]), (pack "&Eopf;", [120124]), (pack "&malt;", [10016]), (pack "&percnt;", [37]), (pack "&delta;", [948]), (pack "&brvbar", [166]), (pack "&boxUr;", [9561]), (pack "&leq;", [8804]), (pack "&minusb;", [8863]), (pack "&Proportion;", [8759]), (pack "&qprime;", [8279]), (pack "&subsup;", [10963]), (pack "&lharul;", [10602]), (pack "&uopf;", [120166]), (pack "&rdca;", [10551]), (pack "&angrtvbd;", [10653]), (pack "&cir;", [9675]), (pack "&nwarr;", [8598]), (pack "&semi;", [59]), (pack "&Map;", [10501]), (pack "&para;", [182]), (pack "&RightTriangleEqual;", [8885]), (pack "&parsim;", [10995]), (pack "&upuparrows;", [8648]), (pack "&Uopf;", [120140]), (pack "&boxur;", [9492]), (pack "&ReverseElement;", [8715]), (pack "&lsqb;", [91]), (pack "&Zacute;", [377]), (pack "&vfr;", [120115]), (pack "&jscr;", [119999]), (pack "&varpi;", [982]), (pack "&ncap;", [10819]), (pack "&Lleftarrow;", [8666]), (pack "&boxuR;", [9560]), (pack "&iiiint;", [10764]), (pack "&macr", [175]), (pack "&lsime;", [10893]), (pack "&backprime;", [8245]), (pack "&ocirc;", [244]), (pack "&UpArrow;", [8593]), (pack "&bigcap;", [8898]), (pack "&Im;", [8465]), (pack "&uparrow;", [8593]), (pack "&rtrie;", [8885]), (pack "&scpolint;", [10771]), (pack "&sup1", [185]), (pack "&NotPrecedesSlantEqual;", [8928]), (pack "&supmult;", [10946]), (pack "&Jscr;", [119973]), (pack "&tilde;", [732]), (pack "&eopf;", [120150]), (pack "&LeftVector;", [8636]), (pack "&fcy;", [1092]), (pack "&dblac;", [733]), (pack "&nshortmid;", [8740]), (pack "&lfloor;", [8970]), (pack "&Tau;", [932]), (pack "&ffr;", [120099]), (pack "&nwArr;", [8662]), (pack "&NotLessTilde;", [8820]), (pack "&map;", [8614]), (pack "&rangd;", [10642]), (pack "&nis;", [8956]), (pack "&Tilde;", [8764]), (pack "&starf;", [9733]), (pack "&Fcy;", [1060]), (pack "&aelig;", [230]), (pack "&notin;", [8713]), (pack "&NegativeThinSpace;", [8203]), (pack "&Auml", [196]), (pack "&isinE;", [8953]), (pack "&lAarr;", [8666]), (pack "&zscr;", [120015]), (pack "&Dagger;", [8225]), (pack "&midast;", [42]), (pack "&LeftTriangleBar;", [10703]), (pack "&Ffr;", [120073]), (pack "&curvearrowright;", [8631]), (pack "&uharl;", [8639]), (pack "&quest;", [63]), (pack "&Delta;", [916]), (pack "&naturals;", [8469]), (pack "&gtrdot;", [8919]), (pack "&ddagger;", [8225]), (pack "&zacute;", [378]), (pack "&bigodot;", [10752]), (pack "&ordf", [170]), (pack "&succapprox;", [10936]), (pack "&ogt;", [10689]), (pack "&nLl;", [8920, 824]), (pack "&vcy;", [1074]), (pack "&OverBracket;", [9140]), (pack "&DiacriticalDot;", [729]), (pack "&Zscr;", [119989]), (pack "&frac14;", [188]), (pack "&boxplus;", [8862]), (pack "&RoundImplies;", [10608]), (pack "&bopf;", [120147]), (pack "&boxvr;", [9500]), (pack "&notindot;", [8949, 824]), (pack "&LessTilde;", [8818]), (pack "&lrhar;", [8651]), (pack "&Wfr;", [120090]), (pack "&cupor;", [10821]), (pack "&Ropf;", [8477]), (pack "&eqcirc;", [8790]), (pack "&lozf;", [10731]), (pack "&SucceedsSlantEqual;", [8829]), (pack "&scy;", [1089]), (pack "&llhard;", [10603]), (pack "&Bopf;", [120121]), (pack "&mscr;", [120002]), (pack "&ne;", [8800]), (pack "&NotGreater;", [8815]), (pack "&reg", [174]), (pack "&nlarr;", [8602]), (pack "&rpar;", [41]), (pack "&Int;", [8748]), (pack "&eacute;", [233]), (pack "&odsold;", [10684]), (pack "&uacute;", [250]), (pack "&Scy;", [1057]), (pack "&pound", [163]), (pack "&gfr;", [120100]), (pack "&ltri;", [9667]), (pack "&Hstrok;", [294]), (pack "&rlm;", [8207]), (pack "&dscy;", [1109]), (pack "&ofcir;", [10687]), (pack "&quaternions;", [8461]), (pack "&demptyv;", [10673]), (pack "&tscy;", [1094]), (pack "&bigcirc;", [9711]), (pack "&checkmark;", [10003]), (pack "&UpTee;", [8869]), (pack "&ReverseUpEquilibrium;", [10607]), (pack "&boxVr;", [9567]), (pack "&rArr;", [8658]), (pack "&loplus;", [10797]), (pack "&odash;", [8861]), (pack "&imath;", [305]), (pack "&Uacute;", [218]), (pack "&RightDoubleBracket;", [10215]), (pack "&luruhar;", [10598]), (pack "&NotSubsetEqual;", [8840]), (pack "&rdquor;", [8221]), (pack "&circledS;", [9416]), (pack "&shy", [173]), (pack "&nwnear;", [10535]), (pack "&caps;", [8745, 65024]), (pack "&nparallel;", [8742]), (pack "&LeftArrowRightArrow;", [8646]), (pack "&laquo", [171]), (pack "&ropf;", [120163]), (pack "&capand;", [10820]), (pack "&lap;", [10885]), (pack "&cong;", [8773]), (pack "&profalar;", [9006]), (pack "&nRightarrow;", [8655]), (pack "&circlearrowright;", [8635]), (pack "&boxVR;", [9568]), (pack "&scnap;", [10938]), (pack "&Nu;", [925]), (pack "&target;", [8982]), (pack "&nlArr;", [8653]), (pack "&ffilig;", [64259]), (pack "&REG", [174]), (pack "&int;", [8747]), (pack "&lmidot;", [320]), (pack "&sqsube;", [8849]), (pack "&sqcups;", [8852, 65024]), (pack "&NotHumpDownHump;", [8782, 824]), (pack "&nGtv;", [8811, 824]), (pack "&veebar;", [8891]), (pack "&orv;", [10843]), (pack "&prsim;", [8830]), (pack "&hstrok;", [295]), (pack "&lessapprox;", [10885]), (pack "&DotEqual;", [8784]), (pack "&OverBrace;", [9182]), (pack "&Lmidot;", [319]), (pack "&bot;", [8869]), (pack "&awint;", [10769]), (pack "&emsp;", [8195]), (pack "&emptyv;", [8709]), (pack "&rarr;", [8594]), (pack "&frac58;", [8541]), (pack "&Mscr;", [8499]), (pack "&prop;", [8733]), (pack "&thickapprox;", [8776]), (pack "&Eacute;", [201]), (pack "&DScy;", [1029]), (pack "&upharpoonleft;", [8639]), (pack "&tint;", [8749]), (pack "&times", [215]), (pack "&Rarr;", [8608]), (pack "&boxvR;", [9566]), (pack "&wfr;", [120116]), (pack "&RightUpVectorBar;", [10580]), (pack "&rangle;", [10217]), (pack "&nu;", [957]), (pack "&nrightarrow;", [8603]), (pack "&TScy;", [1062]), (pack "&rightleftarrows;", [8644]), (pack "&nrtri;", [8939]), (pack "&euro;", [8364]), (pack "&Gfr;", [120074]), (pack "&RightDownVector;", [8642]), (pack "&lnsim;", [8934]), (pack "&dotminus;", [8760]), (pack "&rbrace;", [125]), (pack "&nprec;", [8832]), (pack "&diamond;", [8900]), (pack "&ycirc;", [375]), (pack "&nequiv;", [8802]), (pack "&srarr;", [8594]), (pack "&sqsupset;", [8848]), (pack "&neArr;", [8663]), (pack "&LeftCeiling;", [8968]), (pack "&real;", [8476]), (pack "&phone;", [9742]), (pack "&nsc;", [8833]), (pack "&Star;", [8902]), (pack "&eacute", [233]), (pack "&doteqdot;", [8785]), (pack "&NotSquareSubset;", [8847, 824]), (pack "&gtreqless;", [8923]), (pack "&gtlPar;", [10645]), (pack "&dfr;", [120097]), (pack "&HumpDownHump;", [8782]), (pack "&backsimeq;", [8909]), (pack "&frac14", [188]), (pack "&capcap;", [10827]), (pack "&NotSucceeds;", [8833]), (pack "&NotLessSlantEqual;", [10877, 824]), (pack "&curarrm;", [10556]), (pack "&crarr;", [8629]), (pack "&ensp;", [8194]), (pack "&Cross;", [10799]), (pack "&pscr;", [120005]), (pack "&MinusPlus;", [8723]), (pack "&varkappa;", [1008]), (pack "&blk34;", [9619]), (pack "&Dfr;", [120071]), (pack "&vartriangleleft;", [8882]), (pack "&dd;", [8518]), (pack "&infin;", [8734]), (pack "&circleddash;", [8861]), (pack "&amalg;", [10815]), (pack "&lesdoto;", [10881]), (pack "&Ll;", [8920]), (pack "&Oopf;", [120134]), (pack "&larrbfs;", [10527]), (pack "&gnE;", [8809]), (pack "&xutri;", [9651]), (pack "&Imacr;", [298]), (pack "&subsub;", [10965]), (pack "&cuvee;", [8910]), (pack "&Cconint;", [8752]), (pack "&tfr;", [120113]), (pack "&Therefore;", [8756]), (pack "&star;", [9734]), (pack "&CloseCurlyDoubleQuote;", [8221]), (pack "&icirc;", [238]), (pack "&DoubleLongRightArrow;", [10233]), (pack "&angmsdac;", [10666]), (pack "&TildeTilde;", [8776]), (pack "&gnap;", [10890]), (pack "&nesim;", [8770, 824]), (pack "&raemptyv;", [10675]), (pack "&NotLess;", [8814]), (pack "&odot;", [8857]), (pack "&ltrie;", [8884]), (pack "&Ugrave;", [217]), (pack "&cupbrcap;", [10824]), (pack "&ntriangleright;", [8939]), (pack "&NotGreaterFullEqual;", [8807, 824]), (pack "&NotLeftTriangleEqual;", [8940]), (pack "&PlusMinus;", [177]), (pack "&Uacute", [218]), (pack "&udarr;", [8645]), (pack "&daleth;", [8504]), (pack "&egsdot;", [10904]), (pack "&rbrksld;", [10638]), (pack "&larrfs;", [10525]), (pack "&drcorn;", [8991]), (pack "&cross;", [10007]), (pack "&smt;", [10922]), (pack "&Tfr;", [120087]), (pack "&Icirc;", [206]), (pack "&rharul;", [10604]), (pack "&Ycirc;", [374]), (pack "&ulcorner;", [8988]), (pack "&Diamond;", [8900]), (pack "&rAarr;", [8667]), (pack "&origof;", [8886]), (pack "&les;", [10877]), (pack "&ll;", [8810]), (pack "&CenterDot;", [183]), (pack "&Eacute", [201]), (pack "&nearr;", [8599]), (pack "&oopf;", [120160]), (pack "&ENG;", [330]), (pack "&between;", [8812]), (pack "&aogon;", [261]), (pack "&DoubleDot;", [168]), (pack "&bump;", [8782]), (pack "&gne;", [10888]), (pack "&swarhk;", [10534]), (pack "&DD;", [8517]), (pack "&thinsp;", [8201]), (pack "&rarrap;", [10613]), (pack "&vangrt;", [10652]), (pack "&imacr;", [299]), (pack "&opar;", [10679]), (pack "&robrk;", [10215]), (pack "&eng;", [331]), (pack "&therefore;", [8756]), (pack "&rarrsim;", [10612]), (pack "&NotSucceedsSlantEqual;", [8929]), (pack "&egrave;", [232]), (pack "&Aogon;", [260]), (pack "&hksearow;", [10533]), (pack "&RightTee;", [8866]), (pack "&Pscr;", [119979]), (pack "&Hacek;", [711]), (pack "&uacute", [250]), (pack "&ugrave;", [249]), (pack "&preceq;", [10927]), (pack "&triangle;", [9653]), (pack "&blk12;", [9618]), (pack "&nvge;", [8805, 8402]), (pack "&ohbar;", [10677]), (pack "&gnsim;", [8935]), (pack "&vellip;", [8942]), (pack "&check;", [10003]), (pack "&lsimg;", [10895]), (pack "&NotSuperset;", [8835, 8402]), (pack "&Egrave;", [200]), (pack "&ZeroWidthSpace;", [8203]), (pack "&capbrcup;", [10825]), (pack "&centerdot;", [183]), (pack "&nrtrie;", [8941]), (pack "&phi;", [966]), (pack "&vBar;", [10984]), (pack "&isin;", [8712]), (pack "&gt;", [62]), (pack "&cularr;", [8630]), (pack "&numsp;", [8199]), (pack "&Euml;", [203]), (pack "&zigrarr;", [8669]), (pack "&Sscr;", [119982]), (pack "&boxvh;", [9532]), (pack "&angmsdaf;", [10669]), (pack "&ltdot;", [8918]), (pack "&hairsp;", [8202]), (pack "&cscr;", [119992]), (pack "&angst;", [197]), (pack "&boxDr;", [9555]), (pack "&iff;", [8660]), (pack "&Gt;", [8811]), (pack "&ucy;", [1091]), (pack "&darr;", [8595]), (pack "&xharr;", [10231]), (pack "&gneq;", [10888]), (pack "&boxdr;", [9484]), (pack "&ddarr;", [8650]), (pack "&ldquor;", [8222]), (pack "&gtrapprox;", [10886]), (pack "&Cscr;", [119966]), (pack "&frac34;", [190]), (pack "&dArr;", [8659]), (pack "&Ucy;", [1059]), (pack "&xhArr;", [10234]), (pack "&Iota;", [921]), (pack "&GT;", [62]), (pack "&thetasym;", [977]), (pack "&minusdu;", [10794]), (pack "&Vbar;", [10987]), (pack "&triangleq;", [8796]), (pack "&mapstoup;", [8613]), (pack "&Utilde;", [360]), (pack "&Lambda;", [923]), (pack "&Igrave", [204]), (pack "&boxdR;", [9554]), (pack "&Poincareplane;", [8460]), (pack "&lmoustache;", [9136]), (pack "&prime;", [8242]), (pack "&NotEqualTilde;", [8770, 824]), (pack "&frac45;", [8536]), (pack "&CircleDot;", [8857]), (pack "&sung;", [9834]), (pack "&nsqsube;", [8930]), (pack "&precnsim;", [8936]), (pack "&vartheta;", [977]), (pack "&euml;", [235]), (pack "&sscr;", [120008]), (pack "&nbsp;", [160]), (pack "&Mfr;", [120080]), (pack "&omicron;", [959]), (pack "&bigotimes;", [10754]), (pack "&Iukcy;", [1030]), (pack "&OpenCurlyQuote;", [8216]), (pack "&Omega;", [937]), (pack "&Tab;", [9]), (pack "&NotSquareSuperset;", [8848, 824]), (pack "&profsurf;", [8979]), (pack "&nshortparallel;", [8742]), (pack "&sigma;", [963]), (pack "&disin;", [8946]), (pack "&compfn;", [8728]), (pack "&deg", [176]), (pack "&NotElement;", [8713]), (pack "&dzigrarr;", [10239]), (pack "&Ecy;", [1069]), (pack "&ubrcy;", [1118]), (pack "&boxVh;", [9579]), (pack "&acE;", [8766, 819]), (pack "&nvHarr;", [10500]), (pack "&Omicron;", [927]), (pack "&piv;", [982]), (pack "&boxVH;", [9580]), (pack "&triminus;", [10810]), (pack "&Square;", [9633]), (pack "&Abreve;", [258]), (pack "&Sigma;", [931]), (pack "&tprime;", [8244]), (pack "&ldquo;", [8220]), (pack "&cwconint;", [8754]), (pack "&GreaterLess;", [8823]), (pack "&ulcorn;", [8988]), (pack "&UnderBar;", [95]), (pack "&glj;", [10916]), (pack "&Ubrcy;", [1038]), (pack "&ltlarr;", [10614]), (pack "&larrtl;", [8610]), (pack "&iota;", [953]), (pack "&bigoplus;", [10753]), (pack "&cirscir;", [10690]), (pack "&lvnE;", [8808, 65024]), (pack "&Phi;", [934]), (pack "&esdot;", [8784]), (pack "&frac78;", [8542]), (pack "&DownRightTeeVector;", [10591]), (pack "&utilde;", [361]), (pack "&LeftTriangleEqual;", [8884]), (pack "&lambda;", [955]), (pack "&ThinSpace;", [8201]), (pack "&DifferentialD;", [8518]), (pack "&iquest;", [191]), (pack "&comp;", [8705]), (pack "&igrave", [236]), (pack "&LeftUpDownVector;", [10577]), (pack "&langle;", [10216]), (pack "&nvle;", [8804, 8402]), (pack "&setmn;", [8726]), (pack "&UpArrowBar;", [10514]), (pack "&capdot;", [10816]), (pack "&mfr;", [120106]), (pack "&topf;", [120165]), (pack "&llarr;", [8647]), (pack "&NestedLessLess;", [8810]), (pack "&LeftVectorBar;", [10578]), (pack "&leftrightarrows;", [8646]), (pack "&PrecedesSlantEqual;", [8828]), (pack "&iukcy;", [1110]), (pack "&PrecedesTilde;", [8830]), (pack "&omega;", [969]), (pack "&Darr;", [8609]), (pack "&nltri;", [8938]), (pack "&ecy;", [1101]), (pack "&dopf;", [120149]), (pack "&ange;", [10660]), (pack "&uuml;", [252]), (pack "&iiint;", [8749]), (pack "&ulcrop;", [8975]), (pack "&gsime;", [10894]), (pack "&scnsim;", [8937]), (pack "&ecir;", [8790]), (pack "&Topf;", [120139]), (pack "&lsim;", [8818]), (pack "&notnivc;", [8957]), (pack "&rtri;", [9657]), (pack "&Prime;", [8243]), (pack "&Dopf;", [120123]), (pack "&InvisibleTimes;", [8290]), (pack "&szlig;", [223]), (pack "&boxDR;", [9556]), (pack "&square;", [9633]), (pack "&boxvH;", [9578]), (pack "&Uuml;", [220]), (pack "&abreve;", [259]), (pack "&qopf;", [120162]), (pack "&RightVectorBar;", [10579]), (pack "&equiv;", [8801]), (pack "&pound;", [163]), (pack "&uArr;", [8657]), (pack "&NotNestedGreaterGreater;", [10914, 824]), (pack "&Leftrightarrow;", [8660]), (pack "&prec;", [8826]), (pack "&rbrke;", [10636]), (pack "&rsquo;", [8217]), (pack "&nsup;", [8837]), (pack "&realine;", [8475]), (pack "&mid;", [8739]), (pack "&yacy;", [1103]), (pack "&bigwedge;", [8896]), (pack "&DiacriticalDoubleAcute;", [733]), (pack "&blacktriangleleft;", [9666]), (pack "&Edot;", [278]), (pack "&ee;", [8519]), (pack "&ddotseq;", [10871]), (pack "&csupe;", [10962]), (pack "&slarr;", [8592]), (pack "&Rang;", [10219]), (pack "&roarr;", [8702]), (pack "&subplus;", [10943]), (pack "&dzcy;", [1119]), (pack "&backcong;", [8780]), (pack "&Qopf;", [8474]), (pack "&dsol;", [10742]), (pack "&spades;", [9824]), (pack "&Ccirc;", [264]), (pack "&bsolb;", [10693]), (pack "&approxeq;", [8778]), (pack "&nearrow;", [8599]), (pack "&boxbox;", [10697]), (pack "&nacute;", [324]), (pack "&zcy;", [1079]), (pack "&DJcy;", [1026]), (pack "&Uarr;", [8607]), (pack "&easter;", [10862]), (pack "&hellip;", [8230]), (pack "&DoubleDownArrow;", [8659]), (pack "&epar;", [8917]), (pack "&backsim;", [8765]), (pack "&fscr;", [119995]), (pack "&hybull;", [8259]), (pack "&aopf;", [120146]), (pack "&there4;", [8756]), (pack "&sol;", [47]), (pack "&scirc;", [349]), (pack "&YAcy;", [1071]), (pack "&zhcy;", [1078]), (pack "&vscr;", [120011]), (pack "&npolint;", [10772]), (pack "&oint;", [8750]), (pack "&varnothing;", [8709]), (pack "&Zcy;", [1047]), (pack "&TRADE;", [8482]), (pack "&UnderParenthesis;", [9181]), (pack "&Fscr;", [8497]), (pack "&ETH", [208]), (pack "&Rfr;", [8476]), (pack "&napprox;", [8777]), (pack "&leftrightarrow;", [8596]), (pack "&gla;", [10917]), (pack "&nesear;", [10536]), (pack "&sub;", [8834]), (pack "&edot;", [279]), (pack "&Updownarrow;", [8661]), (pack "&rang;", [10217]), (pack "&Aopf;", [120120]), (pack "&UpDownArrow;", [8597]), (pack "&trade;", [8482]), (pack "&Vscr;", [119985]), (pack "&GreaterEqual;", [8805]), (pack "&bnequiv;", [8801, 8421]), (pack "&omacr;", [333]), (pack "&varsupsetneqq;", [10956, 65024]), (pack "&sc;", [8827]), (pack "&eth", [240]), (pack "&SuchThat;", [8715]), (pack "&ndash;", [8211]), (pack "&lsquor;", [8218]), (pack "&mapstodown;", [8615]), (pack "&LeftRightVector;", [10574]), (pack "&gtrsim;", [8819]), (pack "&Sqrt;", [8730]), (pack "&ReverseEquilibrium;", [8651]), (pack "&rthree;", [8908]), (pack "&ccirc;", [265]), (pack "&circledR;", [174]), (pack "&Omacr;", [332]), (pack "&frac15;", [8533]), (pack "&ZHcy;", [1046]), (pack "&supseteq;", [8839]), (pack "&els;", [10901]), (pack "&suphsol;", [10185]), (pack "&simne;", [8774]), (pack "&duarr;", [8693]), (pack "&Sub;", [8912]), (pack "&DZcy;", [1039]), (pack "&laquo;", [171]), (pack "&xnis;", [8955]), (pack "&Sc;", [10940]), (pack "&chi;", [967]), (pack "&UpperLeftArrow;", [8598]), (pack "&NotCongruent;", [8802]), (pack "&lescc;", [10920]), (pack "&SquareSupersetEqual;", [8850]), (pack "&urcorner;", [8989]), (pack "&shy;", [173]), (pack "&angrtvb;", [8894]), (pack "&SubsetEqual;", [8838]), (pack "&xmap;", [10236]), (pack "&uarr;", [8593]), (pack "&jcy;", [1081]), (pack "&djcy;", [1106]), (pack "&suphsub;", [10967]), (pack "&dollar;", [36]), (pack "&mlcp;", [10971]), (pack "&DownLeftTeeVector;", [10590]), (pack "&bfr;", [120095]), (pack "&SquareUnion;", [8852]), (pack "&LeftRightArrow;", [8596]), (pack "&Jcy;", [1049]), (pack "&lesseqgtr;", [8922]), (pack "&bigcup;", [8899]), (pack "&REG;", [174]), (pack "&beta;", [946]), (pack "&Chi;", [935]), (pack "&bbrktbrk;", [9142]), (pack "&rfr;", [120111]), (pack "&nsubseteq;", [8840]), (pack "&UpTeeArrow;", [8613]), (pack "&rnmid;", [10990]), (pack "&NotNestedLessLess;", [10913, 824]), (pack "&lfisht;", [10620]), (pack "&times;", [215]), (pack "&Nacute;", [323]), (pack "&Bfr;", [120069]), (pack "&excl;", [33]), (pack "&ncup;", [10818]), (pack "&DownBreve;", [785]), (pack "&eDot;", [8785]), (pack "&nsucceq;", [10928, 824]), (pack "&rect;", [9645]), (pack "&ropar;", [10630]), (pack "&mcomma;", [10793]), (pack "&updownarrow;", [8597]), (pack "&reg;", [174]), (pack "&blank;", [9251]), (pack "&Beta;", [914]), (pack "&bowtie;", [8904]), (pack "&NotRightTriangleBar;", [10704, 824]), (pack "&napid;", [8779, 824]), (pack "&Scirc;", [348]), (pack "&rcaron;", [345]), (pack "&Dstrok;", [272]), (pack "&boxdL;", [9557]), (pack "&Re;", [8476]), (pack "&middot;", [183]), (pack "&nGt;", [8811, 8402]), (pack "&nbumpe;", [8783, 824]), (pack "&nopf;", [120159]), (pack "&tstrok;", [359]), (pack "&Gcy;", [1043]), (pack "&Rrightarrow;", [8667]), (pack "&coloneq;", [8788]), (pack "&iacute;", [237]), (pack "&DownArrowUpArrow;", [8693]), (pack "&scsim;", [8831]), (pack "&profline;", [8978]), (pack "&angmsdah;", [10671]), (pack "&DoubleUpDownArrow;", [8661]), (pack "&Nopf;", [8469]), (pack "&yacute;", [253]), (pack "&loz;", [9674]), (pack "&angzarr;", [9084]), (pack "&Aring;", [197]), (pack "&Rcaron;", [344]), (pack "&COPY;", [169]), (pack "&nvrArr;", [10499]), (pack "&simeq;", [8771]), (pack "&LessSlantEqual;", [10877]), (pack "&ngeq;", [8817]), (pack "&zdot;", [380]), (pack "&empty;", [8709]), (pack "&Cfr;", [8493]), (pack "&eqcolon;", [8789]), (pack "&aelig", [230]), (pack "&straightphi;", [981]), (pack "&lrm;", [8206]), (pack "&QUOT;", [34]), (pack "&alefsym;", [8501]), (pack "&lates;", [10925, 65024]), (pack "&race;", [8765, 817]), (pack "&Iacute;", [205]), (pack "&Tstrok;", [358]), (pack "&THORN;", [222]), (pack "&otilde;", [245]), (pack "&prod;", [8719]), (pack "&smid;", [8739]), (pack "&DoubleContourIntegral;", [8751]), (pack "&lat;", [10923]), (pack "&rdsh;", [8627]), (pack "&thorn;", [254]), (pack "&commat;", [64]), (pack "&andv;", [10842]), (pack "&tosa;", [10537]), (pack "&ldrdhar;", [10599]), (pack "&lg;", [8822]), (pack "&cedil;", [184]), (pack "&ntrianglelefteq;", [8940]), (pack "&eparsl;", [10723]), (pack "&Intersection;", [8898]), (pack "&urcrop;", [8974]), (pack "&swArr;", [8665]), (pack "&rightharpoondown;", [8641]), (pack "&SucceedsTilde;", [8831]), (pack "&hbar;", [8463]), (pack "&Otilde;", [213]), (pack "&dstrok;", [273]), (pack "&diam;", [8900]), (pack "&xrArr;", [10233]), (pack "&quot;", [34]), (pack "&DoubleRightTee;", [8872]), (pack "&osol;", [8856]), (pack "&supne;", [8843]), (pack "&ngt;", [8815]), (pack "&latail;", [10521]), (pack "&rightarrowtail;", [8611]), (pack "&vartriangleright;", [8883]), (pack "&equals;", [61]), (pack "&rmoustache;", [9137]), (pack "&Succeeds;", [8827]), (pack "&Sfr;", [120086]), (pack "&lbrkslu;", [10637]), (pack "&sup3;", [179]), (pack "&cfr;", [120096]), (pack "&xrarr;", [10230]), (pack "&RightVector;", [8640]), (pack "&dtrif;", [9662]), (pack "&RightTeeArrow;", [8614]), (pack "&Yscr;", [119988]), (pack "&aring;", [229]), (pack "&image;", [8465]), (pack "&supnE;", [10956]), (pack "&subsim;", [10951]), (pack "&swarr;", [8601]), (pack "&elsdot;", [10903]), (pack "&iscr;", [119998]), (pack "&Ouml;", [214]), (pack "&para", [182]), (pack "&tcedil;", [355]), (pack "&Gbreve;", [286]), (pack "&precsim;", [8830]), (pack "&it;", [8290]), (pack "&becaus;", [8757]), (pack "&lotimes;", [10804]), (pack "&boxDL;", [9559]), (pack "&NotRightTriangle;", [8939]), (pack "&subsetneqq;", [10955]), (pack "&Iscr;", [8464]), (pack "&ThickSpace;", [8287, 8202]), (pack "&nsqsupe;", [8931]), (pack "&nlE;", [8806, 824]), (pack "&ocirc", [244]), (pack "&Tcedil;", [354]), (pack "&fltns;", [9649]), (pack "&egs;", [10902]), (pack "&Zdot;", [379]), (pack "&boxtimes;", [8864]), (pack "&LessGreater;", [8822]), (pack "&lAtail;", [10523]), (pack "&Yacute;", [221]), (pack "&napos;", [329]), (pack "&curlyeqprec;", [8926]), (pack "&olcross;", [10683]), (pack "&smeparsl;", [10724]), (pack "&biguplus;", [10756]), (pack "&ngtr;", [8815]), (pack "&cups;", [8746, 65024]), (pack "&Congruent;", [8801]), (pack "&GreaterFullEqual;", [8807]), (pack "&boxDl;", [9558]), (pack "&fnof;", [402]), (pack "&bull;", [8226]), (pack "&Barv;", [10983]), (pack "&rarrpl;", [10565]), (pack "&sfr;", [120112]), (pack "&uml", [168]), (pack "&Ocirc", [212]), (pack "&sqcaps;", [8851, 65024]), (pack "&or;", [8744]), (pack "&nle;", [8816]), (pack "&nexist;", [8708]), (pack "&doteq;", [8784]), (pack "&boxdl;", [9488]), (pack "&AElig", [198]), (pack "&Superset;", [8835]), (pack "&succcurlyeq;", [8829]), (pack "&npar;", [8742]), (pack "&subdot;", [10941]), (pack "&yscr;", [120014]), (pack "&copy;", [169]), (pack "&ordm", [186]), (pack "&gcy;", [1075]), (pack "&UnderBrace;", [9183]), (pack "&gbreve;", [287]), (pack "&Or;", [10836]), (pack "&ldrushar;", [10571]), (pack "&rlhar;", [8652]), (pack "&ouml;", [246]), (pack "&ruluhar;", [10600]), (pack "&succneqq;", [10934]), (pack "&longmapsto;", [10236]), (pack "&Emacr;", [274]), (pack "&nsub;", [8836]), (pack "&mDDot;", [8762]), (pack "&FilledSmallSquare;", [9724]), (pack "&LongLeftArrow;", [10229]), (pack "&Eogon;", [280]), (pack "&nrarrc;", [10547, 824]), (pack "&sdot;", [8901]), (pack "&nvinfin;", [10718]), (pack "&cupcap;", [10822]), (pack "&plus;", [43]), (pack "&NotVerticalBar;", [8740]), (pack "&circledast;", [8859]), (pack "&cirmid;", [10991]), (pack "&boxUl;", [9564]), (pack "&supset;", [8835]), (pack "&SHCHcy;", [1065]), (pack "&female;", [9792]), (pack "&LeftAngleBracket;", [10216]), (pack "&varsubsetneqq;", [10955, 65024]), (pack "&NewLine;", [10]), (pack "&sqcap;", [8851]), (pack "&lbrke;", [10635]), (pack "&xcap;", [8898]), (pack "&Sup;", [8913]), (pack "&umacr;", [363]), (pack "&leftharpoondown;", [8637]), (pack "&pfr;", [120109]), (pack "&lang;", [10216]), (pack "&approx;", [8776]), (pack "&Lscr;", [8466]), (pack "&Aacute", [193]), (pack "&nleftrightarrow;", [8622]), (pack "&complement;", [8705]), (pack "&lneq;", [10887]), (pack "&setminus;", [8726]), (pack "&NotGreaterLess;", [8825]), (pack "&uogon;", [371]), (pack "&bullet;", [8226]), (pack "&CupCap;", [8781]), (pack "&nvdash;", [8876]), (pack "&NotSquareSubsetEqual;", [8930]), (pack "&smashp;", [10803]), (pack "&Pfr;", [120083]), (pack "&GreaterTilde;", [8819]), (pack "&Umacr;", [362]), (pack "&Igrave;", [204]), (pack "&kopf;", [120156]), (pack "&NotSucceedsEqual;", [10928, 824]), (pack "&NonBreakingSpace;", [160]), (pack "&nLeftrightarrow;", [8654]), (pack "&varrho;", [1009]), (pack "&boxuL;", [9563]), (pack "&notni;", [8716]), (pack "&eg;", [10906]), (pack "&Lang;", [10218]), (pack "&nsucc;", [8833]), (pack "&cup;", [8746]), (pack "&questeq;", [8799]), (pack "&because;", [8757]), (pack "&Kopf;", [120130]), (pack "&Lcy;", [1051]), (pack "&shortmid;", [8739]), (pack "&Equal;", [10869]), (pack "&nvDash;", [8877]), (pack "&rfloor;", [8971]), (pack "&NotLessEqual;", [8816]), (pack "&boxUL;", [9565]), (pack "&gsiml;", [10896]), (pack "&cuwed;", [8911]), (pack "&Cup;", [8915]), (pack "&NotSupersetEqual;", [8841]), (pack "&late;", [10925]), (pack "&CircleMinus;", [8854]), (pack "&succnapprox;", [10938]), (pack "&Because;", [8757]), (pack "&cdot;", [267]), (pack "&xodot;", [10752]), (pack "&ic;", [8291]), (pack "&lacute;", [314]), (pack "&oror;", [10838]), (pack "&ccaps;", [10829]), (pack "&langd;", [10641]), (pack "&gEl;", [10892]), (pack "&sup;", [8835]), (pack "&uharr;", [8638]), (pack "&Backslash;", [8726]), (pack "&aacute", [225]), (pack "&longleftarrow;", [10229]), (pack "&circlearrowleft;", [8634]), (pack "&divide", [247]), (pack "&loarr;", [8701]), (pack "&RightFloor;", [8971]), (pack "&lscr;", [120001]), (pack "&angmsd;", [8737]), (pack "&nvltrie;", [8884, 8402]), (pack "&not", [172]), (pack "&igrave;", [236]), (pack "&lessdot;", [8918]), (pack "&Cdot;", [266]), (pack "&Lacute;", [313]), (pack "&gel;", [8923]), (pack "&leftarrowtail;", [8610]), (pack "&ShortLeftArrow;", [8592]), (pack "&homtht;", [8763]), (pack "&boxul;", [9496]), (pack "&drbkarow;", [10512]), (pack "&rightharpoonup;", [8640]), (pack "&Longleftarrow;", [10232]), (pack "&GreaterGreater;", [10914]), (pack "&tridot;", [9708]), (pack "&VerticalTilde;", [8768]), (pack "&Supset;", [8913]), (pack "&lcy;", [1083]), (pack "&urtri;", [9721]), (pack "&rtimes;", [8906]), (pack "&nVDash;", [8879]), (pack "&emacr;", [275]), (pack "&fflig;", [64256]), (pack "&frasl;", [8260]), (pack "&lgE;", [10897]), (pack "&orslope;", [10839]), (pack "&shchcy;", [1097]), (pack "&eogon;", [281]), (pack "&deg;", [176]), (pack "&nVdash;", [8878]), (pack "&Uogon;", [370]), (pack "&nLtv;", [8810, 824]), (pack "&nleqslant;", [10877, 824]), (pack "&nsubset;", [8834, 8402]), (pack "&ycy;", [1099]), (pack "&mdash;", [8212]), (pack "&Ugrave", [217]), (pack "&rightleftharpoons;", [8652]), (pack "&lcaron;", [318]), (pack "&LessEqualGreater;", [8922]), (pack "&geq;", [8805]), (pack "&Icy;", [1048]), (pack "&VeryThinSpace;", [8202]), (pack "&xlarr;", [10229]), (pack "&iuml;", [239]), (pack "&dHar;", [10597]), (pack "&egrave", [232]), (pack "&Kappa;", [922]), (pack "&nsce;", [10928, 824]), (pack "&zwj;", [8205]), (pack "&blacklozenge;", [10731]), (pack "&inodot;", [305]), (pack "&isinv;", [8712]), (pack "&phiv;", [981]), (pack "&vBarv;", [10985]), (pack "&Lcaron;", [317]), (pack "&rbrkslu;", [10640]), (pack "&lowbar;", [95]), (pack "&olcir;", [10686]), (pack "&prap;", [10935]), (pack "&ifr;", [120102]), (pack "&boxVl;", [9570]), (pack "&SquareSubsetEqual;", [8849]), (pack "&roplus;", [10798]), (pack "&bumpe;", [8783]), (pack "&icirc", [238]), (pack "&Iuml;", [207]), (pack "&af;", [8289]), (pack "&frac23;", [8532]), (pack "&frac56;", [8538]), (pack "&nprcue;", [8928]), (pack "&yfr;", [120118]), (pack "&barwed;", [8965]), (pack "&ubreve;", [365]), (pack "&Icirc", [206]), (pack "&rtrif;", [9656]), (pack "&DiacriticalTilde;", [732]), (pack "&boxVL;", [9571]), (pack "&Ifr;", [8465]), (pack "&eqslantless;", [10901]), (pack "&bumpE;", [10926]), (pack "&measuredangle;", [8737]), (pack "&Ubreve;", [364]), (pack "&blacktriangledown;", [9662]), (pack "&ugrave", [249]), (pack "&apos;", [39]), (pack "&circ;", [710]), (pack "&caret;", [8257]), (pack "&Barwed;", [8966]), (pack "&filig;", [64257]), (pack "&khcy;", [1093]), (pack "&sum;", [8721]), (pack "&eplus;", [10865]), (pack "&Precedes;", [8826]), (pack "&uwangle;", [10663]), (pack "&lnap;", [10889]), (pack "&lrhard;", [10605]), (pack "&rotimes;", [10805]), (pack "&boxminus;", [8863]), (pack "&NestedGreaterGreater;", [8811]), (pack "&rbrack;", [93]), (pack "&nvlArr;", [10498]), (pack "&trianglelefteq;", [8884]), (pack "&EmptySmallSquare;", [9723]), (pack "&lrcorner;", [8991]), (pack "&sigmaf;", [962]), (pack "&Sum;", [8721]), (pack "&bne;", [61, 8421]), (pack "&nsmid;", [8740]), (pack "&DoubleLongLeftArrow;", [10232]), (pack "&yuml;", [255]), (pack "&mapstoleft;", [8612]), (pack "&atilde;", [227]), (pack "&nvgt;", [62, 8402]), (pack "&RightAngleBracket;", [10217]), (pack "&blacktriangle;", [9652]), (pack "&Vert;", [8214]), (pack "&Xi;", [926]), (pack "&Oacute;", [211]), (pack "&lpar;", [40]), (pack "&integers;", [8484]), (pack "&smte;", [10924]), (pack "&vsupne;", [8843, 65024]), (pack "&Yuml;", [376]), (pack "&LeftDownVectorBar;", [10585]), (pack "&rho;", [961]), (pack "&KHcy;", [1061]), (pack "&smallsetminus;", [8726]), (pack "&nearhk;", [10532]), (pack "&Ycy;", [1067]), (pack "&xlArr;", [10232]), (pack "&imagpart;", [8465]), (pack "&oast;", [8859]), (pack "&Egrave", [200]), (pack "&gtcir;", [10874]), (pack "&Atilde;", [195]), (pack "&boxvL;", [9569]), (pack "&wp;", [8472]), (pack "&SmallCircle;", [8728]), (pack "&uplus;", [8846]), (pack "&in;", [8712]), (pack "&OverBar;", [8254]), (pack "&vsupnE;", [10956, 65024]), (pack "&UpEquilibrium;", [10606]), (pack "&larrlp;", [8619]), (pack "&emptyset;", [8709]), (pack "&NotReverseElement;", [8716]), (pack "&Rho;", [929]), (pack "&RightDownTeeVector;", [10589]), (pack "&oscr;", [8500]), (pack "&NotTildeEqual;", [8772]), (pack "&DoubleLeftRightArrow;", [8660]), (pack "&radic;", [8730]), (pack "&boxvl;", [9508]), (pack "&ell;", [8467]), (pack "&popf;", [120161]), (pack "&angmsdab;", [10665]), (pack "&bbrk;", [9141]), (pack "&sigmav;", [962]), (pack "&suplarr;", [10619]), (pack "&exist;", [8707]), (pack "&Yfr;", [120092]), (pack "&TripleDot;", [8411]), (pack "&pointint;", [10773]), (pack "&notinva;", [8713]), (pack "&sect;", [167]), (pack "&NotEqual;", [8800]), (pack "&phmmat;", [8499]), (pack "&csup;", [10960]), (pack "&VerticalBar;", [8739]), (pack "&gescc;", [10921]), (pack "&icy;", [1080]), (pack "&cwint;", [8753]), (pack "&oacute;", [243]), (pack "&xi;", [958]), (pack "&Oscr;", [119978]), (pack "&subrarr;", [10617]), (pack "&kappa;", [954]), (pack "&Popf;", [8473]), (pack "&vert;", [124]), (pack "&thetav;", [977]), (pack "&infintie;", [10717]), (pack "&Bumpeq;", [8782]), (pack "&upsilon;", [965]), (pack "&looparrowleft;", [8619]), (pack "&ovbar;", [9021]), (pack "&nlt;", [8814]), (pack "&Colone;", [10868]), (pack "&Atilde", [195]), (pack "&DownLeftVector;", [8637]), (pack "&efDot;", [8786]), (pack "&downharpoonleft;", [8643]), (pack "&lobrk;", [10214]), (pack "&bigtriangledown;", [9661]), (pack "&plustwo;", [10791]), (pack "&bigvee;", [8897]), (pack "&leqslant;", [10877]), (pack "&lowast;", [8727]), (pack "&yuml", [255]), (pack "&Ncy;", [1053]), (pack "&ntrianglerighteq;", [8941]), (pack "&YUcy;", [1070]), (pack "&nLt;", [8810, 8402]), (pack "&gtrarr;", [10616]), (pack "&bscr;", [119991]), (pack "&intercal;", [8890]), (pack "&gimel;", [8503]), (pack "&vzigzag;", [10650]), (pack "&downdownarrows;", [8650]), (pack "&ecaron;", [283]), (pack "&sqsubset;", [8847]), (pack "&Epsilon;", [917]), (pack "&incare;", [8453]), (pack "&nfr;", [120107]), (pack "&ecolon;", [8789]), (pack "&mapsto;", [8614]), (pack "&ccedil;", [231]), (pack "&iecy;", [1077]), (pack "&expectation;", [8496]), (pack "&exponentiale;", [8519]), (pack "&subsetneq;", [8842]), (pack "&diams;", [9830]), (pack "&scedil;", [351]), (pack "&rarrbfs;", [10528]), (pack "&Racute;", [340]), (pack "&Mopf;", [120132]), (pack "&gtrless;", [8823]), (pack "&OverParenthesis;", [9180]), (pack "&ngE;", [8807, 824]), (pack "&Ccedil;", [199]), (pack "&TildeEqual;", [8771]), (pack "&LeftDownTeeVector;", [10593]), (pack "&Gcirc;", [284]), (pack "&Dashv;", [10980]), (pack "&bumpeq;", [8783]), (pack "&hkswarow;", [10534]), (pack "&swnwar;", [10538]), (pack "&Jukcy;", [1028]), (pack "&colone;", [8788]), (pack "&atilde", [227]), (pack "&Oacute", [211]), (pack "&vnsub;", [8834, 8402]), (pack "&InvisibleComma;", [8291]), (pack "&Scedil;", [350]), (pack "&Wcirc;", [372]), (pack "&glE;", [10898]), (pack "&verbar;", [124]), (pack "&nles;", [10877, 824]), (pack "&nexists;", [8708]), (pack "&ContourIntegral;", [8750]), (pack "&ltcir;", [10873]), (pack "&precapprox;", [10935]), (pack "&Ograve;", [210]), (pack "&sup2;", [178]), (pack "&ncy;", [1085]), (pack "&esim;", [8770]), (pack "&horbar;", [8213]), (pack "&epsilon;", [949]), (pack "&Iuml", [207]), (pack "&supedot;", [10948]), (pack "&AMP;", [38]), (pack "&npreceq;", [10927, 824]), (pack "&sqsupseteq;", [8850]), (pack "&nang;", [8736, 8402]), (pack "&Verbar;", [8214]), (pack "&supdsub;", [10968]), (pack "&Upsilon;", [933]), (pack "&sqsub;", [8847]), (pack "&bigstar;", [9733]), (pack "&lbrksld;", [10639]), (pack "&racute;", [341]), (pack "&Esim;", [10867]), (pack "&mopf;", [120158]), (pack "&leftarrow;", [8592]), (pack "&LeftArrow;", [8592]), (pack "&rightrightarrows;", [8649]), (pack "&bkarow;", [10509]), (pack "&HumpEqual;", [8783]), (pack "&NoBreak;", [8288]), (pack "&amp;", [38]), (pack "&RightTriangle;", [8883]), (pack "&dbkarow;", [10511]), (pack "&gcirc;", [285]), (pack "&IEcy;", [1045]), (pack "&oS;", [9416]), (pack "&RightDownVectorBar;", [10581]), (pack "&Idot;", [304]), (pack "&ExponentialE;", [8519]), (pack "&andand;", [10837]), (pack "&dashv;", [8867]), (pack "&sime;", [8771]), (pack "&rscr;", [120007]), (pack "&HorizontalLine;", [9472]), (pack "&sdotb;", [8865]), (pack "&nge;", [8817]), (pack "&supsub;", [10964]), (pack "&upharpoonright;", [8638]), (pack "&Leftarrow;", [8656]), (pack "&Bscr;", [8492]), (pack "&SquareIntersection;", [8851]), (pack "&sect", [167]), (pack "&olarr;", [8634]), (pack "&wcirc;", [373]), (pack "&oacute", [243]), (pack "&jukcy;", [1108]), (pack "&Ecaron;", [282]), (pack "&die;", [168]), (pack "&simdot;", [10858]), (pack "&ltquest;", [10875]), (pack "&Nfr;", [120081]), (pack "&ograve;", [242]), (pack "&Rscr;", [8475]), (pack "&NotPrecedesEqual;", [10927, 824]), (pack "&twoheadleftarrow;", [8606]), (pack "&yucy;", [1102]), (pack "&iuml", [239]), (pack "&plusb;", [8862]), (pack "&geqq;", [8807]), (pack "&DotDot;", [8412]), (pack "&oplus;", [8853]), (pack "&longrightarrow;", [10230]), (pack "&pre;", [10927]), (pack "&cularrp;", [10557]), (pack "&rarrb;", [8677]), (pack "&Del;", [8711]), (pack "&LeftTee;", [8867]), (pack "&NotLessLess;", [8810, 824]), (pack "&bernou;", [8492]), (pack "&orderof;", [8500]), (pack "&beth;", [8502]), (pack "&lbarr;", [10508]), (pack "&rsh;", [8625]), (pack "&fallingdotseq;", [8786]), (pack "&period;", [46]), (pack "&zopf;", [120171]), (pack "&curarr;", [8631]), (pack "&Longrightarrow;", [10233]), (pack "&clubsuit;", [9827]), (pack "&LeftFloor;", [8970]), (pack "&hamilt;", [8459]), (pack "&otimesas;", [10806]), (pack "&TildeFullEqual;", [8773]), (pack "&dtri;", [9663]), (pack "&kcy;", [1082]), (pack "&angmsdad;", [10667]), (pack "&LeftTriangle;", [8882]), (pack "&DoubleLongLeftRightArrow;", [10234]), (pack "&boxHd;", [9572]), (pack "&lne;", [10887]), (pack "&cire;", [8791]), (pack "&bdquo;", [8222]), (pack "&Escr;", [8496]), (pack "&Rarrtl;", [10518]), (pack "&NotSquareSupersetEqual;", [8931]), (pack "&shortparallel;", [8741]), (pack "&Kcy;", [1050]), (pack "&reals;", [8477]), (pack "&lurdshar;", [10570]), (pack "&grave;", [96]), (pack "&gtreqqless;", [10892]), (pack "&oslash", [248]), (pack "&Odblac;", [336]), (pack "&plusdo;", [8724]), (pack "&notinE;", [8953, 824]), (pack "&kjcy;", [1116]), (pack "&el;", [10905]), (pack "&boxhd;", [9516]), (pack "&dharl;", [8643]), (pack "&ShortRightArrow;", [8594]), (pack "&circeq;", [8791]), (pack "&cuesc;", [8927]), (pack "&Ofr;", [120082]), (pack "&boxv;", [9474]), (pack "&roang;", [10221]), (pack "&Coproduct;", [8720]), (pack "&lBarr;", [10510]), (pack "&uscr;", [120010]), (pack "&hslash;", [8463]), (pack "&rbbrk;", [10099]), (pack "&notniva;", [8716]), (pack "&ncaron;", [328]), (pack "&leftrightharpoons;", [8651]), (pack "&HARDcy;", [1066]), (pack "&omid;", [10678]), (pack "&lbrack;", [91]), (pack "&nsim;", [8769]), (pack "&Jopf;", [120129]), (pack "&DoubleLeftArrow;", [8656]), (pack "&perp;", [8869]), (pack "&iinfin;", [10716]), (pack "&varsubsetneq;", [8842, 65024]), (pack "&Hat;", [94]), (pack "&LongRightArrow;", [10230]), (pack "&heartsuit;", [9829]), (pack "&Ncaron;", [327]), (pack "&frac25;", [8534]), (pack "&KJcy;", [1036]), (pack "&cent", [162]), (pack "&Uscr;", [119984]), (pack "&prE;", [10931]), (pack "&gamma;", [947]), (pack "&curlyeqsucc;", [8927]), (pack "&odblac;", [337]), (pack "&Implies;", [8658]), (pack "&Assign;", [8788]), (pack "&Rsh;", [8625]), (pack "&gvertneqq;", [8809, 65024]), (pack "&and;", [8743]), (pack "&rarrtl;", [8611]), (pack "&escr;", [8495]), (pack "&uring;", [367]), (pack "&lesseqqgtr;", [10891]), (pack "&gnapprox;", [10890]), (pack "&rHar;", [10596]), (pack "&nsubseteqq;", [10949, 824]), (pack "&LowerLeftArrow;", [8601]), (pack "&boxhD;", [9573]), (pack "&sccue;", [8829]), (pack "&Zopf;", [8484]), (pack "&lhard;", [8637]), (pack "&curvearrowleft;", [8630]), (pack "&boxV;", [9553]), (pack "&llcorner;", [8990]), (pack "&iexcl;", [161]), (pack "&telrec;", [8981]), (pack "&ofr;", [120108]), (pack "&part;", [8706]), (pack "&rdquo;", [8221]), (pack "&Uring;", [366]), (pack "&Gamma;", [915]), (pack "&hardcy;", [1098]), (pack "&And;", [10835]), (pack "&multimap;", [8888]), (pack "&lltri;", [9722]), (pack "&ntgl;", [8825]), (pack "&supseteqq;", [10950]), (pack "&NotGreaterTilde;", [8821]), (pack "&niv;", [8715]), (pack "&ltrPar;", [10646]), (pack "&epsiv;", [1013]), (pack "&geqslant;", [10878]), (pack "&vrtri;", [8883]), (pack "&boxHD;", [9574]), (pack "&lrarr;", [8646]), (pack "&lnE;", [8808]), (pack "&cirE;", [10691]), (pack "&uuarr;", [8648]), (pack "&leftharpoonup;", [8636]), (pack "&eqsim;", [8770]), (pack "&Oslash", [216]), (pack "&urcorn;", [8989]), (pack "&jopf;", [120155]), (pack "&nwarhk;", [10531]), (pack "&ap;", [8776]), (pack "&sstarf;", [8902]), (pack "&realpart;", [8476]), (pack "&sqcup;", [8852]), (pack "&sharp;", [9839]), (pack "&num;", [35]), (pack "&Element;", [8712]), (pack "&xcup;", [8899]), (pack "&RightUpTeeVector;", [10588]), (pack "&Wopf;", [120142]), (pack "&lthree;", [8907]), (pack "&prurel;", [8880]), (pack "&operp;", [10681]), (pack "&supsup;", [10966]), (pack "&Hscr;", [8459]), (pack "&Amacr;", [256]), (pack "&Gopf;", [120126]), (pack "&lvertneqq;", [8808, 65024]), (pack "&ccupssm;", [10832]), (pack "&Xscr;", [119987]), (pack "&Iogon;", [302]), (pack "&Vee;", [8897]), (pack "&dash;", [8208]), (pack "&andslope;", [10840]), (pack "&RightUpVector;", [8638]), (pack "&nrarrw;", [8605, 824]), (pack "&parsl;", [11005]), (pack "&VerticalLine;", [124]), (pack "&sbquo;", [8218]), (pack "&natur;", [9838]), (pack "&simg;", [10910]), (pack "&Acirc;", [194]), (pack "&wedge;", [8743]), (pack "&gdot;", [289]), (pack "&Integral;", [8747]), (pack "&supplus;", [10944]), (pack "&softcy;", [1100]), (pack "&LT;", [60]), (pack "&Cap;", [8914]), (pack "&complexes;", [8450]), (pack "&ape;", [8778]), (pack "&lfr;", [120105]), (pack "&quatint;", [10774]), (pack "&Wedge;", [8896]), (pack "&HilbertSpace;", [8459]), (pack "&npr;", [8832]), (pack "&rcub;", [125]), (pack "&Ntilde;", [209]), (pack "&intprod;", [10812]), (pack "&tritime;", [10811]), (pack "&nsime;", [8772]), (pack "&Lfr;", [120079]), (pack "&qint;", [10764]), (pack "&theta;", [952]), (pack "&kgreen;", [312]), (pack "&cupcup;", [10826]), (pack "&wopf;", [120168]), (pack "&trie;", [8796]), (pack "&LeftDoubleBracket;", [10214]), (pack "&hscr;", [119997]), (pack "&Pcy;", [1055]), (pack "&fpartint;", [10765]), (pack "&raquo;", [187]), (pack "&ngeqq;", [8807, 824]), (pack "&xscr;", [120013]), (pack "&gopf;", [120152]), (pack "&ccups;", [10828]), (pack "&SOFTcy;", [1068]), (pack "&subedot;", [10947]), (pack "&lopar;", [10629]), (pack "&FilledVerySmallSquare;", [9642]), (pack "&fjlig;", [102, 106]), (pack "&hyphen;", [8208]), (pack "&succeq;", [10928]), (pack "&iexcl", [161]), (pack "&acirc;", [226]), (pack "&weierp;", [8472]), (pack "&subseteq;", [8838]), (pack "&apE;", [10864]), (pack "&lesssim;", [8818]), (pack "&lsquo;", [8216]), (pack "&cemptyv;", [10674]), (pack "&cap;", [8745]), (pack "&Lt;", [8810]), (pack "&hoarr;", [8703]), (pack "&psi;", [968]), (pack "&order;", [8500]), (pack "&LessFullEqual;", [8806]), (pack "&vnsup;", [8835, 8402]), (pack "&nsupseteq;", [8841]), (pack "&RightUpDownVector;", [10575]), (pack "&ntilde;", [241]), (pack "&odiv;", [10808]), (pack "&Fouriertrf;", [8497]), (pack "&bsol;", [92]), (pack "&nldr;", [8229]), (pack "&RuleDelayed;", [10740]), (pack "&sqsup;", [8848]), (pack "&alpha;", [945]), (pack "&thicksim;", [8764]), (pack "&triangledown;", [9663]), (pack "&varphi;", [981]), (pack "&varsigma;", [962]), (pack "&frac13;", [8531]), (pack "&Equilibrium;", [8652]), (pack "&nGg;", [8921, 824]), (pack "&Gdot;", [288]), (pack "&pcy;", [1087]), (pack "&xotime;", [10754]), (pack "&Psi;", [936]), (pack "&spadesuit;", [9824]), (pack "&supsetneq;", [8843]), (pack "&ClockwiseContourIntegral;", [8754]), (pack "&imagline;", [8464]), (pack "&asympeq;", [8781]), (pack "&CounterClockwiseContourIntegral;", [8755]), (pack "&Alpha;", [913]), (pack "&dotsquare;", [8865]), (pack "&Exists;", [8707]), (pack "&ShortUpArrow;", [8593]), (pack "&trianglerighteq;", [8885]), (pack "&rfisht;", [10621]), (pack "&copysr;", [8471]), (pack "&nleq;", [8816]), (pack "&smtes;", [10924, 65024]), (pack "&amacr;", [257]), (pack "&rharu;", [8640]), (pack "&nwarrow;", [8598]), (pack "&iogon;", [303]), (pack "&Theta;", [920]), (pack "&gesdot;", [10880]), (pack "&frown;", [8994]), (pack "&lt;", [60]), (pack "&vee;", [8744]), (pack "&GreaterEqualLess;", [8923]), (pack "&DownLeftVectorBar;", [10582]), (pack "&agrave", [224]), (pack "&Sacute;", [346]), (pack "&sim;", [8764]), (pack "&rAtail;", [10524]), (pack "&yen", [165]), (pack "&lsh;", [8624]), (pack "&nsimeq;", [8772]), (pack "&nrarr;", [8603]), (pack "&CapitalDifferentialD;", [8517]), (pack "&gesl;", [8923, 65024]), (pack "&ETH;", [208]), (pack "&gesdotol;", [10884]), (pack "&loang;", [10220]), (pack "&RightTeeVector;", [10587]), (pack "&wedgeq;", [8793]), (pack "&bNot;", [10989]), (pack "&lopf;", [120157]), (pack "&Efr;", [120072]), (pack "&kappav;", [1008]), (pack "&UpArrowDownArrow;", [8645]), (pack "&dotplus;", [8724]), (pack "&ntlg;", [8824]), (pack "&mcy;", [1084]), (pack "&Colon;", [8759]), (pack "&subseteqq;", [10949]), (pack "&Product;", [8719]), (pack "&larrb;", [8676]), (pack "&MediumSpace;", [8287]), (pack "&ucirc", [251]), (pack "&varsupsetneq;", [8843, 65024]), (pack "&mnplus;", [8723]), (pack "&permil;", [8240]), (pack "&ogon;", [731]), (pack "&cirfnint;", [10768]), (pack "&lrtri;", [8895]), (pack "&Mcy;", [1052]), (pack "&coprod;", [8720]), (pack "&succnsim;", [8937]), (pack "&dot;", [729]), (pack "&pertenk;", [8241]), (pack "&pm;", [177]), (pack "&ratio;", [8758]), (pack "&frac16;", [8537]), (pack "&topcir;", [10993]), (pack "&ShortDownArrow;", [8595]), (pack "&ncedil;", [326]), (pack "&Ucirc", [219]), (pack "&nsubE;", [10949, 824]), (pack "&NotGreaterEqual;", [8817]), (pack "&lArr;", [8656]), (pack "&LeftArrowBar;", [8676]), (pack "&Hcirc;", [292]), (pack "&sacute;", [347]), (pack "&hookleftarrow;", [8617]), (pack "&LeftUpVector;", [8639]), (pack "&seArr;", [8664]), (pack "&RightArrow;", [8594]), (pack "&prnE;", [10933]), (pack "&Ufr;", [120088]), (pack "&rationals;", [8474]), (pack "&simplus;", [10788]), (pack "&supe;", [8839]), (pack "&bcong;", [8780]), (pack "&rceil;", [8969]), (pack "&squ;", [9633]), (pack "&Ncedil;", [325]), (pack "&barwedge;", [8965]), (pack "&ngeqslant;", [10878, 824]), (pack "&searr;", [8600]), (pack "&harrcir;", [10568]), (pack "&NotSubset;", [8834, 8402]), (pack "&larr;", [8592]), (pack "&Rightarrow;", [8658]), (pack "&Union;", [8899]), (pack "&scap;", [10936]), (pack "&efr;", [120098]), (pack "&UnionPlus;", [8846]), (pack "&nsupseteqq;", [10950, 824]), (pack "&tdot;", [8411]), (pack "&acute", [180]), (pack "&supE;", [10950]), (pack "&Kscr;", [119974]), (pack "&colon;", [58]), (pack "&rhov;", [1009]), (pack "&looparrowright;", [8620]), (pack "&backepsilon;", [1014]), (pack "&micro", [181]), (pack "&twoheadrightarrow;", [8608]), (pack "&lhblk;", [9604]), (pack "&Agrave", [192]), (pack "&EmptyVerySmallSquare;", [9643]), (pack "&ldsh;", [8626]), (pack "&dtdot;", [8945]), (pack "&Lsh;", [8624]), (pack "&zwnj;", [8204]), (pack "&Larr;", [8606]), (pack "&Uarrocir;", [10569]), (pack "&ecirc", [234]), (pack "&bnot;", [8976]), (pack "&RightTriangleBar;", [10704]), (pack "&DownTeeArrow;", [8615]), (pack "&nrArr;", [8655]), (pack "&supsetneqq;", [10956]), (pack "&eth;", [240]), (pack "&comma;", [44]), (pack "&sfrown;", [8994]), (pack "&ord;", [10845]), (pack "&vltri;", [8882]), (pack "&puncsp;", [8200]), (pack "&sdote;", [10854]), (pack "&Lopf;", [120131]), (pack "&hcirc;", [293]), (pack "&xuplus;", [10756]), (pack "&lesdot;", [10879]), (pack "&nsube;", [8840]), (pack "&ufr;", [120114]), (pack "&npart;", [8706, 824]), (pack "&nleqq;", [8806, 824]), (pack "&cacute;", [263]), (pack "&wreath;", [8768]), (pack "&angle;", [8736]), (pack "&bottom;", [8869]), (pack "&ntriangleleft;", [8938]), (pack "&Ecirc", [202]), (pack "&cudarrr;", [10549]), (pack "&xcirc;", [9711]), (pack "&gl;", [8823]), (pack "&rightarrow;", [8594]), (pack "&barvee;", [8893]), (pack "&downharpoonright;", [8642]), (pack "&ratail;", [10522]), (pack "&plusacir;", [10787]), (pack "&kscr;", [120000]), (pack "&Proportional;", [8733]), (pack "&pluse;", [10866]), (pack "&Cacute;", [262]), (pack "&plusdu;", [10789]), (pack "&gtquest;", [10876]), (pack "&topfork;", [10970]), (pack "&Dot;", [168]), (pack "&bepsi;", [1014]), (pack "&EqualTilde;", [8770]), (pack "&DownLeftRightVector;", [10576]), (pack "&NotLessGreater;", [8824]), (pack "&ring;", [730]), (pack "&Iopf;", [120128]), (pack "&Jfr;", [120077]), (pack "&LJcy;", [1033]), (pack "&erarr;", [10609]), (pack "&SquareSuperset;", [8848]), (pack "&zeta;", [950]), (pack "&angrt;", [8735]), (pack "&Uuml", [220]), (pack "&forkv;", [10969]), (pack "&leftleftarrows;", [8647]), (pack "&nspar;", [8742]), (pack "&szlig", [223]), (pack "&rpargt;", [10644]), (pack "&Subset;", [8912]), (pack "&lesdotor;", [10883]), (pack "&Cedilla;", [184]), (pack "&triangleright;", [9657]), (pack "&squarf;", [9642]), (pack "&yicy;", [1111]), (pack "&ohm;", [937]), (pack "&boxHu;", [9575]), (pack "&LeftDownVector;", [8643]), (pack "&ii;", [8520]), (pack "&gneqq;", [8809]), (pack "&DoubleRightArrow;", [8658]), (pack "&rtriltri;", [10702]), (pack "&Zeta;", [918]), (pack "&blk14;", [9617]), (pack "&boxHU;", [9577]), (pack "&dfisht;", [10623]), (pack "&mho;", [8487]), (pack "&nbsp", [160]), (pack "&vDash;", [8872]), (pack "&erDot;", [8787]), (pack "&pluscir;", [10786]), (pack "&euml", [235]), (pack "&angmsdae;", [10668]), (pack "&bigsqcup;", [10758]), (pack "&Gcedil;", [290]), (pack "&napE;", [10864, 824]), (pack "&larrhk;", [8617]), (pack "&LeftTeeArrow;", [8612]), (pack "&iquest", [191]), (pack "&nparsl;", [11005, 8421]), (pack "&Breve;", [728]), (pack "&ltcc;", [10918]), (pack "&YIcy;", [1031]), (pack "&iopf;", [120154]), (pack "&forall;", [8704]), (pack "&Rcy;", [1056]), (pack "&vdash;", [8866]), (pack "&DownArrowBar;", [10515]), (pack "&zfr;", [120119]), (pack "&duhar;", [10607]), (pack "&ngsim;", [8821]), (pack "&fllig;", [64258]), (pack "&DownTee;", [8868]), (pack "&subset;", [8834]), (pack "&CircleTimes;", [8855]), (pack "&rmoust;", [9137]), (pack "&uuml", [252]), (pack "&mstpos;", [8766]), (pack "&LeftTeeVector;", [10586]), (pack "&DownRightVectorBar;", [10583]), (pack "&Vdash;", [8873]), (pack "&Mu;", [924]), (pack "&plankv;", [8463]), (pack "&gg;", [8811]), (pack "&lnapprox;", [10889]), (pack "&elinters;", [9191]), (pack "&uHar;", [10595]), (pack "&lozenge;", [9674]), (pack "&Oslash;", [216]), (pack "&Nscr;", [119977]), (pack "&yopf;", [120170]), (pack "&lcub;", [123]), (pack "&iprod;", [10812]), (pack "&Zfr;", [8488]), (pack "&rarrc;", [10547]), (pack "&lharu;", [8636]), (pack "&LowerRightArrow;", [8600]), (pack "&nisd;", [8954]), (pack "&ncongdot;", [10861, 824]), (pack "&nvrtrie;", [8885, 8402]), (pack "&VDash;", [8875]), (pack "&GT", [62]), (pack "&Gg;", [8921]), (pack "&searhk;", [10533]), (pack "&boxhU;", [9576]), (pack "&Yopf;", [120144]), (pack "&asymp;", [8776]), (pack "&bcy;", [1073]), (pack "&trpezium;", [9186]), (pack "&nbump;", [8782, 824]), (pack "&succ;", [8827]), (pack "&ctdot;", [8943]), (pack "&rcy;", [1088]), (pack "&ltimes;", [8905]), (pack "&isinsv;", [8947]), (pack "&breve;", [728]), (pack "&boxhu;", [9524]), (pack "&NegativeMediumSpace;", [8203]), (pack "&divideontimes;", [8903]), (pack "&GreaterSlantEqual;", [10878]), (pack "&ljcy;", [1113]), (pack "&apacir;", [10863]), (pack "&frac34", [190]), (pack "&UnderBracket;", [9141]), (pack "&Bcy;", [1041]), (pack "&divonx;", [8903]), (pack "&marker;", [9646]), (pack "&NegativeThickSpace;", [8203]), (pack "&rx;", [8478]), (pack "&jfr;", [120103]), (pack "&mu;", [956]), (pack "&nsupset;", [8835, 8402]), (pack "&oslash;", [248]), (pack "&gt", [62]), (pack "&ForAll;", [8704]), (pack "&Euml", [203]), (pack "&utrif;", [9652]), (pack "&nscr;", [120003]), (pack "&cylcty;", [9005]), (pack "&cent;", [162]), (pack "&equivDD;", [10872]), (pack "&nabla;", [8711]), (pack "&larrsim;", [10611]), (pack "&NegativeVeryThinSpace;", [8203])] entitySet = S.fromList [pack "&intlarhk;", pack "&male;", pack "&not;", pack "&clubs;", pack "&cudarrl;", pack "&IJlig;", pack "&rdldhar;", pack "&Zcaron;", pack "&Lcedil;", pack "&ltrif;", pack "&subE;", pack "&prcue;", pack "&NotGreaterSlantEqual;", pack "&nharr;", pack "&nsupe;", pack "&searrow;", pack "&siml;", pack "&ocy;", pack "&varpropto;", pack "&mp;", pack "&jcirc;", pack "&AMP", pack "&gesdoto;", pack "&upsi;", pack "&lstrok;", pack "&triangleleft;", pack "&aacute;", pack "&PrecedesEqual;", pack "&ges;", pack "&half;", pack "&fopf;", pack "&divide;", pack "&bprime;", pack "&Jcirc;", pack "&NotTilde;", pack "&Qscr;", pack "&nsupE;", pack "&hercon;", pack "&Ocy;", pack "&emsp13;", pack "&tbrk;", pack "&gjcy;", pack "&vArr;", pack "&NotCupCap;", pack "&varepsilon;", pack "&DownArrow;", pack "&amp", pack "&rsaquo;", pack "&downarrow;", pack "&wedbar;", pack "&csub;", pack "&ascr;", pack "&nlsim;", pack "&olt;", pack "&preccurlyeq;", pack "&LeftUpTeeVector;", pack "&nhpar;", pack "&rlarr;", pack "&wr;", pack "&ni;", pack "&leqq;", pack "&Kfr;", pack "&rarrlp;", pack "&epsi;", pack "&Ascr;", pack "&diamondsuit;", pack "&zcaron;", pack "&lcedil;", pack "&Ccedil", pack "&leftrightsquigarrow;", pack "&vsubne;", pack "&hearts;", pack "&block;", pack "&natural;", pack "&Vopf;", pack "&Bernoullis;", pack "&GJcy;", pack "&bsim;", pack "&ijlig;", pack "&angsph;", pack "&Otimes;", pack "&seswar;", pack "&Ograve", pack "&sup2", pack "&maltese;", pack "&xoplus;", pack "&Not;", pack "&eqslantgtr;", pack "&prnap;", pack "&NotTildeTilde;", pack "&sce;", pack "&lceil;", pack "&DownRightVector;", pack "&notinvc;", pack "&qscr;", pack "&sube;", pack "&range;", pack "&frac18;", pack "&lagran;", pack "&conint;", pack "&kfr;", pack "&scE;", pack "&NotLeftTriangleBar;", pack "&ccedil", pack "&RightCeiling;", pack "&Fopf;", pack "&Aacute;", pack "&awconint;", pack "&vsubnE;", pack "&Upsi;", pack "&NotGreaterGreater;", pack "&Lstrok;", pack "&cuepr;", pack "&NotExists;", pack "&DoubleUpArrow;", pack "&planck;", pack "&varr;", pack "&Conint;", pack "&precneqq;", pack "&xdtri;", pack "&SquareSubset;", pack "&VerticalSeparator;", pack "&nvap;", pack "&ocir;", pack "&lesges;", pack "&vopf;", pack "&gtcc;", pack "&ograve", pack "&nhArr;", pack "&lesg;", pack "&triplus;", pack "&DiacriticalAcute;", pack "&succsim;", pack "&NotHumpEqual;", pack "&otimes;", pack "&Downarrow;", pack "&utri;", pack "&primes;", pack "&smile;", pack "&OElig;", pack "&Scaron;", pack "&Dcy;", pack "&ouml", pack "&ac;", pack "&dwangle;", pack "&propto;", pack "&Vvdash;", pack "&Ucirc;", pack "&aleph;", pack "&zeetrf;", pack "&ecirc;", pack "&ImaginaryI;", pack "&ApplyFunction;", pack "&Yacute", pack "&ang;", pack "&hfr;", pack "&topbot;", pack "&digamma;", pack "&lessgtr;", pack "&iacute", pack "&yen;", pack "&IOcy;", pack "&ffllig;", pack "&drcrop;", pack "&csube;", pack "&solb;", pack "&NJcy;", pack "&lmoust;", pack "&agrave;", pack "&jmath;", pack "&quot", pack "&spar;", pack "&strns;", pack "&sext;", pack "&rarrhk;", pack "&eqvparsl;", pack "&Ecirc;", pack "&Hfr;", pack "&gE;", pack "&nleftarrow;", pack "&mumap;", pack "&Otilde", pack "&copf;", pack "&frac35;", pack "&Dscr;", pack "&eDDot;", pack "&udhar;", pack "&utdot;", pack "&iiota;", pack "&Tscr;", pack "&ast;", pack "&nmid;", pack "&OpenCurlyDoubleQuote;", pack "&hookrightarrow;", pack "&Sopf;", pack "&trisb;", pack "&ssetmn;", pack "&uhblk;", pack "&emsp14;", pack "&Copf;", pack "&aring", pack "&Tcy;", pack "&xfr;", pack "&submult;", pack "&bsime;", pack "&scaron;", pack "&notnivb;", pack "&orarr;", pack "&micro;", pack "&LongLeftRightArrow;", pack "&fork;", pack "&blacksquare;", pack "&COPY", pack "&ccaron;", pack "&yacute", pack "&acute;", pack "&congdot;", pack "&QUOT", pack "&Aring", pack "&thksim;", pack "&LessLess;", pack "&leg;", pack "&ldca;", pack "&gsim;", pack "&Xfr;", pack "&Jsercy;", pack "&sup3", pack "&angmsdag;", pack "&gvnE;", pack "&dscr;", pack "&Ccaron;", pack "&otilde", pack "&minus;", pack "&CirclePlus;", pack "&tscr;", pack "&apid;", pack "&njcy;", pack "&NotLeftTriangle;", pack "&timesb;", pack "&sopf;", pack "&eta;", pack "&straightepsilon;", pack "&sqsubseteq;", pack "&Ouml", pack "&iocy;", pack "&DoubleVerticalBar;", pack "&tcy;", pack "&longleftrightarrow;", pack "&xwedge;", pack "&simlE;", pack "&copy", pack "&xvee;", pack "&Iacute", pack "&harrw;", pack "&Agrave;", pack "&precnapprox;", pack "&THORN", pack "&rsqb;", pack "&Eta;", pack "&midcir;", pack "&oelig;", pack "&numero;", pack "&capcup;", pack "&rightthreetimes;", pack "&Cayleys;", pack "&middot", pack "&nLeftarrow;", pack "&Longleftrightarrow;", pack "&bsemi;", pack "&ge;", pack "&minusd;", pack "&gap;", pack "&isins;", pack "&nedot;", pack "&risingdotseq;", pack "&LeftUpVectorBar;", pack "&cedil", pack "&NotTildeFullEqual;", pack "&thorn", pack "&thkap;", pack "&DiacriticalGrave;", pack "&jsercy;", pack "&xsqcup;", pack "&RightArrowBar;", pack "&twixt;", pack "&nvlt;", pack "&dcy;", pack "&rsquor;", pack "&acd;", pack "&ucirc;", pack "&lEg;", pack "&Dcaron;", pack "&Gammad;", pack "&NotDoubleVerticalBar;", pack "&hArr;", pack "&nsccue;", pack "&udblac;", pack "&imof;", pack "&timesbar;", pack "&nges;", pack "&Hopf;", pack "&blacktriangleright;", pack "&Auml;", pack "&imped;", pack "&ggg;", pack "&rcedil;", pack "&leftthreetimes;", pack "&lE;", pack "&SHcy;", pack "&Gscr;", pack "&xopf;", pack "&equest;", pack "&frac38;", pack "&scnE;", pack "&gacute;", pack "&pi;", pack "&chcy;", pack "&frac12;", pack "&prnsim;", pack "&curren;", pack "&Afr;", pack "&Udblac;", pack "&swarrow;", pack "&squf;", pack "&Acy;", pack "&vprop;", pack "&Rcedil;", pack "&acirc", pack "&Xopf;", pack "&larrpl;", pack "&curlyvee;", pack "&NotRightTriangleEqual;", pack "&wscr;", pack "&brvbar;", pack "&lbbrk;", pack "&sup1;", pack "&supdot;", pack "&Acirc", pack "&UpperRightArrow;", pack "&CloseCurlyQuote;", pack "&boxH;", pack "&macr;", pack "&sqsupe;", pack "&nvsim;", pack "&ordf;", pack "&rrarr;", pack "&gammad;", pack "&subne;", pack "&Wscr;", pack "&hopf;", pack "&dcaron;", pack "&andd;", pack "&raquo", pack "&cupdot;", pack "&plusmn;", pack "&Mellintrf;", pack "&RBarr;", pack "&top;", pack "&Ntilde", pack "&auml;", pack "&Qfr;", pack "&plussim;", pack "&gscr;", pack "&Itilde;", pack "&flat;", pack "&solbar;", pack "&lsaquo;", pack "&ssmile;", pack "&RightArrowLeftArrow;", pack "&afr;", pack "&SupersetEqual;", pack "&lneqq;", pack "&rBarr;", pack "&acy;", pack "&parallel;", pack "&mldr;", pack "&simgE;", pack "&shcy;", pack "&caron;", pack "&CHcy;", pack "&LT", pack "&rhard;", pack "&intcal;", pack "&oline;", pack "&ncong;", pack "&lHar;", pack "&PartialD;", pack "&le;", pack "&SucceedsEqual;", pack "&Pi;", pack "&subnE;", pack "&par;", pack "&nless;", pack "&lparlt;", pack "&qfr;", pack "&lbrace;", pack "&circledcirc;", pack "&npre;", pack "&curlywedge;", pack "&tshcy;", pack "&ntilde", pack "&tcaron;", pack "&harr;", pack "&upsih;", pack "&bigtriangleup;", pack "&ufisht;", pack "&lt", pack "&itilde;", pack "&bemptyv;", pack "&gesles;", pack "&ominus;", pack "&planckh;", pack "&toea;", pack "&dharr;", pack "&Tcaron;", pack "&supsim;", pack "&boxh;", pack "&div;", pack "&TSHcy;", pack "&nap;", pack "&rbarr;", pack "&isindot;", pack "&veeeq;", pack "&Laplacetrf;", pack "&gtdot;", pack "&ordm;", pack "&AElig;", pack "&pr;", pack "&Vcy;", pack "&tau;", pack "&rightsquigarrow;", pack "&rppolint;", pack "&models;", pack "&angmsdaa;", pack "&pitchfork;", pack "&bsolhsub;", pack "&kcedil;", pack "&DoubleLeftTee;", pack "&NotSucceedsTilde;", pack "&rarrw;", pack "&ultri;", pack "&DDotrahd;", pack "&curren", pack "&timesd;", pack "&doublebarwedge;", pack "&simrarr;", pack "&Vfr;", pack "&frac12", pack "&laemptyv;", pack "&nltrie;", pack "&Kcedil;", pack "&dlcrop;", pack "&plusmn", pack "&auml", pack "&Pr;", pack "&uml;", pack "&Uparrow;", pack "&Ocirc;", pack "&notinvb;", pack "&dagger;", pack "&Vdashl;", pack "&boxUR;", pack "&NotPrecedes;", pack "&dlcorn;", pack "&rarrfs;", pack "&Eopf;", pack "&malt;", pack "&percnt;", pack "&delta;", pack "&brvbar", pack "&boxUr;", pack "&leq;", pack "&minusb;", pack "&Proportion;", pack "&qprime;", pack "&subsup;", pack "&lharul;", pack "&uopf;", pack "&rdca;", pack "&angrtvbd;", pack "&cir;", pack "&nwarr;", pack "&semi;", pack "&Map;", pack "&para;", pack "&RightTriangleEqual;", pack "&parsim;", pack "&upuparrows;", pack "&Uopf;", pack "&boxur;", pack "&ReverseElement;", pack "&lsqb;", pack "&Zacute;", pack "&vfr;", pack "&jscr;", pack "&varpi;", pack "&ncap;", pack "&Lleftarrow;", pack "&boxuR;", pack "&iiiint;", pack "&macr", pack "&lsime;", pack "&backprime;", pack "&ocirc;", pack "&UpArrow;", pack "&bigcap;", pack "&Im;", pack "&uparrow;", pack "&rtrie;", pack "&scpolint;", pack "&sup1", pack "&NotPrecedesSlantEqual;", pack "&supmult;", pack "&Jscr;", pack "&tilde;", pack "&eopf;", pack "&LeftVector;", pack "&fcy;", pack "&dblac;", pack "&nshortmid;", pack "&lfloor;", pack "&Tau;", pack "&ffr;", pack "&nwArr;", pack "&NotLessTilde;", pack "&map;", pack "&rangd;", pack "&nis;", pack "&Tilde;", pack "&starf;", pack "&Fcy;", pack "&aelig;", pack "&notin;", pack "&NegativeThinSpace;", pack "&Auml", pack "&isinE;", pack "&lAarr;", pack "&zscr;", pack "&Dagger;", pack "&midast;", pack "&LeftTriangleBar;", pack "&Ffr;", pack "&curvearrowright;", pack "&uharl;", pack "&quest;", pack "&Delta;", pack "&naturals;", pack "&gtrdot;", pack "&ddagger;", pack "&zacute;", pack "&bigodot;", pack "&ordf", pack "&succapprox;", pack "&ogt;", pack "&nLl;", pack "&vcy;", pack "&OverBracket;", pack "&DiacriticalDot;", pack "&Zscr;", pack "&frac14;", pack "&boxplus;", pack "&RoundImplies;", pack "&bopf;", pack "&boxvr;", pack "&notindot;", pack "&LessTilde;", pack "&lrhar;", pack "&Wfr;", pack "&cupor;", pack "&Ropf;", pack "&eqcirc;", pack "&lozf;", pack "&SucceedsSlantEqual;", pack "&scy;", pack "&llhard;", pack "&Bopf;", pack "&mscr;", pack "&ne;", pack "&NotGreater;", pack "&reg", pack "&nlarr;", pack "&rpar;", pack "&Int;", pack "&eacute;", pack "&odsold;", pack "&uacute;", pack "&Scy;", pack "&pound", pack "&gfr;", pack "&ltri;", pack "&Hstrok;", pack "&rlm;", pack "&dscy;", pack "&ofcir;", pack "&quaternions;", pack "&demptyv;", pack "&tscy;", pack "&bigcirc;", pack "&checkmark;", pack "&UpTee;", pack "&ReverseUpEquilibrium;", pack "&boxVr;", pack "&rArr;", pack "&loplus;", pack "&odash;", pack "&imath;", pack "&Uacute;", pack "&RightDoubleBracket;", pack "&luruhar;", pack "&NotSubsetEqual;", pack "&rdquor;", pack "&circledS;", pack "&shy", pack "&nwnear;", pack "&caps;", pack "&nparallel;", pack "&LeftArrowRightArrow;", pack "&laquo", pack "&ropf;", pack "&capand;", pack "&lap;", pack "&cong;", pack "&profalar;", pack "&nRightarrow;", pack "&circlearrowright;", pack "&boxVR;", pack "&scnap;", pack "&Nu;", pack "&target;", pack "&nlArr;", pack "&ffilig;", pack "&REG", pack "&int;", pack "&lmidot;", pack "&sqsube;", pack "&sqcups;", pack "&NotHumpDownHump;", pack "&nGtv;", pack "&veebar;", pack "&orv;", pack "&prsim;", pack "&hstrok;", pack "&lessapprox;", pack "&DotEqual;", pack "&OverBrace;", pack "&Lmidot;", pack "&bot;", pack "&awint;", pack "&emsp;", pack "&emptyv;", pack "&rarr;", pack "&frac58;", pack "&Mscr;", pack "&prop;", pack "&thickapprox;", pack "&Eacute;", pack "&DScy;", pack "&upharpoonleft;", pack "&tint;", pack "&times", pack "&Rarr;", pack "&boxvR;", pack "&wfr;", pack "&RightUpVectorBar;", pack "&rangle;", pack "&nu;", pack "&nrightarrow;", pack "&TScy;", pack "&rightleftarrows;", pack "&nrtri;", pack "&euro;", pack "&Gfr;", pack "&RightDownVector;", pack "&lnsim;", pack "&dotminus;", pack "&rbrace;", pack "&nprec;", pack "&diamond;", pack "&ycirc;", pack "&nequiv;", pack "&srarr;", pack "&sqsupset;", pack "&neArr;", pack "&LeftCeiling;", pack "&real;", pack "&phone;", pack "&nsc;", pack "&Star;", pack "&eacute", pack "&doteqdot;", pack "&NotSquareSubset;", pack "&gtreqless;", pack "&gtlPar;", pack "&dfr;", pack "&HumpDownHump;", pack "&backsimeq;", pack "&frac14", pack "&capcap;", pack "&NotSucceeds;", pack "&NotLessSlantEqual;", pack "&curarrm;", pack "&crarr;", pack "&ensp;", pack "&Cross;", pack "&pscr;", pack "&MinusPlus;", pack "&varkappa;", pack "&blk34;", pack "&Dfr;", pack "&vartriangleleft;", pack "&dd;", pack "&infin;", pack "&circleddash;", pack "&amalg;", pack "&lesdoto;", pack "&Ll;", pack "&Oopf;", pack "&larrbfs;", pack "&gnE;", pack "&xutri;", pack "&Imacr;", pack "&subsub;", pack "&cuvee;", pack "&Cconint;", pack "&tfr;", pack "&Therefore;", pack "&star;", pack "&CloseCurlyDoubleQuote;", pack "&icirc;", pack "&DoubleLongRightArrow;", pack "&angmsdac;", pack "&TildeTilde;", pack "&gnap;", pack "&nesim;", pack "&raemptyv;", pack "&NotLess;", pack "&odot;", pack "&ltrie;", pack "&Ugrave;", pack "&cupbrcap;", pack "&ntriangleright;", pack "&NotGreaterFullEqual;", pack "&NotLeftTriangleEqual;", pack "&PlusMinus;", pack "&Uacute", pack "&udarr;", pack "&daleth;", pack "&egsdot;", pack "&rbrksld;", pack "&larrfs;", pack "&drcorn;", pack "&cross;", pack "&smt;", pack "&Tfr;", pack "&Icirc;", pack "&rharul;", pack "&Ycirc;", pack "&ulcorner;", pack "&Diamond;", pack "&rAarr;", pack "&origof;", pack "&les;", pack "&ll;", pack "&CenterDot;", pack "&Eacute", pack "&nearr;", pack "&oopf;", pack "&ENG;", pack "&between;", pack "&aogon;", pack "&DoubleDot;", pack "&bump;", pack "&gne;", pack "&swarhk;", pack "&DD;", pack "&thinsp;", pack "&rarrap;", pack "&vangrt;", pack "&imacr;", pack "&opar;", pack "&robrk;", pack "&eng;", pack "&therefore;", pack "&rarrsim;", pack "&NotSucceedsSlantEqual;", pack "&egrave;", pack "&Aogon;", pack "&hksearow;", pack "&RightTee;", pack "&Pscr;", pack "&Hacek;", pack "&uacute", pack "&ugrave;", pack "&preceq;", pack "&triangle;", pack "&blk12;", pack "&nvge;", pack "&ohbar;", pack "&gnsim;", pack "&vellip;", pack "&check;", pack "&lsimg;", pack "&NotSuperset;", pack "&Egrave;", pack "&ZeroWidthSpace;", pack "&capbrcup;", pack "&centerdot;", pack "&nrtrie;", pack "&phi;", pack "&vBar;", pack "&isin;", pack "&gt;", pack "&cularr;", pack "&numsp;", pack "&Euml;", pack "&zigrarr;", pack "&Sscr;", pack "&boxvh;", pack "&angmsdaf;", pack "&ltdot;", pack "&hairsp;", pack "&cscr;", pack "&angst;", pack "&boxDr;", pack "&iff;", pack "&Gt;", pack "&ucy;", pack "&darr;", pack "&xharr;", pack "&gneq;", pack "&boxdr;", pack "&ddarr;", pack "&ldquor;", pack "&gtrapprox;", pack "&Cscr;", pack "&frac34;", pack "&dArr;", pack "&Ucy;", pack "&xhArr;", pack "&Iota;", pack "&GT;", pack "&thetasym;", pack "&minusdu;", pack "&Vbar;", pack "&triangleq;", pack "&mapstoup;", pack "&Utilde;", pack "&Lambda;", pack "&Igrave", pack "&boxdR;", pack "&Poincareplane;", pack "&lmoustache;", pack "&prime;", pack "&NotEqualTilde;", pack "&frac45;", pack "&CircleDot;", pack "&sung;", pack "&nsqsube;", pack "&precnsim;", pack "&vartheta;", pack "&euml;", pack "&sscr;", pack "&nbsp;", pack "&Mfr;", pack "&omicron;", pack "&bigotimes;", pack "&Iukcy;", pack "&OpenCurlyQuote;", pack "&Omega;", pack "&Tab;", pack "&NotSquareSuperset;", pack "&profsurf;", pack "&nshortparallel;", pack "&sigma;", pack "&disin;", pack "&compfn;", pack "&deg", pack "&NotElement;", pack "&dzigrarr;", pack "&Ecy;", pack "&ubrcy;", pack "&boxVh;", pack "&acE;", pack "&nvHarr;", pack "&Omicron;", pack "&piv;", pack "&boxVH;", pack "&triminus;", pack "&Square;", pack "&Abreve;", pack "&Sigma;", pack "&tprime;", pack "&ldquo;", pack "&cwconint;", pack "&GreaterLess;", pack "&ulcorn;", pack "&UnderBar;", pack "&glj;", pack "&Ubrcy;", pack "&ltlarr;", pack "&larrtl;", pack "&iota;", pack "&bigoplus;", pack "&cirscir;", pack "&lvnE;", pack "&Phi;", pack "&esdot;", pack "&frac78;", pack "&DownRightTeeVector;", pack "&utilde;", pack "&LeftTriangleEqual;", pack "&lambda;", pack "&ThinSpace;", pack "&DifferentialD;", pack "&iquest;", pack "&comp;", pack "&igrave", pack "&LeftUpDownVector;", pack "&langle;", pack "&nvle;", pack "&setmn;", pack "&UpArrowBar;", pack "&capdot;", pack "&mfr;", pack "&topf;", pack "&llarr;", pack "&NestedLessLess;", pack "&LeftVectorBar;", pack "&leftrightarrows;", pack "&PrecedesSlantEqual;", pack "&iukcy;", pack "&PrecedesTilde;", pack "&omega;", pack "&Darr;", pack "&nltri;", pack "&ecy;", pack "&dopf;", pack "&ange;", pack "&uuml;", pack "&iiint;", pack "&ulcrop;", pack "&gsime;", pack "&scnsim;", pack "&ecir;", pack "&Topf;", pack "&lsim;", pack "&notnivc;", pack "&rtri;", pack "&Prime;", pack "&Dopf;", pack "&InvisibleTimes;", pack "&szlig;", pack "&boxDR;", pack "&square;", pack "&boxvH;", pack "&Uuml;", pack "&abreve;", pack "&qopf;", pack "&RightVectorBar;", pack "&equiv;", pack "&pound;", pack "&uArr;", pack "&NotNestedGreaterGreater;", pack "&Leftrightarrow;", pack "&prec;", pack "&rbrke;", pack "&rsquo;", pack "&nsup;", pack "&realine;", pack "&mid;", pack "&yacy;", pack "&bigwedge;", pack "&DiacriticalDoubleAcute;", pack "&blacktriangleleft;", pack "&Edot;", pack "&ee;", pack "&ddotseq;", pack "&csupe;", pack "&slarr;", pack "&Rang;", pack "&roarr;", pack "&subplus;", pack "&dzcy;", pack "&backcong;", pack "&Qopf;", pack "&dsol;", pack "&spades;", pack "&Ccirc;", pack "&bsolb;", pack "&approxeq;", pack "&nearrow;", pack "&boxbox;", pack "&nacute;", pack "&zcy;", pack "&DJcy;", pack "&Uarr;", pack "&easter;", pack "&hellip;", pack "&DoubleDownArrow;", pack "&epar;", pack "&backsim;", pack "&fscr;", pack "&hybull;", pack "&aopf;", pack "&there4;", pack "&sol;", pack "&scirc;", pack "&YAcy;", pack "&zhcy;", pack "&vscr;", pack "&npolint;", pack "&oint;", pack "&varnothing;", pack "&Zcy;", pack "&TRADE;", pack "&UnderParenthesis;", pack "&Fscr;", pack "&ETH", pack "&Rfr;", pack "&napprox;", pack "&leftrightarrow;", pack "&gla;", pack "&nesear;", pack "&sub;", pack "&edot;", pack "&Updownarrow;", pack "&rang;", pack "&Aopf;", pack "&UpDownArrow;", pack "&trade;", pack "&Vscr;", pack "&GreaterEqual;", pack "&bnequiv;", pack "&omacr;", pack "&varsupsetneqq;", pack "&sc;", pack "&eth", pack "&SuchThat;", pack "&ndash;", pack "&lsquor;", pack "&mapstodown;", pack "&LeftRightVector;", pack "&gtrsim;", pack "&Sqrt;", pack "&ReverseEquilibrium;", pack "&rthree;", pack "&ccirc;", pack "&circledR;", pack "&Omacr;", pack "&frac15;", pack "&ZHcy;", pack "&supseteq;", pack "&els;", pack "&suphsol;", pack "&simne;", pack "&duarr;", pack "&Sub;", pack "&DZcy;", pack "&laquo;", pack "&xnis;", pack "&Sc;", pack "&chi;", pack "&UpperLeftArrow;", pack "&NotCongruent;", pack "&lescc;", pack "&SquareSupersetEqual;", pack "&urcorner;", pack "&shy;", pack "&angrtvb;", pack "&SubsetEqual;", pack "&xmap;", pack "&uarr;", pack "&jcy;", pack "&djcy;", pack "&suphsub;", pack "&dollar;", pack "&mlcp;", pack "&DownLeftTeeVector;", pack "&bfr;", pack "&SquareUnion;", pack "&LeftRightArrow;", pack "&Jcy;", pack "&lesseqgtr;", pack "&bigcup;", pack "&REG;", pack "&beta;", pack "&Chi;", pack "&bbrktbrk;", pack "&rfr;", pack "&nsubseteq;", pack "&UpTeeArrow;", pack "&rnmid;", pack "&NotNestedLessLess;", pack "&lfisht;", pack "&times;", pack "&Nacute;", pack "&Bfr;", pack "&excl;", pack "&ncup;", pack "&DownBreve;", pack "&eDot;", pack "&nsucceq;", pack "&rect;", pack "&ropar;", pack "&mcomma;", pack "&updownarrow;", pack "&reg;", pack "&blank;", pack "&Beta;", pack "&bowtie;", pack "&NotRightTriangleBar;", pack "&napid;", pack "&Scirc;", pack "&rcaron;", pack "&Dstrok;", pack "&boxdL;", pack "&Re;", pack "&middot;", pack "&nGt;", pack "&nbumpe;", pack "&nopf;", pack "&tstrok;", pack "&Gcy;", pack "&Rrightarrow;", pack "&coloneq;", pack "&iacute;", pack "&DownArrowUpArrow;", pack "&scsim;", pack "&profline;", pack "&angmsdah;", pack "&DoubleUpDownArrow;", pack "&Nopf;", pack "&yacute;", pack "&loz;", pack "&angzarr;", pack "&Aring;", pack "&Rcaron;", pack "&COPY;", pack "&nvrArr;", pack "&simeq;", pack "&LessSlantEqual;", pack "&ngeq;", pack "&zdot;", pack "&empty;", pack "&Cfr;", pack "&eqcolon;", pack "&aelig", pack "&straightphi;", pack "&lrm;", pack "&QUOT;", pack "&alefsym;", pack "&lates;", pack "&race;", pack "&Iacute;", pack "&Tstrok;", pack "&THORN;", pack "&otilde;", pack "&prod;", pack "&smid;", pack "&DoubleContourIntegral;", pack "&lat;", pack "&rdsh;", pack "&thorn;", pack "&commat;", pack "&andv;", pack "&tosa;", pack "&ldrdhar;", pack "&lg;", pack "&cedil;", pack "&ntrianglelefteq;", pack "&eparsl;", pack "&Intersection;", pack "&urcrop;", pack "&swArr;", pack "&rightharpoondown;", pack "&SucceedsTilde;", pack "&hbar;", pack "&Otilde;", pack "&dstrok;", pack "&diam;", pack "&xrArr;", pack "&quot;", pack "&DoubleRightTee;", pack "&osol;", pack "&supne;", pack "&ngt;", pack "&latail;", pack "&rightarrowtail;", pack "&vartriangleright;", pack "&equals;", pack "&rmoustache;", pack "&Succeeds;", pack "&Sfr;", pack "&lbrkslu;", pack "&sup3;", pack "&cfr;", pack "&xrarr;", pack "&RightVector;", pack "&dtrif;", pack "&RightTeeArrow;", pack "&Yscr;", pack "&aring;", pack "&image;", pack "&supnE;", pack "&subsim;", pack "&swarr;", pack "&elsdot;", pack "&iscr;", pack "&Ouml;", pack "&para", pack "&tcedil;", pack "&Gbreve;", pack "&precsim;", pack "&it;", pack "&becaus;", pack "&lotimes;", pack "&boxDL;", pack "&NotRightTriangle;", pack "&subsetneqq;", pack "&Iscr;", pack "&ThickSpace;", pack "&nsqsupe;", pack "&nlE;", pack "&ocirc", pack "&Tcedil;", pack "&fltns;", pack "&egs;", pack "&Zdot;", pack "&boxtimes;", pack "&LessGreater;", pack "&lAtail;", pack "&Yacute;", pack "&napos;", pack "&curlyeqprec;", pack "&olcross;", pack "&smeparsl;", pack "&biguplus;", pack "&ngtr;", pack "&cups;", pack "&Congruent;", pack "&GreaterFullEqual;", pack "&boxDl;", pack "&fnof;", pack "&bull;", pack "&Barv;", pack "&rarrpl;", pack "&sfr;", pack "&uml", pack "&Ocirc", pack "&sqcaps;", pack "&or;", pack "&nle;", pack "&nexist;", pack "&doteq;", pack "&boxdl;", pack "&AElig", pack "&Superset;", pack "&succcurlyeq;", pack "&npar;", pack "&subdot;", pack "&yscr;", pack "&copy;", pack "&ordm", pack "&gcy;", pack "&UnderBrace;", pack "&gbreve;", pack "&Or;", pack "&ldrushar;", pack "&rlhar;", pack "&ouml;", pack "&ruluhar;", pack "&succneqq;", pack "&longmapsto;", pack "&Emacr;", pack "&nsub;", pack "&mDDot;", pack "&FilledSmallSquare;", pack "&LongLeftArrow;", pack "&Eogon;", pack "&nrarrc;", pack "&sdot;", pack "&nvinfin;", pack "&cupcap;", pack "&plus;", pack "&NotVerticalBar;", pack "&circledast;", pack "&cirmid;", pack "&boxUl;", pack "&supset;", pack "&SHCHcy;", pack "&female;", pack "&LeftAngleBracket;", pack "&varsubsetneqq;", pack "&NewLine;", pack "&sqcap;", pack "&lbrke;", pack "&xcap;", pack "&Sup;", pack "&umacr;", pack "&leftharpoondown;", pack "&pfr;", pack "&lang;", pack "&approx;", pack "&Lscr;", pack "&Aacute", pack "&nleftrightarrow;", pack "&complement;", pack "&lneq;", pack "&setminus;", pack "&NotGreaterLess;", pack "&uogon;", pack "&bullet;", pack "&CupCap;", pack "&nvdash;", pack "&NotSquareSubsetEqual;", pack "&smashp;", pack "&Pfr;", pack "&GreaterTilde;", pack "&Umacr;", pack "&Igrave;", pack "&kopf;", pack "&NotSucceedsEqual;", pack "&NonBreakingSpace;", pack "&nLeftrightarrow;", pack "&varrho;", pack "&boxuL;", pack "&notni;", pack "&eg;", pack "&Lang;", pack "&nsucc;", pack "&cup;", pack "&questeq;", pack "&because;", pack "&Kopf;", pack "&Lcy;", pack "&shortmid;", pack "&Equal;", pack "&nvDash;", pack "&rfloor;", pack "&NotLessEqual;", pack "&boxUL;", pack "&gsiml;", pack "&cuwed;", pack "&Cup;", pack "&NotSupersetEqual;", pack "&late;", pack "&CircleMinus;", pack "&succnapprox;", pack "&Because;", pack "&cdot;", pack "&xodot;", pack "&ic;", pack "&lacute;", pack "&oror;", pack "&ccaps;", pack "&langd;", pack "&gEl;", pack "&sup;", pack "&uharr;", pack "&Backslash;", pack "&aacute", pack "&longleftarrow;", pack "&circlearrowleft;", pack "&divide", pack "&loarr;", pack "&RightFloor;", pack "&lscr;", pack "&angmsd;", pack "&nvltrie;", pack "&not", pack "&igrave;", pack "&lessdot;", pack "&Cdot;", pack "&Lacute;", pack "&gel;", pack "&leftarrowtail;", pack "&ShortLeftArrow;", pack "&homtht;", pack "&boxul;", pack "&drbkarow;", pack "&rightharpoonup;", pack "&Longleftarrow;", pack "&GreaterGreater;", pack "&tridot;", pack "&VerticalTilde;", pack "&Supset;", pack "&lcy;", pack "&urtri;", pack "&rtimes;", pack "&nVDash;", pack "&emacr;", pack "&fflig;", pack "&frasl;", pack "&lgE;", pack "&orslope;", pack "&shchcy;", pack "&eogon;", pack "&deg;", pack "&nVdash;", pack "&Uogon;", pack "&nLtv;", pack "&nleqslant;", pack "&nsubset;", pack "&ycy;", pack "&mdash;", pack "&Ugrave", pack "&rightleftharpoons;", pack "&lcaron;", pack "&LessEqualGreater;", pack "&geq;", pack "&Icy;", pack "&VeryThinSpace;", pack "&xlarr;", pack "&iuml;", pack "&dHar;", pack "&egrave", pack "&Kappa;", pack "&nsce;", pack "&zwj;", pack "&blacklozenge;", pack "&inodot;", pack "&isinv;", pack "&phiv;", pack "&vBarv;", pack "&Lcaron;", pack "&rbrkslu;", pack "&lowbar;", pack "&olcir;", pack "&prap;", pack "&ifr;", pack "&boxVl;", pack "&SquareSubsetEqual;", pack "&roplus;", pack "&bumpe;", pack "&icirc", pack "&Iuml;", pack "&af;", pack "&frac23;", pack "&frac56;", pack "&nprcue;", pack "&yfr;", pack "&barwed;", pack "&ubreve;", pack "&Icirc", pack "&rtrif;", pack "&DiacriticalTilde;", pack "&boxVL;", pack "&Ifr;", pack "&eqslantless;", pack "&bumpE;", pack "&measuredangle;", pack "&Ubreve;", pack "&blacktriangledown;", pack "&ugrave", pack "&apos;", pack "&circ;", pack "&caret;", pack "&Barwed;", pack "&filig;", pack "&khcy;", pack "&sum;", pack "&eplus;", pack "&Precedes;", pack "&uwangle;", pack "&lnap;", pack "&lrhard;", pack "&rotimes;", pack "&boxminus;", pack "&NestedGreaterGreater;", pack "&rbrack;", pack "&nvlArr;", pack "&trianglelefteq;", pack "&EmptySmallSquare;", pack "&lrcorner;", pack "&sigmaf;", pack "&Sum;", pack "&bne;", pack "&nsmid;", pack "&DoubleLongLeftArrow;", pack "&yuml;", pack "&mapstoleft;", pack "&atilde;", pack "&nvgt;", pack "&RightAngleBracket;", pack "&blacktriangle;", pack "&Vert;", pack "&Xi;", pack "&Oacute;", pack "&lpar;", pack "&integers;", pack "&smte;", pack "&vsupne;", pack "&Yuml;", pack "&LeftDownVectorBar;", pack "&rho;", pack "&KHcy;", pack "&smallsetminus;", pack "&nearhk;", pack "&Ycy;", pack "&xlArr;", pack "&imagpart;", pack "&oast;", pack "&Egrave", pack "&gtcir;", pack "&Atilde;", pack "&boxvL;", pack "&wp;", pack "&SmallCircle;", pack "&uplus;", pack "&in;", pack "&OverBar;", pack "&vsupnE;", pack "&UpEquilibrium;", pack "&larrlp;", pack "&emptyset;", pack "&NotReverseElement;", pack "&Rho;", pack "&RightDownTeeVector;", pack "&oscr;", pack "&NotTildeEqual;", pack "&DoubleLeftRightArrow;", pack "&radic;", pack "&boxvl;", pack "&ell;", pack "&popf;", pack "&angmsdab;", pack "&bbrk;", pack "&sigmav;", pack "&suplarr;", pack "&exist;", pack "&Yfr;", pack "&TripleDot;", pack "&pointint;", pack "&notinva;", pack "&sect;", pack "&NotEqual;", pack "&phmmat;", pack "&csup;", pack "&VerticalBar;", pack "&gescc;", pack "&icy;", pack "&cwint;", pack "&oacute;", pack "&xi;", pack "&Oscr;", pack "&subrarr;", pack "&kappa;", pack "&Popf;", pack "&vert;", pack "&thetav;", pack "&infintie;", pack "&Bumpeq;", pack "&upsilon;", pack "&looparrowleft;", pack "&ovbar;", pack "&nlt;", pack "&Colone;", pack "&Atilde", pack "&DownLeftVector;", pack "&efDot;", pack "&downharpoonleft;", pack "&lobrk;", pack "&bigtriangledown;", pack "&plustwo;", pack "&bigvee;", pack "&leqslant;", pack "&lowast;", pack "&yuml", pack "&Ncy;", pack "&ntrianglerighteq;", pack "&YUcy;", pack "&nLt;", pack "&gtrarr;", pack "&bscr;", pack "&intercal;", pack "&gimel;", pack "&vzigzag;", pack "&downdownarrows;", pack "&ecaron;", pack "&sqsubset;", pack "&Epsilon;", pack "&incare;", pack "&nfr;", pack "&ecolon;", pack "&mapsto;", pack "&ccedil;", pack "&iecy;", pack "&expectation;", pack "&exponentiale;", pack "&subsetneq;", pack "&diams;", pack "&scedil;", pack "&rarrbfs;", pack "&Racute;", pack "&Mopf;", pack "&gtrless;", pack "&OverParenthesis;", pack "&ngE;", pack "&Ccedil;", pack "&TildeEqual;", pack "&LeftDownTeeVector;", pack "&Gcirc;", pack "&Dashv;", pack "&bumpeq;", pack "&hkswarow;", pack "&swnwar;", pack "&Jukcy;", pack "&colone;", pack "&atilde", pack "&Oacute", pack "&vnsub;", pack "&InvisibleComma;", pack "&Scedil;", pack "&Wcirc;", pack "&glE;", pack "&verbar;", pack "&nles;", pack "&nexists;", pack "&ContourIntegral;", pack "&ltcir;", pack "&precapprox;", pack "&Ograve;", pack "&sup2;", pack "&ncy;", pack "&esim;", pack "&horbar;", pack "&epsilon;", pack "&Iuml", pack "&supedot;", pack "&AMP;", pack "&npreceq;", pack "&sqsupseteq;", pack "&nang;", pack "&Verbar;", pack "&supdsub;", pack "&Upsilon;", pack "&sqsub;", pack "&bigstar;", pack "&lbrksld;", pack "&racute;", pack "&Esim;", pack "&mopf;", pack "&leftarrow;", pack "&LeftArrow;", pack "&rightrightarrows;", pack "&bkarow;", pack "&HumpEqual;", pack "&NoBreak;", pack "&amp;", pack "&RightTriangle;", pack "&dbkarow;", pack "&gcirc;", pack "&IEcy;", pack "&oS;", pack "&RightDownVectorBar;", pack "&Idot;", pack "&ExponentialE;", pack "&andand;", pack "&dashv;", pack "&sime;", pack "&rscr;", pack "&HorizontalLine;", pack "&sdotb;", pack "&nge;", pack "&supsub;", pack "&upharpoonright;", pack "&Leftarrow;", pack "&Bscr;", pack "&SquareIntersection;", pack "&sect", pack "&olarr;", pack "&wcirc;", pack "&oacute", pack "&jukcy;", pack "&Ecaron;", pack "&die;", pack "&simdot;", pack "&ltquest;", pack "&Nfr;", pack "&ograve;", pack "&Rscr;", pack "&NotPrecedesEqual;", pack "&twoheadleftarrow;", pack "&yucy;", pack "&iuml", pack "&plusb;", pack "&geqq;", pack "&DotDot;", pack "&oplus;", pack "&longrightarrow;", pack "&pre;", pack "&cularrp;", pack "&rarrb;", pack "&Del;", pack "&LeftTee;", pack "&NotLessLess;", pack "&bernou;", pack "&orderof;", pack "&beth;", pack "&lbarr;", pack "&rsh;", pack "&fallingdotseq;", pack "&period;", pack "&zopf;", pack "&curarr;", pack "&Longrightarrow;", pack "&clubsuit;", pack "&LeftFloor;", pack "&hamilt;", pack "&otimesas;", pack "&TildeFullEqual;", pack "&dtri;", pack "&kcy;", pack "&angmsdad;", pack "&LeftTriangle;", pack "&DoubleLongLeftRightArrow;", pack "&boxHd;", pack "&lne;", pack "&cire;", pack "&bdquo;", pack "&Escr;", pack "&Rarrtl;", pack "&NotSquareSupersetEqual;", pack "&shortparallel;", pack "&Kcy;", pack "&reals;", pack "&lurdshar;", pack "&grave;", pack "&gtreqqless;", pack "&oslash", pack "&Odblac;", pack "&plusdo;", pack "&notinE;", pack "&kjcy;", pack "&el;", pack "&boxhd;", pack "&dharl;", pack "&ShortRightArrow;", pack "&circeq;", pack "&cuesc;", pack "&Ofr;", pack "&boxv;", pack "&roang;", pack "&Coproduct;", pack "&lBarr;", pack "&uscr;", pack "&hslash;", pack "&rbbrk;", pack "&notniva;", pack "&ncaron;", pack "&leftrightharpoons;", pack "&HARDcy;", pack "&omid;", pack "&lbrack;", pack "&nsim;", pack "&Jopf;", pack "&DoubleLeftArrow;", pack "&perp;", pack "&iinfin;", pack "&varsubsetneq;", pack "&Hat;", pack "&LongRightArrow;", pack "&heartsuit;", pack "&Ncaron;", pack "&frac25;", pack "&KJcy;", pack "&cent", pack "&Uscr;", pack "&prE;", pack "&gamma;", pack "&curlyeqsucc;", pack "&odblac;", pack "&Implies;", pack "&Assign;", pack "&Rsh;", pack "&gvertneqq;", pack "&and;", pack "&rarrtl;", pack "&escr;", pack "&uring;", pack "&lesseqqgtr;", pack "&gnapprox;", pack "&rHar;", pack "&nsubseteqq;", pack "&LowerLeftArrow;", pack "&boxhD;", pack "&sccue;", pack "&Zopf;", pack "&lhard;", pack "&curvearrowleft;", pack "&boxV;", pack "&llcorner;", pack "&iexcl;", pack "&telrec;", pack "&ofr;", pack "&part;", pack "&rdquo;", pack "&Uring;", pack "&Gamma;", pack "&hardcy;", pack "&And;", pack "&multimap;", pack "&lltri;", pack "&ntgl;", pack "&supseteqq;", pack "&NotGreaterTilde;", pack "&niv;", pack "&ltrPar;", pack "&epsiv;", pack "&geqslant;", pack "&vrtri;", pack "&boxHD;", pack "&lrarr;", pack "&lnE;", pack "&cirE;", pack "&uuarr;", pack "&leftharpoonup;", pack "&eqsim;", pack "&Oslash", pack "&urcorn;", pack "&jopf;", pack "&nwarhk;", pack "&ap;", pack "&sstarf;", pack "&realpart;", pack "&sqcup;", pack "&sharp;", pack "&num;", pack "&Element;", pack "&xcup;", pack "&RightUpTeeVector;", pack "&Wopf;", pack "&lthree;", pack "&prurel;", pack "&operp;", pack "&supsup;", pack "&Hscr;", pack "&Amacr;", pack "&Gopf;", pack "&lvertneqq;", pack "&ccupssm;", pack "&Xscr;", pack "&Iogon;", pack "&Vee;", pack "&dash;", pack "&andslope;", pack "&RightUpVector;", pack "&nrarrw;", pack "&parsl;", pack "&VerticalLine;", pack "&sbquo;", pack "&natur;", pack "&simg;", pack "&Acirc;", pack "&wedge;", pack "&gdot;", pack "&Integral;", pack "&supplus;", pack "&softcy;", pack "&LT;", pack "&Cap;", pack "&complexes;", pack "&ape;", pack "&lfr;", pack "&quatint;", pack "&Wedge;", pack "&HilbertSpace;", pack "&npr;", pack "&rcub;", pack "&Ntilde;", pack "&intprod;", pack "&tritime;", pack "&nsime;", pack "&Lfr;", pack "&qint;", pack "&theta;", pack "&kgreen;", pack "&cupcup;", pack "&wopf;", pack "&trie;", pack "&LeftDoubleBracket;", pack "&hscr;", pack "&Pcy;", pack "&fpartint;", pack "&raquo;", pack "&ngeqq;", pack "&xscr;", pack "&gopf;", pack "&ccups;", pack "&SOFTcy;", pack "&subedot;", pack "&lopar;", pack "&FilledVerySmallSquare;", pack "&fjlig;", pack "&hyphen;", pack "&succeq;", pack "&iexcl", pack "&acirc;", pack "&weierp;", pack "&subseteq;", pack "&apE;", pack "&lesssim;", pack "&lsquo;", pack "&cemptyv;", pack "&cap;", pack "&Lt;", pack "&hoarr;", pack "&psi;", pack "&order;", pack "&LessFullEqual;", pack "&vnsup;", pack "&nsupseteq;", pack "&RightUpDownVector;", pack "&ntilde;", pack "&odiv;", pack "&Fouriertrf;", pack "&bsol;", pack "&nldr;", pack "&RuleDelayed;", pack "&sqsup;", pack "&alpha;", pack "&thicksim;", pack "&triangledown;", pack "&varphi;", pack "&varsigma;", pack "&frac13;", pack "&Equilibrium;", pack "&nGg;", pack "&Gdot;", pack "&pcy;", pack "&xotime;", pack "&Psi;", pack "&spadesuit;", pack "&supsetneq;", pack "&ClockwiseContourIntegral;", pack "&imagline;", pack "&asympeq;", pack "&CounterClockwiseContourIntegral;", pack "&Alpha;", pack "&dotsquare;", pack "&Exists;", pack "&ShortUpArrow;", pack "&trianglerighteq;", pack "&rfisht;", pack "&copysr;", pack "&nleq;", pack "&smtes;", pack "&amacr;", pack "&rharu;", pack "&nwarrow;", pack "&iogon;", pack "&Theta;", pack "&gesdot;", pack "&frown;", pack "&lt;", pack "&vee;", pack "&GreaterEqualLess;", pack "&DownLeftVectorBar;", pack "&agrave", pack "&Sacute;", pack "&sim;", pack "&rAtail;", pack "&yen", pack "&lsh;", pack "&nsimeq;", pack "&nrarr;", pack "&CapitalDifferentialD;", pack "&gesl;", pack "&ETH;", pack "&gesdotol;", pack "&loang;", pack "&RightTeeVector;", pack "&wedgeq;", pack "&bNot;", pack "&lopf;", pack "&Efr;", pack "&kappav;", pack "&UpArrowDownArrow;", pack "&dotplus;", pack "&ntlg;", pack "&mcy;", pack "&Colon;", pack "&subseteqq;", pack "&Product;", pack "&larrb;", pack "&MediumSpace;", pack "&ucirc", pack "&varsupsetneq;", pack "&mnplus;", pack "&permil;", pack "&ogon;", pack "&cirfnint;", pack "&lrtri;", pack "&Mcy;", pack "&coprod;", pack "&succnsim;", pack "&dot;", pack "&pertenk;", pack "&pm;", pack "&ratio;", pack "&frac16;", pack "&topcir;", pack "&ShortDownArrow;", pack "&ncedil;", pack "&Ucirc", pack "&nsubE;", pack "&NotGreaterEqual;", pack "&lArr;", pack "&LeftArrowBar;", pack "&Hcirc;", pack "&sacute;", pack "&hookleftarrow;", pack "&LeftUpVector;", pack "&seArr;", pack "&RightArrow;", pack "&prnE;", pack "&Ufr;", pack "&rationals;", pack "&simplus;", pack "&supe;", pack "&bcong;", pack "&rceil;", pack "&squ;", pack "&Ncedil;", pack "&barwedge;", pack "&ngeqslant;", pack "&searr;", pack "&harrcir;", pack "&NotSubset;", pack "&larr;", pack "&Rightarrow;", pack "&Union;", pack "&scap;", pack "&efr;", pack "&UnionPlus;", pack "&nsupseteqq;", pack "&tdot;", pack "&acute", pack "&supE;", pack "&Kscr;", pack "&colon;", pack "&rhov;", pack "&looparrowright;", pack "&backepsilon;", pack "&micro", pack "&twoheadrightarrow;", pack "&lhblk;", pack "&Agrave", pack "&EmptyVerySmallSquare;", pack "&ldsh;", pack "&dtdot;", pack "&Lsh;", pack "&zwnj;", pack "&Larr;", pack "&Uarrocir;", pack "&ecirc", pack "&bnot;", pack "&RightTriangleBar;", pack "&DownTeeArrow;", pack "&nrArr;", pack "&supsetneqq;", pack "&eth;", pack "&comma;", pack "&sfrown;", pack "&ord;", pack "&vltri;", pack "&puncsp;", pack "&sdote;", pack "&Lopf;", pack "&hcirc;", pack "&xuplus;", pack "&lesdot;", pack "&nsube;", pack "&ufr;", pack "&npart;", pack "&nleqq;", pack "&cacute;", pack "&wreath;", pack "&angle;", pack "&bottom;", pack "&ntriangleleft;", pack "&Ecirc", pack "&cudarrr;", pack "&xcirc;", pack "&gl;", pack "&rightarrow;", pack "&barvee;", pack "&downharpoonright;", pack "&ratail;", pack "&plusacir;", pack "&kscr;", pack "&Proportional;", pack "&pluse;", pack "&Cacute;", pack "&plusdu;", pack "&gtquest;", pack "&topfork;", pack "&Dot;", pack "&bepsi;", pack "&EqualTilde;", pack "&DownLeftRightVector;", pack "&NotLessGreater;", pack "&ring;", pack "&Iopf;", pack "&Jfr;", pack "&LJcy;", pack "&erarr;", pack "&SquareSuperset;", pack "&zeta;", pack "&angrt;", pack "&Uuml", pack "&forkv;", pack "&leftleftarrows;", pack "&nspar;", pack "&szlig", pack "&rpargt;", pack "&Subset;", pack "&lesdotor;", pack "&Cedilla;", pack "&triangleright;", pack "&squarf;", pack "&yicy;", pack "&ohm;", pack "&boxHu;", pack "&LeftDownVector;", pack "&ii;", pack "&gneqq;", pack "&DoubleRightArrow;", pack "&rtriltri;", pack "&Zeta;", pack "&blk14;", pack "&boxHU;", pack "&dfisht;", pack "&mho;", pack "&nbsp", pack "&vDash;", pack "&erDot;", pack "&pluscir;", pack "&euml", pack "&angmsdae;", pack "&bigsqcup;", pack "&Gcedil;", pack "&napE;", pack "&larrhk;", pack "&LeftTeeArrow;", pack "&iquest", pack "&nparsl;", pack "&Breve;", pack "&ltcc;", pack "&YIcy;", pack "&iopf;", pack "&forall;", pack "&Rcy;", pack "&vdash;", pack "&DownArrowBar;", pack "&zfr;", pack "&duhar;", pack "&ngsim;", pack "&fllig;", pack "&DownTee;", pack "&subset;", pack "&CircleTimes;", pack "&rmoust;", pack "&uuml", pack "&mstpos;", pack "&LeftTeeVector;", pack "&DownRightVectorBar;", pack "&Vdash;", pack "&Mu;", pack "&plankv;", pack "&gg;", pack "&lnapprox;", pack "&elinters;", pack "&uHar;", pack "&lozenge;", pack "&Oslash;", pack "&Nscr;", pack "&yopf;", pack "&lcub;", pack "&iprod;", pack "&Zfr;", pack "&rarrc;", pack "&lharu;", pack "&LowerRightArrow;", pack "&nisd;", pack "&ncongdot;", pack "&nvrtrie;", pack "&VDash;", pack "&GT", pack "&Gg;", pack "&searhk;", pack "&boxhU;", pack "&Yopf;", pack "&asymp;", pack "&bcy;", pack "&trpezium;", pack "&nbump;", pack "&succ;", pack "&ctdot;", pack "&rcy;", pack "&ltimes;", pack "&isinsv;", pack "&breve;", pack "&boxhu;", pack "&NegativeMediumSpace;", pack "&divideontimes;", pack "&GreaterSlantEqual;", pack "&ljcy;", pack "&apacir;", pack "&frac34", pack "&UnderBracket;", pack "&Bcy;", pack "&divonx;", pack "&marker;", pack "&NegativeThickSpace;", pack "&rx;", pack "&jfr;", pack "&mu;", pack "&nsupset;", pack "&oslash;", pack "&gt", pack "&ForAll;", pack "&Euml", pack "&utrif;", pack "&nscr;", pack "&cylcty;", pack "&cent;", pack "&equivDD;", pack "&nabla;", pack "&larrsim;", pack "&NegativeVeryThinSpace;"]
zudov/html5-entity
src/Text/Html/Entity/Data.hs
bsd-3-clause
113,739
0
8
23,814
47,228
27,017
20,211
1,801
1
{-# LANGUAGE UndecidableInstances , TypeSynonymInstances , MultiParamTypeClasses , DeriveDataTypeable , FlexibleInstances #-} {- | Instantiation of the "MFlow" server for the Hack interface see <http://hackage.haskell.org/package/hack> -} module MFlow.Hack( module MFlow.Cookies ,module MFlow ,hackMessageFlow) where import Data.Typeable import Hack import Control.Concurrent.MVar(modifyMVar_, readMVar) import Control.Monad(when) import Data.ByteString.Lazy.Char8 as B(pack, unpack, length, ByteString) import Control.Concurrent(ThreadId(..)) import System.IO.Unsafe import Control.Concurrent.MVar import Control.Concurrent import Control.Exception import qualified Data.Map as M import Data.Maybe import Data.TCache import Data.TCache.DefaultPersistence import Control.Workflow hiding (Indexable(..)) import MFlow import MFlow.Cookies import MFlow.Hack.Response import Data.Monoid import Data.CaseInsensitive import System.Time import System.Time flow= "flow" instance Processable Env where pwfname env= if null sc then noScript else sc where sc= tail $ pathInfo env puser env = fromMaybe anonymous $ lookup cookieuser $ http env pind env= fromMaybe (error ": No FlowID") $ lookup flow $ http env getParams= http -- getServer env= serverName env -- getPath env= pathInfo env -- getPort env= serverPort env --------------------------------------------- -- --instance ConvertTo String TResp where -- convert = TResp . pack -- --instance ConvertTo ByteString TResp where -- convert = TResp -- -- --instance ConvertTo Error TResp where -- convert (Error e)= TResp . pack $ errorResponse e -- --instance ToResponse v =>ConvertTo (HttpData v) TResp where -- convert= TRespR --webScheduler :: Env -- -> ProcList -- -> IO (TResp, ThreadId) --webScheduler = msgScheduler --theDir= unsafePerformIO getCurrentDirectory wFMiddleware :: (Env -> Bool) -> (Env-> IO Response) -> (Env -> IO Response) wFMiddleware filter f = \ env -> if filter env then hackMessageFlow env else f env -- !> "new message" -- | An instance of the abstract "MFlow" scheduler to the Hack interface -- it accept the list of processes being scheduled and return a hack handler -- -- Example: -- -- @main= do -- -- putStrLn $ options messageFlows -- 'run' 80 $ 'hackMessageFlow' messageFlows -- where -- messageFlows= [(\"main\", 'runFlow' flowname ) -- ,(\"hello\", 'stateless' statelesproc) -- ,(\"trans\", 'transient' $ runflow transientflow] -- options msgs= \"in the browser choose\\n\\n\" ++ -- concat [ "http:\/\/server\/"++ i ++ "\n" | (i,_) \<- msgs] -- @ --hackMessageFlow :: [(String, (Token -> Workflow IO ()))] -- -> (Env -> IO Response) --hackMessageFlow messageFlows = -- unsafePerformIO (addMessageFlows messageFlows) `seq` -- hackWorkflow -- wFMiddleware f other -- where -- f env = unsafePerformIO $ do -- paths <- getMessageFlows >>= -- return (pwfname env `elem` paths) -- other= (\env -> defaultResponse $ "options: " ++ opts) -- (paths,_)= unzip messageFlows -- opts= concatMap (\s -> "<a href=\""++ s ++"\">"++s ++"</a>, ") paths splitPath ""= ("","","") splitPath str= let strr= reverse str (ext, rest)= span (/= '.') strr (mod, path)= span(/='/') $ tail rest in (tail $ reverse path, reverse mod, reverse ext) hackMessageFlow :: Env -> IO Response hackMessageFlow req1= do let httpreq1= http req1 let cookies= {-# SCC "getCookies" #-} getCookies httpreq1 (flowval , retcookies) <- case lookup ( flow) cookies of Just fl -> return (fl, []) Nothing -> do fl <- newFlow return ( fl, [( flow, fl, "/",(Just $ show $ 365*24*60*60))]) {- for state persistence in cookies putStateCookie req1 cookies let retcookies= case getStateCookie req1 of Nothing -> retcookies1 Just ck -> ck:retcookies1 -} let input= case ( requestMethod req1, lookup "Content-Type" httpreq1 ) of (POST,Just "application/x-www-form-urlencoded") -> urlDecode . unpack $ hackInput req1 (GET, _) -> urlDecode . queryString $ req1 _ -> [] let req = case retcookies of [] -> req1{http= (input ++ cookies) ++ http req1} -- !> "REQ" _ -> req1{http=(flow, flowval): ( input ++ cookies ) ++ http req1} -- !> "REQ" (resp',th) <- msgScheduler req let resp''= toResponse resp' let headers1= case retcookies of [] -> headers resp''; _ -> (cookieHeaders retcookies) let resp = resp''{status=200, headers= headers1 {-,("Content-Length",show $ B.length x) -}} return resp ------persistent state in cookies (not tested) tvresources :: MVar (Maybe ( M.Map string string)) tvresources= unsafePerformIO $ newMVar Nothing statCookieName= "stat" putStateCookie req cookies= case lookup statCookieName cookies of Nothing -> return () Just (statCookieName, str , "/", _) -> modifyMVar_ tvresources $ \mmap -> case mmap of Just map -> return $ Just $ M.insert (keyResource req) str map Nothing -> return $ Just $ M.fromList [((keyResource req), str) ] getStateCookie req= do mr<- readMVar tvresources case mr of Nothing -> return Nothing Just map -> case M.lookup (keyResource req) map of Nothing -> return Nothing Just str -> do swapMVar tvresources Nothing return $ Just (statCookieName, str , "/") {- persistInCookies= setPersist PersistStat{readStat=readResource, writeStat=writeResource, deleteStat=deleteResource} where writeResource stat= modifyMVar_ tvresources $ \mmap -> case mmap of Just map-> return $ Just $ M.insert (keyResource stat) (serialize stat) map Nothing -> return $ Just $ M.fromList [((keyResource stat), (serialize stat)) ] readResource stat= do mstr <- withMVar tvresources $ \mmap -> case mmap of Just map -> return $ M.lookup (keyResource stat) map Nothing -> return Nothing case mstr of Nothing -> return Nothing Just str -> return $ deserialize str deleteResource stat= modifyMVar_ tvresources $ \mmap-> case mmap of Just map -> return $ Just $ M.delete (keyResource stat) map Nothing -> return $ Nothing -}
agocorona/MFlow
src/MFlow/Hack.hs
bsd-3-clause
6,964
0
22
2,033
1,219
669
550
88
6
{- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[PrelNames]{Definitions of prelude modules and names} Nota Bene: all Names defined in here should come from the base package - ModuleNames for prelude modules, e.g. pREL_BASE_Name :: ModuleName - Modules for prelude modules e.g. pREL_Base :: Module - Uniques for Ids, DataCons, TyCons and Classes that the compiler "knows about" in some way e.g. intTyConKey :: Unique minusClassOpKey :: Unique - Names for Ids, DataCons, TyCons and Classes that the compiler "knows about" in some way e.g. intTyConName :: Name minusName :: Name One of these Names contains (a) the module and occurrence name of the thing (b) its Unique The way the compiler "knows about" one of these things is where the type checker or desugarer needs to look it up. For example, when desugaring list comprehensions the desugarer needs to conjure up 'foldr'. It does this by looking up foldrName in the environment. - RdrNames for Ids, DataCons etc that the compiler may emit into generated code (e.g. for deriving). It's not necessary to know the uniques for these guys, only their names Note [Known-key names] ~~~~~~~~~~~~~~~~~~~~~~ It is *very* important that the compiler gives wired-in things and things with "known-key" names the correct Uniques wherever they occur. We have to be careful about this in exactly two places: 1. When we parse some source code, renaming the AST better yield an AST whose Names have the correct uniques 2. When we read an interface file, the read-in gubbins better have the right uniques This is accomplished through a combination of mechanisms: 1. When parsing source code, the RdrName-decorated AST has some RdrNames which are Exact. These are wired-in RdrNames where the we could directly tell from the parsed syntax what Name to use. For example, when we parse a [] in a type we can just insert an Exact RdrName Name with the listTyConKey. Currently, I believe this is just an optimisation: it would be equally valid to just output Orig RdrNames that correctly record the module etc we expect the final Name to come from. However, were we to eliminate isBuiltInOcc_maybe it would become essential (see point 3). 2. The knownKeyNames (which consist of the basicKnownKeyNames from the module, and those names reachable via the wired-in stuff from TysWiredIn) are used to initialise the "OrigNameCache" in IfaceEnv. This initialization ensures that when the type checker or renamer (both of which use IfaceEnv) look up an original name (i.e. a pair of a Module and an OccName) for a known-key name they get the correct Unique. This is the most important mechanism for ensuring that known-key stuff gets the right Unique, and is why it is so important to place your known-key names in the appropriate lists. 3. For "infinite families" of known-key names (i.e. tuples and sums), we have to be extra careful. Because there are an infinite number of these things, we cannot add them to the list of known-key names used to initialise the OrigNameCache. Instead, we have to rely on never having to look them up in that cache. See Note [Infinite families of known-key names] for details. Note [Infinite families of known-key names] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Infinite families of known-key things (e.g. tuples and sums) pose a tricky problem: we can't add them to the knownKeyNames finite map which we use to ensure that, e.g., a reference to (,) gets assigned the right unique (if this doesn't sound familiar see Note [Known-key names] above). We instead handle tuples and sums separately from the "vanilla" known-key things, a) The parser recognises them specially and generates an Exact Name (hence not looked up in the orig-name cache) b) The known infinite families of names are specially serialised by BinIface.putName, with that special treatment detected when we read back to ensure that we get back to the correct uniques. See Note [Symbol table representation of names] in BinIface and Note [How tuples work] in TysWiredIn. Most of the infinite families cannot occur in source code, so mechanisms (a) and (b) suffice to ensure that they always have the right Unique. In particular, implicit param TyCon names, constraint tuples and Any TyCons cannot be mentioned by the user. For those things that *can* appear in source programs, c) IfaceEnv.lookupOrigNameCache uses isBuiltInOcc_maybe to map built-in syntax directly onto the corresponding name, rather than trying to find it in the original-name cache. See also Note [Built-in syntax and the OrigNameCache] -} {-# LANGUAGE CPP #-} module PrelNames ( Unique, Uniquable(..), hasKey, -- Re-exported for convenience ----------------------------------------------------------- module PrelNames, -- A huge bunch of (a) Names, e.g. intTyConName -- (b) Uniques e.g. intTyConKey -- (c) Groups of classes and types -- (d) miscellaneous things -- So many that we export them all ) where #include "HsVersions.h" import GhcPrelude import Module import OccName import RdrName import Unique import Name import SrcLoc import FastString import Config ( cIntegerLibraryType, IntegerLibrary(..) ) import Panic ( panic ) {- ************************************************************************ * * allNameStrings * * ************************************************************************ -} allNameStrings :: [String] -- Infinite list of a,b,c...z, aa, ab, ac, ... etc allNameStrings = [ c:cs | cs <- "" : allNameStrings, c <- ['a'..'z'] ] {- ************************************************************************ * * \subsection{Local Names} * * ************************************************************************ This *local* name is used by the interactive stuff -} itName :: Unique -> SrcSpan -> Name itName uniq loc = mkInternalName uniq (mkOccNameFS varName (fsLit "it")) loc -- mkUnboundName makes a place-holder Name; it shouldn't be looked at except possibly -- during compiler debugging. mkUnboundName :: OccName -> Name mkUnboundName occ = mkInternalName unboundKey occ noSrcSpan isUnboundName :: Name -> Bool isUnboundName name = name `hasKey` unboundKey {- ************************************************************************ * * \subsection{Known key Names} * * ************************************************************************ This section tells what the compiler knows about the association of names with uniques. These ones are the *non* wired-in ones. The wired in ones are defined in TysWiredIn etc. -} basicKnownKeyNames :: [Name] basicKnownKeyNames = genericTyConNames ++ [ -- Classes. *Must* include: -- classes that are grabbed by key (e.g., eqClassKey) -- classes in "Class.standardClassKeys" (quite a few) eqClassName, -- mentioned, derivable ordClassName, -- derivable boundedClassName, -- derivable numClassName, -- mentioned, numeric enumClassName, -- derivable monadClassName, functorClassName, realClassName, -- numeric integralClassName, -- numeric fractionalClassName, -- numeric floatingClassName, -- numeric realFracClassName, -- numeric realFloatClassName, -- numeric dataClassName, isStringClassName, applicativeClassName, alternativeClassName, foldableClassName, traversableClassName, semigroupClassName, sappendName, monoidClassName, memptyName, mappendName, mconcatName, -- The IO type -- See Note [TyConRepNames for non-wired-in TyCons] ioTyConName, ioDataConName, runMainIOName, -- Type representation types trModuleTyConName, trModuleDataConName, trNameTyConName, trNameSDataConName, trNameDDataConName, trTyConTyConName, trTyConDataConName, -- Typeable typeableClassName, typeRepTyConName, someTypeRepTyConName, someTypeRepDataConName, kindRepTyConName, kindRepTyConAppDataConName, kindRepVarDataConName, kindRepAppDataConName, kindRepFunDataConName, kindRepTYPEDataConName, kindRepTypeLitSDataConName, kindRepTypeLitDDataConName, typeLitSortTyConName, typeLitSymbolDataConName, typeLitNatDataConName, typeRepIdName, mkTrConName, mkTrAppName, mkTrFunName, typeSymbolTypeRepName, typeNatTypeRepName, trGhcPrimModuleName, -- KindReps for common cases starKindRepName, starArrStarKindRepName, starArrStarArrStarKindRepName, -- Dynamic toDynName, -- Numeric stuff negateName, minusName, geName, eqName, -- Conversion functions rationalTyConName, ratioTyConName, ratioDataConName, fromRationalName, fromIntegerName, toIntegerName, toRationalName, fromIntegralName, realToFracName, -- Int# stuff divIntName, modIntName, -- String stuff fromStringName, -- Enum stuff enumFromName, enumFromThenName, enumFromThenToName, enumFromToName, -- Applicative stuff pureAName, apAName, thenAName, -- Functor stuff fmapName, -- Monad stuff thenIOName, bindIOName, returnIOName, failIOName, bindMName, thenMName, returnMName, joinMName, -- MonadFail monadFailClassName, failMName, failMName_preMFP, -- MonadFix monadFixClassName, mfixName, -- Arrow stuff arrAName, composeAName, firstAName, appAName, choiceAName, loopAName, -- Ix stuff ixClassName, -- Show stuff showClassName, -- Read stuff readClassName, -- Stable pointers newStablePtrName, -- GHC Extensions groupWithName, -- Strings and lists unpackCStringName, unpackCStringFoldrName, unpackCStringUtf8Name, -- Overloaded lists isListClassName, fromListName, fromListNName, toListName, -- List operations concatName, filterName, mapName, zipName, foldrName, buildName, augmentName, appendName, -- FFI primitive types that are not wired-in. stablePtrTyConName, ptrTyConName, funPtrTyConName, int8TyConName, int16TyConName, int32TyConName, int64TyConName, word16TyConName, word32TyConName, word64TyConName, -- Others otherwiseIdName, inlineIdName, eqStringName, assertName, breakpointName, breakpointCondName, breakpointAutoName, opaqueTyConName, assertErrorName, printName, fstName, sndName, -- Integer integerTyConName, mkIntegerName, integerToWord64Name, integerToInt64Name, word64ToIntegerName, int64ToIntegerName, plusIntegerName, timesIntegerName, smallIntegerName, wordToIntegerName, integerToWordName, integerToIntName, minusIntegerName, negateIntegerName, eqIntegerPrimName, neqIntegerPrimName, absIntegerName, signumIntegerName, leIntegerPrimName, gtIntegerPrimName, ltIntegerPrimName, geIntegerPrimName, compareIntegerName, quotRemIntegerName, divModIntegerName, quotIntegerName, remIntegerName, divIntegerName, modIntegerName, floatFromIntegerName, doubleFromIntegerName, encodeFloatIntegerName, encodeDoubleIntegerName, decodeDoubleIntegerName, gcdIntegerName, lcmIntegerName, andIntegerName, orIntegerName, xorIntegerName, complementIntegerName, shiftLIntegerName, shiftRIntegerName, bitIntegerName, -- Natural naturalTyConName, naturalFromIntegerName, -- Float/Double rationalToFloatName, rationalToDoubleName, -- Other classes randomClassName, randomGenClassName, monadPlusClassName, -- Type-level naturals knownNatClassName, knownSymbolClassName, -- Overloaded labels isLabelClassName, -- Implicit Parameters ipClassName, -- Overloaded record fields hasFieldClassName, -- Call Stacks callStackTyConName, emptyCallStackName, pushCallStackName, -- Source Locations srcLocDataConName, -- Annotation type checking toAnnotationWrapperName -- The Ordering type , orderingTyConName , ltDataConName, eqDataConName, gtDataConName -- The SPEC type for SpecConstr , specTyConName -- The Either type , eitherTyConName, leftDataConName, rightDataConName -- Plugins , pluginTyConName , frontendPluginTyConName -- Generics , genClassName, gen1ClassName , datatypeClassName, constructorClassName, selectorClassName -- Monad comprehensions , guardMName , liftMName , mzipName -- GHCi Sandbox , ghciIoClassName, ghciStepIoMName -- StaticPtr , makeStaticName , staticPtrTyConName , staticPtrDataConName, staticPtrInfoDataConName , fromStaticPtrName -- Fingerprint , fingerprintDataConName -- Custom type errors , errorMessageTypeErrorFamName , typeErrorTextDataConName , typeErrorAppendDataConName , typeErrorVAppendDataConName , typeErrorShowTypeDataConName -- homogeneous equality , eqTyConName ] ++ case cIntegerLibraryType of IntegerGMP -> [integerSDataConName] IntegerSimple -> [] genericTyConNames :: [Name] genericTyConNames = [ v1TyConName, u1TyConName, par1TyConName, rec1TyConName, k1TyConName, m1TyConName, sumTyConName, prodTyConName, compTyConName, rTyConName, dTyConName, cTyConName, sTyConName, rec0TyConName, d1TyConName, c1TyConName, s1TyConName, noSelTyConName, repTyConName, rep1TyConName, uRecTyConName, uAddrTyConName, uCharTyConName, uDoubleTyConName, uFloatTyConName, uIntTyConName, uWordTyConName, prefixIDataConName, infixIDataConName, leftAssociativeDataConName, rightAssociativeDataConName, notAssociativeDataConName, sourceUnpackDataConName, sourceNoUnpackDataConName, noSourceUnpackednessDataConName, sourceLazyDataConName, sourceStrictDataConName, noSourceStrictnessDataConName, decidedLazyDataConName, decidedStrictDataConName, decidedUnpackDataConName, metaDataDataConName, metaConsDataConName, metaSelDataConName ] {- ************************************************************************ * * \subsection{Module names} * * ************************************************************************ --MetaHaskell Extension Add a new module here -} pRELUDE :: Module pRELUDE = mkBaseModule_ pRELUDE_NAME gHC_PRIM, gHC_TYPES, gHC_GENERICS, gHC_MAGIC, gHC_CLASSES, gHC_BASE, gHC_ENUM, gHC_GHCI, gHC_CSTRING, gHC_SHOW, gHC_READ, gHC_NUM, gHC_INTEGER_TYPE, gHC_NATURAL, gHC_LIST, gHC_TUPLE, dATA_TUPLE, dATA_EITHER, dATA_STRING, dATA_FOLDABLE, dATA_TRAVERSABLE, gHC_CONC, gHC_IO, gHC_IO_Exception, gHC_ST, gHC_ARR, gHC_STABLE, gHC_PTR, gHC_ERR, gHC_REAL, gHC_FLOAT, gHC_TOP_HANDLER, sYSTEM_IO, dYNAMIC, tYPEABLE, tYPEABLE_INTERNAL, gENERICS, rEAD_PREC, lEX, gHC_INT, gHC_WORD, mONAD, mONAD_FIX, mONAD_ZIP, mONAD_FAIL, aRROW, cONTROL_APPLICATIVE, gHC_DESUGAR, rANDOM, gHC_EXTS, cONTROL_EXCEPTION_BASE, gHC_TYPELITS, gHC_TYPENATS, dATA_TYPE_EQUALITY, dATA_COERCE :: Module gHC_PRIM = mkPrimModule (fsLit "GHC.Prim") -- Primitive types and values gHC_TYPES = mkPrimModule (fsLit "GHC.Types") gHC_MAGIC = mkPrimModule (fsLit "GHC.Magic") gHC_CSTRING = mkPrimModule (fsLit "GHC.CString") gHC_CLASSES = mkPrimModule (fsLit "GHC.Classes") gHC_BASE = mkBaseModule (fsLit "GHC.Base") gHC_ENUM = mkBaseModule (fsLit "GHC.Enum") gHC_GHCI = mkBaseModule (fsLit "GHC.GHCi") gHC_SHOW = mkBaseModule (fsLit "GHC.Show") gHC_READ = mkBaseModule (fsLit "GHC.Read") gHC_NUM = mkBaseModule (fsLit "GHC.Num") gHC_INTEGER_TYPE= mkIntegerModule (fsLit "GHC.Integer.Type") gHC_NATURAL = mkBaseModule (fsLit "GHC.Natural") gHC_LIST = mkBaseModule (fsLit "GHC.List") gHC_TUPLE = mkPrimModule (fsLit "GHC.Tuple") dATA_TUPLE = mkBaseModule (fsLit "Data.Tuple") dATA_EITHER = mkBaseModule (fsLit "Data.Either") dATA_STRING = mkBaseModule (fsLit "Data.String") dATA_FOLDABLE = mkBaseModule (fsLit "Data.Foldable") dATA_TRAVERSABLE= mkBaseModule (fsLit "Data.Traversable") gHC_CONC = mkBaseModule (fsLit "GHC.Conc") gHC_IO = mkBaseModule (fsLit "GHC.IO") gHC_IO_Exception = mkBaseModule (fsLit "GHC.IO.Exception") gHC_ST = mkBaseModule (fsLit "GHC.ST") gHC_ARR = mkBaseModule (fsLit "GHC.Arr") gHC_STABLE = mkBaseModule (fsLit "GHC.Stable") gHC_PTR = mkBaseModule (fsLit "GHC.Ptr") gHC_ERR = mkBaseModule (fsLit "GHC.Err") gHC_REAL = mkBaseModule (fsLit "GHC.Real") gHC_FLOAT = mkBaseModule (fsLit "GHC.Float") gHC_TOP_HANDLER = mkBaseModule (fsLit "GHC.TopHandler") sYSTEM_IO = mkBaseModule (fsLit "System.IO") dYNAMIC = mkBaseModule (fsLit "Data.Dynamic") tYPEABLE = mkBaseModule (fsLit "Data.Typeable") tYPEABLE_INTERNAL = mkBaseModule (fsLit "Data.Typeable.Internal") gENERICS = mkBaseModule (fsLit "Data.Data") rEAD_PREC = mkBaseModule (fsLit "Text.ParserCombinators.ReadPrec") lEX = mkBaseModule (fsLit "Text.Read.Lex") gHC_INT = mkBaseModule (fsLit "GHC.Int") gHC_WORD = mkBaseModule (fsLit "GHC.Word") mONAD = mkBaseModule (fsLit "Control.Monad") mONAD_FIX = mkBaseModule (fsLit "Control.Monad.Fix") mONAD_ZIP = mkBaseModule (fsLit "Control.Monad.Zip") mONAD_FAIL = mkBaseModule (fsLit "Control.Monad.Fail") aRROW = mkBaseModule (fsLit "Control.Arrow") cONTROL_APPLICATIVE = mkBaseModule (fsLit "Control.Applicative") gHC_DESUGAR = mkBaseModule (fsLit "GHC.Desugar") rANDOM = mkBaseModule (fsLit "System.Random") gHC_EXTS = mkBaseModule (fsLit "GHC.Exts") cONTROL_EXCEPTION_BASE = mkBaseModule (fsLit "Control.Exception.Base") gHC_GENERICS = mkBaseModule (fsLit "GHC.Generics") gHC_TYPELITS = mkBaseModule (fsLit "GHC.TypeLits") gHC_TYPENATS = mkBaseModule (fsLit "GHC.TypeNats") dATA_TYPE_EQUALITY = mkBaseModule (fsLit "Data.Type.Equality") dATA_COERCE = mkBaseModule (fsLit "Data.Coerce") gHC_PARR' :: Module gHC_PARR' = mkBaseModule (fsLit "GHC.PArr") gHC_SRCLOC :: Module gHC_SRCLOC = mkBaseModule (fsLit "GHC.SrcLoc") gHC_STACK, gHC_STACK_TYPES :: Module gHC_STACK = mkBaseModule (fsLit "GHC.Stack") gHC_STACK_TYPES = mkBaseModule (fsLit "GHC.Stack.Types") gHC_STATICPTR :: Module gHC_STATICPTR = mkBaseModule (fsLit "GHC.StaticPtr") gHC_STATICPTR_INTERNAL :: Module gHC_STATICPTR_INTERNAL = mkBaseModule (fsLit "GHC.StaticPtr.Internal") gHC_FINGERPRINT_TYPE :: Module gHC_FINGERPRINT_TYPE = mkBaseModule (fsLit "GHC.Fingerprint.Type") gHC_OVER_LABELS :: Module gHC_OVER_LABELS = mkBaseModule (fsLit "GHC.OverloadedLabels") gHC_RECORDS :: Module gHC_RECORDS = mkBaseModule (fsLit "GHC.Records") mAIN, rOOT_MAIN :: Module mAIN = mkMainModule_ mAIN_NAME rOOT_MAIN = mkMainModule (fsLit ":Main") -- Root module for initialisation mkInteractiveModule :: Int -> Module -- (mkInteractiveMoudule 9) makes module 'interactive:M9' mkInteractiveModule n = mkModule interactiveUnitId (mkModuleName ("Ghci" ++ show n)) pRELUDE_NAME, mAIN_NAME :: ModuleName pRELUDE_NAME = mkModuleNameFS (fsLit "Prelude") mAIN_NAME = mkModuleNameFS (fsLit "Main") dATA_ARRAY_PARALLEL_NAME, dATA_ARRAY_PARALLEL_PRIM_NAME :: ModuleName dATA_ARRAY_PARALLEL_NAME = mkModuleNameFS (fsLit "Data.Array.Parallel") dATA_ARRAY_PARALLEL_PRIM_NAME = mkModuleNameFS (fsLit "Data.Array.Parallel.Prim") mkPrimModule :: FastString -> Module mkPrimModule m = mkModule primUnitId (mkModuleNameFS m) mkIntegerModule :: FastString -> Module mkIntegerModule m = mkModule integerUnitId (mkModuleNameFS m) mkBaseModule :: FastString -> Module mkBaseModule m = mkModule baseUnitId (mkModuleNameFS m) mkBaseModule_ :: ModuleName -> Module mkBaseModule_ m = mkModule baseUnitId m mkThisGhcModule :: FastString -> Module mkThisGhcModule m = mkModule thisGhcUnitId (mkModuleNameFS m) mkThisGhcModule_ :: ModuleName -> Module mkThisGhcModule_ m = mkModule thisGhcUnitId m mkMainModule :: FastString -> Module mkMainModule m = mkModule mainUnitId (mkModuleNameFS m) mkMainModule_ :: ModuleName -> Module mkMainModule_ m = mkModule mainUnitId m {- ************************************************************************ * * RdrNames * * ************************************************************************ -} main_RDR_Unqual :: RdrName main_RDR_Unqual = mkUnqual varName (fsLit "main") -- We definitely don't want an Orig RdrName, because -- main might, in principle, be imported into module Main forall_tv_RDR, dot_tv_RDR :: RdrName forall_tv_RDR = mkUnqual tvName (fsLit "forall") dot_tv_RDR = mkUnqual tvName (fsLit ".") eq_RDR, ge_RDR, le_RDR, lt_RDR, gt_RDR, compare_RDR, ltTag_RDR, eqTag_RDR, gtTag_RDR :: RdrName eq_RDR = nameRdrName eqName ge_RDR = nameRdrName geName le_RDR = varQual_RDR gHC_CLASSES (fsLit "<=") lt_RDR = varQual_RDR gHC_CLASSES (fsLit "<") gt_RDR = varQual_RDR gHC_CLASSES (fsLit ">") compare_RDR = varQual_RDR gHC_CLASSES (fsLit "compare") ltTag_RDR = dataQual_RDR gHC_TYPES (fsLit "LT") eqTag_RDR = dataQual_RDR gHC_TYPES (fsLit "EQ") gtTag_RDR = dataQual_RDR gHC_TYPES (fsLit "GT") eqClass_RDR, numClass_RDR, ordClass_RDR, enumClass_RDR, monadClass_RDR :: RdrName eqClass_RDR = nameRdrName eqClassName numClass_RDR = nameRdrName numClassName ordClass_RDR = nameRdrName ordClassName enumClass_RDR = nameRdrName enumClassName monadClass_RDR = nameRdrName monadClassName map_RDR, append_RDR :: RdrName map_RDR = varQual_RDR gHC_BASE (fsLit "map") append_RDR = varQual_RDR gHC_BASE (fsLit "++") foldr_RDR, build_RDR, returnM_RDR, bindM_RDR, failM_RDR_preMFP, failM_RDR:: RdrName foldr_RDR = nameRdrName foldrName build_RDR = nameRdrName buildName returnM_RDR = nameRdrName returnMName bindM_RDR = nameRdrName bindMName failM_RDR_preMFP = nameRdrName failMName_preMFP failM_RDR = nameRdrName failMName left_RDR, right_RDR :: RdrName left_RDR = nameRdrName leftDataConName right_RDR = nameRdrName rightDataConName fromEnum_RDR, toEnum_RDR :: RdrName fromEnum_RDR = varQual_RDR gHC_ENUM (fsLit "fromEnum") toEnum_RDR = varQual_RDR gHC_ENUM (fsLit "toEnum") enumFrom_RDR, enumFromTo_RDR, enumFromThen_RDR, enumFromThenTo_RDR :: RdrName enumFrom_RDR = nameRdrName enumFromName enumFromTo_RDR = nameRdrName enumFromToName enumFromThen_RDR = nameRdrName enumFromThenName enumFromThenTo_RDR = nameRdrName enumFromThenToName ratioDataCon_RDR, plusInteger_RDR, timesInteger_RDR :: RdrName ratioDataCon_RDR = nameRdrName ratioDataConName plusInteger_RDR = nameRdrName plusIntegerName timesInteger_RDR = nameRdrName timesIntegerName ioDataCon_RDR :: RdrName ioDataCon_RDR = nameRdrName ioDataConName eqString_RDR, unpackCString_RDR, unpackCStringFoldr_RDR, unpackCStringUtf8_RDR :: RdrName eqString_RDR = nameRdrName eqStringName unpackCString_RDR = nameRdrName unpackCStringName unpackCStringFoldr_RDR = nameRdrName unpackCStringFoldrName unpackCStringUtf8_RDR = nameRdrName unpackCStringUtf8Name newStablePtr_RDR :: RdrName newStablePtr_RDR = nameRdrName newStablePtrName bindIO_RDR, returnIO_RDR :: RdrName bindIO_RDR = nameRdrName bindIOName returnIO_RDR = nameRdrName returnIOName fromInteger_RDR, fromRational_RDR, minus_RDR, times_RDR, plus_RDR :: RdrName fromInteger_RDR = nameRdrName fromIntegerName fromRational_RDR = nameRdrName fromRationalName minus_RDR = nameRdrName minusName times_RDR = varQual_RDR gHC_NUM (fsLit "*") plus_RDR = varQual_RDR gHC_NUM (fsLit "+") toInteger_RDR, toRational_RDR, fromIntegral_RDR :: RdrName toInteger_RDR = nameRdrName toIntegerName toRational_RDR = nameRdrName toRationalName fromIntegral_RDR = nameRdrName fromIntegralName stringTy_RDR, fromString_RDR :: RdrName stringTy_RDR = tcQual_RDR gHC_BASE (fsLit "String") fromString_RDR = nameRdrName fromStringName fromList_RDR, fromListN_RDR, toList_RDR :: RdrName fromList_RDR = nameRdrName fromListName fromListN_RDR = nameRdrName fromListNName toList_RDR = nameRdrName toListName compose_RDR :: RdrName compose_RDR = varQual_RDR gHC_BASE (fsLit ".") not_RDR, getTag_RDR, succ_RDR, pred_RDR, minBound_RDR, maxBound_RDR, and_RDR, range_RDR, inRange_RDR, index_RDR, unsafeIndex_RDR, unsafeRangeSize_RDR :: RdrName and_RDR = varQual_RDR gHC_CLASSES (fsLit "&&") not_RDR = varQual_RDR gHC_CLASSES (fsLit "not") getTag_RDR = varQual_RDR gHC_BASE (fsLit "getTag") succ_RDR = varQual_RDR gHC_ENUM (fsLit "succ") pred_RDR = varQual_RDR gHC_ENUM (fsLit "pred") minBound_RDR = varQual_RDR gHC_ENUM (fsLit "minBound") maxBound_RDR = varQual_RDR gHC_ENUM (fsLit "maxBound") range_RDR = varQual_RDR gHC_ARR (fsLit "range") inRange_RDR = varQual_RDR gHC_ARR (fsLit "inRange") index_RDR = varQual_RDR gHC_ARR (fsLit "index") unsafeIndex_RDR = varQual_RDR gHC_ARR (fsLit "unsafeIndex") unsafeRangeSize_RDR = varQual_RDR gHC_ARR (fsLit "unsafeRangeSize") readList_RDR, readListDefault_RDR, readListPrec_RDR, readListPrecDefault_RDR, readPrec_RDR, parens_RDR, choose_RDR, lexP_RDR, expectP_RDR :: RdrName readList_RDR = varQual_RDR gHC_READ (fsLit "readList") readListDefault_RDR = varQual_RDR gHC_READ (fsLit "readListDefault") readListPrec_RDR = varQual_RDR gHC_READ (fsLit "readListPrec") readListPrecDefault_RDR = varQual_RDR gHC_READ (fsLit "readListPrecDefault") readPrec_RDR = varQual_RDR gHC_READ (fsLit "readPrec") parens_RDR = varQual_RDR gHC_READ (fsLit "parens") choose_RDR = varQual_RDR gHC_READ (fsLit "choose") lexP_RDR = varQual_RDR gHC_READ (fsLit "lexP") expectP_RDR = varQual_RDR gHC_READ (fsLit "expectP") readField_RDR, readSymField_RDR :: RdrName readField_RDR = varQual_RDR gHC_READ (fsLit "readField") readSymField_RDR = varQual_RDR gHC_READ (fsLit "readSymField") punc_RDR, ident_RDR, symbol_RDR :: RdrName punc_RDR = dataQual_RDR lEX (fsLit "Punc") ident_RDR = dataQual_RDR lEX (fsLit "Ident") symbol_RDR = dataQual_RDR lEX (fsLit "Symbol") step_RDR, alt_RDR, reset_RDR, prec_RDR, pfail_RDR :: RdrName step_RDR = varQual_RDR rEAD_PREC (fsLit "step") alt_RDR = varQual_RDR rEAD_PREC (fsLit "+++") reset_RDR = varQual_RDR rEAD_PREC (fsLit "reset") prec_RDR = varQual_RDR rEAD_PREC (fsLit "prec") pfail_RDR = varQual_RDR rEAD_PREC (fsLit "pfail") showsPrec_RDR, shows_RDR, showString_RDR, showSpace_RDR, showCommaSpace_RDR, showParen_RDR :: RdrName showsPrec_RDR = varQual_RDR gHC_SHOW (fsLit "showsPrec") shows_RDR = varQual_RDR gHC_SHOW (fsLit "shows") showString_RDR = varQual_RDR gHC_SHOW (fsLit "showString") showSpace_RDR = varQual_RDR gHC_SHOW (fsLit "showSpace") showCommaSpace_RDR = varQual_RDR gHC_SHOW (fsLit "showCommaSpace") showParen_RDR = varQual_RDR gHC_SHOW (fsLit "showParen") undefined_RDR :: RdrName undefined_RDR = varQual_RDR gHC_ERR (fsLit "undefined") error_RDR :: RdrName error_RDR = varQual_RDR gHC_ERR (fsLit "error") -- Generics (constructors and functions) u1DataCon_RDR, par1DataCon_RDR, rec1DataCon_RDR, k1DataCon_RDR, m1DataCon_RDR, l1DataCon_RDR, r1DataCon_RDR, prodDataCon_RDR, comp1DataCon_RDR, unPar1_RDR, unRec1_RDR, unK1_RDR, unComp1_RDR, from_RDR, from1_RDR, to_RDR, to1_RDR, datatypeName_RDR, moduleName_RDR, packageName_RDR, isNewtypeName_RDR, conName_RDR, conFixity_RDR, conIsRecord_RDR, selName_RDR, prefixDataCon_RDR, infixDataCon_RDR, leftAssocDataCon_RDR, rightAssocDataCon_RDR, notAssocDataCon_RDR, uAddrDataCon_RDR, uCharDataCon_RDR, uDoubleDataCon_RDR, uFloatDataCon_RDR, uIntDataCon_RDR, uWordDataCon_RDR, uAddrHash_RDR, uCharHash_RDR, uDoubleHash_RDR, uFloatHash_RDR, uIntHash_RDR, uWordHash_RDR :: RdrName u1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "U1") par1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Par1") rec1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Rec1") k1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "K1") m1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "M1") l1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "L1") r1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "R1") prodDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit ":*:") comp1DataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Comp1") unPar1_RDR = varQual_RDR gHC_GENERICS (fsLit "unPar1") unRec1_RDR = varQual_RDR gHC_GENERICS (fsLit "unRec1") unK1_RDR = varQual_RDR gHC_GENERICS (fsLit "unK1") unComp1_RDR = varQual_RDR gHC_GENERICS (fsLit "unComp1") from_RDR = varQual_RDR gHC_GENERICS (fsLit "from") from1_RDR = varQual_RDR gHC_GENERICS (fsLit "from1") to_RDR = varQual_RDR gHC_GENERICS (fsLit "to") to1_RDR = varQual_RDR gHC_GENERICS (fsLit "to1") datatypeName_RDR = varQual_RDR gHC_GENERICS (fsLit "datatypeName") moduleName_RDR = varQual_RDR gHC_GENERICS (fsLit "moduleName") packageName_RDR = varQual_RDR gHC_GENERICS (fsLit "packageName") isNewtypeName_RDR = varQual_RDR gHC_GENERICS (fsLit "isNewtype") selName_RDR = varQual_RDR gHC_GENERICS (fsLit "selName") conName_RDR = varQual_RDR gHC_GENERICS (fsLit "conName") conFixity_RDR = varQual_RDR gHC_GENERICS (fsLit "conFixity") conIsRecord_RDR = varQual_RDR gHC_GENERICS (fsLit "conIsRecord") prefixDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Prefix") infixDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Infix") leftAssocDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "LeftAssociative") rightAssocDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "RightAssociative") notAssocDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "NotAssociative") uAddrDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UAddr") uCharDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UChar") uDoubleDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UDouble") uFloatDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UFloat") uIntDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UInt") uWordDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UWord") uAddrHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uAddr#") uCharHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uChar#") uDoubleHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uDouble#") uFloatHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uFloat#") uIntHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uInt#") uWordHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uWord#") fmap_RDR, replace_RDR, pure_RDR, ap_RDR, liftA2_RDR, foldable_foldr_RDR, foldMap_RDR, null_RDR, all_RDR, traverse_RDR, mempty_RDR, mappend_RDR :: RdrName fmap_RDR = varQual_RDR gHC_BASE (fsLit "fmap") replace_RDR = varQual_RDR gHC_BASE (fsLit "<$") pure_RDR = nameRdrName pureAName ap_RDR = nameRdrName apAName liftA2_RDR = varQual_RDR gHC_BASE (fsLit "liftA2") foldable_foldr_RDR = varQual_RDR dATA_FOLDABLE (fsLit "foldr") foldMap_RDR = varQual_RDR dATA_FOLDABLE (fsLit "foldMap") null_RDR = varQual_RDR dATA_FOLDABLE (fsLit "null") all_RDR = varQual_RDR dATA_FOLDABLE (fsLit "all") traverse_RDR = varQual_RDR dATA_TRAVERSABLE (fsLit "traverse") mempty_RDR = varQual_RDR gHC_BASE (fsLit "mempty") mappend_RDR = varQual_RDR gHC_BASE (fsLit "mappend") eqTyCon_RDR :: RdrName eqTyCon_RDR = tcQual_RDR dATA_TYPE_EQUALITY (fsLit "~") ---------------------- varQual_RDR, tcQual_RDR, clsQual_RDR, dataQual_RDR :: Module -> FastString -> RdrName varQual_RDR mod str = mkOrig mod (mkOccNameFS varName str) tcQual_RDR mod str = mkOrig mod (mkOccNameFS tcName str) clsQual_RDR mod str = mkOrig mod (mkOccNameFS clsName str) dataQual_RDR mod str = mkOrig mod (mkOccNameFS dataName str) {- ************************************************************************ * * \subsection{Known-key names} * * ************************************************************************ Many of these Names are not really "built in", but some parts of the compiler (notably the deriving mechanism) need to mention their names, and it's convenient to write them all down in one place. --MetaHaskell Extension add the constrs and the lower case case -- guys as well (perhaps) e.g. see trueDataConName below -} wildCardName :: Name wildCardName = mkSystemVarName wildCardKey (fsLit "wild") runMainIOName :: Name runMainIOName = varQual gHC_TOP_HANDLER (fsLit "runMainIO") runMainKey orderingTyConName, ltDataConName, eqDataConName, gtDataConName :: Name orderingTyConName = tcQual gHC_TYPES (fsLit "Ordering") orderingTyConKey ltDataConName = dcQual gHC_TYPES (fsLit "LT") ltDataConKey eqDataConName = dcQual gHC_TYPES (fsLit "EQ") eqDataConKey gtDataConName = dcQual gHC_TYPES (fsLit "GT") gtDataConKey specTyConName :: Name specTyConName = tcQual gHC_TYPES (fsLit "SPEC") specTyConKey eitherTyConName, leftDataConName, rightDataConName :: Name eitherTyConName = tcQual dATA_EITHER (fsLit "Either") eitherTyConKey leftDataConName = dcQual dATA_EITHER (fsLit "Left") leftDataConKey rightDataConName = dcQual dATA_EITHER (fsLit "Right") rightDataConKey -- Generics (types) v1TyConName, u1TyConName, par1TyConName, rec1TyConName, k1TyConName, m1TyConName, sumTyConName, prodTyConName, compTyConName, rTyConName, dTyConName, cTyConName, sTyConName, rec0TyConName, d1TyConName, c1TyConName, s1TyConName, noSelTyConName, repTyConName, rep1TyConName, uRecTyConName, uAddrTyConName, uCharTyConName, uDoubleTyConName, uFloatTyConName, uIntTyConName, uWordTyConName, prefixIDataConName, infixIDataConName, leftAssociativeDataConName, rightAssociativeDataConName, notAssociativeDataConName, sourceUnpackDataConName, sourceNoUnpackDataConName, noSourceUnpackednessDataConName, sourceLazyDataConName, sourceStrictDataConName, noSourceStrictnessDataConName, decidedLazyDataConName, decidedStrictDataConName, decidedUnpackDataConName, metaDataDataConName, metaConsDataConName, metaSelDataConName :: Name v1TyConName = tcQual gHC_GENERICS (fsLit "V1") v1TyConKey u1TyConName = tcQual gHC_GENERICS (fsLit "U1") u1TyConKey par1TyConName = tcQual gHC_GENERICS (fsLit "Par1") par1TyConKey rec1TyConName = tcQual gHC_GENERICS (fsLit "Rec1") rec1TyConKey k1TyConName = tcQual gHC_GENERICS (fsLit "K1") k1TyConKey m1TyConName = tcQual gHC_GENERICS (fsLit "M1") m1TyConKey sumTyConName = tcQual gHC_GENERICS (fsLit ":+:") sumTyConKey prodTyConName = tcQual gHC_GENERICS (fsLit ":*:") prodTyConKey compTyConName = tcQual gHC_GENERICS (fsLit ":.:") compTyConKey rTyConName = tcQual gHC_GENERICS (fsLit "R") rTyConKey dTyConName = tcQual gHC_GENERICS (fsLit "D") dTyConKey cTyConName = tcQual gHC_GENERICS (fsLit "C") cTyConKey sTyConName = tcQual gHC_GENERICS (fsLit "S") sTyConKey rec0TyConName = tcQual gHC_GENERICS (fsLit "Rec0") rec0TyConKey d1TyConName = tcQual gHC_GENERICS (fsLit "D1") d1TyConKey c1TyConName = tcQual gHC_GENERICS (fsLit "C1") c1TyConKey s1TyConName = tcQual gHC_GENERICS (fsLit "S1") s1TyConKey noSelTyConName = tcQual gHC_GENERICS (fsLit "NoSelector") noSelTyConKey repTyConName = tcQual gHC_GENERICS (fsLit "Rep") repTyConKey rep1TyConName = tcQual gHC_GENERICS (fsLit "Rep1") rep1TyConKey uRecTyConName = tcQual gHC_GENERICS (fsLit "URec") uRecTyConKey uAddrTyConName = tcQual gHC_GENERICS (fsLit "UAddr") uAddrTyConKey uCharTyConName = tcQual gHC_GENERICS (fsLit "UChar") uCharTyConKey uDoubleTyConName = tcQual gHC_GENERICS (fsLit "UDouble") uDoubleTyConKey uFloatTyConName = tcQual gHC_GENERICS (fsLit "UFloat") uFloatTyConKey uIntTyConName = tcQual gHC_GENERICS (fsLit "UInt") uIntTyConKey uWordTyConName = tcQual gHC_GENERICS (fsLit "UWord") uWordTyConKey prefixIDataConName = dcQual gHC_GENERICS (fsLit "PrefixI") prefixIDataConKey infixIDataConName = dcQual gHC_GENERICS (fsLit "InfixI") infixIDataConKey leftAssociativeDataConName = dcQual gHC_GENERICS (fsLit "LeftAssociative") leftAssociativeDataConKey rightAssociativeDataConName = dcQual gHC_GENERICS (fsLit "RightAssociative") rightAssociativeDataConKey notAssociativeDataConName = dcQual gHC_GENERICS (fsLit "NotAssociative") notAssociativeDataConKey sourceUnpackDataConName = dcQual gHC_GENERICS (fsLit "SourceUnpack") sourceUnpackDataConKey sourceNoUnpackDataConName = dcQual gHC_GENERICS (fsLit "SourceNoUnpack") sourceNoUnpackDataConKey noSourceUnpackednessDataConName = dcQual gHC_GENERICS (fsLit "NoSourceUnpackedness") noSourceUnpackednessDataConKey sourceLazyDataConName = dcQual gHC_GENERICS (fsLit "SourceLazy") sourceLazyDataConKey sourceStrictDataConName = dcQual gHC_GENERICS (fsLit "SourceStrict") sourceStrictDataConKey noSourceStrictnessDataConName = dcQual gHC_GENERICS (fsLit "NoSourceStrictness") noSourceStrictnessDataConKey decidedLazyDataConName = dcQual gHC_GENERICS (fsLit "DecidedLazy") decidedLazyDataConKey decidedStrictDataConName = dcQual gHC_GENERICS (fsLit "DecidedStrict") decidedStrictDataConKey decidedUnpackDataConName = dcQual gHC_GENERICS (fsLit "DecidedUnpack") decidedUnpackDataConKey metaDataDataConName = dcQual gHC_GENERICS (fsLit "MetaData") metaDataDataConKey metaConsDataConName = dcQual gHC_GENERICS (fsLit "MetaCons") metaConsDataConKey metaSelDataConName = dcQual gHC_GENERICS (fsLit "MetaSel") metaSelDataConKey -- Primitive Int divIntName, modIntName :: Name divIntName = varQual gHC_CLASSES (fsLit "divInt#") divIntIdKey modIntName = varQual gHC_CLASSES (fsLit "modInt#") modIntIdKey -- Base strings Strings unpackCStringName, unpackCStringFoldrName, unpackCStringUtf8Name, eqStringName :: Name unpackCStringName = varQual gHC_CSTRING (fsLit "unpackCString#") unpackCStringIdKey unpackCStringFoldrName = varQual gHC_CSTRING (fsLit "unpackFoldrCString#") unpackCStringFoldrIdKey unpackCStringUtf8Name = varQual gHC_CSTRING (fsLit "unpackCStringUtf8#") unpackCStringUtf8IdKey eqStringName = varQual gHC_BASE (fsLit "eqString") eqStringIdKey -- The 'inline' function inlineIdName :: Name inlineIdName = varQual gHC_MAGIC (fsLit "inline") inlineIdKey -- Base classes (Eq, Ord, Functor) fmapName, eqClassName, eqName, ordClassName, geName, functorClassName :: Name eqClassName = clsQual gHC_CLASSES (fsLit "Eq") eqClassKey eqName = varQual gHC_CLASSES (fsLit "==") eqClassOpKey ordClassName = clsQual gHC_CLASSES (fsLit "Ord") ordClassKey geName = varQual gHC_CLASSES (fsLit ">=") geClassOpKey functorClassName = clsQual gHC_BASE (fsLit "Functor") functorClassKey fmapName = varQual gHC_BASE (fsLit "fmap") fmapClassOpKey -- Class Monad monadClassName, thenMName, bindMName, returnMName, failMName_preMFP :: Name monadClassName = clsQual gHC_BASE (fsLit "Monad") monadClassKey thenMName = varQual gHC_BASE (fsLit ">>") thenMClassOpKey bindMName = varQual gHC_BASE (fsLit ">>=") bindMClassOpKey returnMName = varQual gHC_BASE (fsLit "return") returnMClassOpKey failMName_preMFP = varQual gHC_BASE (fsLit "fail") failMClassOpKey_preMFP -- Class MonadFail monadFailClassName, failMName :: Name monadFailClassName = clsQual mONAD_FAIL (fsLit "MonadFail") monadFailClassKey failMName = varQual mONAD_FAIL (fsLit "fail") failMClassOpKey -- Class Applicative applicativeClassName, pureAName, apAName, thenAName :: Name applicativeClassName = clsQual gHC_BASE (fsLit "Applicative") applicativeClassKey apAName = varQual gHC_BASE (fsLit "<*>") apAClassOpKey pureAName = varQual gHC_BASE (fsLit "pure") pureAClassOpKey thenAName = varQual gHC_BASE (fsLit "*>") thenAClassOpKey -- Classes (Foldable, Traversable) foldableClassName, traversableClassName :: Name foldableClassName = clsQual dATA_FOLDABLE (fsLit "Foldable") foldableClassKey traversableClassName = clsQual dATA_TRAVERSABLE (fsLit "Traversable") traversableClassKey -- Classes (Semigroup, Monoid) semigroupClassName, sappendName :: Name semigroupClassName = clsQual gHC_BASE (fsLit "Semigroup") semigroupClassKey sappendName = varQual gHC_BASE (fsLit "<>") sappendClassOpKey monoidClassName, memptyName, mappendName, mconcatName :: Name monoidClassName = clsQual gHC_BASE (fsLit "Monoid") monoidClassKey memptyName = varQual gHC_BASE (fsLit "mempty") memptyClassOpKey mappendName = varQual gHC_BASE (fsLit "mappend") mappendClassOpKey mconcatName = varQual gHC_BASE (fsLit "mconcat") mconcatClassOpKey -- AMP additions joinMName, alternativeClassName :: Name joinMName = varQual gHC_BASE (fsLit "join") joinMIdKey alternativeClassName = clsQual mONAD (fsLit "Alternative") alternativeClassKey -- joinMIdKey, apAClassOpKey, pureAClassOpKey, thenAClassOpKey, alternativeClassKey :: Unique joinMIdKey = mkPreludeMiscIdUnique 750 apAClassOpKey = mkPreludeMiscIdUnique 751 -- <*> pureAClassOpKey = mkPreludeMiscIdUnique 752 thenAClassOpKey = mkPreludeMiscIdUnique 753 alternativeClassKey = mkPreludeMiscIdUnique 754 -- Functions for GHC extensions groupWithName :: Name groupWithName = varQual gHC_EXTS (fsLit "groupWith") groupWithIdKey -- Random PrelBase functions fromStringName, otherwiseIdName, foldrName, buildName, augmentName, mapName, appendName, assertName, breakpointName, breakpointCondName, breakpointAutoName, opaqueTyConName :: Name fromStringName = varQual dATA_STRING (fsLit "fromString") fromStringClassOpKey otherwiseIdName = varQual gHC_BASE (fsLit "otherwise") otherwiseIdKey foldrName = varQual gHC_BASE (fsLit "foldr") foldrIdKey buildName = varQual gHC_BASE (fsLit "build") buildIdKey augmentName = varQual gHC_BASE (fsLit "augment") augmentIdKey mapName = varQual gHC_BASE (fsLit "map") mapIdKey appendName = varQual gHC_BASE (fsLit "++") appendIdKey assertName = varQual gHC_BASE (fsLit "assert") assertIdKey breakpointName = varQual gHC_BASE (fsLit "breakpoint") breakpointIdKey breakpointCondName= varQual gHC_BASE (fsLit "breakpointCond") breakpointCondIdKey breakpointAutoName= varQual gHC_BASE (fsLit "breakpointAuto") breakpointAutoIdKey opaqueTyConName = tcQual gHC_BASE (fsLit "Opaque") opaqueTyConKey breakpointJumpName :: Name breakpointJumpName = mkInternalName breakpointJumpIdKey (mkOccNameFS varName (fsLit "breakpointJump")) noSrcSpan breakpointCondJumpName :: Name breakpointCondJumpName = mkInternalName breakpointCondJumpIdKey (mkOccNameFS varName (fsLit "breakpointCondJump")) noSrcSpan breakpointAutoJumpName :: Name breakpointAutoJumpName = mkInternalName breakpointAutoJumpIdKey (mkOccNameFS varName (fsLit "breakpointAutoJump")) noSrcSpan -- PrelTup fstName, sndName :: Name fstName = varQual dATA_TUPLE (fsLit "fst") fstIdKey sndName = varQual dATA_TUPLE (fsLit "snd") sndIdKey -- Module GHC.Num numClassName, fromIntegerName, minusName, negateName :: Name numClassName = clsQual gHC_NUM (fsLit "Num") numClassKey fromIntegerName = varQual gHC_NUM (fsLit "fromInteger") fromIntegerClassOpKey minusName = varQual gHC_NUM (fsLit "-") minusClassOpKey negateName = varQual gHC_NUM (fsLit "negate") negateClassOpKey integerTyConName, mkIntegerName, integerSDataConName, integerToWord64Name, integerToInt64Name, word64ToIntegerName, int64ToIntegerName, plusIntegerName, timesIntegerName, smallIntegerName, wordToIntegerName, integerToWordName, integerToIntName, minusIntegerName, negateIntegerName, eqIntegerPrimName, neqIntegerPrimName, absIntegerName, signumIntegerName, leIntegerPrimName, gtIntegerPrimName, ltIntegerPrimName, geIntegerPrimName, compareIntegerName, quotRemIntegerName, divModIntegerName, quotIntegerName, remIntegerName, divIntegerName, modIntegerName, floatFromIntegerName, doubleFromIntegerName, encodeFloatIntegerName, encodeDoubleIntegerName, decodeDoubleIntegerName, gcdIntegerName, lcmIntegerName, andIntegerName, orIntegerName, xorIntegerName, complementIntegerName, shiftLIntegerName, shiftRIntegerName, bitIntegerName :: Name integerTyConName = tcQual gHC_INTEGER_TYPE (fsLit "Integer") integerTyConKey integerSDataConName = dcQual gHC_INTEGER_TYPE (fsLit n) integerSDataConKey where n = case cIntegerLibraryType of IntegerGMP -> "S#" IntegerSimple -> panic "integerSDataConName evaluated for integer-simple" mkIntegerName = varQual gHC_INTEGER_TYPE (fsLit "mkInteger") mkIntegerIdKey integerToWord64Name = varQual gHC_INTEGER_TYPE (fsLit "integerToWord64") integerToWord64IdKey integerToInt64Name = varQual gHC_INTEGER_TYPE (fsLit "integerToInt64") integerToInt64IdKey word64ToIntegerName = varQual gHC_INTEGER_TYPE (fsLit "word64ToInteger") word64ToIntegerIdKey int64ToIntegerName = varQual gHC_INTEGER_TYPE (fsLit "int64ToInteger") int64ToIntegerIdKey plusIntegerName = varQual gHC_INTEGER_TYPE (fsLit "plusInteger") plusIntegerIdKey timesIntegerName = varQual gHC_INTEGER_TYPE (fsLit "timesInteger") timesIntegerIdKey smallIntegerName = varQual gHC_INTEGER_TYPE (fsLit "smallInteger") smallIntegerIdKey wordToIntegerName = varQual gHC_INTEGER_TYPE (fsLit "wordToInteger") wordToIntegerIdKey integerToWordName = varQual gHC_INTEGER_TYPE (fsLit "integerToWord") integerToWordIdKey integerToIntName = varQual gHC_INTEGER_TYPE (fsLit "integerToInt") integerToIntIdKey minusIntegerName = varQual gHC_INTEGER_TYPE (fsLit "minusInteger") minusIntegerIdKey negateIntegerName = varQual gHC_INTEGER_TYPE (fsLit "negateInteger") negateIntegerIdKey eqIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "eqInteger#") eqIntegerPrimIdKey neqIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "neqInteger#") neqIntegerPrimIdKey absIntegerName = varQual gHC_INTEGER_TYPE (fsLit "absInteger") absIntegerIdKey signumIntegerName = varQual gHC_INTEGER_TYPE (fsLit "signumInteger") signumIntegerIdKey leIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "leInteger#") leIntegerPrimIdKey gtIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "gtInteger#") gtIntegerPrimIdKey ltIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "ltInteger#") ltIntegerPrimIdKey geIntegerPrimName = varQual gHC_INTEGER_TYPE (fsLit "geInteger#") geIntegerPrimIdKey compareIntegerName = varQual gHC_INTEGER_TYPE (fsLit "compareInteger") compareIntegerIdKey quotRemIntegerName = varQual gHC_INTEGER_TYPE (fsLit "quotRemInteger") quotRemIntegerIdKey divModIntegerName = varQual gHC_INTEGER_TYPE (fsLit "divModInteger") divModIntegerIdKey quotIntegerName = varQual gHC_INTEGER_TYPE (fsLit "quotInteger") quotIntegerIdKey remIntegerName = varQual gHC_INTEGER_TYPE (fsLit "remInteger") remIntegerIdKey divIntegerName = varQual gHC_INTEGER_TYPE (fsLit "divInteger") divIntegerIdKey modIntegerName = varQual gHC_INTEGER_TYPE (fsLit "modInteger") modIntegerIdKey floatFromIntegerName = varQual gHC_INTEGER_TYPE (fsLit "floatFromInteger") floatFromIntegerIdKey doubleFromIntegerName = varQual gHC_INTEGER_TYPE (fsLit "doubleFromInteger") doubleFromIntegerIdKey encodeFloatIntegerName = varQual gHC_INTEGER_TYPE (fsLit "encodeFloatInteger") encodeFloatIntegerIdKey encodeDoubleIntegerName = varQual gHC_INTEGER_TYPE (fsLit "encodeDoubleInteger") encodeDoubleIntegerIdKey decodeDoubleIntegerName = varQual gHC_INTEGER_TYPE (fsLit "decodeDoubleInteger") decodeDoubleIntegerIdKey gcdIntegerName = varQual gHC_INTEGER_TYPE (fsLit "gcdInteger") gcdIntegerIdKey lcmIntegerName = varQual gHC_INTEGER_TYPE (fsLit "lcmInteger") lcmIntegerIdKey andIntegerName = varQual gHC_INTEGER_TYPE (fsLit "andInteger") andIntegerIdKey orIntegerName = varQual gHC_INTEGER_TYPE (fsLit "orInteger") orIntegerIdKey xorIntegerName = varQual gHC_INTEGER_TYPE (fsLit "xorInteger") xorIntegerIdKey complementIntegerName = varQual gHC_INTEGER_TYPE (fsLit "complementInteger") complementIntegerIdKey shiftLIntegerName = varQual gHC_INTEGER_TYPE (fsLit "shiftLInteger") shiftLIntegerIdKey shiftRIntegerName = varQual gHC_INTEGER_TYPE (fsLit "shiftRInteger") shiftRIntegerIdKey bitIntegerName = varQual gHC_INTEGER_TYPE (fsLit "bitInteger") bitIntegerIdKey -- GHC.Natural types naturalTyConName :: Name naturalTyConName = tcQual gHC_NATURAL (fsLit "Natural") naturalTyConKey naturalFromIntegerName :: Name naturalFromIntegerName = varQual gHC_NATURAL (fsLit "naturalFromInteger") naturalFromIntegerIdKey -- GHC.Real types and classes rationalTyConName, ratioTyConName, ratioDataConName, realClassName, integralClassName, realFracClassName, fractionalClassName, fromRationalName, toIntegerName, toRationalName, fromIntegralName, realToFracName :: Name rationalTyConName = tcQual gHC_REAL (fsLit "Rational") rationalTyConKey ratioTyConName = tcQual gHC_REAL (fsLit "Ratio") ratioTyConKey ratioDataConName = dcQual gHC_REAL (fsLit ":%") ratioDataConKey realClassName = clsQual gHC_REAL (fsLit "Real") realClassKey integralClassName = clsQual gHC_REAL (fsLit "Integral") integralClassKey realFracClassName = clsQual gHC_REAL (fsLit "RealFrac") realFracClassKey fractionalClassName = clsQual gHC_REAL (fsLit "Fractional") fractionalClassKey fromRationalName = varQual gHC_REAL (fsLit "fromRational") fromRationalClassOpKey toIntegerName = varQual gHC_REAL (fsLit "toInteger") toIntegerClassOpKey toRationalName = varQual gHC_REAL (fsLit "toRational") toRationalClassOpKey fromIntegralName = varQual gHC_REAL (fsLit "fromIntegral")fromIntegralIdKey realToFracName = varQual gHC_REAL (fsLit "realToFrac") realToFracIdKey -- PrelFloat classes floatingClassName, realFloatClassName :: Name floatingClassName = clsQual gHC_FLOAT (fsLit "Floating") floatingClassKey realFloatClassName = clsQual gHC_FLOAT (fsLit "RealFloat") realFloatClassKey -- other GHC.Float functions rationalToFloatName, rationalToDoubleName :: Name rationalToFloatName = varQual gHC_FLOAT (fsLit "rationalToFloat") rationalToFloatIdKey rationalToDoubleName = varQual gHC_FLOAT (fsLit "rationalToDouble") rationalToDoubleIdKey -- Class Ix ixClassName :: Name ixClassName = clsQual gHC_ARR (fsLit "Ix") ixClassKey -- Typeable representation types trModuleTyConName , trModuleDataConName , trNameTyConName , trNameSDataConName , trNameDDataConName , trTyConTyConName , trTyConDataConName :: Name trModuleTyConName = tcQual gHC_TYPES (fsLit "Module") trModuleTyConKey trModuleDataConName = dcQual gHC_TYPES (fsLit "Module") trModuleDataConKey trNameTyConName = tcQual gHC_TYPES (fsLit "TrName") trNameTyConKey trNameSDataConName = dcQual gHC_TYPES (fsLit "TrNameS") trNameSDataConKey trNameDDataConName = dcQual gHC_TYPES (fsLit "TrNameD") trNameDDataConKey trTyConTyConName = tcQual gHC_TYPES (fsLit "TyCon") trTyConTyConKey trTyConDataConName = dcQual gHC_TYPES (fsLit "TyCon") trTyConDataConKey kindRepTyConName , kindRepTyConAppDataConName , kindRepVarDataConName , kindRepAppDataConName , kindRepFunDataConName , kindRepTYPEDataConName , kindRepTypeLitSDataConName , kindRepTypeLitDDataConName :: Name kindRepTyConName = tcQual gHC_TYPES (fsLit "KindRep") kindRepTyConKey kindRepTyConAppDataConName = dcQual gHC_TYPES (fsLit "KindRepTyConApp") kindRepTyConAppDataConKey kindRepVarDataConName = dcQual gHC_TYPES (fsLit "KindRepVar") kindRepVarDataConKey kindRepAppDataConName = dcQual gHC_TYPES (fsLit "KindRepApp") kindRepAppDataConKey kindRepFunDataConName = dcQual gHC_TYPES (fsLit "KindRepFun") kindRepFunDataConKey kindRepTYPEDataConName = dcQual gHC_TYPES (fsLit "KindRepTYPE") kindRepTYPEDataConKey kindRepTypeLitSDataConName = dcQual gHC_TYPES (fsLit "KindRepTypeLitS") kindRepTypeLitSDataConKey kindRepTypeLitDDataConName = dcQual gHC_TYPES (fsLit "KindRepTypeLitD") kindRepTypeLitDDataConKey typeLitSortTyConName , typeLitSymbolDataConName , typeLitNatDataConName :: Name typeLitSortTyConName = tcQual gHC_TYPES (fsLit "TypeLitSort") typeLitSortTyConKey typeLitSymbolDataConName = dcQual gHC_TYPES (fsLit "TypeLitSymbol") typeLitSymbolDataConKey typeLitNatDataConName = dcQual gHC_TYPES (fsLit "TypeLitNat") typeLitNatDataConKey -- Class Typeable, and functions for constructing `Typeable` dictionaries typeableClassName , typeRepTyConName , someTypeRepTyConName , someTypeRepDataConName , mkTrConName , mkTrAppName , mkTrFunName , typeRepIdName , typeNatTypeRepName , typeSymbolTypeRepName , trGhcPrimModuleName :: Name typeableClassName = clsQual tYPEABLE_INTERNAL (fsLit "Typeable") typeableClassKey typeRepTyConName = tcQual tYPEABLE_INTERNAL (fsLit "TypeRep") typeRepTyConKey someTypeRepTyConName = tcQual tYPEABLE_INTERNAL (fsLit "SomeTypeRep") someTypeRepTyConKey someTypeRepDataConName = dcQual tYPEABLE_INTERNAL (fsLit "SomeTypeRep") someTypeRepDataConKey typeRepIdName = varQual tYPEABLE_INTERNAL (fsLit "typeRep#") typeRepIdKey mkTrConName = varQual tYPEABLE_INTERNAL (fsLit "mkTrCon") mkTrConKey mkTrAppName = varQual tYPEABLE_INTERNAL (fsLit "mkTrApp") mkTrAppKey mkTrFunName = varQual tYPEABLE_INTERNAL (fsLit "mkTrFun") mkTrFunKey typeNatTypeRepName = varQual tYPEABLE_INTERNAL (fsLit "typeNatTypeRep") typeNatTypeRepKey typeSymbolTypeRepName = varQual tYPEABLE_INTERNAL (fsLit "typeSymbolTypeRep") typeSymbolTypeRepKey -- this is the Typeable 'Module' for GHC.Prim (which has no code, so we place in GHC.Types) -- See Note [Grand plan for Typeable] in TcTypeable. trGhcPrimModuleName = varQual gHC_TYPES (fsLit "tr$ModuleGHCPrim") trGhcPrimModuleKey -- Typeable KindReps for some common cases starKindRepName, starArrStarKindRepName, starArrStarArrStarKindRepName :: Name starKindRepName = varQual gHC_TYPES (fsLit "krep$*") starKindRepKey starArrStarKindRepName = varQual gHC_TYPES (fsLit "krep$*Arr*") starArrStarKindRepKey starArrStarArrStarKindRepName = varQual gHC_TYPES (fsLit "krep$*->*->*") starArrStarArrStarKindRepKey -- Custom type errors errorMessageTypeErrorFamName , typeErrorTextDataConName , typeErrorAppendDataConName , typeErrorVAppendDataConName , typeErrorShowTypeDataConName :: Name errorMessageTypeErrorFamName = tcQual gHC_TYPELITS (fsLit "TypeError") errorMessageTypeErrorFamKey typeErrorTextDataConName = dcQual gHC_TYPELITS (fsLit "Text") typeErrorTextDataConKey typeErrorAppendDataConName = dcQual gHC_TYPELITS (fsLit ":<>:") typeErrorAppendDataConKey typeErrorVAppendDataConName = dcQual gHC_TYPELITS (fsLit ":$$:") typeErrorVAppendDataConKey typeErrorShowTypeDataConName = dcQual gHC_TYPELITS (fsLit "ShowType") typeErrorShowTypeDataConKey -- Dynamic toDynName :: Name toDynName = varQual dYNAMIC (fsLit "toDyn") toDynIdKey -- Class Data dataClassName :: Name dataClassName = clsQual gENERICS (fsLit "Data") dataClassKey -- Error module assertErrorName :: Name assertErrorName = varQual gHC_IO_Exception (fsLit "assertError") assertErrorIdKey -- Enum module (Enum, Bounded) enumClassName, enumFromName, enumFromToName, enumFromThenName, enumFromThenToName, boundedClassName :: Name enumClassName = clsQual gHC_ENUM (fsLit "Enum") enumClassKey enumFromName = varQual gHC_ENUM (fsLit "enumFrom") enumFromClassOpKey enumFromToName = varQual gHC_ENUM (fsLit "enumFromTo") enumFromToClassOpKey enumFromThenName = varQual gHC_ENUM (fsLit "enumFromThen") enumFromThenClassOpKey enumFromThenToName = varQual gHC_ENUM (fsLit "enumFromThenTo") enumFromThenToClassOpKey boundedClassName = clsQual gHC_ENUM (fsLit "Bounded") boundedClassKey -- List functions concatName, filterName, zipName :: Name concatName = varQual gHC_LIST (fsLit "concat") concatIdKey filterName = varQual gHC_LIST (fsLit "filter") filterIdKey zipName = varQual gHC_LIST (fsLit "zip") zipIdKey -- Overloaded lists isListClassName, fromListName, fromListNName, toListName :: Name isListClassName = clsQual gHC_EXTS (fsLit "IsList") isListClassKey fromListName = varQual gHC_EXTS (fsLit "fromList") fromListClassOpKey fromListNName = varQual gHC_EXTS (fsLit "fromListN") fromListNClassOpKey toListName = varQual gHC_EXTS (fsLit "toList") toListClassOpKey -- Class Show showClassName :: Name showClassName = clsQual gHC_SHOW (fsLit "Show") showClassKey -- Class Read readClassName :: Name readClassName = clsQual gHC_READ (fsLit "Read") readClassKey -- Classes Generic and Generic1, Datatype, Constructor and Selector genClassName, gen1ClassName, datatypeClassName, constructorClassName, selectorClassName :: Name genClassName = clsQual gHC_GENERICS (fsLit "Generic") genClassKey gen1ClassName = clsQual gHC_GENERICS (fsLit "Generic1") gen1ClassKey datatypeClassName = clsQual gHC_GENERICS (fsLit "Datatype") datatypeClassKey constructorClassName = clsQual gHC_GENERICS (fsLit "Constructor") constructorClassKey selectorClassName = clsQual gHC_GENERICS (fsLit "Selector") selectorClassKey genericClassNames :: [Name] genericClassNames = [genClassName, gen1ClassName] -- GHCi things ghciIoClassName, ghciStepIoMName :: Name ghciIoClassName = clsQual gHC_GHCI (fsLit "GHCiSandboxIO") ghciIoClassKey ghciStepIoMName = varQual gHC_GHCI (fsLit "ghciStepIO") ghciStepIoMClassOpKey -- IO things ioTyConName, ioDataConName, thenIOName, bindIOName, returnIOName, failIOName :: Name ioTyConName = tcQual gHC_TYPES (fsLit "IO") ioTyConKey ioDataConName = dcQual gHC_TYPES (fsLit "IO") ioDataConKey thenIOName = varQual gHC_BASE (fsLit "thenIO") thenIOIdKey bindIOName = varQual gHC_BASE (fsLit "bindIO") bindIOIdKey returnIOName = varQual gHC_BASE (fsLit "returnIO") returnIOIdKey failIOName = varQual gHC_IO (fsLit "failIO") failIOIdKey -- IO things printName :: Name printName = varQual sYSTEM_IO (fsLit "print") printIdKey -- Int, Word, and Addr things int8TyConName, int16TyConName, int32TyConName, int64TyConName :: Name int8TyConName = tcQual gHC_INT (fsLit "Int8") int8TyConKey int16TyConName = tcQual gHC_INT (fsLit "Int16") int16TyConKey int32TyConName = tcQual gHC_INT (fsLit "Int32") int32TyConKey int64TyConName = tcQual gHC_INT (fsLit "Int64") int64TyConKey -- Word module word16TyConName, word32TyConName, word64TyConName :: Name word16TyConName = tcQual gHC_WORD (fsLit "Word16") word16TyConKey word32TyConName = tcQual gHC_WORD (fsLit "Word32") word32TyConKey word64TyConName = tcQual gHC_WORD (fsLit "Word64") word64TyConKey -- PrelPtr module ptrTyConName, funPtrTyConName :: Name ptrTyConName = tcQual gHC_PTR (fsLit "Ptr") ptrTyConKey funPtrTyConName = tcQual gHC_PTR (fsLit "FunPtr") funPtrTyConKey -- Foreign objects and weak pointers stablePtrTyConName, newStablePtrName :: Name stablePtrTyConName = tcQual gHC_STABLE (fsLit "StablePtr") stablePtrTyConKey newStablePtrName = varQual gHC_STABLE (fsLit "newStablePtr") newStablePtrIdKey -- Recursive-do notation monadFixClassName, mfixName :: Name monadFixClassName = clsQual mONAD_FIX (fsLit "MonadFix") monadFixClassKey mfixName = varQual mONAD_FIX (fsLit "mfix") mfixIdKey -- Arrow notation arrAName, composeAName, firstAName, appAName, choiceAName, loopAName :: Name arrAName = varQual aRROW (fsLit "arr") arrAIdKey composeAName = varQual gHC_DESUGAR (fsLit ">>>") composeAIdKey firstAName = varQual aRROW (fsLit "first") firstAIdKey appAName = varQual aRROW (fsLit "app") appAIdKey choiceAName = varQual aRROW (fsLit "|||") choiceAIdKey loopAName = varQual aRROW (fsLit "loop") loopAIdKey -- Monad comprehensions guardMName, liftMName, mzipName :: Name guardMName = varQual mONAD (fsLit "guard") guardMIdKey liftMName = varQual mONAD (fsLit "liftM") liftMIdKey mzipName = varQual mONAD_ZIP (fsLit "mzip") mzipIdKey -- Annotation type checking toAnnotationWrapperName :: Name toAnnotationWrapperName = varQual gHC_DESUGAR (fsLit "toAnnotationWrapper") toAnnotationWrapperIdKey -- Other classes, needed for type defaulting monadPlusClassName, randomClassName, randomGenClassName, isStringClassName :: Name monadPlusClassName = clsQual mONAD (fsLit "MonadPlus") monadPlusClassKey randomClassName = clsQual rANDOM (fsLit "Random") randomClassKey randomGenClassName = clsQual rANDOM (fsLit "RandomGen") randomGenClassKey isStringClassName = clsQual dATA_STRING (fsLit "IsString") isStringClassKey -- Type-level naturals knownNatClassName :: Name knownNatClassName = clsQual gHC_TYPENATS (fsLit "KnownNat") knownNatClassNameKey knownSymbolClassName :: Name knownSymbolClassName = clsQual gHC_TYPELITS (fsLit "KnownSymbol") knownSymbolClassNameKey -- Overloaded labels isLabelClassName :: Name isLabelClassName = clsQual gHC_OVER_LABELS (fsLit "IsLabel") isLabelClassNameKey -- Implicit Parameters ipClassName :: Name ipClassName = clsQual gHC_CLASSES (fsLit "IP") ipClassKey -- Overloaded record fields hasFieldClassName :: Name hasFieldClassName = clsQual gHC_RECORDS (fsLit "HasField") hasFieldClassNameKey -- Source Locations callStackTyConName, emptyCallStackName, pushCallStackName, srcLocDataConName :: Name callStackTyConName = tcQual gHC_STACK_TYPES (fsLit "CallStack") callStackTyConKey emptyCallStackName = varQual gHC_STACK_TYPES (fsLit "emptyCallStack") emptyCallStackKey pushCallStackName = varQual gHC_STACK_TYPES (fsLit "pushCallStack") pushCallStackKey srcLocDataConName = dcQual gHC_STACK_TYPES (fsLit "SrcLoc") srcLocDataConKey -- plugins pLUGINS :: Module pLUGINS = mkThisGhcModule (fsLit "Plugins") pluginTyConName :: Name pluginTyConName = tcQual pLUGINS (fsLit "Plugin") pluginTyConKey frontendPluginTyConName :: Name frontendPluginTyConName = tcQual pLUGINS (fsLit "FrontendPlugin") frontendPluginTyConKey -- Static pointers makeStaticName :: Name makeStaticName = varQual gHC_STATICPTR_INTERNAL (fsLit "makeStatic") makeStaticKey staticPtrInfoTyConName :: Name staticPtrInfoTyConName = tcQual gHC_STATICPTR (fsLit "StaticPtrInfo") staticPtrInfoTyConKey staticPtrInfoDataConName :: Name staticPtrInfoDataConName = dcQual gHC_STATICPTR (fsLit "StaticPtrInfo") staticPtrInfoDataConKey staticPtrTyConName :: Name staticPtrTyConName = tcQual gHC_STATICPTR (fsLit "StaticPtr") staticPtrTyConKey staticPtrDataConName :: Name staticPtrDataConName = dcQual gHC_STATICPTR (fsLit "StaticPtr") staticPtrDataConKey fromStaticPtrName :: Name fromStaticPtrName = varQual gHC_STATICPTR (fsLit "fromStaticPtr") fromStaticPtrClassOpKey fingerprintDataConName :: Name fingerprintDataConName = dcQual gHC_FINGERPRINT_TYPE (fsLit "Fingerprint") fingerprintDataConKey -- homogeneous equality. See Note [The equality types story] in TysPrim eqTyConName :: Name eqTyConName = tcQual dATA_TYPE_EQUALITY (fsLit "~") eqTyConKey {- ************************************************************************ * * \subsection{Local helpers} * * ************************************************************************ All these are original names; hence mkOrig -} varQual, tcQual, clsQual, dcQual :: Module -> FastString -> Unique -> Name varQual = mk_known_key_name varName tcQual = mk_known_key_name tcName clsQual = mk_known_key_name clsName dcQual = mk_known_key_name dataName mk_known_key_name :: NameSpace -> Module -> FastString -> Unique -> Name mk_known_key_name space modu str unique = mkExternalName unique modu (mkOccNameFS space str) noSrcSpan {- ************************************************************************ * * \subsubsection[Uniques-prelude-Classes]{@Uniques@ for wired-in @Classes@} * * ************************************************************************ --MetaHaskell extension hand allocate keys here -} boundedClassKey, enumClassKey, eqClassKey, floatingClassKey, fractionalClassKey, integralClassKey, monadClassKey, dataClassKey, functorClassKey, numClassKey, ordClassKey, readClassKey, realClassKey, realFloatClassKey, realFracClassKey, showClassKey, ixClassKey :: Unique boundedClassKey = mkPreludeClassUnique 1 enumClassKey = mkPreludeClassUnique 2 eqClassKey = mkPreludeClassUnique 3 floatingClassKey = mkPreludeClassUnique 5 fractionalClassKey = mkPreludeClassUnique 6 integralClassKey = mkPreludeClassUnique 7 monadClassKey = mkPreludeClassUnique 8 dataClassKey = mkPreludeClassUnique 9 functorClassKey = mkPreludeClassUnique 10 numClassKey = mkPreludeClassUnique 11 ordClassKey = mkPreludeClassUnique 12 readClassKey = mkPreludeClassUnique 13 realClassKey = mkPreludeClassUnique 14 realFloatClassKey = mkPreludeClassUnique 15 realFracClassKey = mkPreludeClassUnique 16 showClassKey = mkPreludeClassUnique 17 ixClassKey = mkPreludeClassUnique 18 typeableClassKey, typeable1ClassKey, typeable2ClassKey, typeable3ClassKey, typeable4ClassKey, typeable5ClassKey, typeable6ClassKey, typeable7ClassKey :: Unique typeableClassKey = mkPreludeClassUnique 20 typeable1ClassKey = mkPreludeClassUnique 21 typeable2ClassKey = mkPreludeClassUnique 22 typeable3ClassKey = mkPreludeClassUnique 23 typeable4ClassKey = mkPreludeClassUnique 24 typeable5ClassKey = mkPreludeClassUnique 25 typeable6ClassKey = mkPreludeClassUnique 26 typeable7ClassKey = mkPreludeClassUnique 27 monadFixClassKey :: Unique monadFixClassKey = mkPreludeClassUnique 28 monadFailClassKey :: Unique monadFailClassKey = mkPreludeClassUnique 29 monadPlusClassKey, randomClassKey, randomGenClassKey :: Unique monadPlusClassKey = mkPreludeClassUnique 30 randomClassKey = mkPreludeClassUnique 31 randomGenClassKey = mkPreludeClassUnique 32 isStringClassKey :: Unique isStringClassKey = mkPreludeClassUnique 33 applicativeClassKey, foldableClassKey, traversableClassKey :: Unique applicativeClassKey = mkPreludeClassUnique 34 foldableClassKey = mkPreludeClassUnique 35 traversableClassKey = mkPreludeClassUnique 36 genClassKey, gen1ClassKey, datatypeClassKey, constructorClassKey, selectorClassKey :: Unique genClassKey = mkPreludeClassUnique 37 gen1ClassKey = mkPreludeClassUnique 38 datatypeClassKey = mkPreludeClassUnique 39 constructorClassKey = mkPreludeClassUnique 40 selectorClassKey = mkPreludeClassUnique 41 -- KnownNat: see Note [KnowNat & KnownSymbol and EvLit] in TcEvidence knownNatClassNameKey :: Unique knownNatClassNameKey = mkPreludeClassUnique 42 -- KnownSymbol: see Note [KnownNat & KnownSymbol and EvLit] in TcEvidence knownSymbolClassNameKey :: Unique knownSymbolClassNameKey = mkPreludeClassUnique 43 ghciIoClassKey :: Unique ghciIoClassKey = mkPreludeClassUnique 44 isLabelClassNameKey :: Unique isLabelClassNameKey = mkPreludeClassUnique 45 semigroupClassKey, monoidClassKey :: Unique semigroupClassKey = mkPreludeClassUnique 46 monoidClassKey = mkPreludeClassUnique 47 -- Implicit Parameters ipClassKey :: Unique ipClassKey = mkPreludeClassUnique 48 -- Overloaded record fields hasFieldClassNameKey :: Unique hasFieldClassNameKey = mkPreludeClassUnique 49 ---------------- Template Haskell ------------------- -- THNames.hs: USES ClassUniques 200-299 ----------------------------------------------------- {- ************************************************************************ * * \subsubsection[Uniques-prelude-TyCons]{@Uniques@ for wired-in @TyCons@} * * ************************************************************************ -} addrPrimTyConKey, arrayPrimTyConKey, arrayArrayPrimTyConKey, boolTyConKey, byteArrayPrimTyConKey, charPrimTyConKey, charTyConKey, doublePrimTyConKey, doubleTyConKey, floatPrimTyConKey, floatTyConKey, funTyConKey, intPrimTyConKey, intTyConKey, int8TyConKey, int16TyConKey, int32PrimTyConKey, int32TyConKey, int64PrimTyConKey, int64TyConKey, integerTyConKey, naturalTyConKey, listTyConKey, foreignObjPrimTyConKey, maybeTyConKey, weakPrimTyConKey, mutableArrayPrimTyConKey, mutableArrayArrayPrimTyConKey, mutableByteArrayPrimTyConKey, orderingTyConKey, mVarPrimTyConKey, ratioTyConKey, rationalTyConKey, realWorldTyConKey, stablePtrPrimTyConKey, stablePtrTyConKey, eqTyConKey, heqTyConKey, smallArrayPrimTyConKey, smallMutableArrayPrimTyConKey :: Unique addrPrimTyConKey = mkPreludeTyConUnique 1 arrayPrimTyConKey = mkPreludeTyConUnique 3 boolTyConKey = mkPreludeTyConUnique 4 byteArrayPrimTyConKey = mkPreludeTyConUnique 5 charPrimTyConKey = mkPreludeTyConUnique 7 charTyConKey = mkPreludeTyConUnique 8 doublePrimTyConKey = mkPreludeTyConUnique 9 doubleTyConKey = mkPreludeTyConUnique 10 floatPrimTyConKey = mkPreludeTyConUnique 11 floatTyConKey = mkPreludeTyConUnique 12 funTyConKey = mkPreludeTyConUnique 13 intPrimTyConKey = mkPreludeTyConUnique 14 intTyConKey = mkPreludeTyConUnique 15 int8TyConKey = mkPreludeTyConUnique 16 int16TyConKey = mkPreludeTyConUnique 17 int32PrimTyConKey = mkPreludeTyConUnique 18 int32TyConKey = mkPreludeTyConUnique 19 int64PrimTyConKey = mkPreludeTyConUnique 20 int64TyConKey = mkPreludeTyConUnique 21 integerTyConKey = mkPreludeTyConUnique 22 naturalTyConKey = mkPreludeTyConUnique 23 listTyConKey = mkPreludeTyConUnique 24 foreignObjPrimTyConKey = mkPreludeTyConUnique 25 maybeTyConKey = mkPreludeTyConUnique 26 weakPrimTyConKey = mkPreludeTyConUnique 27 mutableArrayPrimTyConKey = mkPreludeTyConUnique 28 mutableByteArrayPrimTyConKey = mkPreludeTyConUnique 29 orderingTyConKey = mkPreludeTyConUnique 30 mVarPrimTyConKey = mkPreludeTyConUnique 31 ratioTyConKey = mkPreludeTyConUnique 32 rationalTyConKey = mkPreludeTyConUnique 33 realWorldTyConKey = mkPreludeTyConUnique 34 stablePtrPrimTyConKey = mkPreludeTyConUnique 35 stablePtrTyConKey = mkPreludeTyConUnique 36 eqTyConKey = mkPreludeTyConUnique 38 heqTyConKey = mkPreludeTyConUnique 39 arrayArrayPrimTyConKey = mkPreludeTyConUnique 40 mutableArrayArrayPrimTyConKey = mkPreludeTyConUnique 41 statePrimTyConKey, stableNamePrimTyConKey, stableNameTyConKey, mutVarPrimTyConKey, ioTyConKey, wordPrimTyConKey, wordTyConKey, word8TyConKey, word16TyConKey, word32PrimTyConKey, word32TyConKey, word64PrimTyConKey, word64TyConKey, liftedConKey, unliftedConKey, anyBoxConKey, kindConKey, boxityConKey, typeConKey, threadIdPrimTyConKey, bcoPrimTyConKey, ptrTyConKey, funPtrTyConKey, tVarPrimTyConKey, eqPrimTyConKey, eqReprPrimTyConKey, eqPhantPrimTyConKey, voidPrimTyConKey, compactPrimTyConKey :: Unique statePrimTyConKey = mkPreludeTyConUnique 50 stableNamePrimTyConKey = mkPreludeTyConUnique 51 stableNameTyConKey = mkPreludeTyConUnique 52 eqPrimTyConKey = mkPreludeTyConUnique 53 eqReprPrimTyConKey = mkPreludeTyConUnique 54 eqPhantPrimTyConKey = mkPreludeTyConUnique 55 mutVarPrimTyConKey = mkPreludeTyConUnique 56 ioTyConKey = mkPreludeTyConUnique 57 voidPrimTyConKey = mkPreludeTyConUnique 58 wordPrimTyConKey = mkPreludeTyConUnique 59 wordTyConKey = mkPreludeTyConUnique 60 word8TyConKey = mkPreludeTyConUnique 61 word16TyConKey = mkPreludeTyConUnique 62 word32PrimTyConKey = mkPreludeTyConUnique 63 word32TyConKey = mkPreludeTyConUnique 64 word64PrimTyConKey = mkPreludeTyConUnique 65 word64TyConKey = mkPreludeTyConUnique 66 liftedConKey = mkPreludeTyConUnique 67 unliftedConKey = mkPreludeTyConUnique 68 anyBoxConKey = mkPreludeTyConUnique 69 kindConKey = mkPreludeTyConUnique 70 boxityConKey = mkPreludeTyConUnique 71 typeConKey = mkPreludeTyConUnique 72 threadIdPrimTyConKey = mkPreludeTyConUnique 73 bcoPrimTyConKey = mkPreludeTyConUnique 74 ptrTyConKey = mkPreludeTyConUnique 75 funPtrTyConKey = mkPreludeTyConUnique 76 tVarPrimTyConKey = mkPreludeTyConUnique 77 compactPrimTyConKey = mkPreludeTyConUnique 78 -- Parallel array type constructor parrTyConKey :: Unique parrTyConKey = mkPreludeTyConUnique 82 -- dotnet interop objectTyConKey :: Unique objectTyConKey = mkPreludeTyConUnique 83 eitherTyConKey :: Unique eitherTyConKey = mkPreludeTyConUnique 84 -- Kind constructors liftedTypeKindTyConKey, tYPETyConKey, constraintKindTyConKey, starKindTyConKey, unicodeStarKindTyConKey, runtimeRepTyConKey, vecCountTyConKey, vecElemTyConKey :: Unique liftedTypeKindTyConKey = mkPreludeTyConUnique 87 tYPETyConKey = mkPreludeTyConUnique 88 constraintKindTyConKey = mkPreludeTyConUnique 92 starKindTyConKey = mkPreludeTyConUnique 93 unicodeStarKindTyConKey = mkPreludeTyConUnique 94 runtimeRepTyConKey = mkPreludeTyConUnique 95 vecCountTyConKey = mkPreludeTyConUnique 96 vecElemTyConKey = mkPreludeTyConUnique 97 pluginTyConKey, frontendPluginTyConKey :: Unique pluginTyConKey = mkPreludeTyConUnique 102 frontendPluginTyConKey = mkPreludeTyConUnique 103 unknownTyConKey, unknown1TyConKey, unknown2TyConKey, unknown3TyConKey, opaqueTyConKey :: Unique unknownTyConKey = mkPreludeTyConUnique 129 unknown1TyConKey = mkPreludeTyConUnique 130 unknown2TyConKey = mkPreludeTyConUnique 131 unknown3TyConKey = mkPreludeTyConUnique 132 opaqueTyConKey = mkPreludeTyConUnique 133 -- Generics (Unique keys) v1TyConKey, u1TyConKey, par1TyConKey, rec1TyConKey, k1TyConKey, m1TyConKey, sumTyConKey, prodTyConKey, compTyConKey, rTyConKey, dTyConKey, cTyConKey, sTyConKey, rec0TyConKey, d1TyConKey, c1TyConKey, s1TyConKey, noSelTyConKey, repTyConKey, rep1TyConKey, uRecTyConKey, uAddrTyConKey, uCharTyConKey, uDoubleTyConKey, uFloatTyConKey, uIntTyConKey, uWordTyConKey :: Unique v1TyConKey = mkPreludeTyConUnique 135 u1TyConKey = mkPreludeTyConUnique 136 par1TyConKey = mkPreludeTyConUnique 137 rec1TyConKey = mkPreludeTyConUnique 138 k1TyConKey = mkPreludeTyConUnique 139 m1TyConKey = mkPreludeTyConUnique 140 sumTyConKey = mkPreludeTyConUnique 141 prodTyConKey = mkPreludeTyConUnique 142 compTyConKey = mkPreludeTyConUnique 143 rTyConKey = mkPreludeTyConUnique 144 dTyConKey = mkPreludeTyConUnique 146 cTyConKey = mkPreludeTyConUnique 147 sTyConKey = mkPreludeTyConUnique 148 rec0TyConKey = mkPreludeTyConUnique 149 d1TyConKey = mkPreludeTyConUnique 151 c1TyConKey = mkPreludeTyConUnique 152 s1TyConKey = mkPreludeTyConUnique 153 noSelTyConKey = mkPreludeTyConUnique 154 repTyConKey = mkPreludeTyConUnique 155 rep1TyConKey = mkPreludeTyConUnique 156 uRecTyConKey = mkPreludeTyConUnique 157 uAddrTyConKey = mkPreludeTyConUnique 158 uCharTyConKey = mkPreludeTyConUnique 159 uDoubleTyConKey = mkPreludeTyConUnique 160 uFloatTyConKey = mkPreludeTyConUnique 161 uIntTyConKey = mkPreludeTyConUnique 162 uWordTyConKey = mkPreludeTyConUnique 163 -- Type-level naturals typeNatKindConNameKey, typeSymbolKindConNameKey, typeNatAddTyFamNameKey, typeNatMulTyFamNameKey, typeNatExpTyFamNameKey, typeNatLeqTyFamNameKey, typeNatSubTyFamNameKey , typeSymbolCmpTyFamNameKey, typeNatCmpTyFamNameKey , typeNatDivTyFamNameKey , typeNatModTyFamNameKey , typeNatLogTyFamNameKey :: Unique typeNatKindConNameKey = mkPreludeTyConUnique 164 typeSymbolKindConNameKey = mkPreludeTyConUnique 165 typeNatAddTyFamNameKey = mkPreludeTyConUnique 166 typeNatMulTyFamNameKey = mkPreludeTyConUnique 167 typeNatExpTyFamNameKey = mkPreludeTyConUnique 168 typeNatLeqTyFamNameKey = mkPreludeTyConUnique 169 typeNatSubTyFamNameKey = mkPreludeTyConUnique 170 typeSymbolCmpTyFamNameKey = mkPreludeTyConUnique 171 typeNatCmpTyFamNameKey = mkPreludeTyConUnique 172 typeNatDivTyFamNameKey = mkPreludeTyConUnique 173 typeNatModTyFamNameKey = mkPreludeTyConUnique 174 typeNatLogTyFamNameKey = mkPreludeTyConUnique 175 -- Custom user type-errors errorMessageTypeErrorFamKey :: Unique errorMessageTypeErrorFamKey = mkPreludeTyConUnique 176 ntTyConKey:: Unique ntTyConKey = mkPreludeTyConUnique 177 coercibleTyConKey :: Unique coercibleTyConKey = mkPreludeTyConUnique 178 proxyPrimTyConKey :: Unique proxyPrimTyConKey = mkPreludeTyConUnique 179 specTyConKey :: Unique specTyConKey = mkPreludeTyConUnique 180 anyTyConKey :: Unique anyTyConKey = mkPreludeTyConUnique 181 smallArrayPrimTyConKey = mkPreludeTyConUnique 182 smallMutableArrayPrimTyConKey = mkPreludeTyConUnique 183 staticPtrTyConKey :: Unique staticPtrTyConKey = mkPreludeTyConUnique 184 staticPtrInfoTyConKey :: Unique staticPtrInfoTyConKey = mkPreludeTyConUnique 185 callStackTyConKey :: Unique callStackTyConKey = mkPreludeTyConUnique 186 -- Typeables typeRepTyConKey, someTypeRepTyConKey, someTypeRepDataConKey :: Unique typeRepTyConKey = mkPreludeTyConUnique 187 someTypeRepTyConKey = mkPreludeTyConUnique 188 someTypeRepDataConKey = mkPreludeTyConUnique 189 typeSymbolAppendFamNameKey :: Unique typeSymbolAppendFamNameKey = mkPreludeTyConUnique 190 ---------------- Template Haskell ------------------- -- THNames.hs: USES TyConUniques 200-299 ----------------------------------------------------- ----------------------- SIMD ------------------------ -- USES TyConUniques 300-399 ----------------------------------------------------- #include "primop-vector-uniques.hs-incl" {- ************************************************************************ * * \subsubsection[Uniques-prelude-DataCons]{@Uniques@ for wired-in @DataCons@} * * ************************************************************************ -} charDataConKey, consDataConKey, doubleDataConKey, falseDataConKey, floatDataConKey, intDataConKey, integerSDataConKey, nilDataConKey, ratioDataConKey, stableNameDataConKey, trueDataConKey, wordDataConKey, word8DataConKey, ioDataConKey, integerDataConKey, heqDataConKey, coercibleDataConKey, nothingDataConKey, justDataConKey :: Unique charDataConKey = mkPreludeDataConUnique 1 consDataConKey = mkPreludeDataConUnique 2 doubleDataConKey = mkPreludeDataConUnique 3 falseDataConKey = mkPreludeDataConUnique 4 floatDataConKey = mkPreludeDataConUnique 5 intDataConKey = mkPreludeDataConUnique 6 integerSDataConKey = mkPreludeDataConUnique 7 nothingDataConKey = mkPreludeDataConUnique 8 justDataConKey = mkPreludeDataConUnique 9 nilDataConKey = mkPreludeDataConUnique 11 ratioDataConKey = mkPreludeDataConUnique 12 word8DataConKey = mkPreludeDataConUnique 13 stableNameDataConKey = mkPreludeDataConUnique 14 trueDataConKey = mkPreludeDataConUnique 15 wordDataConKey = mkPreludeDataConUnique 16 ioDataConKey = mkPreludeDataConUnique 17 integerDataConKey = mkPreludeDataConUnique 18 heqDataConKey = mkPreludeDataConUnique 19 -- Generic data constructors crossDataConKey, inlDataConKey, inrDataConKey, genUnitDataConKey :: Unique crossDataConKey = mkPreludeDataConUnique 20 inlDataConKey = mkPreludeDataConUnique 21 inrDataConKey = mkPreludeDataConUnique 22 genUnitDataConKey = mkPreludeDataConUnique 23 -- Data constructor for parallel arrays parrDataConKey :: Unique parrDataConKey = mkPreludeDataConUnique 24 leftDataConKey, rightDataConKey :: Unique leftDataConKey = mkPreludeDataConUnique 25 rightDataConKey = mkPreludeDataConUnique 26 ltDataConKey, eqDataConKey, gtDataConKey :: Unique ltDataConKey = mkPreludeDataConUnique 27 eqDataConKey = mkPreludeDataConUnique 28 gtDataConKey = mkPreludeDataConUnique 29 coercibleDataConKey = mkPreludeDataConUnique 32 staticPtrDataConKey :: Unique staticPtrDataConKey = mkPreludeDataConUnique 33 staticPtrInfoDataConKey :: Unique staticPtrInfoDataConKey = mkPreludeDataConUnique 34 fingerprintDataConKey :: Unique fingerprintDataConKey = mkPreludeDataConUnique 35 srcLocDataConKey :: Unique srcLocDataConKey = mkPreludeDataConUnique 37 trTyConTyConKey, trTyConDataConKey, trModuleTyConKey, trModuleDataConKey, trNameTyConKey, trNameSDataConKey, trNameDDataConKey, trGhcPrimModuleKey, kindRepTyConKey, typeLitSortTyConKey :: Unique trTyConTyConKey = mkPreludeDataConUnique 40 trTyConDataConKey = mkPreludeDataConUnique 41 trModuleTyConKey = mkPreludeDataConUnique 42 trModuleDataConKey = mkPreludeDataConUnique 43 trNameTyConKey = mkPreludeDataConUnique 44 trNameSDataConKey = mkPreludeDataConUnique 45 trNameDDataConKey = mkPreludeDataConUnique 46 trGhcPrimModuleKey = mkPreludeDataConUnique 47 kindRepTyConKey = mkPreludeDataConUnique 48 typeLitSortTyConKey = mkPreludeDataConUnique 49 typeErrorTextDataConKey, typeErrorAppendDataConKey, typeErrorVAppendDataConKey, typeErrorShowTypeDataConKey :: Unique typeErrorTextDataConKey = mkPreludeDataConUnique 50 typeErrorAppendDataConKey = mkPreludeDataConUnique 51 typeErrorVAppendDataConKey = mkPreludeDataConUnique 52 typeErrorShowTypeDataConKey = mkPreludeDataConUnique 53 prefixIDataConKey, infixIDataConKey, leftAssociativeDataConKey, rightAssociativeDataConKey, notAssociativeDataConKey, sourceUnpackDataConKey, sourceNoUnpackDataConKey, noSourceUnpackednessDataConKey, sourceLazyDataConKey, sourceStrictDataConKey, noSourceStrictnessDataConKey, decidedLazyDataConKey, decidedStrictDataConKey, decidedUnpackDataConKey, metaDataDataConKey, metaConsDataConKey, metaSelDataConKey :: Unique prefixIDataConKey = mkPreludeDataConUnique 54 infixIDataConKey = mkPreludeDataConUnique 55 leftAssociativeDataConKey = mkPreludeDataConUnique 56 rightAssociativeDataConKey = mkPreludeDataConUnique 57 notAssociativeDataConKey = mkPreludeDataConUnique 58 sourceUnpackDataConKey = mkPreludeDataConUnique 59 sourceNoUnpackDataConKey = mkPreludeDataConUnique 60 noSourceUnpackednessDataConKey = mkPreludeDataConUnique 61 sourceLazyDataConKey = mkPreludeDataConUnique 62 sourceStrictDataConKey = mkPreludeDataConUnique 63 noSourceStrictnessDataConKey = mkPreludeDataConUnique 64 decidedLazyDataConKey = mkPreludeDataConUnique 65 decidedStrictDataConKey = mkPreludeDataConUnique 66 decidedUnpackDataConKey = mkPreludeDataConUnique 67 metaDataDataConKey = mkPreludeDataConUnique 68 metaConsDataConKey = mkPreludeDataConUnique 69 metaSelDataConKey = mkPreludeDataConUnique 70 vecRepDataConKey, tupleRepDataConKey, sumRepDataConKey :: Unique vecRepDataConKey = mkPreludeDataConUnique 71 tupleRepDataConKey = mkPreludeDataConUnique 72 sumRepDataConKey = mkPreludeDataConUnique 73 -- See Note [Wiring in RuntimeRep] in TysWiredIn runtimeRepSimpleDataConKeys :: [Unique] liftedRepDataConKey :: Unique runtimeRepSimpleDataConKeys@( liftedRepDataConKey : _) = map mkPreludeDataConUnique [74..82] -- See Note [Wiring in RuntimeRep] in TysWiredIn -- VecCount vecCountDataConKeys :: [Unique] vecCountDataConKeys = map mkPreludeDataConUnique [83..88] -- See Note [Wiring in RuntimeRep] in TysWiredIn -- VecElem vecElemDataConKeys :: [Unique] vecElemDataConKeys = map mkPreludeDataConUnique [89..98] -- Typeable things kindRepTyConAppDataConKey, kindRepVarDataConKey, kindRepAppDataConKey, kindRepFunDataConKey, kindRepTYPEDataConKey, kindRepTypeLitSDataConKey, kindRepTypeLitDDataConKey :: Unique kindRepTyConAppDataConKey = mkPreludeDataConUnique 100 kindRepVarDataConKey = mkPreludeDataConUnique 101 kindRepAppDataConKey = mkPreludeDataConUnique 102 kindRepFunDataConKey = mkPreludeDataConUnique 103 kindRepTYPEDataConKey = mkPreludeDataConUnique 104 kindRepTypeLitSDataConKey = mkPreludeDataConUnique 105 kindRepTypeLitDDataConKey = mkPreludeDataConUnique 106 typeLitSymbolDataConKey, typeLitNatDataConKey :: Unique typeLitSymbolDataConKey = mkPreludeDataConUnique 107 typeLitNatDataConKey = mkPreludeDataConUnique 108 ---------------- Template Haskell ------------------- -- THNames.hs: USES DataUniques 200-250 ----------------------------------------------------- {- ************************************************************************ * * \subsubsection[Uniques-prelude-Ids]{@Uniques@ for wired-in @Ids@ (except @DataCons@)} * * ************************************************************************ -} wildCardKey, absentErrorIdKey, augmentIdKey, appendIdKey, buildIdKey, errorIdKey, foldrIdKey, recSelErrorIdKey, seqIdKey, irrefutPatErrorIdKey, eqStringIdKey, noMethodBindingErrorIdKey, nonExhaustiveGuardsErrorIdKey, runtimeErrorIdKey, patErrorIdKey, voidPrimIdKey, realWorldPrimIdKey, recConErrorIdKey, unpackCStringUtf8IdKey, unpackCStringAppendIdKey, unpackCStringFoldrIdKey, unpackCStringIdKey, typeErrorIdKey, divIntIdKey, modIntIdKey :: Unique wildCardKey = mkPreludeMiscIdUnique 0 -- See Note [WildCard binders] absentErrorIdKey = mkPreludeMiscIdUnique 1 augmentIdKey = mkPreludeMiscIdUnique 2 appendIdKey = mkPreludeMiscIdUnique 3 buildIdKey = mkPreludeMiscIdUnique 4 errorIdKey = mkPreludeMiscIdUnique 5 foldrIdKey = mkPreludeMiscIdUnique 6 recSelErrorIdKey = mkPreludeMiscIdUnique 7 seqIdKey = mkPreludeMiscIdUnique 8 irrefutPatErrorIdKey = mkPreludeMiscIdUnique 9 eqStringIdKey = mkPreludeMiscIdUnique 10 noMethodBindingErrorIdKey = mkPreludeMiscIdUnique 11 nonExhaustiveGuardsErrorIdKey = mkPreludeMiscIdUnique 12 runtimeErrorIdKey = mkPreludeMiscIdUnique 13 patErrorIdKey = mkPreludeMiscIdUnique 14 realWorldPrimIdKey = mkPreludeMiscIdUnique 15 recConErrorIdKey = mkPreludeMiscIdUnique 16 unpackCStringUtf8IdKey = mkPreludeMiscIdUnique 17 unpackCStringAppendIdKey = mkPreludeMiscIdUnique 18 unpackCStringFoldrIdKey = mkPreludeMiscIdUnique 19 unpackCStringIdKey = mkPreludeMiscIdUnique 20 voidPrimIdKey = mkPreludeMiscIdUnique 21 typeErrorIdKey = mkPreludeMiscIdUnique 22 divIntIdKey = mkPreludeMiscIdUnique 23 modIntIdKey = mkPreludeMiscIdUnique 24 unsafeCoerceIdKey, concatIdKey, filterIdKey, zipIdKey, bindIOIdKey, returnIOIdKey, newStablePtrIdKey, printIdKey, failIOIdKey, nullAddrIdKey, voidArgIdKey, fstIdKey, sndIdKey, otherwiseIdKey, assertIdKey :: Unique unsafeCoerceIdKey = mkPreludeMiscIdUnique 30 concatIdKey = mkPreludeMiscIdUnique 31 filterIdKey = mkPreludeMiscIdUnique 32 zipIdKey = mkPreludeMiscIdUnique 33 bindIOIdKey = mkPreludeMiscIdUnique 34 returnIOIdKey = mkPreludeMiscIdUnique 35 newStablePtrIdKey = mkPreludeMiscIdUnique 36 printIdKey = mkPreludeMiscIdUnique 37 failIOIdKey = mkPreludeMiscIdUnique 38 nullAddrIdKey = mkPreludeMiscIdUnique 39 voidArgIdKey = mkPreludeMiscIdUnique 40 fstIdKey = mkPreludeMiscIdUnique 41 sndIdKey = mkPreludeMiscIdUnique 42 otherwiseIdKey = mkPreludeMiscIdUnique 43 assertIdKey = mkPreludeMiscIdUnique 44 mkIntegerIdKey, smallIntegerIdKey, wordToIntegerIdKey, integerToWordIdKey, integerToIntIdKey, integerToWord64IdKey, integerToInt64IdKey, word64ToIntegerIdKey, int64ToIntegerIdKey, plusIntegerIdKey, timesIntegerIdKey, minusIntegerIdKey, negateIntegerIdKey, eqIntegerPrimIdKey, neqIntegerPrimIdKey, absIntegerIdKey, signumIntegerIdKey, leIntegerPrimIdKey, gtIntegerPrimIdKey, ltIntegerPrimIdKey, geIntegerPrimIdKey, compareIntegerIdKey, quotRemIntegerIdKey, divModIntegerIdKey, quotIntegerIdKey, remIntegerIdKey, divIntegerIdKey, modIntegerIdKey, floatFromIntegerIdKey, doubleFromIntegerIdKey, encodeFloatIntegerIdKey, encodeDoubleIntegerIdKey, decodeDoubleIntegerIdKey, gcdIntegerIdKey, lcmIntegerIdKey, andIntegerIdKey, orIntegerIdKey, xorIntegerIdKey, complementIntegerIdKey, shiftLIntegerIdKey, shiftRIntegerIdKey :: Unique mkIntegerIdKey = mkPreludeMiscIdUnique 60 smallIntegerIdKey = mkPreludeMiscIdUnique 61 integerToWordIdKey = mkPreludeMiscIdUnique 62 integerToIntIdKey = mkPreludeMiscIdUnique 63 integerToWord64IdKey = mkPreludeMiscIdUnique 64 integerToInt64IdKey = mkPreludeMiscIdUnique 65 plusIntegerIdKey = mkPreludeMiscIdUnique 66 timesIntegerIdKey = mkPreludeMiscIdUnique 67 minusIntegerIdKey = mkPreludeMiscIdUnique 68 negateIntegerIdKey = mkPreludeMiscIdUnique 69 eqIntegerPrimIdKey = mkPreludeMiscIdUnique 70 neqIntegerPrimIdKey = mkPreludeMiscIdUnique 71 absIntegerIdKey = mkPreludeMiscIdUnique 72 signumIntegerIdKey = mkPreludeMiscIdUnique 73 leIntegerPrimIdKey = mkPreludeMiscIdUnique 74 gtIntegerPrimIdKey = mkPreludeMiscIdUnique 75 ltIntegerPrimIdKey = mkPreludeMiscIdUnique 76 geIntegerPrimIdKey = mkPreludeMiscIdUnique 77 compareIntegerIdKey = mkPreludeMiscIdUnique 78 quotIntegerIdKey = mkPreludeMiscIdUnique 79 remIntegerIdKey = mkPreludeMiscIdUnique 80 divIntegerIdKey = mkPreludeMiscIdUnique 81 modIntegerIdKey = mkPreludeMiscIdUnique 82 divModIntegerIdKey = mkPreludeMiscIdUnique 83 quotRemIntegerIdKey = mkPreludeMiscIdUnique 84 floatFromIntegerIdKey = mkPreludeMiscIdUnique 85 doubleFromIntegerIdKey = mkPreludeMiscIdUnique 86 encodeFloatIntegerIdKey = mkPreludeMiscIdUnique 87 encodeDoubleIntegerIdKey = mkPreludeMiscIdUnique 88 gcdIntegerIdKey = mkPreludeMiscIdUnique 89 lcmIntegerIdKey = mkPreludeMiscIdUnique 90 andIntegerIdKey = mkPreludeMiscIdUnique 91 orIntegerIdKey = mkPreludeMiscIdUnique 92 xorIntegerIdKey = mkPreludeMiscIdUnique 93 complementIntegerIdKey = mkPreludeMiscIdUnique 94 shiftLIntegerIdKey = mkPreludeMiscIdUnique 95 shiftRIntegerIdKey = mkPreludeMiscIdUnique 96 wordToIntegerIdKey = mkPreludeMiscIdUnique 97 word64ToIntegerIdKey = mkPreludeMiscIdUnique 98 int64ToIntegerIdKey = mkPreludeMiscIdUnique 99 decodeDoubleIntegerIdKey = mkPreludeMiscIdUnique 100 rootMainKey, runMainKey :: Unique rootMainKey = mkPreludeMiscIdUnique 101 runMainKey = mkPreludeMiscIdUnique 102 thenIOIdKey, lazyIdKey, assertErrorIdKey, oneShotKey, runRWKey :: Unique thenIOIdKey = mkPreludeMiscIdUnique 103 lazyIdKey = mkPreludeMiscIdUnique 104 assertErrorIdKey = mkPreludeMiscIdUnique 105 oneShotKey = mkPreludeMiscIdUnique 106 runRWKey = mkPreludeMiscIdUnique 107 breakpointIdKey, breakpointCondIdKey, breakpointAutoIdKey, breakpointJumpIdKey, breakpointCondJumpIdKey, breakpointAutoJumpIdKey :: Unique breakpointIdKey = mkPreludeMiscIdUnique 110 breakpointCondIdKey = mkPreludeMiscIdUnique 111 breakpointAutoIdKey = mkPreludeMiscIdUnique 112 breakpointJumpIdKey = mkPreludeMiscIdUnique 113 breakpointCondJumpIdKey = mkPreludeMiscIdUnique 114 breakpointAutoJumpIdKey = mkPreludeMiscIdUnique 115 inlineIdKey, noinlineIdKey :: Unique inlineIdKey = mkPreludeMiscIdUnique 120 -- see below mapIdKey, groupWithIdKey, dollarIdKey :: Unique mapIdKey = mkPreludeMiscIdUnique 121 groupWithIdKey = mkPreludeMiscIdUnique 122 dollarIdKey = mkPreludeMiscIdUnique 123 coercionTokenIdKey :: Unique coercionTokenIdKey = mkPreludeMiscIdUnique 124 noinlineIdKey = mkPreludeMiscIdUnique 125 rationalToFloatIdKey, rationalToDoubleIdKey :: Unique rationalToFloatIdKey = mkPreludeMiscIdUnique 130 rationalToDoubleIdKey = mkPreludeMiscIdUnique 131 -- dotnet interop unmarshalObjectIdKey, marshalObjectIdKey, marshalStringIdKey, unmarshalStringIdKey, checkDotnetResNameIdKey :: Unique unmarshalObjectIdKey = mkPreludeMiscIdUnique 150 marshalObjectIdKey = mkPreludeMiscIdUnique 151 marshalStringIdKey = mkPreludeMiscIdUnique 152 unmarshalStringIdKey = mkPreludeMiscIdUnique 153 checkDotnetResNameIdKey = mkPreludeMiscIdUnique 154 undefinedKey :: Unique undefinedKey = mkPreludeMiscIdUnique 155 magicDictKey :: Unique magicDictKey = mkPreludeMiscIdUnique 156 coerceKey :: Unique coerceKey = mkPreludeMiscIdUnique 157 {- Certain class operations from Prelude classes. They get their own uniques so we can look them up easily when we want to conjure them up during type checking. -} -- Just a placeholder for unbound variables produced by the renamer: unboundKey :: Unique unboundKey = mkPreludeMiscIdUnique 158 fromIntegerClassOpKey, minusClassOpKey, fromRationalClassOpKey, enumFromClassOpKey, enumFromThenClassOpKey, enumFromToClassOpKey, enumFromThenToClassOpKey, eqClassOpKey, geClassOpKey, negateClassOpKey, failMClassOpKey_preMFP, bindMClassOpKey, thenMClassOpKey, returnMClassOpKey, fmapClassOpKey :: Unique fromIntegerClassOpKey = mkPreludeMiscIdUnique 160 minusClassOpKey = mkPreludeMiscIdUnique 161 fromRationalClassOpKey = mkPreludeMiscIdUnique 162 enumFromClassOpKey = mkPreludeMiscIdUnique 163 enumFromThenClassOpKey = mkPreludeMiscIdUnique 164 enumFromToClassOpKey = mkPreludeMiscIdUnique 165 enumFromThenToClassOpKey = mkPreludeMiscIdUnique 166 eqClassOpKey = mkPreludeMiscIdUnique 167 geClassOpKey = mkPreludeMiscIdUnique 168 negateClassOpKey = mkPreludeMiscIdUnique 169 failMClassOpKey_preMFP = mkPreludeMiscIdUnique 170 bindMClassOpKey = mkPreludeMiscIdUnique 171 -- (>>=) thenMClassOpKey = mkPreludeMiscIdUnique 172 -- (>>) fmapClassOpKey = mkPreludeMiscIdUnique 173 returnMClassOpKey = mkPreludeMiscIdUnique 174 -- Recursive do notation mfixIdKey :: Unique mfixIdKey = mkPreludeMiscIdUnique 175 -- MonadFail operations failMClassOpKey :: Unique failMClassOpKey = mkPreludeMiscIdUnique 176 -- Arrow notation arrAIdKey, composeAIdKey, firstAIdKey, appAIdKey, choiceAIdKey, loopAIdKey :: Unique arrAIdKey = mkPreludeMiscIdUnique 180 composeAIdKey = mkPreludeMiscIdUnique 181 -- >>> firstAIdKey = mkPreludeMiscIdUnique 182 appAIdKey = mkPreludeMiscIdUnique 183 choiceAIdKey = mkPreludeMiscIdUnique 184 -- ||| loopAIdKey = mkPreludeMiscIdUnique 185 fromStringClassOpKey :: Unique fromStringClassOpKey = mkPreludeMiscIdUnique 186 -- Annotation type checking toAnnotationWrapperIdKey :: Unique toAnnotationWrapperIdKey = mkPreludeMiscIdUnique 187 -- Conversion functions fromIntegralIdKey, realToFracIdKey, toIntegerClassOpKey, toRationalClassOpKey :: Unique fromIntegralIdKey = mkPreludeMiscIdUnique 190 realToFracIdKey = mkPreludeMiscIdUnique 191 toIntegerClassOpKey = mkPreludeMiscIdUnique 192 toRationalClassOpKey = mkPreludeMiscIdUnique 193 -- Monad comprehensions guardMIdKey, liftMIdKey, mzipIdKey :: Unique guardMIdKey = mkPreludeMiscIdUnique 194 liftMIdKey = mkPreludeMiscIdUnique 195 mzipIdKey = mkPreludeMiscIdUnique 196 -- GHCi ghciStepIoMClassOpKey :: Unique ghciStepIoMClassOpKey = mkPreludeMiscIdUnique 197 -- Overloaded lists isListClassKey, fromListClassOpKey, fromListNClassOpKey, toListClassOpKey :: Unique isListClassKey = mkPreludeMiscIdUnique 198 fromListClassOpKey = mkPreludeMiscIdUnique 199 fromListNClassOpKey = mkPreludeMiscIdUnique 500 toListClassOpKey = mkPreludeMiscIdUnique 501 proxyHashKey :: Unique proxyHashKey = mkPreludeMiscIdUnique 502 ---------------- Template Haskell ------------------- -- THNames.hs: USES IdUniques 200-499 ----------------------------------------------------- -- Used to make `Typeable` dictionaries mkTyConKey , mkTrConKey , mkTrAppKey , mkTrFunKey , typeNatTypeRepKey , typeSymbolTypeRepKey , typeRepIdKey :: Unique mkTyConKey = mkPreludeMiscIdUnique 503 mkTrConKey = mkPreludeMiscIdUnique 504 mkTrAppKey = mkPreludeMiscIdUnique 505 typeNatTypeRepKey = mkPreludeMiscIdUnique 506 typeSymbolTypeRepKey = mkPreludeMiscIdUnique 507 typeRepIdKey = mkPreludeMiscIdUnique 508 mkTrFunKey = mkPreludeMiscIdUnique 509 -- Representations for primitive types trTYPEKey ,trTYPE'PtrRepLiftedKey , trRuntimeRepKey , tr'PtrRepLiftedKey :: Unique trTYPEKey = mkPreludeMiscIdUnique 510 trTYPE'PtrRepLiftedKey = mkPreludeMiscIdUnique 511 trRuntimeRepKey = mkPreludeMiscIdUnique 512 tr'PtrRepLiftedKey = mkPreludeMiscIdUnique 513 -- KindReps for common cases starKindRepKey, starArrStarKindRepKey, starArrStarArrStarKindRepKey :: Unique starKindRepKey = mkPreludeMiscIdUnique 520 starArrStarKindRepKey = mkPreludeMiscIdUnique 521 starArrStarArrStarKindRepKey = mkPreludeMiscIdUnique 522 -- Dynamic toDynIdKey :: Unique toDynIdKey = mkPreludeMiscIdUnique 550 bitIntegerIdKey :: Unique bitIntegerIdKey = mkPreludeMiscIdUnique 551 heqSCSelIdKey, coercibleSCSelIdKey :: Unique heqSCSelIdKey = mkPreludeMiscIdUnique 552 coercibleSCSelIdKey = mkPreludeMiscIdUnique 553 sappendClassOpKey :: Unique sappendClassOpKey = mkPreludeMiscIdUnique 554 memptyClassOpKey, mappendClassOpKey, mconcatClassOpKey :: Unique memptyClassOpKey = mkPreludeMiscIdUnique 555 mappendClassOpKey = mkPreludeMiscIdUnique 556 mconcatClassOpKey = mkPreludeMiscIdUnique 557 emptyCallStackKey, pushCallStackKey :: Unique emptyCallStackKey = mkPreludeMiscIdUnique 558 pushCallStackKey = mkPreludeMiscIdUnique 559 fromStaticPtrClassOpKey :: Unique fromStaticPtrClassOpKey = mkPreludeMiscIdUnique 560 makeStaticKey :: Unique makeStaticKey = mkPreludeMiscIdUnique 561 -- Natural naturalFromIntegerIdKey :: Unique naturalFromIntegerIdKey = mkPreludeMiscIdUnique 562 {- ************************************************************************ * * \subsection[Class-std-groups]{Standard groups of Prelude classes} * * ************************************************************************ NOTE: @Eq@ and @Text@ do need to appear in @standardClasses@ even though every numeric class has these two as a superclass, because the list of ambiguous dictionaries hasn't been simplified. -} numericClassKeys :: [Unique] numericClassKeys = [ numClassKey , realClassKey , integralClassKey ] ++ fractionalClassKeys fractionalClassKeys :: [Unique] fractionalClassKeys = [ fractionalClassKey , floatingClassKey , realFracClassKey , realFloatClassKey ] -- The "standard classes" are used in defaulting (Haskell 98 report 4.3.4), -- and are: "classes defined in the Prelude or a standard library" standardClassKeys :: [Unique] standardClassKeys = derivableClassKeys ++ numericClassKeys ++ [randomClassKey, randomGenClassKey, functorClassKey, monadClassKey, monadPlusClassKey, monadFailClassKey, semigroupClassKey, monoidClassKey, isStringClassKey, applicativeClassKey, foldableClassKey, traversableClassKey, alternativeClassKey ] {- @derivableClassKeys@ is also used in checking \tr{deriving} constructs (@TcDeriv@). -} derivableClassKeys :: [Unique] derivableClassKeys = [ eqClassKey, ordClassKey, enumClassKey, ixClassKey, boundedClassKey, showClassKey, readClassKey ] -- These are the "interactive classes" that are consulted when doing -- defaulting. Does not include Num or IsString, which have special -- handling. interactiveClassNames :: [Name] interactiveClassNames = [ showClassName, eqClassName, ordClassName, foldableClassName , traversableClassName ] interactiveClassKeys :: [Unique] interactiveClassKeys = map getUnique interactiveClassNames {- ************************************************************************ * * Semi-builtin names * * ************************************************************************ The following names should be considered by GHCi to be in scope always. -} pretendNameIsInScope :: Name -> Bool pretendNameIsInScope n = any (n `hasKey`) [ starKindTyConKey, liftedTypeKindTyConKey, tYPETyConKey , runtimeRepTyConKey, liftedRepDataConKey ]
ezyang/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
108,661
0
10
24,152
16,526
9,425
7,101
1,685
2
module Data.ByteString.Char8.AsBs ( module Data.ByteString.Char8.AsBs ) where -- generated by https://github.com/rvion/ride/tree/master/jetpack-gen import qualified Data.ByteString.Char8 as I -- bs_findSubstring :: ByteString -> ByteString -> Maybe Int bs_findSubstring = I.findSubstring -- bs_findSubstrings :: ByteString -> ByteString -> [Int] bs_findSubstrings = I.findSubstrings -- bs_hPutStrLn :: Handle -> ByteString -> IO () bs_hPutStrLn = I.hPutStrLn -- bs_lines :: ByteString -> [ByteString] bs_lines = I.lines -- bs_putStrLn :: ByteString -> IO () bs_putStrLn = I.putStrLn -- bs_readInt :: ByteString -> Maybe (Int, ByteString) bs_readInt = I.readInt -- bs_readInteger :: ByteString -> Maybe (Integer, ByteString) bs_readInteger = I.readInteger -- bs_unlines :: [ByteString] -> ByteString bs_unlines = I.unlines -- bs_unwords :: [ByteString] -> ByteString bs_unwords = I.unwords -- bs_words :: ByteString -> [ByteString] bs_words = I.words
rvion/ride
jetpack/src/Data/ByteString/Char8/AsBs.hs
bsd-3-clause
966
0
5
135
108
71
37
13
1
{-| Default lenses for simple total getters and total possibly polymorphic, updates. Useful for creating accessor labels for single constructor datatypes. Also useful field labels that are shared between all the constructors of a multi constructor datatypes. -} {-# LANGUAGE TypeOperators #-} module Data.Label.Total ( (:->) , Total , lens , get , modify , set -- * Working in contexts. , traverse , lifted ) where import Control.Monad ((<=<), liftM) import Data.Label.Poly (Lens) import Data.Label.Point (Total) import qualified Data.Label.Poly as Poly {-# INLINE lens #-} {-# INLINE get #-} {-# INLINE modify #-} {-# INLINE set #-} ------------------------------------------------------------------------------- -- | Total lens type specialized for total accessor functions. type f :-> o = Lens Total f o -- | Create a total lens from a getter and a modifier. -- -- We expect the following law to hold: -- -- > get l (set l a f) == a -- -- > set l (get l f) f == f lens :: (f -> o) -- ^ Getter. -> ((o -> i) -> f -> g) -- ^ Modifier. -> (f -> g) :-> (o -> i) lens g s = Poly.lens g (uncurry s) -- | Get the getter function from a lens. get :: ((f -> g) :-> (o -> i)) -> f -> o get = Poly.get -- | Get the modifier function from a lens. modify :: (f -> g) :-> (o -> i) -> (o -> i) -> f -> g modify = curry . Poly.modify -- | Get the setter function from a lens. set :: ((f -> g) :-> (o -> i)) -> i -> f -> g set = curry . Poly.set -- | Modify in some context. traverse :: Functor m => (f -> g) :-> (o -> i) -> (o -> m i) -> f -> m g traverse l m f = (\w -> set l w f) `fmap` m (get l f) -- | Lifted lens composition. -- -- For example, useful when specialized to lists: -- -- > :: (f :-> [o]) -- > -> (o :-> [a]) -- > -> (f :-> [a]) lifted :: Monad m => (f -> g) :-> (m o -> m i) -> (o -> i) :-> (m a -> m b) -> (f -> g) :-> (m a -> m b) lifted a b = lens (get b <=< get a) (modify a . liftM . modify b)
bergmark/fclabels
src/Data/Label/Total.hs
bsd-3-clause
1,968
0
11
472
584
332
252
37
1
{-# LANGUAGE RankNTypes, BangPatterns, ScopedTypeVariables, FlexibleInstances #-} module Math.Probably.MALA where import Math.Probably.MCMC import qualified Math.Probably.PDF as PDF import Math.Probably.RandIO import Math.Probably.FoldingStats import Math.Probably.Sampler import qualified Math.Probably.PDF as PDF import Control.Applicative import Numeric.LinearAlgebra import Numeric.AD import Text.Printf import System.IO import Data.Maybe import Statistics.Test.KolmogorovSmirnov import Statistics.Test.MannWhitneyU import qualified Data.Vector.Unboxed as U import qualified Control.Monad.State.Strict as S import qualified Data.Vector.Storable as VS import Debug.Trace import Data.IORef import Control.Spoon class IsNaN a where isItNaN :: a -> Bool instance IsNaN Double where isItNaN = nanOrInf instance IsNaN (Vector Double) where isItNaN = any nanOrInf . toList instance IsNaN (Matrix Double) where isItNaN = or . (map (any nanOrInf . toList)) . toRows checkNaN :: IsNaN a => String -> a -> String checkNaN s x | isItNaN x = " "++s++" " | otherwise = "" class Covariance a where mvnSampler :: Vector Double -> Double -> a -> Sampler (Vector Double) mvnPDF :: Vector Double -> Double -> a -> PDF.PDF (Vector Double) covMul :: a -> Vector Double -> Vector Double restrict :: Vector Int -> a -> a instance Covariance (Matrix Double,Matrix Double,Matrix Double) where mvnSampler mu sigma (cov, covInv, covChol) = multiNormalByChol mu (scale (sqrt sigma) covChol) mvnPDF mu sigma (cov, covInv, covChol) = PDF.multiNormalByInvFixCov (scale (recip sigma) covInv) mu covMul (cov, covInv, covChol) v = cov <> v instance Covariance (Vector Double) where mvnSampler mu sigma varv = multiNormalIndep (scale sigma varv) mu mvnPDF mu sigma varv = PDF.multiNormalIndep (scale sigma varv) mu covMul varv v = VS.zipWith (*) varv v restrict vixs v = VS.backpermute v vixs data MalaPar = MalaPar { mpXi :: !(Vector Double), mpPi :: !Double, mpGradLast :: !(Vector Double), mpSigma :: !Double, mpCount :: !Double, mpAccept :: !Double, mpFreezeSigma :: !Bool, mpThin :: !Int, mpMaxGradLen :: !Double } --, -- mpLastRatio :: !Double } deriving Show data Pair a b = Pair !a !b data List a = Cons !a !(List a) | Nil unPair (Pair x y) = (x,y) unList (Cons x xs) = x: unList xs unList Nil =[] trunc t v = scale (t/(max t (norm2 v))) v mala1 :: Covariance a => a -> (Vector Double -> (Double,Vector Double)) -> Bool -> MalaPar -> Sampler MalaPar mala1 cov postgrad useCache (MalaPar xi piCached gradientiCached sigma tr tracc freeze thinn maxGrad) = do let (pi,gradienti) = if useCache then (piCached, gradientiCached) else let (p, gr_untr) = postgrad xi in (p, trunc maxGrad gr_untr) let xstarMean = xi + scale (sigma/2) (cov `covMul` gradienti) xstar <- mvnSampler xstarMean sigma cov u <- unitSample let (!pstar, gradientStarUntrunc) = postgrad xstar gradientStar = trunc maxGrad gradientStarUntrunc let !revJumpMean = xstar + scale (sigma/2) (cov `covMul` gradientStar) ptop = mvnPDF revJumpMean sigma cov xi pbot = mvnPDF xstarMean sigma cov xstar ratio = exp $ pstar -pi + ptop - pbot tr' = max 1 tr sigmaNext = case () of _ | freeze -> sigma accept = tracc / tr freezeNext = freeze {-| freeze = True | not freeze = tr > 100 && accept > 0.5 && accept < 0.6 -} if trace (show $ (tr, pstar ,pi , ratio, sigma)) $ u < ratio then return $ MalaPar xstar pstar (gradientStar) (if freezeNext then sigma else (min 1.4 $ 1+kmala/tr')*sigma) (tr+1) (tracc+1) freezeNext thinn maxGrad -- sigma (tr+1) (tracc+1) else return $ MalaPar xi pi ( gradienti) (if freezeNext then sigma else (max 0.7143 $ 1-kmala/tr')**1.3*sigma) (tr+1) tracc freezeNext thinn maxGrad -- sigma (tr+1) tracc blockMala1 :: Covariance a => (Vector Double -> (Double,Vector Double)) -> Vector Double -> [(a, MalaPar, Vector Int)] -> Sampler (Vector Double, [(a, MalaPar, Vector Int)]) blockMala1 postgrad xi blocks = do let go totalV [] accblocks = return (totalV, reverse accblocks) go totalV ((cov, mp0, vixs) : blocks) accblocks = do let myPostGrad vpars = let (p, grad) = postgrad $ VS.update_ totalV vixs vpars in (p, VS.backpermute grad vixs) mp1 <- mala1 cov myPostGrad False mp0 let newTotalV = VS.update_ totalV vixs (mpXi mp1) go newTotalV blocks $ (cov, mp1, vixs) : accblocks go xi blocks [] runMalaBlocks :: Covariance a => a -> (Vector Double -> (Double,Vector Double)) -> Int -> Double -> Int -> Vector Double -> [Vector Int] -> RIO [Vector Double] runMalaBlocks cov postgrad nsam truncN thinN init vixs = go nsam initBlocks init [] where initBlocks = flip map vixs $ \vix-> (restrict vix cov, MalaPar (VS.backpermute init vix) 0 (fromList [0]) 0.001 0 0 False thinN truncN, vix) go 0 _ _ vs = return vs go n blocks0 v0 vs = do (!v1, blocks1) <- sample $ blockMala1 postgrad v0 blocks0 let (_,mpLast,_) = last blocks1 io $ print $ (n, mpPi mpLast, map (\(_,mp,_) -> mpSigma mp) blocks1) let newChainRes = if thinN == 0 || n `mod` thinN ==0 then v1 : vs else vs go (n-1) blocks1 v1 newChainRes {-runMala :: Matrix Double -> (Vector Double -> (Double,Vector Double)) -> Int -> Vector Double -> RIO [(Double,Vector Double)] runMala cov postgrad nsam init = go nsam mp1 [] where go 0 mpar xs = do io $ putStrLn $ "MALA accept = "++show (mpAccept mpar/mpCount mpar) io $ putStrLn $ "MALA sigma = "++show (mpSigma mpar) return xs go n y xs = do y1 <- sample $ mala1 cov postgrad y go (n-1) y1 $ (mpPi y1, mpXi y1):xs (pi, gradi) = postgrad init mp1 = MalaPar init pi (gradi) 1 0 0 False -} runMalaMP :: Covariance a => a -> (Vector Double -> (Double,Vector Double)) -> Int -> MalaPar -> [(Double,Vector Double)] -> RIO (MalaPar, [(Double,Vector Double)]) runMalaMP cov pdf nsam init xs0 = go nsam init xs0 where go 0 mpar xs = do io $ putStrLn $ "MALA accept = "++show (mpAccept mpar/mpCount mpar) io $ putStrLn $ "MALA sigma = "++show (mpSigma mpar) return (mpar, xs) go n y xs = do y1 <- sample $ mala1 cov pdf True y -- io $ do putStrLn $ show (mpCount y1, mpPi y1, mpSigma y1) -- hFlush stdout let newChainRes = if mpThin y1 == 0 || round (mpCount y1) `mod` mpThin y1 ==0 then let !xi = mpXi y1 !pi = mpPi y1 !more = (pi,xi) in more:xs else xs go (n-1) y1 newChainRes runMalaUntilBetter :: Covariance a => a ->(Vector Double -> (Double,Vector Double)) -> Int -> MalaPar -> RIO (MalaPar, [(Double,Vector Double)]) runMalaUntilBetter cov pdf nsam init = go nsam init [] where pTarget = mpPi init go 0 mpar xs = do io $ putStrLn $ "MALA accept = "++show (mpAccept mpar/mpCount mpar) io $ putStrLn $ "MALA sigma = "++show (mpSigma mpar) return (mpar, xs) go n y xs = do y1 <- sample $ mala1 cov pdf True y io $ do putStrLn $ show (mpCount y1, mpPi y1, mpSigma y1) hFlush stdout let newChainRes = if mpThin y1 == 0 || round (mpCount y1) `mod` mpThin y1 ==0 then (mpPi y1, mpXi y1):xs else xs if mpPi y1 > pTarget then return (y1, newChainRes) else go (n-1) y1 $ newChainRes {-runMalaMPaccept' :: Matrix Double -> (Vector Double -> (Double,Vector Double)) -> Int -> MalaPar -> RIO (MalaPar, [(Double,Vector Double)]) runMalaMPaccept' cov pdf nsam init = do stseed <- S.get res <- io $ do seedref <- newIORef stseed resRef <- newIORef Nil let go !mpar | (round $ mpAccept mpar) >= nsam = return mpar | otherwise = do seed <- readIORef seedref putStr ((show (round $ mpAccept mpar)) ++".") >> hFlush stdout let (!mpar1, !seed1) = unSam (mala1 cov pdf mpar) seed writeIORef seedref seed1 modifyIORef resRef (Cons (Pair (mpPi mpar1) ( mpXi mpar1))) go mpar1 mpar <- go init seed <- readIORef seedref reslist <- readIORef resRef return (seed, (mpar,reslist)) S.put $ fst res let mp = fst $ snd res return $ (mp, map unPair $ unList $ snd $ snd res) -- pi = pdf $ toList $ mpXi init -} runMalaMPaccept :: Covariance a => a -> (Vector Double -> (Double,Vector Double)) -> Int -> MalaPar -> RIO (MalaPar, [(Double,Vector Double)]) runMalaMPaccept cov pdf nsam init = go init [] where go !mpar !xs | (round $ mpAccept mpar) >= nsam = do io $ putStrLn $ "MALA accept = "++show (mpAccept mpar/mpCount mpar) io $ putStrLn $ "MALA sigma = "++show (mpSigma mpar) return (mpar, xs) | mpAccept mpar < 0.5 && mpCount mpar > 20 = return (mpar, []) | otherwise = do !mpar1 <- sample $ mala1 cov pdf True mpar io $ putStr ((show (round $ mpAccept mpar)) ++".") >> hFlush stdout go mpar1 $ (mpPi mpar1, mpXi mpar1):xs kmala = 5 {-runMalaRioESS :: Matrix Double -> (Vector Double -> (Double,Vector Double)) -> Int -> Vector Double -> RIO [Vector Double] runMalaRioESS cov pdf want_ess xi = do let (p0,grad0) = pdf xi let sigma0 = 1.5 / (realToFrac $ dim xi) -- determined empirically let mp0 = MalaPar xi p0 grad0 sigma0 0 0 False nsam0 = want_ess*20 io $ putStrLn $ "initial sigma = "++show (mpSigma mp0) (mp1, xs1) <- runMalaMP cov pdf nsam0 mp0 [] let have_ess = min (mpAccept mp1) $ calcESSprim $ map snd xs1 if have_ess > realToFrac want_ess then return $ map snd xs1 else do let need_ess = max 1 $ realToFrac want_ess - have_ess samples_per_es = realToFrac nsam0/have_ess to_do = round $ samples_per_es * need_ess (mp2, xs2) <- runMalaMP cov pdf to_do mp1 xs1 return $ map snd xs2 -} runMalaRioCodaESS :: Covariance a => a-> (Vector Double -> (Double,Vector Double)) -> Int -> Double -> Vector Double -> RIO [Vector Double] runMalaRioCodaESS cov pdf want_ess truncN xi = do let (p0,grad0) = pdf xi let sigma0 = 1.5 / (realToFrac $ dim xi) -- determined empirically let mp0 = MalaPar xi p0 (trunc truncN grad0) sigma0 0 0 False 0 truncN nsam0 = want_ess*1 let converged mp xs = do let have_ess = min (mpAccept mp) $ calcESSprim $ map snd xs io $ putStrLn $ "ESS=" ++show have_ess if have_ess > realToFrac want_ess then return $ map snd xs else do let need_ess = max 1 $ realToFrac want_ess - have_ess samples_per_es = realToFrac nsam0/have_ess to_do = round $ samples_per_es * need_ess io $ putStrLn $ "running converged for "++show to_do (mp2, xs2) <- runMalaMP cov pdf to_do (mp {mpFreezeSigma = True}) xs io $ putStrLn $ "All done" return $ map snd xs2 let go mp n xs = do (mp2, xs2) <- runMalaMP cov pdf n mp [] let testres = mannWhitneyUtest TwoTailed 0.05 (U.fromList $ map fst xs2) (U.fromList $ map fst xs) if testres/= Just NotSignificant then do io$ putStrLn $ "not converged: "++show testres++" at "++show (mpPi mp2) go mp2 (round $ realToFrac n*2) xs2 else do io$ putStrLn "converged!" converged mp2 (xs2++xs) io $ putStrLn $ "initial sigma = "++show (mpSigma mp0) (mp1, xs1) <- runMalaMPaccept cov pdf nsam0 mp0 case xs1 of [] -> return [] _ -> go mp1 (round $ mpCount mp1) xs1 {- case (spoon (invlndet cov), mbCholSH cov) of (Just (covInv, (lndt,_)), Just covChol) -> go_rest (covInv, covChol) _ -> let cov' = PDF.posdefify cov in case (spoon (invlndet cov'), mbCholSH cov') of (Just (covInv, (lndt,_)), Just covChol) -> go_rest (covInv, covChol) _ -> do io $ putStrLn "non-invertible covariance matrix" return [] -} runMalaRioSimple :: Covariance a => a -> (Vector Double -> (Double,Vector Double)) -> Int -> Double -> Int -> Vector Double -> RIO [Vector Double] runMalaRioSimple cov pdf samples maxGrad thinN xi = do let (p0,grad0) = pdf xi let sigma0 = 2.7e-4 --1.5 / (realToFrac $ dim xi) -- determined empirically let mp0 = MalaPar xi p0 (trunc maxGrad grad0) sigma0 0 0 False thinN maxGrad (mp2, xs2) <- runMalaMP cov pdf samples mp0 [] io $ putStrLn $ "All done" return $ map snd xs2 calcCovariance :: Vector Double -> Vector Double -> (Vector Double -> (Double,Vector Double)) -> (Vector Double -> Double) -> Either (Vector Double) (Matrix Double, Matrix Double, Matrix Double) calcCovariance vinit vnear postgrad posterior = finalcov where ndim = dim vinit finalcov | ndim > 0 -- > 20000 --FIXME = Left $ calcFDindepVars vinit vnear posterior --Left $ iCov vinit -- | otherwise = hessToCov (calcFDhess vinit vnear postgrad) Nothing iCov v = VS.replicate (VS.length v) 1 -- in (m,m,m) calcFDindepVars v v' post = trace ("FDVars = "++show (VS.take 10 vars)) $ vars where hv = mapVector (*1e-4) v --mapVector (max 1e-9 . abs) $ v - v' n = dim v postv = post v postPlus i = post $ v VS.// [(i,v @>i + hv @> i)] postMinus i = post $ v VS.// [(i,v @>i - hv@> i)] vars = buildVector n fvar fvar i = negate $ recip $ (postPlus i - 2*postv + postMinus i)/((hv @> i)*(hv @> i)) calcFDhess v v' postgrad = hess2 where grad = snd . postgrad gradi i = (@>i) . grad hv = mapVector (max 1e-9 . abs) $ v - v' n = dim v gradv = grad v grads = fromRows $ flip map [0..(n-1)] $ \i -> grad (v VS.// [(i,v @>i + hv @> i)]) fhess (i,j) | i<j = 0 | otherwise = (grads @@>(j,i) - (gradv @> i)) /(2*(hv @> j)) + (grads @@>(i,j)- (gradv @> j)) /(2*(hv @> i)) -- hess3 = scale (recip $ realToFrac n) $ sum $ map outerSelf $ grads hess1 = buildMatrix n n fhess hess2 = buildMatrix n n $ \(i,j) -> if i>=j then hess1 @@> (i,j) else hess1 @@> (j,i) outerSelf v= v `outer` v hessToCov hess mOriginal = let mTryPosdefify = case mOriginal of Nothing -> hessToCov (PDF.posdefify hess) (Just hess) Just horiginal -> let ds = mapVector (negate . recip) $ takeDiag horiginal in trace ("USING DIAGS"++show (VS.take 10 ds)) $ Left $ ds in case spoon $ inv $ negate $ hess of Just cov -> case mbCholSH cov of Just cholm -> trace ("invert success:"++show (VS.take 10 $ takeDiag cov) ++ "det="++show (det cov)) $ Right (cov, negate hess, cholm) Nothing -> trace ("chol fail") mTryPosdefify Nothing -> trace ("inv fail") mTryPosdefify {- Just cov -> case mbCholSH cov of Just cholm -> Right (cov, negate hessToCov,cholm) Nothing -> case mbCholSH $ PDF.posdefify cov of Just cholm -> Right (cov, negate hess,cholm) Nothing -> vars Nothing -> vars -} acceptSM ampar | mpCount ampar == 0 = "0/0" | otherwise = printf "%.3g" (rate::Double) ++ " ("++show yes++"/"++show total++")" where rate = realToFrac (yes) / realToFrac (total) yes = mpAccept ampar total = mpCount ampar
glutamate/probably
Math/Probably/MALA.hs
bsd-3-clause
17,132
0
23
5,861
5,064
2,559
2,505
298
5
module Compile.Types.Job where data Job = Job { jobOut :: FilePath , jobSource :: FilePath , jobOutFormat :: OF } data OF = C0 | Asm | Obj | ELF deriving Eq defaultJob :: Job defaultJob = Job {jobOut = "", jobSource = "", jobOutFormat = ELF}
maurer/15-411-Haskell-Base-Code
src/Compile/Types/Job.hs
bsd-3-clause
331
0
8
136
83
53
30
13
1
{-# LANGUAGE CPP #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE ScopedTypeVariables #-} module Properties.Stack where import Test.QuickCheck import Instances import XMonad.StackSet hiding (filter) import qualified XMonad.StackSet as S (filter) import Data.Maybe #ifdef VERSION_quickcheck_classes import Data.Proxy import Test.QuickCheck.Classes ( Laws (lawsTypeclass, lawsProperties), Proxy1 (Proxy1), foldableLaws, traversableLaws, ) #endif -- The list returned by index should be the same length as the actual -- windows kept in the zipper prop_index_length (x :: T) = case stack . workspace . current $ x of Nothing -> length (index x) == 0 Just it -> length (index x) == length (focus it : up it ++ down it) -- For all windows in the stackSet, findTag should identify the -- correct workspace prop_findIndex (x :: T) = and [ tag w == fromJust (findTag i x) | w <- workspace (current x) : map workspace (visible x) ++ hidden x , t <- maybeToList (stack w) , i <- focus t : up t ++ down t ] prop_allWindowsMember (NonEmptyWindowsStackSet x) = do -- Reimplementation of arbitraryWindow, but to make sure that -- implementation doesn't change in the future, and stop using allWindows, -- which is a key component in this test (together with member). let ws = allWindows x -- We know that there are at least 1 window in a NonEmptyWindowsStackSet. idx <- choose(0, (length ws) - 1) return $ member (ws!!idx) x -- preserve order prop_filter_order (x :: T) = case stack $ workspace $ current x of Nothing -> True Just s@(Stack i _ _) -> integrate' (S.filter (/= i) s) == filter (/= i) (integrate' (Just s)) -- differentiate should return Nothing if the list is empty or Just stack, with -- the first element of the list is current, and the rest of the list is down. prop_differentiate xs = if null xs then differentiate xs == Nothing else (differentiate xs) == Just (Stack (head xs) [] (tail xs)) where _ = xs :: [Int] #ifdef VERSION_quickcheck_classes -- Check type class laws of 'Data.Foldable.Foldable' and 'Data.Traversable.Traversable'. newtype TestStack a = TestStack (Stack a) deriving (Eq, Read, Show, Foldable, Functor) instance (Arbitrary a) => Arbitrary (TestStack a) where arbitrary = TestStack <$> (Stack <$> arbitrary <*> arbitrary <*> arbitrary) shrink = traverse shrink instance Traversable TestStack where traverse f (TestStack sx) = fmap TestStack (traverse f sx) prop_laws_Stack = format (foldableLaws p) <> format (traversableLaws p) where p = Proxy :: Proxy TestStack format laws = [ ("Stack: " <> lawsTypeclass laws <> ": " <> name, prop) | (name, prop) <- lawsProperties laws ] #else prop_laws_Stack = [] #endif
xmonad/xmonad
tests/Properties/Stack.hs
bsd-3-clause
2,851
0
13
637
781
412
369
31
2
module Mistral.CodeGen.ResolveTags where import Mistral.Driver import Mistral.ModuleSystem.Name ( mangleName ) import Mistral.TypeCheck.AST import Mistral.Utils.SCC ( Group ) import Mistral.Utils.PP import Control.Applicative ( (<$>), (<*>), pure ) import Data.Foldable ( foldMap, foldl' ) import qualified Data.Map as Map import Data.Monoid ( Monoid(..) ) import qualified Data.Set as Set import qualified Data.Traversable as T resolveTags :: Program -> Driver Program resolveTags prog = do let tags = progTagMap prog traceMsg (text "tag map:" $$ text (show tags)) nodes' <- mapM (resolveNamed resolveNode tags) (progNodes prog) binds' <- mapM (resolveGroup resolveDecl tags) (progBinds prog) return prog { progNodes = nodes' , progBinds = binds' } -- | Sets of tags, and the thing that they map to. data TagMap = TagMap { getTopoTagMap :: AtomMap , getTaskTagMap :: AtomMap } deriving (Show) type AtomMap = Map.Map Atom (Set.Set Name) topoTags, taskTags :: AtomMap -> TagMap topoTags tags = mempty { getTopoTagMap = tags } taskTags tags = mempty { getTaskTagMap = tags } hasTags :: Name -> Set.Set Atom -> AtomMap hasTags n tags = let s = Set.singleton n in foldl' (\m t -> Map.insert t s m) Map.empty tags instance Monoid TagMap where mempty = TagMap Map.empty Map.empty mappend (TagMap a b) (TagMap c d) = let su = Map.unionWith Set.union in TagMap (su a c) (su b d) mconcat ms = let su = Map.unionsWith Set.union in TagMap (su (map getTopoTagMap ms)) (su (map getTaskTagMap ms)) type TagSet = [(Name,Set.Set Atom)] resolveName :: Set.Set Atom -> AtomMap -> Maybe Name resolveName tags names = case validList of [x] -> Just x (_:_) -> Nothing -- error "Explicit fail on ambiguous tags pending further discussion" _ -> Nothing where validList = Set.toList validSet validSet = intersections (map lk (Set.toList tags)) intersections [] = mempty intersections (x:xs) = foldl' Set.intersection x xs lk t = maybe mempty id (Map.lookup t names) -- | Construct the static task-tag map for a program. progTagMap :: Program -> TagMap progTagMap prog = foldMap nodeTagMap (progNodes prog) nodeTagMap :: Named Node -> TagMap nodeTagMap (Named name node) = mconcat $ topoTags (name `hasTags` foldMap exprTags (nTags node)) : map taskTagMap (nTasks node) taskTagMap :: Named Task -> TagMap taskTagMap (Named name task) = taskTags (name `hasTags` foldMap exprTags (tTags task)) exprTags :: Expr -> Set.Set Atom exprTags e = case getTags e of Just tags -> tags Nothing -> mempty resolveTaskSet :: TagMap -> Tasks -> Driver Tasks resolveTaskSet tags tasks = do ts' <- mapM (resolveTask tags) (taskTasks tasks) return tasks { taskTasks = ts' } resolveTask :: TagMap -> Named Task -> Driver (Named Task) resolveTask tags o = do let task = nValue o cs' <- mapM (resolveTaskConstraint tags) (tConstraints task) return o { nValue = task { tConstraints = cs' } } resolveTaskConstraint :: TagMap -> TaskConstraint -> Driver TaskConstraint resolveTaskConstraint tags tc = case tc of TCOn ty e -> do n <- tagsToName (getTopoTagMap tags) e return (TCOn ty (EVar n)) resolveNamed :: (TagMap -> a -> Driver a) -> (TagMap -> Named a -> Driver (Named a)) resolveNamed resolve tags nm = T.traverse (resolve tags) nm resolveNode :: TagMap -> Node -> Driver Node resolveNode tags node = do tasks <- mapM (resolveTask tags) (nTasks node) return node { nTasks = tasks } -- NOTE: resolving tags for bindings won't change the structure of a recursive -- group, as tags aren't used to identify functions, beyond task declarations. resolveGroup :: (TagMap -> a -> Driver a) -> (TagMap -> Group a -> Driver (Group a)) resolveGroup resolve tags group = T.mapM (resolve tags) group resolveDecl :: TagMap -> Decl -> Driver Decl resolveDecl tags b = do e' <- resolveExpr tags (bBody b) return b { bBody = e' } resolveExpr :: TagMap -> Expr -> Driver Expr resolveExpr tags = go where go e = case elimEApp e of -- XXX we really need the evidence from the constraint solver at this point, -- but for now we just assume the send target is a tag expression defaulting -- back to what was on error. (send@(ETApp (EPrim PSend) _),[who,what]) -> do (_,_,mb) <- tryMessages (tagsToName (getTaskTagMap tags) who) case mb of Just who' -> return $ appE send [ ELit (LString (mangleName who')) , what] Nothing -> return e -- resolve node names in a task set (ETaskSet tasks,args) -> do tasks' <- resolveTaskSet tags tasks args' <- mapM go args return (appE (ETaskSet tasks') args') (f,xs) -- reached a single expression | null xs -> case f of ELet gs e' ty -> ELet <$> mapM (resolveGroup resolveDecl tags) gs <*> go e' <*> return ty ECase s m rty -> ECase s <$> match m <*> return rty EStmts ity ty as -> EStmts ity ty <$> mapM action as -- XXX there are likely important cases being skipped _ -> return e -- traverse the application | otherwise -> appE <$> go f <*> mapM go xs match :: Match pat -> Driver (Match pat) match m = case m of MCase s sty m' -> MCase <$> go s <*> pure sty <*> match m' MRename n e ty m' -> MRename n<$> go e <*> pure ty <*> match m' MPat pat m' -> MPat pat <$> match m' MSplit l r -> MSplit <$> match l <*> match r MFail -> return m MExpr e -> MExpr <$> go e MGuard e m' -> MGuard <$> go e <*> match m' action a = case a of ABind p m ty -> ABind p <$> go m <*> pure ty AReceive r fs to wild -> AReceive r <$> T.traverse from fs <*> T.traverse timeout to <*> T.traverse go wild from (From src msg msgTy body) = From src msg msgTy <$> match body timeout (Timeout lit body) = Timeout lit <$> go body -- | Resolve a set of tags to a task identifier. Fail when one isn't uniquely -- identified. tagsToName :: AtomMap -> Expr -> Driver Name tagsToName tags e = do spec <- case getTags e of Just spec -> return spec Nothing -> fail "Invalid tag expression" case resolveName spec tags of Just n -> return n _ -> fail $ "Unable to resolve tags: " ++ show (spec,tags) getTags :: Expr -> Maybe (Set.Set Atom) getTags e = case e of EMkTuple elems | (tys,es) <- unzip elems, all (== atomCon) tys -> mconcat `fmap` mapM getTags es ELit (LAtom a) -> Just (Set.singleton a) _ -> Nothing
GaloisInc/mistral
src/Mistral/CodeGen/ResolveTags.hs
bsd-3-clause
6,936
0
22
1,972
2,406
1,191
1,215
144
14
module T414 where import Data.Kind import Data.Singletons.TH $(singletons [d| class C1 (a :: Bool) where type T1 a b class C2 a where type T2 a b type C3 :: Bool -> Constraint class C3 a where type T3 a b |])
goldfirere/singletons
singletons-base/tests/compile-and-dump/Singletons/T414.hs
bsd-3-clause
235
0
7
68
29
18
11
-1
-1
module Print1 where main::IO() main = putStrLn "Jai Bhairavi"
dhaneshkk/haskell-programming
print1.hs
bsd-3-clause
73
0
6
20
22
12
10
4
1
-- | This module exports State related modules. module Jat.PState (module M) where import Jat.PState.Data as M import Jat.PState.Fun as M import Jat.PState.Step as M import Jat.PState.Semantics as M import Jat.PState.BoolDomain as M import Jat.PState.IntDomain as M import Jat.PState.MemoryModel as M
ComputationWithBoundedResources/jat
src/Jat/PState.hs
bsd-3-clause
304
0
4
44
69
51
18
8
0
{-# LANGUAGE BangPatterns #-} module Main where import Control.Concurrent.STM import Gauge.Main import Data.List (foldl') import System.Random.MWC import qualified RingOfQueuesSTM as A import qualified RingOfQueues as AIO import qualified BinaryHeapSTM as B import qualified BinaryHeap as BIO import qualified Heap as O import qualified Network.HTTP2.Priority.PSQ as P import qualified RandomSkewHeap as R type Key = Int type Weight = Int numOfStreams :: Int numOfStreams = 100 numOfTrials :: Int numOfTrials = 10000 main :: IO () main = do gen <- create ws <- uniformRs (1,256) gen numOfStreams let ks = [1,3..] xs = zip ks ws defaultMain [ bgroup "enqueue & dequeue" [ bench "Random Skew Heap" $ whnf enqdeqR xs , bench "Skew Binomial Heap" $ whnf enqdeqO xs , bench "Priority Search Queue" $ whnf enqdeqP xs , bench "Binary Heap" $ nfIO (enqdeqBIO xs) , bench "Binary Heap STM" $ nfIO (enqdeqB xs) , bench "Ring of Queues" $ nfIO (enqdeqAIO xs) , bench "Ring of Queues STM" $ nfIO (enqdeqA xs) ] , bgroup "delete" [ bench "Random Skew Heap" $ whnf deleteR xs , bench "Skew Binomial Heap" $ whnf deleteO xs , bench "Priority Search Queue" $ whnf deleteP xs , bench "Binary Heap" $ nfIO (deleteBIO xs) , bench "Binary Heap STM" $ nfIO (deleteB xs) , bench "Ring of Queues IO" $ nfIO (deleteAIO xs) ] ] where uniformRs range gen n = loop n [] where loop 0 rs = return rs loop i rs = do r <- uniformR range gen loop (i-1) (r:rs) ---------------------------------------------------------------- enqdeqR :: [(Key,Weight)] -> () enqdeqR xs = loop pq numOfTrials where !pq = createR xs R.empty loop _ 0 = () loop q !n = case R.dequeue q of Nothing -> error "enqdeqR" Just (k,w,v,q') -> let !q'' = R.enqueue k w v q' in loop q'' (n - 1) deleteR :: [(Key,Weight)] -> R.PriorityQueue Int deleteR xs = foldl' (\q k -> let (_,!q') = R.delete k q in q') pq ks where !pq = createR xs R.empty (ks,_) = unzip xs createR :: [(Key,Weight)] -> R.PriorityQueue Int -> R.PriorityQueue Int createR [] !q = q createR ((k,w):xs) !q = createR xs q' where !v = k !q' = R.enqueue k w v q ---------------------------------------------------------------- enqdeqO :: [(Key,Weight)] -> O.PriorityQueue Int enqdeqO xs = loop pq numOfTrials where !pq = createO xs O.empty loop !q 0 = q loop !q !n = case O.dequeue q of Nothing -> error "enqdeqO" Just (k,p,v,q') -> loop (O.enqueue k p v q') (n - 1) deleteO :: [(Key,Weight)] -> O.PriorityQueue Int deleteO xs = foldl' (\q k -> let (_,!q') = O.delete k q in q') pq ks where !pq = createO xs O.empty (ks,_) = unzip xs createO :: [(Key,Weight)] -> O.PriorityQueue Int -> O.PriorityQueue Int createO [] !q = q createO ((k,w):xs) !q = createO xs q' where !pre = O.newPrecedence w !v = k !q' = O.enqueue k pre v q ---------------------------------------------------------------- enqdeqP :: [(Key,Weight)] -> P.PriorityQueue Int enqdeqP xs = loop pq numOfTrials where !pq = createP xs P.empty loop !q 0 = q loop !q !n = case P.dequeue q of Nothing -> error "enqdeqP" Just (k,pre,x,q') -> loop (P.enqueue k pre x q') (n - 1) deleteP :: [(Key,Weight)] -> P.PriorityQueue Int deleteP xs = foldl' (\q k -> let (_,!q') = P.delete k q in q') pq ks where !pq = createP xs P.empty (ks,_) = unzip xs createP :: [(Key,Weight)] -> P.PriorityQueue Int -> P.PriorityQueue Int createP [] !q = q createP ((k,w):xs) !q = createP xs q' where !pre = P.newPrecedence w !v = k !q' = P.enqueue k pre v q ---------------------------------------------------------------- enqdeqB :: [(Key,Weight)] -> IO () enqdeqB xs = do q <- atomically (B.new numOfStreams) _ <- createB xs q loop q numOfTrials where loop _ 0 = return () loop q !n = do ent <- atomically $ B.dequeue q atomically $ B.enqueue ent q loop q (n - 1) deleteB :: [(Key,Weight)] -> IO () deleteB xs = do q <- atomically $ B.new numOfStreams ents <- createB xs q mapM_ (\ent -> atomically $ B.delete ent q) ents createB :: [(Key,Weight)] -> B.PriorityQueue Int -> IO [B.Entry Key] createB [] _ = return [] createB ((k,w):xs) !q = do ent <- atomically $ B.newEntry k w atomically $ B.enqueue ent q ents <- createB xs q return $ ent:ents ---------------------------------------------------------------- enqdeqBIO :: [(Key,Weight)] -> IO () enqdeqBIO xs = do q <- BIO.new numOfStreams _ <- createBIO xs q loop q numOfTrials where loop _ 0 = return () loop q !n = do ent <- BIO.dequeue q BIO.enqueue ent q loop q (n - 1) deleteBIO :: [(Key,Weight)] -> IO () deleteBIO xs = do q <- BIO.new numOfStreams ents <- createBIO xs q mapM_ (\ent -> BIO.delete ent q) ents createBIO :: [(Key,Weight)] -> BIO.PriorityQueue Int -> IO [BIO.Entry Key] createBIO [] _ = return [] createBIO ((k,w):xs) !q = do ent <- BIO.newEntry k w BIO.enqueue ent q ents <- createBIO xs q return $ ent:ents ---------------------------------------------------------------- enqdeqA :: [(Key,Weight)] -> IO () enqdeqA ws = do q <- atomically A.new createA ws q loop q numOfTrials where loop _ 0 = return () loop q !n = do ent <- atomically $ A.dequeue q atomically $ A.enqueue ent q loop q (n - 1) createA :: [(Key,Weight)] -> A.PriorityQueue Int -> IO () createA [] _ = return () createA ((k,w):xs) !q = do let !ent = A.newEntry k w atomically $ A.enqueue ent q createA xs q ---------------------------------------------------------------- enqdeqAIO :: [(Key,Weight)] -> IO () enqdeqAIO xs = do q <- AIO.new _ <- createAIO xs q loop q numOfTrials where loop _ 0 = return () loop q !n = do Just ent <- AIO.dequeue q _ <- AIO.enqueue ent q loop q (n - 1) deleteAIO :: [(Key,Weight)] -> IO () deleteAIO xs = do q <- AIO.new ns <- createAIO xs q mapM_ AIO.delete ns createAIO :: [(Key,Weight)] -> AIO.PriorityQueue Int -> IO [AIO.Node (AIO.Entry Weight)] createAIO [] _ = return [] createAIO ((k,w):xs) !q = do let !ent = AIO.newEntry k w n <- AIO.enqueue ent q ns <- createAIO xs q return $ n : ns ----------------------------------------------------------------
kazu-yamamoto/http2
bench-priority/Main.hs
bsd-3-clause
6,758
0
15
1,920
2,854
1,408
1,446
179
3
{-# LANGUAGE CPP #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} #if __GLASGOW_HASKELL__ >= 707 {-# LANGUAGE DeriveDataTypeable #-} #endif ----------------------------------------------------------------------------- -- | -- Module : Control.Comonad.Cofree -- Copyright : (C) 2008-2013 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <[email protected]> -- Stability : provisional -- Portability : MPTCs, fundeps -- -- Cofree comonads -- ---------------------------------------------------------------------------- module Control.Comonad.Cofree ( Cofree(..) , ComonadCofree(..) , section , coiter , coiterW , unfold , unfoldM , hoistCofree -- * Lenses into cofree comonads , _extract , _unwrap , telescoped ) where import Control.Applicative import Control.Comonad import Control.Comonad.Trans.Class import Control.Comonad.Cofree.Class import Control.Comonad.Env.Class import Control.Comonad.Store.Class as Class import Control.Comonad.Traced.Class import Control.Comonad.Hoist.Class import Control.Category import Control.Monad(ap, (>=>), liftM) import Control.Monad.Zip import Data.Functor.Bind import Data.Functor.Extend import Data.Data import Data.Distributive import Data.Foldable import Data.Semigroup import Data.Traversable import Data.Semigroup.Foldable import Data.Semigroup.Traversable import Prelude hiding (id,(.)) import Prelude.Extras infixr 5 :< -- | The 'Cofree' 'Comonad' of a functor @f@. -- -- /Formally/ -- -- A 'Comonad' @v@ is a cofree 'Comonad' for @f@ if every comonad homomorphism -- another comonad @w@ to @v@ is equivalent to a natural transformation -- from @w@ to @f@. -- -- A 'cofree' functor is right adjoint to a forgetful functor. -- -- Cofree is a functor from the category of functors to the category of comonads -- that is right adjoint to the forgetful functor from the category of comonads -- to the category of functors that forgets how to 'extract' and -- 'duplicate', leaving you with only a 'Functor'. -- -- In practice, cofree comonads are quite useful for annotating syntax trees, -- or talking about streams. -- -- A number of common comonads arise directly as cofree comonads. -- -- For instance, -- -- * @'Cofree' 'Maybe'@ forms the a comonad for a non-empty list. -- -- * @'Cofree' ('Const' b)@ is a product. -- -- * @'Cofree' 'Identity'@ forms an infinite stream. -- -- * @'Cofree' ((->) b)'@ describes a Moore machine with states labeled with values of type a, and transitions on edges of type b. -- -- Furthermore, if the functor @f@ forms a monoid (for example, by -- being an instance of 'Alternative'), the resulting 'Comonad' is -- also a 'Monad'. See -- <http://www.cs.appstate.edu/~johannp/jfp06-revised.pdf Monadic Augment and Generalised Shortcut Fusion> by Neil Ghani et al., Section 4.3 -- for more details. -- -- In particular, if @f a ≡ [a]@, the -- resulting data structure is a <https://en.wikipedia.org/wiki/Rose_tree Rose tree>. -- For a practical application, check -- <https://personal.cis.strath.ac.uk/neil.ghani/papers/ghani-calco07 Higher Dimensional Trees, Algebraically> by Neil Ghani et al. data Cofree f a = a :< f (Cofree f a) #if __GLASGOW_HASKELL__ >= 707 deriving (Typeable) #endif -- | Use coiteration to generate a cofree comonad from a seed. -- -- @'coiter' f = 'unfold' ('id' 'Control.Arrow.&&&' f)@ coiter :: Functor f => (a -> f a) -> a -> Cofree f a coiter psi a = a :< (coiter psi <$> psi a) -- | Like coiter for comonadic values. coiterW :: (Comonad w, Functor f) => (w a -> f (w a)) -> w a -> Cofree f a coiterW psi a = extract a :< (coiterW psi <$> psi a) -- | Unfold a cofree comonad from a seed. unfold :: Functor f => (b -> (a, f b)) -> b -> Cofree f a unfold f c = case f c of (x, d) -> x :< fmap (unfold f) d -- | Unfold a cofree comonad from a seed, monadically. unfoldM :: (Traversable f, Monad m) => (b -> m (a, f b)) -> b -> m (Cofree f a) unfoldM f = f >=> \ (x, t) -> (x :<) `liftM` Data.Traversable.mapM (unfoldM f) t hoistCofree :: Functor f => (forall x . f x -> g x) -> Cofree f a -> Cofree g a hoistCofree f (x :< y) = x :< f (hoistCofree f <$> y) instance Functor f => ComonadCofree f (Cofree f) where unwrap (_ :< as) = as {-# INLINE unwrap #-} instance Distributive f => Distributive (Cofree f) where distribute w = fmap extract w :< fmap distribute (collect unwrap w) instance Functor f => Functor (Cofree f) where fmap f (a :< as) = f a :< fmap (fmap f) as b <$ (_ :< as) = b :< fmap (b <$) as instance Functor f => Extend (Cofree f) where extended = extend {-# INLINE extended #-} duplicated = duplicate {-# INLINE duplicated #-} instance Functor f => Comonad (Cofree f) where extend f w = f w :< fmap (extend f) (unwrap w) duplicate w = w :< fmap duplicate (unwrap w) extract (a :< _) = a {-# INLINE extract #-} -- | This is not a true 'Comonad' transformer, but this instance is convenient. instance ComonadTrans Cofree where lower (_ :< as) = fmap extract as {-# INLINE lower #-} instance Alternative f => Monad (Cofree f) where return x = x :< empty {-# INLINE return #-} (a :< m) >>= k = case k a of b :< n -> b :< (n <|> fmap (>>= k) m) instance (Alternative f, MonadZip f) => MonadZip (Cofree f) where mzip (a :< as) (b :< bs) = (a, b) :< fmap (uncurry mzip) (mzip as bs) -- | -- -- @'lower' . 'section' = 'id'@ section :: Comonad f => f a -> Cofree f a section as = extract as :< extend section as instance Apply f => Apply (Cofree f) where (f :< fs) <.> (a :< as) = f a :< ((<.>) <$> fs <.> as) {-# INLINE (<.>) #-} (f :< fs) <. (_ :< as) = f :< ((<. ) <$> fs <.> as) {-# INLINE (<.) #-} (_ :< fs) .> (a :< as) = a :< (( .>) <$> fs <.> as) {-# INLINE (.>) #-} instance ComonadApply f => ComonadApply (Cofree f) where (f :< fs) <@> (a :< as) = f a :< ((<@>) <$> fs <@> as) {-# INLINE (<@>) #-} (f :< fs) <@ (_ :< as) = f :< ((<@ ) <$> fs <@> as) {-# INLINE (<@) #-} (_ :< fs) @> (a :< as) = a :< (( @>) <$> fs <@> as) {-# INLINE (@>) #-} instance Alternative f => Applicative (Cofree f) where pure = return {-# INLINE pure #-} (<*>) = ap {-# INLINE (<*>) #-} instance (Functor f, Show1 f) => Show1 (Cofree f) where showsPrec1 d (a :< as) = showParen (d > 5) $ showsPrec 6 a . showString " :< " . showsPrec1 5 (fmap Lift1 as) instance (Show (f (Cofree f a)), Show a) => Show (Cofree f a) where showsPrec d (a :< as) = showParen (d > 5) $ showsPrec 6 a . showString " :< " . showsPrec 5 as instance (Functor f, Read1 f) => Read1 (Cofree f) where readsPrec1 d r = readParen (d > 5) (\r' -> [(u :< fmap lower1 v,w) | (u, s) <- readsPrec 6 r', (":<", t) <- lex s, (v, w) <- readsPrec1 5 t]) r instance (Read (f (Cofree f a)), Read a) => Read (Cofree f a) where readsPrec d r = readParen (d > 5) (\r' -> [(u :< v,w) | (u, s) <- readsPrec 6 r', (":<", t) <- lex s, (v, w) <- readsPrec 5 t]) r instance (Eq (f (Cofree f a)), Eq a) => Eq (Cofree f a) where #ifndef HLINT a :< as == b :< bs = a == b && as == bs #endif instance (Functor f, Eq1 f) => Eq1 (Cofree f) where #ifndef HLINT a :< as ==# b :< bs = a == b && fmap Lift1 as ==# fmap Lift1 bs #endif instance (Ord (f (Cofree f a)), Ord a) => Ord (Cofree f a) where compare (a :< as) (b :< bs) = case compare a b of LT -> LT EQ -> compare as bs GT -> GT instance (Functor f, Ord1 f) => Ord1 (Cofree f) where compare1 (a :< as) (b :< bs) = case compare a b of LT -> LT EQ -> compare1 (fmap Lift1 as) (fmap Lift1 bs) GT -> GT instance Foldable f => Foldable (Cofree f) where foldMap f = go where go (a :< as) = f a `mappend` foldMap go as {-# INLINE foldMap #-} instance Foldable1 f => Foldable1 (Cofree f) where foldMap1 f = go where go (a :< as) = f a <> foldMap1 go as {-# INLINE foldMap1 #-} instance Traversable f => Traversable (Cofree f) where traverse f = go where go (a :< as) = (:<) <$> f a <*> traverse go as {-# INLINE traverse #-} instance Traversable1 f => Traversable1 (Cofree f) where traverse1 f = go where go (a :< as) = (:<) <$> f a <.> traverse1 go as {-# INLINE traverse1 #-} #if __GLASGOW_HASKELL__ < 707 instance (Typeable1 f) => Typeable1 (Cofree f) where typeOf1 dfa = mkTyConApp cofreeTyCon [typeOf1 (f dfa)] where f :: Cofree f a -> f a f = undefined instance (Typeable1 f, Typeable a) => Typeable (Cofree f a) where typeOf = typeOfDefault cofreeTyCon :: TyCon #if __GLASGOW_HASKELL__ < 704 cofreeTyCon = mkTyCon "Control.Comonad.Cofree.Cofree" #else cofreeTyCon = mkTyCon3 "free" "Control.Comonad.Cofree" "Cofree" #endif {-# NOINLINE cofreeTyCon #-} instance ( Typeable1 f , Data (f (Cofree f a)) , Data a ) => Data (Cofree f a) where gfoldl f z (a :< as) = z (:<) `f` a `f` as toConstr _ = cofreeConstr gunfold k z c = case constrIndex c of 1 -> k (k (z (:<))) _ -> error "gunfold" dataTypeOf _ = cofreeDataType dataCast1 f = gcast1 f cofreeConstr :: Constr cofreeConstr = mkConstr cofreeDataType ":<" [] Infix {-# NOINLINE cofreeConstr #-} cofreeDataType :: DataType cofreeDataType = mkDataType "Control.Comonad.Cofree.Cofree" [cofreeConstr] {-# NOINLINE cofreeDataType #-} #endif instance ComonadHoist Cofree where cohoist = hoistCofree instance ComonadEnv e w => ComonadEnv e (Cofree w) where ask = ask . lower {-# INLINE ask #-} instance ComonadStore s w => ComonadStore s (Cofree w) where pos (_ :< as) = Class.pos as {-# INLINE pos #-} peek s (_ :< as) = extract (Class.peek s as) {-# INLINE peek #-} instance ComonadTraced m w => ComonadTraced m (Cofree w) where trace m = trace m . lower {-# INLINE trace #-} -- | This is a lens that can be used to read or write from the target of 'extract'. -- -- Using (^.) from the @lens@ package: -- -- @foo ^. '_extract' == 'extract' foo@ -- -- For more on lenses see the @lens@ package on hackage -- -- @'_extract' :: Lens' ('Cofree' g a) a@ _extract :: Functor f => (a -> f a) -> Cofree g a -> f (Cofree g a) _extract f (a :< as) = (:< as) <$> f a {-# INLINE _extract #-} -- | This is a lens that can be used to read or write to the tails of a 'Cofree' 'Comonad'. -- -- Using (^.) from the @lens@ package: -- -- @foo ^. '_unwrap' == 'unwrap' foo@ -- -- For more on lenses see the @lens@ package on hackage -- -- @'_unwrap' :: Lens' ('Cofree' g a) (g ('Cofree' g a))@ _unwrap :: Functor f => (g (Cofree g a) -> f (g (Cofree g a))) -> Cofree g a -> f (Cofree g a) _unwrap f (a :< as) = (a :<) <$> f as {-# INLINE _unwrap #-} -- | Construct a @Lens@ into a @'Cofree' f@ given a list of lenses into the base functor. -- -- For more on lenses see the 'lens' package on hackage. -- -- @telescoped :: 'Functor' g => [Lens' ('Cofree' g a) (g ('Cofree' g a))] -> Lens' ('Cofree' g a) a@ telescoped :: (Functor f, Functor g) => [(Cofree g a -> f (Cofree g a)) -> g (Cofree g a) -> f (g (Cofree g a))] -> (a -> f a) -> Cofree g a -> f (Cofree g a) telescoped = Prelude.foldr (\l r -> _unwrap . l . r) _extract {-# INLINE telescoped #-}
dalaing/free
src/Control/Comonad/Cofree.hs
bsd-3-clause
11,481
0
14
2,679
3,534
1,892
1,642
-1
-1
{-# LANGUAGE ScopedTypeVariables, ScopedTypeVariables, TupleSections #-} module Happstack.Server.Internal.Handler ( request , parseResponse , putRequest ) where import qualified Paths_happstack_server as Paths import qualified Data.Version as DV import Control.Applicative (pure) import Control.Concurrent (newMVar, newEmptyMVar, tryTakeMVar) import Control.Exception.Extensible as E import Control.Monad import Data.List(elemIndex) import Data.Char(toLower) import Data.Maybe ( fromMaybe, fromJust, isJust, isNothing ) import Data.Time (UTCTime) import Prelude hiding (last) import qualified Data.ByteString.Char8 as P import qualified Data.ByteString.Char8 as B import qualified Data.ByteString.Lazy.Char8 as L import Data.ByteString.Lazy.Internal (ByteString(Chunk, Empty)) import qualified Data.ByteString.Lazy.Char8 as LC import qualified Data.Map as M import Data.Int (Int64) import Happstack.Server.Internal.Cookie import Happstack.Server.Internal.Clock import Happstack.Server.Internal.Types import Happstack.Server.Internal.Multipart import Happstack.Server.Internal.RFC822Headers import Happstack.Server.Internal.MessageWrap import Happstack.Server.SURI(SURI(..),path,query) import Happstack.Server.SURI.ParseURI import Happstack.Server.Internal.TimeoutIO (TimeoutIO(..)) import Happstack.Server.Internal.Monads (failResponse) import qualified Happstack.Server.Internal.TimeoutManager as TM import Numeric import System.Directory (removeFile) import System.IO import System.IO.Error (isDoesNotExistError) request :: TimeoutIO -> Maybe (LogAccess UTCTime) -> Host -> (Request -> IO Response) -> IO () request timeoutIO mlog host handler = rloop timeoutIO mlog host handler =<< toGetContents timeoutIO required :: String -> Maybe a -> Either String a required err Nothing = Left err required _ (Just a) = Right a rloop :: TimeoutIO -> Maybe (LogAccess UTCTime) -> Host -> (Request -> IO Response) -> L.ByteString -> IO () rloop timeoutIO mlog host handler inputStr | L.null inputStr = return () | otherwise = (join $ do let parseRequest = do (topStr, restStr) <- required "failed to separate request" $ splitAtEmptyLine inputStr (rql, headerStr) <- required "failed to separate headers/body" $ splitAtCRLF topStr let (m,u,v) = requestLine rql headers' <- case parseHeaders "host" (L.unpack headerStr) of Nothing -> Left "failed to parse host header" Just x -> Right x let headers = mkHeaders headers' let contentLen = fromMaybe 0 $ fmap fst (P.readInt =<< getHeaderUnsafe contentlengthC headers) (body, nextRequest) <- case () of () | contentLen < 0 -> Left "negative content-length" | isJust $ getHeaderBS transferEncodingC headers -> return $ consumeChunks restStr | otherwise -> return (L.splitAt (fromIntegral contentLen) restStr) let cookies = [ (cookieName c, c) | cl <- fromMaybe [] (fmap getCookies (getHeader "Cookie" headers)), c <- cl ] -- Ugle return (m, u, cookies, v, headers, body, nextRequest) case parseRequest of Left err -> error $ "failed to parse HTTP request: " ++ err Right (m, u, cookies, v, headers, body, nextRequest) -> pure $ do bodyRef <- newMVar (Body body) bodyInputRef <- newEmptyMVar let req = Request (toSecure timeoutIO) m (pathEls (path u)) (path u) (query u) (queryInput u) bodyInputRef cookies v headers bodyRef host let ioseq act = act >>= \x -> x `seq` return x (res, handlerKilled) <- ((, False) `liftM` ioseq (handler req)) `E.catches` [ Handler $ \(e::EscapeHTTP) -> throwIO e -- need to handle this higher up , Handler $ \(e::E.SomeException) -> pure (failResponse (show e), fromException e == Just ThreadKilled) ] case mlog of Nothing -> return () (Just logger) -> do time <- getApproximateUTCTime let host' = fst host user = "-" requestLn = unwords [show $ rqMethod req, rqUri req, show $ rqVersion req] responseCode = rsCode res size = maybe (-1) (readDec' . B.unpack) (getHeader "Content-Length" res) -- -1 indicates unknown size referer = B.unpack $ fromMaybe (B.pack "") $ getHeader "Referer" req userAgent = B.unpack $ fromMaybe (B.pack "") $ getHeader "User-Agent" req logger host' user time requestLn responseCode size referer userAgent -- withNoPush sock $ putAugmentedResult thandle sock req res putAugmentedResult timeoutIO req res -- clean up tmp files cleanupTempFiles req -- do not continue if handler was killed when (not handlerKilled && continueHTTP req res) $ rloop timeoutIO mlog host handler nextRequest) `E.catch` (escapeHttpHandler timeoutIO) escapeHttpHandler :: TimeoutIO -> EscapeHTTP -> IO () escapeHttpHandler tio (EscapeHTTP f) = f tio -- NOTE: if someone took the inputs and never put them back, then they are responsible for the cleanup cleanupTempFiles :: Request -> IO () cleanupTempFiles req = do mInputs <- tryTakeMVar (rqInputsBody req) case mInputs of Nothing -> return () (Just inputs) -> mapM_ deleteTmpFile inputs where deleteTmpFile :: (String, Input) -> IO () deleteTmpFile (_, input) = case inputValue input of (Left fp) -> E.catchJust (guard . isDoesNotExistError) (removeFile fp) (const $ return ()) _ -> return () -- | Unserializes the bytestring into a response. If there is an -- error it will return @Left msg@. parseResponse :: L.ByteString -> Either String Response parseResponse inputStr = do (topStr,restStr) <- required "failed to separate response" $ splitAtEmptyLine inputStr (rsl,headerStr) <- required "failed to separate headers/body" $ splitAtCRLF topStr let (_,code) = responseLine rsl headers' <- case parseHeaders "host" (L.unpack headerStr) of Nothing -> Left "failed to parse host header" Just x -> Right x let headers = mkHeaders headers' let mbCL = fmap fst (B.readInt =<< getHeader "content-length" headers) (body,_) <- maybe (if (isNothing $ getHeader "transfer-encoding" headers) then return (restStr,L.pack "") else return $ consumeChunks restStr) (\cl->return (L.splitAt (fromIntegral cl) restStr)) mbCL return $ Response {rsCode=code,rsHeaders=headers,rsBody=body,rsFlags=RsFlags ContentLength,rsValidator=Nothing} -- http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html -- note this does NOT handle extenions consumeChunks::L.ByteString->(L.ByteString,L.ByteString) consumeChunks str = let (parts,tr,rest) = consumeChunksImpl str in (L.concat . (++ [tr]) .map snd $ parts,rest) consumeChunksImpl :: L.ByteString -> ([(Int64, L.ByteString)], L.ByteString, L.ByteString) consumeChunksImpl str | L.null str = ([],L.empty,str) | chunkLen == 0 = let (last,rest') = L.splitAt lenLine1 str (tr',rest'') = getTrailer rest' in ([(0,last)],tr',rest'') | otherwise = ((chunkLen,part):crest,tr,rest2) where line1 = head $ lazylines str lenLine1 = (L.length line1) + 1 -- endchar chunkLen = (fst $ head $ readHex $ L.unpack line1) len = chunkLen + lenLine1 + 2 (part,rest) = L.splitAt len str (crest,tr,rest2) = consumeChunksImpl rest getTrailer s = L.splitAt index s where index | crlfLC `L.isPrefixOf` s = 2 | otherwise = let iscrlf = L.zipWith (\a b -> a == '\r' && b == '\n') s . L.tail $ s Just i = elemIndex True $ zipWith (&&) iscrlf (tail (tail iscrlf)) in fromIntegral $ i+4 crlfLC :: L.ByteString crlfLC = L.pack "\r\n" -- Properly lazy version of 'lines' for lazy bytestrings lazylines :: L.ByteString -> [L.ByteString] lazylines s | L.null s = [] | otherwise = let (l,s') = L.break ((==) '\n') s in l : if L.null s' then [] else lazylines (L.tail s') requestLine :: L.ByteString -> (Method, SURI, HttpVersion) requestLine l = case P.words ((P.concat . L.toChunks) l) of [rq,uri,ver] -> (method rq, SURI $ parseURIRef uri, version ver) [rq,uri] -> (method rq, SURI $ parseURIRef uri,HttpVersion 0 9) x -> error $ "requestLine cannot handle input: " ++ (show x) responseLine :: L.ByteString -> (B.ByteString, Int) responseLine l = case B.words ((B.concat . L.toChunks) l) of (v:c:_) -> version v `seq` (v,fst (fromJust (B.readInt c))) x -> error $ "responseLine cannot handle input: " ++ (show x) method :: B.ByteString -> Method method r = fj $ lookup r mtable where fj (Just x) = x fj Nothing = EXTENSION r mtable = [ (P.pack "GET", GET) , (P.pack "HEAD", HEAD) , (P.pack "POST", POST) , (P.pack "PUT", PUT) , (P.pack "DELETE", DELETE) , (P.pack "TRACE", TRACE) , (P.pack "OPTIONS", OPTIONS) , (P.pack "CONNECT", CONNECT) , (P.pack "PATCH", PATCH) ] -- Result side staticHeaders :: Headers staticHeaders = foldr (uncurry setHeaderBS) (mkHeaders []) [ (serverC, happstackC) ] -- FIXME: we should not be controlling the response headers in mysterious ways in this low level code -- headers should be set by application code and the core http engine should be very lean. putAugmentedResult :: TimeoutIO -> Request -> Response -> IO () putAugmentedResult timeoutIO req res = do case res of -- standard bytestring response Response {} -> do let isChunked = rsfLength (rsFlags res) == TransferEncodingChunked && isHTTP1_1 req sendTop (if isChunked then Nothing else (Just (fromIntegral (L.length (rsBody res))))) isChunked when (rqMethod req /= HEAD) (let body = if isChunked then chunk (rsBody res) else rsBody res in toPutLazy timeoutIO body) -- zero-copy sendfile response -- the handle *should* be closed by the garbage collector SendFile {} -> do let infp = sfFilePath res off = sfOffset res count = sfCount res sendTop (Just count) False TM.tickle (toHandle timeoutIO) toSendFile timeoutIO infp off count where ph (HeaderPair k vs) = map (\v -> P.concat [k, fsepC, v, crlfC]) vs sendTop cl isChunked = do allHeaders <- augmentHeaders req res cl isChunked toPut timeoutIO $ B.concat $ concat [ (pversion $ rqVersion req) -- Print HTTP version , [responseMessage $ rsCode res] -- Print responseCode , concatMap ph (M.elems allHeaders) -- Print all headers , [crlfC] ] TM.tickle (toHandle timeoutIO) chunk :: L.ByteString -> L.ByteString chunk Empty = LC.pack "0\r\n\r\n" chunk (Chunk c cs) = Chunk (B.pack $ showHex (B.length c) "\r\n") (Chunk c (Chunk (B.pack "\r\n") (chunk cs))) augmentHeaders :: Request -> Response -> Maybe Integer -> Bool -> IO Headers augmentHeaders req res mcl isChunked = do -- TODO: Hoist static headers to the toplevel. raw <- getApproximateTime let stdHeaders = staticHeaders `M.union` M.fromList ( [ (dateCLower, HeaderPair dateC [raw]) , (connectionCLower, HeaderPair connectionC [if continueHTTP req res then keepAliveC else closeC]) ] ++ case rsfLength (rsFlags res) of NoContentLength -> [] ContentLength | not (hasHeader "Content-Length" res) -> case mcl of (Just cl) -> [(contentlengthC, HeaderPair contentLengthC [P.pack (show cl)])] _ -> [] | otherwise -> [] TransferEncodingChunked -- we check 'chunked' because we might not use this mode if the client is http 1.0 | isChunked -> [(transferEncodingC, HeaderPair transferEncodingC [chunkedC])] | otherwise -> [] ) return (rsHeaders res `M.union` stdHeaders) -- 'union' prefers 'headers res' when duplicate keys are encountered. -- | Serializes the request to the given handle putRequest :: Handle -> Request -> IO () putRequest h rq = do let put = B.hPut h ph (HeaderPair k vs) = map (\v -> B.concat [k, fsepC, v, crlfC]) vs sp = [B.pack " "] mapM_ put $ concat [[B.pack $ show $ rqMethod rq],sp ,[B.pack $ rqURL rq],sp ,(pversion $ rqVersion rq), [crlfC] ,concatMap ph (M.elems $ rqHeaders rq) ,[crlfC] ] mBody <- takeRequestBody rq -- tryTakeMVar (rqBody rq) L.hPut h (maybe L.empty unBody mBody) -- FIXME: should this actually be an error if the body is null? hFlush h -- HttpVersion pversion :: HttpVersion -> [B.ByteString] pversion (HttpVersion 1 1) = [http11] pversion (HttpVersion 1 0) = [http10] pversion (HttpVersion x y) = [P.pack "HTTP/", P.pack (show x), P.pack ".", P.pack (show y)] version :: B.ByteString -> HttpVersion version x | x == http09 = HttpVersion 0 9 | x == http10 = HttpVersion 1 0 | x == http11 = HttpVersion 1 1 | otherwise = error "Invalid HTTP version" http09 :: B.ByteString http09 = P.pack "HTTP/0.9" http10 :: B.ByteString http10 = P.pack "HTTP/1.0" http11 :: B.ByteString http11 = P.pack "HTTP/1.1" -- * ByteString Constants connectionC :: B.ByteString connectionC = P.pack "Connection" connectionCLower :: B.ByteString connectionCLower = P.map toLower connectionC closeC :: B.ByteString closeC = P.pack "close" keepAliveC :: B.ByteString keepAliveC = P.pack "Keep-Alive" crlfC :: B.ByteString crlfC = P.pack "\r\n" fsepC :: B.ByteString fsepC = P.pack ": " -- contentTypeC :: B.ByteString -- contentTypeC = P.pack "Content-Type" contentLengthC :: B.ByteString contentLengthC = P.pack "Content-Length" contentlengthC :: B.ByteString contentlengthC = P.pack "content-length" dateC :: B.ByteString dateC = P.pack "Date" dateCLower :: B.ByteString dateCLower = P.map toLower dateC serverC :: B.ByteString serverC = P.pack "Server" happstackC :: B.ByteString happstackC = P.pack $ "Happstack/" ++ DV.showVersion Paths.version -- textHtmlC :: B.ByteString -- textHtmlC = P.pack "text/html; charset=utf-8" transferEncodingC :: B.ByteString transferEncodingC = P.pack "Transfer-Encoding" chunkedC :: B.ByteString chunkedC = P.pack "chunked" -- Response code names responseMessage :: (Num t, Show t, Eq t) => t -> B.ByteString responseMessage 100 = P.pack " 100 Continue\r\n" responseMessage 101 = P.pack " 101 Switching Protocols\r\n" responseMessage 200 = P.pack " 200 OK\r\n" responseMessage 201 = P.pack " 201 Created\r\n" responseMessage 202 = P.pack " 202 Accepted\r\n" responseMessage 203 = P.pack " 203 Non-Authoritative Information\r\n" responseMessage 204 = P.pack " 204 No Content\r\n" responseMessage 205 = P.pack " 205 Reset Content\r\n" responseMessage 206 = P.pack " 206 Partial Content\r\n" responseMessage 300 = P.pack " 300 Multiple Choices\r\n" responseMessage 301 = P.pack " 301 Moved Permanently\r\n" responseMessage 302 = P.pack " 302 Found\r\n" responseMessage 303 = P.pack " 303 See Other\r\n" responseMessage 304 = P.pack " 304 Not Modified\r\n" responseMessage 305 = P.pack " 305 Use Proxy\r\n" responseMessage 307 = P.pack " 307 Temporary Redirect\r\n" responseMessage 400 = P.pack " 400 Bad Request\r\n" responseMessage 401 = P.pack " 401 Unauthorized\r\n" responseMessage 402 = P.pack " 402 Payment Required\r\n" responseMessage 403 = P.pack " 403 Forbidden\r\n" responseMessage 404 = P.pack " 404 Not Found\r\n" responseMessage 405 = P.pack " 405 Method Not Allowed\r\n" responseMessage 406 = P.pack " 406 Not Acceptable\r\n" responseMessage 407 = P.pack " 407 Proxy Authentication Required\r\n" responseMessage 408 = P.pack " 408 Request Time-out\r\n" responseMessage 409 = P.pack " 409 Conflict\r\n" responseMessage 410 = P.pack " 410 Gone\r\n" responseMessage 411 = P.pack " 411 Length Required\r\n" responseMessage 412 = P.pack " 412 Precondition Failed\r\n" responseMessage 413 = P.pack " 413 Request Entity Too Large\r\n" responseMessage 414 = P.pack " 414 Request-URI Too Large\r\n" responseMessage 415 = P.pack " 415 Unsupported Media Type\r\n" responseMessage 416 = P.pack " 416 Requested range not satisfiable\r\n" responseMessage 417 = P.pack " 417 Expectation Failed\r\n" responseMessage 500 = P.pack " 500 Internal Server Error\r\n" responseMessage 501 = P.pack " 501 Not Implemented\r\n" responseMessage 502 = P.pack " 502 Bad Gateway\r\n" responseMessage 503 = P.pack " 503 Service Unavailable\r\n" responseMessage 504 = P.pack " 504 Gateway Time-out\r\n" responseMessage 505 = P.pack " 505 HTTP Version not supported\r\n" responseMessage x = P.pack (" " ++ show x ++ " \r\n")
Happstack/happstack-server
src/Happstack/Server/Internal/Handler.hs
bsd-3-clause
18,735
1
30
5,705
5,279
2,719
2,560
334
5
{-# LANGUAGE MagicHash #-} -- | Evaluate an array by breaking it up into linear chunks and filling -- each chunk in parallel. module Data.Array.Repa.Eval.Chunked ( fillLinearS , fillBlock2S , fillChunkedP , fillChunkedIOP) where import Data.Array.Repa.Index import Data.Array.Repa.Eval.Gang import GHC.Exts import Prelude as P ------------------------------------------------------------------------------- -- | Fill something sequentially. -- -- * The array is filled linearly from start to finish. -- fillLinearS :: Int -- ^ Number of elements. -> (Int -> a -> IO ()) -- ^ Update function to write into result buffer. -> (Int -> a) -- ^ Fn to get the value at a given index. -> IO () fillLinearS !(I# len) write getElem = fill 0# where fill !ix | ix >=# len = return () | otherwise = do write (I# ix) (getElem (I# ix)) fill (ix +# 1#) {-# INLINE [0] fillLinearS #-} ------------------------------------------------------------------------------- -- | Fill a block in a rank-2 array, sequentially. -- -- * Blockwise filling can be more cache-efficient than linear filling for -- rank-2 arrays. -- -- * The block is filled in row major order from top to bottom. -- fillBlock2S :: (Int -> a -> IO ()) -- ^ Update function to write into result buffer. -> (DIM2 -> a) -- ^ Fn to get the value at the given index. -> Int# -- ^ Width of the whole array. -> Int# -- ^ x0 lower left corner of block to fill. -> Int# -- ^ y0 -> Int# -- ^ w0 width of block to fill -> Int# -- ^ h0 height of block to fill -> IO () fillBlock2S write getElem !imageWidth !x0 !y0 !w0 h0 = do fillBlock y0 ix0 where !x1 = x0 +# w0 !y1 = y0 +# h0 !ix0 = x0 +# (y0 *# imageWidth) {-# INLINE fillBlock #-} fillBlock !y !ix | y >=# y1 = return () | otherwise = do fillLine1 x0 ix fillBlock (y +# 1#) (ix +# imageWidth) where {-# INLINE fillLine1 #-} fillLine1 !x !ix' | x >=# x1 = return () | otherwise = do write (I# ix') (getElem (Z :. (I# y) :. (I# x))) fillLine1 (x +# 1#) (ix' +# 1#) {-# INLINE [0] fillBlock2S #-} ------------------------------------------------------------------------------- -- | Fill something in parallel. -- -- * The array is split into linear chunks, -- and each thread linearly fills one chunk. -- fillChunkedP :: Int -- ^ Number of elements. -> (Int -> a -> IO ()) -- ^ Update function to write into result buffer. -> (Int -> a) -- ^ Fn to get the value at a given index. -> IO () fillChunkedP !(I# len) write getElem = gangIO theGang $ \(I# thread) -> let !start = splitIx thread !end = splitIx (thread +# 1#) in fill start end where -- Decide now to split the work across the threads. -- If the length of the vector doesn't divide evenly among the threads, -- then the first few get an extra element. !(I# threads) = gangSize theGang !chunkLen = len `quotInt#` threads !chunkLeftover = len `remInt#` threads {-# INLINE splitIx #-} splitIx thread | thread <# chunkLeftover = thread *# (chunkLen +# 1#) | otherwise = thread *# chunkLen +# chunkLeftover -- Evaluate the elements of a single chunk. {-# INLINE fill #-} fill !ix !end | ix >=# end = return () | otherwise = do write (I# ix) (getElem (I# ix)) fill (ix +# 1#) end {-# INLINE [0] fillChunkedP #-} ------------------------------------------------------------------------------- -- | Fill something in parallel, using a separate IO action for each thread. -- -- * The array is split into linear chunks, -- and each thread linearly fills one chunk. -- fillChunkedIOP :: Int -- ^ Number of elements. -> (Int -> a -> IO ()) -- ^ Update fn to write into result buffer. -> (Int -> IO (Int -> IO a)) -- ^ Create a fn to get the value at a given index. -- The first `Int` is the thread number, so you can do some -- per-thread initialisation. -> IO () fillChunkedIOP !(I# len) write mkGetElem = gangIO theGang $ \(I# thread) -> let !start = splitIx thread !end = splitIx (thread +# 1#) in fillChunk thread start end where -- Decide now to split the work across the threads. -- If the length of the vector doesn't divide evenly among the threads, -- then the first few get an extra element. !(I# threads) = gangSize theGang !chunkLen = len `quotInt#` threads !chunkLeftover = len `remInt#` threads {-# INLINE splitIx #-} splitIx thread | thread <# chunkLeftover = thread *# (chunkLen +# 1#) | otherwise = thread *# chunkLen +# chunkLeftover -- Given the threadId, starting and ending indices. -- Make a function to get each element for this chunk -- and call it for every index. {-# INLINE fillChunk #-} fillChunk !thread !ixStart !ixEnd = do getElem <- mkGetElem (I# thread) fill getElem ixStart ixEnd -- Call the provided getElem function for every element -- in a chunk, and feed the result to the write function. {-# INLINE fill #-} fill !getElem !ix0 !end = go ix0 where go !ix | ix >=# end = return () | otherwise = do x <- getElem (I# ix) write (I# ix) x go (ix +# 1#) {-# INLINE [0] fillChunkedIOP #-}
kairne/repa-lts
Data/Array/Repa/Eval/Chunked.hs
bsd-3-clause
5,873
67
19
1,899
1,240
638
602
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Agon.FBAuth(login) where import Agon.Types import Agon.Instances import Agon.Agon import Agon.APIConstructors import Agon.Data import Agon.HTTP import Control.Monad.Reader import Control.Monad.Trans import Control.Monad.Trans.Either import Data.Aeson import Data.Time.Clock.POSIX (getPOSIXTime) import Servant data FacebookInfo = FacebookInfo { fbID :: String, fbName :: String } instance FromJSON FacebookInfo where parseJSON (Object v) = FacebookInfo <$> v .: "id" <*> v .: "name" parseJSON _ = mzero login :: String -> AppM (User, Principal) login token = do let url = "https://graph.facebook.com/me?access_token=" ++ token req <- buildReq url "GET" (Nothing :: Maybe ()) fb <- httpJSON req agon <- ask fetchRes <- liftIO (runEitherT $ runAgonM (get $ fbID fb) agon) case fetchRes of Left err -> case (errHTTPCode err) of 404 -> createUser fb _ -> lift $ left err Right u -> do p <- makePrincipal u return (u, p) createUser :: FacebookInfo -> AppM (User, Principal) createUser (FacebookInfo fid fname) = do let usr = User Nothing fid fname False update usr p <- makePrincipal usr return (usr, p) makePrincipal :: User -> AppM Principal makePrincipal u = do let uid = _userID u tme <- liftIO $ fmap round getPOSIXTime return $ Principal uid (tme + 604800)
Feeniks/Agon
app/Agon/FBAuth.hs
bsd-3-clause
1,440
0
14
339
487
247
240
45
3
-- | all internal Functions for manipulating ExprTrees also backstage fun module Functions ( -- * Functions insert, forkWith, relabel, relabelAt, commutate, substitute, _substitute, isSubstitute, varToSymbol, simplify, isNumber, isVariable, ($$), diag, scales ) where import Data import Data.Ratio import Data.Ord (comparing) import Control.Exception (assert) import Control.Applicative (liftA2) import Data.Char (isDigit) insert :: ExprTree a -> Label -> Fun -> Side -> ExprTree a -> ExprTree a -- ^ guess what - inserts a tree at label on given side into given tree insert shrubbery here withfun onSide toTree | l == here = forkWith shrubbery withfun onSide toTree | here < l = Node l f (insert shrubbery here withfun onSide lb) rb | here > l = Node l f lb (insert shrubbery here withfun onSide rb) | otherwise = error "label out of range" where (Node _ f lb rb) = toTree l = lab toTree forkWith :: ExprTree a -> Fun -> Side -> ExprTree a -> ExprTree a -- ^ Just an insert on top level forkWith branch fun L trunk = relabelAt l (Node l fun branch trunk) where l = lab trunk forkWith branch fun R trunk = relabelAt l (Node l fun trunk branch) where l = lab trunk relabel :: ExprTree a -> ExprTree a -- ^ relabels a tree on top level relabel = relabelAt (1 % 1) relabelAt :: Label -> ExprTree a -> ExprTree a -- ^ relabels a tree startin on a given level relabelAt init (Node l fun lb rb) = Node init fun (relabelAt (init - (1 % (2 * d))) lb) (relabelAt (init + (1 % (2 * d))) rb) where d = denominator init relabelAt init (Leaf l v) = Leaf init v commutate :: ExprTree a -> ExprTree a -- ^ should be commutation laws for addition and multiplication commutate (Node l fun lb rb) = relabelAt l (Node l fun rb lb) commutate e = e substitute :: [(Algebraic, Rational)] -> ExprTree Algebraic -> ExprTree Rational -- ^ substitutes a whole ExprTree according to a list of substitution rules substitute sRule = fmap ( _substitute sRule) _substitute :: [( Algebraic, Rational)] -> Algebraic -> Rational {- ^ an internal function to apply a list of substitution rules to given variables >>> _substitute [(Alg "x1",2%1)] Alg "x1" 2%1 >>> _substitute [(Alg "x2",2%1)] Alg "x1" Alg "x2" -} _substitute sRule (Alg v) | '%' ∈ v = read v :: Rational | otherwise = assert (length _sRule == 1) (snd (head _sRule)) where _sRule = filter (isSubstitute (Alg v)) sRule isSubstitute :: Algebraic -> (Algebraic, Rational) -> Bool -- ^ checks if a given Algebraic expression can be substituted by Rational isSubstitute v x = fst x == v varToSymbol :: Algebraic -> [(Algebraic, Rational)] -> Symbol -- ^ changes variables to symbols - this function should be applied after having -- made all substitutions before - danger danger danger danger !!! varToSymbol a srules | a `elem` keys = Symbol (Just value, Alg (show value)) | isNumber a = Symbol (Just rat, a) | otherwise = Symbol (Nothing , a) where Alg a_ = a rat = read a_::Rational keys = map fst srules aValues = map snd $ filter (\x -> fst x == a) srules (value:[]) = aValues -- with pattern matching ?? ($$) :: (a1 -> a2, b1 -> b2) -> (a1, b1) -> (a2, b2) -- ^ applicates a pair of functions to a pair of values (f1, f2) $$ (x, y) = (f1 x, f2 y) diag :: a -> (a, a) -- ^ duplicates a value to a pair diag x = (x, x) foldTree :: ExprTree Rational -> Rational -- ^ folds Rational Trees - to get one Rational number foldTree (Leaf l a) = a foldTree (Node lab Add l r) = foldTree l + foldTree r foldTree (Node lab Sub l r) = foldTree l - foldTree r foldTree (Node lab Mul l r) = foldTree l * foldTree r foldTree (Node lab Div l r) = foldTree l / foldTree r simplify :: ExprTree Symbol -> ExprTree Symbol -- ^ no idea if it works - should simplify symbol trees - haaard work !! simplify (Leaf lab s) = (Leaf lab s) simplify (Node lab Add (Leaf lab1 (Symbol (a1,b1))) (Leaf lab2 (Symbol (a2,b2)))) | (not $ isVariable b1) && (not $ isVariable b2) = Leaf (0%1) s where s = Symbol (liftA2 (+) a1 a2, Alg (show b)) b = (eval b1) + (eval b2) isVariable :: Algebraic -> Bool -- ^ well checks wether an algebraic expression is a variable or not -- (variables start with letters isVariable = not . isNumber isNumber :: Algebraic -> Bool -- ^ guess again - checks if an @Algebraic@ is actually a number isNumber (Alg (a:aa)) = (isDigit a) scales :: ExprTree Rational -> ExprTree Rational -> Ordering -- ^ like the antque ones, /scales/ measure /GT/,/LQ/ or /EQ/ scales = Data.Ord.comparing foldTree (∈) :: Eq a => a -> [a] -> Bool (∈) = elem
epsilonhalbe/Algebra-Alchemy
Functions.hs
bsd-3-clause
5,085
0
13
1,461
1,592
828
764
89
1
module StompParserSpec where import Funque.Stomp.Parser import Data.ByteString(pack) import Data.ByteString.Internal(c2w, w2c) import Data.Word(Word8) import Control.Monad import Test.HUnit import Test.QuickCheck import Test.Framework.Providers.HUnit import Test.Framework.Providers.QuickCheck2 tests = [ testWhitespaceHeaders , testParseConnected , testParseNoHeaders , testParseBody , testQCase1 , testProperty "serialize and parse" prop_serializeAndParse ] parseCheck name s frame = testCase name $ assertEqual name (Right frame) (parseFrame . pack . (fmap c2w) $ s) serializeAndParseCheck name f = testCase name $ assertEqual name (Right f) $ (parseFrame . serializeFrame) f testWhitespaceHeaders = parseCheck "whitespace in header value" "CONNECTED\nversion: 1.0\n\n\NUL" $ StompFrame "CONNECTED" [("version", " 1.0")] Nothing -- STOMP 1.2 explicitly says we MUST NOT trim values testParseConnected = parseCheck "connected message" "CONNECTED\nsession:ID:123\nheartbeat:0,0\nversion:1.0\n\n\NUL" $ StompFrame "CONNECTED" [("session", "ID:123"), ("heartbeat", "0,0"), ("version", "1.0")] Nothing testParseNoHeaders = parseCheck "without headers" "CONNECTED\n\n\NUL" $ StompFrame "CONNECTED" [] Nothing testParseBody = parseCheck "with body" "CONNECTED\n\nABC1\NUL" $ StompFrame "CONNECTED" [] (Just . (fmap c2w) $ "ABC1") testQCase1 = serializeAndParseCheck "QuckCheck failure 1" $ StompFrame "\ACK" [("=]\b\ACK","\SUBl',\NAK"),("%\DC2?\DELK"," v"),("a\SOH","5"),("\DC3","Gn"),("\bkB`/S","\ENQ5V"),("\EMb.","1")] (Just [33,151,123,44,63,119]) prop_serializeAndParse f = (parseFrame . serializeFrame) f == Right f newtype NonLfChar = NonLfChar { getNonLfChar :: Char } instance Arbitrary NonLfChar where arbitrary = (NonLfChar . w2c) `fmap` (elements $ [0..9] ++ [11..127]) newtype Octet = Octet { getOctet :: Word8 } instance Arbitrary Octet where arbitrary = Octet `fmap` elements [0..255] instance Arbitrary StompFrame where arbitrary = do cmd <- listOf1 $ getNonLfChar `fmap` arbitrary headers <- listOf genHeader body <- oneof [return Nothing, Just `fmap` listOf1 ((getOctet `fmap` arbitrary) `suchThat` (/= 0))] return $ StompFrame cmd headers body where genHeader :: Gen StompHeader genHeader = do n <- listOf1 $ (getNonLfChar `fmap` arbitrary) `suchThat` (/= ':') v <- listOf1 $ getNonLfChar `fmap` arbitrary return (n, v)
vokhotnikov/funque
test/StompParserSpec.hs
bsd-3-clause
2,547
0
16
491
738
414
324
47
1
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GADTs #-} -- | -- Module : Pact.Coverage -- Copyright : (C) 2021 Stuart Popejoy -- License : BSD-style (see the file LICENSE) -- Maintainer : Stuart Popejoy <[email protected]> -- -- Implement advice to provide LCOV coverage data. -- module Pact.Coverage ( mkCoverageAdvice , writeCovReport , writeCovReport' ) where import Control.Monad.IO.Class import Control.Monad.State.Strict import Control.Lens (set) import Data.Default import Data.Foldable import Data.IORef import qualified Data.HashMap.Strict as HM import qualified Data.Text as T import Data.Text.Encoding import Text.Trifecta.Delta import System.Directory import System.FilePath import Pact.Coverage.Report import Pact.Typechecker import Pact.Types.Advice import Pact.Types.Info import Pact.Types.Pretty import Pact.Types.Term hiding (App(..),Object(..),Step(..)) import Pact.Types.Typecheck import Pact.Types.Runtime (ModuleData(..),eeAdvice) import Pact.Repl import Pact.Repl.Types mkCoverageAdvice :: IO (IORef LcovReport,Advice) mkCoverageAdvice = newIORef mempty >>= \r -> return (r,Advice $ cover r) cover :: MonadIO m => IORef LcovReport -> Info -> AdviceContext r -> m (r,a) -> m a cover ref i ctx f = case _iInfo i of Just {} -> do post <- report (parseInf i) (r,a) <- f post r return a _ -> fmap snd f where report (fn,l) = liftIO $ modifyIORef ref (<> newRep) >> return post where newRep = fr <> case ctx of AdviceUser (fdef,_) -> mkFunLcov fdef _ -> mempty post = case ctx of AdviceModule _m -> postModule _ -> const $ return () fr = mkFileLcov fn mempty mempty $ lnReport l mkFileLcov fileName funReps brReps lnReps = LcovReport $ HM.singleton fileName (FileReport fileName funReps brReps lnReps) lnReport l = lnReport' l 1 lnReport' l count = HM.singleton l (LineReport l count) lnReport'' hi count = lnReport' l count where (_,l) = parseInf hi mkFunLcov fdef = mkFileLcov fn (mkFunReport fdef 1 l) mempty $ lnReport l where (fn,l) = parseInf (_dInfo fdef) mkFunReport fdef count fl = HM.singleton dn $ FunctionReport fl dn count where dn = renderCompactText $ derefDef fdef postModule :: MonadIO m => ModuleData Ref -> m () postModule (ModuleData (MDModule _m) modDefs) = do ((modFuns,modLines),_) <- liftIO $ runTC 0 False $ foldM walkDefs (mempty,mempty) (HM.elems modDefs) let (fn,_l) = parseInf i newRep = mkFileLcov fn modFuns mempty modLines liftIO $ modifyIORef ref (<> newRep) postModule _ = return () walkDefs acc@(fs,ls) mem = case mem of Ref r -> do tl <- mkTop (fmap Left r) case tl of (TopFun FDefun {..} _) -> do let fm = HM.singleton dn $ FunctionReport l dn 0 (_fn,l) = parseInf _fInfo dn = renderCompactText _fModule <> "." <> _fName lns = HM.unions $ map astRep _fBody return (HM.union fs fm,HM.unions [ls,lns,lnReport'' _fInfo 0]) _ -> return acc _ -> return acc astRep :: AST Node -> HM.HashMap Int LineReport astRep App {..} = HM.unions $ [lnReport'' _aNode 0,specials] ++ map astRep _aAppArgs where specials = case _aAppFun of (FNative _ _ _ (Just (_,SBinding bast))) -> astRep bast _ -> mempty astRep List {..} = HM.unions $ map astRep _aList astRep Object {..} = HM.unions $ map astRep $ toList _aObject astRep Step {..} = HM.union (astRep _aExec) $ maybe mempty astRep _aRollback astRep Binding {..} = HM.unions $ map (astRep . snd) _aBindings ++ map astRep _aBody astRep _ = mempty parseInf :: HasInfo i => i -> (FilePath,Int) parseInf inf = case getInfo inf of Info (Just (_,Parsed (Directed fn l _ _ _) _)) -> (T.unpack $ decodeUtf8 fn,succ $ fromIntegral l) Info (Just (_,Parsed (Lines l _ _ _) _)) -> nofile $ succ $ fromIntegral l _ -> nofile 0 where nofile l = ("<interactive>",l) writeCovReport :: IORef LcovReport -> IO () writeCovReport = writeCovReport' True "coverage/lcov.info" writeCovReport' :: Bool -> FilePath -> IORef LcovReport -> IO () writeCovReport' mkParentDir reportFile ref = do when mkParentDir $ createDirectoryIfMissing True $ takeDirectory reportFile readIORef ref >>= writeReport reportFile -- _cover "examples/accounts/accounts.repl" _cover :: FilePath -> IO () _cover fn = do (ref,adv) <- mkCoverageAdvice s <- set (rEnv . eeAdvice) adv <$> initReplState (Script False fn) Nothing void $! runStateT (useReplLib >> loadFile def fn) s writeCovReport ref
kadena-io/pact
src-ghc/Pact/Coverage.hs
bsd-3-clause
4,761
0
22
1,161
1,700
869
831
104
13
-- -- Chapter 8. -- module C'8 where import Test.QuickCheck hiding ( Result ) -- Notes: Chapter 4> cabal install -- Chapter 7> cabal install import C'4 import C'7 import B'C'8 import E'8'23 import E'8'22 import E'8'21 import E'8'20 import E'8'19 import E'8'18 import E'8'17 import E'8'16 import E'8'15 import E'8'14 import E'8'13 import E'8'12 import E'8'11 import E'8'10 import E'8''9 import E'8''8 import E'8''7 import E'8''6 import E'8''5 import E'8''4 import E'8''3 import E'8''2 import E'8''1
pascal-knodel/haskell-craft
_/links/C'8.hs
mit
514
0
5
93
98
67
31
28
0
module Partition where import Prelude (Bool(..)) (x:xs) ++ ys = x:(xs ++ ys) [] ++ ys = ys data Pair a b = Pair a b partition :: (a -> Bool) -> [a] -> Pair [a] [a] partition p [] = Pair [] [] partition p (x:xs) | p x = Pair (x:ys) zs | True = Pair ys (x:zs) where Pair ys zs = partition p xs qsort :: (a -> a -> Bool) -> [a] -> [a] qsort (<) [] = [] qsort (<) (x:xs) = qsort (<) ys ++ [x] ++ qsort (<) zs where Pair ys zs = partition (< x) xs
danr/hipspec
tfp1/tests/Partition.hs
gpl-3.0
472
0
8
135
315
167
148
15
1
main = ''
roberth/uu-helium
test/parser/EmptyChar.hs
gpl-3.0
9
0
5
2
8
4
4
-1
-1
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE StandaloneDeriving #-} -- - Immediate operand module Haskus.Arch.Common.Immediate ( Imm (..) , ImmFam (..) , ImmFamT , ImmFamP , immFamToImm ) where import Haskus.Format.Binary.Word import Haskus.Arch.Common.Solver import Haskus.Utils.Solver import Haskus.Utils.Flow import Haskus.Utils.List (nub) -- | Immediate value data Imm it s = Imm { immSize :: !s -- ^ Size of the immediate , immSignExtended :: !(Maybe s) -- ^ Sign-extended to the given size , immValue :: !Word64 -- ^ Value of the immediate , immType :: !(Maybe it) -- ^ Type of the immediate } deriving (Show,Eq) -- | Immediate family data ImmFam t it s = ImmFam { immFamSize :: !(Q t s) -- ^ Size of the immediate , immFamSignExtended :: !(Q t (Maybe s)) -- ^ Sign-extended to the given size , immFamValue :: !(Q t (Maybe Word64)) -- ^ Value of the immediate , immFamType :: !(Q t (Maybe it)) -- ^ Type of the immediate } -- | Predicated immediate family type ImmFamP p e it s = ImmFam (NT p e) it s -- | Terminal immediate family type ImmFamT it s = ImmFam T it s deriving instance (Show it, Show s) => Show (ImmFam T it s) deriving instance (Eq it, Eq s) => Eq (ImmFam T it s) deriving instance (Ord it, Ord s) => Ord (ImmFam T it s) deriving instance (Show p, Show e, Show it, Show s) => Show (ImmFam (NT p e) it s) deriving instance (Eq p, Eq e, Eq it, Eq s) => Eq (ImmFam (NT p e) it s) deriving instance (Ord p, Ord e, Ord it, Ord s) => Ord (ImmFam (NT p e) it s) instance (Ord p, Eq e, Eq i, Eq s, Eq p) => Predicated (ImmFam (NT p e) i s) where type Pred (ImmFam (NT p e) i s) = p type PredErr (ImmFam (NT p e) i s) = e type PredTerm (ImmFam (NT p e) i s) = ImmFam T i s liftTerminal (ImmFam s e v t) = ImmFam (liftTerminal s) (liftTerminal e) (liftTerminal v) (liftTerminal t) reducePredicates oracle (ImmFam s e v t) = initP ImmFam ImmFam |> (`applyP` reducePredicates oracle s) |> (`applyP` reducePredicates oracle e) |> (`applyP` reducePredicates oracle v) |> (`applyP` reducePredicates oracle t) |> resultP getTerminals (ImmFam ss es vs ts) = [ ImmFam s e v t | s <- getTerminals ss , e <- getTerminals es , v <- getTerminals vs , t <- getTerminals ts ] getPredicates (ImmFam s e v t) = nub $ concat [ getPredicates s , getPredicates e , getPredicates v , getPredicates t ] -- | Convert an immediate family into an immediate immFamToImm :: ImmFamT it s -> Maybe (Imm it s) immFamToImm ImmFam{..} = case immFamValue of Nothing -> Nothing Just v -> Just (Imm immFamSize immFamSignExtended v immFamType)
hsyl20/ViperVM
haskus-system/src/lib/Haskus/Arch/Common/Immediate.hs
bsd-3-clause
3,268
0
13
1,049
1,033
558
475
83
2
-- Memcached interface. -- Copyright (C) 2005 Evan Martin <[email protected]> module Main where import qualified Network.Memcache import Network.Memcache.Key(hash) import qualified Network.Memcache.Protocol as S import Control.Exception import System.Process import System.IO -- used for emulating sleep() import Test.HUnit withServerConnection :: (S.Server -> IO ()) -> IO () withServerConnection f = bracket connect disconnect f where connect = S.connect "localhost" 11211 disconnect = S.disconnect statsTest :: Test statsTest = TestCase $ withServerConnection $ \server -> do stats <- S.stats server assertBool "stats returns multiple stats" (length stats > 10) setGetTest :: Test setGetTest = TestCase $ withServerConnection $ \server -> do let foo = 3 :: Int success <- Network.Memcache.set server "foo" foo foo' <- Network.Memcache.get server "foo" case foo' of Nothing -> assertFailure "'foo' not found just after setting it" Just v -> assertEqual "foo value" (3 :: Int) v hashTest :: Test hashTest = TestCase $ do assertBool "hash produces different values" (hash key1 /= hash key2) where key1 = "foo"; key2 = "bar" -- XXX hack: is there no other way to wait? sleep :: Int -> IO () sleep x = hWaitForInput stdin x >> return () main :: IO () main = bracket upDaemon downDaemon runTests >> return () where upDaemon = do m <- runCommand "memcached" sleep 200 -- give it time to start up and bind. return m downDaemon = terminateProcess runTests _ = runTestTT $ TestList [statsTest, setGetTest, hashTest] -- vim: set ts=2 sw=2 et :
alsonkemp/haskell-memcached
Test.hs
mit
1,622
0
13
327
451
234
217
37
2
module Hasql.Postgres.Statement.TemplateConverter.Parser where import Hasql.Postgres.Prelude import Data.Attoparsec.ByteString.Char8 import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Lazy.Builder as BB data Part = Chunk BB.Builder | Placeholder run :: ByteString -> Parser a -> Either Text a run input parser = either (Left . fromString) Right $ parseOnly (parser <* endOfInput) input parts :: Parser [Part] parts = many (chunk <|> placeholder) where chunk = fmap Chunk $ fmap mconcat $ many1 $ stringLit <|> (BB.char8 <$> notChar '?') placeholder = char '?' *> pure Placeholder stringLit :: Parser BB.Builder stringLit = do quote <- char '"' <|> char '\'' contentBuilders <- many $ (BB.byteString <$> string "\\\\") <|> (BB.byteString <$> string (fromString ['\\', quote])) <|> (BB.char8 <$> notChar quote) char quote return $ BB.char7 quote <> mconcat contentBuilders <> BB.char7 quote
AndrewRademacher/hasql-postgres
library/Hasql/Postgres/Statement/TemplateConverter/Parser.hs
mit
1,019
0
15
233
329
172
157
31
1
-- | Utility functions. module Brick.Util ( clamp , on , fg , bg , clOffset ) where import Control.Lens ((&), (%~)) import Data.Monoid ((<>)) import Graphics.Vty import Brick.Types.Internal (Location(..), CursorLocation(..), cursorLocationL) -- | Given a minimum value and a maximum value, clamp a value to that -- range (values less than the minimum map to the minimum and values -- greater than the maximum map to the maximum). -- -- >>> clamp 1 10 11 -- 10 -- >>> clamp 1 10 2 -- 2 -- >>> clamp 5 10 1 -- 5 clamp :: (Ord a) => a -- ^ The minimum value -> a -- ^ The maximum value -> a -- ^ The value to clamp -> a clamp mn mx val = max mn (min val mx) -- | Build an attribute from a foreground color and a background color. -- Intended to be used infix. on :: Color -- ^ The foreground color -> Color -- ^ The background color -> Attr on f b = defAttr `withForeColor` f `withBackColor` b -- | Create an attribute from the specified foreground color (the -- background color is the "default"). fg :: Color -> Attr fg = (defAttr `withForeColor`) -- | Create an attribute from the specified background color (the -- background color is the "default"). bg :: Color -> Attr bg = (defAttr `withBackColor`) -- | Add a 'Location' offset to the specified 'CursorLocation'. clOffset :: CursorLocation -> Location -> CursorLocation clOffset cl off = cl & cursorLocationL %~ (<> off)
sisirkoppaka/brick
src/Brick/Util.hs
bsd-3-clause
1,465
0
8
346
266
169
97
27
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="si-LK"> <title>Script Console</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>
kingthorin/zap-extensions
addOns/scripts/src/main/javahelp/org/zaproxy/zap/extension/scripts/resources/help_si_LK/helpset_si_LK.hs
apache-2.0
959
77
66
156
407
206
201
-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="ms-MY"> <title>Report Generation</title> <maps> <homeID>reports</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>
kingthorin/zap-extensions
addOns/reports/src/main/javahelp/org/zaproxy/addon/reports/resources/help_ms_MY/helpset_ms_MY.hs
apache-2.0
966
77
66
156
407
206
201
-1
-1
-- BANNERSTART -- - Copyright 2006-2008, Galois, Inc. -- - This software is distributed under a standard, three-clause BSD license. -- - Please see the file LICENSE, distributed with this software, for specific -- - terms and conditions. -- Author: Adam Wick <[email protected]> -- BANNEREND -- import Control.Concurrent import Hypervisor.Console import Hypervisor.XenStore main :: IO () main = do con <- initXenConsole xs <- initXenStore writeConsole con "Getting ID ...\n" me <- xsGetDomId xs writeConsole con $ "Got ID = " ++ show me ++ ".\n" threadDelay (2 * 1000 * 1000)
ggkitsas/HaLVM
examples/Core/GetIdTest/GetId.hs
bsd-3-clause
589
0
10
106
109
55
54
11
1
-- parser produced by Happy Version 1.11 module HsParser (parse) where import Syntax import SyntaxUtil import ParseMonad import Lexer import LexUtil(readInteger, readRational) import ParseUtil --import Rewrite import IOExts import Char(showLitChar) data HappyAbsSyn = HappyTerminal Token | HappyErrorToken Int | HappyAbsSyn4 (HsModuleR) | HappyAbsSyn5 (([HsImportDecl], [HsDecl])) | HappyAbsSyn7 (()) | HappyAbsSyn8 (Maybe [HsExportSpec]) | HappyAbsSyn9 ([HsExportSpec]) | HappyAbsSyn12 (HsExportSpec) | HappyAbsSyn13 ([HsName]) | HappyAbsSyn14 (HsName) | HappyAbsSyn15 ([HsImportDecl]) | HappyAbsSyn16 (HsImportDecl) | HappyAbsSyn17 (Bool) | HappyAbsSyn18 (Maybe Module) | HappyAbsSyn19 (Maybe (Bool, [HsImportSpec])) | HappyAbsSyn20 ((Bool, [HsImportSpec])) | HappyAbsSyn21 ([HsImportSpec]) | HappyAbsSyn23 (HsImportSpec) | HappyAbsSyn26 ([HsDecl]) | HappyAbsSyn27 (HsDecl) | HappyAbsSyn28 (Int) | HappyAbsSyn29 (HsAssoc) | HappyAbsSyn30 ([HsIdent]) | HappyAbsSyn32 (HsFunDeps HsType) | HappyAbsSyn34 (HsFunDep HsType) | HappyAbsSyn35 ([HsType]) | HappyAbsSyn42 (HsType) | HappyAbsSyn46 (([HsType],HsType)) | HappyAbsSyn48 (([HsType], [HsType])) | HappyAbsSyn51 (([HsType], HsName)) | HappyAbsSyn52 ([HsConDecl HsType ]) | HappyAbsSyn53 (HsConDecl HsType) | HappyAbsSyn54 ((HsName, [HsBangType HsType])) | HappyAbsSyn56 (HsBangType HsType) | HappyAbsSyn58 ([([HsName], HsBangType HsType)]) | HappyAbsSyn59 (([HsName], HsBangType HsType)) | HappyAbsSyn70 ((HsName,[HsPat])) | HappyAbsSyn72 (HsRhs HsExp) | HappyAbsSyn73 ([(SrcLoc, HsExp, HsExp)]) | HappyAbsSyn74 ((SrcLoc, HsExp, HsExp)) | HappyAbsSyn75 (HsExp) | HappyAbsSyn82 ([HsExp]) | HappyAbsSyn85 ([HsStmtAtom HsExp HsPat [HsDecl] ]) | HappyAbsSyn86 (HsStmtAtom HsExp HsPat [HsDecl]) | HappyAbsSyn87 ([HsAlt HsExp HsPat [HsDecl]]) | HappyAbsSyn89 (HsAlt HsExp HsPat [HsDecl]) | HappyAbsSyn93 ([HsStmtAtom HsExp HsPat [HsDecl]]) | HappyAbsSyn96 ([HsFieldUpdate HsExp]) | HappyAbsSyn98 (HsFieldUpdate HsExp) | HappyAbsSyn99 (HsPat) | HappyAbsSyn103 ([HsPat]) | HappyAbsSyn105 ([HsPatField HsPat]) | HappyAbsSyn107 (HsPatField HsPat) | HappyAbsSyn120 (HsIdent) | HappyAbsSyn132 (HsLiteral) | HappyAbsSyn134 (SrcLoc) | HappyAbsSyn137 (Module) type HappyReduction = Int -> (Token) -> HappyState (Token) (HappyStk HappyAbsSyn -> PM(HappyAbsSyn)) -> [HappyState (Token) (HappyStk HappyAbsSyn -> PM(HappyAbsSyn))] -> HappyStk HappyAbsSyn -> PM(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 :: Int -> HappyReduction happyReduce_1, happyReduce_2, happyReduce_3, happyReduce_4, happyReduce_5, happyReduce_6, happyReduce_7, happyReduce_8, happyReduce_9, happyReduce_10, happyReduce_11, 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 :: HappyReduction action_0 (4) = happyGoto action_3 action_0 (134) = happyGoto action_4 action_0 _ = happyReduce_317 action_1 (134) = happyGoto action_2 action_1 _ = happyFail action_2 (197) = happyShift action_8 action_2 _ = happyFail action_3 (205) = happyAccept action_3 _ = happyFail action_4 (160) = happyShift action_7 action_4 (197) = happyShift action_8 action_4 (5) = happyGoto action_5 action_4 (135) = happyGoto action_6 action_4 _ = happyReduce_318 action_5 _ = happyReduce_2 action_6 (143) = happyShift action_34 action_6 (144) = happyShift action_35 action_6 (145) = happyShift action_36 action_6 (146) = happyShift action_37 action_6 (147) = happyShift action_38 action_6 (153) = happyShift action_39 action_6 (154) = happyShift action_40 action_6 (155) = happyShift action_41 action_6 (156) = happyShift action_42 action_6 (157) = happyShift action_43 action_6 (163) = happyShift action_44 action_6 (166) = happyShift action_45 action_6 (177) = happyShift action_46 action_6 (180) = happyShift action_47 action_6 (182) = happyShift action_48 action_6 (183) = happyShift action_49 action_6 (184) = happyShift action_50 action_6 (188) = happyShift action_51 action_6 (190) = happyShift action_52 action_6 (192) = happyShift action_53 action_6 (193) = happyShift action_54 action_6 (194) = happyShift action_55 action_6 (195) = happyShift action_56 action_6 (198) = happyShift action_57 action_6 (201) = happyShift action_58 action_6 (203) = happyShift action_59 action_6 (204) = happyShift action_60 action_6 (6) = happyGoto action_61 action_6 (15) = happyGoto action_12 action_6 (16) = happyGoto action_13 action_6 (26) = happyGoto action_14 action_6 (27) = happyGoto action_15 action_6 (29) = happyGoto action_16 action_6 (31) = happyGoto action_17 action_6 (38) = happyGoto action_18 action_6 (40) = happyGoto action_19 action_6 (41) = happyGoto action_20 action_6 (69) = happyGoto action_21 action_6 (70) = happyGoto action_22 action_6 (100) = happyGoto action_23 action_6 (101) = happyGoto action_24 action_6 (102) = happyGoto action_25 action_6 (113) = happyGoto action_26 action_6 (115) = happyGoto action_27 action_6 (122) = happyGoto action_28 action_6 (123) = happyGoto action_29 action_6 (124) = happyGoto action_30 action_6 (126) = happyGoto action_31 action_6 (132) = happyGoto action_32 action_6 (133) = happyGoto action_33 action_6 _ = happyReduce_8 action_7 (143) = happyShift action_34 action_7 (144) = happyShift action_35 action_7 (145) = happyShift action_36 action_7 (146) = happyShift action_37 action_7 (147) = happyShift action_38 action_7 (153) = happyShift action_39 action_7 (154) = happyShift action_40 action_7 (155) = happyShift action_41 action_7 (156) = happyShift action_42 action_7 (157) = happyShift action_43 action_7 (163) = happyShift action_44 action_7 (166) = happyShift action_45 action_7 (177) = happyShift action_46 action_7 (180) = happyShift action_47 action_7 (182) = happyShift action_48 action_7 (183) = happyShift action_49 action_7 (184) = happyShift action_50 action_7 (188) = happyShift action_51 action_7 (190) = happyShift action_52 action_7 (192) = happyShift action_53 action_7 (193) = happyShift action_54 action_7 (194) = happyShift action_55 action_7 (195) = happyShift action_56 action_7 (198) = happyShift action_57 action_7 (201) = happyShift action_58 action_7 (203) = happyShift action_59 action_7 (204) = happyShift action_60 action_7 (6) = happyGoto action_11 action_7 (15) = happyGoto action_12 action_7 (16) = happyGoto action_13 action_7 (26) = happyGoto action_14 action_7 (27) = happyGoto action_15 action_7 (29) = happyGoto action_16 action_7 (31) = happyGoto action_17 action_7 (38) = happyGoto action_18 action_7 (40) = happyGoto action_19 action_7 (41) = happyGoto action_20 action_7 (69) = happyGoto action_21 action_7 (70) = happyGoto action_22 action_7 (100) = happyGoto action_23 action_7 (101) = happyGoto action_24 action_7 (102) = happyGoto action_25 action_7 (113) = happyGoto action_26 action_7 (115) = happyGoto action_27 action_7 (122) = happyGoto action_28 action_7 (123) = happyGoto action_29 action_7 (124) = happyGoto action_30 action_7 (126) = happyGoto action_31 action_7 (132) = happyGoto action_32 action_7 (133) = happyGoto action_33 action_7 _ = happyReduce_8 action_8 (145) = happyShift action_10 action_8 (137) = happyGoto action_9 action_8 _ = happyFail action_9 (157) = happyShift action_130 action_9 (8) = happyGoto action_128 action_9 (9) = happyGoto action_129 action_9 _ = happyReduce_12 action_10 _ = happyReduce_321 action_11 (161) = happyShift action_127 action_11 _ = happyFail action_12 (159) = happyShift action_126 action_12 (7) = happyGoto action_125 action_12 _ = happyReduce_10 action_13 _ = happyReduce_30 action_14 (159) = happyShift action_124 action_14 (7) = happyGoto action_123 action_14 _ = happyReduce_10 action_15 _ = happyReduce_84 action_16 (134) = happyGoto action_122 action_16 _ = happyReduce_317 action_17 _ = happyReduce_54 action_18 _ = happyReduce_71 action_19 _ = happyReduce_83 action_20 (165) = happyShift action_121 action_20 (134) = happyGoto action_120 action_20 _ = happyReduce_317 action_21 _ = happyReduce_85 action_22 (134) = happyGoto action_119 action_22 _ = happyReduce_317 action_23 (147) = happyShift action_117 action_23 (148) = happyShift action_99 action_23 (149) = happyShift action_100 action_23 (150) = happyShift action_101 action_23 (151) = happyShift action_102 action_23 (167) = happyShift action_118 action_23 (168) = happyShift action_104 action_23 (179) = happyShift action_105 action_23 (117) = happyGoto action_112 action_23 (119) = happyGoto action_113 action_23 (127) = happyGoto action_114 action_23 (128) = happyGoto action_94 action_23 (129) = happyGoto action_115 action_23 (130) = happyGoto action_96 action_23 (131) = happyGoto action_97 action_23 (134) = happyGoto action_116 action_23 _ = happyReduce_317 action_24 _ = happyReduce_234 action_25 _ = happyReduce_238 action_26 (143) = happyShift action_34 action_26 (144) = happyShift action_35 action_26 (145) = happyShift action_36 action_26 (146) = happyShift action_37 action_26 (153) = happyShift action_39 action_26 (154) = happyShift action_40 action_26 (155) = happyShift action_41 action_26 (156) = happyShift action_42 action_26 (157) = happyShift action_83 action_26 (163) = happyShift action_44 action_26 (165) = happyReduce_90 action_26 (166) = happyShift action_45 action_26 (170) = happyReduce_90 action_26 (176) = happyShift action_111 action_26 (177) = happyShift action_46 action_26 (180) = happyShift action_47 action_26 (188) = happyShift action_51 action_26 (203) = happyShift action_59 action_26 (102) = happyGoto action_107 action_26 (103) = happyGoto action_110 action_26 (113) = happyGoto action_81 action_26 (115) = happyGoto action_82 action_26 (122) = happyGoto action_28 action_26 (123) = happyGoto action_29 action_26 (124) = happyGoto action_30 action_26 (126) = happyGoto action_31 action_26 (132) = happyGoto action_32 action_26 (133) = happyGoto action_33 action_26 _ = happyReduce_239 action_27 (143) = happyShift action_34 action_27 (144) = happyShift action_35 action_27 (145) = happyShift action_36 action_27 (146) = happyShift action_37 action_27 (153) = happyShift action_39 action_27 (154) = happyShift action_40 action_27 (155) = happyShift action_41 action_27 (156) = happyShift action_42 action_27 (157) = happyShift action_83 action_27 (160) = happyShift action_109 action_27 (163) = happyShift action_44 action_27 (166) = happyShift action_45 action_27 (177) = happyShift action_46 action_27 (180) = happyShift action_47 action_27 (188) = happyShift action_51 action_27 (203) = happyShift action_59 action_27 (102) = happyGoto action_107 action_27 (103) = happyGoto action_108 action_27 (113) = happyGoto action_81 action_27 (115) = happyGoto action_82 action_27 (122) = happyGoto action_28 action_27 (123) = happyGoto action_29 action_27 (124) = happyGoto action_30 action_27 (126) = happyGoto action_31 action_27 (132) = happyGoto action_32 action_27 (133) = happyGoto action_33 action_27 _ = happyReduce_241 action_28 _ = happyReduce_273 action_29 _ = happyReduce_291 action_30 _ = happyReduce_277 action_31 _ = happyReduce_297 action_32 _ = happyReduce_244 action_33 _ = happyReduce_312 action_34 _ = happyReduce_293 action_35 _ = happyReduce_292 action_36 _ = happyReduce_301 action_37 _ = happyReduce_298 action_38 (153) = happyShift action_39 action_38 (154) = happyShift action_40 action_38 (133) = happyGoto action_106 action_38 _ = happyFail action_39 _ = happyReduce_315 action_40 _ = happyReduce_316 action_41 _ = happyReduce_313 action_42 _ = happyReduce_314 action_43 (143) = happyShift action_34 action_43 (144) = happyShift action_35 action_43 (145) = happyShift action_36 action_43 (146) = happyShift action_37 action_43 (147) = happyShift action_98 action_43 (148) = happyShift action_99 action_43 (149) = happyShift action_100 action_43 (150) = happyShift action_101 action_43 (151) = happyShift action_102 action_43 (153) = happyShift action_39 action_43 (154) = happyShift action_40 action_43 (155) = happyShift action_41 action_43 (156) = happyShift action_42 action_43 (157) = happyShift action_43 action_43 (158) = happyShift action_103 action_43 (163) = happyShift action_44 action_43 (166) = happyShift action_45 action_43 (168) = happyShift action_104 action_43 (177) = happyShift action_46 action_43 (179) = happyShift action_105 action_43 (180) = happyShift action_47 action_43 (188) = happyShift action_51 action_43 (203) = happyShift action_59 action_43 (70) = happyGoto action_88 action_43 (99) = happyGoto action_89 action_43 (100) = happyGoto action_90 action_43 (101) = happyGoto action_24 action_43 (102) = happyGoto action_25 action_43 (108) = happyGoto action_91 action_43 (113) = happyGoto action_92 action_43 (115) = happyGoto action_27 action_43 (122) = happyGoto action_28 action_43 (123) = happyGoto action_29 action_43 (124) = happyGoto action_30 action_43 (126) = happyGoto action_31 action_43 (127) = happyGoto action_93 action_43 (128) = happyGoto action_94 action_43 (129) = happyGoto action_95 action_43 (130) = happyGoto action_96 action_43 (131) = happyGoto action_97 action_43 (132) = happyGoto action_32 action_43 (133) = happyGoto action_33 action_43 _ = happyFail action_44 (143) = happyShift action_34 action_44 (144) = happyShift action_35 action_44 (145) = happyShift action_36 action_44 (146) = happyShift action_37 action_44 (147) = happyShift action_38 action_44 (153) = happyShift action_39 action_44 (154) = happyShift action_40 action_44 (155) = happyShift action_41 action_44 (156) = happyShift action_42 action_44 (157) = happyShift action_83 action_44 (163) = happyShift action_44 action_44 (166) = happyShift action_45 action_44 (177) = happyShift action_46 action_44 (180) = happyShift action_47 action_44 (188) = happyShift action_51 action_44 (203) = happyShift action_59 action_44 (99) = happyGoto action_84 action_44 (100) = happyGoto action_85 action_44 (101) = happyGoto action_24 action_44 (102) = happyGoto action_25 action_44 (109) = happyGoto action_86 action_44 (110) = happyGoto action_87 action_44 (113) = happyGoto action_81 action_44 (115) = happyGoto action_27 action_44 (122) = happyGoto action_28 action_44 (123) = happyGoto action_29 action_44 (124) = happyGoto action_30 action_44 (126) = happyGoto action_31 action_44 (132) = happyGoto action_32 action_44 (133) = happyGoto action_33 action_44 _ = happyReduce_260 action_45 _ = happyReduce_245 action_46 (143) = happyShift action_34 action_46 (144) = happyShift action_35 action_46 (145) = happyShift action_36 action_46 (146) = happyShift action_37 action_46 (153) = happyShift action_39 action_46 (154) = happyShift action_40 action_46 (155) = happyShift action_41 action_46 (156) = happyShift action_42 action_46 (157) = happyShift action_83 action_46 (163) = happyShift action_44 action_46 (166) = happyShift action_45 action_46 (177) = happyShift action_46 action_46 (180) = happyShift action_47 action_46 (188) = happyShift action_51 action_46 (203) = happyShift action_59 action_46 (102) = happyGoto action_80 action_46 (113) = happyGoto action_81 action_46 (115) = happyGoto action_82 action_46 (122) = happyGoto action_28 action_46 (123) = happyGoto action_29 action_46 (124) = happyGoto action_30 action_46 (126) = happyGoto action_31 action_46 (132) = happyGoto action_32 action_46 (133) = happyGoto action_33 action_46 _ = happyFail action_47 _ = happyReduce_294 action_48 (134) = happyGoto action_79 action_48 _ = happyReduce_317 action_49 (134) = happyGoto action_78 action_49 _ = happyReduce_317 action_50 (134) = happyGoto action_77 action_50 _ = happyReduce_317 action_51 _ = happyReduce_296 action_52 (134) = happyGoto action_76 action_52 _ = happyReduce_317 action_53 _ = happyReduce_58 action_54 _ = happyReduce_59 action_55 _ = happyReduce_60 action_56 (134) = happyGoto action_75 action_56 _ = happyReduce_317 action_57 (134) = happyGoto action_74 action_57 _ = happyReduce_317 action_58 (145) = happyShift action_36 action_58 (146) = happyShift action_71 action_58 (157) = happyShift action_72 action_58 (163) = happyShift action_73 action_58 (45) = happyGoto action_66 action_58 (49) = happyGoto action_67 action_58 (125) = happyGoto action_68 action_58 (126) = happyGoto action_69 action_58 (139) = happyGoto action_70 action_58 _ = happyFail action_59 _ = happyReduce_295 action_60 (134) = happyGoto action_65 action_60 _ = happyReduce_317 action_61 (1) = happyShift action_63 action_61 (162) = happyShift action_64 action_61 (136) = happyGoto action_62 action_61 _ = happyFail action_62 _ = happyReduce_4 action_63 _ = happyReduce_320 action_64 _ = happyReduce_319 action_65 (143) = happyShift action_34 action_65 (157) = happyShift action_147 action_65 (180) = happyShift action_47 action_65 (188) = happyShift action_51 action_65 (203) = happyShift action_59 action_65 (112) = happyGoto action_202 action_65 (123) = happyGoto action_146 action_65 _ = happyFail action_66 (143) = happyShift action_34 action_66 (180) = happyShift action_47 action_66 (188) = happyShift action_51 action_66 (203) = happyShift action_59 action_66 (50) = happyGoto action_200 action_66 (123) = happyGoto action_180 action_66 (142) = happyGoto action_201 action_66 _ = happyReduce_112 action_67 (134) = happyGoto action_199 action_67 _ = happyReduce_317 action_68 _ = happyReduce_100 action_69 _ = happyReduce_323 action_70 _ = happyReduce_299 action_71 _ = happyReduce_300 action_72 (158) = happyShift action_196 action_72 (165) = happyShift action_197 action_72 (175) = happyShift action_198 action_72 (81) = happyGoto action_195 action_72 _ = happyFail action_73 (164) = happyShift action_194 action_73 _ = happyFail action_74 (143) = happyShift action_34 action_74 (145) = happyShift action_36 action_74 (146) = happyShift action_71 action_74 (157) = happyShift action_182 action_74 (163) = happyShift action_183 action_74 (180) = happyShift action_47 action_74 (188) = happyShift action_51 action_74 (203) = happyShift action_59 action_74 (42) = happyGoto action_184 action_74 (43) = happyGoto action_176 action_74 (44) = happyGoto action_177 action_74 (45) = happyGoto action_185 action_74 (48) = happyGoto action_193 action_74 (49) = happyGoto action_187 action_74 (123) = happyGoto action_180 action_74 (125) = happyGoto action_68 action_74 (126) = happyGoto action_69 action_74 (139) = happyGoto action_70 action_74 (142) = happyGoto action_181 action_74 _ = happyFail action_75 (143) = happyShift action_34 action_75 (145) = happyShift action_36 action_75 (146) = happyShift action_71 action_75 (157) = happyShift action_182 action_75 (163) = happyShift action_183 action_75 (180) = happyShift action_47 action_75 (188) = happyShift action_51 action_75 (203) = happyShift action_59 action_75 (42) = happyGoto action_175 action_75 (43) = happyGoto action_176 action_75 (44) = happyGoto action_177 action_75 (45) = happyGoto action_178 action_75 (46) = happyGoto action_192 action_75 (123) = happyGoto action_180 action_75 (125) = happyGoto action_68 action_75 (126) = happyGoto action_69 action_75 (139) = happyGoto action_70 action_75 (142) = happyGoto action_181 action_75 _ = happyFail action_76 (203) = happyShift action_191 action_76 (17) = happyGoto action_190 action_76 _ = happyReduce_33 action_77 (143) = happyShift action_34 action_77 (145) = happyShift action_36 action_77 (146) = happyShift action_71 action_77 (157) = happyShift action_182 action_77 (163) = happyShift action_183 action_77 (180) = happyShift action_47 action_77 (188) = happyShift action_51 action_77 (203) = happyShift action_59 action_77 (42) = happyGoto action_189 action_77 (43) = happyGoto action_176 action_77 (44) = happyGoto action_177 action_77 (45) = happyGoto action_178 action_77 (123) = happyGoto action_180 action_77 (125) = happyGoto action_68 action_77 (126) = happyGoto action_69 action_77 (139) = happyGoto action_70 action_77 (142) = happyGoto action_181 action_77 _ = happyFail action_78 (143) = happyShift action_34 action_78 (145) = happyShift action_36 action_78 (146) = happyShift action_71 action_78 (157) = happyShift action_182 action_78 (163) = happyShift action_183 action_78 (180) = happyShift action_47 action_78 (188) = happyShift action_51 action_78 (203) = happyShift action_59 action_78 (42) = happyGoto action_184 action_78 (43) = happyGoto action_176 action_78 (44) = happyGoto action_177 action_78 (45) = happyGoto action_185 action_78 (48) = happyGoto action_186 action_78 (49) = happyGoto action_187 action_78 (51) = happyGoto action_188 action_78 (123) = happyGoto action_180 action_78 (125) = happyGoto action_68 action_78 (126) = happyGoto action_69 action_78 (139) = happyGoto action_70 action_78 (142) = happyGoto action_181 action_78 _ = happyFail action_79 (143) = happyShift action_34 action_79 (145) = happyShift action_36 action_79 (146) = happyShift action_71 action_79 (157) = happyShift action_182 action_79 (163) = happyShift action_183 action_79 (180) = happyShift action_47 action_79 (188) = happyShift action_51 action_79 (203) = happyShift action_59 action_79 (42) = happyGoto action_175 action_79 (43) = happyGoto action_176 action_79 (44) = happyGoto action_177 action_79 (45) = happyGoto action_178 action_79 (46) = happyGoto action_179 action_79 (123) = happyGoto action_180 action_79 (125) = happyGoto action_68 action_79 (126) = happyGoto action_69 action_79 (139) = happyGoto action_70 action_79 (142) = happyGoto action_181 action_79 _ = happyFail action_80 _ = happyReduce_249 action_81 (176) = happyShift action_111 action_81 _ = happyReduce_239 action_82 (160) = happyShift action_109 action_82 _ = happyReduce_241 action_83 (143) = happyShift action_34 action_83 (144) = happyShift action_35 action_83 (145) = happyShift action_36 action_83 (146) = happyShift action_37 action_83 (147) = happyShift action_98 action_83 (148) = happyShift action_99 action_83 (149) = happyShift action_100 action_83 (150) = happyShift action_101 action_83 (151) = happyShift action_102 action_83 (153) = happyShift action_39 action_83 (154) = happyShift action_40 action_83 (155) = happyShift action_41 action_83 (156) = happyShift action_42 action_83 (157) = happyShift action_83 action_83 (158) = happyShift action_103 action_83 (163) = happyShift action_44 action_83 (166) = happyShift action_45 action_83 (168) = happyShift action_104 action_83 (177) = happyShift action_46 action_83 (179) = happyShift action_105 action_83 (180) = happyShift action_47 action_83 (188) = happyShift action_51 action_83 (203) = happyShift action_59 action_83 (99) = happyGoto action_89 action_83 (100) = happyGoto action_85 action_83 (101) = happyGoto action_24 action_83 (102) = happyGoto action_25 action_83 (108) = happyGoto action_91 action_83 (113) = happyGoto action_81 action_83 (115) = happyGoto action_27 action_83 (122) = happyGoto action_28 action_83 (123) = happyGoto action_29 action_83 (124) = happyGoto action_30 action_83 (126) = happyGoto action_31 action_83 (127) = happyGoto action_93 action_83 (128) = happyGoto action_94 action_83 (129) = happyGoto action_95 action_83 (130) = happyGoto action_96 action_83 (131) = happyGoto action_97 action_83 (132) = happyGoto action_32 action_83 (133) = happyGoto action_33 action_83 _ = happyFail action_84 (165) = happyShift action_174 action_84 _ = happyReduce_263 action_85 (149) = happyShift action_100 action_85 (151) = happyShift action_102 action_85 (167) = happyShift action_173 action_85 (119) = happyGoto action_113 action_85 (127) = happyGoto action_114 action_85 (128) = happyGoto action_94 action_85 _ = happyReduce_233 action_86 (164) = happyShift action_172 action_86 _ = happyFail action_87 _ = happyReduce_261 action_88 (158) = happyShift action_171 action_88 _ = happyFail action_89 (158) = happyShift action_169 action_89 (165) = happyShift action_170 action_89 _ = happyFail action_90 (147) = happyShift action_117 action_90 (148) = happyShift action_99 action_90 (149) = happyShift action_100 action_90 (150) = happyShift action_101 action_90 (151) = happyShift action_102 action_90 (167) = happyShift action_118 action_90 (168) = happyShift action_104 action_90 (179) = happyShift action_105 action_90 (117) = happyGoto action_112 action_90 (119) = happyGoto action_113 action_90 (127) = happyGoto action_114 action_90 (128) = happyGoto action_94 action_90 (129) = happyGoto action_115 action_90 (130) = happyGoto action_96 action_90 (131) = happyGoto action_97 action_90 _ = happyReduce_233 action_91 (158) = happyShift action_168 action_91 _ = happyFail action_92 (143) = happyShift action_34 action_92 (144) = happyShift action_35 action_92 (145) = happyShift action_36 action_92 (146) = happyShift action_37 action_92 (153) = happyShift action_39 action_92 (154) = happyShift action_40 action_92 (155) = happyShift action_41 action_92 (156) = happyShift action_42 action_92 (157) = happyShift action_83 action_92 (163) = happyShift action_44 action_92 (166) = happyShift action_45 action_92 (176) = happyShift action_111 action_92 (177) = happyShift action_46 action_92 (180) = happyShift action_47 action_92 (188) = happyShift action_51 action_92 (203) = happyShift action_59 action_92 (102) = happyGoto action_107 action_92 (103) = happyGoto action_110 action_92 (113) = happyGoto action_81 action_92 (115) = happyGoto action_82 action_92 (122) = happyGoto action_28 action_92 (123) = happyGoto action_29 action_92 (124) = happyGoto action_30 action_92 (126) = happyGoto action_31 action_92 (132) = happyGoto action_32 action_92 (133) = happyGoto action_33 action_92 _ = happyReduce_239 action_93 (158) = happyShift action_167 action_93 _ = happyFail action_94 _ = happyReduce_302 action_95 (158) = happyShift action_166 action_95 _ = happyFail action_96 _ = happyReduce_305 action_97 _ = happyReduce_306 action_98 (153) = happyShift action_39 action_98 (154) = happyShift action_40 action_98 (133) = happyGoto action_106 action_98 _ = happyReduce_308 action_99 _ = happyReduce_307 action_100 _ = happyReduce_304 action_101 _ = happyReduce_311 action_102 _ = happyReduce_303 action_103 _ = happyReduce_242 action_104 _ = happyReduce_310 action_105 _ = happyReduce_309 action_106 _ = happyReduce_237 action_107 (143) = happyShift action_34 action_107 (144) = happyShift action_35 action_107 (145) = happyShift action_36 action_107 (146) = happyShift action_37 action_107 (153) = happyShift action_39 action_107 (154) = happyShift action_40 action_107 (155) = happyShift action_41 action_107 (156) = happyShift action_42 action_107 (157) = happyShift action_83 action_107 (163) = happyShift action_44 action_107 (166) = happyShift action_45 action_107 (177) = happyShift action_46 action_107 (180) = happyShift action_47 action_107 (188) = happyShift action_51 action_107 (203) = happyShift action_59 action_107 (102) = happyGoto action_164 action_107 (104) = happyGoto action_165 action_107 (113) = happyGoto action_81 action_107 (115) = happyGoto action_82 action_107 (122) = happyGoto action_28 action_107 (123) = happyGoto action_29 action_107 (124) = happyGoto action_30 action_107 (126) = happyGoto action_31 action_107 (132) = happyGoto action_32 action_107 (133) = happyGoto action_33 action_107 _ = happyReduce_251 action_108 _ = happyReduce_236 action_109 (143) = happyShift action_34 action_109 (144) = happyShift action_35 action_109 (157) = happyShift action_136 action_109 (180) = happyShift action_47 action_109 (188) = happyShift action_51 action_109 (203) = happyShift action_59 action_109 (105) = happyGoto action_160 action_109 (106) = happyGoto action_161 action_109 (107) = happyGoto action_162 action_109 (113) = happyGoto action_163 action_109 (122) = happyGoto action_28 action_109 (123) = happyGoto action_29 action_109 _ = happyReduce_253 action_110 _ = happyReduce_157 action_111 (143) = happyShift action_34 action_111 (144) = happyShift action_35 action_111 (145) = happyShift action_36 action_111 (146) = happyShift action_37 action_111 (153) = happyShift action_39 action_111 (154) = happyShift action_40 action_111 (155) = happyShift action_41 action_111 (156) = happyShift action_42 action_111 (157) = happyShift action_83 action_111 (163) = happyShift action_44 action_111 (166) = happyShift action_45 action_111 (177) = happyShift action_46 action_111 (180) = happyShift action_47 action_111 (188) = happyShift action_51 action_111 (203) = happyShift action_59 action_111 (102) = happyGoto action_159 action_111 (113) = happyGoto action_81 action_111 (115) = happyGoto action_82 action_111 (122) = happyGoto action_28 action_111 (123) = happyGoto action_29 action_111 (124) = happyGoto action_30 action_111 (126) = happyGoto action_31 action_111 (132) = happyGoto action_32 action_111 (133) = happyGoto action_33 action_111 _ = happyFail action_112 (143) = happyShift action_34 action_112 (144) = happyShift action_35 action_112 (145) = happyShift action_36 action_112 (146) = happyShift action_37 action_112 (147) = happyShift action_38 action_112 (153) = happyShift action_39 action_112 (154) = happyShift action_40 action_112 (155) = happyShift action_41 action_112 (156) = happyShift action_42 action_112 (157) = happyShift action_83 action_112 (163) = happyShift action_44 action_112 (166) = happyShift action_45 action_112 (177) = happyShift action_46 action_112 (180) = happyShift action_47 action_112 (188) = happyShift action_51 action_112 (203) = happyShift action_59 action_112 (100) = happyGoto action_158 action_112 (101) = happyGoto action_24 action_112 (102) = happyGoto action_25 action_112 (113) = happyGoto action_81 action_112 (115) = happyGoto action_27 action_112 (122) = happyGoto action_28 action_112 (123) = happyGoto action_29 action_112 (124) = happyGoto action_30 action_112 (126) = happyGoto action_31 action_112 (132) = happyGoto action_32 action_112 (133) = happyGoto action_33 action_112 _ = happyFail action_113 (143) = happyShift action_34 action_113 (144) = happyShift action_35 action_113 (145) = happyShift action_36 action_113 (146) = happyShift action_37 action_113 (147) = happyShift action_38 action_113 (153) = happyShift action_39 action_113 (154) = happyShift action_40 action_113 (155) = happyShift action_41 action_113 (156) = happyShift action_42 action_113 (157) = happyShift action_83 action_113 (163) = happyShift action_44 action_113 (166) = happyShift action_45 action_113 (177) = happyShift action_46 action_113 (180) = happyShift action_47 action_113 (188) = happyShift action_51 action_113 (203) = happyShift action_59 action_113 (101) = happyGoto action_157 action_113 (102) = happyGoto action_25 action_113 (113) = happyGoto action_81 action_113 (115) = happyGoto action_27 action_113 (122) = happyGoto action_28 action_113 (123) = happyGoto action_29 action_113 (124) = happyGoto action_30 action_113 (126) = happyGoto action_31 action_113 (132) = happyGoto action_32 action_113 (133) = happyGoto action_33 action_113 _ = happyFail action_114 _ = happyReduce_285 action_115 _ = happyReduce_281 action_116 (171) = happyShift action_152 action_116 (173) = happyShift action_153 action_116 (72) = happyGoto action_156 action_116 (73) = happyGoto action_150 action_116 (74) = happyGoto action_151 action_116 _ = happyFail action_117 _ = happyReduce_308 action_118 (143) = happyShift action_34 action_118 (144) = happyShift action_35 action_118 (145) = happyShift action_36 action_118 (146) = happyShift action_37 action_118 (180) = happyShift action_47 action_118 (188) = happyShift action_51 action_118 (203) = happyShift action_59 action_118 (122) = happyGoto action_154 action_118 (123) = happyGoto action_29 action_118 (124) = happyGoto action_155 action_118 (126) = happyGoto action_31 action_118 _ = happyFail action_119 (171) = happyShift action_152 action_119 (173) = happyShift action_153 action_119 (72) = happyGoto action_149 action_119 (73) = happyGoto action_150 action_119 (74) = happyGoto action_151 action_119 _ = happyFail action_120 (170) = happyShift action_148 action_120 _ = happyFail action_121 (143) = happyShift action_34 action_121 (157) = happyShift action_147 action_121 (180) = happyShift action_47 action_121 (188) = happyShift action_51 action_121 (203) = happyShift action_59 action_121 (112) = happyGoto action_145 action_121 (123) = happyGoto action_146 action_121 _ = happyFail action_122 (153) = happyShift action_144 action_122 (28) = happyGoto action_143 action_122 _ = happyReduce_56 action_123 _ = happyReduce_6 action_124 (143) = happyShift action_34 action_124 (144) = happyShift action_35 action_124 (145) = happyShift action_36 action_124 (146) = happyShift action_37 action_124 (147) = happyShift action_38 action_124 (153) = happyShift action_39 action_124 (154) = happyShift action_40 action_124 (155) = happyShift action_41 action_124 (156) = happyShift action_42 action_124 (157) = happyShift action_43 action_124 (163) = happyShift action_44 action_124 (166) = happyShift action_45 action_124 (177) = happyShift action_46 action_124 (180) = happyShift action_47 action_124 (182) = happyShift action_48 action_124 (183) = happyShift action_49 action_124 (184) = happyShift action_50 action_124 (188) = happyShift action_51 action_124 (192) = happyShift action_53 action_124 (193) = happyShift action_54 action_124 (194) = happyShift action_55 action_124 (195) = happyShift action_56 action_124 (198) = happyShift action_57 action_124 (201) = happyShift action_58 action_124 (203) = happyShift action_59 action_124 (204) = happyShift action_60 action_124 (27) = happyGoto action_15 action_124 (29) = happyGoto action_16 action_124 (31) = happyGoto action_142 action_124 (38) = happyGoto action_18 action_124 (40) = happyGoto action_19 action_124 (41) = happyGoto action_20 action_124 (69) = happyGoto action_21 action_124 (70) = happyGoto action_22 action_124 (100) = happyGoto action_23 action_124 (101) = happyGoto action_24 action_124 (102) = happyGoto action_25 action_124 (113) = happyGoto action_26 action_124 (115) = happyGoto action_27 action_124 (122) = happyGoto action_28 action_124 (123) = happyGoto action_29 action_124 (124) = happyGoto action_30 action_124 (126) = happyGoto action_31 action_124 (132) = happyGoto action_32 action_124 (133) = happyGoto action_33 action_124 _ = happyReduce_9 action_125 _ = happyReduce_7 action_126 (143) = happyShift action_34 action_126 (144) = happyShift action_35 action_126 (145) = happyShift action_36 action_126 (146) = happyShift action_37 action_126 (147) = happyShift action_38 action_126 (153) = happyShift action_39 action_126 (154) = happyShift action_40 action_126 (155) = happyShift action_41 action_126 (156) = happyShift action_42 action_126 (157) = happyShift action_43 action_126 (163) = happyShift action_44 action_126 (166) = happyShift action_45 action_126 (177) = happyShift action_46 action_126 (180) = happyShift action_47 action_126 (182) = happyShift action_48 action_126 (183) = happyShift action_49 action_126 (184) = happyShift action_50 action_126 (188) = happyShift action_51 action_126 (190) = happyShift action_52 action_126 (192) = happyShift action_53 action_126 (193) = happyShift action_54 action_126 (194) = happyShift action_55 action_126 (195) = happyShift action_56 action_126 (198) = happyShift action_57 action_126 (201) = happyShift action_58 action_126 (203) = happyShift action_59 action_126 (204) = happyShift action_60 action_126 (16) = happyGoto action_140 action_126 (26) = happyGoto action_141 action_126 (27) = happyGoto action_15 action_126 (29) = happyGoto action_16 action_126 (31) = happyGoto action_17 action_126 (38) = happyGoto action_18 action_126 (40) = happyGoto action_19 action_126 (41) = happyGoto action_20 action_126 (69) = happyGoto action_21 action_126 (70) = happyGoto action_22 action_126 (100) = happyGoto action_23 action_126 (101) = happyGoto action_24 action_126 (102) = happyGoto action_25 action_126 (113) = happyGoto action_26 action_126 (115) = happyGoto action_27 action_126 (122) = happyGoto action_28 action_126 (123) = happyGoto action_29 action_126 (124) = happyGoto action_30 action_126 (126) = happyGoto action_31 action_126 (132) = happyGoto action_32 action_126 (133) = happyGoto action_33 action_126 _ = happyReduce_9 action_127 _ = happyReduce_3 action_128 (202) = happyShift action_139 action_128 _ = happyFail action_129 _ = happyReduce_11 action_130 (143) = happyShift action_34 action_130 (144) = happyShift action_35 action_130 (145) = happyShift action_36 action_130 (146) = happyShift action_71 action_130 (157) = happyShift action_136 action_130 (158) = happyShift action_137 action_130 (180) = happyShift action_47 action_130 (188) = happyShift action_51 action_130 (197) = happyShift action_138 action_130 (203) = happyShift action_59 action_130 (11) = happyGoto action_131 action_130 (12) = happyGoto action_132 action_130 (113) = happyGoto action_133 action_130 (122) = happyGoto action_28 action_130 (123) = happyGoto action_29 action_130 (125) = happyGoto action_134 action_130 (126) = happyGoto action_69 action_130 (139) = happyGoto action_70 action_130 (140) = happyGoto action_135 action_130 _ = happyFail action_131 (165) = happyShift action_273 action_131 (10) = happyGoto action_272 action_131 _ = happyReduce_16 action_132 _ = happyReduce_18 action_133 _ = happyReduce_19 action_134 _ = happyReduce_324 action_135 (157) = happyShift action_271 action_135 _ = happyReduce_20 action_136 (147) = happyShift action_117 action_136 (148) = happyShift action_99 action_136 (150) = happyShift action_101 action_136 (168) = happyShift action_104 action_136 (179) = happyShift action_105 action_136 (129) = happyGoto action_95 action_136 (130) = happyGoto action_96 action_136 (131) = happyGoto action_97 action_136 _ = happyFail action_137 _ = happyReduce_14 action_138 (145) = happyShift action_10 action_138 (137) = happyGoto action_270 action_138 _ = happyFail action_139 (160) = happyShift action_7 action_139 (5) = happyGoto action_269 action_139 (135) = happyGoto action_6 action_139 _ = happyReduce_318 action_140 _ = happyReduce_29 action_141 (159) = happyShift action_124 action_141 (7) = happyGoto action_268 action_141 _ = happyReduce_10 action_142 _ = happyReduce_53 action_143 (147) = happyShift action_117 action_143 (148) = happyShift action_99 action_143 (149) = happyShift action_100 action_143 (167) = happyShift action_267 action_143 (168) = happyShift action_104 action_143 (179) = happyShift action_105 action_143 (30) = happyGoto action_261 action_143 (116) = happyGoto action_262 action_143 (118) = happyGoto action_263 action_143 (120) = happyGoto action_264 action_143 (128) = happyGoto action_265 action_143 (130) = happyGoto action_266 action_143 _ = happyFail action_144 _ = happyReduce_57 action_145 _ = happyReduce_89 action_146 _ = happyReduce_271 action_147 (147) = happyShift action_117 action_147 (148) = happyShift action_99 action_147 (168) = happyShift action_104 action_147 (179) = happyShift action_105 action_147 (130) = happyGoto action_260 action_147 _ = happyFail action_148 (143) = happyShift action_34 action_148 (145) = happyShift action_36 action_148 (146) = happyShift action_71 action_148 (157) = happyShift action_182 action_148 (163) = happyShift action_183 action_148 (180) = happyShift action_47 action_148 (188) = happyShift action_51 action_148 (203) = happyShift action_59 action_148 (42) = happyGoto action_175 action_148 (43) = happyGoto action_176 action_148 (44) = happyGoto action_177 action_148 (45) = happyGoto action_178 action_148 (46) = happyGoto action_259 action_148 (123) = happyGoto action_180 action_148 (125) = happyGoto action_68 action_148 (126) = happyGoto action_69 action_148 (139) = happyGoto action_70 action_148 (142) = happyGoto action_181 action_148 _ = happyFail action_149 (202) = happyShift action_232 action_149 (71) = happyGoto action_258 action_149 _ = happyReduce_161 action_150 (173) = happyShift action_153 action_150 (74) = happyGoto action_257 action_150 _ = happyReduce_163 action_151 _ = happyReduce_165 action_152 (143) = happyShift action_34 action_152 (144) = happyShift action_35 action_152 (145) = happyShift action_36 action_152 (146) = happyShift action_37 action_152 (147) = happyShift action_245 action_152 (152) = happyShift action_246 action_152 (153) = happyShift action_39 action_152 (154) = happyShift action_40 action_152 (155) = happyShift action_41 action_152 (156) = happyShift action_42 action_152 (157) = happyShift action_247 action_152 (163) = happyShift action_248 action_152 (166) = happyShift action_249 action_152 (172) = happyShift action_250 action_152 (177) = happyShift action_251 action_152 (180) = happyShift action_47 action_152 (181) = happyShift action_252 action_152 (186) = happyShift action_253 action_152 (188) = happyShift action_51 action_152 (189) = happyShift action_254 action_152 (196) = happyShift action_255 action_152 (203) = happyShift action_59 action_152 (75) = happyGoto action_256 action_152 (76) = happyGoto action_236 action_152 (77) = happyGoto action_237 action_152 (78) = happyGoto action_238 action_152 (79) = happyGoto action_239 action_152 (80) = happyGoto action_240 action_152 (111) = happyGoto action_241 action_152 (113) = happyGoto action_242 action_152 (115) = happyGoto action_243 action_152 (122) = happyGoto action_28 action_152 (123) = happyGoto action_29 action_152 (124) = happyGoto action_30 action_152 (126) = happyGoto action_31 action_152 (132) = happyGoto action_244 action_152 (133) = happyGoto action_33 action_152 _ = happyFail action_153 (143) = happyShift action_34 action_153 (144) = happyShift action_35 action_153 (145) = happyShift action_36 action_153 (146) = happyShift action_37 action_153 (147) = happyShift action_245 action_153 (152) = happyShift action_246 action_153 (153) = happyShift action_39 action_153 (154) = happyShift action_40 action_153 (155) = happyShift action_41 action_153 (156) = happyShift action_42 action_153 (157) = happyShift action_247 action_153 (163) = happyShift action_248 action_153 (166) = happyShift action_249 action_153 (172) = happyShift action_250 action_153 (177) = happyShift action_251 action_153 (180) = happyShift action_47 action_153 (181) = happyShift action_252 action_153 (186) = happyShift action_253 action_153 (188) = happyShift action_51 action_153 (189) = happyShift action_254 action_153 (196) = happyShift action_255 action_153 (203) = happyShift action_59 action_153 (75) = happyGoto action_235 action_153 (76) = happyGoto action_236 action_153 (77) = happyGoto action_237 action_153 (78) = happyGoto action_238 action_153 (79) = happyGoto action_239 action_153 (80) = happyGoto action_240 action_153 (111) = happyGoto action_241 action_153 (113) = happyGoto action_242 action_153 (115) = happyGoto action_243 action_153 (122) = happyGoto action_28 action_153 (123) = happyGoto action_29 action_153 (124) = happyGoto action_30 action_153 (126) = happyGoto action_31 action_153 (132) = happyGoto action_244 action_153 (133) = happyGoto action_33 action_153 _ = happyFail action_154 (167) = happyShift action_234 action_154 _ = happyFail action_155 (167) = happyShift action_233 action_155 _ = happyFail action_156 (202) = happyShift action_232 action_156 (71) = happyGoto action_231 action_156 _ = happyReduce_161 action_157 _ = happyReduce_235 action_158 (149) = happyShift action_100 action_158 (151) = happyShift action_102 action_158 (167) = happyShift action_173 action_158 (119) = happyGoto action_113 action_158 (127) = happyGoto action_114 action_158 (128) = happyGoto action_94 action_158 _ = happyReduce_158 action_159 _ = happyReduce_240 action_160 (161) = happyShift action_230 action_160 _ = happyFail action_161 _ = happyReduce_254 action_162 (165) = happyShift action_229 action_162 _ = happyReduce_256 action_163 (171) = happyShift action_228 action_163 _ = happyFail action_164 (143) = happyShift action_34 action_164 (144) = happyShift action_35 action_164 (145) = happyShift action_36 action_164 (146) = happyShift action_37 action_164 (153) = happyShift action_39 action_164 (154) = happyShift action_40 action_164 (155) = happyShift action_41 action_164 (156) = happyShift action_42 action_164 (157) = happyShift action_83 action_164 (163) = happyShift action_44 action_164 (166) = happyShift action_45 action_164 (177) = happyShift action_46 action_164 (180) = happyShift action_47 action_164 (188) = happyShift action_51 action_164 (203) = happyShift action_59 action_164 (102) = happyGoto action_164 action_164 (104) = happyGoto action_227 action_164 (113) = happyGoto action_81 action_164 (115) = happyGoto action_82 action_164 (122) = happyGoto action_28 action_164 (123) = happyGoto action_29 action_164 (124) = happyGoto action_30 action_164 (126) = happyGoto action_31 action_164 (132) = happyGoto action_32 action_164 (133) = happyGoto action_33 action_164 _ = happyReduce_251 action_165 _ = happyReduce_250 action_166 _ = happyReduce_274 action_167 _ = happyReduce_278 action_168 _ = happyReduce_247 action_169 _ = happyReduce_246 action_170 (143) = happyShift action_34 action_170 (144) = happyShift action_35 action_170 (145) = happyShift action_36 action_170 (146) = happyShift action_37 action_170 (147) = happyShift action_38 action_170 (153) = happyShift action_39 action_170 (154) = happyShift action_40 action_170 (155) = happyShift action_41 action_170 (156) = happyShift action_42 action_170 (157) = happyShift action_83 action_170 (163) = happyShift action_44 action_170 (166) = happyShift action_45 action_170 (177) = happyShift action_46 action_170 (180) = happyShift action_47 action_170 (188) = happyShift action_51 action_170 (203) = happyShift action_59 action_170 (99) = happyGoto action_225 action_170 (100) = happyGoto action_85 action_170 (101) = happyGoto action_24 action_170 (102) = happyGoto action_25 action_170 (108) = happyGoto action_226 action_170 (113) = happyGoto action_81 action_170 (115) = happyGoto action_27 action_170 (122) = happyGoto action_28 action_170 (123) = happyGoto action_29 action_170 (124) = happyGoto action_30 action_170 (126) = happyGoto action_31 action_170 (132) = happyGoto action_32 action_170 (133) = happyGoto action_33 action_170 _ = happyFail action_171 (143) = happyShift action_34 action_171 (144) = happyShift action_35 action_171 (145) = happyShift action_36 action_171 (146) = happyShift action_37 action_171 (153) = happyShift action_39 action_171 (154) = happyShift action_40 action_171 (155) = happyShift action_41 action_171 (156) = happyShift action_42 action_171 (157) = happyShift action_83 action_171 (163) = happyShift action_44 action_171 (166) = happyShift action_45 action_171 (177) = happyShift action_46 action_171 (180) = happyShift action_47 action_171 (188) = happyShift action_51 action_171 (203) = happyShift action_59 action_171 (102) = happyGoto action_164 action_171 (104) = happyGoto action_224 action_171 (113) = happyGoto action_81 action_171 (115) = happyGoto action_82 action_171 (122) = happyGoto action_28 action_171 (123) = happyGoto action_29 action_171 (124) = happyGoto action_30 action_171 (126) = happyGoto action_31 action_171 (132) = happyGoto action_32 action_171 (133) = happyGoto action_33 action_171 _ = happyReduce_251 action_172 _ = happyReduce_248 action_173 (145) = happyShift action_36 action_173 (146) = happyShift action_37 action_173 (124) = happyGoto action_155 action_173 (126) = happyGoto action_31 action_173 _ = happyFail action_174 (143) = happyShift action_34 action_174 (144) = happyShift action_35 action_174 (145) = happyShift action_36 action_174 (146) = happyShift action_37 action_174 (147) = happyShift action_38 action_174 (153) = happyShift action_39 action_174 (154) = happyShift action_40 action_174 (155) = happyShift action_41 action_174 (156) = happyShift action_42 action_174 (157) = happyShift action_83 action_174 (163) = happyShift action_44 action_174 (166) = happyShift action_45 action_174 (177) = happyShift action_46 action_174 (180) = happyShift action_47 action_174 (188) = happyShift action_51 action_174 (203) = happyShift action_59 action_174 (99) = happyGoto action_84 action_174 (100) = happyGoto action_85 action_174 (101) = happyGoto action_24 action_174 (102) = happyGoto action_25 action_174 (109) = happyGoto action_223 action_174 (110) = happyGoto action_87 action_174 (113) = happyGoto action_81 action_174 (115) = happyGoto action_27 action_174 (122) = happyGoto action_28 action_174 (123) = happyGoto action_29 action_174 (124) = happyGoto action_30 action_174 (126) = happyGoto action_31 action_174 (132) = happyGoto action_32 action_174 (133) = happyGoto action_33 action_174 _ = happyReduce_260 action_175 (178) = happyShift action_222 action_175 _ = happyReduce_106 action_176 (143) = happyShift action_34 action_176 (145) = happyShift action_36 action_176 (146) = happyShift action_71 action_176 (157) = happyShift action_182 action_176 (163) = happyShift action_183 action_176 (175) = happyShift action_221 action_176 (180) = happyShift action_47 action_176 (188) = happyShift action_51 action_176 (203) = happyShift action_59 action_176 (44) = happyGoto action_220 action_176 (45) = happyGoto action_178 action_176 (123) = happyGoto action_180 action_176 (125) = happyGoto action_68 action_176 (126) = happyGoto action_69 action_176 (139) = happyGoto action_70 action_176 (142) = happyGoto action_181 action_176 _ = happyReduce_92 action_177 _ = happyReduce_94 action_178 _ = happyReduce_95 action_179 (173) = happyShift action_219 action_179 (32) = happyGoto action_218 action_179 _ = happyReduce_72 action_180 _ = happyReduce_326 action_181 _ = happyReduce_96 action_182 (143) = happyShift action_34 action_182 (145) = happyShift action_36 action_182 (146) = happyShift action_71 action_182 (157) = happyShift action_182 action_182 (158) = happyShift action_196 action_182 (163) = happyShift action_183 action_182 (165) = happyShift action_197 action_182 (175) = happyShift action_198 action_182 (180) = happyShift action_47 action_182 (188) = happyShift action_51 action_182 (203) = happyShift action_59 action_182 (42) = happyGoto action_216 action_182 (43) = happyGoto action_176 action_182 (44) = happyGoto action_177 action_182 (45) = happyGoto action_178 action_182 (47) = happyGoto action_217 action_182 (81) = happyGoto action_195 action_182 (123) = happyGoto action_180 action_182 (125) = happyGoto action_68 action_182 (126) = happyGoto action_69 action_182 (139) = happyGoto action_70 action_182 (142) = happyGoto action_181 action_182 _ = happyFail action_183 (143) = happyShift action_34 action_183 (145) = happyShift action_36 action_183 (146) = happyShift action_71 action_183 (157) = happyShift action_182 action_183 (163) = happyShift action_183 action_183 (164) = happyShift action_194 action_183 (180) = happyShift action_47 action_183 (188) = happyShift action_51 action_183 (203) = happyShift action_59 action_183 (42) = happyGoto action_215 action_183 (43) = happyGoto action_176 action_183 (44) = happyGoto action_177 action_183 (45) = happyGoto action_178 action_183 (123) = happyGoto action_180 action_183 (125) = happyGoto action_68 action_183 (126) = happyGoto action_69 action_183 (139) = happyGoto action_70 action_183 (142) = happyGoto action_181 action_183 _ = happyFail action_184 (178) = happyShift action_214 action_184 _ = happyFail action_185 (143) = happyShift action_34 action_185 (145) = happyReduce_95 action_185 (146) = happyReduce_95 action_185 (157) = happyReduce_95 action_185 (163) = happyReduce_95 action_185 (175) = happyReduce_95 action_185 (178) = happyReduce_95 action_185 (180) = happyShift action_47 action_185 (188) = happyShift action_51 action_185 (203) = happyShift action_59 action_185 (50) = happyGoto action_200 action_185 (123) = happyGoto action_180 action_185 (142) = happyGoto action_201 action_185 _ = happyReduce_112 action_186 (171) = happyShift action_213 action_186 _ = happyReduce_115 action_187 _ = happyReduce_110 action_188 _ = happyReduce_69 action_189 _ = happyReduce_68 action_190 (145) = happyShift action_10 action_190 (137) = happyGoto action_212 action_190 _ = happyFail action_191 _ = happyReduce_32 action_192 (202) = happyShift action_211 action_192 (67) = happyGoto action_210 action_192 _ = happyReduce_152 action_193 (171) = happyShift action_209 action_193 _ = happyFail action_194 _ = happyReduce_102 action_195 (158) = happyShift action_207 action_195 (165) = happyShift action_208 action_195 _ = happyFail action_196 _ = happyReduce_101 action_197 _ = happyReduce_194 action_198 (158) = happyShift action_206 action_198 _ = happyFail action_199 (171) = happyShift action_205 action_199 _ = happyFail action_200 (143) = happyShift action_34 action_200 (180) = happyShift action_47 action_200 (188) = happyShift action_51 action_200 (203) = happyShift action_59 action_200 (123) = happyGoto action_180 action_200 (142) = happyGoto action_204 action_200 _ = happyReduce_111 action_201 _ = happyReduce_114 action_202 (170) = happyShift action_203 action_202 _ = happyFail action_203 (143) = happyShift action_34 action_203 (145) = happyShift action_36 action_203 (146) = happyShift action_71 action_203 (157) = happyShift action_182 action_203 (163) = happyShift action_183 action_203 (180) = happyShift action_47 action_203 (188) = happyShift action_51 action_203 (203) = happyShift action_59 action_203 (42) = happyGoto action_346 action_203 (43) = happyGoto action_176 action_203 (44) = happyGoto action_177 action_203 (45) = happyGoto action_178 action_203 (123) = happyGoto action_180 action_203 (125) = happyGoto action_68 action_203 (126) = happyGoto action_69 action_203 (139) = happyGoto action_70 action_203 (142) = happyGoto action_181 action_203 _ = happyFail action_204 _ = happyReduce_113 action_205 (143) = happyShift action_34 action_205 (145) = happyShift action_36 action_205 (146) = happyShift action_71 action_205 (157) = happyShift action_182 action_205 (163) = happyShift action_183 action_205 (180) = happyShift action_47 action_205 (188) = happyShift action_51 action_205 (203) = happyShift action_59 action_205 (42) = happyGoto action_345 action_205 (43) = happyGoto action_176 action_205 (44) = happyGoto action_177 action_205 (45) = happyGoto action_178 action_205 (123) = happyGoto action_180 action_205 (125) = happyGoto action_68 action_205 (126) = happyGoto action_69 action_205 (139) = happyGoto action_70 action_205 (142) = happyGoto action_181 action_205 _ = happyFail action_206 _ = happyReduce_103 action_207 _ = happyReduce_104 action_208 _ = happyReduce_193 action_209 (53) = happyGoto action_344 action_209 (134) = happyGoto action_339 action_209 _ = happyReduce_317 action_210 _ = happyReduce_67 action_211 (160) = happyShift action_343 action_211 (135) = happyGoto action_342 action_211 _ = happyReduce_318 action_212 (180) = happyShift action_341 action_212 (18) = happyGoto action_340 action_212 _ = happyReduce_35 action_213 (52) = happyGoto action_337 action_213 (53) = happyGoto action_338 action_213 (134) = happyGoto action_339 action_213 _ = happyReduce_317 action_214 (145) = happyShift action_36 action_214 (146) = happyShift action_71 action_214 (157) = happyShift action_72 action_214 (163) = happyShift action_73 action_214 (45) = happyGoto action_66 action_214 (49) = happyGoto action_336 action_214 (125) = happyGoto action_68 action_214 (126) = happyGoto action_69 action_214 (139) = happyGoto action_70 action_214 _ = happyFail action_215 (164) = happyShift action_335 action_215 _ = happyFail action_216 (158) = happyShift action_333 action_216 (165) = happyShift action_334 action_216 _ = happyFail action_217 (158) = happyShift action_331 action_217 (165) = happyShift action_332 action_217 _ = happyFail action_218 (202) = happyShift action_330 action_218 (63) = happyGoto action_329 action_218 _ = happyReduce_142 action_219 (143) = happyShift action_34 action_219 (180) = happyShift action_47 action_219 (188) = happyShift action_51 action_219 (203) = happyShift action_59 action_219 (33) = happyGoto action_325 action_219 (34) = happyGoto action_326 action_219 (35) = happyGoto action_327 action_219 (50) = happyGoto action_328 action_219 (123) = happyGoto action_180 action_219 (142) = happyGoto action_201 action_219 _ = happyReduce_77 action_220 _ = happyReduce_93 action_221 (143) = happyShift action_34 action_221 (145) = happyShift action_36 action_221 (146) = happyShift action_71 action_221 (157) = happyShift action_182 action_221 (163) = happyShift action_183 action_221 (180) = happyShift action_47 action_221 (188) = happyShift action_51 action_221 (203) = happyShift action_59 action_221 (42) = happyGoto action_324 action_221 (43) = happyGoto action_176 action_221 (44) = happyGoto action_177 action_221 (45) = happyGoto action_178 action_221 (123) = happyGoto action_180 action_221 (125) = happyGoto action_68 action_221 (126) = happyGoto action_69 action_221 (139) = happyGoto action_70 action_221 (142) = happyGoto action_181 action_221 _ = happyFail action_222 (143) = happyShift action_34 action_222 (145) = happyShift action_36 action_222 (146) = happyShift action_71 action_222 (157) = happyShift action_182 action_222 (163) = happyShift action_183 action_222 (180) = happyShift action_47 action_222 (188) = happyShift action_51 action_222 (203) = happyShift action_59 action_222 (42) = happyGoto action_323 action_222 (43) = happyGoto action_176 action_222 (44) = happyGoto action_177 action_222 (45) = happyGoto action_178 action_222 (123) = happyGoto action_180 action_222 (125) = happyGoto action_68 action_222 (126) = happyGoto action_69 action_222 (139) = happyGoto action_70 action_222 (142) = happyGoto action_181 action_222 _ = happyFail action_223 _ = happyReduce_262 action_224 _ = happyReduce_159 action_225 (165) = happyShift action_170 action_225 _ = happyReduce_259 action_226 _ = happyReduce_258 action_227 _ = happyReduce_252 action_228 (143) = happyShift action_34 action_228 (144) = happyShift action_35 action_228 (145) = happyShift action_36 action_228 (146) = happyShift action_37 action_228 (147) = happyShift action_38 action_228 (153) = happyShift action_39 action_228 (154) = happyShift action_40 action_228 (155) = happyShift action_41 action_228 (156) = happyShift action_42 action_228 (157) = happyShift action_83 action_228 (163) = happyShift action_44 action_228 (166) = happyShift action_45 action_228 (177) = happyShift action_46 action_228 (180) = happyShift action_47 action_228 (188) = happyShift action_51 action_228 (203) = happyShift action_59 action_228 (99) = happyGoto action_322 action_228 (100) = happyGoto action_85 action_228 (101) = happyGoto action_24 action_228 (102) = happyGoto action_25 action_228 (113) = happyGoto action_81 action_228 (115) = happyGoto action_27 action_228 (122) = happyGoto action_28 action_228 (123) = happyGoto action_29 action_228 (124) = happyGoto action_30 action_228 (126) = happyGoto action_31 action_228 (132) = happyGoto action_32 action_228 (133) = happyGoto action_33 action_228 _ = happyFail action_229 (143) = happyShift action_34 action_229 (144) = happyShift action_35 action_229 (157) = happyShift action_136 action_229 (180) = happyShift action_47 action_229 (188) = happyShift action_51 action_229 (203) = happyShift action_59 action_229 (106) = happyGoto action_321 action_229 (107) = happyGoto action_162 action_229 (113) = happyGoto action_163 action_229 (122) = happyGoto action_28 action_229 (123) = happyGoto action_29 action_229 _ = happyFail action_230 _ = happyReduce_243 action_231 _ = happyReduce_156 action_232 (160) = happyShift action_289 action_232 (39) = happyGoto action_320 action_232 (135) = happyGoto action_288 action_232 _ = happyReduce_318 action_233 _ = happyReduce_286 action_234 _ = happyReduce_282 action_235 (134) = happyGoto action_319 action_235 _ = happyReduce_317 action_236 (147) = happyShift action_117 action_236 (148) = happyShift action_99 action_236 (149) = happyShift action_100 action_236 (150) = happyShift action_101 action_236 (151) = happyShift action_102 action_236 (167) = happyShift action_118 action_236 (168) = happyShift action_104 action_236 (170) = happyShift action_318 action_236 (179) = happyShift action_105 action_236 (117) = happyGoto action_305 action_236 (119) = happyGoto action_306 action_236 (121) = happyGoto action_317 action_236 (127) = happyGoto action_114 action_236 (128) = happyGoto action_94 action_236 (129) = happyGoto action_115 action_236 (130) = happyGoto action_96 action_236 (131) = happyGoto action_97 action_236 _ = happyReduce_168 action_237 _ = happyReduce_169 action_238 (143) = happyShift action_34 action_238 (144) = happyShift action_35 action_238 (145) = happyShift action_36 action_238 (146) = happyShift action_37 action_238 (152) = happyShift action_246 action_238 (153) = happyShift action_39 action_238 (154) = happyShift action_40 action_238 (155) = happyShift action_41 action_238 (156) = happyShift action_42 action_238 (157) = happyShift action_247 action_238 (163) = happyShift action_248 action_238 (166) = happyShift action_249 action_238 (177) = happyShift action_251 action_238 (180) = happyShift action_47 action_238 (188) = happyShift action_51 action_238 (203) = happyShift action_59 action_238 (79) = happyGoto action_316 action_238 (80) = happyGoto action_240 action_238 (111) = happyGoto action_241 action_238 (113) = happyGoto action_242 action_238 (115) = happyGoto action_243 action_238 (122) = happyGoto action_28 action_238 (123) = happyGoto action_29 action_238 (124) = happyGoto action_30 action_238 (126) = happyGoto action_31 action_238 (132) = happyGoto action_244 action_238 (133) = happyGoto action_33 action_238 _ = happyReduce_177 action_239 (160) = happyShift action_315 action_239 _ = happyReduce_179 action_240 _ = happyReduce_181 action_241 _ = happyReduce_183 action_242 (176) = happyShift action_314 action_242 _ = happyReduce_182 action_243 _ = happyReduce_270 action_244 _ = happyReduce_184 action_245 (143) = happyShift action_34 action_245 (144) = happyShift action_35 action_245 (145) = happyShift action_36 action_245 (146) = happyShift action_37 action_245 (152) = happyShift action_246 action_245 (153) = happyShift action_39 action_245 (154) = happyShift action_40 action_245 (155) = happyShift action_41 action_245 (156) = happyShift action_42 action_245 (157) = happyShift action_247 action_245 (163) = happyShift action_248 action_245 (166) = happyShift action_249 action_245 (177) = happyShift action_251 action_245 (180) = happyShift action_47 action_245 (188) = happyShift action_51 action_245 (203) = happyShift action_59 action_245 (78) = happyGoto action_313 action_245 (79) = happyGoto action_239 action_245 (80) = happyGoto action_240 action_245 (111) = happyGoto action_241 action_245 (113) = happyGoto action_242 action_245 (115) = happyGoto action_243 action_245 (122) = happyGoto action_28 action_245 (123) = happyGoto action_29 action_245 (124) = happyGoto action_30 action_245 (126) = happyGoto action_31 action_245 (132) = happyGoto action_244 action_245 (133) = happyGoto action_33 action_245 _ = happyFail action_246 (168) = happyShift action_312 action_246 _ = happyFail action_247 (143) = happyShift action_34 action_247 (144) = happyShift action_35 action_247 (145) = happyShift action_36 action_247 (146) = happyShift action_37 action_247 (147) = happyShift action_310 action_247 (148) = happyShift action_99 action_247 (149) = happyShift action_100 action_247 (150) = happyShift action_101 action_247 (151) = happyShift action_102 action_247 (152) = happyShift action_246 action_247 (153) = happyShift action_39 action_247 (154) = happyShift action_40 action_247 (155) = happyShift action_41 action_247 (156) = happyShift action_42 action_247 (157) = happyShift action_247 action_247 (158) = happyShift action_311 action_247 (163) = happyShift action_248 action_247 (165) = happyShift action_197 action_247 (166) = happyShift action_249 action_247 (167) = happyShift action_118 action_247 (168) = happyShift action_104 action_247 (172) = happyShift action_250 action_247 (177) = happyShift action_251 action_247 (179) = happyShift action_105 action_247 (180) = happyShift action_47 action_247 (181) = happyShift action_252 action_247 (186) = happyShift action_253 action_247 (188) = happyShift action_51 action_247 (189) = happyShift action_254 action_247 (196) = happyShift action_255 action_247 (203) = happyShift action_59 action_247 (75) = happyGoto action_301 action_247 (76) = happyGoto action_302 action_247 (77) = happyGoto action_237 action_247 (78) = happyGoto action_238 action_247 (79) = happyGoto action_239 action_247 (80) = happyGoto action_240 action_247 (81) = happyGoto action_303 action_247 (82) = happyGoto action_304 action_247 (111) = happyGoto action_241 action_247 (113) = happyGoto action_242 action_247 (115) = happyGoto action_243 action_247 (117) = happyGoto action_305 action_247 (119) = happyGoto action_306 action_247 (121) = happyGoto action_307 action_247 (122) = happyGoto action_28 action_247 (123) = happyGoto action_29 action_247 (124) = happyGoto action_30 action_247 (126) = happyGoto action_31 action_247 (127) = happyGoto action_308 action_247 (128) = happyGoto action_94 action_247 (129) = happyGoto action_309 action_247 (130) = happyGoto action_96 action_247 (131) = happyGoto action_97 action_247 (132) = happyGoto action_244 action_247 (133) = happyGoto action_33 action_247 _ = happyFail action_248 (143) = happyShift action_34 action_248 (144) = happyShift action_35 action_248 (145) = happyShift action_36 action_248 (146) = happyShift action_37 action_248 (147) = happyShift action_245 action_248 (152) = happyShift action_246 action_248 (153) = happyShift action_39 action_248 (154) = happyShift action_40 action_248 (155) = happyShift action_41 action_248 (156) = happyShift action_42 action_248 (157) = happyShift action_247 action_248 (163) = happyShift action_248 action_248 (164) = happyShift action_300 action_248 (166) = happyShift action_249 action_248 (172) = happyShift action_250 action_248 (177) = happyShift action_251 action_248 (180) = happyShift action_47 action_248 (181) = happyShift action_252 action_248 (186) = happyShift action_253 action_248 (188) = happyShift action_51 action_248 (189) = happyShift action_254 action_248 (196) = happyShift action_255 action_248 (203) = happyShift action_59 action_248 (75) = happyGoto action_297 action_248 (76) = happyGoto action_236 action_248 (77) = happyGoto action_237 action_248 (78) = happyGoto action_238 action_248 (79) = happyGoto action_239 action_248 (80) = happyGoto action_240 action_248 (83) = happyGoto action_298 action_248 (84) = happyGoto action_299 action_248 (111) = happyGoto action_241 action_248 (113) = happyGoto action_242 action_248 (115) = happyGoto action_243 action_248 (122) = happyGoto action_28 action_248 (123) = happyGoto action_29 action_248 (124) = happyGoto action_30 action_248 (126) = happyGoto action_31 action_248 (132) = happyGoto action_244 action_248 (133) = happyGoto action_33 action_248 _ = happyFail action_249 _ = happyReduce_191 action_250 (143) = happyShift action_34 action_250 (144) = happyShift action_35 action_250 (145) = happyShift action_36 action_250 (146) = happyShift action_37 action_250 (153) = happyShift action_39 action_250 (154) = happyShift action_40 action_250 (155) = happyShift action_41 action_250 (156) = happyShift action_42 action_250 (157) = happyShift action_83 action_250 (163) = happyShift action_44 action_250 (166) = happyShift action_45 action_250 (177) = happyShift action_46 action_250 (180) = happyShift action_47 action_250 (188) = happyShift action_51 action_250 (203) = happyShift action_59 action_250 (102) = happyGoto action_164 action_250 (104) = happyGoto action_296 action_250 (113) = happyGoto action_81 action_250 (115) = happyGoto action_82 action_250 (122) = happyGoto action_28 action_250 (123) = happyGoto action_29 action_250 (124) = happyGoto action_30 action_250 (126) = happyGoto action_31 action_250 (132) = happyGoto action_32 action_250 (133) = happyGoto action_33 action_250 _ = happyReduce_251 action_251 (143) = happyShift action_34 action_251 (144) = happyShift action_35 action_251 (145) = happyShift action_36 action_251 (146) = happyShift action_37 action_251 (152) = happyShift action_246 action_251 (153) = happyShift action_39 action_251 (154) = happyShift action_40 action_251 (155) = happyShift action_41 action_251 (156) = happyShift action_42 action_251 (157) = happyShift action_247 action_251 (163) = happyShift action_248 action_251 (166) = happyShift action_249 action_251 (177) = happyShift action_251 action_251 (180) = happyShift action_47 action_251 (188) = happyShift action_51 action_251 (203) = happyShift action_59 action_251 (80) = happyGoto action_295 action_251 (111) = happyGoto action_241 action_251 (113) = happyGoto action_242 action_251 (115) = happyGoto action_243 action_251 (122) = happyGoto action_28 action_251 (123) = happyGoto action_29 action_251 (124) = happyGoto action_30 action_251 (126) = happyGoto action_31 action_251 (132) = happyGoto action_244 action_251 (133) = happyGoto action_33 action_251 _ = happyFail action_252 (143) = happyShift action_34 action_252 (144) = happyShift action_35 action_252 (145) = happyShift action_36 action_252 (146) = happyShift action_37 action_252 (147) = happyShift action_245 action_252 (152) = happyShift action_246 action_252 (153) = happyShift action_39 action_252 (154) = happyShift action_40 action_252 (155) = happyShift action_41 action_252 (156) = happyShift action_42 action_252 (157) = happyShift action_247 action_252 (163) = happyShift action_248 action_252 (166) = happyShift action_249 action_252 (172) = happyShift action_250 action_252 (177) = happyShift action_251 action_252 (180) = happyShift action_47 action_252 (181) = happyShift action_252 action_252 (186) = happyShift action_253 action_252 (188) = happyShift action_51 action_252 (189) = happyShift action_254 action_252 (196) = happyShift action_255 action_252 (203) = happyShift action_59 action_252 (75) = happyGoto action_294 action_252 (76) = happyGoto action_236 action_252 (77) = happyGoto action_237 action_252 (78) = happyGoto action_238 action_252 (79) = happyGoto action_239 action_252 (80) = happyGoto action_240 action_252 (111) = happyGoto action_241 action_252 (113) = happyGoto action_242 action_252 (115) = happyGoto action_243 action_252 (122) = happyGoto action_28 action_252 (123) = happyGoto action_29 action_252 (124) = happyGoto action_30 action_252 (126) = happyGoto action_31 action_252 (132) = happyGoto action_244 action_252 (133) = happyGoto action_33 action_252 _ = happyFail action_253 (160) = happyShift action_293 action_253 (93) = happyGoto action_291 action_253 (135) = happyGoto action_292 action_253 _ = happyReduce_318 action_254 (143) = happyShift action_34 action_254 (144) = happyShift action_35 action_254 (145) = happyShift action_36 action_254 (146) = happyShift action_37 action_254 (147) = happyShift action_245 action_254 (152) = happyShift action_246 action_254 (153) = happyShift action_39 action_254 (154) = happyShift action_40 action_254 (155) = happyShift action_41 action_254 (156) = happyShift action_42 action_254 (157) = happyShift action_247 action_254 (163) = happyShift action_248 action_254 (166) = happyShift action_249 action_254 (172) = happyShift action_250 action_254 (177) = happyShift action_251 action_254 (180) = happyShift action_47 action_254 (181) = happyShift action_252 action_254 (186) = happyShift action_253 action_254 (188) = happyShift action_51 action_254 (189) = happyShift action_254 action_254 (196) = happyShift action_255 action_254 (203) = happyShift action_59 action_254 (75) = happyGoto action_290 action_254 (76) = happyGoto action_236 action_254 (77) = happyGoto action_237 action_254 (78) = happyGoto action_238 action_254 (79) = happyGoto action_239 action_254 (80) = happyGoto action_240 action_254 (111) = happyGoto action_241 action_254 (113) = happyGoto action_242 action_254 (115) = happyGoto action_243 action_254 (122) = happyGoto action_28 action_254 (123) = happyGoto action_29 action_254 (124) = happyGoto action_30 action_254 (126) = happyGoto action_31 action_254 (132) = happyGoto action_244 action_254 (133) = happyGoto action_33 action_254 _ = happyFail action_255 (160) = happyShift action_289 action_255 (39) = happyGoto action_287 action_255 (135) = happyGoto action_288 action_255 _ = happyReduce_318 action_256 _ = happyReduce_162 action_257 _ = happyReduce_164 action_258 _ = happyReduce_155 action_259 _ = happyReduce_88 action_260 (158) = happyShift action_286 action_260 _ = happyFail action_261 _ = happyReduce_55 action_262 _ = happyReduce_287 action_263 _ = happyReduce_288 action_264 (165) = happyShift action_285 action_264 _ = happyReduce_62 action_265 _ = happyReduce_283 action_266 _ = happyReduce_279 action_267 (143) = happyShift action_34 action_267 (145) = happyShift action_36 action_267 (180) = happyShift action_47 action_267 (188) = happyShift action_51 action_267 (203) = happyShift action_59 action_267 (123) = happyGoto action_283 action_267 (126) = happyGoto action_284 action_267 _ = happyFail action_268 _ = happyReduce_5 action_269 _ = happyReduce_1 action_270 _ = happyReduce_24 action_271 (143) = happyShift action_34 action_271 (144) = happyShift action_35 action_271 (145) = happyShift action_36 action_271 (146) = happyShift action_37 action_271 (157) = happyShift action_280 action_271 (158) = happyShift action_281 action_271 (169) = happyShift action_282 action_271 (180) = happyShift action_47 action_271 (188) = happyShift action_51 action_271 (203) = happyShift action_59 action_271 (13) = happyGoto action_276 action_271 (14) = happyGoto action_277 action_271 (113) = happyGoto action_278 action_271 (115) = happyGoto action_279 action_271 (122) = happyGoto action_28 action_271 (123) = happyGoto action_29 action_271 (124) = happyGoto action_30 action_271 (126) = happyGoto action_31 action_271 _ = happyFail action_272 (158) = happyShift action_275 action_272 _ = happyFail action_273 (143) = happyShift action_34 action_273 (144) = happyShift action_35 action_273 (145) = happyShift action_36 action_273 (146) = happyShift action_71 action_273 (157) = happyShift action_136 action_273 (180) = happyShift action_47 action_273 (188) = happyShift action_51 action_273 (197) = happyShift action_138 action_273 (203) = happyShift action_59 action_273 (12) = happyGoto action_274 action_273 (113) = happyGoto action_133 action_273 (122) = happyGoto action_28 action_273 (123) = happyGoto action_29 action_273 (125) = happyGoto action_134 action_273 (126) = happyGoto action_69 action_273 (139) = happyGoto action_70 action_273 (140) = happyGoto action_135 action_273 _ = happyReduce_15 action_274 _ = happyReduce_17 action_275 _ = happyReduce_13 action_276 (158) = happyShift action_418 action_276 (165) = happyShift action_419 action_276 _ = happyFail action_277 _ = happyReduce_26 action_278 _ = happyReduce_27 action_279 _ = happyReduce_28 action_280 (147) = happyShift action_117 action_280 (148) = happyShift action_99 action_280 (149) = happyShift action_100 action_280 (150) = happyShift action_101 action_280 (151) = happyShift action_102 action_280 (168) = happyShift action_104 action_280 (179) = happyShift action_105 action_280 (127) = happyGoto action_93 action_280 (128) = happyGoto action_94 action_280 (129) = happyGoto action_95 action_280 (130) = happyGoto action_96 action_280 (131) = happyGoto action_97 action_280 _ = happyFail action_281 _ = happyReduce_22 action_282 (158) = happyShift action_417 action_282 _ = happyFail action_283 (167) = happyShift action_416 action_283 _ = happyFail action_284 (167) = happyShift action_415 action_284 _ = happyFail action_285 (147) = happyShift action_117 action_285 (148) = happyShift action_99 action_285 (149) = happyShift action_100 action_285 (167) = happyShift action_267 action_285 (168) = happyShift action_104 action_285 (179) = happyShift action_105 action_285 (30) = happyGoto action_414 action_285 (116) = happyGoto action_262 action_285 (118) = happyGoto action_263 action_285 (120) = happyGoto action_264 action_285 (128) = happyGoto action_265 action_285 (130) = happyGoto action_266 action_285 _ = happyFail action_286 _ = happyReduce_272 action_287 (191) = happyShift action_413 action_287 _ = happyFail action_288 (143) = happyShift action_34 action_288 (144) = happyShift action_35 action_288 (145) = happyShift action_36 action_288 (146) = happyShift action_37 action_288 (147) = happyShift action_38 action_288 (153) = happyShift action_39 action_288 (154) = happyShift action_40 action_288 (155) = happyShift action_41 action_288 (156) = happyShift action_42 action_288 (157) = happyShift action_43 action_288 (159) = happyShift action_353 action_288 (163) = happyShift action_44 action_288 (166) = happyShift action_45 action_288 (177) = happyShift action_46 action_288 (180) = happyShift action_47 action_288 (188) = happyShift action_51 action_288 (192) = happyShift action_53 action_288 (193) = happyShift action_54 action_288 (194) = happyShift action_55 action_288 (203) = happyShift action_59 action_288 (7) = happyGoto action_408 action_288 (27) = happyGoto action_15 action_288 (29) = happyGoto action_16 action_288 (36) = happyGoto action_412 action_288 (37) = happyGoto action_410 action_288 (38) = happyGoto action_411 action_288 (40) = happyGoto action_19 action_288 (41) = happyGoto action_20 action_288 (69) = happyGoto action_21 action_288 (70) = happyGoto action_22 action_288 (100) = happyGoto action_23 action_288 (101) = happyGoto action_24 action_288 (102) = happyGoto action_25 action_288 (113) = happyGoto action_26 action_288 (115) = happyGoto action_27 action_288 (122) = happyGoto action_28 action_288 (123) = happyGoto action_29 action_288 (124) = happyGoto action_30 action_288 (126) = happyGoto action_31 action_288 (132) = happyGoto action_32 action_288 (133) = happyGoto action_33 action_288 _ = happyReduce_10 action_289 (143) = happyShift action_34 action_289 (144) = happyShift action_35 action_289 (145) = happyShift action_36 action_289 (146) = happyShift action_37 action_289 (147) = happyShift action_38 action_289 (153) = happyShift action_39 action_289 (154) = happyShift action_40 action_289 (155) = happyShift action_41 action_289 (156) = happyShift action_42 action_289 (157) = happyShift action_43 action_289 (159) = happyShift action_353 action_289 (163) = happyShift action_44 action_289 (166) = happyShift action_45 action_289 (177) = happyShift action_46 action_289 (180) = happyShift action_47 action_289 (188) = happyShift action_51 action_289 (192) = happyShift action_53 action_289 (193) = happyShift action_54 action_289 (194) = happyShift action_55 action_289 (203) = happyShift action_59 action_289 (7) = happyGoto action_408 action_289 (27) = happyGoto action_15 action_289 (29) = happyGoto action_16 action_289 (36) = happyGoto action_409 action_289 (37) = happyGoto action_410 action_289 (38) = happyGoto action_411 action_289 (40) = happyGoto action_19 action_289 (41) = happyGoto action_20 action_289 (69) = happyGoto action_21 action_289 (70) = happyGoto action_22 action_289 (100) = happyGoto action_23 action_289 (101) = happyGoto action_24 action_289 (102) = happyGoto action_25 action_289 (113) = happyGoto action_26 action_289 (115) = happyGoto action_27 action_289 (122) = happyGoto action_28 action_289 (123) = happyGoto action_29 action_289 (124) = happyGoto action_30 action_289 (126) = happyGoto action_31 action_289 (132) = happyGoto action_32 action_289 (133) = happyGoto action_33 action_289 _ = happyReduce_10 action_290 (200) = happyShift action_407 action_290 _ = happyFail action_291 _ = happyReduce_176 action_292 (143) = happyShift action_34 action_292 (144) = happyShift action_35 action_292 (145) = happyShift action_36 action_292 (146) = happyShift action_37 action_292 (147) = happyShift action_245 action_292 (152) = happyShift action_246 action_292 (153) = happyShift action_39 action_292 (154) = happyShift action_40 action_292 (155) = happyShift action_41 action_292 (156) = happyShift action_42 action_292 (157) = happyShift action_247 action_292 (163) = happyShift action_248 action_292 (166) = happyShift action_249 action_292 (172) = happyShift action_250 action_292 (177) = happyShift action_251 action_292 (180) = happyShift action_47 action_292 (181) = happyShift action_252 action_292 (186) = happyShift action_253 action_292 (188) = happyShift action_51 action_292 (189) = happyShift action_254 action_292 (196) = happyShift action_405 action_292 (203) = happyShift action_59 action_292 (75) = happyGoto action_400 action_292 (76) = happyGoto action_401 action_292 (77) = happyGoto action_237 action_292 (78) = happyGoto action_238 action_292 (79) = happyGoto action_239 action_292 (80) = happyGoto action_240 action_292 (86) = happyGoto action_402 action_292 (94) = happyGoto action_406 action_292 (95) = happyGoto action_404 action_292 (111) = happyGoto action_241 action_292 (113) = happyGoto action_242 action_292 (115) = happyGoto action_243 action_292 (122) = happyGoto action_28 action_292 (123) = happyGoto action_29 action_292 (124) = happyGoto action_30 action_292 (126) = happyGoto action_31 action_292 (132) = happyGoto action_244 action_292 (133) = happyGoto action_33 action_292 _ = happyFail action_293 (143) = happyShift action_34 action_293 (144) = happyShift action_35 action_293 (145) = happyShift action_36 action_293 (146) = happyShift action_37 action_293 (147) = happyShift action_245 action_293 (152) = happyShift action_246 action_293 (153) = happyShift action_39 action_293 (154) = happyShift action_40 action_293 (155) = happyShift action_41 action_293 (156) = happyShift action_42 action_293 (157) = happyShift action_247 action_293 (163) = happyShift action_248 action_293 (166) = happyShift action_249 action_293 (172) = happyShift action_250 action_293 (177) = happyShift action_251 action_293 (180) = happyShift action_47 action_293 (181) = happyShift action_252 action_293 (186) = happyShift action_253 action_293 (188) = happyShift action_51 action_293 (189) = happyShift action_254 action_293 (196) = happyShift action_405 action_293 (203) = happyShift action_59 action_293 (75) = happyGoto action_400 action_293 (76) = happyGoto action_401 action_293 (77) = happyGoto action_237 action_293 (78) = happyGoto action_238 action_293 (79) = happyGoto action_239 action_293 (80) = happyGoto action_240 action_293 (86) = happyGoto action_402 action_293 (94) = happyGoto action_403 action_293 (95) = happyGoto action_404 action_293 (111) = happyGoto action_241 action_293 (113) = happyGoto action_242 action_293 (115) = happyGoto action_243 action_293 (122) = happyGoto action_28 action_293 (123) = happyGoto action_29 action_293 (124) = happyGoto action_30 action_293 (126) = happyGoto action_31 action_293 (132) = happyGoto action_244 action_293 (133) = happyGoto action_33 action_293 _ = happyFail action_294 (199) = happyShift action_399 action_294 _ = happyFail action_295 _ = happyReduce_192 action_296 (175) = happyShift action_398 action_296 _ = happyFail action_297 (165) = happyShift action_395 action_297 (169) = happyShift action_396 action_297 (173) = happyShift action_397 action_297 _ = happyReduce_197 action_298 (164) = happyShift action_394 action_298 _ = happyFail action_299 (165) = happyShift action_393 action_299 _ = happyReduce_198 action_300 _ = happyReduce_265 action_301 (158) = happyShift action_391 action_301 (165) = happyShift action_392 action_301 _ = happyFail action_302 (147) = happyShift action_117 action_302 (148) = happyShift action_99 action_302 (149) = happyShift action_100 action_302 (150) = happyShift action_101 action_302 (151) = happyShift action_102 action_302 (167) = happyShift action_118 action_302 (168) = happyShift action_104 action_302 (170) = happyShift action_318 action_302 (179) = happyShift action_105 action_302 (117) = happyGoto action_305 action_302 (119) = happyGoto action_306 action_302 (121) = happyGoto action_390 action_302 (127) = happyGoto action_114 action_302 (128) = happyGoto action_94 action_302 (129) = happyGoto action_115 action_302 (130) = happyGoto action_96 action_302 (131) = happyGoto action_97 action_302 _ = happyReduce_168 action_303 (158) = happyShift action_389 action_303 (165) = happyShift action_208 action_303 _ = happyFail action_304 (158) = happyShift action_387 action_304 (165) = happyShift action_388 action_304 _ = happyFail action_305 _ = happyReduce_289 action_306 _ = happyReduce_290 action_307 (143) = happyShift action_34 action_307 (144) = happyShift action_35 action_307 (145) = happyShift action_36 action_307 (146) = happyShift action_37 action_307 (147) = happyShift action_245 action_307 (152) = happyShift action_246 action_307 (153) = happyShift action_39 action_307 (154) = happyShift action_40 action_307 (155) = happyShift action_41 action_307 (156) = happyShift action_42 action_307 (157) = happyShift action_247 action_307 (163) = happyShift action_248 action_307 (166) = happyShift action_249 action_307 (172) = happyShift action_250 action_307 (177) = happyShift action_251 action_307 (180) = happyShift action_47 action_307 (181) = happyShift action_252 action_307 (186) = happyShift action_253 action_307 (188) = happyShift action_51 action_307 (189) = happyShift action_254 action_307 (196) = happyShift action_255 action_307 (203) = happyShift action_59 action_307 (76) = happyGoto action_386 action_307 (77) = happyGoto action_237 action_307 (78) = happyGoto action_238 action_307 (79) = happyGoto action_239 action_307 (80) = happyGoto action_240 action_307 (111) = happyGoto action_241 action_307 (113) = happyGoto action_242 action_307 (115) = happyGoto action_243 action_307 (122) = happyGoto action_28 action_307 (123) = happyGoto action_29 action_307 (124) = happyGoto action_30 action_307 (126) = happyGoto action_31 action_307 (132) = happyGoto action_244 action_307 (133) = happyGoto action_33 action_307 _ = happyFail action_308 (158) = happyShift action_167 action_308 _ = happyReduce_285 action_309 (158) = happyShift action_166 action_309 _ = happyReduce_281 action_310 (143) = happyShift action_34 action_310 (144) = happyShift action_35 action_310 (145) = happyShift action_36 action_310 (146) = happyShift action_37 action_310 (152) = happyShift action_246 action_310 (153) = happyShift action_39 action_310 (154) = happyShift action_40 action_310 (155) = happyShift action_41 action_310 (156) = happyShift action_42 action_310 (157) = happyShift action_247 action_310 (163) = happyShift action_248 action_310 (166) = happyShift action_249 action_310 (177) = happyShift action_251 action_310 (180) = happyShift action_47 action_310 (188) = happyShift action_51 action_310 (203) = happyShift action_59 action_310 (78) = happyGoto action_313 action_310 (79) = happyGoto action_239 action_310 (80) = happyGoto action_240 action_310 (111) = happyGoto action_241 action_310 (113) = happyGoto action_242 action_310 (115) = happyGoto action_243 action_310 (122) = happyGoto action_28 action_310 (123) = happyGoto action_29 action_310 (124) = happyGoto action_30 action_310 (126) = happyGoto action_31 action_310 (132) = happyGoto action_244 action_310 (133) = happyGoto action_33 action_310 _ = happyReduce_308 action_311 _ = happyReduce_264 action_312 (157) = happyShift action_384 action_312 (163) = happyShift action_385 action_312 _ = happyFail action_313 (143) = happyShift action_34 action_313 (144) = happyShift action_35 action_313 (145) = happyShift action_36 action_313 (146) = happyShift action_37 action_313 (152) = happyShift action_246 action_313 (153) = happyShift action_39 action_313 (154) = happyShift action_40 action_313 (155) = happyShift action_41 action_313 (156) = happyShift action_42 action_313 (157) = happyShift action_247 action_313 (163) = happyShift action_248 action_313 (166) = happyShift action_249 action_313 (177) = happyShift action_251 action_313 (180) = happyShift action_47 action_313 (188) = happyShift action_51 action_313 (203) = happyShift action_59 action_313 (79) = happyGoto action_316 action_313 (80) = happyGoto action_240 action_313 (111) = happyGoto action_241 action_313 (113) = happyGoto action_242 action_313 (115) = happyGoto action_243 action_313 (122) = happyGoto action_28 action_313 (123) = happyGoto action_29 action_313 (124) = happyGoto action_30 action_313 (126) = happyGoto action_31 action_313 (132) = happyGoto action_244 action_313 (133) = happyGoto action_33 action_313 _ = happyReduce_175 action_314 (143) = happyShift action_34 action_314 (144) = happyShift action_35 action_314 (145) = happyShift action_36 action_314 (146) = happyShift action_37 action_314 (152) = happyShift action_246 action_314 (153) = happyShift action_39 action_314 (154) = happyShift action_40 action_314 (155) = happyShift action_41 action_314 (156) = happyShift action_42 action_314 (157) = happyShift action_247 action_314 (163) = happyShift action_248 action_314 (166) = happyShift action_249 action_314 (177) = happyShift action_251 action_314 (180) = happyShift action_47 action_314 (188) = happyShift action_51 action_314 (203) = happyShift action_59 action_314 (80) = happyGoto action_383 action_314 (111) = happyGoto action_241 action_314 (113) = happyGoto action_242 action_314 (115) = happyGoto action_243 action_314 (122) = happyGoto action_28 action_314 (123) = happyGoto action_29 action_314 (124) = happyGoto action_30 action_314 (126) = happyGoto action_31 action_314 (132) = happyGoto action_244 action_314 (133) = happyGoto action_33 action_314 _ = happyFail action_315 (143) = happyShift action_34 action_315 (144) = happyShift action_35 action_315 (157) = happyShift action_136 action_315 (180) = happyShift action_47 action_315 (188) = happyShift action_51 action_315 (203) = happyShift action_59 action_315 (96) = happyGoto action_379 action_315 (97) = happyGoto action_380 action_315 (98) = happyGoto action_381 action_315 (113) = happyGoto action_382 action_315 (122) = happyGoto action_28 action_315 (123) = happyGoto action_29 action_315 _ = happyReduce_228 action_316 (160) = happyShift action_315 action_316 _ = happyReduce_178 action_317 (143) = happyShift action_34 action_317 (144) = happyShift action_35 action_317 (145) = happyShift action_36 action_317 (146) = happyShift action_37 action_317 (147) = happyShift action_245 action_317 (152) = happyShift action_246 action_317 (153) = happyShift action_39 action_317 (154) = happyShift action_40 action_317 (155) = happyShift action_41 action_317 (156) = happyShift action_42 action_317 (157) = happyShift action_247 action_317 (163) = happyShift action_248 action_317 (166) = happyShift action_249 action_317 (172) = happyShift action_250 action_317 (177) = happyShift action_251 action_317 (180) = happyShift action_47 action_317 (181) = happyShift action_252 action_317 (186) = happyShift action_253 action_317 (188) = happyShift action_51 action_317 (189) = happyShift action_254 action_317 (196) = happyShift action_255 action_317 (203) = happyShift action_59 action_317 (77) = happyGoto action_378 action_317 (78) = happyGoto action_238 action_317 (79) = happyGoto action_239 action_317 (80) = happyGoto action_240 action_317 (111) = happyGoto action_241 action_317 (113) = happyGoto action_242 action_317 (115) = happyGoto action_243 action_317 (122) = happyGoto action_28 action_317 (123) = happyGoto action_29 action_317 (124) = happyGoto action_30 action_317 (126) = happyGoto action_31 action_317 (132) = happyGoto action_244 action_317 (133) = happyGoto action_33 action_317 _ = happyFail action_318 (134) = happyGoto action_377 action_318 _ = happyReduce_317 action_319 (171) = happyShift action_376 action_319 _ = happyFail action_320 _ = happyReduce_160 action_321 _ = happyReduce_255 action_322 _ = happyReduce_257 action_323 _ = happyReduce_105 action_324 _ = happyReduce_91 action_325 _ = happyReduce_73 action_326 (165) = happyShift action_375 action_326 _ = happyReduce_74 action_327 (175) = happyShift action_374 action_327 _ = happyFail action_328 (143) = happyShift action_34 action_328 (180) = happyShift action_47 action_328 (188) = happyShift action_51 action_328 (203) = happyShift action_59 action_328 (123) = happyGoto action_180 action_328 (142) = happyGoto action_204 action_328 _ = happyReduce_78 action_329 _ = happyReduce_66 action_330 (160) = happyShift action_373 action_330 (135) = happyGoto action_372 action_330 _ = happyReduce_318 action_331 _ = happyReduce_97 action_332 (143) = happyShift action_34 action_332 (145) = happyShift action_36 action_332 (146) = happyShift action_71 action_332 (157) = happyShift action_182 action_332 (163) = happyShift action_183 action_332 (180) = happyShift action_47 action_332 (188) = happyShift action_51 action_332 (203) = happyShift action_59 action_332 (42) = happyGoto action_371 action_332 (43) = happyGoto action_176 action_332 (44) = happyGoto action_177 action_332 (45) = happyGoto action_178 action_332 (123) = happyGoto action_180 action_332 (125) = happyGoto action_68 action_332 (126) = happyGoto action_69 action_332 (139) = happyGoto action_70 action_332 (142) = happyGoto action_181 action_332 _ = happyFail action_333 _ = happyReduce_99 action_334 (143) = happyShift action_34 action_334 (145) = happyShift action_36 action_334 (146) = happyShift action_71 action_334 (157) = happyShift action_182 action_334 (163) = happyShift action_183 action_334 (180) = happyShift action_47 action_334 (188) = happyShift action_51 action_334 (203) = happyShift action_59 action_334 (42) = happyGoto action_370 action_334 (43) = happyGoto action_176 action_334 (44) = happyGoto action_177 action_334 (45) = happyGoto action_178 action_334 (123) = happyGoto action_180 action_334 (125) = happyGoto action_68 action_334 (126) = happyGoto action_69 action_334 (139) = happyGoto action_70 action_334 (142) = happyGoto action_181 action_334 _ = happyFail action_335 _ = happyReduce_98 action_336 _ = happyReduce_109 action_337 (173) = happyShift action_369 action_337 (185) = happyShift action_348 action_337 (61) = happyGoto action_368 action_337 _ = happyReduce_134 action_338 _ = happyReduce_117 action_339 (143) = happyShift action_34 action_339 (145) = happyShift action_36 action_339 (146) = happyShift action_71 action_339 (157) = happyShift action_366 action_339 (163) = happyShift action_183 action_339 (179) = happyShift action_367 action_339 (180) = happyShift action_47 action_339 (188) = happyShift action_51 action_339 (203) = happyShift action_59 action_339 (43) = happyGoto action_360 action_339 (44) = happyGoto action_177 action_339 (45) = happyGoto action_178 action_339 (54) = happyGoto action_361 action_339 (55) = happyGoto action_362 action_339 (57) = happyGoto action_363 action_339 (114) = happyGoto action_364 action_339 (123) = happyGoto action_180 action_339 (125) = happyGoto action_68 action_339 (126) = happyGoto action_365 action_339 (139) = happyGoto action_70 action_339 (142) = happyGoto action_181 action_339 _ = happyFail action_340 (157) = happyShift action_358 action_340 (188) = happyShift action_359 action_340 (19) = happyGoto action_356 action_340 (20) = happyGoto action_357 action_340 _ = happyReduce_37 action_341 (145) = happyShift action_10 action_341 (137) = happyGoto action_355 action_341 _ = happyFail action_342 (143) = happyShift action_34 action_342 (144) = happyShift action_35 action_342 (145) = happyShift action_36 action_342 (146) = happyShift action_37 action_342 (147) = happyShift action_38 action_342 (153) = happyShift action_39 action_342 (154) = happyShift action_40 action_342 (155) = happyShift action_41 action_342 (156) = happyShift action_42 action_342 (157) = happyShift action_43 action_342 (159) = happyShift action_353 action_342 (163) = happyShift action_44 action_342 (166) = happyShift action_45 action_342 (177) = happyShift action_46 action_342 (180) = happyShift action_47 action_342 (188) = happyShift action_51 action_342 (203) = happyShift action_59 action_342 (7) = happyGoto action_349 action_342 (66) = happyGoto action_350 action_342 (68) = happyGoto action_354 action_342 (69) = happyGoto action_352 action_342 (70) = happyGoto action_22 action_342 (100) = happyGoto action_23 action_342 (101) = happyGoto action_24 action_342 (102) = happyGoto action_25 action_342 (113) = happyGoto action_92 action_342 (115) = happyGoto action_27 action_342 (122) = happyGoto action_28 action_342 (123) = happyGoto action_29 action_342 (124) = happyGoto action_30 action_342 (126) = happyGoto action_31 action_342 (132) = happyGoto action_32 action_342 (133) = happyGoto action_33 action_342 _ = happyReduce_10 action_343 (143) = happyShift action_34 action_343 (144) = happyShift action_35 action_343 (145) = happyShift action_36 action_343 (146) = happyShift action_37 action_343 (147) = happyShift action_38 action_343 (153) = happyShift action_39 action_343 (154) = happyShift action_40 action_343 (155) = happyShift action_41 action_343 (156) = happyShift action_42 action_343 (157) = happyShift action_43 action_343 (159) = happyShift action_353 action_343 (163) = happyShift action_44 action_343 (166) = happyShift action_45 action_343 (177) = happyShift action_46 action_343 (180) = happyShift action_47 action_343 (188) = happyShift action_51 action_343 (203) = happyShift action_59 action_343 (7) = happyGoto action_349 action_343 (66) = happyGoto action_350 action_343 (68) = happyGoto action_351 action_343 (69) = happyGoto action_352 action_343 (70) = happyGoto action_22 action_343 (100) = happyGoto action_23 action_343 (101) = happyGoto action_24 action_343 (102) = happyGoto action_25 action_343 (113) = happyGoto action_92 action_343 (115) = happyGoto action_27 action_343 (122) = happyGoto action_28 action_343 (123) = happyGoto action_29 action_343 (124) = happyGoto action_30 action_343 (126) = happyGoto action_31 action_343 (132) = happyGoto action_32 action_343 (133) = happyGoto action_33 action_343 _ = happyReduce_10 action_344 (185) = happyShift action_348 action_344 (61) = happyGoto action_347 action_344 _ = happyReduce_134 action_345 _ = happyReduce_63 action_346 _ = happyReduce_70 action_347 _ = happyReduce_65 action_348 (145) = happyShift action_36 action_348 (146) = happyShift action_71 action_348 (157) = happyShift action_487 action_348 (125) = happyGoto action_485 action_348 (126) = happyGoto action_69 action_348 (139) = happyGoto action_70 action_348 (141) = happyGoto action_486 action_348 _ = happyFail action_349 _ = happyReduce_154 action_350 (159) = happyShift action_484 action_350 (7) = happyGoto action_483 action_350 _ = happyReduce_10 action_351 (161) = happyShift action_482 action_351 _ = happyFail action_352 _ = happyReduce_149 action_353 _ = happyReduce_9 action_354 (1) = happyShift action_63 action_354 (162) = happyShift action_64 action_354 (136) = happyGoto action_481 action_354 _ = happyFail action_355 _ = happyReduce_34 action_356 _ = happyReduce_31 action_357 _ = happyReduce_36 action_358 (143) = happyShift action_34 action_358 (145) = happyShift action_36 action_358 (157) = happyShift action_147 action_358 (165) = happyShift action_480 action_358 (180) = happyShift action_47 action_358 (188) = happyShift action_51 action_358 (203) = happyShift action_59 action_358 (10) = happyGoto action_473 action_358 (21) = happyGoto action_474 action_358 (22) = happyGoto action_475 action_358 (23) = happyGoto action_476 action_358 (112) = happyGoto action_477 action_358 (123) = happyGoto action_146 action_358 (126) = happyGoto action_478 action_358 (138) = happyGoto action_479 action_358 _ = happyReduce_16 action_359 (157) = happyShift action_472 action_359 _ = happyFail action_360 (143) = happyShift action_34 action_360 (145) = happyShift action_36 action_360 (146) = happyShift action_71 action_360 (149) = happyReduce_127 action_360 (157) = happyShift action_182 action_360 (163) = happyShift action_183 action_360 (167) = happyReduce_127 action_360 (179) = happyShift action_471 action_360 (180) = happyShift action_47 action_360 (188) = happyShift action_51 action_360 (203) = happyShift action_59 action_360 (44) = happyGoto action_220 action_360 (45) = happyGoto action_178 action_360 (123) = happyGoto action_180 action_360 (125) = happyGoto action_68 action_360 (126) = happyGoto action_69 action_360 (139) = happyGoto action_70 action_360 (142) = happyGoto action_181 action_360 _ = happyReduce_121 action_361 _ = happyReduce_118 action_362 (143) = happyShift action_34 action_362 (145) = happyShift action_36 action_362 (146) = happyShift action_71 action_362 (157) = happyShift action_182 action_362 (163) = happyShift action_183 action_362 (179) = happyShift action_470 action_362 (180) = happyShift action_47 action_362 (188) = happyShift action_51 action_362 (203) = happyShift action_59 action_362 (44) = happyGoto action_468 action_362 (45) = happyGoto action_178 action_362 (56) = happyGoto action_469 action_362 (123) = happyGoto action_180 action_362 (125) = happyGoto action_68 action_362 (126) = happyGoto action_69 action_362 (139) = happyGoto action_70 action_362 (142) = happyGoto action_181 action_362 _ = happyReduce_122 action_363 (149) = happyShift action_100 action_363 (167) = happyShift action_467 action_363 (118) = happyGoto action_466 action_363 (128) = happyGoto action_265 action_363 _ = happyFail action_364 (160) = happyShift action_465 action_364 _ = happyFail action_365 (160) = happyReduce_275 action_365 _ = happyReduce_323 action_366 (143) = happyShift action_34 action_366 (145) = happyShift action_36 action_366 (146) = happyShift action_71 action_366 (149) = happyShift action_100 action_366 (157) = happyShift action_182 action_366 (158) = happyShift action_196 action_366 (163) = happyShift action_183 action_366 (165) = happyShift action_197 action_366 (175) = happyShift action_198 action_366 (180) = happyShift action_47 action_366 (188) = happyShift action_51 action_366 (203) = happyShift action_59 action_366 (42) = happyGoto action_216 action_366 (43) = happyGoto action_176 action_366 (44) = happyGoto action_177 action_366 (45) = happyGoto action_178 action_366 (47) = happyGoto action_217 action_366 (81) = happyGoto action_195 action_366 (123) = happyGoto action_180 action_366 (125) = happyGoto action_68 action_366 (126) = happyGoto action_69 action_366 (128) = happyGoto action_464 action_366 (139) = happyGoto action_70 action_366 (142) = happyGoto action_181 action_366 _ = happyFail action_367 (143) = happyShift action_34 action_367 (145) = happyShift action_36 action_367 (146) = happyShift action_71 action_367 (157) = happyShift action_182 action_367 (163) = happyShift action_183 action_367 (180) = happyShift action_47 action_367 (188) = happyShift action_51 action_367 (203) = happyShift action_59 action_367 (44) = happyGoto action_463 action_367 (45) = happyGoto action_178 action_367 (123) = happyGoto action_180 action_367 (125) = happyGoto action_68 action_367 (126) = happyGoto action_69 action_367 (139) = happyGoto action_70 action_367 (142) = happyGoto action_181 action_367 _ = happyFail action_368 _ = happyReduce_64 action_369 (53) = happyGoto action_462 action_369 (134) = happyGoto action_339 action_369 _ = happyReduce_317 action_370 _ = happyReduce_108 action_371 _ = happyReduce_107 action_372 (143) = happyShift action_34 action_372 (144) = happyShift action_35 action_372 (157) = happyShift action_136 action_372 (159) = happyShift action_353 action_372 (180) = happyShift action_47 action_372 (188) = happyShift action_51 action_372 (203) = happyShift action_59 action_372 (7) = happyGoto action_456 action_372 (40) = happyGoto action_457 action_372 (41) = happyGoto action_20 action_372 (64) = happyGoto action_461 action_372 (65) = happyGoto action_459 action_372 (113) = happyGoto action_460 action_372 (122) = happyGoto action_28 action_372 (123) = happyGoto action_29 action_372 _ = happyReduce_10 action_373 (143) = happyShift action_34 action_373 (144) = happyShift action_35 action_373 (157) = happyShift action_136 action_373 (159) = happyShift action_353 action_373 (180) = happyShift action_47 action_373 (188) = happyShift action_51 action_373 (203) = happyShift action_59 action_373 (7) = happyGoto action_456 action_373 (40) = happyGoto action_457 action_373 (41) = happyGoto action_20 action_373 (64) = happyGoto action_458 action_373 (65) = happyGoto action_459 action_373 (113) = happyGoto action_460 action_373 (122) = happyGoto action_28 action_373 (123) = happyGoto action_29 action_373 _ = happyReduce_10 action_374 (143) = happyShift action_34 action_374 (180) = happyShift action_47 action_374 (188) = happyShift action_51 action_374 (203) = happyShift action_59 action_374 (35) = happyGoto action_455 action_374 (50) = happyGoto action_328 action_374 (123) = happyGoto action_180 action_374 (142) = happyGoto action_201 action_374 _ = happyReduce_77 action_375 (143) = happyShift action_34 action_375 (180) = happyShift action_47 action_375 (188) = happyShift action_51 action_375 (203) = happyShift action_59 action_375 (33) = happyGoto action_454 action_375 (34) = happyGoto action_326 action_375 (35) = happyGoto action_327 action_375 (50) = happyGoto action_328 action_375 (123) = happyGoto action_180 action_375 (142) = happyGoto action_201 action_375 _ = happyReduce_77 action_376 (143) = happyShift action_34 action_376 (144) = happyShift action_35 action_376 (145) = happyShift action_36 action_376 (146) = happyShift action_37 action_376 (147) = happyShift action_245 action_376 (152) = happyShift action_246 action_376 (153) = happyShift action_39 action_376 (154) = happyShift action_40 action_376 (155) = happyShift action_41 action_376 (156) = happyShift action_42 action_376 (157) = happyShift action_247 action_376 (163) = happyShift action_248 action_376 (166) = happyShift action_249 action_376 (172) = happyShift action_250 action_376 (177) = happyShift action_251 action_376 (180) = happyShift action_47 action_376 (181) = happyShift action_252 action_376 (186) = happyShift action_253 action_376 (188) = happyShift action_51 action_376 (189) = happyShift action_254 action_376 (196) = happyShift action_255 action_376 (203) = happyShift action_59 action_376 (75) = happyGoto action_453 action_376 (76) = happyGoto action_236 action_376 (77) = happyGoto action_237 action_376 (78) = happyGoto action_238 action_376 (79) = happyGoto action_239 action_376 (80) = happyGoto action_240 action_376 (111) = happyGoto action_241 action_376 (113) = happyGoto action_242 action_376 (115) = happyGoto action_243 action_376 (122) = happyGoto action_28 action_376 (123) = happyGoto action_29 action_376 (124) = happyGoto action_30 action_376 (126) = happyGoto action_31 action_376 (132) = happyGoto action_244 action_376 (133) = happyGoto action_33 action_376 _ = happyFail action_377 (143) = happyShift action_34 action_377 (145) = happyShift action_36 action_377 (146) = happyShift action_71 action_377 (157) = happyShift action_182 action_377 (163) = happyShift action_183 action_377 (180) = happyShift action_47 action_377 (188) = happyShift action_51 action_377 (203) = happyShift action_59 action_377 (42) = happyGoto action_175 action_377 (43) = happyGoto action_176 action_377 (44) = happyGoto action_177 action_377 (45) = happyGoto action_178 action_377 (46) = happyGoto action_452 action_377 (123) = happyGoto action_180 action_377 (125) = happyGoto action_68 action_377 (126) = happyGoto action_69 action_377 (139) = happyGoto action_70 action_377 (142) = happyGoto action_181 action_377 _ = happyFail action_378 _ = happyReduce_170 action_379 (161) = happyShift action_451 action_379 _ = happyFail action_380 (165) = happyShift action_450 action_380 _ = happyReduce_229 action_381 _ = happyReduce_231 action_382 (171) = happyShift action_449 action_382 _ = happyFail action_383 _ = happyReduce_190 action_384 (158) = happyShift action_448 action_384 (165) = happyShift action_197 action_384 (81) = happyGoto action_447 action_384 _ = happyFail action_385 (164) = happyShift action_446 action_385 _ = happyFail action_386 (147) = happyShift action_117 action_386 (148) = happyShift action_99 action_386 (149) = happyShift action_100 action_386 (150) = happyShift action_101 action_386 (151) = happyShift action_102 action_386 (158) = happyShift action_445 action_386 (167) = happyShift action_118 action_386 (168) = happyShift action_104 action_386 (179) = happyShift action_105 action_386 (117) = happyGoto action_305 action_386 (119) = happyGoto action_306 action_386 (121) = happyGoto action_317 action_386 (127) = happyGoto action_114 action_386 (128) = happyGoto action_94 action_386 (129) = happyGoto action_115 action_386 (130) = happyGoto action_96 action_386 (131) = happyGoto action_97 action_386 _ = happyFail action_387 _ = happyReduce_186 action_388 (143) = happyShift action_34 action_388 (144) = happyShift action_35 action_388 (145) = happyShift action_36 action_388 (146) = happyShift action_37 action_388 (147) = happyShift action_245 action_388 (152) = happyShift action_246 action_388 (153) = happyShift action_39 action_388 (154) = happyShift action_40 action_388 (155) = happyShift action_41 action_388 (156) = happyShift action_42 action_388 (157) = happyShift action_247 action_388 (163) = happyShift action_248 action_388 (166) = happyShift action_249 action_388 (172) = happyShift action_250 action_388 (177) = happyShift action_251 action_388 (180) = happyShift action_47 action_388 (181) = happyShift action_252 action_388 (186) = happyShift action_253 action_388 (188) = happyShift action_51 action_388 (189) = happyShift action_254 action_388 (196) = happyShift action_255 action_388 (203) = happyShift action_59 action_388 (75) = happyGoto action_444 action_388 (76) = happyGoto action_236 action_388 (77) = happyGoto action_237 action_388 (78) = happyGoto action_238 action_388 (79) = happyGoto action_239 action_388 (80) = happyGoto action_240 action_388 (111) = happyGoto action_241 action_388 (113) = happyGoto action_242 action_388 (115) = happyGoto action_243 action_388 (122) = happyGoto action_28 action_388 (123) = happyGoto action_29 action_388 (124) = happyGoto action_30 action_388 (126) = happyGoto action_31 action_388 (132) = happyGoto action_244 action_388 (133) = happyGoto action_33 action_388 _ = happyFail action_389 _ = happyReduce_266 action_390 (143) = happyShift action_34 action_390 (144) = happyShift action_35 action_390 (145) = happyShift action_36 action_390 (146) = happyShift action_37 action_390 (147) = happyShift action_245 action_390 (152) = happyShift action_246 action_390 (153) = happyShift action_39 action_390 (154) = happyShift action_40 action_390 (155) = happyShift action_41 action_390 (156) = happyShift action_42 action_390 (157) = happyShift action_247 action_390 (158) = happyShift action_443 action_390 (163) = happyShift action_248 action_390 (166) = happyShift action_249 action_390 (172) = happyShift action_250 action_390 (177) = happyShift action_251 action_390 (180) = happyShift action_47 action_390 (181) = happyShift action_252 action_390 (186) = happyShift action_253 action_390 (188) = happyShift action_51 action_390 (189) = happyShift action_254 action_390 (196) = happyShift action_255 action_390 (203) = happyShift action_59 action_390 (77) = happyGoto action_378 action_390 (78) = happyGoto action_238 action_390 (79) = happyGoto action_239 action_390 (80) = happyGoto action_240 action_390 (111) = happyGoto action_241 action_390 (113) = happyGoto action_242 action_390 (115) = happyGoto action_243 action_390 (122) = happyGoto action_28 action_390 (123) = happyGoto action_29 action_390 (124) = happyGoto action_30 action_390 (126) = happyGoto action_31 action_390 (132) = happyGoto action_244 action_390 (133) = happyGoto action_33 action_390 _ = happyFail action_391 _ = happyReduce_185 action_392 (143) = happyShift action_34 action_392 (144) = happyShift action_35 action_392 (145) = happyShift action_36 action_392 (146) = happyShift action_37 action_392 (147) = happyShift action_245 action_392 (152) = happyShift action_246 action_392 (153) = happyShift action_39 action_392 (154) = happyShift action_40 action_392 (155) = happyShift action_41 action_392 (156) = happyShift action_42 action_392 (157) = happyShift action_247 action_392 (163) = happyShift action_248 action_392 (166) = happyShift action_249 action_392 (172) = happyShift action_250 action_392 (177) = happyShift action_251 action_392 (180) = happyShift action_47 action_392 (181) = happyShift action_252 action_392 (186) = happyShift action_253 action_392 (188) = happyShift action_51 action_392 (189) = happyShift action_254 action_392 (196) = happyShift action_255 action_392 (203) = happyShift action_59 action_392 (75) = happyGoto action_442 action_392 (76) = happyGoto action_236 action_392 (77) = happyGoto action_237 action_392 (78) = happyGoto action_238 action_392 (79) = happyGoto action_239 action_392 (80) = happyGoto action_240 action_392 (111) = happyGoto action_241 action_392 (113) = happyGoto action_242 action_392 (115) = happyGoto action_243 action_392 (122) = happyGoto action_28 action_392 (123) = happyGoto action_29 action_392 (124) = happyGoto action_30 action_392 (126) = happyGoto action_31 action_392 (132) = happyGoto action_244 action_392 (133) = happyGoto action_33 action_392 _ = happyFail action_393 (143) = happyShift action_34 action_393 (144) = happyShift action_35 action_393 (145) = happyShift action_36 action_393 (146) = happyShift action_37 action_393 (147) = happyShift action_245 action_393 (152) = happyShift action_246 action_393 (153) = happyShift action_39 action_393 (154) = happyShift action_40 action_393 (155) = happyShift action_41 action_393 (156) = happyShift action_42 action_393 (157) = happyShift action_247 action_393 (163) = happyShift action_248 action_393 (166) = happyShift action_249 action_393 (172) = happyShift action_250 action_393 (177) = happyShift action_251 action_393 (180) = happyShift action_47 action_393 (181) = happyShift action_252 action_393 (186) = happyShift action_253 action_393 (188) = happyShift action_51 action_393 (189) = happyShift action_254 action_393 (196) = happyShift action_255 action_393 (203) = happyShift action_59 action_393 (75) = happyGoto action_441 action_393 (76) = happyGoto action_236 action_393 (77) = happyGoto action_237 action_393 (78) = happyGoto action_238 action_393 (79) = happyGoto action_239 action_393 (80) = happyGoto action_240 action_393 (111) = happyGoto action_241 action_393 (113) = happyGoto action_242 action_393 (115) = happyGoto action_243 action_393 (122) = happyGoto action_28 action_393 (123) = happyGoto action_29 action_393 (124) = happyGoto action_30 action_393 (126) = happyGoto action_31 action_393 (132) = happyGoto action_244 action_393 (133) = happyGoto action_33 action_393 _ = happyFail action_394 _ = happyReduce_187 action_395 (143) = happyShift action_34 action_395 (144) = happyShift action_35 action_395 (145) = happyShift action_36 action_395 (146) = happyShift action_37 action_395 (147) = happyShift action_245 action_395 (152) = happyShift action_246 action_395 (153) = happyShift action_39 action_395 (154) = happyShift action_40 action_395 (155) = happyShift action_41 action_395 (156) = happyShift action_42 action_395 (157) = happyShift action_247 action_395 (163) = happyShift action_248 action_395 (166) = happyShift action_249 action_395 (172) = happyShift action_250 action_395 (177) = happyShift action_251 action_395 (180) = happyShift action_47 action_395 (181) = happyShift action_252 action_395 (186) = happyShift action_253 action_395 (188) = happyShift action_51 action_395 (189) = happyShift action_254 action_395 (196) = happyShift action_255 action_395 (203) = happyShift action_59 action_395 (75) = happyGoto action_440 action_395 (76) = happyGoto action_236 action_395 (77) = happyGoto action_237 action_395 (78) = happyGoto action_238 action_395 (79) = happyGoto action_239 action_395 (80) = happyGoto action_240 action_395 (111) = happyGoto action_241 action_395 (113) = happyGoto action_242 action_395 (115) = happyGoto action_243 action_395 (122) = happyGoto action_28 action_395 (123) = happyGoto action_29 action_395 (124) = happyGoto action_30 action_395 (126) = happyGoto action_31 action_395 (132) = happyGoto action_244 action_395 (133) = happyGoto action_33 action_395 _ = happyFail action_396 (143) = happyShift action_34 action_396 (144) = happyShift action_35 action_396 (145) = happyShift action_36 action_396 (146) = happyShift action_37 action_396 (147) = happyShift action_245 action_396 (152) = happyShift action_246 action_396 (153) = happyShift action_39 action_396 (154) = happyShift action_40 action_396 (155) = happyShift action_41 action_396 (156) = happyShift action_42 action_396 (157) = happyShift action_247 action_396 (163) = happyShift action_248 action_396 (166) = happyShift action_249 action_396 (172) = happyShift action_250 action_396 (177) = happyShift action_251 action_396 (180) = happyShift action_47 action_396 (181) = happyShift action_252 action_396 (186) = happyShift action_253 action_396 (188) = happyShift action_51 action_396 (189) = happyShift action_254 action_396 (196) = happyShift action_255 action_396 (203) = happyShift action_59 action_396 (75) = happyGoto action_439 action_396 (76) = happyGoto action_236 action_396 (77) = happyGoto action_237 action_396 (78) = happyGoto action_238 action_396 (79) = happyGoto action_239 action_396 (80) = happyGoto action_240 action_396 (111) = happyGoto action_241 action_396 (113) = happyGoto action_242 action_396 (115) = happyGoto action_243 action_396 (122) = happyGoto action_28 action_396 (123) = happyGoto action_29 action_396 (124) = happyGoto action_30 action_396 (126) = happyGoto action_31 action_396 (132) = happyGoto action_244 action_396 (133) = happyGoto action_33 action_396 _ = happyReduce_199 action_397 (143) = happyShift action_34 action_397 (144) = happyShift action_35 action_397 (145) = happyShift action_36 action_397 (146) = happyShift action_37 action_397 (147) = happyShift action_245 action_397 (152) = happyShift action_246 action_397 (153) = happyShift action_39 action_397 (154) = happyShift action_40 action_397 (155) = happyShift action_41 action_397 (156) = happyShift action_42 action_397 (157) = happyShift action_247 action_397 (163) = happyShift action_248 action_397 (166) = happyShift action_249 action_397 (172) = happyShift action_250 action_397 (177) = happyShift action_251 action_397 (180) = happyShift action_47 action_397 (181) = happyShift action_252 action_397 (186) = happyShift action_253 action_397 (188) = happyShift action_51 action_397 (189) = happyShift action_254 action_397 (196) = happyShift action_405 action_397 (203) = happyShift action_59 action_397 (75) = happyGoto action_436 action_397 (76) = happyGoto action_401 action_397 (77) = happyGoto action_237 action_397 (78) = happyGoto action_238 action_397 (79) = happyGoto action_239 action_397 (80) = happyGoto action_240 action_397 (85) = happyGoto action_437 action_397 (86) = happyGoto action_438 action_397 (111) = happyGoto action_241 action_397 (113) = happyGoto action_242 action_397 (115) = happyGoto action_243 action_397 (122) = happyGoto action_28 action_397 (123) = happyGoto action_29 action_397 (124) = happyGoto action_30 action_397 (126) = happyGoto action_31 action_397 (132) = happyGoto action_244 action_397 (133) = happyGoto action_33 action_397 _ = happyFail action_398 (143) = happyShift action_34 action_398 (144) = happyShift action_35 action_398 (145) = happyShift action_36 action_398 (146) = happyShift action_37 action_398 (147) = happyShift action_245 action_398 (152) = happyShift action_246 action_398 (153) = happyShift action_39 action_398 (154) = happyShift action_40 action_398 (155) = happyShift action_41 action_398 (156) = happyShift action_42 action_398 (157) = happyShift action_247 action_398 (163) = happyShift action_248 action_398 (166) = happyShift action_249 action_398 (172) = happyShift action_250 action_398 (177) = happyShift action_251 action_398 (180) = happyShift action_47 action_398 (181) = happyShift action_252 action_398 (186) = happyShift action_253 action_398 (188) = happyShift action_51 action_398 (189) = happyShift action_254 action_398 (196) = happyShift action_255 action_398 (203) = happyShift action_59 action_398 (75) = happyGoto action_435 action_398 (76) = happyGoto action_236 action_398 (77) = happyGoto action_237 action_398 (78) = happyGoto action_238 action_398 (79) = happyGoto action_239 action_398 (80) = happyGoto action_240 action_398 (111) = happyGoto action_241 action_398 (113) = happyGoto action_242 action_398 (115) = happyGoto action_243 action_398 (122) = happyGoto action_28 action_398 (123) = happyGoto action_29 action_398 (124) = happyGoto action_30 action_398 (126) = happyGoto action_31 action_398 (132) = happyGoto action_244 action_398 (133) = happyGoto action_33 action_398 _ = happyFail action_399 (160) = happyShift action_434 action_399 (87) = happyGoto action_432 action_399 (135) = happyGoto action_433 action_399 _ = happyReduce_318 action_400 (159) = happyReduce_209 action_400 _ = happyReduce_225 action_401 (147) = happyShift action_117 action_401 (148) = happyShift action_99 action_401 (149) = happyShift action_100 action_401 (150) = happyShift action_101 action_401 (151) = happyShift action_102 action_401 (167) = happyShift action_118 action_401 (168) = happyShift action_104 action_401 (170) = happyShift action_318 action_401 (174) = happyShift action_431 action_401 (179) = happyShift action_105 action_401 (117) = happyGoto action_305 action_401 (119) = happyGoto action_306 action_401 (121) = happyGoto action_317 action_401 (127) = happyGoto action_114 action_401 (128) = happyGoto action_94 action_401 (129) = happyGoto action_115 action_401 (130) = happyGoto action_96 action_401 (131) = happyGoto action_97 action_401 _ = happyReduce_168 action_402 _ = happyReduce_227 action_403 (161) = happyShift action_430 action_403 _ = happyFail action_404 (159) = happyShift action_429 action_404 _ = happyFail action_405 (160) = happyShift action_289 action_405 (39) = happyGoto action_428 action_405 (135) = happyGoto action_288 action_405 _ = happyReduce_318 action_406 (1) = happyShift action_63 action_406 (162) = happyShift action_64 action_406 (136) = happyGoto action_427 action_406 _ = happyFail action_407 (143) = happyShift action_34 action_407 (144) = happyShift action_35 action_407 (145) = happyShift action_36 action_407 (146) = happyShift action_37 action_407 (147) = happyShift action_245 action_407 (152) = happyShift action_246 action_407 (153) = happyShift action_39 action_407 (154) = happyShift action_40 action_407 (155) = happyShift action_41 action_407 (156) = happyShift action_42 action_407 (157) = happyShift action_247 action_407 (163) = happyShift action_248 action_407 (166) = happyShift action_249 action_407 (172) = happyShift action_250 action_407 (177) = happyShift action_251 action_407 (180) = happyShift action_47 action_407 (181) = happyShift action_252 action_407 (186) = happyShift action_253 action_407 (188) = happyShift action_51 action_407 (189) = happyShift action_254 action_407 (196) = happyShift action_255 action_407 (203) = happyShift action_59 action_407 (75) = happyGoto action_426 action_407 (76) = happyGoto action_236 action_407 (77) = happyGoto action_237 action_407 (78) = happyGoto action_238 action_407 (79) = happyGoto action_239 action_407 (80) = happyGoto action_240 action_407 (111) = happyGoto action_241 action_407 (113) = happyGoto action_242 action_407 (115) = happyGoto action_243 action_407 (122) = happyGoto action_28 action_407 (123) = happyGoto action_29 action_407 (124) = happyGoto action_30 action_407 (126) = happyGoto action_31 action_407 (132) = happyGoto action_244 action_407 (133) = happyGoto action_33 action_407 _ = happyFail action_408 _ = happyReduce_80 action_409 (161) = happyShift action_425 action_409 _ = happyFail action_410 (159) = happyShift action_424 action_410 (7) = happyGoto action_423 action_410 _ = happyReduce_10 action_411 _ = happyReduce_82 action_412 (1) = happyShift action_63 action_412 (162) = happyShift action_64 action_412 (136) = happyGoto action_422 action_412 _ = happyFail action_413 (143) = happyShift action_34 action_413 (144) = happyShift action_35 action_413 (145) = happyShift action_36 action_413 (146) = happyShift action_37 action_413 (147) = happyShift action_245 action_413 (152) = happyShift action_246 action_413 (153) = happyShift action_39 action_413 (154) = happyShift action_40 action_413 (155) = happyShift action_41 action_413 (156) = happyShift action_42 action_413 (157) = happyShift action_247 action_413 (163) = happyShift action_248 action_413 (166) = happyShift action_249 action_413 (172) = happyShift action_250 action_413 (177) = happyShift action_251 action_413 (180) = happyShift action_47 action_413 (181) = happyShift action_252 action_413 (186) = happyShift action_253 action_413 (188) = happyShift action_51 action_413 (189) = happyShift action_254 action_413 (196) = happyShift action_255 action_413 (203) = happyShift action_59 action_413 (75) = happyGoto action_421 action_413 (76) = happyGoto action_236 action_413 (77) = happyGoto action_237 action_413 (78) = happyGoto action_238 action_413 (79) = happyGoto action_239 action_413 (80) = happyGoto action_240 action_413 (111) = happyGoto action_241 action_413 (113) = happyGoto action_242 action_413 (115) = happyGoto action_243 action_413 (122) = happyGoto action_28 action_413 (123) = happyGoto action_29 action_413 (124) = happyGoto action_30 action_413 (126) = happyGoto action_31 action_413 (132) = happyGoto action_244 action_413 (133) = happyGoto action_33 action_413 _ = happyFail action_414 _ = happyReduce_61 action_415 _ = happyReduce_284 action_416 _ = happyReduce_280 action_417 _ = happyReduce_21 action_418 _ = happyReduce_23 action_419 (143) = happyShift action_34 action_419 (144) = happyShift action_35 action_419 (145) = happyShift action_36 action_419 (146) = happyShift action_37 action_419 (157) = happyShift action_280 action_419 (180) = happyShift action_47 action_419 (188) = happyShift action_51 action_419 (203) = happyShift action_59 action_419 (14) = happyGoto action_420 action_419 (113) = happyGoto action_278 action_419 (115) = happyGoto action_279 action_419 (122) = happyGoto action_28 action_419 (123) = happyGoto action_29 action_419 (124) = happyGoto action_30 action_419 (126) = happyGoto action_31 action_419 _ = happyFail action_420 _ = happyReduce_25 action_421 _ = happyReduce_172 action_422 _ = happyReduce_87 action_423 _ = happyReduce_79 action_424 (143) = happyShift action_34 action_424 (144) = happyShift action_35 action_424 (145) = happyShift action_36 action_424 (146) = happyShift action_37 action_424 (147) = happyShift action_38 action_424 (153) = happyShift action_39 action_424 (154) = happyShift action_40 action_424 (155) = happyShift action_41 action_424 (156) = happyShift action_42 action_424 (157) = happyShift action_43 action_424 (163) = happyShift action_44 action_424 (166) = happyShift action_45 action_424 (177) = happyShift action_46 action_424 (180) = happyShift action_47 action_424 (188) = happyShift action_51 action_424 (192) = happyShift action_53 action_424 (193) = happyShift action_54 action_424 (194) = happyShift action_55 action_424 (203) = happyShift action_59 action_424 (27) = happyGoto action_15 action_424 (29) = happyGoto action_16 action_424 (38) = happyGoto action_522 action_424 (40) = happyGoto action_19 action_424 (41) = happyGoto action_20 action_424 (69) = happyGoto action_21 action_424 (70) = happyGoto action_22 action_424 (100) = happyGoto action_23 action_424 (101) = happyGoto action_24 action_424 (102) = happyGoto action_25 action_424 (113) = happyGoto action_26 action_424 (115) = happyGoto action_27 action_424 (122) = happyGoto action_28 action_424 (123) = happyGoto action_29 action_424 (124) = happyGoto action_30 action_424 (126) = happyGoto action_31 action_424 (132) = happyGoto action_32 action_424 (133) = happyGoto action_33 action_424 _ = happyReduce_9 action_425 _ = happyReduce_86 action_426 (187) = happyShift action_521 action_426 _ = happyFail action_427 _ = happyReduce_223 action_428 (191) = happyShift action_413 action_428 _ = happyReduce_210 action_429 (143) = happyShift action_34 action_429 (144) = happyShift action_35 action_429 (145) = happyShift action_36 action_429 (146) = happyShift action_37 action_429 (147) = happyShift action_245 action_429 (152) = happyShift action_246 action_429 (153) = happyShift action_39 action_429 (154) = happyShift action_40 action_429 (155) = happyShift action_41 action_429 (156) = happyShift action_42 action_429 (157) = happyShift action_247 action_429 (163) = happyShift action_248 action_429 (166) = happyShift action_249 action_429 (172) = happyShift action_250 action_429 (177) = happyShift action_251 action_429 (180) = happyShift action_47 action_429 (181) = happyShift action_252 action_429 (186) = happyShift action_253 action_429 (188) = happyShift action_51 action_429 (189) = happyShift action_254 action_429 (196) = happyShift action_405 action_429 (203) = happyShift action_59 action_429 (75) = happyGoto action_519 action_429 (76) = happyGoto action_401 action_429 (77) = happyGoto action_237 action_429 (78) = happyGoto action_238 action_429 (79) = happyGoto action_239 action_429 (80) = happyGoto action_240 action_429 (86) = happyGoto action_520 action_429 (111) = happyGoto action_241 action_429 (113) = happyGoto action_242 action_429 (115) = happyGoto action_243 action_429 (122) = happyGoto action_28 action_429 (123) = happyGoto action_29 action_429 (124) = happyGoto action_30 action_429 (126) = happyGoto action_31 action_429 (132) = happyGoto action_244 action_429 (133) = happyGoto action_33 action_429 _ = happyFail action_430 _ = happyReduce_222 action_431 (143) = happyShift action_34 action_431 (144) = happyShift action_35 action_431 (145) = happyShift action_36 action_431 (146) = happyShift action_37 action_431 (147) = happyShift action_245 action_431 (152) = happyShift action_246 action_431 (153) = happyShift action_39 action_431 (154) = happyShift action_40 action_431 (155) = happyShift action_41 action_431 (156) = happyShift action_42 action_431 (157) = happyShift action_247 action_431 (163) = happyShift action_248 action_431 (166) = happyShift action_249 action_431 (172) = happyShift action_250 action_431 (177) = happyShift action_251 action_431 (180) = happyShift action_47 action_431 (181) = happyShift action_252 action_431 (186) = happyShift action_253 action_431 (188) = happyShift action_51 action_431 (189) = happyShift action_254 action_431 (196) = happyShift action_255 action_431 (203) = happyShift action_59 action_431 (75) = happyGoto action_518 action_431 (76) = happyGoto action_236 action_431 (77) = happyGoto action_237 action_431 (78) = happyGoto action_238 action_431 (79) = happyGoto action_239 action_431 (80) = happyGoto action_240 action_431 (111) = happyGoto action_241 action_431 (113) = happyGoto action_242 action_431 (115) = happyGoto action_243 action_431 (122) = happyGoto action_28 action_431 (123) = happyGoto action_29 action_431 (124) = happyGoto action_30 action_431 (126) = happyGoto action_31 action_431 (132) = happyGoto action_244 action_431 (133) = happyGoto action_33 action_431 _ = happyFail action_432 _ = happyReduce_174 action_433 (143) = happyShift action_34 action_433 (144) = happyShift action_35 action_433 (145) = happyShift action_36 action_433 (146) = happyShift action_37 action_433 (147) = happyShift action_38 action_433 (153) = happyShift action_39 action_433 (154) = happyShift action_40 action_433 (155) = happyShift action_41 action_433 (156) = happyShift action_42 action_433 (157) = happyShift action_83 action_433 (163) = happyShift action_44 action_433 (166) = happyShift action_45 action_433 (177) = happyShift action_46 action_433 (180) = happyShift action_47 action_433 (188) = happyShift action_51 action_433 (203) = happyShift action_59 action_433 (88) = happyGoto action_517 action_433 (89) = happyGoto action_515 action_433 (100) = happyGoto action_516 action_433 (101) = happyGoto action_24 action_433 (102) = happyGoto action_25 action_433 (113) = happyGoto action_81 action_433 (115) = happyGoto action_27 action_433 (122) = happyGoto action_28 action_433 (123) = happyGoto action_29 action_433 (124) = happyGoto action_30 action_433 (126) = happyGoto action_31 action_433 (132) = happyGoto action_32 action_433 (133) = happyGoto action_33 action_433 _ = happyFail action_434 (143) = happyShift action_34 action_434 (144) = happyShift action_35 action_434 (145) = happyShift action_36 action_434 (146) = happyShift action_37 action_434 (147) = happyShift action_38 action_434 (153) = happyShift action_39 action_434 (154) = happyShift action_40 action_434 (155) = happyShift action_41 action_434 (156) = happyShift action_42 action_434 (157) = happyShift action_83 action_434 (163) = happyShift action_44 action_434 (166) = happyShift action_45 action_434 (177) = happyShift action_46 action_434 (180) = happyShift action_47 action_434 (188) = happyShift action_51 action_434 (203) = happyShift action_59 action_434 (88) = happyGoto action_514 action_434 (89) = happyGoto action_515 action_434 (100) = happyGoto action_516 action_434 (101) = happyGoto action_24 action_434 (102) = happyGoto action_25 action_434 (113) = happyGoto action_81 action_434 (115) = happyGoto action_27 action_434 (122) = happyGoto action_28 action_434 (123) = happyGoto action_29 action_434 (124) = happyGoto action_30 action_434 (126) = happyGoto action_31 action_434 (132) = happyGoto action_32 action_434 (133) = happyGoto action_33 action_434 _ = happyFail action_435 _ = happyReduce_171 action_436 _ = happyReduce_209 action_437 (165) = happyShift action_513 action_437 _ = happyReduce_203 action_438 _ = happyReduce_207 action_439 _ = happyReduce_201 action_440 (169) = happyShift action_512 action_440 _ = happyReduce_205 action_441 _ = happyReduce_204 action_442 _ = happyReduce_196 action_443 _ = happyReduce_188 action_444 _ = happyReduce_195 action_445 _ = happyReduce_189 action_446 _ = happyReduce_268 action_447 (158) = happyShift action_511 action_447 (165) = happyShift action_208 action_447 _ = happyFail action_448 _ = happyReduce_267 action_449 (143) = happyShift action_34 action_449 (144) = happyShift action_35 action_449 (145) = happyShift action_36 action_449 (146) = happyShift action_37 action_449 (147) = happyShift action_245 action_449 (152) = happyShift action_246 action_449 (153) = happyShift action_39 action_449 (154) = happyShift action_40 action_449 (155) = happyShift action_41 action_449 (156) = happyShift action_42 action_449 (157) = happyShift action_247 action_449 (163) = happyShift action_248 action_449 (166) = happyShift action_249 action_449 (172) = happyShift action_250 action_449 (177) = happyShift action_251 action_449 (180) = happyShift action_47 action_449 (181) = happyShift action_252 action_449 (186) = happyShift action_253 action_449 (188) = happyShift action_51 action_449 (189) = happyShift action_254 action_449 (196) = happyShift action_255 action_449 (203) = happyShift action_59 action_449 (75) = happyGoto action_510 action_449 (76) = happyGoto action_236 action_449 (77) = happyGoto action_237 action_449 (78) = happyGoto action_238 action_449 (79) = happyGoto action_239 action_449 (80) = happyGoto action_240 action_449 (111) = happyGoto action_241 action_449 (113) = happyGoto action_242 action_449 (115) = happyGoto action_243 action_449 (122) = happyGoto action_28 action_449 (123) = happyGoto action_29 action_449 (124) = happyGoto action_30 action_449 (126) = happyGoto action_31 action_449 (132) = happyGoto action_244 action_449 (133) = happyGoto action_33 action_449 _ = happyFail action_450 (143) = happyShift action_34 action_450 (144) = happyShift action_35 action_450 (157) = happyShift action_136 action_450 (180) = happyShift action_47 action_450 (188) = happyShift action_51 action_450 (203) = happyShift action_59 action_450 (98) = happyGoto action_509 action_450 (113) = happyGoto action_382 action_450 (122) = happyGoto action_28 action_450 (123) = happyGoto action_29 action_450 _ = happyFail action_451 _ = happyReduce_180 action_452 _ = happyReduce_167 action_453 _ = happyReduce_166 action_454 _ = happyReduce_75 action_455 _ = happyReduce_76 action_456 _ = happyReduce_145 action_457 _ = happyReduce_147 action_458 (161) = happyShift action_508 action_458 _ = happyFail action_459 (159) = happyShift action_507 action_459 (7) = happyGoto action_506 action_459 _ = happyReduce_10 action_460 _ = happyReduce_90 action_461 (1) = happyShift action_63 action_461 (162) = happyShift action_64 action_461 (136) = happyGoto action_505 action_461 _ = happyFail action_462 _ = happyReduce_116 action_463 _ = happyReduce_128 action_464 (158) = happyShift action_504 action_464 _ = happyFail action_465 (143) = happyShift action_34 action_465 (144) = happyShift action_35 action_465 (157) = happyShift action_136 action_465 (180) = happyShift action_47 action_465 (188) = happyShift action_51 action_465 (203) = happyShift action_59 action_465 (41) = happyGoto action_501 action_465 (58) = happyGoto action_502 action_465 (59) = happyGoto action_503 action_465 (113) = happyGoto action_460 action_465 (122) = happyGoto action_28 action_465 (123) = happyGoto action_29 action_465 _ = happyFail action_466 (143) = happyShift action_34 action_466 (145) = happyShift action_36 action_466 (146) = happyShift action_71 action_466 (157) = happyShift action_182 action_466 (163) = happyShift action_183 action_466 (179) = happyShift action_367 action_466 (180) = happyShift action_47 action_466 (188) = happyShift action_51 action_466 (203) = happyShift action_59 action_466 (43) = happyGoto action_499 action_466 (44) = happyGoto action_177 action_466 (45) = happyGoto action_178 action_466 (57) = happyGoto action_500 action_466 (123) = happyGoto action_180 action_466 (125) = happyGoto action_68 action_466 (126) = happyGoto action_69 action_466 (139) = happyGoto action_70 action_466 (142) = happyGoto action_181 action_466 _ = happyFail action_467 (145) = happyShift action_36 action_467 (126) = happyGoto action_284 action_467 _ = happyFail action_468 _ = happyReduce_125 action_469 _ = happyReduce_124 action_470 (143) = happyShift action_34 action_470 (145) = happyShift action_36 action_470 (146) = happyShift action_71 action_470 (157) = happyShift action_182 action_470 (163) = happyShift action_183 action_470 (180) = happyShift action_47 action_470 (188) = happyShift action_51 action_470 (203) = happyShift action_59 action_470 (44) = happyGoto action_498 action_470 (45) = happyGoto action_178 action_470 (123) = happyGoto action_180 action_470 (125) = happyGoto action_68 action_470 (126) = happyGoto action_69 action_470 (139) = happyGoto action_70 action_470 (142) = happyGoto action_181 action_470 _ = happyFail action_471 (143) = happyShift action_34 action_471 (145) = happyShift action_36 action_471 (146) = happyShift action_71 action_471 (157) = happyShift action_182 action_471 (163) = happyShift action_183 action_471 (180) = happyShift action_47 action_471 (188) = happyShift action_51 action_471 (203) = happyShift action_59 action_471 (44) = happyGoto action_497 action_471 (45) = happyGoto action_178 action_471 (123) = happyGoto action_180 action_471 (125) = happyGoto action_68 action_471 (126) = happyGoto action_69 action_471 (139) = happyGoto action_70 action_471 (142) = happyGoto action_181 action_471 _ = happyFail action_472 (143) = happyShift action_34 action_472 (145) = happyShift action_36 action_472 (157) = happyShift action_147 action_472 (165) = happyShift action_480 action_472 (180) = happyShift action_47 action_472 (188) = happyShift action_51 action_472 (203) = happyShift action_59 action_472 (10) = happyGoto action_473 action_472 (21) = happyGoto action_496 action_472 (22) = happyGoto action_475 action_472 (23) = happyGoto action_476 action_472 (112) = happyGoto action_477 action_472 (123) = happyGoto action_146 action_472 (126) = happyGoto action_478 action_472 (138) = happyGoto action_479 action_472 _ = happyReduce_16 action_473 _ = happyReduce_40 action_474 (165) = happyShift action_480 action_474 (10) = happyGoto action_495 action_474 _ = happyReduce_16 action_475 (165) = happyShift action_494 action_475 (10) = happyGoto action_493 action_475 _ = happyReduce_16 action_476 _ = happyReduce_43 action_477 _ = happyReduce_44 action_478 _ = happyReduce_322 action_479 (157) = happyShift action_492 action_479 _ = happyReduce_45 action_480 _ = happyReduce_15 action_481 _ = happyReduce_151 action_482 _ = happyReduce_150 action_483 _ = happyReduce_153 action_484 (143) = happyShift action_34 action_484 (144) = happyShift action_35 action_484 (145) = happyShift action_36 action_484 (146) = happyShift action_37 action_484 (147) = happyShift action_38 action_484 (153) = happyShift action_39 action_484 (154) = happyShift action_40 action_484 (155) = happyShift action_41 action_484 (156) = happyShift action_42 action_484 (157) = happyShift action_43 action_484 (163) = happyShift action_44 action_484 (166) = happyShift action_45 action_484 (177) = happyShift action_46 action_484 (180) = happyShift action_47 action_484 (188) = happyShift action_51 action_484 (203) = happyShift action_59 action_484 (69) = happyGoto action_491 action_484 (70) = happyGoto action_22 action_484 (100) = happyGoto action_23 action_484 (101) = happyGoto action_24 action_484 (102) = happyGoto action_25 action_484 (113) = happyGoto action_92 action_484 (115) = happyGoto action_27 action_484 (122) = happyGoto action_28 action_484 (123) = happyGoto action_29 action_484 (124) = happyGoto action_30 action_484 (126) = happyGoto action_31 action_484 (132) = happyGoto action_32 action_484 (133) = happyGoto action_33 action_484 _ = happyReduce_9 action_485 _ = happyReduce_325 action_486 _ = happyReduce_135 action_487 (145) = happyShift action_36 action_487 (146) = happyShift action_71 action_487 (158) = happyShift action_490 action_487 (62) = happyGoto action_488 action_487 (125) = happyGoto action_485 action_487 (126) = happyGoto action_69 action_487 (139) = happyGoto action_70 action_487 (141) = happyGoto action_489 action_487 _ = happyFail action_488 (158) = happyShift action_546 action_488 (165) = happyShift action_547 action_488 _ = happyFail action_489 _ = happyReduce_139 action_490 _ = happyReduce_136 action_491 _ = happyReduce_148 action_492 (143) = happyShift action_34 action_492 (145) = happyShift action_36 action_492 (157) = happyShift action_543 action_492 (158) = happyShift action_544 action_492 (169) = happyShift action_545 action_492 (180) = happyShift action_47 action_492 (188) = happyShift action_51 action_492 (203) = happyShift action_59 action_492 (24) = happyGoto action_538 action_492 (25) = happyGoto action_539 action_492 (112) = happyGoto action_540 action_492 (114) = happyGoto action_541 action_492 (123) = happyGoto action_146 action_492 (126) = happyGoto action_542 action_492 _ = happyFail action_493 _ = happyReduce_41 action_494 (143) = happyShift action_34 action_494 (145) = happyShift action_36 action_494 (157) = happyShift action_147 action_494 (180) = happyShift action_47 action_494 (188) = happyShift action_51 action_494 (203) = happyShift action_59 action_494 (23) = happyGoto action_537 action_494 (112) = happyGoto action_477 action_494 (123) = happyGoto action_146 action_494 (126) = happyGoto action_478 action_494 (138) = happyGoto action_479 action_494 _ = happyReduce_15 action_495 (158) = happyShift action_536 action_495 _ = happyFail action_496 (165) = happyShift action_480 action_496 (10) = happyGoto action_535 action_496 _ = happyReduce_16 action_497 _ = happyReduce_123 action_498 _ = happyReduce_126 action_499 (143) = happyShift action_34 action_499 (145) = happyShift action_36 action_499 (146) = happyShift action_71 action_499 (157) = happyShift action_182 action_499 (163) = happyShift action_183 action_499 (180) = happyShift action_47 action_499 (188) = happyShift action_51 action_499 (203) = happyShift action_59 action_499 (44) = happyGoto action_220 action_499 (45) = happyGoto action_178 action_499 (123) = happyGoto action_180 action_499 (125) = happyGoto action_68 action_499 (126) = happyGoto action_69 action_499 (139) = happyGoto action_70 action_499 (142) = happyGoto action_181 action_499 _ = happyReduce_127 action_500 _ = happyReduce_119 action_501 (165) = happyShift action_121 action_501 (170) = happyShift action_534 action_501 _ = happyFail action_502 (161) = happyShift action_532 action_502 (165) = happyShift action_533 action_502 _ = happyFail action_503 _ = happyReduce_130 action_504 _ = happyReduce_276 action_505 _ = happyReduce_141 action_506 _ = happyReduce_144 action_507 (143) = happyShift action_34 action_507 (144) = happyShift action_35 action_507 (145) = happyShift action_36 action_507 (146) = happyShift action_37 action_507 (147) = happyShift action_38 action_507 (153) = happyShift action_39 action_507 (154) = happyShift action_40 action_507 (155) = happyShift action_41 action_507 (156) = happyShift action_42 action_507 (157) = happyShift action_43 action_507 (163) = happyShift action_44 action_507 (166) = happyShift action_45 action_507 (177) = happyShift action_46 action_507 (180) = happyShift action_47 action_507 (188) = happyShift action_51 action_507 (203) = happyShift action_59 action_507 (40) = happyGoto action_530 action_507 (41) = happyGoto action_20 action_507 (66) = happyGoto action_531 action_507 (69) = happyGoto action_352 action_507 (70) = happyGoto action_22 action_507 (100) = happyGoto action_23 action_507 (101) = happyGoto action_24 action_507 (102) = happyGoto action_25 action_507 (113) = happyGoto action_26 action_507 (115) = happyGoto action_27 action_507 (122) = happyGoto action_28 action_507 (123) = happyGoto action_29 action_507 (124) = happyGoto action_30 action_507 (126) = happyGoto action_31 action_507 (132) = happyGoto action_32 action_507 (133) = happyGoto action_33 action_507 _ = happyReduce_9 action_508 _ = happyReduce_140 action_509 _ = happyReduce_230 action_510 _ = happyReduce_232 action_511 _ = happyReduce_269 action_512 (143) = happyShift action_34 action_512 (144) = happyShift action_35 action_512 (145) = happyShift action_36 action_512 (146) = happyShift action_37 action_512 (147) = happyShift action_245 action_512 (152) = happyShift action_246 action_512 (153) = happyShift action_39 action_512 (154) = happyShift action_40 action_512 (155) = happyShift action_41 action_512 (156) = happyShift action_42 action_512 (157) = happyShift action_247 action_512 (163) = happyShift action_248 action_512 (166) = happyShift action_249 action_512 (172) = happyShift action_250 action_512 (177) = happyShift action_251 action_512 (180) = happyShift action_47 action_512 (181) = happyShift action_252 action_512 (186) = happyShift action_253 action_512 (188) = happyShift action_51 action_512 (189) = happyShift action_254 action_512 (196) = happyShift action_255 action_512 (203) = happyShift action_59 action_512 (75) = happyGoto action_529 action_512 (76) = happyGoto action_236 action_512 (77) = happyGoto action_237 action_512 (78) = happyGoto action_238 action_512 (79) = happyGoto action_239 action_512 (80) = happyGoto action_240 action_512 (111) = happyGoto action_241 action_512 (113) = happyGoto action_242 action_512 (115) = happyGoto action_243 action_512 (122) = happyGoto action_28 action_512 (123) = happyGoto action_29 action_512 (124) = happyGoto action_30 action_512 (126) = happyGoto action_31 action_512 (132) = happyGoto action_244 action_512 (133) = happyGoto action_33 action_512 _ = happyReduce_200 action_513 (143) = happyShift action_34 action_513 (144) = happyShift action_35 action_513 (145) = happyShift action_36 action_513 (146) = happyShift action_37 action_513 (147) = happyShift action_245 action_513 (152) = happyShift action_246 action_513 (153) = happyShift action_39 action_513 (154) = happyShift action_40 action_513 (155) = happyShift action_41 action_513 (156) = happyShift action_42 action_513 (157) = happyShift action_247 action_513 (163) = happyShift action_248 action_513 (166) = happyShift action_249 action_513 (172) = happyShift action_250 action_513 (177) = happyShift action_251 action_513 (180) = happyShift action_47 action_513 (181) = happyShift action_252 action_513 (186) = happyShift action_253 action_513 (188) = happyShift action_51 action_513 (189) = happyShift action_254 action_513 (196) = happyShift action_405 action_513 (203) = happyShift action_59 action_513 (75) = happyGoto action_436 action_513 (76) = happyGoto action_401 action_513 (77) = happyGoto action_237 action_513 (78) = happyGoto action_238 action_513 (79) = happyGoto action_239 action_513 (80) = happyGoto action_240 action_513 (86) = happyGoto action_528 action_513 (111) = happyGoto action_241 action_513 (113) = happyGoto action_242 action_513 (115) = happyGoto action_243 action_513 (122) = happyGoto action_28 action_513 (123) = happyGoto action_29 action_513 (124) = happyGoto action_30 action_513 (126) = happyGoto action_31 action_513 (132) = happyGoto action_244 action_513 (133) = happyGoto action_33 action_513 _ = happyFail action_514 (159) = happyShift action_525 action_514 (7) = happyGoto action_527 action_514 _ = happyReduce_10 action_515 _ = happyReduce_214 action_516 (149) = happyShift action_100 action_516 (151) = happyShift action_102 action_516 (167) = happyShift action_173 action_516 (119) = happyGoto action_113 action_516 (127) = happyGoto action_114 action_516 (128) = happyGoto action_94 action_516 (134) = happyGoto action_526 action_516 _ = happyReduce_317 action_517 (159) = happyShift action_525 action_517 (7) = happyGoto action_524 action_517 _ = happyReduce_10 action_518 _ = happyReduce_208 action_519 (159) = happyReduce_209 action_519 _ = happyReduce_224 action_520 _ = happyReduce_226 action_521 (143) = happyShift action_34 action_521 (144) = happyShift action_35 action_521 (145) = happyShift action_36 action_521 (146) = happyShift action_37 action_521 (147) = happyShift action_245 action_521 (152) = happyShift action_246 action_521 (153) = happyShift action_39 action_521 (154) = happyShift action_40 action_521 (155) = happyShift action_41 action_521 (156) = happyShift action_42 action_521 (157) = happyShift action_247 action_521 (163) = happyShift action_248 action_521 (166) = happyShift action_249 action_521 (172) = happyShift action_250 action_521 (177) = happyShift action_251 action_521 (180) = happyShift action_47 action_521 (181) = happyShift action_252 action_521 (186) = happyShift action_253 action_521 (188) = happyShift action_51 action_521 (189) = happyShift action_254 action_521 (196) = happyShift action_255 action_521 (203) = happyShift action_59 action_521 (75) = happyGoto action_523 action_521 (76) = happyGoto action_236 action_521 (77) = happyGoto action_237 action_521 (78) = happyGoto action_238 action_521 (79) = happyGoto action_239 action_521 (80) = happyGoto action_240 action_521 (111) = happyGoto action_241 action_521 (113) = happyGoto action_242 action_521 (115) = happyGoto action_243 action_521 (122) = happyGoto action_28 action_521 (123) = happyGoto action_29 action_521 (124) = happyGoto action_30 action_521 (126) = happyGoto action_31 action_521 (132) = happyGoto action_244 action_521 (133) = happyGoto action_33 action_521 _ = happyFail action_522 _ = happyReduce_81 action_523 _ = happyReduce_173 action_524 (1) = happyShift action_63 action_524 (162) = happyShift action_64 action_524 (136) = happyGoto action_565 action_524 _ = happyFail action_525 (143) = happyShift action_34 action_525 (144) = happyShift action_35 action_525 (145) = happyShift action_36 action_525 (146) = happyShift action_37 action_525 (147) = happyShift action_38 action_525 (153) = happyShift action_39 action_525 (154) = happyShift action_40 action_525 (155) = happyShift action_41 action_525 (156) = happyShift action_42 action_525 (157) = happyShift action_83 action_525 (163) = happyShift action_44 action_525 (166) = happyShift action_45 action_525 (177) = happyShift action_46 action_525 (180) = happyShift action_47 action_525 (188) = happyShift action_51 action_525 (203) = happyShift action_59 action_525 (89) = happyGoto action_564 action_525 (100) = happyGoto action_516 action_525 (101) = happyGoto action_24 action_525 (102) = happyGoto action_25 action_525 (113) = happyGoto action_81 action_525 (115) = happyGoto action_27 action_525 (122) = happyGoto action_28 action_525 (123) = happyGoto action_29 action_525 (124) = happyGoto action_30 action_525 (126) = happyGoto action_31 action_525 (132) = happyGoto action_32 action_525 (133) = happyGoto action_33 action_525 _ = happyReduce_9 action_526 (173) = happyShift action_562 action_526 (175) = happyShift action_563 action_526 (90) = happyGoto action_559 action_526 (91) = happyGoto action_560 action_526 (92) = happyGoto action_561 action_526 _ = happyFail action_527 (161) = happyShift action_558 action_527 _ = happyFail action_528 _ = happyReduce_206 action_529 _ = happyReduce_202 action_530 _ = happyReduce_146 action_531 (159) = happyShift action_484 action_531 (7) = happyGoto action_557 action_531 _ = happyReduce_10 action_532 _ = happyReduce_120 action_533 (143) = happyShift action_34 action_533 (144) = happyShift action_35 action_533 (157) = happyShift action_136 action_533 (180) = happyShift action_47 action_533 (188) = happyShift action_51 action_533 (203) = happyShift action_59 action_533 (41) = happyGoto action_501 action_533 (59) = happyGoto action_556 action_533 (113) = happyGoto action_460 action_533 (122) = happyGoto action_28 action_533 (123) = happyGoto action_29 action_533 _ = happyFail action_534 (143) = happyShift action_34 action_534 (145) = happyShift action_36 action_534 (146) = happyShift action_71 action_534 (157) = happyShift action_182 action_534 (163) = happyShift action_183 action_534 (179) = happyShift action_555 action_534 (180) = happyShift action_47 action_534 (188) = happyShift action_51 action_534 (203) = happyShift action_59 action_534 (42) = happyGoto action_553 action_534 (43) = happyGoto action_176 action_534 (44) = happyGoto action_177 action_534 (45) = happyGoto action_178 action_534 (60) = happyGoto action_554 action_534 (123) = happyGoto action_180 action_534 (125) = happyGoto action_68 action_534 (126) = happyGoto action_69 action_534 (139) = happyGoto action_70 action_534 (142) = happyGoto action_181 action_534 _ = happyFail action_535 (158) = happyShift action_552 action_535 _ = happyFail action_536 _ = happyReduce_38 action_537 _ = happyReduce_42 action_538 (158) = happyShift action_550 action_538 (165) = happyShift action_551 action_538 _ = happyFail action_539 _ = happyReduce_50 action_540 _ = happyReduce_51 action_541 _ = happyReduce_52 action_542 _ = happyReduce_275 action_543 (147) = happyShift action_117 action_543 (148) = happyShift action_99 action_543 (149) = happyShift action_100 action_543 (168) = happyShift action_104 action_543 (179) = happyShift action_105 action_543 (128) = happyGoto action_464 action_543 (130) = happyGoto action_260 action_543 _ = happyFail action_544 _ = happyReduce_47 action_545 (158) = happyShift action_549 action_545 _ = happyFail action_546 _ = happyReduce_137 action_547 (145) = happyShift action_36 action_547 (146) = happyShift action_71 action_547 (125) = happyGoto action_485 action_547 (126) = happyGoto action_69 action_547 (139) = happyGoto action_70 action_547 (141) = happyGoto action_548 action_547 _ = happyFail action_548 _ = happyReduce_138 action_549 _ = happyReduce_46 action_550 _ = happyReduce_48 action_551 (143) = happyShift action_34 action_551 (145) = happyShift action_36 action_551 (157) = happyShift action_543 action_551 (180) = happyShift action_47 action_551 (188) = happyShift action_51 action_551 (203) = happyShift action_59 action_551 (25) = happyGoto action_571 action_551 (112) = happyGoto action_540 action_551 (114) = happyGoto action_541 action_551 (123) = happyGoto action_146 action_551 (126) = happyGoto action_542 action_551 _ = happyFail action_552 _ = happyReduce_39 action_553 _ = happyReduce_132 action_554 _ = happyReduce_131 action_555 (143) = happyShift action_34 action_555 (145) = happyShift action_36 action_555 (146) = happyShift action_71 action_555 (157) = happyShift action_182 action_555 (163) = happyShift action_183 action_555 (180) = happyShift action_47 action_555 (188) = happyShift action_51 action_555 (203) = happyShift action_59 action_555 (44) = happyGoto action_570 action_555 (45) = happyGoto action_178 action_555 (123) = happyGoto action_180 action_555 (125) = happyGoto action_68 action_555 (126) = happyGoto action_69 action_555 (139) = happyGoto action_70 action_555 (142) = happyGoto action_181 action_555 _ = happyFail action_556 _ = happyReduce_129 action_557 _ = happyReduce_143 action_558 _ = happyReduce_211 action_559 (202) = happyShift action_569 action_559 _ = happyReduce_215 action_560 (173) = happyShift action_562 action_560 (92) = happyGoto action_568 action_560 _ = happyReduce_218 action_561 _ = happyReduce_220 action_562 (134) = happyGoto action_567 action_562 _ = happyReduce_317 action_563 (143) = happyShift action_34 action_563 (144) = happyShift action_35 action_563 (145) = happyShift action_36 action_563 (146) = happyShift action_37 action_563 (147) = happyShift action_245 action_563 (152) = happyShift action_246 action_563 (153) = happyShift action_39 action_563 (154) = happyShift action_40 action_563 (155) = happyShift action_41 action_563 (156) = happyShift action_42 action_563 (157) = happyShift action_247 action_563 (163) = happyShift action_248 action_563 (166) = happyShift action_249 action_563 (172) = happyShift action_250 action_563 (177) = happyShift action_251 action_563 (180) = happyShift action_47 action_563 (181) = happyShift action_252 action_563 (186) = happyShift action_253 action_563 (188) = happyShift action_51 action_563 (189) = happyShift action_254 action_563 (196) = happyShift action_255 action_563 (203) = happyShift action_59 action_563 (75) = happyGoto action_566 action_563 (76) = happyGoto action_236 action_563 (77) = happyGoto action_237 action_563 (78) = happyGoto action_238 action_563 (79) = happyGoto action_239 action_563 (80) = happyGoto action_240 action_563 (111) = happyGoto action_241 action_563 (113) = happyGoto action_242 action_563 (115) = happyGoto action_243 action_563 (122) = happyGoto action_28 action_563 (123) = happyGoto action_29 action_563 (124) = happyGoto action_30 action_563 (126) = happyGoto action_31 action_563 (132) = happyGoto action_244 action_563 (133) = happyGoto action_33 action_563 _ = happyFail action_564 _ = happyReduce_213 action_565 _ = happyReduce_212 action_566 _ = happyReduce_217 action_567 (143) = happyShift action_34 action_567 (144) = happyShift action_35 action_567 (145) = happyShift action_36 action_567 (146) = happyShift action_37 action_567 (147) = happyShift action_245 action_567 (152) = happyShift action_246 action_567 (153) = happyShift action_39 action_567 (154) = happyShift action_40 action_567 (155) = happyShift action_41 action_567 (156) = happyShift action_42 action_567 (157) = happyShift action_247 action_567 (163) = happyShift action_248 action_567 (166) = happyShift action_249 action_567 (172) = happyShift action_250 action_567 (177) = happyShift action_251 action_567 (180) = happyShift action_47 action_567 (181) = happyShift action_252 action_567 (186) = happyShift action_253 action_567 (188) = happyShift action_51 action_567 (189) = happyShift action_254 action_567 (196) = happyShift action_255 action_567 (203) = happyShift action_59 action_567 (75) = happyGoto action_573 action_567 (76) = happyGoto action_236 action_567 (77) = happyGoto action_237 action_567 (78) = happyGoto action_238 action_567 (79) = happyGoto action_239 action_567 (80) = happyGoto action_240 action_567 (111) = happyGoto action_241 action_567 (113) = happyGoto action_242 action_567 (115) = happyGoto action_243 action_567 (122) = happyGoto action_28 action_567 (123) = happyGoto action_29 action_567 (124) = happyGoto action_30 action_567 (126) = happyGoto action_31 action_567 (132) = happyGoto action_244 action_567 (133) = happyGoto action_33 action_567 _ = happyFail action_568 _ = happyReduce_219 action_569 (160) = happyShift action_289 action_569 (39) = happyGoto action_572 action_569 (135) = happyGoto action_288 action_569 _ = happyReduce_318 action_570 _ = happyReduce_133 action_571 _ = happyReduce_49 action_572 _ = happyReduce_216 action_573 (175) = happyShift action_574 action_573 _ = happyFail action_574 (143) = happyShift action_34 action_574 (144) = happyShift action_35 action_574 (145) = happyShift action_36 action_574 (146) = happyShift action_37 action_574 (147) = happyShift action_245 action_574 (152) = happyShift action_246 action_574 (153) = happyShift action_39 action_574 (154) = happyShift action_40 action_574 (155) = happyShift action_41 action_574 (156) = happyShift action_42 action_574 (157) = happyShift action_247 action_574 (163) = happyShift action_248 action_574 (166) = happyShift action_249 action_574 (172) = happyShift action_250 action_574 (177) = happyShift action_251 action_574 (180) = happyShift action_47 action_574 (181) = happyShift action_252 action_574 (186) = happyShift action_253 action_574 (188) = happyShift action_51 action_574 (189) = happyShift action_254 action_574 (196) = happyShift action_255 action_574 (203) = happyShift action_59 action_574 (75) = happyGoto action_575 action_574 (76) = happyGoto action_236 action_574 (77) = happyGoto action_237 action_574 (78) = happyGoto action_238 action_574 (79) = happyGoto action_239 action_574 (80) = happyGoto action_240 action_574 (111) = happyGoto action_241 action_574 (113) = happyGoto action_242 action_574 (115) = happyGoto action_243 action_574 (122) = happyGoto action_28 action_574 (123) = happyGoto action_29 action_574 (124) = happyGoto action_30 action_574 (126) = happyGoto action_31 action_574 (132) = happyGoto action_244 action_574 (133) = happyGoto action_33 action_574 _ = happyFail action_575 _ = happyReduce_221 happyReduce_1 = happyReduce 6 4 happyReduction_1 happyReduction_1 ((HappyAbsSyn5 happy_var_6) `HappyStk` _ `HappyStk` (HappyAbsSyn8 happy_var_4) `HappyStk` (HappyAbsSyn137 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn134 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn4 (hsModule happy_var_1 happy_var_3 happy_var_4 happy_var_6 ) `HappyStk` happyRest happyReduce_2 = happySpecReduce_2 4 happyReduction_2 happyReduction_2 (HappyAbsSyn5 happy_var_2) (HappyAbsSyn134 happy_var_1) = HappyAbsSyn4 (hsModule happy_var_1 main_mod Nothing happy_var_2 ) happyReduction_2 _ _ = notHappyAtAll happyReduce_3 = happySpecReduce_3 5 happyReduction_3 happyReduction_3 _ (HappyAbsSyn5 happy_var_2) _ = HappyAbsSyn5 (happy_var_2 ) happyReduction_3 _ _ _ = notHappyAtAll happyReduce_4 = happySpecReduce_3 5 happyReduction_4 happyReduction_4 _ (HappyAbsSyn5 happy_var_2) _ = HappyAbsSyn5 (happy_var_2 ) happyReduction_4 _ _ _ = notHappyAtAll happyReduce_5 = happyReduce 4 6 happyReduction_5 happyReduction_5 (_ `HappyStk` (HappyAbsSyn26 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn15 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn5 ((happy_var_1, happy_var_3) ) `HappyStk` happyRest happyReduce_6 = happySpecReduce_2 6 happyReduction_6 happyReduction_6 _ (HappyAbsSyn26 happy_var_1) = HappyAbsSyn5 (([], happy_var_1) ) happyReduction_6 _ _ = notHappyAtAll happyReduce_7 = happySpecReduce_2 6 happyReduction_7 happyReduction_7 _ (HappyAbsSyn15 happy_var_1) = HappyAbsSyn5 ((happy_var_1, []) ) happyReduction_7 _ _ = notHappyAtAll happyReduce_8 = happySpecReduce_0 6 happyReduction_8 happyReduction_8 = HappyAbsSyn5 (([], []) ) happyReduce_9 = happySpecReduce_1 7 happyReduction_9 happyReduction_9 _ = HappyAbsSyn7 (() ) happyReduce_10 = happySpecReduce_0 7 happyReduction_10 happyReduction_10 = HappyAbsSyn7 (() ) happyReduce_11 = happySpecReduce_1 8 happyReduction_11 happyReduction_11 (HappyAbsSyn9 happy_var_1) = HappyAbsSyn8 (Just happy_var_1 ) happyReduction_11 _ = notHappyAtAll happyReduce_12 = happySpecReduce_0 8 happyReduction_12 happyReduction_12 = HappyAbsSyn8 (Nothing ) happyReduce_13 = happyReduce 4 9 happyReduction_13 happyReduction_13 (_ `HappyStk` _ `HappyStk` (HappyAbsSyn9 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn9 (reverse happy_var_2 ) `HappyStk` happyRest happyReduce_14 = happySpecReduce_2 9 happyReduction_14 happyReduction_14 _ _ = HappyAbsSyn9 ([] ) happyReduce_15 = happySpecReduce_1 10 happyReduction_15 happyReduction_15 _ = HappyAbsSyn7 (() ) happyReduce_16 = happySpecReduce_0 10 happyReduction_16 happyReduction_16 = HappyAbsSyn7 (() ) happyReduce_17 = happySpecReduce_3 11 happyReduction_17 happyReduction_17 (HappyAbsSyn12 happy_var_3) _ (HappyAbsSyn9 happy_var_1) = HappyAbsSyn9 (happy_var_3 : happy_var_1 ) happyReduction_17 _ _ _ = notHappyAtAll happyReduce_18 = happySpecReduce_1 11 happyReduction_18 happyReduction_18 (HappyAbsSyn12 happy_var_1) = HappyAbsSyn9 ([happy_var_1] ) happyReduction_18 _ = notHappyAtAll happyReduce_19 = happySpecReduce_1 12 happyReduction_19 happyReduction_19 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn12 (HsEVar happy_var_1 ) happyReduction_19 _ = notHappyAtAll happyReduce_20 = happySpecReduce_1 12 happyReduction_20 happyReduction_20 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn12 (HsEAbs happy_var_1 ) happyReduction_20 _ = notHappyAtAll happyReduce_21 = happyReduce 4 12 happyReduction_21 happyReduction_21 (_ `HappyStk` _ `HappyStk` _ `HappyStk` (HappyAbsSyn14 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn12 (HsEThingAll happy_var_1 ) `HappyStk` happyRest happyReduce_22 = happySpecReduce_3 12 happyReduction_22 happyReduction_22 _ _ (HappyAbsSyn14 happy_var_1) = HappyAbsSyn12 (HsEThingWith happy_var_1 [] ) happyReduction_22 _ _ _ = notHappyAtAll happyReduce_23 = happyReduce 4 12 happyReduction_23 happyReduction_23 (_ `HappyStk` (HappyAbsSyn13 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn14 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn12 (HsEThingWith happy_var_1 (reverse happy_var_3) ) `HappyStk` happyRest happyReduce_24 = happySpecReduce_2 12 happyReduction_24 happyReduction_24 (HappyAbsSyn137 happy_var_2) _ = HappyAbsSyn12 (HsEModuleContents happy_var_2 ) happyReduction_24 _ _ = notHappyAtAll happyReduce_25 = happySpecReduce_3 13 happyReduction_25 happyReduction_25 (HappyAbsSyn14 happy_var_3) _ (HappyAbsSyn13 happy_var_1) = HappyAbsSyn13 (happy_var_3 : happy_var_1 ) happyReduction_25 _ _ _ = notHappyAtAll happyReduce_26 = happySpecReduce_1 13 happyReduction_26 happyReduction_26 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn13 ([happy_var_1] ) happyReduction_26 _ = notHappyAtAll happyReduce_27 = happySpecReduce_1 14 happyReduction_27 happyReduction_27 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_27 _ = notHappyAtAll happyReduce_28 = happySpecReduce_1 14 happyReduction_28 happyReduction_28 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_28 _ = notHappyAtAll happyReduce_29 = happySpecReduce_3 15 happyReduction_29 happyReduction_29 (HappyAbsSyn16 happy_var_3) _ (HappyAbsSyn15 happy_var_1) = HappyAbsSyn15 (happy_var_3 : happy_var_1 ) happyReduction_29 _ _ _ = notHappyAtAll happyReduce_30 = happySpecReduce_1 15 happyReduction_30 happyReduction_30 (HappyAbsSyn16 happy_var_1) = HappyAbsSyn15 ([happy_var_1] ) happyReduction_30 _ = notHappyAtAll happyReduce_31 = happyReduce 6 16 happyReduction_31 happyReduction_31 ((HappyAbsSyn19 happy_var_6) `HappyStk` (HappyAbsSyn18 happy_var_5) `HappyStk` (HappyAbsSyn137 happy_var_4) `HappyStk` (HappyAbsSyn17 happy_var_3) `HappyStk` (HappyAbsSyn134 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn16 (HsImportDecl happy_var_2 happy_var_4 happy_var_3 happy_var_5 happy_var_6 ) `HappyStk` happyRest happyReduce_32 = happySpecReduce_1 17 happyReduction_32 happyReduction_32 _ = HappyAbsSyn17 (True ) happyReduce_33 = happySpecReduce_0 17 happyReduction_33 happyReduction_33 = HappyAbsSyn17 (False ) happyReduce_34 = happySpecReduce_2 18 happyReduction_34 happyReduction_34 (HappyAbsSyn137 happy_var_2) _ = HappyAbsSyn18 (Just happy_var_2 ) happyReduction_34 _ _ = notHappyAtAll happyReduce_35 = happySpecReduce_0 18 happyReduction_35 happyReduction_35 = HappyAbsSyn18 (Nothing ) happyReduce_36 = happySpecReduce_1 19 happyReduction_36 happyReduction_36 (HappyAbsSyn20 happy_var_1) = HappyAbsSyn19 (Just happy_var_1 ) happyReduction_36 _ = notHappyAtAll happyReduce_37 = happySpecReduce_0 19 happyReduction_37 happyReduction_37 = HappyAbsSyn19 (Nothing ) happyReduce_38 = happyReduce 4 20 happyReduction_38 happyReduction_38 (_ `HappyStk` _ `HappyStk` (HappyAbsSyn21 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn20 ((False, reverse happy_var_2) ) `HappyStk` happyRest happyReduce_39 = happyReduce 5 20 happyReduction_39 happyReduction_39 (_ `HappyStk` _ `HappyStk` (HappyAbsSyn21 happy_var_3) `HappyStk` _ `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn20 ((True, reverse happy_var_3) ) `HappyStk` happyRest happyReduce_40 = happySpecReduce_1 21 happyReduction_40 happyReduction_40 _ = HappyAbsSyn21 ([] ) happyReduce_41 = happySpecReduce_2 21 happyReduction_41 happyReduction_41 _ (HappyAbsSyn21 happy_var_1) = HappyAbsSyn21 (happy_var_1 ) happyReduction_41 _ _ = notHappyAtAll happyReduce_42 = happySpecReduce_3 22 happyReduction_42 happyReduction_42 (HappyAbsSyn23 happy_var_3) _ (HappyAbsSyn21 happy_var_1) = HappyAbsSyn21 (happy_var_3 : happy_var_1 ) happyReduction_42 _ _ _ = notHappyAtAll happyReduce_43 = happySpecReduce_1 22 happyReduction_43 happyReduction_43 (HappyAbsSyn23 happy_var_1) = HappyAbsSyn21 ([happy_var_1] ) happyReduction_43 _ = notHappyAtAll happyReduce_44 = happySpecReduce_1 23 happyReduction_44 happyReduction_44 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn23 (HsIVar happy_var_1 ) happyReduction_44 _ = notHappyAtAll happyReduce_45 = happySpecReduce_1 23 happyReduction_45 happyReduction_45 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn23 (HsIAbs happy_var_1 ) happyReduction_45 _ = notHappyAtAll happyReduce_46 = happyReduce 4 23 happyReduction_46 happyReduction_46 (_ `HappyStk` _ `HappyStk` _ `HappyStk` (HappyAbsSyn14 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn23 (HsIThingAll happy_var_1 ) `HappyStk` happyRest happyReduce_47 = happySpecReduce_3 23 happyReduction_47 happyReduction_47 _ _ (HappyAbsSyn14 happy_var_1) = HappyAbsSyn23 (HsIThingWith happy_var_1 [] ) happyReduction_47 _ _ _ = notHappyAtAll happyReduce_48 = happyReduce 4 23 happyReduction_48 happyReduction_48 (_ `HappyStk` (HappyAbsSyn13 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn14 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn23 (HsIThingWith happy_var_1 (reverse happy_var_3) ) `HappyStk` happyRest happyReduce_49 = happySpecReduce_3 24 happyReduction_49 happyReduction_49 (HappyAbsSyn14 happy_var_3) _ (HappyAbsSyn13 happy_var_1) = HappyAbsSyn13 (happy_var_3 : happy_var_1 ) happyReduction_49 _ _ _ = notHappyAtAll happyReduce_50 = happySpecReduce_1 24 happyReduction_50 happyReduction_50 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn13 ([happy_var_1] ) happyReduction_50 _ = notHappyAtAll happyReduce_51 = happySpecReduce_1 25 happyReduction_51 happyReduction_51 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_51 _ = notHappyAtAll happyReduce_52 = happySpecReduce_1 25 happyReduction_52 happyReduction_52 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_52 _ = notHappyAtAll happyReduce_53 = happySpecReduce_3 26 happyReduction_53 happyReduction_53 (HappyAbsSyn27 happy_var_3) _ (HappyAbsSyn26 happy_var_1) = HappyAbsSyn26 (funCons happy_var_3 happy_var_1 ) happyReduction_53 _ _ _ = notHappyAtAll happyReduce_54 = happySpecReduce_1 26 happyReduction_54 happyReduction_54 (HappyAbsSyn27 happy_var_1) = HappyAbsSyn26 ([happy_var_1] ) happyReduction_54 _ = notHappyAtAll happyReduce_55 = happyReduce 4 27 happyReduction_55 happyReduction_55 ((HappyAbsSyn30 happy_var_4) `HappyStk` (HappyAbsSyn28 happy_var_3) `HappyStk` (HappyAbsSyn134 happy_var_2) `HappyStk` (HappyAbsSyn29 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn27 (hsInfixDecl happy_var_2 (HsFixity happy_var_1 happy_var_3) happy_var_4 ) `HappyStk` happyRest happyReduce_56 = happySpecReduce_0 28 happyReduction_56 happyReduction_56 = HappyAbsSyn28 (9 ) happyReduce_57 = happySpecReduce_1 28 happyReduction_57 happyReduction_57 (HappyTerminal (IntTok happy_var_1)) = HappyAbsSyn28 (fromInteger (readInteger happy_var_1) ) happyReduction_57 _ = notHappyAtAll happyReduce_58 = happySpecReduce_1 29 happyReduction_58 happyReduction_58 _ = HappyAbsSyn29 (HsAssocNone ) happyReduce_59 = happySpecReduce_1 29 happyReduction_59 happyReduction_59 _ = HappyAbsSyn29 (HsAssocLeft ) happyReduce_60 = happySpecReduce_1 29 happyReduction_60 happyReduction_60 _ = HappyAbsSyn29 (HsAssocRight ) happyReduce_61 = happySpecReduce_3 30 happyReduction_61 happyReduction_61 (HappyAbsSyn30 happy_var_3) _ (HappyAbsSyn120 happy_var_1) = HappyAbsSyn30 (happy_var_1 : happy_var_3 ) happyReduction_61 _ _ _ = notHappyAtAll happyReduce_62 = happySpecReduce_1 30 happyReduction_62 happyReduction_62 (HappyAbsSyn120 happy_var_1) = HappyAbsSyn30 ([happy_var_1] ) happyReduction_62 _ = notHappyAtAll happyReduce_63 = happyReduce 5 31 happyReduction_63 happyReduction_63 ((HappyAbsSyn42 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn134 happy_var_3) `HappyStk` (HappyAbsSyn35 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn27 (hsTypeDecl happy_var_3 happy_var_2 happy_var_5 ) `HappyStk` happyRest happyReduce_64 = happyReduce 6 31 happyReduction_64 happyReduction_64 ((HappyAbsSyn13 happy_var_6) `HappyStk` (HappyAbsSyn52 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn48 happy_var_3) `HappyStk` (HappyAbsSyn134 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn27 (hsDataDecl happy_var_2 (fst happy_var_3) (snd happy_var_3) (reverse happy_var_5) happy_var_6 ) `HappyStk` happyRest happyReduce_65 = happyReduce 6 31 happyReduction_65 happyReduction_65 ((HappyAbsSyn13 happy_var_6) `HappyStk` (HappyAbsSyn53 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn48 happy_var_3) `HappyStk` (HappyAbsSyn134 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn27 (hsNewTypeDecl happy_var_2 (fst happy_var_3) (snd happy_var_3) happy_var_5 happy_var_6 ) `HappyStk` happyRest happyReduce_66 = happyReduce 5 31 happyReduction_66 happyReduction_66 ((HappyAbsSyn26 happy_var_5) `HappyStk` (HappyAbsSyn32 happy_var_4) `HappyStk` (HappyAbsSyn46 happy_var_3) `HappyStk` (HappyAbsSyn134 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn27 (hsClassDecl happy_var_2 (fst happy_var_3) (snd happy_var_3) happy_var_4 happy_var_5 ) `HappyStk` happyRest happyReduce_67 = happyReduce 4 31 happyReduction_67 happyReduction_67 ((HappyAbsSyn26 happy_var_4) `HappyStk` (HappyAbsSyn46 happy_var_3) `HappyStk` (HappyAbsSyn134 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn27 (hsInstDecl happy_var_2 (fst happy_var_3) (snd happy_var_3) happy_var_4 ) `HappyStk` happyRest happyReduce_68 = happySpecReduce_3 31 happyReduction_68 happyReduction_68 (HappyAbsSyn42 happy_var_3) (HappyAbsSyn134 happy_var_2) _ = HappyAbsSyn27 (hsDefaultDecl happy_var_2 happy_var_3 ) happyReduction_68 _ _ _ = notHappyAtAll happyReduce_69 = happySpecReduce_3 31 happyReduction_69 happyReduction_69 (HappyAbsSyn51 happy_var_3) (HappyAbsSyn134 happy_var_2) _ = HappyAbsSyn27 (hsPrimitiveTypeDecl happy_var_2 (fst happy_var_3) (snd happy_var_3) ) happyReduction_69 _ _ _ = notHappyAtAll happyReduce_70 = happyReduce 5 31 happyReduction_70 happyReduction_70 ((HappyAbsSyn42 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn14 happy_var_3) `HappyStk` (HappyAbsSyn134 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn27 (hsPrimitiveBind happy_var_2 happy_var_3 happy_var_5 ) `HappyStk` happyRest happyReduce_71 = happySpecReduce_1 31 happyReduction_71 happyReduction_71 (HappyAbsSyn27 happy_var_1) = HappyAbsSyn27 (happy_var_1 ) happyReduction_71 _ = notHappyAtAll happyReduce_72 = happySpecReduce_0 32 happyReduction_72 happyReduction_72 = HappyAbsSyn32 ([] ) happyReduce_73 = happySpecReduce_2 32 happyReduction_73 happyReduction_73 (HappyAbsSyn32 happy_var_2) _ = HappyAbsSyn32 (happy_var_2 ) happyReduction_73 _ _ = notHappyAtAll happyReduce_74 = happySpecReduce_1 33 happyReduction_74 happyReduction_74 (HappyAbsSyn34 happy_var_1) = HappyAbsSyn32 ([happy_var_1] ) happyReduction_74 _ = notHappyAtAll happyReduce_75 = happySpecReduce_3 33 happyReduction_75 happyReduction_75 (HappyAbsSyn32 happy_var_3) _ (HappyAbsSyn34 happy_var_1) = HappyAbsSyn32 (happy_var_1:happy_var_3 ) happyReduction_75 _ _ _ = notHappyAtAll happyReduce_76 = happySpecReduce_3 34 happyReduction_76 happyReduction_76 (HappyAbsSyn35 happy_var_3) _ (HappyAbsSyn35 happy_var_1) = HappyAbsSyn34 ((happy_var_1,happy_var_3) ) happyReduction_76 _ _ _ = notHappyAtAll happyReduce_77 = happySpecReduce_0 35 happyReduction_77 happyReduction_77 = HappyAbsSyn35 ([] ) happyReduce_78 = happySpecReduce_1 35 happyReduction_78 happyReduction_78 (HappyAbsSyn35 happy_var_1) = HappyAbsSyn35 (happy_var_1 ) happyReduction_78 _ = notHappyAtAll happyReduce_79 = happySpecReduce_2 36 happyReduction_79 happyReduction_79 _ (HappyAbsSyn26 happy_var_1) = HappyAbsSyn26 (reverse happy_var_1 ) happyReduction_79 _ _ = notHappyAtAll happyReduce_80 = happySpecReduce_1 36 happyReduction_80 happyReduction_80 _ = HappyAbsSyn26 ([] ) happyReduce_81 = happySpecReduce_3 37 happyReduction_81 happyReduction_81 (HappyAbsSyn27 happy_var_3) _ (HappyAbsSyn26 happy_var_1) = HappyAbsSyn26 (funCons happy_var_3 happy_var_1 ) happyReduction_81 _ _ _ = notHappyAtAll happyReduce_82 = happySpecReduce_1 37 happyReduction_82 happyReduction_82 (HappyAbsSyn27 happy_var_1) = HappyAbsSyn26 ([happy_var_1] ) happyReduction_82 _ = notHappyAtAll happyReduce_83 = happySpecReduce_1 38 happyReduction_83 happyReduction_83 (HappyAbsSyn27 happy_var_1) = HappyAbsSyn27 (happy_var_1 ) happyReduction_83 _ = notHappyAtAll happyReduce_84 = happySpecReduce_1 38 happyReduction_84 happyReduction_84 (HappyAbsSyn27 happy_var_1) = HappyAbsSyn27 (happy_var_1 ) happyReduction_84 _ = notHappyAtAll happyReduce_85 = happySpecReduce_1 38 happyReduction_85 happyReduction_85 (HappyAbsSyn27 happy_var_1) = HappyAbsSyn27 (happy_var_1 ) happyReduction_85 _ = notHappyAtAll happyReduce_86 = happySpecReduce_3 39 happyReduction_86 happyReduction_86 _ (HappyAbsSyn26 happy_var_2) _ = HappyAbsSyn26 (happy_var_2 ) happyReduction_86 _ _ _ = notHappyAtAll happyReduce_87 = happySpecReduce_3 39 happyReduction_87 happyReduction_87 _ (HappyAbsSyn26 happy_var_2) _ = HappyAbsSyn26 (happy_var_2 ) happyReduction_87 _ _ _ = notHappyAtAll happyReduce_88 = happyReduce 4 40 happyReduction_88 happyReduction_88 ((HappyAbsSyn46 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn134 happy_var_2) `HappyStk` (HappyAbsSyn13 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn27 (hsTypeSig happy_var_2 (reverse happy_var_1) (fst happy_var_4) (snd happy_var_4) ) `HappyStk` happyRest happyReduce_89 = happySpecReduce_3 41 happyReduction_89 happyReduction_89 (HappyAbsSyn14 happy_var_3) _ (HappyAbsSyn13 happy_var_1) = HappyAbsSyn13 (happy_var_3 : happy_var_1 ) happyReduction_89 _ _ _ = notHappyAtAll happyReduce_90 = happyMonadReduce 1 41 happyReduction_90 happyReduction_90 ((HappyAbsSyn14 happy_var_1) `HappyStk` happyRest) = happyThen ( case happy_var_1 of Qual _ _ -> parseError "bad qvar in vars." _ -> return [happy_var_1] ) (\r -> happyReturn (HappyAbsSyn13 r)) happyReduce_91 = happySpecReduce_3 42 happyReduction_91 happyReduction_91 (HappyAbsSyn42 happy_var_3) _ (HappyAbsSyn42 happy_var_1) = HappyAbsSyn42 (hsTyFun happy_var_1 happy_var_3 ) happyReduction_91 _ _ _ = notHappyAtAll happyReduce_92 = happySpecReduce_1 42 happyReduction_92 happyReduction_92 (HappyAbsSyn42 happy_var_1) = HappyAbsSyn42 (happy_var_1 ) happyReduction_92 _ = notHappyAtAll happyReduce_93 = happySpecReduce_2 43 happyReduction_93 happyReduction_93 (HappyAbsSyn42 happy_var_2) (HappyAbsSyn42 happy_var_1) = HappyAbsSyn42 (hsTyApp happy_var_1 happy_var_2 ) happyReduction_93 _ _ = notHappyAtAll happyReduce_94 = happySpecReduce_1 43 happyReduction_94 happyReduction_94 (HappyAbsSyn42 happy_var_1) = HappyAbsSyn42 (happy_var_1 ) happyReduction_94 _ = notHappyAtAll happyReduce_95 = happySpecReduce_1 44 happyReduction_95 happyReduction_95 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn42 (hsTyCon happy_var_1 ) happyReduction_95 _ = notHappyAtAll happyReduce_96 = happySpecReduce_1 44 happyReduction_96 happyReduction_96 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn42 (hsTyVar happy_var_1 ) happyReduction_96 _ = notHappyAtAll happyReduce_97 = happySpecReduce_3 44 happyReduction_97 happyReduction_97 _ (HappyAbsSyn35 happy_var_2) _ = HappyAbsSyn42 (hsTyTuple (reverse happy_var_2) ) happyReduction_97 _ _ _ = notHappyAtAll happyReduce_98 = happySpecReduce_3 44 happyReduction_98 happyReduction_98 _ (HappyAbsSyn42 happy_var_2) _ = HappyAbsSyn42 (hsTyApp list_tycon happy_var_2 ) happyReduction_98 _ _ _ = notHappyAtAll happyReduce_99 = happySpecReduce_3 44 happyReduction_99 happyReduction_99 _ (HappyAbsSyn42 happy_var_2) _ = HappyAbsSyn42 (happy_var_2 ) happyReduction_99 _ _ _ = notHappyAtAll happyReduce_100 = happySpecReduce_1 45 happyReduction_100 happyReduction_100 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_100 _ = notHappyAtAll happyReduce_101 = happySpecReduce_2 45 happyReduction_101 happyReduction_101 _ _ = HappyAbsSyn14 (unit_tycon_name ) happyReduce_102 = happySpecReduce_2 45 happyReduction_102 happyReduction_102 _ _ = HappyAbsSyn14 (list_tycon_name ) happyReduce_103 = happySpecReduce_3 45 happyReduction_103 happyReduction_103 _ _ _ = HappyAbsSyn14 (fun_tycon_name ) happyReduce_104 = happySpecReduce_3 45 happyReduction_104 happyReduction_104 _ (HappyAbsSyn28 happy_var_2) _ = HappyAbsSyn14 (tuple_tycon_name happy_var_2 ) happyReduction_104 _ _ _ = notHappyAtAll happyReduce_105 = happySpecReduce_3 46 happyReduction_105 happyReduction_105 (HappyAbsSyn42 happy_var_3) _ (HappyAbsSyn42 happy_var_1) = HappyAbsSyn46 ((reverse (tupleTypeToContext happy_var_1), happy_var_3) ) happyReduction_105 _ _ _ = notHappyAtAll happyReduce_106 = happySpecReduce_1 46 happyReduction_106 happyReduction_106 (HappyAbsSyn42 happy_var_1) = HappyAbsSyn46 (([], happy_var_1) ) happyReduction_106 _ = notHappyAtAll happyReduce_107 = happySpecReduce_3 47 happyReduction_107 happyReduction_107 (HappyAbsSyn42 happy_var_3) _ (HappyAbsSyn35 happy_var_1) = HappyAbsSyn35 (happy_var_3 : happy_var_1 ) happyReduction_107 _ _ _ = notHappyAtAll happyReduce_108 = happySpecReduce_3 47 happyReduction_108 happyReduction_108 (HappyAbsSyn42 happy_var_3) _ (HappyAbsSyn42 happy_var_1) = HappyAbsSyn35 ([happy_var_3, happy_var_1] ) happyReduction_108 _ _ _ = notHappyAtAll happyReduce_109 = happySpecReduce_3 48 happyReduction_109 happyReduction_109 (HappyAbsSyn35 happy_var_3) _ (HappyAbsSyn42 happy_var_1) = HappyAbsSyn48 ((reverse (tupleTypeToContext happy_var_1), happy_var_3) ) happyReduction_109 _ _ _ = notHappyAtAll happyReduce_110 = happySpecReduce_1 48 happyReduction_110 happyReduction_110 (HappyAbsSyn35 happy_var_1) = HappyAbsSyn48 (([], happy_var_1) ) happyReduction_110 _ = notHappyAtAll happyReduce_111 = happySpecReduce_2 49 happyReduction_111 happyReduction_111 (HappyAbsSyn35 happy_var_2) (HappyAbsSyn14 happy_var_1) = HappyAbsSyn35 (hsTyCon happy_var_1 : reverse happy_var_2 ) happyReduction_111 _ _ = notHappyAtAll happyReduce_112 = happySpecReduce_1 49 happyReduction_112 happyReduction_112 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn35 ([hsTyCon happy_var_1] ) happyReduction_112 _ = notHappyAtAll happyReduce_113 = happySpecReduce_2 50 happyReduction_113 happyReduction_113 (HappyAbsSyn14 happy_var_2) (HappyAbsSyn35 happy_var_1) = HappyAbsSyn35 (hsTyVar happy_var_2 : happy_var_1 ) happyReduction_113 _ _ = notHappyAtAll happyReduce_114 = happySpecReduce_1 50 happyReduction_114 happyReduction_114 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn35 ([hsTyVar happy_var_1] ) happyReduction_114 _ = notHappyAtAll happyReduce_115 = happyMonadReduce 1 51 happyReduction_115 happyReduction_115 ((HappyAbsSyn48 happy_var_1) `HappyStk` happyRest) = happyThen ( case snd happy_var_1 of [Typ (HsTyCon nm)] -> return (fst happy_var_1,nm) _ -> parseError "Primitive types are not allowed to have parameters" ) (\r -> happyReturn (HappyAbsSyn51 r)) happyReduce_116 = happySpecReduce_3 52 happyReduction_116 happyReduction_116 (HappyAbsSyn53 happy_var_3) _ (HappyAbsSyn52 happy_var_1) = HappyAbsSyn52 (happy_var_3 : happy_var_1 ) happyReduction_116 _ _ _ = notHappyAtAll happyReduce_117 = happySpecReduce_1 52 happyReduction_117 happyReduction_117 (HappyAbsSyn53 happy_var_1) = HappyAbsSyn52 ([happy_var_1] ) happyReduction_117 _ = notHappyAtAll happyReduce_118 = happySpecReduce_2 53 happyReduction_118 happyReduction_118 (HappyAbsSyn54 happy_var_2) (HappyAbsSyn134 happy_var_1) = HappyAbsSyn53 (HsConDecl happy_var_1 (fst happy_var_2) (snd happy_var_2) ) happyReduction_118 _ _ = notHappyAtAll happyReduce_119 = happyReduce 4 53 happyReduction_119 happyReduction_119 ((HappyAbsSyn56 happy_var_4) `HappyStk` (HappyAbsSyn14 happy_var_3) `HappyStk` (HappyAbsSyn56 happy_var_2) `HappyStk` (HappyAbsSyn134 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn53 (HsConDecl happy_var_1 happy_var_3 [happy_var_2, happy_var_4] ) `HappyStk` happyRest happyReduce_120 = happyReduce 5 53 happyReduction_120 happyReduction_120 (_ `HappyStk` (HappyAbsSyn58 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn14 happy_var_2) `HappyStk` (HappyAbsSyn134 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn53 (HsRecDecl happy_var_1 happy_var_2 (reverse happy_var_4) ) `HappyStk` happyRest happyReduce_121 = happyMonadReduce 1 54 happyReduction_121 happyReduction_121 ((HappyAbsSyn42 happy_var_1) `HappyStk` happyRest) = happyThen ( do { (c, ts) <- splitTyConApp happy_var_1 ; return (c, map HsUnBangedType ts) } ) (\r -> happyReturn (HappyAbsSyn54 r)) happyReduce_122 = happySpecReduce_1 54 happyReduction_122 happyReduction_122 (HappyAbsSyn54 happy_var_1) = HappyAbsSyn54 (happy_var_1 ) happyReduction_122 _ = notHappyAtAll happyReduce_123 = happyMonadReduce 3 55 happyReduction_123 happyReduction_123 ((HappyAbsSyn42 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn42 happy_var_1) `HappyStk` happyRest) = happyThen ( do { (c, ts) <- splitTyConApp happy_var_1 ; return (c, map HsUnBangedType ts ++ [HsBangedType happy_var_3]) } ) (\r -> happyReturn (HappyAbsSyn54 r)) happyReduce_124 = happySpecReduce_2 55 happyReduction_124 happyReduction_124 (HappyAbsSyn56 happy_var_2) (HappyAbsSyn54 happy_var_1) = HappyAbsSyn54 ((fst happy_var_1, snd happy_var_1 ++ [happy_var_2] ) ) happyReduction_124 _ _ = notHappyAtAll happyReduce_125 = happySpecReduce_1 56 happyReduction_125 happyReduction_125 (HappyAbsSyn42 happy_var_1) = HappyAbsSyn56 (HsUnBangedType happy_var_1 ) happyReduction_125 _ = notHappyAtAll happyReduce_126 = happySpecReduce_2 56 happyReduction_126 happyReduction_126 (HappyAbsSyn42 happy_var_2) _ = HappyAbsSyn56 (HsBangedType happy_var_2 ) happyReduction_126 _ _ = notHappyAtAll happyReduce_127 = happySpecReduce_1 57 happyReduction_127 happyReduction_127 (HappyAbsSyn42 happy_var_1) = HappyAbsSyn56 (HsUnBangedType happy_var_1 ) happyReduction_127 _ = notHappyAtAll happyReduce_128 = happySpecReduce_2 57 happyReduction_128 happyReduction_128 (HappyAbsSyn42 happy_var_2) _ = HappyAbsSyn56 (HsBangedType happy_var_2 ) happyReduction_128 _ _ = notHappyAtAll happyReduce_129 = happySpecReduce_3 58 happyReduction_129 happyReduction_129 (HappyAbsSyn59 happy_var_3) _ (HappyAbsSyn58 happy_var_1) = HappyAbsSyn58 (happy_var_3 : happy_var_1 ) happyReduction_129 _ _ _ = notHappyAtAll happyReduce_130 = happySpecReduce_1 58 happyReduction_130 happyReduction_130 (HappyAbsSyn59 happy_var_1) = HappyAbsSyn58 ([happy_var_1] ) happyReduction_130 _ = notHappyAtAll happyReduce_131 = happySpecReduce_3 59 happyReduction_131 happyReduction_131 (HappyAbsSyn56 happy_var_3) _ (HappyAbsSyn13 happy_var_1) = HappyAbsSyn59 ((reverse happy_var_1, happy_var_3) ) happyReduction_131 _ _ _ = notHappyAtAll happyReduce_132 = happySpecReduce_1 60 happyReduction_132 happyReduction_132 (HappyAbsSyn42 happy_var_1) = HappyAbsSyn56 (HsUnBangedType happy_var_1 ) happyReduction_132 _ = notHappyAtAll happyReduce_133 = happySpecReduce_2 60 happyReduction_133 happyReduction_133 (HappyAbsSyn42 happy_var_2) _ = HappyAbsSyn56 (HsBangedType happy_var_2 ) happyReduction_133 _ _ = notHappyAtAll happyReduce_134 = happySpecReduce_0 61 happyReduction_134 happyReduction_134 = HappyAbsSyn13 ([] ) happyReduce_135 = happySpecReduce_2 61 happyReduction_135 happyReduction_135 (HappyAbsSyn14 happy_var_2) _ = HappyAbsSyn13 ([happy_var_2] ) happyReduction_135 _ _ = notHappyAtAll happyReduce_136 = happySpecReduce_3 61 happyReduction_136 happyReduction_136 _ _ _ = HappyAbsSyn13 ([] ) happyReduce_137 = happyReduce 4 61 happyReduction_137 happyReduction_137 (_ `HappyStk` (HappyAbsSyn13 happy_var_3) `HappyStk` _ `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn13 (reverse happy_var_3 ) `HappyStk` happyRest happyReduce_138 = happySpecReduce_3 62 happyReduction_138 happyReduction_138 (HappyAbsSyn14 happy_var_3) _ (HappyAbsSyn13 happy_var_1) = HappyAbsSyn13 (happy_var_3 : happy_var_1 ) happyReduction_138 _ _ _ = notHappyAtAll happyReduce_139 = happySpecReduce_1 62 happyReduction_139 happyReduction_139 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn13 ([happy_var_1] ) happyReduction_139 _ = notHappyAtAll happyReduce_140 = happyReduce 4 63 happyReduction_140 happyReduction_140 (_ `HappyStk` (HappyAbsSyn26 happy_var_3) `HappyStk` _ `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn26 (happy_var_3 ) `HappyStk` happyRest happyReduce_141 = happyReduce 4 63 happyReduction_141 happyReduction_141 (_ `HappyStk` (HappyAbsSyn26 happy_var_3) `HappyStk` _ `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn26 (happy_var_3 ) `HappyStk` happyRest happyReduce_142 = happySpecReduce_0 63 happyReduction_142 happyReduction_142 = HappyAbsSyn26 ([] ) happyReduce_143 = happyReduce 4 64 happyReduction_143 happyReduction_143 (_ `HappyStk` (HappyAbsSyn26 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn26 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn26 (reverse happy_var_1 ++ reverse happy_var_3 ) `HappyStk` happyRest happyReduce_144 = happySpecReduce_2 64 happyReduction_144 happyReduction_144 _ (HappyAbsSyn26 happy_var_1) = HappyAbsSyn26 (reverse happy_var_1 ) happyReduction_144 _ _ = notHappyAtAll happyReduce_145 = happySpecReduce_1 64 happyReduction_145 happyReduction_145 _ = HappyAbsSyn26 ([] ) happyReduce_146 = happySpecReduce_3 65 happyReduction_146 happyReduction_146 (HappyAbsSyn27 happy_var_3) _ (HappyAbsSyn26 happy_var_1) = HappyAbsSyn26 (funCons happy_var_3 happy_var_1 ) happyReduction_146 _ _ _ = notHappyAtAll happyReduce_147 = happySpecReduce_1 65 happyReduction_147 happyReduction_147 (HappyAbsSyn27 happy_var_1) = HappyAbsSyn26 ([happy_var_1] ) happyReduction_147 _ = notHappyAtAll happyReduce_148 = happySpecReduce_3 66 happyReduction_148 happyReduction_148 (HappyAbsSyn27 happy_var_3) _ (HappyAbsSyn26 happy_var_1) = HappyAbsSyn26 (funCons happy_var_3 happy_var_1 ) happyReduction_148 _ _ _ = notHappyAtAll happyReduce_149 = happySpecReduce_1 66 happyReduction_149 happyReduction_149 (HappyAbsSyn27 happy_var_1) = HappyAbsSyn26 ([happy_var_1] ) happyReduction_149 _ = notHappyAtAll happyReduce_150 = happyReduce 4 67 happyReduction_150 happyReduction_150 (_ `HappyStk` (HappyAbsSyn26 happy_var_3) `HappyStk` _ `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn26 (happy_var_3 ) `HappyStk` happyRest happyReduce_151 = happyReduce 4 67 happyReduction_151 happyReduction_151 (_ `HappyStk` (HappyAbsSyn26 happy_var_3) `HappyStk` _ `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn26 (happy_var_3 ) `HappyStk` happyRest happyReduce_152 = happySpecReduce_0 67 happyReduction_152 happyReduction_152 = HappyAbsSyn26 ([] ) happyReduce_153 = happySpecReduce_2 68 happyReduction_153 happyReduction_153 _ (HappyAbsSyn26 happy_var_1) = HappyAbsSyn26 (reverse happy_var_1 ) happyReduction_153 _ _ = notHappyAtAll happyReduce_154 = happySpecReduce_1 68 happyReduction_154 happyReduction_154 _ = HappyAbsSyn26 ([] ) happyReduce_155 = happyReduce 4 69 happyReduction_155 happyReduction_155 ((HappyAbsSyn26 happy_var_4) `HappyStk` (HappyAbsSyn72 happy_var_3) `HappyStk` (HappyAbsSyn134 happy_var_2) `HappyStk` (HappyAbsSyn70 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn27 (mkFunDef' happy_var_1 happy_var_2 happy_var_3 happy_var_4 ) `HappyStk` happyRest happyReduce_156 = happyReduce 4 69 happyReduction_156 happyReduction_156 ((HappyAbsSyn26 happy_var_4) `HappyStk` (HappyAbsSyn72 happy_var_3) `HappyStk` (HappyAbsSyn134 happy_var_2) `HappyStk` (HappyAbsSyn99 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn27 (hsPatBind happy_var_2 happy_var_1 happy_var_3 happy_var_4 ) `HappyStk` happyRest happyReduce_157 = happySpecReduce_2 70 happyReduction_157 happyReduction_157 (HappyAbsSyn103 happy_var_2) (HappyAbsSyn14 happy_var_1) = HappyAbsSyn70 ((happy_var_1,happy_var_2) ) happyReduction_157 _ _ = notHappyAtAll happyReduce_158 = happySpecReduce_3 70 happyReduction_158 happyReduction_158 (HappyAbsSyn99 happy_var_3) (HappyAbsSyn14 happy_var_2) (HappyAbsSyn99 happy_var_1) = HappyAbsSyn70 ((happy_var_2,[happy_var_1,happy_var_3]) ) happyReduction_158 _ _ _ = notHappyAtAll happyReduce_159 = happyReduce 4 70 happyReduction_159 happyReduction_159 ((HappyAbsSyn103 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn70 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn70 ((fst happy_var_2,snd happy_var_2++happy_var_4) ) `HappyStk` happyRest happyReduce_160 = happySpecReduce_2 71 happyReduction_160 happyReduction_160 (HappyAbsSyn26 happy_var_2) _ = HappyAbsSyn26 (happy_var_2 ) happyReduction_160 _ _ = notHappyAtAll happyReduce_161 = happySpecReduce_0 71 happyReduction_161 happyReduction_161 = HappyAbsSyn26 ([] ) happyReduce_162 = happySpecReduce_2 72 happyReduction_162 happyReduction_162 (HappyAbsSyn75 happy_var_2) _ = HappyAbsSyn72 (HsBody happy_var_2 ) happyReduction_162 _ _ = notHappyAtAll happyReduce_163 = happySpecReduce_1 72 happyReduction_163 happyReduction_163 (HappyAbsSyn73 happy_var_1) = HappyAbsSyn72 (HsGuard (reverse happy_var_1) ) happyReduction_163 _ = notHappyAtAll happyReduce_164 = happySpecReduce_2 73 happyReduction_164 happyReduction_164 (HappyAbsSyn74 happy_var_2) (HappyAbsSyn73 happy_var_1) = HappyAbsSyn73 (happy_var_2 : happy_var_1 ) happyReduction_164 _ _ = notHappyAtAll happyReduce_165 = happySpecReduce_1 73 happyReduction_165 happyReduction_165 (HappyAbsSyn74 happy_var_1) = HappyAbsSyn73 ([happy_var_1] ) happyReduction_165 _ = notHappyAtAll happyReduce_166 = happyReduce 5 74 happyReduction_166 happyReduction_166 ((HappyAbsSyn75 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn134 happy_var_3) `HappyStk` (HappyAbsSyn75 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn74 ((happy_var_3, happy_var_2, happy_var_5) ) `HappyStk` happyRest happyReduce_167 = happyReduce 4 75 happyReduction_167 happyReduction_167 ((HappyAbsSyn46 happy_var_4) `HappyStk` (HappyAbsSyn134 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn75 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn75 (hsExpTypeSig happy_var_3 happy_var_1 (fst happy_var_4) (snd happy_var_4) ) `HappyStk` happyRest happyReduce_168 = happySpecReduce_1 75 happyReduction_168 happyReduction_168 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (happy_var_1 ) happyReduction_168 _ = notHappyAtAll happyReduce_169 = happySpecReduce_1 76 happyReduction_169 happyReduction_169 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (happy_var_1 ) happyReduction_169 _ = notHappyAtAll happyReduce_170 = happySpecReduce_3 76 happyReduction_170 happyReduction_170 (HappyAbsSyn75 happy_var_3) (HappyAbsSyn120 happy_var_2) (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (hsInfixApp happy_var_1 happy_var_2 happy_var_3 ) happyReduction_170 _ _ _ = notHappyAtAll happyReduce_171 = happyReduce 4 77 happyReduction_171 happyReduction_171 ((HappyAbsSyn75 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn103 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn75 (hsLambda happy_var_2 happy_var_4 ) `HappyStk` happyRest happyReduce_172 = happyReduce 4 77 happyReduction_172 happyReduction_172 ((HappyAbsSyn75 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn26 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn75 (hsLet happy_var_2 happy_var_4 ) `HappyStk` happyRest happyReduce_173 = happyReduce 6 77 happyReduction_173 happyReduction_173 ((HappyAbsSyn75 happy_var_6) `HappyStk` _ `HappyStk` (HappyAbsSyn75 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn75 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn75 (hsIf happy_var_2 happy_var_4 happy_var_6 ) `HappyStk` happyRest happyReduce_174 = happyReduce 4 77 happyReduction_174 happyReduction_174 ((HappyAbsSyn87 happy_var_4) `HappyStk` _ `HappyStk` (HappyAbsSyn75 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn75 (hsCase happy_var_2 happy_var_4 ) `HappyStk` happyRest happyReduce_175 = happySpecReduce_2 77 happyReduction_175 happyReduction_175 (HappyAbsSyn75 happy_var_2) _ = HappyAbsSyn75 (hsNegApp happy_var_2 ) happyReduction_175 _ _ = notHappyAtAll happyReduce_176 = happySpecReduce_2 77 happyReduction_176 happyReduction_176 (HappyAbsSyn93 happy_var_2) _ = HappyAbsSyn75 (hsDo (atoms2Stmt happy_var_2) ) happyReduction_176 _ _ = notHappyAtAll happyReduce_177 = happySpecReduce_1 77 happyReduction_177 happyReduction_177 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (happy_var_1 ) happyReduction_177 _ = notHappyAtAll happyReduce_178 = happySpecReduce_2 78 happyReduction_178 happyReduction_178 (HappyAbsSyn75 happy_var_2) (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (hsApp happy_var_1 happy_var_2 ) happyReduction_178 _ _ = notHappyAtAll happyReduce_179 = happySpecReduce_1 78 happyReduction_179 happyReduction_179 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (happy_var_1 ) happyReduction_179 _ = notHappyAtAll happyReduce_180 = happyReduce 4 79 happyReduction_180 happyReduction_180 (_ `HappyStk` (HappyAbsSyn96 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn75 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn75 (mkRecord happy_var_1 (reverse happy_var_3) ) `HappyStk` happyRest happyReduce_181 = happySpecReduce_1 79 happyReduction_181 happyReduction_181 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (happy_var_1 ) happyReduction_181 _ = notHappyAtAll happyReduce_182 = happySpecReduce_1 80 happyReduction_182 happyReduction_182 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn75 (hsEVar (happy_var_1 :: HsName) ) 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_1 80 happyReduction_184 happyReduction_184 (HappyAbsSyn132 happy_var_1) = HappyAbsSyn75 (hsLit happy_var_1 ) happyReduction_184 _ = notHappyAtAll happyReduce_185 = happySpecReduce_3 80 happyReduction_185 happyReduction_185 _ (HappyAbsSyn75 happy_var_2) _ = HappyAbsSyn75 (hsParen happy_var_2 ) happyReduction_185 _ _ _ = notHappyAtAll happyReduce_186 = happySpecReduce_3 80 happyReduction_186 happyReduction_186 _ (HappyAbsSyn82 happy_var_2) _ = HappyAbsSyn75 (hsTuple (reverse happy_var_2) ) happyReduction_186 _ _ _ = notHappyAtAll happyReduce_187 = happySpecReduce_3 80 happyReduction_187 happyReduction_187 _ (HappyAbsSyn75 happy_var_2) _ = HappyAbsSyn75 (happy_var_2 ) happyReduction_187 _ _ _ = notHappyAtAll happyReduce_188 = happyReduce 4 80 happyReduction_188 happyReduction_188 (_ `HappyStk` (HappyAbsSyn120 happy_var_3) `HappyStk` (HappyAbsSyn75 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn75 (hsLeftSection happy_var_2 happy_var_3 ) `HappyStk` happyRest happyReduce_189 = happyReduce 4 80 happyReduction_189 happyReduction_189 (_ `HappyStk` (HappyAbsSyn75 happy_var_3) `HappyStk` (HappyAbsSyn120 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn75 (hsRightSection happy_var_2 happy_var_3 ) `HappyStk` happyRest happyReduce_190 = happySpecReduce_3 80 happyReduction_190 happyReduction_190 (HappyAbsSyn75 happy_var_3) _ (HappyAbsSyn14 happy_var_1) = HappyAbsSyn75 (hsAsPat happy_var_1 happy_var_3 ) happyReduction_190 _ _ _ = notHappyAtAll happyReduce_191 = happySpecReduce_1 80 happyReduction_191 happyReduction_191 _ = HappyAbsSyn75 (hsWildCard ) happyReduce_192 = happySpecReduce_2 80 happyReduction_192 happyReduction_192 (HappyAbsSyn75 happy_var_2) _ = HappyAbsSyn75 (hsIrrPat happy_var_2 ) happyReduction_192 _ _ = notHappyAtAll happyReduce_193 = happySpecReduce_2 81 happyReduction_193 happyReduction_193 _ (HappyAbsSyn28 happy_var_1) = HappyAbsSyn28 (happy_var_1 + 1 ) happyReduction_193 _ _ = notHappyAtAll happyReduce_194 = happySpecReduce_1 81 happyReduction_194 happyReduction_194 _ = HappyAbsSyn28 (1 ) happyReduce_195 = happySpecReduce_3 82 happyReduction_195 happyReduction_195 (HappyAbsSyn75 happy_var_3) _ (HappyAbsSyn82 happy_var_1) = HappyAbsSyn82 (happy_var_3 : happy_var_1 ) happyReduction_195 _ _ _ = notHappyAtAll happyReduce_196 = happySpecReduce_3 82 happyReduction_196 happyReduction_196 (HappyAbsSyn75 happy_var_3) _ (HappyAbsSyn75 happy_var_1) = HappyAbsSyn82 ([happy_var_3, happy_var_1] ) happyReduction_196 _ _ _ = notHappyAtAll happyReduce_197 = happySpecReduce_1 83 happyReduction_197 happyReduction_197 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (hsList [happy_var_1] ) happyReduction_197 _ = notHappyAtAll happyReduce_198 = happySpecReduce_1 83 happyReduction_198 happyReduction_198 (HappyAbsSyn82 happy_var_1) = HappyAbsSyn75 (hsList (reverse happy_var_1) ) happyReduction_198 _ = notHappyAtAll happyReduce_199 = happySpecReduce_2 83 happyReduction_199 happyReduction_199 _ (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (hsEnumFrom happy_var_1 ) happyReduction_199 _ _ = notHappyAtAll happyReduce_200 = happyReduce 4 83 happyReduction_200 happyReduction_200 (_ `HappyStk` (HappyAbsSyn75 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn75 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn75 (hsEnumFromThen happy_var_1 happy_var_3 ) `HappyStk` happyRest happyReduce_201 = happySpecReduce_3 83 happyReduction_201 happyReduction_201 (HappyAbsSyn75 happy_var_3) _ (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (hsEnumFromTo happy_var_1 happy_var_3 ) happyReduction_201 _ _ _ = notHappyAtAll happyReduce_202 = happyReduce 5 83 happyReduction_202 happyReduction_202 ((HappyAbsSyn75 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn75 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn75 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn75 (hsEnumFromThenTo happy_var_1 happy_var_3 happy_var_5 ) `HappyStk` happyRest happyReduce_203 = happySpecReduce_3 83 happyReduction_203 happyReduction_203 (HappyAbsSyn85 happy_var_3) _ (HappyAbsSyn75 happy_var_1) = HappyAbsSyn75 (hsListComp (atoms2Stmt (reverse happy_var_3 ++ [HsQualifierAtom happy_var_1])) ) happyReduction_203 _ _ _ = notHappyAtAll happyReduce_204 = happySpecReduce_3 84 happyReduction_204 happyReduction_204 (HappyAbsSyn75 happy_var_3) _ (HappyAbsSyn82 happy_var_1) = HappyAbsSyn82 (happy_var_3 : happy_var_1 ) happyReduction_204 _ _ _ = notHappyAtAll happyReduce_205 = happySpecReduce_3 84 happyReduction_205 happyReduction_205 (HappyAbsSyn75 happy_var_3) _ (HappyAbsSyn75 happy_var_1) = HappyAbsSyn82 ([happy_var_3,happy_var_1] ) happyReduction_205 _ _ _ = notHappyAtAll happyReduce_206 = happySpecReduce_3 85 happyReduction_206 happyReduction_206 (HappyAbsSyn86 happy_var_3) _ (HappyAbsSyn85 happy_var_1) = HappyAbsSyn85 (happy_var_3 : happy_var_1 ) happyReduction_206 _ _ _ = notHappyAtAll happyReduce_207 = happySpecReduce_1 85 happyReduction_207 happyReduction_207 (HappyAbsSyn86 happy_var_1) = HappyAbsSyn85 ([happy_var_1] ) happyReduction_207 _ = notHappyAtAll happyReduce_208 = happyMonadReduce 3 86 happyReduction_208 happyReduction_208 ((HappyAbsSyn75 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn75 happy_var_1) `HappyStk` happyRest) = happyThen ( do { p <- expToPat happy_var_1 ; return (HsGeneratorAtom p happy_var_3) } ) (\r -> happyReturn (HappyAbsSyn86 r)) happyReduce_209 = happySpecReduce_1 86 happyReduction_209 happyReduction_209 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn86 (HsQualifierAtom happy_var_1 ) happyReduction_209 _ = notHappyAtAll happyReduce_210 = happySpecReduce_2 86 happyReduction_210 happyReduction_210 (HappyAbsSyn26 happy_var_2) _ = HappyAbsSyn86 (HsLetStmtAtom happy_var_2 ) happyReduction_210 _ _ = notHappyAtAll happyReduce_211 = happyReduce 4 87 happyReduction_211 happyReduction_211 (_ `HappyStk` _ `HappyStk` (HappyAbsSyn87 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn87 (reverse happy_var_2 ) `HappyStk` happyRest happyReduce_212 = happyReduce 4 87 happyReduction_212 happyReduction_212 (_ `HappyStk` _ `HappyStk` (HappyAbsSyn87 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn87 (reverse happy_var_2 ) `HappyStk` happyRest happyReduce_213 = happySpecReduce_3 88 happyReduction_213 happyReduction_213 (HappyAbsSyn89 happy_var_3) _ (HappyAbsSyn87 happy_var_1) = HappyAbsSyn87 (happy_var_3 : happy_var_1 ) happyReduction_213 _ _ _ = notHappyAtAll happyReduce_214 = happySpecReduce_1 88 happyReduction_214 happyReduction_214 (HappyAbsSyn89 happy_var_1) = HappyAbsSyn87 ([happy_var_1] ) happyReduction_214 _ = notHappyAtAll happyReduce_215 = happySpecReduce_3 89 happyReduction_215 happyReduction_215 (HappyAbsSyn72 happy_var_3) (HappyAbsSyn134 happy_var_2) (HappyAbsSyn99 happy_var_1) = HappyAbsSyn89 (HsAlt happy_var_2 happy_var_1 happy_var_3 [] ) happyReduction_215 _ _ _ = notHappyAtAll happyReduce_216 = happyReduce 5 89 happyReduction_216 happyReduction_216 ((HappyAbsSyn26 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn72 happy_var_3) `HappyStk` (HappyAbsSyn134 happy_var_2) `HappyStk` (HappyAbsSyn99 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn89 (HsAlt happy_var_2 happy_var_1 happy_var_3 happy_var_5 ) `HappyStk` happyRest happyReduce_217 = happySpecReduce_2 90 happyReduction_217 happyReduction_217 (HappyAbsSyn75 happy_var_2) _ = HappyAbsSyn72 (HsBody happy_var_2 ) happyReduction_217 _ _ = notHappyAtAll happyReduce_218 = happySpecReduce_1 90 happyReduction_218 happyReduction_218 (HappyAbsSyn73 happy_var_1) = HappyAbsSyn72 (HsGuard (reverse happy_var_1) ) happyReduction_218 _ = notHappyAtAll happyReduce_219 = happySpecReduce_2 91 happyReduction_219 happyReduction_219 (HappyAbsSyn74 happy_var_2) (HappyAbsSyn73 happy_var_1) = HappyAbsSyn73 (happy_var_2 : happy_var_1 ) happyReduction_219 _ _ = notHappyAtAll happyReduce_220 = happySpecReduce_1 91 happyReduction_220 happyReduction_220 (HappyAbsSyn74 happy_var_1) = HappyAbsSyn73 ([happy_var_1] ) happyReduction_220 _ = notHappyAtAll happyReduce_221 = happyReduce 5 92 happyReduction_221 happyReduction_221 ((HappyAbsSyn75 happy_var_5) `HappyStk` _ `HappyStk` (HappyAbsSyn75 happy_var_3) `HappyStk` (HappyAbsSyn134 happy_var_2) `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn74 ((happy_var_2, happy_var_3, happy_var_5) ) `HappyStk` happyRest happyReduce_222 = happySpecReduce_3 93 happyReduction_222 happyReduction_222 _ (HappyAbsSyn93 happy_var_2) _ = HappyAbsSyn93 (happy_var_2 ) happyReduction_222 _ _ _ = notHappyAtAll happyReduce_223 = happySpecReduce_3 93 happyReduction_223 happyReduction_223 _ (HappyAbsSyn93 happy_var_2) _ = HappyAbsSyn93 (happy_var_2 ) happyReduction_223 _ _ _ = notHappyAtAll happyReduce_224 = happySpecReduce_3 94 happyReduction_224 happyReduction_224 (HappyAbsSyn75 happy_var_3) _ (HappyAbsSyn93 happy_var_1) = HappyAbsSyn93 (reverse (HsQualifierAtom happy_var_3 : happy_var_1) ) happyReduction_224 _ _ _ = notHappyAtAll happyReduce_225 = happySpecReduce_1 94 happyReduction_225 happyReduction_225 (HappyAbsSyn75 happy_var_1) = HappyAbsSyn93 ([HsQualifierAtom happy_var_1] ) happyReduction_225 _ = notHappyAtAll happyReduce_226 = happySpecReduce_3 95 happyReduction_226 happyReduction_226 (HappyAbsSyn86 happy_var_3) _ (HappyAbsSyn93 happy_var_1) = HappyAbsSyn93 (happy_var_3 : happy_var_1 ) happyReduction_226 _ _ _ = notHappyAtAll happyReduce_227 = happySpecReduce_1 95 happyReduction_227 happyReduction_227 (HappyAbsSyn86 happy_var_1) = HappyAbsSyn93 ([happy_var_1] ) happyReduction_227 _ = notHappyAtAll happyReduce_228 = happySpecReduce_0 96 happyReduction_228 happyReduction_228 = HappyAbsSyn96 ([] ) happyReduce_229 = happySpecReduce_1 96 happyReduction_229 happyReduction_229 (HappyAbsSyn96 happy_var_1) = HappyAbsSyn96 (happy_var_1 ) happyReduction_229 _ = notHappyAtAll happyReduce_230 = happySpecReduce_3 97 happyReduction_230 happyReduction_230 (HappyAbsSyn98 happy_var_3) _ (HappyAbsSyn96 happy_var_1) = HappyAbsSyn96 (happy_var_3 : happy_var_1 ) happyReduction_230 _ _ _ = notHappyAtAll happyReduce_231 = happySpecReduce_1 97 happyReduction_231 happyReduction_231 (HappyAbsSyn98 happy_var_1) = HappyAbsSyn96 ([happy_var_1] ) happyReduction_231 _ = notHappyAtAll happyReduce_232 = happySpecReduce_3 98 happyReduction_232 happyReduction_232 (HappyAbsSyn75 happy_var_3) _ (HappyAbsSyn14 happy_var_1) = HappyAbsSyn98 (HsFieldUpdate happy_var_1 happy_var_3 ) happyReduction_232 _ _ _ = notHappyAtAll happyReduce_233 = happySpecReduce_1 99 happyReduction_233 happyReduction_233 (HappyAbsSyn99 happy_var_1) = HappyAbsSyn99 (happy_var_1 ) happyReduction_233 _ = notHappyAtAll happyReduce_234 = happySpecReduce_1 100 happyReduction_234 happyReduction_234 (HappyAbsSyn99 happy_var_1) = HappyAbsSyn99 (happy_var_1 ) happyReduction_234 _ = notHappyAtAll happyReduce_235 = happySpecReduce_3 100 happyReduction_235 happyReduction_235 (HappyAbsSyn99 happy_var_3) (HappyAbsSyn14 happy_var_2) (HappyAbsSyn99 happy_var_1) = HappyAbsSyn99 (hsPInfixApp happy_var_1 (HsCon happy_var_2) happy_var_3 ) happyReduction_235 _ _ _ = notHappyAtAll happyReduce_236 = happySpecReduce_2 101 happyReduction_236 happyReduction_236 (HappyAbsSyn103 happy_var_2) (HappyAbsSyn14 happy_var_1) = HappyAbsSyn99 (hsPApp happy_var_1 happy_var_2 ) happyReduction_236 _ _ = notHappyAtAll happyReduce_237 = happySpecReduce_2 101 happyReduction_237 happyReduction_237 (HappyAbsSyn132 happy_var_2) _ = HappyAbsSyn99 (hsPNeg (hsPLit happy_var_2) ) happyReduction_237 _ _ = notHappyAtAll happyReduce_238 = happySpecReduce_1 101 happyReduction_238 happyReduction_238 (HappyAbsSyn99 happy_var_1) = HappyAbsSyn99 (happy_var_1 ) happyReduction_238 _ = notHappyAtAll happyReduce_239 = happySpecReduce_1 102 happyReduction_239 happyReduction_239 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn99 (hsPVar happy_var_1 ) happyReduction_239 _ = notHappyAtAll happyReduce_240 = happySpecReduce_3 102 happyReduction_240 happyReduction_240 (HappyAbsSyn99 happy_var_3) _ (HappyAbsSyn14 happy_var_1) = HappyAbsSyn99 (hsPAsPat happy_var_1 happy_var_3 ) happyReduction_240 _ _ _ = notHappyAtAll happyReduce_241 = happySpecReduce_1 102 happyReduction_241 happyReduction_241 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn99 (hsPCon happy_var_1 ) happyReduction_241 _ = notHappyAtAll happyReduce_242 = happySpecReduce_2 102 happyReduction_242 happyReduction_242 _ _ = HappyAbsSyn99 (hsPCon (qualify "Prelude" "()") ) happyReduce_243 = happyReduce 4 102 happyReduction_243 happyReduction_243 (_ `HappyStk` (HappyAbsSyn105 happy_var_3) `HappyStk` _ `HappyStk` (HappyAbsSyn14 happy_var_1) `HappyStk` happyRest) = HappyAbsSyn99 (hsPRec happy_var_1 happy_var_3 ) `HappyStk` happyRest happyReduce_244 = happySpecReduce_1 102 happyReduction_244 happyReduction_244 (HappyAbsSyn132 happy_var_1) = HappyAbsSyn99 (hsPLit happy_var_1 ) happyReduction_244 _ = notHappyAtAll happyReduce_245 = happySpecReduce_1 102 happyReduction_245 happyReduction_245 _ = HappyAbsSyn99 (hsPWildCard ) happyReduce_246 = happySpecReduce_3 102 happyReduction_246 happyReduction_246 _ (HappyAbsSyn99 happy_var_2) _ = HappyAbsSyn99 (hsPParen happy_var_2 ) happyReduction_246 _ _ _ = notHappyAtAll happyReduce_247 = happySpecReduce_3 102 happyReduction_247 happyReduction_247 _ (HappyAbsSyn103 happy_var_2) _ = HappyAbsSyn99 (hsPTuple happy_var_2 ) happyReduction_247 _ _ _ = notHappyAtAll happyReduce_248 = happySpecReduce_3 102 happyReduction_248 happyReduction_248 _ (HappyAbsSyn103 happy_var_2) _ = HappyAbsSyn99 (hsPList happy_var_2 ) happyReduction_248 _ _ _ = notHappyAtAll happyReduce_249 = happySpecReduce_2 102 happyReduction_249 happyReduction_249 (HappyAbsSyn99 happy_var_2) _ = HappyAbsSyn99 (hsPIrrPat happy_var_2 ) happyReduction_249 _ _ = notHappyAtAll happyReduce_250 = happySpecReduce_2 103 happyReduction_250 happyReduction_250 (HappyAbsSyn103 happy_var_2) (HappyAbsSyn99 happy_var_1) = HappyAbsSyn103 (happy_var_1 : happy_var_2 ) happyReduction_250 _ _ = notHappyAtAll happyReduce_251 = happySpecReduce_0 104 happyReduction_251 happyReduction_251 = HappyAbsSyn103 ([] ) happyReduce_252 = happySpecReduce_2 104 happyReduction_252 happyReduction_252 (HappyAbsSyn103 happy_var_2) (HappyAbsSyn99 happy_var_1) = HappyAbsSyn103 (happy_var_1 : happy_var_2 ) happyReduction_252 _ _ = notHappyAtAll happyReduce_253 = happySpecReduce_0 105 happyReduction_253 happyReduction_253 = HappyAbsSyn105 ([] ) happyReduce_254 = happySpecReduce_1 105 happyReduction_254 happyReduction_254 (HappyAbsSyn105 happy_var_1) = HappyAbsSyn105 (happy_var_1 ) happyReduction_254 _ = notHappyAtAll happyReduce_255 = happySpecReduce_3 106 happyReduction_255 happyReduction_255 (HappyAbsSyn105 happy_var_3) _ (HappyAbsSyn107 happy_var_1) = HappyAbsSyn105 (happy_var_1 : happy_var_3 ) happyReduction_255 _ _ _ = notHappyAtAll happyReduce_256 = happySpecReduce_1 106 happyReduction_256 happyReduction_256 (HappyAbsSyn107 happy_var_1) = HappyAbsSyn105 ([happy_var_1] ) happyReduction_256 _ = notHappyAtAll happyReduce_257 = happySpecReduce_3 107 happyReduction_257 happyReduction_257 (HappyAbsSyn99 happy_var_3) _ (HappyAbsSyn14 happy_var_1) = HappyAbsSyn107 (HsPFieldPat happy_var_1 happy_var_3 ) happyReduction_257 _ _ _ = notHappyAtAll happyReduce_258 = happySpecReduce_3 108 happyReduction_258 happyReduction_258 (HappyAbsSyn103 happy_var_3) _ (HappyAbsSyn99 happy_var_1) = HappyAbsSyn103 (happy_var_1 : happy_var_3 ) happyReduction_258 _ _ _ = notHappyAtAll happyReduce_259 = happySpecReduce_3 108 happyReduction_259 happyReduction_259 (HappyAbsSyn99 happy_var_3) _ (HappyAbsSyn99 happy_var_1) = HappyAbsSyn103 ([happy_var_1, happy_var_3] ) happyReduction_259 _ _ _ = notHappyAtAll happyReduce_260 = happySpecReduce_0 109 happyReduction_260 happyReduction_260 = HappyAbsSyn103 ([] ) happyReduce_261 = happySpecReduce_1 109 happyReduction_261 happyReduction_261 (HappyAbsSyn103 happy_var_1) = HappyAbsSyn103 (happy_var_1 ) happyReduction_261 _ = notHappyAtAll happyReduce_262 = happySpecReduce_3 110 happyReduction_262 happyReduction_262 (HappyAbsSyn103 happy_var_3) _ (HappyAbsSyn99 happy_var_1) = HappyAbsSyn103 (happy_var_1 : happy_var_3 ) happyReduction_262 _ _ _ = notHappyAtAll happyReduce_263 = happySpecReduce_1 110 happyReduction_263 happyReduction_263 (HappyAbsSyn99 happy_var_1) = HappyAbsSyn103 ([happy_var_1] ) happyReduction_263 _ = notHappyAtAll happyReduce_264 = happySpecReduce_2 111 happyReduction_264 happyReduction_264 _ _ = HappyAbsSyn75 (hsECon (qualify "Prelude" "()") ) happyReduce_265 = happySpecReduce_2 111 happyReduction_265 happyReduction_265 _ _ = HappyAbsSyn75 (hsList [] ) happyReduce_266 = happySpecReduce_3 111 happyReduction_266 happyReduction_266 _ (HappyAbsSyn28 happy_var_2) _ = HappyAbsSyn75 (hsECon (qualify "Prelude" (tuple happy_var_2)) ) happyReduction_266 _ _ _ = notHappyAtAll happyReduce_267 = happyReduce 4 111 happyReduction_267 happyReduction_267 (_ `HappyStk` _ `HappyStk` _ `HappyStk` (HappyTerminal (QModId happy_var_1)) `HappyStk` happyRest) = HappyAbsSyn75 (hsECon (qualify happy_var_1 "()") ) `HappyStk` happyRest happyReduce_268 = happyReduce 4 111 happyReduction_268 happyReduction_268 (_ `HappyStk` _ `HappyStk` _ `HappyStk` _ `HappyStk` happyRest) = HappyAbsSyn75 (hsList [] ) `HappyStk` happyRest happyReduce_269 = happyReduce 5 111 happyReduction_269 happyReduction_269 (_ `HappyStk` (HappyAbsSyn28 happy_var_4) `HappyStk` _ `HappyStk` _ `HappyStk` (HappyTerminal (QModId happy_var_1)) `HappyStk` happyRest) = HappyAbsSyn75 (hsECon (qualify happy_var_1 (tuple happy_var_4)) ) `HappyStk` happyRest happyReduce_270 = happySpecReduce_1 111 happyReduction_270 happyReduction_270 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn75 (hsECon happy_var_1 ) happyReduction_270 _ = notHappyAtAll happyReduce_271 = happySpecReduce_1 112 happyReduction_271 happyReduction_271 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_271 _ = notHappyAtAll happyReduce_272 = happySpecReduce_3 112 happyReduction_272 happyReduction_272 _ (HappyAbsSyn14 happy_var_2) _ = HappyAbsSyn14 (happy_var_2 ) happyReduction_272 _ _ _ = notHappyAtAll happyReduce_273 = happySpecReduce_1 113 happyReduction_273 happyReduction_273 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_273 _ = notHappyAtAll happyReduce_274 = happySpecReduce_3 113 happyReduction_274 happyReduction_274 _ (HappyAbsSyn14 happy_var_2) _ = HappyAbsSyn14 (happy_var_2 ) happyReduction_274 _ _ _ = notHappyAtAll happyReduce_275 = happySpecReduce_1 114 happyReduction_275 happyReduction_275 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_275 _ = notHappyAtAll happyReduce_276 = happySpecReduce_3 114 happyReduction_276 happyReduction_276 _ (HappyAbsSyn14 happy_var_2) _ = HappyAbsSyn14 (happy_var_2 ) happyReduction_276 _ _ _ = notHappyAtAll happyReduce_277 = happySpecReduce_1 115 happyReduction_277 happyReduction_277 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_277 _ = notHappyAtAll happyReduce_278 = happySpecReduce_3 115 happyReduction_278 happyReduction_278 _ (HappyAbsSyn14 happy_var_2) _ = HappyAbsSyn14 (happy_var_2 ) happyReduction_278 _ _ _ = notHappyAtAll happyReduce_279 = happySpecReduce_1 116 happyReduction_279 happyReduction_279 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_279 _ = notHappyAtAll happyReduce_280 = happySpecReduce_3 116 happyReduction_280 happyReduction_280 _ (HappyAbsSyn14 happy_var_2) _ = HappyAbsSyn14 (happy_var_2 ) happyReduction_280 _ _ _ = notHappyAtAll happyReduce_281 = happySpecReduce_1 117 happyReduction_281 happyReduction_281 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_281 _ = notHappyAtAll happyReduce_282 = happySpecReduce_3 117 happyReduction_282 happyReduction_282 _ (HappyAbsSyn14 happy_var_2) _ = HappyAbsSyn14 (happy_var_2 ) happyReduction_282 _ _ _ = notHappyAtAll happyReduce_283 = happySpecReduce_1 118 happyReduction_283 happyReduction_283 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_283 _ = notHappyAtAll happyReduce_284 = happySpecReduce_3 118 happyReduction_284 happyReduction_284 _ (HappyAbsSyn14 happy_var_2) _ = HappyAbsSyn14 (happy_var_2 ) happyReduction_284 _ _ _ = notHappyAtAll happyReduce_285 = happySpecReduce_1 119 happyReduction_285 happyReduction_285 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_285 _ = notHappyAtAll happyReduce_286 = happySpecReduce_3 119 happyReduction_286 happyReduction_286 _ (HappyAbsSyn14 happy_var_2) _ = HappyAbsSyn14 (happy_var_2 ) happyReduction_286 _ _ _ = notHappyAtAll happyReduce_287 = happySpecReduce_1 120 happyReduction_287 happyReduction_287 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn120 (hsVar happy_var_1 ) happyReduction_287 _ = notHappyAtAll happyReduce_288 = happySpecReduce_1 120 happyReduction_288 happyReduction_288 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn120 (hsCon happy_var_1 ) happyReduction_288 _ = notHappyAtAll happyReduce_289 = happySpecReduce_1 121 happyReduction_289 happyReduction_289 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn120 (hsVar happy_var_1 ) happyReduction_289 _ = notHappyAtAll happyReduce_290 = happySpecReduce_1 121 happyReduction_290 happyReduction_290 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn120 (hsCon happy_var_1 ) happyReduction_290 _ = notHappyAtAll happyReduce_291 = happySpecReduce_1 122 happyReduction_291 happyReduction_291 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_291 _ = notHappyAtAll happyReduce_292 = happySpecReduce_1 122 happyReduction_292 happyReduction_292 (HappyTerminal (QVarId happy_var_1)) = HappyAbsSyn14 (uncurry (Qual . Module) happy_var_1 ) happyReduction_292 _ = notHappyAtAll happyReduce_293 = happySpecReduce_1 123 happyReduction_293 happyReduction_293 (HappyTerminal (VarId happy_var_1)) = HappyAbsSyn14 (UnQual happy_var_1 ) happyReduction_293 _ = notHappyAtAll happyReduce_294 = happySpecReduce_1 123 happyReduction_294 happyReduction_294 _ = HappyAbsSyn14 (as_name ) happyReduce_295 = happySpecReduce_1 123 happyReduction_295 happyReduction_295 _ = HappyAbsSyn14 (qualified_name ) happyReduce_296 = happySpecReduce_1 123 happyReduction_296 happyReduction_296 _ = HappyAbsSyn14 (hiding_name ) happyReduce_297 = happySpecReduce_1 124 happyReduction_297 happyReduction_297 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_297 _ = notHappyAtAll happyReduce_298 = happySpecReduce_1 124 happyReduction_298 happyReduction_298 (HappyTerminal (QConId happy_var_1)) = HappyAbsSyn14 (uncurry (Qual . Module) happy_var_1 ) happyReduction_298 _ = notHappyAtAll happyReduce_299 = happySpecReduce_1 125 happyReduction_299 happyReduction_299 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_299 _ = notHappyAtAll happyReduce_300 = happySpecReduce_1 125 happyReduction_300 happyReduction_300 (HappyTerminal (QConId happy_var_1)) = HappyAbsSyn14 (uncurry (Qual . Module) happy_var_1 ) happyReduction_300 _ = notHappyAtAll happyReduce_301 = happySpecReduce_1 126 happyReduction_301 happyReduction_301 (HappyTerminal (ConId happy_var_1)) = HappyAbsSyn14 (UnQual happy_var_1 ) happyReduction_301 _ = notHappyAtAll happyReduce_302 = happySpecReduce_1 127 happyReduction_302 happyReduction_302 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_302 _ = notHappyAtAll happyReduce_303 = happySpecReduce_1 127 happyReduction_303 happyReduction_303 (HappyTerminal (QConSym happy_var_1)) = HappyAbsSyn14 (uncurry (Qual . Module) happy_var_1 ) happyReduction_303 _ = notHappyAtAll happyReduce_304 = happySpecReduce_1 128 happyReduction_304 happyReduction_304 (HappyTerminal (ConSym happy_var_1)) = HappyAbsSyn14 (UnQual happy_var_1 ) happyReduction_304 _ = notHappyAtAll happyReduce_305 = happySpecReduce_1 129 happyReduction_305 happyReduction_305 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_305 _ = notHappyAtAll happyReduce_306 = happySpecReduce_1 129 happyReduction_306 happyReduction_306 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_306 _ = notHappyAtAll happyReduce_307 = happySpecReduce_1 130 happyReduction_307 happyReduction_307 (HappyTerminal (VarSym happy_var_1)) = HappyAbsSyn14 (UnQual happy_var_1 ) happyReduction_307 _ = notHappyAtAll happyReduce_308 = happySpecReduce_1 130 happyReduction_308 happyReduction_308 _ = HappyAbsSyn14 (minus_name ) happyReduce_309 = happySpecReduce_1 130 happyReduction_309 happyReduction_309 _ = HappyAbsSyn14 (pling_name ) happyReduce_310 = happySpecReduce_1 130 happyReduction_310 happyReduction_310 _ = HappyAbsSyn14 (period_name ) happyReduce_311 = happySpecReduce_1 131 happyReduction_311 happyReduction_311 (HappyTerminal (QVarSym happy_var_1)) = HappyAbsSyn14 (uncurry (Qual . Module) happy_var_1 ) happyReduction_311 _ = notHappyAtAll happyReduce_312 = happySpecReduce_1 132 happyReduction_312 happyReduction_312 (HappyAbsSyn132 happy_var_1) = HappyAbsSyn132 (happy_var_1 ) happyReduction_312 _ = notHappyAtAll happyReduce_313 = happySpecReduce_1 132 happyReduction_313 happyReduction_313 (HappyTerminal (Character happy_var_1)) = HappyAbsSyn132 (HsChar happy_var_1 ) happyReduction_313 _ = notHappyAtAll happyReduce_314 = happySpecReduce_1 132 happyReduction_314 happyReduction_314 (HappyTerminal (StringTok happy_var_1)) = HappyAbsSyn132 (HsString happy_var_1 ) happyReduction_314 _ = notHappyAtAll happyReduce_315 = happySpecReduce_1 133 happyReduction_315 happyReduction_315 (HappyTerminal (IntTok happy_var_1)) = HappyAbsSyn132 (HsInt (readInteger happy_var_1) ) happyReduction_315 _ = notHappyAtAll happyReduce_316 = happySpecReduce_1 133 happyReduction_316 happyReduction_316 (HappyTerminal (FloatTok happy_var_1)) = HappyAbsSyn132 (HsFrac (readRational happy_var_1) ) happyReduction_316 _ = notHappyAtAll happyReduce_317 = happyMonadReduce 0 134 happyReduction_317 happyReduction_317 (happyRest) = happyThen ( getSrcLoc ) (\r -> happyReturn (HappyAbsSyn134 r)) happyReduce_318 = happyMonadReduce 0 135 happyReduction_318 happyReduction_318 (happyRest) = happyThen ( do { SrcLoc _ _ c <- getSrcLoc ; pushContext (Layout c) } ) (\r -> happyReturn (HappyAbsSyn7 r)) happyReduce_319 = happySpecReduce_1 136 happyReduction_319 happyReduction_319 _ = HappyAbsSyn7 (() ) happyReduce_320 = happyMonadReduce 1 136 happyReduction_320 happyReduction_320 (_ `HappyStk` happyRest) = happyThen ( popContext ) (\r -> happyReturn (HappyAbsSyn7 r)) happyReduce_321 = happySpecReduce_1 137 happyReduction_321 happyReduction_321 (HappyTerminal (ConId happy_var_1)) = HappyAbsSyn137 (Module happy_var_1 ) happyReduction_321 _ = notHappyAtAll happyReduce_322 = happySpecReduce_1 138 happyReduction_322 happyReduction_322 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_322 _ = notHappyAtAll happyReduce_323 = happySpecReduce_1 139 happyReduction_323 happyReduction_323 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_323 _ = notHappyAtAll happyReduce_324 = happySpecReduce_1 140 happyReduction_324 happyReduction_324 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_324 _ = notHappyAtAll happyReduce_325 = happySpecReduce_1 141 happyReduction_325 happyReduction_325 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_325 _ = notHappyAtAll happyReduce_326 = happySpecReduce_1 142 happyReduction_326 happyReduction_326 (HappyAbsSyn14 happy_var_1) = HappyAbsSyn14 (happy_var_1 ) happyReduction_326 _ = notHappyAtAll happyNewToken action sts stk = lexer(\tk -> let cont i = action i i tk (HappyState action) sts stk in case tk of { EOF -> action 205 205 (error "reading EOF!") (HappyState action) sts stk; VarId happy_dollar_dollar -> cont 143; QVarId happy_dollar_dollar -> cont 144; ConId happy_dollar_dollar -> cont 145; QConId happy_dollar_dollar -> cont 146; VarSym "-" -> cont 147; VarSym happy_dollar_dollar -> cont 148; ConSym happy_dollar_dollar -> cont 149; QVarSym happy_dollar_dollar -> cont 150; QConSym happy_dollar_dollar -> cont 151; QModId happy_dollar_dollar -> cont 152; IntTok happy_dollar_dollar -> cont 153; FloatTok happy_dollar_dollar -> cont 154; Character happy_dollar_dollar -> cont 155; StringTok happy_dollar_dollar -> cont 156; LeftParen -> cont 157; RightParen -> cont 158; SemiColon -> cont 159; LeftCurly -> cont 160; RightCurly -> cont 161; VRightCurly -> cont 162; LeftSquare -> cont 163; RightSquare -> cont 164; Comma -> cont 165; Underscore -> cont 166; BackQuote -> cont 167; Period -> cont 168; DotDot -> cont 169; DoubleColon -> cont 170; Equals -> cont 171; Backslash -> cont 172; Bar -> cont 173; LeftArrow -> cont 174; RightArrow -> cont 175; At -> cont 176; Tilde -> cont 177; DoubleArrow -> cont 178; Exclamation -> cont 179; KW_As -> cont 180; KW_Case -> cont 181; KW_Class -> cont 182; KW_Data -> cont 183; KW_Default -> cont 184; KW_Deriving -> cont 185; KW_Do -> cont 186; KW_Else -> cont 187; KW_Hiding -> cont 188; KW_If -> cont 189; KW_Import -> cont 190; KW_In -> cont 191; KW_Infix -> cont 192; KW_InfixL -> cont 193; KW_InfixR -> cont 194; KW_Instance -> cont 195; KW_Let -> cont 196; KW_Module -> cont 197; KW_NewType -> cont 198; KW_Of -> cont 199; KW_Then -> cont 200; KW_Type -> cont 201; KW_Where -> cont 202; KW_Qualified -> cont 203; KW_Primitive -> cont 204; }) happyThen :: PM a -> (a -> PM b) -> PM b happyThen = (thenPM) happyReturn = (returnPM) happyThen1 = happyThen happyReturn1 = happyReturn parse = happyThen (happyParse action_0) (\x -> case x of {HappyAbsSyn4 z -> happyReturn z; _other -> notHappyAtAll }) happyError = parseError "parse error" {-# LINE 1 "GenericTemplate.hs" #-} {-# LINE 1 "GenericTemplate.hs" #-} -- $Id: HsParser.hs,v 1.17 2001/11/24 04:55:36 hallgren Exp $ {-# LINE 15 "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 happyAccept j tk st sts (HappyStk ans _) = (happyReturn1 ans) ----------------------------------------------------------------------------- -- Arrays only: do the next action {-# LINE 138 "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') = action nt j tk st sts (fn v1 `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') = action nt j tk st sts (fn v1 v2 `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') = action nt j tk st sts (fn v1 v2 v3 `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 = action nt j tk st1 sts1 (fn stk) where sts1@(((st1@(HappyState (action))):(_))) = happyDrop k ((st):(sts)) happyMonadReduce k nt fn (1) tk st sts stk = happyFail (1) tk st sts stk happyMonadReduce k nt fn j tk st sts stk = happyThen1 (fn stk) (\r -> action nt j tk st1 sts1 (r `HappyStk` drop_stk)) where sts1@(((st1@(HappyState (action))):(_))) = happyDrop k ((st):(sts)) drop_stk = happyDropStk k 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 = -- trace "failing" $ happyError {- 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 = error "Internal Happy error\n" ----------------------------------------------------------------------------- -- Hack to get the typechecker to accept our action functions ----------------------------------------------------------------------------- -- 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.
forste/haReFork
tools/base/parse/extras/HsParser.hs
bsd-3-clause
251,162
9,397
22
34,931
76,473
41,048
35,425
7,277
63
{-# LANGUAGE CPP #-} import Data.Char import Data.List import Data.Function (on) import System.Environment import System.FilePath import Test.Haddock import Test.Haddock.Xhtml checkConfig :: CheckConfig Xml checkConfig = CheckConfig { ccfgRead = parseXml , ccfgClean = \_ -> strip , ccfgDump = dumpXml , ccfgEqual = (==) `on` dumpXml } where strip = stripAnchors' . stripLinks' . stripFooter stripLinks' = stripLinksWhen $ \href -> "#local-" `isPrefixOf` href stripAnchors' = stripAnchorsWhen $ \name -> "local-" `isPrefixOf` name dirConfig :: DirConfig dirConfig = (defaultDirConfig $ takeDirectory __FILE__) { dcfgCheckIgnore = checkIgnore } main :: IO () main = do cfg <- parseArgs checkConfig dirConfig =<< getArgs runAndCheck $ cfg { cfgHaddockArgs = cfgHaddockArgs cfg ++ [ "--pretty-html" , "--hyperlinked-source" ] } checkIgnore :: FilePath -> Bool checkIgnore file | and . map ($ file) $ [isHtmlFile, isSourceFile, isModuleFile] = False where isHtmlFile = (== ".html") . takeExtension isSourceFile = (== "src") . takeDirectory isModuleFile = isUpper . head . takeBaseName checkIgnore _ = True
Helkafen/haddock
hypsrc-test/Main.hs
bsd-2-clause
1,234
0
11
291
333
190
143
34
1
import Foreign import Data.Word import Control.Monad import System.Mem main = do let finalize p = do putStrLn ("finalize: " ++ show p) free p allocToForeignPtr finalize (mallocBytes 4096) forever performGC allocToForeignPtr :: (Ptr a -> IO ()) -- finalizer -> IO (Ptr a) -- allocate -> IO (ForeignPtr a) allocToForeignPtr fin alloc = do done <- asFinalizer fin newForeignPtr done =<< alloc asFinalizer :: (Ptr a -> IO ()) -> IO (FinalizerPtr a) asFinalizer = mkFinalizer foreign import ccall "wrapper" mkFinalizer :: (Ptr a -> IO ()) -> IO (FinalizerPtr a)
urbanslug/ghc
testsuite/tests/ffi/should_run/ffi020.hs
bsd-3-clause
651
0
15
185
234
112
122
21
1
module Run where import Prelude hiding (id, putStrLn) import Control.Lens hiding (children, mapping) import qualified Data.List as List import Data.Map (Map) import qualified Data.Map as Map import qualified Data.Set as Set import Data.Text (Text) import qualified Builtins import CodeDb import CodeDbIdGen --import qualified Diff import qualified DiffTree import qualified Eval import qualified Id import qualified Lam data ProjectionCode = ProjectionCode CodeDbId CodeDbType [ProjectionCode] projectionCodeId :: ProjectionCode -> CodeDbId projectionCodeId (ProjectionCode id _ _) = id data Projection = Projection { projectionCode :: [ProjectionCode], projectionNames :: Map CodeDbId Text } instance Monoid Projection where mempty = Projection [] Map.empty mappend (Projection code1 names1) (Projection code2 names2) = Projection (code1 ++ code2) (Map.union names1 names2) data Error = ParseError (Lam.NameResolutionError CodeDbId) | RuntimeError (Eval.EvalError CodeDbId) deriving (Eq, Ord, Show) evalWithTrail :: Lam.Resolved CodeDbId -> Eval.Env CodeDbId -> Map CodeDbId (Eval.Val CodeDbId) -> Lam.ExpWithId CodeDbId -> Eval.Trail CodeDbId -> Either [Error] (Eval.Trailing CodeDbId (Eval.Val CodeDbId)) evalWithTrail resolved toplevelEnv initialEnv mainExp trail = (_Left %~ map RuntimeError) $ Eval.eval resolved (Eval.GlobalEnv toplevelEnv) (Eval.Frame Nothing (CodeDbId "TOPFRAME") Map.empty) initialEnv trail mainExp bindingContentsEnvItems :: (Ord i) => Lam.BindingWithId i -> [(i, Eval.Val i)] bindingContentsEnvItems (Id.WithId i (Identity (Lam.Binding _ contents))) = go contents where go (Lam.BindingExp boundExp) = [(Lam.expTopId boundExp, Eval.Thunk [] Set.empty Map.empty (Id.WithId (Lam.expTopId boundExp) . Identity . Eval.ThunkExp $ boundExp))] go (Lam.BindingTypeish (Lam.Record fields)) = [(i, Eval.Thunk [fieldIds] (Set.fromList fieldIds) Map.empty (Id.WithId i . Identity $ Eval.ThunkRecord))] where fieldIds = (^. Id.id) <$> fields go (Lam.BindingTypeish (Lam.Union _)) = [] eval :: [Lam.BindingWithId CodeDbId] -> Map CodeDbId (Eval.Val CodeDbId) -> Either [Error] (Eval.Val CodeDbId) eval bindingsWithIds initialEnv = do resolved <- (_Left %~ pure . ParseError) $ Lam.resolveVars (Lam.GlobalNames Builtins.functionIds Builtins.allArgIds) bindingsWithIds let maybeMainExp = Lam.bindingExp =<< List.find ((== "main") . Lam.bindingName) bindingsWithIds mainExp <- maybe (Left [RuntimeError $ Eval.UndefinedVar (CodeDbId "toplevel") "main"]) Right maybeMainExp let toplevelEnv = let bindingsEnv = Map.fromList . concat $ bindingContentsEnvItems <$> bindingsWithIds in Map.unions [bindingsEnv, Builtins.builtinsEnv] iterateTrail mempty (evalWithTrail resolved toplevelEnv initialEnv mainExp) iterateTrail :: Eval.Trail CodeDbId -> (Eval.Trail CodeDbId -> Either [Error] (Eval.Trailing CodeDbId (Eval.Val CodeDbId))) -> Either [Error] (Eval.Val CodeDbId) iterateTrail trail1 next = do (Eval.Trailing newTrail result) <- next trail1 let mergedTrails = Set.union trail1 newTrail if trail1 == mergedTrails then pure result else iterateTrail mergedTrails next projectCode :: [Lam.Binding Identity] -> IO ([Lam.BindingWithId CodeDbId], Projection) projectCode code = do bindingsWithIds <- runCodeDbIdGen $ mapM (Lam.bindingWithId nextCodeDbId) code let projection = bindingsWithIdsProjection bindingsWithIds pure (bindingsWithIds, projection) runProjection :: [Lam.BindingWithId CodeDbId] -> (Either [Error] (Eval.Val CodeDbId)) runProjection bindingsWithIds = eval bindingsWithIds Map.empty runProjectionWithEnv :: [Lam.BindingWithId CodeDbId] -> Map CodeDbId (Eval.Val CodeDbId) -> Either [Error] (Eval.Val CodeDbId) runProjectionWithEnv bindingsWithIds initialEnv = eval bindingsWithIds initialEnv bindingsWithIdsProjection :: [Lam.BindingWithId CodeDbId] -> Projection bindingsWithIdsProjection bindingsWithIds = mconcat $ diffTreeProjection <$> diffTrees where diffTrees = Lam.bindingDiffTrees (Lam.mapBindingId codeDbIdText <$> bindingsWithIds) diffTreeProjection :: DiffTree.DiffTree -> Projection diffTreeProjection (DiffTree.DiffTree id label name children) = let Projection childrenProjectionCode childNamesMap = foldMap diffTreeProjection children projectionCode = ProjectionCode (CodeDbId id) (CodeDbType label) childrenProjectionCode projectionNames = maybe childNamesMap (\childName -> Map.insert (CodeDbId id) childName childNamesMap) name in Projection [projectionCode] projectionNames initFromProjection :: Projection -> ([CodeDbId], CodeDb) initFromProjection Projection{..} = (id, CodeDb tree projectionNames) where (id, tree) = codeDbGraphFromProjectionCodeList projectionCode codeDbGraphFromProjectionCodeList :: [ProjectionCode] -> ([CodeDbId], CodeDbGraph) codeDbGraphFromProjectionCodeList projectionCodeList = (ids, Map.unions trees) where (ids, trees) = unzip $ map codeDbGraphFromProjectionCode $ projectionCodeList codeDbGraphFromProjectionCode :: ProjectionCode -> (CodeDbId, CodeDbGraph) codeDbGraphFromProjectionCode (ProjectionCode id ty children) = (id, Map.insert id entry childrenCodeDbGraph) where (childrenCodeDbIds, childrenCodeDbGraphs) = unzip $ map codeDbGraphFromProjectionCode children childrenCodeDbGraph = Map.unions childrenCodeDbGraphs entry = CodeDbGraphEntry ty childrenCodeDbIds
imccoy/utopia
src/Run.hs
mit
5,569
0
17
904
1,703
881
822
-1
-1
{-# LANGUAGE TemplateHaskell #-} module TH_Helper where import Language.Haskell.TH ( stringE ) import Language.Haskell.TH.Syntax ( Q, Exp ) bs1 :: IO (Bool, String) bs1 = return (True, "bob") bs2 :: IO (Bool, String) bs2 = return (False, "bob") bs3 :: IO (Bool, String) bs3 = return (True, "") bs4 :: IO (Bool, String) bs4 = return (False, "") cq1 :: Q Exp cq1 = [| return True :: IO Bool |] cq2 :: Q Exp cq2 = [| return False :: IO Bool |] cq3 :: Q Exp cq3 = [| error "Elumpit" :: IO Bool |] flumpet :: Q Exp flumpet = stringE "flumpet"
sixears/fluffy
t/TH_Helper.hs
mit
575
0
6
142
207
123
84
20
1
module Main ( main ) where import Test.Framework import Test.Framework.Providers.QuickCheck2 import Test.Framework.Providers.HUnit import UITest main :: IO () main = defaultMain tests tests :: [Test] tests = [ testGroup "UI" [ testGroup "Migrated from HUnit" $ hUnitTestToTests testRenderBullet , testProperty "SVG for bullet" propRenderedSvgContainsCircle ] ]
andreyLevushkin/LambdaWars
tests/MainTestSuite.hs
mit
407
0
9
92
91
52
39
15
1
--scans.hs module Scans where fibs = 1 : scanl (+) 1 fibs fibsN = (!!) fibs fibsToN n = take n $ fibs smallFibs = takeWhile (< 100) fibs factorialScan n = scanl (*) 1 [1..n]
deciduously/Haskell-First-Principles-Exercises
2-Defining and combining/10-Folding Lists/code/scans.hs
mit
176
0
6
38
84
47
37
6
1
-- file: ch01/WC.hs -- From chapter 1, http://book.realworldhaskell.org/read/getting-started.html main = interact wordCount where wordCount input = show (length (lines input)) ++ "\n"
Sgoettschkes/learning
haskell/RealWorldHaskell/ch01/WC.hs
mit
189
0
12
27
40
20
20
2
1
module Main where valid :: Char -> Bool valid x = (x >= '0' && x <= '9') indexof ([], x, n) = -1 indexof (s:t, x, n) | (x == s) = n | otherwise = indexof(t, x, n + 1) index (list, x) = indexof(list, x, 0) char2nr :: Char -> Integer char2nr x = index("0123456789", x) list_reverse ([], e) = e list_reverse (s:t, e) = list_reverse(t, s:e) reverse_list s = list_reverse(s, []) int_reverse :: [Char] -> Integer int_reverse [] = 0 int_reverse (s:t) = char2nr(s) + 10 * int_reverse(t) int_parse list = int_reverse(reverse_list list) fraction_imp :: Floating float => [Char] -> float fraction_imp [] = 0.0 fraction_imp (s:t) = fromIntegral(char2nr(s)) + fraction_imp(t) * 0.1 fraction_parse n = 0.1 * fraction_imp(n) drop_while ([], n) = [] drop_while (s:t, n) | s == n = t | otherwise = drop_while(t, n) take_until ([], n) = [] take_until (s:t, n) | s == n = [] | otherwise = s:take_until(t, n) integer_part n = int_parse [x | x <- n, valid x] fraction_part n = fraction_parse [x | x <- n, valid x] string2num n = fromIntegral(integer_part(take_until(n, '.'))) + fraction_part(drop_while(n, '.')) main = do print (valid '9') print (valid 'a') print (index ([1,2,3,4,5], 4)) print (index ([1,2,3,4,5], 9)) print (char2nr '9') print (reverse_list "Hello, World") print (int_parse "1234") print (fraction_parse "1234") print (take_until ("13.14159", '.')) print (drop_while ("13.14159", '.')) print (string2num "3.1415926" ) print (string2num "$2,345,678.222" )
skywind3000/language
haskell/str2int.hs
mit
1,802
0
11
586
839
432
407
47
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Views.Components.FeaturedComics (featuredComicsView) where import BasicPrelude import Text.Blaze.Html5 (Html, toHtml, toValue, (!)) import qualified Text.Blaze.Html5 as H import qualified Text.Blaze.Html5.Attributes as A import Models.FeaturedComic (FeaturedComic) import qualified Models.FeaturedComic as FCo import Models.Image (getStandardXLarge) import Routes (RouteUrl(ComicUrl)) featuredComicsView :: [FeaturedComic] -> Html featuredComicsView featuredComics = case featuredComics of [] -> mempty xs -> do H.h2 "Featured comics" H.div ! A.class_ "container row" $ mapM_ featuredComicsItemView xs featuredComicsItemView :: FeaturedComic -> Html featuredComicsItemView featuredComic = let name = FCo.name featuredComic in H.div ! A.class_ "col-md-3" $ H.a ! A.href (toValue (ComicUrl (FCo.id featuredComic))) ! A.class_ "thumbnail" $ do H.img ! A.class_ "img-responsive img-circle center-block" ! A.src (toValue (getStandardXLarge (FCo.thumbnail featuredComic))) ! A.alt (toValue name) ! A.title (toValue name) H.div ! A.class_ "caption" $ H.h4 ! A.class_ "text-center text-ellipsis" $ toHtml name
nicolashery/example-marvel-haskell
Views/Components/FeaturedComics.hs
mit
1,285
0
20
243
368
195
173
31
2
module NinetyNine.Parser.Token where import Control.Applicative ((<|>), some) import NinetyNine.Parser.Char import NinetyNine.Parser.Combinator import NinetyNine.Parser.Prim natural :: Parser Integer natural = read <$> some digit integer :: Parser Integer integer = sign <*> natural float :: Parser Double float = sign <*> unsigned where unsigned = read . concat <$> sequence [some digit, string ".", some digit] sign :: Num n => Parser (n -> n) sign = (negate <$ char '-') <|> (id <$ char '+') <|> return id lexeme :: Parser a -> Parser a lexeme = (<* spaces) parens :: Parser a -> Parser a parens = between (char '(') (char ')') completes :: Parser a -> Parser a completes = between spaces eof . lexeme
airt/Haskell-99
src/NinetyNine/Parser/Token.hs
mit
719
0
10
131
278
147
131
20
1
module Network.Minecraft.Actions ( chat , look , move ) where import Control.Monad.State import Network.Minecraft.Core (send) import Network.Minecraft.State import Network.Minecraft.Types chat :: String -> Bot () chat = send . ChatMessage look :: Float -> Float -> Bot () look y p = modifyPlayer $ \s -> s { playerYaw = y, playerPitch = p } move :: Int -> Int -> Int -> Bot () move dx dy dz = do modifyPlayer $ \s -> s { playerX = playerX s + fromIntegral dx , playerY = playerY s + fromIntegral dy , playerZ = playerZ s + fromIntegral dz } player <- gets statePlayer send $ PlayerPosition (playerX player) (playerY player) (playerStance player) (playerZ player) (playerOnGround player)
kylc/botM
src/Network/Minecraft/Actions.hs
mit
802
0
12
233
275
146
129
19
1
-- Intermission: Exercises -- We’re going to practice using case expressions by rewriting functions. Some -- of these functions you’ve already seen in previous chapters (and some you’ll -- see later using different syntax yet again!), but you’ll be writing new -- versions now. Please note these are all written as they would be in source -- code files, and we recommend you write your answers in source files and then -- load into GHCi to check, rather than trying to do them directly into the -- REPL. -- First, rewrite if-then-else expressions into case expressions. -- 1. The following should return x when x is greater than y. functionC x y = case (x > y) of True -> x False -> y -- 2. The following will add 2 to even numbers and otherwise simply return the -- input value. ifEvenAdd2 n = case even n of True -> (n+2) False -> n -- The next exercise doesn’t have all the cases covered. See if you can fix it. -- 1. The following compares a value, x, to zero and returns an indicator for -- whether x is a postive number or negative number. But what if x is 0? You may -- need to play with the compare function a bit to find what to do. nums x = case compare x 0 of LT -> -1 GT -> 1 EQ -> 0
diminishedprime/.org
reading-list/haskell_programming_from_first_principles/07_05.hs
mit
1,294
0
9
324
121
68
53
11
3
-- | NOTE: This exception should only be used to indicate an Hquery bug. {-# LANGUAGE DeriveDataTypeable #-} module Text.Hquery.Internal.Error where import Control.Exception import Data.Typeable data HqueryInternalException = HqueryInternalException String deriving (Show, Typeable) instance Exception HqueryInternalException -- | Unconditionally throw an HqueryInternalException with the specified error -- message. This should not be used for user errors, just internal hquery -- errors. raise :: String -> a raise = throw . HqueryInternalException
tych0/hquery
src/Text/Hquery/Internal/Error.hs
mit
556
0
6
76
68
41
27
9
1
module Zepto.Primitives.IOPrimitives where import Control.Monad (liftM) import Control.Monad.Except (liftIO, throwError) import Crypto.Number.Generate (generateBetween) import System.Directory (doesFileExist, getHomeDirectory, getCurrentDirectory, setCurrentDirectory) import System.Environment (getEnv, setEnv) import System.Exit import System.IO import System.IO.Error (tryIOError) import System.Process (readProcessWithExitCode) import System.Clock import qualified System.IO.Strict as S (readFile) import qualified Data.ByteString as BS (readFile) import Zepto.Types import Paths_zepto changeDirDoc :: String changeDirDoc = "changes directory of the current program.\n\ \n\ params:\n\ - dir: the directory to change to\n\ complexity: O(1)\n\ returns: boolean" changeDir :: LispVal -> IOThrowsError LispVal changeDir (SimpleVal (String dir)) = do _ <- liftIO $ setCurrentDirectory dir return $ fromSimple $ Bool True changeDir x = throwError $ TypeMismatch "string" x getHomeDirDoc :: String getHomeDirDoc = "get user's home directory.\n\ \n\ complexity: O(1)\n\ returns: the home directory as string" getHomeDir :: IOThrowsError LispVal getHomeDir = do dir <- liftIO getHomeDirectory return $ fromSimple $ String dir zeptoDirDoc :: String zeptoDirDoc = "get zepto installation directory.\n\ \n\ complexity: O(1)\n\ returns: the directory as string" getZeptoDir :: IOThrowsError LispVal getZeptoDir = do dir <- liftIO $ getDataFileName "" return $ fromSimple $ String dir getCurrentDirDoc :: String getCurrentDirDoc = "get the current directory.\n\ \n\ complexity: O(1)\n\ returns: the current directory as string" getCurrentDir :: IOThrowsError LispVal getCurrentDir = do dir <- liftIO getCurrentDirectory return $ fromSimple $ String dir openDoc :: String -> String openDoc mode = "open a file for " ++ mode ++ ".\n\ \n\ params:\n\ - filename: the filename of the file to open\n\ complexity: O(1)\n\ returns: the file port" makePort :: IOMode -> [LispVal] -> IOThrowsError LispVal makePort mode [SimpleVal (String filename)] = do fex <- liftIO $ doesFileExist filename if not fex && mode == ReadMode then return $ fromSimple $ Bool False else liftM Port $ liftIO $ openFile filename mode makePort _ badArgs = throwError $ BadSpecialForm "Cannot evaluate " $ head badArgs closeFDoc :: String -> String closeFDoc mode = "close a file that was opened for " ++ mode ++ ".\n\ \n\ params:\n\ - port: the port to close\n\ complexity: O(1)\n\ returns: nil" closePort :: [LispVal] -> IOThrowsError LispVal closePort [Port port] = liftIO $ hClose port >> return (fromSimple (Bool True)) closePort _ = return $ fromSimple $ Bool False displayDoc :: String displayDoc = "write <par>obj</par> to file <par>f</par>. Does not append newline.\n\ \n\ params:\n\ - obj: the object to write\n\ - file: the file to write to; also accepts <zepto>:stdout</zepto> or <zepto>:stderr</zepto> (optional, defaults to standard output)\n\ complexity: O(1)\n\ returns: nil" writeDoc :: String writeDoc = "write <par>obj</par> to file <par>f</par>. Appends newline.\n\ \n\ params:\n\ - obj: the object to write\n\ - file: the file to write to; also accepts <zepto>:stdout</zepto> or <zepto>:stderr</zepto> (optional, defaults to standard output)\n\ complexity: O(1)\n\ returns: nil" writeProc :: (Handle -> LispVal -> IO a) -> [LispVal] -> IOThrowsError LispVal writeProc fun [obj] = writeProc fun [obj, Port stdout] writeProc fun [obj, SimpleVal (Atom ":stdout")] = writeProc fun [obj, Port stdout] writeProc fun [obj, SimpleVal (Atom ":stderr")] = writeProc fun [obj, Port stderr] writeProc fun [obj, Port port] = do out <- liftIO $ tryIOError (liftIO $ fun port obj) case out of Left _ -> throwError $ Default "IO Error writing to port" Right _ -> return $ fromSimple $ Nil "" writeProc fun [obj, a@(SimpleVal (Atom ":flush"))] = writeProc fun [obj, Port stdout, a] writeProc fun [obj, SimpleVal (Atom ":stdout"), a@(SimpleVal (Atom ":flush"))] = writeProc fun [obj, Port stdout, a] writeProc fun [obj, SimpleVal (Atom ":stderr"), a@(SimpleVal (Atom ":flush"))] = writeProc fun [obj, Port stderr, a] writeProc fun [obj, Port port, SimpleVal (Atom ":flush")] = do out <- liftIO $ tryIOError (liftIO $ fun port obj) case out of Left _ -> throwError $ Default "IO Error writing to port" Right _ -> do flush <- liftIO $ tryIOError (liftIO $ hFlush port) case flush of Left _ -> throwError $ Default "IO Error flushing port" Right _ -> return $ fromSimple $ Nil "" writeProc _ [] = throwError $ NumArgs 1 [] writeProc _ badArgs = throwError $ BadSpecialForm "Cannot evaluate " $ head badArgs writeCharDoc :: String writeCharDoc = "write <par>obj</par> to a file <par>f</par>, defaults to the\n\ standard output.\n\ \n\ params:\n\ - obj: the object to write\n\ - f: the file to write to; also accepts <zepto>:stdout</zepto> and <zepto>:stderr</zepto> (optional)\n\ complexity: O(1)\n\ returns: nil" writeCharProc :: [LispVal] -> IOThrowsError LispVal writeCharProc [obj] = writeCharProc [obj, Port stdout] writeCharProc [obj, SimpleVal (Atom ":stdout")] = writeCharProc [obj, Port stdout] writeCharProc [obj, SimpleVal (Atom ":stderr")] = writeCharProc [obj, Port stderr] writeCharProc [obj@(SimpleVal (Character _)), Port port] = do out <- liftIO $ tryIOError (liftIO $ hPutStr port (show obj)) case out of Left _ -> throwError $ Default "IO Error writing to port" Right _ -> return $ fromSimple $ Nil "" writeCharProc [wrong, _] = throwError $ TypeMismatch "char" wrong writeCharProc [] = throwError $ NumArgs 1 [] writeCharProc badArgs = throwError $ BadSpecialForm "Cannot evaluate " $ head badArgs print' :: Handle -> LispVal -> IO () print' port obj = case obj of SimpleVal (String str) -> hPutStr port str _ -> hPutStr port $ show obj readContentsDoc :: String readContentsDoc = "read the contents of a file or port <par>f</par>.\n\ \n\ params:\n\ - f: the file or port to read\n\ complexity: O(n)\n\ returns: the contents as a string" readContents :: [LispVal] -> IOThrowsError LispVal readContents [SimpleVal (String filename)] = liftM (SimpleVal . String) $ liftIO $ S.readFile filename readContents [Port handle] = liftM (SimpleVal . String) $ liftIO $ hGetContents handle readContents [x] = throwError $ TypeMismatch "string" x readContents badArgs = throwError $ NumArgs 1 badArgs readBinContentsDoc :: String readBinContentsDoc = "read the contents of a file or port <par>f</par> as a byte vector.\n\ \n\ params:\n\ - f: the file or port to read\n\ complexity: O(n)\n\ returns: the contents as a byte vector" readBinaryContents :: [LispVal] -> IOThrowsError LispVal readBinaryContents [SimpleVal (String filename)] = liftM ByteVector $ liftIO $ BS.readFile filename readBinaryContents [x] = throwError $ TypeMismatch "string" x readBinaryContents badArgs = throwError $ NumArgs 1 badArgs exitDoc :: String exitDoc = "exit zepto.\n\ \n\ params:\n\ - return code: the program return code (optional); defaults to 0\n\ complexity: O(1)\n\ returns: this procedure exits the program" exitProc :: [LispVal] -> IOThrowsError LispVal exitProc [] = do _ <- liftIO $ tryIOError $ liftIO exitSuccess return $ fromSimple $ Nil "" exitProc [SimpleVal (Number (NumI 0))] = do _ <- liftIO $ tryIOError $ liftIO exitSuccess return $ fromSimple $ Nil "" exitProc [SimpleVal (Number (NumS 0))] = do _ <- liftIO $ tryIOError $ liftIO exitSuccess return $ fromSimple $ Nil "" exitProc [SimpleVal (Number (NumI x))] = do _ <- liftIO $ tryIOError $ liftIO $ exitWith $ ExitFailure $ fromInteger x return $ fromSimple $ Nil "" exitProc [SimpleVal (Number (NumS x))] = do _ <- liftIO $ tryIOError $ liftIO $ exitWith $ ExitFailure x return $ fromSimple $ Nil "" exitProc [x] = throwError $ TypeMismatch "integer" x exitProc badArg = throwError $ NumArgs 1 badArg timeDoc :: String timeDoc = "get the UNIX timestamp as a pair of the seconds since the UNIX\n\ epoch and the nanoseconds since the last second.\n\ \n\ complexity: O(1)\n\ returns: a pair of the format <zepto>[secs, nanosecs]</zepto>" timeProc :: IOThrowsError LispVal timeProc = do x <- liftIO $ getTime Realtime return $ List [makeNum (sec x), makeNum (nsec x)] where makeNum n = fromSimple $ Number $ NumI $ fromIntegral n systemDoc :: String systemDoc = "call the command <par>cmd</par> with an optional list of arguments\n\ <par>args</par>.\n\ \n\ params:\n\ - cmd: the command to call\n\ - args: the list of CLI arguments (optional)\n\ complexity: the complexity of <par>cmd</par>\n\ returns: <zepto>[return-code, std-output, error-output]</zepto>" systemProc :: [LispVal] -> IOThrowsError LispVal systemProc [SimpleVal (String s)] = do x <- liftIO $ tryIOError $ liftIO $ readProcessWithExitCode s [] "" case x of Right el -> case fst3 el of ExitSuccess -> return $ List $ fromSimple (Number $ NumI 0) : fromSimple (String $ snd3 el) : [fromSimple $ String $ thd3 el] ExitFailure w -> return $ List $ fromSimple (Number $ NumI $ fromIntegral w) : fromSimple (String $ snd3 el) : [fromSimple $ String $ thd3 el] Left w -> throwError $ Default $ show w systemProc [SimpleVal (String s), List given] = do let margs = unpackList given case margs of Right args -> do x <- liftIO $ tryIOError $ liftIO $ readProcessWithExitCode s args "" case x of Right el -> case fst3 el of ExitSuccess -> return $ List $ fromSimple (Number $ NumI 0) : fromSimple (String $ snd3 el) : [fromSimple $ String $ thd3 el] ExitFailure w -> return $ List $ fromSimple (Number $ NumI $ fromIntegral w) : fromSimple (String $ snd3 el) : [fromSimple $ String $ thd3 el] Left w -> throwError $ Default $ show w Left err -> throwError $ TypeMismatch "string" err where unpackList :: [LispVal] -> Either LispVal [String] unpackList pack = if all isString pack then Right $ map unpack' pack else Left $ notString pack isString (SimpleVal (String _)) = True isString _ = False unpack' (SimpleVal (String e)) = e unpack' _ = "" notString [] = fromSimple $ Nil "" notString (SimpleVal (String _):l) = notString l notString (err:_) = err systemProc [x] = throwError $ TypeMismatch "string" x systemProc badArg = throwError $ NumArgs 1 badArg randIntDoc :: String randIntDoc = "generate a random integer in a cryptographically secure manner.\n\ Optionally provide an upper or lower bound. If none are provided, the bounds\n\ will be the minimum and maximum bound of the integer hardware data type.\n\ If only one is provided, it is interpreted as the upper bound.\n\ \n\ params:\n\ - lo: the lower bound (optional)\n\ - hi: the upper bound (optional)\n\ complexity: O(1)\n\ returns: a random small-int" randIntProc :: [LispVal] -> IOThrowsError LispVal randIntProc [] = randIntProc [fromSimple $ Number $ NumI $ toInteger (minBound :: Int), fromSimple $ Number $ NumI $ toInteger (maxBound :: Int)] randIntProc [mx] = randIntProc [fromSimple $ Number $ NumI $ toInteger (minBound :: Int), mx] randIntProc [SimpleVal (Number (NumI mn)), SimpleVal (Number (NumI mx))] = do n <- liftIO $ generateBetween mn mx return $ fromSimple $ Number $ NumI n randIntProc [SimpleVal (Number (NumI _)), x] = throwError $ TypeMismatch "integer" x randIntProc [x, _] = throwError $ TypeMismatch "integer" x randIntProc x = throwError $ NumArgs 2 x fst3 :: (a, b, c) -> a fst3 (x, _, _) = x snd3 :: (a, b, c) -> b snd3 (_, x, _) = x thd3 :: (a, b, c) -> c thd3 (_, _, x) = x getEnvDoc :: String getEnvDoc = "get an environment variable <par>var</par>.\n\ \n\ params:\n\ - var: the name of the environment variable\n\ complexity: O(1)\n\ returns: a string of the environment variable" getEnvProc :: LispVal -> IOThrowsError LispVal getEnvProc (SimpleVal (String var)) = do val <- liftIO $ getEnv var return $ fromSimple $ String val getEnvProc x = throwError $ TypeMismatch "string" x setEnvDoc :: String setEnvDoc = "set an environment variable <par>var</par> to <par>val</par>.\n\ \n\ params:\n\ - var: the name of the environment variable\n\ - val: the value that <par>var</par> should be set to (string)\n\ complexity: O(1)\n\ returns: nil" setEnvProc :: [LispVal] -> IOThrowsError LispVal setEnvProc [SimpleVal (String var), SimpleVal (String val)] = do _ <- liftIO $ setEnv var val return $ fromSimple $ Nil "" setEnvProc [SimpleVal (String _), x] = throwError $ TypeMismatch "string" x setEnvProc [x, _] = throwError $ TypeMismatch "string" x setEnvProc x = throwError $ NumArgs 2 x
zepto-lang/zepto
src/Zepto/Primitives/IOPrimitives.hs
gpl-2.0
13,418
614
21
3,078
4,982
2,570
2,412
-1
-1
module Main where -- import Control.Applicative ( (<$>) ) -- import Control.Monad ( forM ) import Control.Monad.Reader import qualified Graphics.UI.SDL.Mixer as SDLm import App.Hash import App.Stuff import App.Image import App.Font import App.Screen import App.Handle data App = App { appScreen :: Screen , appHandle :: Handle , appConfig :: AppConfig } appSurface :: App -> ScreenSurface appSurface app = screenSurface $ appScreen app data AppConfig = AppConfig { music :: SDLm.Music , scratch :: SDLm.Chunk , high :: SDLm.Chunk , med :: SDLm.Chunk , low :: SDLm.Chunk } initialize :: IO App initialize = do screen <- screenInit 640 480 32 "Hardest game" fontInit SDLm.openAudio 22050 SDLm.AudioS16Sys 2 4096 music <- SDLm.loadMUS "Example.ogg" scratch <- SDLm.loadWAV "scratch.wav" high <- SDLm.loadWAV "high.wav" med <- SDLm.loadWAV "medium.wav" low <- SDLm.loadWAV "low.wav" return $ App screen emptyHandle (AppConfig music scratch high med low) {-mainFont <- TTFM.openFont "lazy.ttf" 28 cTime <- getCPUTimeDouble imags <- forM imgs (\(file, params) -> loadImage (file ++ ".png") params) let hash = zipWith (\(file, _) im -> (intern file, im)) imgs imags in return $ App (Screen screen width height bpp) (Player (80, 240) 0 150) (Handle False []) mainFont startLevels cTime hash -} -- imgs = [("player", Nothing), ("enemy", Just (255, 255, 255)), ("gold", Just (255, 255, 255))] cleanUp :: App -> IO () cleanUp app = do -- mapM_ (SDL.freeSurface.snd) $ appImages app fontQuit SDLm.closeAudio screenQuit prepareLoop :: App -> IO (Double, Handle) prepareLoop app = do -- appRender app screenRefresh (appSurface app) cTime <- getCPUTimeDouble handle <- updateHandle $ appHandle app return (cTime, handle) loop :: App -> IO App loop app = do (_, h) <- prepareLoop app if not $ null $ handleKeys h then do isNotPlayingMusic <- fmap not SDLm.playingMusic if isNotPlayingMusic then SDLm.playMusic (music $ appConfig app) (-1) else do pausedMusic <- SDLm.pausedMusic if pausedMusic then SDLm.resumeMusic else SDLm.pauseMusic loop app else if handleQuit h then return app else loop app {-(cTime, handle) <- prepareLoop app let timeForSaver = time - cTime + dtim in if timeForSaver > 0 then let nApp = app {appLevels = (lvl {levelLength = timeForSaver}):lvls, appHandle = handle} in if handleQuit handle then return nApp else loop nApp else let nPlayer = player {beastPosition = levelStartPos $ head lvls} nApp = app {appLevels = lvls, appPlayer = nPlayer, appHandle = handle} in if handleQuit handle then return nApp else loop nApp-} main :: IO () main = initialize >>= loop >>= cleanUp {- loop app@(App scr playerU _ fon levels@(Level startpos enemas zonas golds:leveles) dtim images) = do (cTime, handle) <- prepareLoop app let deltaTime = cTime - dtim nEmems = map (`beastTurn` deltaTime) enemas np = playerTurn playerU (handleKeys handle) zonas deltaTime (nPlayer, pickedGold) = if any (`collision` np) nEmems then (playerDie np startpos, resetGold golds) else (np, takeGold np golds) in if all goldTaked pickedGold && any (checkWin nPlayer) zonas then let mPlayer = nPlayer {beastPosition = levelStartPos $ head leveles} nApp = App scr mPlayer handle fon leveles cTime images in if handleQuit handle then return nApp else loop nApp else let nApp = App scr nPlayer handle fon (lvlsUpdate levels nEmems pickedGold) cTime images in if handleQuit handle then return nApp else loop nApp playerTurn :: Beast -> [SDL.SDLKey] -> [Zone] -> DTime -> Beast playerTurn pl [] _ _ = pl playerTurn pl@(Player curtPos _ vC) (k:keys) zon dTime |SDL.SDLK_UP == k = playerTurn (newPl (0, -vc)) keys zon dTime |SDL.SDLK_DOWN == k = playerTurn (newPl (0, vc)) keys zon dTime |SDL.SDLK_LEFT == k = playerTurn (newPl (-vc, 0)) keys zon dTime |SDL.SDLK_RIGHT == k = playerTurn (newPl (vc, 0)) keys zon dTime |otherwise = playerTurn pl keys zon dTime where newPl (dx, dy) = let player = pl {beastPosition = plus curtPos (dx, dy)} in if all (checkCollision player) zon then player else pl vc = vC * dTime -} {- appRender (App screen player _ font (level:_) _ images) = do color <- (SDL.mapRGB . SDL.surfaceGetPixelFormat) surface 0x3f 0x3f 0x3f let clipRect = Just $ SDL.Rect 0 0 640 480 in do SDL.fillRect surface clipRect color renderLevel level images surface renderBeast player (hashFind "player" images) surface deathC <- TTFR.renderTextSolid font (show $ beastDeathCount player) (SDL.Color 0 0 0) applySurface 600 0 deathC surface Nothing SDL.flip surface where surface = screenSurface screen renderLevel :: Level -> Hash SDL.Surface -> SDL.Surface -> IO () renderLevel (Level _ enem zones gold) images screen = do mapM_ (`renderZone` screen) zones mapM_ (\x -> renderGold x (hashFind "gold" images) screen) gold mapM_ (\x -> renderBeast x (hashFind "enemy" images) screen) enem renderGold :: Gold -> SDL.Surface -> SDL.Surface -> IO Bool renderGold (Gold (dx, dy) False) pict screen = applySurface x y pict screen Nothing where x = floor dx y = floor dy renderGold _ _ _ = return False -- if gold already taken - nothing to do here renderBeast :: Beast -> SDL.Surface -> SDL.Surface -> IO Bool renderBeast unit beastImage screen = applySurface x y beastImage screen Nothing where x = (floor . fst . beastPosition) unit y = (floor . snd . beastPosition) unit renderZone :: Zone -> SDL.Surface -> IO Bool renderZone (ZoneForbid (u1, u2) (u3, u4)) screen = renderZoneWithColor (u1, u2) (u3, u4) (0x3f, 0x3f, 0x3f) screen renderZone (ZoneAllow (u1, u2) (u3, u4)) screen = renderZoneWithColor (u1, u2) (u3, u4) (0xff, 0xff, 0xff) screen renderZone (ZoneWin (u1, u2) (u3, u4)) screen = renderZoneWithColor (u1, u2) (u3, u4) (0x88, 0xff, 0x88) screen renderZoneWithColor :: (RealFrac a) => (a, a) -> (a, a) -> (Word8, Word8, Word8) -> SDL.Surface -> IO Bool renderZoneWithColor (u1, u2) (u3, u4) (r, g, b) screen = do color <- (SDL.mapRGB . SDL.surfaceGetPixelFormat) screen r g b let clipRect = Just $ SDL.Rect (floor u1) (floor u2) (ceiling (u3 - u1)) (ceiling (u4 - u2)) in SDL.fillRect screen clipRect color -}
triplepointfive/hegine
src/Main.hs
gpl-2.0
7,056
0
14
2,033
574
296
278
59
5
----------------------------------------------------------------------------- -- -- Module : App.Image -- Copyright : -- License : AllRightsReserved -- -- Maintainer : -- Stability : -- Portability : -- -- | -- ----------------------------------------------------------------------------- module App.Image ( loadImage , loadImageTransparent , Image ) where import Data.Word ( Word8 ) import qualified Graphics.UI.SDL as SDL import qualified Graphics.UI.SDL.Image as SDLi type Image = SDL.Surface loadImageTransparent :: String -> (Word8, Word8, Word8) -> IO Image loadImageTransparent filename colorKey = loadImage filename >>= setColorKey colorKey setColorKey :: (Word8, Word8, Word8) -> Image -> IO Image setColorKey (r, g, b) surface = (SDL.mapRGB . SDL.surfaceGetPixelFormat) surface r g b >>= SDL.setColorKey surface [SDL.SrcColorKey] >> return surface loadImage :: String -> IO Image loadImage filename = SDLi.load filename >>= SDL.displayFormat
triplepointfive/hegine
src/App/Image.hs
gpl-2.0
982
0
10
149
230
134
96
14
1
module Main (main) where import Prelude hiding (log) import Adam.FeedTorrent.Imports import Adam.FeedTorrent.Data import Adam.FeedTorrent.Parser import Adam.FeedTorrent.Download import Adam.FeedTorrent.Config import Adam.FeedTorrent.Args import Adam.FeedTorrent.Test (runTest) -- | Prints error messages. For now it is only putStrLn. displayError :: String -> IO () displayError = putStrLn -- | Prints log messages. For now it is only putStrLn. log :: String -> IO () log = putStrLn -- | Parses cmd line arguments and dispatches to application commands. main :: IO () main = do args <- parseArgs ecfg <- getConfig case ecfg of Left msg -> displayError $ "Error parsing config file: " ++ msg Right cfg -> do when (argCommandFeeds args) $ cmdFeeds cfg when (argCommandTorrents args) $ cmdTorrents cfg when (argCommandTest args) $ cmdTest cfg -- | Fetches all feeds specified in the config. cmdFeeds :: Config -> IO () cmdFeeds cfg = do newdirde <- doesDirectoryExist (newFeedDir cfg) dirde <- doesDirectoryExist (feedDir cfg) if not newdirde then displayError $ "new feed dir (" ++ newFeedDir cfg ++ ") does not exist." else if not dirde then displayError $ "feed dir (" ++ feedDir cfg ++ ") does not exist." else forM_ (feedUrls cfg) (\url -> do log $ "Downloading " ++ fromUrl url dlres <- downloadToUnique url (newFeedDir cfg) case dlres of Left err -> print err Right fp -> log $ "Wrote file to " ++ newFeedDir cfg </> fp ) -- | All processed feeds. feedXmls :: Config -> IO [FilePath] feedXmls cfg = map (feedDir cfg </>) <$> (getDirectoryContents' . feedDir) cfg -- | All unprocessed feeds. newFeedXmls :: Config -> IO [FilePath] newFeedXmls cfg = map (newFeedDir cfg </>) <$> (getDirectoryContents' . newFeedDir) cfg -- | Compares unprocessed and processed feeds and downloads new -- torrents. cmdTorrents :: Config -> IO () cmdTorrents cfg = do feeds <- mapM parseFile =<< feedXmls cfg newFeeds <- mapM parseFile =<< newFeedXmls cfg let mergedFeeds = mergeAllFeeds feeds newFeeds -- Only download torrents that aren't already stored. forM_ mergedFeeds (\feed -> do forM_ (items feed) (\item -> do putStrLn $ "Downloading " ++ enclosureUrl item file <- getTorrentUnlessExists cfg item case file of Left e -> error . show $ e Right filename -> putStrLn $ "Downloaded " ++ filename) mv (newFeedPath cfg feed) (oldFeedPath cfg feed)) -- | Runs some tests. cmdTest :: Config -> IO () cmdTest = runTest (cmdFeeds,cmdTorrents)
bergmark/feedtorrent
Main.hs
gpl-3.0
2,796
0
21
763
756
375
381
57
4
module Rako (make_deck,make_deck_basic,basic_param) where import Data.Random import Data.Random.List (shuffleN) data Param = Param { max_card :: Int, min_card :: Int, slot_values :: [Int] } ct_cards param = max_card param - min_card param basic_param = Param 60 1 [5, 10, 15, 20, 25, 30, 35, 40, 45, 50] make_deck_basic = make_deck basic_param make_deck :: Param -> RVar [Int] make_deck param = let n = [ min_card param .. max_card param ] in shuffleN (ct_cards param) n make_one_deck :: Param -> IO [Int] make_one_deck param = runRVar (make_deck param)
jmesmon/trifles
rako/Rako.hs
gpl-3.0
565
8
10
98
226
125
101
15
1
module HobTest.Context.Stubbed ( loadStubbedContext, stubbedFileLoader, failingFileWriter ) where import Control.Monad.Error (throwError) import Data.Text (pack) import Data.Tree import qualified Hob.Context as HC import qualified Hob.Context.FileContext as HFC import qualified Hob.Context.StyleContext as HSC import Hob.DirectoryTree import Hob.Ui fileTreeStub :: IO (Forest DirectoryTreeElement) fileTreeStub = return [ Node (DirectoryTreeElement "a" "/xxx/a" True) [ Node (DirectoryTreeElement "b" "/xxx/a/b" False) []], Node (DirectoryTreeElement "a.b" "/xxx/a.b" False) [], Node (DirectoryTreeElement "c" "/xxx/c" False) [], Node (DirectoryTreeElement "-" "/xxx/cannotRead" False) []] failingFileWriter :: HFC.FileWriter failingFileWriter _ _ = throwError $ userError "cannot write files stub" stubbedFileLoader :: HFC.FileLoader stubbedFileLoader "/xxx/c" = return $ Just $ pack "file contents for /xxx/c" stubbedFileLoader "/xxx/a/b" = return $ Just $ pack "file contents for /xxx/a/b" stubbedFileLoader "/xxx/a.b" = return $ Just $ pack "file contents for /xxx/a.b" stubbedFileLoader "/xxx/cannotRead" = return Nothing stubbedFileLoader "/xxx/testName.hs" = return $ Just $ pack "file contents for /xxx/testName.hs" stubbedFileLoader path = throwError $ userError $ "cannot open unknown file: "++path loadStubbedContext :: IO HC.Context loadStubbedContext = do sc <- HSC.defaultStyleContext "app-data" fc <- HFC.defaultFileContext stubbedFileLoader failingFileWriter fileTreeStub loadGui fc sc
svalaskevicius/hob
test/HobTest/Context/Stubbed.hs
gpl-3.0
1,602
0
11
275
389
204
185
33
1
{- PP Copyright (C) 2015-2021 Christophe Delord http://cdelord.fr/pp This file is part of PP. PP 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. PP 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 PP. If not, see <http://www.gnu.org/licenses/>. -} module CSV (makeTable) where import Control.Monad.Exception.Asynchronous.Lazy (Exceptional(..)) import Data.Char import Data.List import Data.Spreadsheet import Formats -- Type of cells data Kind = Number | Other deriving (Eq) -- Alignment of columns data Alignment = LeftAligned Int | RightAligned Int deriving (Show, Eq) -- List of possible cell separators separators :: String separators = ",;\t|" -- parseCSV parses a CSV string. -- The header `header` is used as the table header. -- If header is Nothing, the first line of the CSV data is used as a header. -- It returns the alignments of the columns and the table itself. -- The cells are left or right justified. parseCSV :: Maybe [String] -> String -> ([Alignment], [[String]]) parseCSV header csvData = (columnFormats, table) where -- CSV parser qm = '"' sep = inferSeparator csvData rows = case fromString qm sep csvData of Exceptional{exception=Nothing, result=rs} -> joinMultiLines rs Exceptional{exception=Just exc} -> errorWithoutStackTrace exc -- Header rows' = case header of Nothing -> rows Just h -> h : rows -- Line padding (each line must have the same length) maxRowLen = maximum $ map length rows' paddedRows = [ row ++ replicate (maxRowLen - length row) "" | row <- rows' ] -- Left/right alignment according to the kind of data columnFormats = map columnFormat $ transpose paddedRows table = align paddedRows columnFormats -- Infers the most probable separator according to the frequencies of characters inferSeparator :: String -> Char inferSeparator csvData = snd $ maximum freqs where count c = length $ filter (==c) csvData freqs = zip (map count separators) separators -- a cell can be a number or anything else cellKind :: String -> Kind cellKind cell = case (reads cell :: [(Double, String)]) of [_] -> Number _ -> Other -- a column is right justified if it contains more numbers than non-numbers columnFormat :: [String] -> Alignment columnFormat cells | length lefts > length rights = LeftAligned w | otherwise = RightAligned w where fmts = map cellKind cells (rights, lefts) = partition (==Number) fmts w = maximum $ map length cells -- add left or right padding to each cell according to the column alignment align :: [[String]] -> [Alignment] -> [[String]] align rows columnFormats = map alignRow rows where alignRow = zipWith alignCell columnFormats alignCell (LeftAligned w) cell = ' ' : cell' ++ replicate (w - length cell') ' ' ++ " " where cell' = strip cell alignCell (RightAligned w) cell = ' ' : replicate (w - length cell') ' ' ++ cell' ++ " " where cell' = strip cell strip = halfStrip . halfStrip where halfStrip = dropWhile isSpace . reverse -- remove new lines in cells joinMultiLines :: [[String]] -> [[String]] joinMultiLines = map (map (map join . filter (/= '\r'))) where join '\n' = ' ' join c = c -- generates a markdown or reStructuredText table makeTable :: Dialect -> Maybe [String] -> String -> String makeTable dialect header csvData = unlines $ case dialect of Md -> makePipeTable Rst -> makeGridTable where (columnFormats, table) = parseCSV header csvData (headerRow : rows) = table makeRow corner cells = concat [ corner, intercalate corner cells, corner ] makeSepRow corner cell = makeRow corner (map cell columnFormats) makeSep (LeftAligned w) = replicate (w+2) '-' makeSep (RightAligned w) = replicate (w+2) '-' makeBigSep c (LeftAligned w) = alignmentChar ++ replicate (w+1) c makeBigSep c (RightAligned w) = replicate (w+1) c ++ alignmentChar alignmentChar = case dialect of Md -> ":" Rst -> "=" makeGridTable = [ sepLine , makeRow "|" headerRow , makeSepRow "+" (makeBigSep '=') ] ++ concat [ [makeRow "|" row, sepLine] | row <- rows ] where sepLine = makeSepRow "+" makeSep makePipeTable = [ makeRow "|" headerRow , makeSepRow "|" (makeBigSep '-') ] ++ map (makeRow "|") rows
CDSoft/pp
src/CSV.hs
gpl-3.0
5,046
0
13
1,318
1,201
637
564
76
5
{-# 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.YouTube.Watermarks.Set -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <[email protected]> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Uploads a watermark image to YouTube and sets it for a channel. -- -- /See:/ <https://developers.google.com/youtube/v3 YouTube Data API Reference> for @youtube.watermarks.set@. module Network.Google.Resource.YouTube.Watermarks.Set ( -- * REST Resource WatermarksSetResource -- * Creating a Request , watermarksSet , WatermarksSet -- * Request Lenses , wsChannelId , wsPayload , wsOnBehalfOfContentOwner ) where import Network.Google.Prelude import Network.Google.YouTube.Types -- | A resource alias for @youtube.watermarks.set@ method which the -- 'WatermarksSet' request conforms to. type WatermarksSetResource = "youtube" :> "v3" :> "watermarks" :> "set" :> QueryParam "channelId" Text :> QueryParam "onBehalfOfContentOwner" Text :> QueryParam "alt" AltJSON :> ReqBody '[JSON] InvideoBranding :> Post '[JSON] () :<|> "upload" :> "youtube" :> "v3" :> "watermarks" :> "set" :> QueryParam "channelId" Text :> QueryParam "onBehalfOfContentOwner" Text :> QueryParam "alt" AltJSON :> QueryParam "uploadType" Multipart :> MultipartRelated '[JSON] InvideoBranding :> Post '[JSON] () -- | Uploads a watermark image to YouTube and sets it for a channel. -- -- /See:/ 'watermarksSet' smart constructor. data WatermarksSet = WatermarksSet' { _wsChannelId :: !Text , _wsPayload :: !InvideoBranding , _wsOnBehalfOfContentOwner :: !(Maybe Text) } deriving (Eq,Show,Data,Typeable,Generic) -- | Creates a value of 'WatermarksSet' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'wsChannelId' -- -- * 'wsPayload' -- -- * 'wsOnBehalfOfContentOwner' watermarksSet :: Text -- ^ 'wsChannelId' -> InvideoBranding -- ^ 'wsPayload' -> WatermarksSet watermarksSet pWsChannelId_ pWsPayload_ = WatermarksSet' { _wsChannelId = pWsChannelId_ , _wsPayload = pWsPayload_ , _wsOnBehalfOfContentOwner = Nothing } -- | The channelId parameter specifies the YouTube channel ID for which the -- watermark is being provided. wsChannelId :: Lens' WatermarksSet Text wsChannelId = lens _wsChannelId (\ s a -> s{_wsChannelId = a}) -- | Multipart request metadata. wsPayload :: Lens' WatermarksSet InvideoBranding wsPayload = lens _wsPayload (\ s a -> s{_wsPayload = a}) -- | Note: This parameter is intended exclusively for YouTube content -- partners. The onBehalfOfContentOwner parameter indicates that the -- request\'s authorization credentials identify a YouTube CMS user who is -- acting on behalf of the content owner specified in the parameter value. -- This parameter is intended for YouTube content partners that own and -- manage many different YouTube channels. It allows content owners to -- authenticate once and get access to all their video and channel data, -- without having to provide authentication credentials for each individual -- channel. The CMS account that the user authenticates with must be linked -- to the specified YouTube content owner. wsOnBehalfOfContentOwner :: Lens' WatermarksSet (Maybe Text) wsOnBehalfOfContentOwner = lens _wsOnBehalfOfContentOwner (\ s a -> s{_wsOnBehalfOfContentOwner = a}) instance GoogleRequest WatermarksSet where type Rs WatermarksSet = () type Scopes WatermarksSet = '["https://www.googleapis.com/auth/youtube", "https://www.googleapis.com/auth/youtube.force-ssl", "https://www.googleapis.com/auth/youtube.upload", "https://www.googleapis.com/auth/youtubepartner"] requestClient WatermarksSet'{..} = go (Just _wsChannelId) _wsOnBehalfOfContentOwner (Just AltJSON) _wsPayload youTubeService where go :<|> _ = buildClient (Proxy :: Proxy WatermarksSetResource) mempty instance GoogleRequest (MediaUpload WatermarksSet) where type Rs (MediaUpload WatermarksSet) = () type Scopes (MediaUpload WatermarksSet) = Scopes WatermarksSet requestClient (MediaUpload WatermarksSet'{..} body) = go (Just _wsChannelId) _wsOnBehalfOfContentOwner (Just AltJSON) (Just Multipart) _wsPayload body youTubeService where _ :<|> go = buildClient (Proxy :: Proxy WatermarksSetResource) mempty
rueshyna/gogol
gogol-youtube/gen/Network/Google/Resource/YouTube/Watermarks/Set.hs
mpl-2.0
5,565
0
26
1,469
716
406
310
102
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.DirectConnect.DeleteConnection -- Copyright : (c) 2013-2014 Brendan Hay <[email protected]> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or -- you can obtain it at http://mozilla.org/MPL/2.0/. -- Maintainer : Brendan Hay <[email protected]> -- Stability : experimental -- Portability : non-portable (GHC extensions) -- -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | Deletes the connection. -- -- Deleting a connection only stops the AWS Direct Connect port hour and data -- transfer charges. You need to cancel separately with the providers any -- services or charges for cross-connects or network circuits that connect you -- to the AWS Direct Connect location. -- -- <http://docs.aws.amazon.com/directconnect/latest/APIReference/API_DeleteConnection.html> module Network.AWS.DirectConnect.DeleteConnection ( -- * Request DeleteConnection -- ** Request constructor , deleteConnection -- ** Request lenses , dcConnectionId -- * Response , DeleteConnectionResponse -- ** Response constructor , deleteConnectionResponse -- ** Response lenses , dcrBandwidth , dcrConnectionId , dcrConnectionName , dcrConnectionState , dcrLocation , dcrOwnerAccount , dcrPartnerName , dcrRegion , dcrVlan ) where import Network.AWS.Prelude import Network.AWS.Request.JSON import Network.AWS.DirectConnect.Types import qualified GHC.Exts newtype DeleteConnection = DeleteConnection { _dcConnectionId :: Text } deriving (Eq, Ord, Read, Show, Monoid, IsString) -- | 'DeleteConnection' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'dcConnectionId' @::@ 'Text' -- deleteConnection :: Text -- ^ 'dcConnectionId' -> DeleteConnection deleteConnection p1 = DeleteConnection { _dcConnectionId = p1 } dcConnectionId :: Lens' DeleteConnection Text dcConnectionId = lens _dcConnectionId (\s a -> s { _dcConnectionId = a }) data DeleteConnectionResponse = DeleteConnectionResponse { _dcrBandwidth :: Maybe Text , _dcrConnectionId :: Maybe Text , _dcrConnectionName :: Maybe Text , _dcrConnectionState :: Maybe ConnectionState , _dcrLocation :: Maybe Text , _dcrOwnerAccount :: Maybe Text , _dcrPartnerName :: Maybe Text , _dcrRegion :: Maybe Text , _dcrVlan :: Maybe Int } deriving (Eq, Read, Show) -- | 'DeleteConnectionResponse' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'dcrBandwidth' @::@ 'Maybe' 'Text' -- -- * 'dcrConnectionId' @::@ 'Maybe' 'Text' -- -- * 'dcrConnectionName' @::@ 'Maybe' 'Text' -- -- * 'dcrConnectionState' @::@ 'Maybe' 'ConnectionState' -- -- * 'dcrLocation' @::@ 'Maybe' 'Text' -- -- * 'dcrOwnerAccount' @::@ 'Maybe' 'Text' -- -- * 'dcrPartnerName' @::@ 'Maybe' 'Text' -- -- * 'dcrRegion' @::@ 'Maybe' 'Text' -- -- * 'dcrVlan' @::@ 'Maybe' 'Int' -- deleteConnectionResponse :: DeleteConnectionResponse deleteConnectionResponse = DeleteConnectionResponse { _dcrOwnerAccount = Nothing , _dcrConnectionId = Nothing , _dcrConnectionName = Nothing , _dcrConnectionState = Nothing , _dcrRegion = Nothing , _dcrLocation = Nothing , _dcrBandwidth = Nothing , _dcrVlan = Nothing , _dcrPartnerName = Nothing } -- | Bandwidth of the connection. -- -- Example: 1Gbps (for regular connections), or 500Mbps (for hosted connections) -- -- Default: None dcrBandwidth :: Lens' DeleteConnectionResponse (Maybe Text) dcrBandwidth = lens _dcrBandwidth (\s a -> s { _dcrBandwidth = a }) dcrConnectionId :: Lens' DeleteConnectionResponse (Maybe Text) dcrConnectionId = lens _dcrConnectionId (\s a -> s { _dcrConnectionId = a }) dcrConnectionName :: Lens' DeleteConnectionResponse (Maybe Text) dcrConnectionName = lens _dcrConnectionName (\s a -> s { _dcrConnectionName = a }) dcrConnectionState :: Lens' DeleteConnectionResponse (Maybe ConnectionState) dcrConnectionState = lens _dcrConnectionState (\s a -> s { _dcrConnectionState = a }) dcrLocation :: Lens' DeleteConnectionResponse (Maybe Text) dcrLocation = lens _dcrLocation (\s a -> s { _dcrLocation = a }) dcrOwnerAccount :: Lens' DeleteConnectionResponse (Maybe Text) dcrOwnerAccount = lens _dcrOwnerAccount (\s a -> s { _dcrOwnerAccount = a }) dcrPartnerName :: Lens' DeleteConnectionResponse (Maybe Text) dcrPartnerName = lens _dcrPartnerName (\s a -> s { _dcrPartnerName = a }) dcrRegion :: Lens' DeleteConnectionResponse (Maybe Text) dcrRegion = lens _dcrRegion (\s a -> s { _dcrRegion = a }) dcrVlan :: Lens' DeleteConnectionResponse (Maybe Int) dcrVlan = lens _dcrVlan (\s a -> s { _dcrVlan = a }) instance ToPath DeleteConnection where toPath = const "/" instance ToQuery DeleteConnection where toQuery = const mempty instance ToHeaders DeleteConnection instance ToJSON DeleteConnection where toJSON DeleteConnection{..} = object [ "connectionId" .= _dcConnectionId ] instance AWSRequest DeleteConnection where type Sv DeleteConnection = DirectConnect type Rs DeleteConnection = DeleteConnectionResponse request = post "DeleteConnection" response = jsonResponse instance FromJSON DeleteConnectionResponse where parseJSON = withObject "DeleteConnectionResponse" $ \o -> DeleteConnectionResponse <$> o .:? "bandwidth" <*> o .:? "connectionId" <*> o .:? "connectionName" <*> o .:? "connectionState" <*> o .:? "location" <*> o .:? "ownerAccount" <*> o .:? "partnerName" <*> o .:? "region" <*> o .:? "vlan"
dysinger/amazonka
amazonka-directconnect/gen/Network/AWS/DirectConnect/DeleteConnection.hs
mpl-2.0
6,341
0
25
1,385
1,024
602
422
105
1
{-| Arbitrary types for Network.Haskoin.Transaction. -} module Network.Haskoin.Test.Transaction where import Control.Monad import qualified Data.ByteString as BS import Data.Either (fromRight) import Data.List (nub, nubBy, permutations) import Data.Word (Word64) import Network.Haskoin.Constants import Network.Haskoin.Crypto import Network.Haskoin.Script import Network.Haskoin.Test.Crypto import Network.Haskoin.Test.Script import Network.Haskoin.Transaction import Test.QuickCheck newtype TestCoin = TestCoin { getTestCoin :: Word64 } deriving (Eq, Show) instance Coin TestCoin where coinValue = getTestCoin arbitraryTxHash :: Gen TxHash arbitraryTxHash = TxHash <$> arbitraryHash256 -- | Arbitrary amount of Satoshi as Word64 (Between 1 and 21e14) arbitrarySatoshi :: Gen TestCoin arbitrarySatoshi = TestCoin <$> choose (1, maxSatoshi) -- | Arbitrary OutPoint arbitraryOutPoint :: Gen OutPoint arbitraryOutPoint = OutPoint <$> arbitraryTxHash <*> arbitrary -- | Arbitrary TxOut arbitraryTxOut :: Gen TxOut arbitraryTxOut = TxOut <$> (getTestCoin <$> arbitrarySatoshi) <*> (encodeOutputBS <$> arbitraryScriptOutput) -- | Arbitrary TxIn arbitraryTxIn :: Gen TxIn arbitraryTxIn = TxIn <$> arbitraryOutPoint <*> (encodeInputBS <$> arbitraryScriptInput) <*> arbitrary -- | Arbitrary Tx arbitraryTx :: Gen Tx arbitraryTx = do v <- arbitrary ni <- choose (0,5) no <- choose (0,5) inps <- vectorOf ni arbitraryTxIn outs <- vectorOf no arbitraryTxOut let uniqueInps = nubBy (\a b -> prevOutput a == prevOutput b) inps t <- arbitrary return $ createTx v uniqueInps outs t -- | Arbitrary Tx containing only inputs of type SpendPKHash, SpendScriptHash -- (multisig) and outputs of type PayPKHash and PaySH. Only compressed -- public keys are used. arbitraryAddrOnlyTx :: Gen Tx arbitraryAddrOnlyTx = do v <- arbitrary ni <- choose (0,5) no <- choose (0,5) inps <- vectorOf ni arbitraryAddrOnlyTxIn outs <- vectorOf no arbitraryAddrOnlyTxOut t <- arbitrary return $ createTx v inps outs t -- | Arbitrary TxIn that can only be of type SpendPKHash or -- SpendScriptHash (multisig). Only compressed public keys are used. arbitraryAddrOnlyTxIn :: Gen TxIn arbitraryAddrOnlyTxIn = do o <- arbitraryOutPoint inp <- oneof [ arbitraryPKHashCInput, arbitraryMulSigSHCInput ] s <- arbitrary return $ TxIn o (encodeInputBS inp) s -- | Arbitrary TxOut that can only be of type PayPKHash or PaySH arbitraryAddrOnlyTxOut :: Gen TxOut arbitraryAddrOnlyTxOut = do v <- getTestCoin <$> arbitrarySatoshi out <- oneof [ arbitraryPKHashOutput, arbitrarySHOutput ] return $ TxOut v $ encodeOutputBS out -- | Arbitrary SigInput with the corresponding private keys used -- to generate the ScriptOutput or RedeemScript arbitrarySigInput :: Gen (SigInput, [PrvKey]) arbitrarySigInput = oneof [ arbitraryPKSigInput >>= \(si, k) -> return (si, [k]) , arbitraryPKHashSigInput >>= \(si, k) -> return (si, [k]) , arbitraryMSSigInput , arbitrarySHSigInput ] -- | Arbitrary SigInput with a ScriptOutput of type PayPK arbitraryPKSigInput :: Gen (SigInput, PrvKey) arbitraryPKSigInput = do k <- arbitraryPrvKey let out = PayPK $ derivePubKey k op <- arbitraryOutPoint sh <- arbitraryValidSigHash return (SigInput out op sh Nothing, k) -- | Arbitrary SigInput with a ScriptOutput of type PayPKHash arbitraryPKHashSigInput :: Gen (SigInput, PrvKey) arbitraryPKHashSigInput = do k <- arbitraryPrvKey let out = PayPKHash $ getAddrHash $ pubKeyAddr $ derivePubKey k op <- arbitraryOutPoint sh <- arbitraryValidSigHash return (SigInput out op sh Nothing, k) -- | Arbitrary SigInput with a ScriptOutput of type PayMulSig arbitraryMSSigInput :: Gen (SigInput, [PrvKey]) arbitraryMSSigInput = do (m,n) <- arbitraryMSParam ks <- vectorOf n arbitraryPrvKey let out = PayMulSig (map derivePubKey ks) m op <- arbitraryOutPoint sh <- arbitraryValidSigHash perm <- choose (0,n-1) let ksPerm = take m $ permutations ks !! perm return (SigInput out op sh Nothing, ksPerm) -- | Arbitrary SigInput with ScriptOutput of type PaySH and a RedeemScript arbitrarySHSigInput :: Gen (SigInput, [PrvKey]) arbitrarySHSigInput = do (SigInput rdm op sh _, ks) <- oneof [ f <$> arbitraryPKSigInput , f <$> arbitraryPKHashSigInput , arbitraryMSSigInput ] let out = PayScriptHash $ getAddrHash $ p2shAddr rdm return (SigInput out op sh $ Just rdm, ks) where f (si, k) = (si, [k]) -- | Arbitrary Tx (empty TxIn), SigInputs and PrvKeys that can be passed to -- signTx or detSignTx to fully sign the Tx. arbitrarySigningData :: Gen (Tx, [SigInput], [PrvKey]) arbitrarySigningData = do v <- arbitrary ni <- choose (1,5) no <- choose (1,5) sigis <- vectorOf ni arbitrarySigInput let uSigis = nubBy (\(a,_) (b,_) -> sigDataOP a == sigDataOP b) sigis inps <- forM uSigis $ \(s,_) -> do sq <- arbitrary return $ TxIn (sigDataOP s) BS.empty sq outs <- vectorOf no arbitraryTxOut l <- arbitrary perm <- choose (0, length inps - 1) let tx = createTx v (permutations inps !! perm) outs l keys = concatMap snd uSigis return (tx, map fst uSigis, keys) arbitraryEmptyTx :: Gen Tx arbitraryEmptyTx = do v <- arbitrary no <- choose (1,5) ni <- choose (1,5) outs <- vectorOf no arbitraryTxOut ops <- vectorOf ni arbitraryOutPoint t <- arbitrary s <- arbitrary return $ createTx v (map (\op -> TxIn op BS.empty s) (nub ops)) outs t arbitraryPartialTxs :: Gen ([Tx], [(ScriptOutput, OutPoint, Int, Int)]) arbitraryPartialTxs = do tx <- arbitraryEmptyTx res <- forM (map prevOutput $ txIn tx) $ \op -> do (so, rdmM, prvs, m, n) <- arbitraryData txs <- mapM (singleSig so rdmM tx op) prvs return (txs, (so, op, m, n)) return (concatMap fst res, map snd res) where singleSig so rdmM tx op prv = do sh <- arbitraryValidSigHash let sigi = SigInput so op sh rdmM return . fromRight (error "Colud not decode transaction") $ signTx tx [sigi] [prv] arbitraryData = do (m, n) <- arbitraryMSParam nPrv <- choose (m, n) keys <- vectorOf n arbitraryPubKey perm <- choose (0, length keys - 1) let pubKeys = map snd keys prvKeys = take nPrv $ permutations (map fst keys) !! perm let so = PayMulSig pubKeys m elements [ (so, Nothing, prvKeys, m, n) , ( PayScriptHash $ getAddrHash $ p2shAddr so , Just so , prvKeys , m , n) ]
plaprade/haskoin
haskoin-core/src/Network/Haskoin/Test/Transaction.hs
unlicense
7,018
0
16
1,842
2,015
1,036
979
157
1
import XMonad import XMonad.Hooks.DynamicLog import XMonad.Hooks.ManageDocks import XMonad.Util.Run(spawnPipe) import XMonad.Util.EZConfig(additionalKeys) import XMonad.Layout import XMonad.Layout.Grid import XMonad.Layout.NoBorders import XMonad.Layout.ResizableTile import XMonad.Layout.Spacing import XMonad.Layout.Spiral import XMonad.Layout.SimpleDecoration import XMonad.Layout.NoFrillsDecoration import XMonad.Layout.Magnifier import XMonad.Util.Themes import System.IO myManageHook = composeAll [ className =? "Firefox" --> doShift "3:www" , className =? "Skype" --> doShift "5:z" , className =? "Xmessage" --> doFloat , manageDocks ] myTheme = defaultTheme { activeColor = blue , inactiveColor = grey , activeBorderColor = blue , inactiveBorderColor = grey , activeTextColor = grey , inactiveTextColor = light , decoHeight = 14 } where blue = "#99bbdd" grey = "#444444" light = "#dddddd" main = do xmproc <- spawnPipe "xmobar /home/jwustrack/.xmobarrc" xmonad $ defaultConfig { workspaces = ["dev","doc","www","zw","z","6","7","8","9","₀"] , borderWidth = 1 , terminal = "/home/jwustrack/bin/urxvt -fb 'xft:Monospace:size=10' -fn 'xft:Monospace:size=10' +sb -tn rxvt-unicode -bg `rcolor`" , normalBorderColor = "#444444" , focusedBorderColor = "#99bbdd" , manageHook = myManageHook <+> manageHook defaultConfig --, layoutHook = avoidStruts $ Tall 1 (3 / 100) (1 / 1.162) ||| Grid ||| Full , layoutHook = noFrillsDeco shrinkText myTheme $ avoidStruts ( Tall 1 (3 / 100) (1 / 2) ||| Mirror (Tall 1 (3 / 100) (1 / 2)) ||| Grid ||| Full ) , logHook = dynamicLogWithPP xmobarPP { ppCurrent = wrap "<fc=#66ccff>" "</fc>" , ppOutput = hPutStrLn xmproc , ppLayout = \x -> "<fc=#6cf>" ++ last (words x) ++ "</fc>" , ppTitle = xmobarColor "white" "" . shorten 50 } , modMask = mod4Mask }
jwustrack/conf
.xmonad/xmonad.hs
unlicense
2,067
2
20
517
482
281
201
48
1
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-| Module : Haskoin.Transaction.Common Copyright : No rights reserved License : MIT Maintainer : [email protected] Stability : experimental Portability : POSIX Code related to transactions parsing and serialization. -} module Haskoin.Transaction.Common ( -- * Transactions Tx(..) , TxIn(..) , TxOut(..) , OutPoint(..) , TxHash(..) , WitnessData , WitnessStack , WitnessStackItem , txHash , hexToTxHash , txHashToHex , nosigTxHash , nullOutPoint ) where import Control.Applicative ((<|>)) import Control.DeepSeq import Control.Monad (forM_, guard, liftM2, mzero, replicateM, unless, when, (<=<)) import Data.Aeson as A import Data.Aeson.Encoding (unsafeToEncoding) import Data.Binary (Binary (..)) import Data.ByteString (ByteString) import qualified Data.ByteString as B import Data.ByteString.Builder (char7) import qualified Data.ByteString.Lazy as BL import Data.Bytes.Get import Data.Bytes.Put import Data.Bytes.Serial import Data.Hashable (Hashable) import Data.Maybe (fromMaybe) import Data.Serialize (Serialize (..)) import Data.String (IsString, fromString) import Data.String.Conversions (cs) import Data.Text (Text) import Data.Word (Word32, Word64) import GHC.Generics (Generic) import Haskoin.Crypto.Hash import Haskoin.Network.Common import Haskoin.Util import Text.Read as R -- | Transaction id: hash of transaction excluding witness data. newtype TxHash = TxHash { getTxHash :: Hash256 } deriving (Eq, Ord, Generic, Hashable, Serial, NFData) instance Serialize TxHash where put = serialize get = deserialize instance Binary TxHash where put = serialize get = deserialize instance Show TxHash where showsPrec _ = shows . txHashToHex instance Read TxHash where readPrec = do R.String str <- R.lexP maybe R.pfail return $ hexToTxHash $ cs str instance IsString TxHash where fromString s = let e = error "Could not read transaction hash from hex string" in fromMaybe e $ hexToTxHash $ cs s instance FromJSON TxHash where parseJSON = withText "txid" $ maybe mzero return . hexToTxHash instance ToJSON TxHash where toJSON = A.String . txHashToHex toEncoding h = unsafeToEncoding $ char7 '"' <> hexBuilder (BL.reverse (runPutL (serialize h))) <> char7 '"' -- | Transaction hash excluding signatures. nosigTxHash :: Tx -> TxHash nosigTxHash tx = TxHash $ doubleSHA256 $ runPutS $ serialize tx { txIn = map clearInput $ txIn tx } where clearInput ti = ti { scriptInput = B.empty } -- | Convert transaction hash to hex form, reversing bytes. txHashToHex :: TxHash -> Text txHashToHex (TxHash h) = encodeHex (B.reverse (runPutS (serialize h))) -- | Convert transaction hash from hex, reversing bytes. hexToTxHash :: Text -> Maybe TxHash hexToTxHash hex = do bs <- B.reverse <$> decodeHex hex h <- either (const Nothing) Just (runGetS deserialize bs) return $ TxHash h -- | Witness stack for SegWit transactions. type WitnessData = [WitnessStack] -- | Witness stack for SegWit transactions. type WitnessStack = [WitnessStackItem] -- | Witness stack item for SegWit transactions. type WitnessStackItem = ByteString -- | Data type representing a transaction. data Tx = Tx { -- | transaction data format version txVersion :: !Word32 -- | list of transaction inputs , txIn :: ![TxIn] -- | list of transaction outputs , txOut :: ![TxOut] -- | witness data for the transaction , txWitness :: !WitnessData -- | earliest mining height or time , txLockTime :: !Word32 } deriving (Show, Read, Eq, Ord, Generic, Hashable, NFData) -- | Compute transaction hash. txHash :: Tx -> TxHash txHash tx = TxHash . doubleSHA256 . runPutS $ serialize tx {txWitness = []} instance IsString Tx where fromString = fromMaybe e . (eitherToMaybe . runGetS deserialize <=< decodeHex) . cs where e = error "Could not read transaction from hex string" instance Serial Tx where deserialize = isWitnessTx >>= \w -> if w then parseWitnessTx else parseLegacyTx serialize tx | null (txWitness tx) = putLegacyTx tx | otherwise = putWitnessTx tx instance Binary Tx where put = serialize get = deserialize instance Serialize Tx where put = serialize get = deserialize putInOut :: MonadPut m => Tx -> m () putInOut tx = do putVarInt $ length (txIn tx) forM_ (txIn tx) serialize putVarInt $ length (txOut tx) forM_ (txOut tx) serialize -- | Non-SegWit transaction serializer. putLegacyTx :: MonadPut m => Tx -> m () putLegacyTx tx = do putWord32le (txVersion tx) putInOut tx putWord32le (txLockTime tx) -- | Witness transaciton serializer. putWitnessTx :: MonadPut m => Tx -> m () putWitnessTx tx = do putWord32le (txVersion tx) putWord8 0x00 putWord8 0x01 putInOut tx putWitnessData (txWitness tx) putWord32le (txLockTime tx) isWitnessTx :: MonadGet m => m Bool isWitnessTx = lookAhead $ do _ <- getWord32le m <- getWord8 f <- getWord8 return (m == 0x00 && f == 0x01) -- | Non-SegWit transaction deseralizer. parseLegacyTx :: MonadGet m => m Tx parseLegacyTx = do v <- getWord32le is <- replicateList =<< deserialize os <- replicateList =<< deserialize when (length is == 0x00 && length os == 0x01) $ fail "Witness transaction" l <- getWord32le return Tx { txVersion = v , txIn = is , txOut = os , txWitness = [] , txLockTime = l } where replicateList (VarInt c) = replicateM (fromIntegral c) deserialize -- | Witness transaction deserializer. parseWitnessTx :: MonadGet m => m Tx parseWitnessTx = do v <- getWord32le m <- getWord8 f <- getWord8 unless (m == 0x00 && f == 0x01) $ fail "Not a witness transaction" is <- replicateList =<< deserialize os <- replicateList =<< deserialize w <- parseWitnessData $ length is l <- getWord32le return Tx {txVersion = v, txIn = is, txOut = os, txWitness = w, txLockTime = l} where replicateList (VarInt c) = replicateM (fromIntegral c) deserialize -- | Witness data deserializer. Requires count of inputs. parseWitnessData :: MonadGet m => Int -> m WitnessData parseWitnessData n = replicateM n parseWitnessStack where parseWitnessStack = do VarInt i <- deserialize replicateM (fromIntegral i) parseWitnessStackItem parseWitnessStackItem = do VarInt i <- deserialize getByteString $ fromIntegral i -- | Witness data serializer. putWitnessData :: MonadPut m => WitnessData -> m () putWitnessData = mapM_ putWitnessStack where putWitnessStack ws = do putVarInt $ length ws mapM_ putWitnessStackItem ws putWitnessStackItem bs = do putVarInt $ B.length bs putByteString bs instance FromJSON Tx where parseJSON = withObject "Tx" $ \o -> Tx <$> o .: "version" <*> o .: "inputs" <*> o .: "outputs" <*> (mapM (mapM f) =<< o .: "witnessdata") <*> o .: "locktime" where f = maybe mzero return . decodeHex instance ToJSON Tx where toJSON (Tx v i o w l) = object [ "version" .= v , "inputs" .= i , "outputs" .= o , "witnessdata" .= fmap (fmap encodeHex) w , "locktime" .= l ] toEncoding (Tx v i o w l) = pairs ( "version" .= v <> "inputs" .= i <> "outputs" .= o <> "witnessdata" .= fmap (fmap encodeHex) w <> "locktime" .= l ) -- | Data type representing a transaction input. data TxIn = TxIn { -- | output being spent prevOutput :: !OutPoint -- | signatures and redeem script , scriptInput :: !ByteString -- | lock-time using sequence numbers (BIP-68) , txInSequence :: !Word32 } deriving (Eq, Show, Read, Ord, Generic, Hashable, NFData) instance Serial TxIn where deserialize = TxIn <$> deserialize <*> (readBS =<< deserialize) <*> getWord32le where readBS (VarInt len) = getByteString $ fromIntegral len serialize (TxIn o s q) = do serialize o putVarInt $ B.length s putByteString s putWord32le q instance Binary TxIn where get = deserialize put = serialize instance Serialize TxIn where get = deserialize put = serialize instance FromJSON TxIn where parseJSON = withObject "TxIn" $ \o -> TxIn <$> o .: "prevoutput" <*> (maybe mzero return . decodeHex =<< o .: "inputscript") <*> o .: "sequence" instance ToJSON TxIn where toJSON (TxIn o s q) = object [ "prevoutput" .= o , "inputscript" .= encodeHex s , "sequence" .= q ] toEncoding (TxIn o s q) = pairs ( "prevoutput" .= o <> "inputscript" .= encodeHex s <> "sequence" .= q ) -- | Data type representing a transaction output. data TxOut = TxOut { -- | value of output is satoshi outValue :: !Word64 -- | pubkey script , scriptOutput :: !ByteString } deriving (Eq, Show, Read, Ord, Generic, Hashable, NFData) instance Serial TxOut where deserialize = do val <- getWord64le VarInt len <- deserialize TxOut val <$> getByteString (fromIntegral len) serialize (TxOut o s) = do putWord64le o putVarInt $ B.length s putByteString s instance Binary TxOut where put = serialize get = deserialize instance Serialize TxOut where put = serialize get = deserialize instance FromJSON TxOut where parseJSON = withObject "TxOut" $ \o -> TxOut <$> o .: "value" <*> (maybe mzero return . decodeHex =<< o .: "outputscript") instance ToJSON TxOut where toJSON (TxOut o s) = object ["value" .= o, "outputscript" .= encodeHex s] toEncoding (TxOut o s) = pairs ("value" .= o <> "outputscript" .= encodeHex s) -- | The 'OutPoint' refers to a transaction output being spent. data OutPoint = OutPoint { -- | hash of previous transaction outPointHash :: !TxHash -- | position of output in previous transaction , outPointIndex :: !Word32 } deriving (Show, Read, Eq, Ord, Generic, Hashable, NFData) instance Serial OutPoint where deserialize = do (h,i) <- liftM2 (,) deserialize getWord32le return $ OutPoint h i serialize (OutPoint h i) = serialize h >> putWord32le i instance Binary OutPoint where put = serialize get = deserialize instance Serialize OutPoint where put = serialize get = deserialize instance FromJSON OutPoint where parseJSON = withObject "OutPoint" $ \o -> OutPoint <$> o .: "txid" <*> o .: "index" instance ToJSON OutPoint where toJSON (OutPoint h i) = object ["txid" .= h, "index" .= i] toEncoding (OutPoint h i) = pairs ("txid" .= h <> "index" .= i) -- | Outpoint used in coinbase transactions. nullOutPoint :: OutPoint nullOutPoint = OutPoint { outPointHash = "0000000000000000000000000000000000000000000000000000000000000000" , outPointIndex = maxBound }
haskoin/haskoin
src/Haskoin/Transaction/Common.hs
unlicense
12,027
0
16
3,622
3,170
1,643
1,527
-1
-1
{-# LANGUAGE BangPatterns #-} {- Copyright 2020 The CodeWorld Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -} module CodeWorld.DrawState where import CodeWorld.Color data DrawState = -- | A 'Color', if already chosen. DrawState !AffineTransformation !(Maybe Color) -- | @(AffineTransformation a b c d e f)@ represents an affine transformation matrix -- -- > a c e -- > b d f -- > 0 0 1 -- -- References: -- https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/transform -- https://en.wikipedia.org/wiki/Transformation_matrix#Affine_transformations data AffineTransformation = AffineTransformation !Double !Double !Double !Double !Double !Double initialAffineTransformation :: AffineTransformation initialAffineTransformation = AffineTransformation 1 0 0 1 0 0 mapDSAT :: (AffineTransformation -> AffineTransformation) -> DrawState -> DrawState mapDSAT f (DrawState at mc) = DrawState (f at) mc mapDSColor :: (Maybe Color -> Maybe Color) -> DrawState -> DrawState mapDSColor f (DrawState at mc) = DrawState at (f mc) initialDS :: DrawState initialDS = DrawState initialAffineTransformation Nothing translateDS :: Double -> Double -> DrawState -> DrawState translateDS x y = mapDSAT $ \(AffineTransformation a b c d e f) -> AffineTransformation a b c d (a * x + c * y + e) (b * x + d * y + f) scaleDS :: Double -> Double -> DrawState -> DrawState scaleDS x y = mapDSAT $ \(AffineTransformation a b c d e f) -> AffineTransformation (x * a) (x * b) (y * c) (y * d) e f rotateDS :: Double -> DrawState -> DrawState rotateDS r = mapDSAT $ \(AffineTransformation a b c d e f) -> AffineTransformation (a * cos r + c * sin r) (b * cos r + d * sin r) (c * cos r - a * sin r) (d * cos r - b * sin r) e f reflectDS :: Double -> DrawState -> DrawState reflectDS th = mapDSAT $ \(AffineTransformation a b c d e f) -> AffineTransformation (a * cos r + c * sin r) (b * cos r + d * sin r) (a * sin r - c * cos r) (b * sin r - d * cos r) e f where r = 2 * th setColorDS :: Color -> DrawState -> DrawState setColorDS col = mapDSColor $ \mcol -> case (col, mcol) of (_, Nothing) -> Just col (RGBA _ _ _ 0, Just _) -> Just col (RGBA _ _ _ a1, Just (RGBA r0 g0 b0 a0)) -> Just (RGBA r0 g0 b0 (a0 * a1)) opaqueDS :: DrawState -> DrawState opaqueDS = mapDSColor $ fmap $ \(RGBA r g b _) -> RGBA r g b 1 getColorDS :: DrawState -> Maybe Color getColorDS (DrawState _ col) = col
google/codeworld
codeworld-api/src/CodeWorld/DrawState.hs
apache-2.0
3,039
0
14
675
918
469
449
74
3
{-# LANGUAGE OverloadedStrings #-} {- Created : 2015 Aug 26 (Wed) 11:56:37 by Harold Carr. Last Modified : 2015 Sep 18 (Fri) 08:08:21 by Harold Carr. -} module Service.Interact ( GetUser , PutUser , getUserPutUser , input , mkInvalidMethodOrRoute , mkInvalidMsgResponse , showInput , showOutput ) where import Client (Msg (..), MsgId, Name) import Control.Concurrent.MVar (MVar, newEmptyMVar, putMVar, takeMVar) import qualified Data.Map as Map data User = User Name MsgId challenges :: [(String,String)] challenges = [ ("NOT USED", "NOT USED") , ("r ^. responseHeader \"Content-Type\"" , "application/json; charset=utf-8") , ("r ^. responseStatus . statusCode" , "200") , ("r ^? responseBody . key \"msgId\"" , "Just (Number 3.0)") , ("msgId (fromJust (decode (fromJust (r ^? responseBody)) :: Maybe Msg))" , "4") , ("sum [1 .. 5]" , "15") , ("foldr (+) 0 [1 .. 5]" , "15") , ("product [1 .. 5]" , "120") , ("foldr (*) 1 [1 .. 5]" , "120") , ("concat [[1,2],[3,4]]" , "[1,2,3,4]") , ("foldr (++) [] [[1,2],[3,4]]" , "[1,2,3,4]") , ("length [3,2,1]" , "3") , ("foldl (const . succ) 0 [3,2,1]" , "3") , ("lastDigit 2038" , "8") , ("dropLastDigit 2038" , "203") , ("sumDigits [11, 6, 19, 5]" , "23") , ("YOU WIN!" , "dGVzdDp1c2Vy") ] challenge, expect :: Int -> String challenge = ce fst expect = ce snd -- ce :: forall t. ((String, String) -> t) -> Int -> t ce f n = f (challenges!!n) numChallenges :: Int numChallenges = length challenges - 1 score, showInput, showOutput :: Msg -> String score m = show (msgId m) ++ "/" ++ show numChallenges showInput m = "-> name:" ++ name m ++ ", id:" ++ show (msgId m) showOutput m = "<- name:" ++ name m ++ ", score:" ++ show (score m) ++ ", challenge: " ++ txt m type GetUser = Name -> IO (Maybe User) type PutUser = Name -> User -> IO User getUserPutUser :: IO (GetUser, PutUser) getUserPutUser = do mv <- newEmptyMVar; putMVar mv Map.empty return (getUser mv, putUser mv) getUser :: Ord k => MVar (Map.Map k a) -> k -> IO (Maybe a) getUser mv name0 = do m <- takeMVar mv let u = Map.lookup name0 m putMVar mv m return u putUser :: Ord k => MVar (Map.Map k b) -> k -> b -> IO b putUser mv name0 user = do m <- takeMVar mv let newM = Map.insert name0 user m putMVar mv newM return user input :: GetUser -> PutUser -> Msg -> IO Msg input gUser pUser m@(Msg name0 _ _) = do r <- gUser name0 case r of Nothing -> newUser pUser m Just exist -> existingUser pUser m exist newUser :: Monad m => (Name -> User -> m a) -> Msg -> m Msg newUser pUser (Msg name0 _ _) = do let mId = 1 let user = User name0 mId pUser name0 user return (mkMsg name0 mId) existingUser :: Monad m => (Name -> User -> m a) -> Msg -> User -> m Msg existingUser pUser (Msg name0 inId msg) u@(User _ outId) = if inId /= outId || msg /= expect outId then return (mkMsg name0 outId) else updateUser pUser u updateUser :: Monad m => (Name -> User -> m a) -> User -> m Msg updateUser pUser (User name0 mId) = do let newId = mId + 1 let newUser0 = User name0 newId pUser name0 newUser0 return (mkMsg name0 newId) mkMsg :: Name -> Int -> Msg mkMsg name0 n = Msg name0 n (challenge n) mkInvalidMsgResponse :: IO Msg mkInvalidMsgResponse = mkInvalidResponse "INVALID INPUT MESSAGE" mkInvalidMethodOrRoute :: IO Msg mkInvalidMethodOrRoute = mkInvalidResponse "INVALID HTTP METHOD OR ROUTE" mkInvalidResponse :: String -> IO Msg mkInvalidResponse = return . Msg "BAD" 0 test :: IO () test = do (gUser,pUser) <- getUserPutUser -- gUser (Name "Harold") -- pUser (Name "Harold") (User (Name "Harold")) one <- input gUser pUser (Msg "H" (-1) "my name is h") two <- input gUser pUser (Msg "H" 0 "my name is h") thr <- input gUser pUser (Msg "H" 1 "Just \"application/json; charset=utf-8\"") fou <- input gUser pUser (Msg "H" 1 "Just \"Warp/3.0.13.1\"") fiv <- input gUser pUser (Msg "H" 2 "Just \"Warp/3.0.13.1\"") mapM_ print [one,two,thr,fou,fiv] {- (decode (convertString "{ \"name\": \"H\", \"msg\": {\"txt\":\"foldC3\",\"msgId\":2} }")) :: (Maybe Msg) -}
haroldcarr/utah-haskell
2015-09-17-REST-client-wreq-aeson-foldr/solution/src/Service/Interact.hs
apache-2.0
4,815
0
12
1,583
1,402
724
678
104
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Kubernetes.V1.Capability where import GHC.Generics import qualified Data.Aeson -- | data Capability = Capability { } deriving (Show, Eq, Generic) instance Data.Aeson.FromJSON Capability instance Data.Aeson.ToJSON Capability
minhdoboi/deprecated-openshift-haskell-api
kubernetes/lib/Kubernetes/V1/Capability.hs
apache-2.0
413
1
6
60
69
42
27
12
0
import Data.List.Split (splitOn) import Data.List (transpose) ngrams n (x:xs) = if length xs >= (n - 1) then [take n (x:xs)] ++ ngrams n xs else [] splitGridLine line = map (\x -> read x :: Integer) $ splitOn " " line splitGrid gridLines = map splitGridLine gridLines horizontalsMax n grid = let horizontalsLine line = maximum $ map product $ ngrams n line in maximum $ map horizontalsLine grid verticalsMax n grid = horizontalsMax n (transpose grid) -- Get a single diagonal. x,y == starting point diagonal n grid x y = if n == 0 then [] else [(grid !! x )!! y] ++ diagonal (n-1) grid (x+1) (y+1) -- Assumes symmetric grid. Left-to-right diagonal diagonalsLRMax n grid = let maxX = (length (head grid)) - n maxY = (length grid) - n startPositions = [(x, y) | x <- [0..maxX], y <- [0..maxY]] in maximum $ map (\(x,y) -> product (diagonal n grid x y)) startPositions diagonalsMax n grid = maximum [diagonalsLRMax n grid, diagonalsLRMax n (map reverse grid)] allDirectionsMax n grid = maximum [horizontalsMax n grid, verticalsMax n grid, diagonalsMax n grid] main = do let rawGrid = ["08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08", "49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00", "81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65", "52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91", "22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80", "24 47 32 60 99 03 45 02 44 75 33 53 78 36 84 20 35 17 12 50", "32 98 81 28 64 23 67 10 26 38 40 67 59 54 70 66 18 38 64 70", "67 26 20 68 02 62 12 20 95 63 94 39 63 08 40 91 66 49 94 21", "24 55 58 05 66 73 99 26 97 17 78 78 96 83 14 88 34 89 63 72", "21 36 23 09 75 00 76 44 20 45 35 14 00 61 33 97 34 31 33 95", "78 17 53 28 22 75 31 67 15 94 03 80 04 62 16 14 09 53 56 92", "16 39 05 42 96 35 31 47 55 58 88 24 00 17 54 24 36 29 85 57", "86 56 00 48 35 71 89 07 05 44 44 37 44 60 21 58 51 54 17 58", "19 80 81 68 05 94 47 69 28 73 92 13 86 52 17 77 04 89 55 40", "04 52 08 83 97 35 99 16 07 97 57 32 16 26 26 79 33 27 98 66", "88 36 68 87 57 62 20 72 03 46 33 67 46 55 12 32 63 93 53 69", "04 42 16 73 38 25 39 11 24 94 72 18 08 46 29 32 40 62 76 36", "20 69 36 41 72 30 23 88 34 62 99 69 82 67 59 85 74 04 36 16", "20 73 35 29 78 31 90 01 74 31 49 71 48 86 81 16 23 57 05 54", "01 70 54 71 83 51 54 69 16 92 33 48 61 43 52 01 89 19 67 48"] let grid = splitGrid rawGrid print $ allDirectionsMax 4 grid
ulikoehler/ProjectEuler
Euler11.hs
apache-2.0
2,934
0
13
1,133
584
307
277
42
2
module NLP.Nerf.Server ( -- * Server runNerfServer -- * Client , ner ) where import Prelude hiding (Word) import Control.Applicative ((<$>)) import Control.Monad (forever, void) import Control.Concurrent (forkIO) import System.IO (Handle, hFlush) import qualified Data.Binary as B import qualified Data.ByteString.Lazy as BS import qualified Network as N import Data.Named.Tree (NeForest) import NLP.Nerf.Types import NLP.Nerf (Nerf) import qualified NLP.Nerf as Nerf ------------------------------------------------- -- Server ------------------------------------------------- -- | Run a Nerf server on a given port. runNerfServer :: Nerf -> N.PortID -> IO () runNerfServer nerf port = N.withSocketsDo $ do sock <- N.listenOn port forever $ sockHandler nerf sock sockHandler :: Nerf -> N.Socket -> IO () sockHandler nerf sock = do (handle, _, _) <- N.accept sock -- putStrLn "Connection established" void $ forkIO $ do -- putStrLn "Waiting for input..." inp <- recvMsg handle -- putStr "> " >> T.putStrLn inp let out = Nerf.ner nerf inp -- putStr "No. of sentences: " >> print (length out) sendMsg handle out ------------------------------------------------- -- Client ------------------------------------------------- -- | Perform NER tagging on the input sentence. ner :: N.HostName -> N.PortID -> String -> IO (NeForest NE Word) ner host port inp = do handle <- N.connectTo host port -- putStrLn "Connection established" -- putStr "Send request: " >> putStrLn inp sendMsg handle inp recvMsg handle ------------------------------------------------- -- Messages ------------------------------------------------- sendMsg :: B.Binary a => Handle -> a -> IO () sendMsg h msg = do let x = B.encode msg n = fromIntegral $ BS.length x sendInt h n BS.hPut h x hFlush h recvMsg :: B.Binary a => Handle -> IO a recvMsg h = do n <- recvInt h B.decode <$> BS.hGet h n sendInt :: Handle -> Int -> IO () sendInt h x = BS.hPut h (B.encode x) -- | TODO: is it safe to assume that the length of the -- `Int` representation is 8? recvInt :: Handle -> IO Int recvInt h = B.decode <$> BS.hGet h 8
kawu/nerf
src/NLP/Nerf/Server.hs
bsd-2-clause
2,306
0
14
549
599
316
283
47
1
-- | -- Module : Crypto.Hash.SHAKE -- License : BSD-style -- Maintainer : Vincent Hanquez <[email protected]> -- Stability : experimental -- Portability : unknown -- -- Module containing the binding functions to work with the -- SHA3 extendable output functions (SHAKE). -- {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} module Crypto.Hash.SHAKE ( SHAKE128 (..), SHAKE256 (..) ) where import Crypto.Hash.Types import Foreign.Ptr (Ptr) import Data.Typeable import Data.Word (Word8, Word32) import Data.Proxy (Proxy(..)) import GHC.TypeLits (Nat, KnownNat, natVal) import Crypto.Internal.Nat -- | SHAKE128 (128 bits) extendable output function. Supports an arbitrary -- digest size (multiple of 8 bits), to be specified as a type parameter -- of kind 'Nat'. -- -- Note: outputs from @'SHAKE128' n@ and @'SHAKE128' m@ for the same input are -- correlated (one being a prefix of the other). Results are unrelated to -- 'SHAKE256' results. data SHAKE128 (bitlen :: Nat) = SHAKE128 deriving (Show, Typeable) instance (IsDivisibleBy8 bitlen, KnownNat bitlen) => HashAlgorithm (SHAKE128 bitlen) where type HashBlockSize (SHAKE128 bitlen) = 168 type HashDigestSize (SHAKE128 bitlen) = Div8 bitlen type HashInternalContextSize (SHAKE128 bitlen) = 376 hashBlockSize _ = 168 hashDigestSize _ = byteLen (Proxy :: Proxy bitlen) hashInternalContextSize _ = 376 hashInternalInit p = c_sha3_init p 128 hashInternalUpdate = c_sha3_update hashInternalFinalize = shakeFinalizeOutput (Proxy :: Proxy bitlen) -- | SHAKE256 (256 bits) extendable output function. Supports an arbitrary -- digest size (multiple of 8 bits), to be specified as a type parameter -- of kind 'Nat'. -- -- Note: outputs from @'SHAKE256' n@ and @'SHAKE256' m@ for the same input are -- correlated (one being a prefix of the other). Results are unrelated to -- 'SHAKE128' results. data SHAKE256 (bitlen :: Nat) = SHAKE256 deriving (Show, Typeable) instance (IsDivisibleBy8 bitlen, KnownNat bitlen) => HashAlgorithm (SHAKE256 bitlen) where type HashBlockSize (SHAKE256 bitlen) = 136 type HashDigestSize (SHAKE256 bitlen) = Div8 bitlen type HashInternalContextSize (SHAKE256 bitlen) = 344 hashBlockSize _ = 136 hashDigestSize _ = byteLen (Proxy :: Proxy bitlen) hashInternalContextSize _ = 344 hashInternalInit p = c_sha3_init p 256 hashInternalUpdate = c_sha3_update hashInternalFinalize = shakeFinalizeOutput (Proxy :: Proxy bitlen) shakeFinalizeOutput :: (IsDivisibleBy8 bitlen, KnownNat bitlen) => proxy bitlen -> Ptr (Context a) -> Ptr (Digest a) -> IO () shakeFinalizeOutput d ctx dig = do c_sha3_finalize_shake ctx c_sha3_output ctx dig (byteLen d) foreign import ccall unsafe "cryptonite_sha3_init" c_sha3_init :: Ptr (Context a) -> Word32 -> IO () foreign import ccall "cryptonite_sha3_update" c_sha3_update :: Ptr (Context a) -> Ptr Word8 -> Word32 -> IO () foreign import ccall unsafe "cryptonite_sha3_finalize_shake" c_sha3_finalize_shake :: Ptr (Context a) -> IO () foreign import ccall unsafe "cryptonite_sha3_output" c_sha3_output :: Ptr (Context a) -> Ptr (Digest a) -> Word32 -> IO ()
tekul/cryptonite
Crypto/Hash/SHAKE.hs
bsd-3-clause
3,715
0
11
872
722
396
326
58
1
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverlappingInstances #-} module Database.Concelo.VMap ( VMap() , empty , singleton , member , Database.Concelo.VMap.lookup , first , firstValue , Database.Concelo.VMap.last , lastValue , insert , modify , delete , foldrKeys , keys , foldrPairs , pairs , foldrTriples , triples , index , union , Database.Concelo.VMap.subtract , foldrDiff , diff ) where import qualified Data.ByteString.Char8 as BS import qualified Data.ByteString.Base16 as B16 import qualified Data.Tree.RBTree as T import qualified Control.Lens as L import Data.Maybe (fromJust) import Data.Functor ((<$>)) import Control.Applicative ((<|>)) import Prelude hiding (foldr) import Data.Foldable (Foldable(foldr)) newtype VMap k v = VMap { run :: T.RBTree (Cell k v) } instance (Show k, Show v) => Show (VMap k v) where show = show . pairs instance Show v => Show (VMap BS.ByteString v) where show = show . fmap (\(k,v) -> (B16.encode $ BS.take 4 k, v)) . pairs instance Ord k => Functor (VMap k) where fmap f = foldrTriples (\(r, k, v) -> insert r k $ f v) empty instance Foldable (VMap k) where foldr visit seed = foldr (\(Cell _ _ v) -> visit v) seed . run data Cell k v = Cell { getCellVersion :: Integer , getCellKey :: k , getCellValue :: v } cellVersion = L.lens getCellVersion (\x v -> x { getCellVersion = v }) instance Eq k => Eq (Cell k v) where a == b = (getCellKey a) == (getCellKey b) instance Ord k => Ord (Cell k v) where compare a b = compare (getCellKey a) (getCellKey b) compareKey k c = compare k (getCellKey c) cellVersionsEqual (Cell a _ _) (Cell b _ _) = a == b empty = VMap T.Leaf singleton version key value = insert version key value empty member key map = maybe False (const True) $ find key map lookup key map = getCellValue <$> find key map find key (VMap tree) = T.searchFast (\k c -> compare k $ getCellKey c) tree key first (VMap tree) = pairKV <$> T.first tree firstValue map = snd <$> first map last' (VMap tree) = pairKV <$> T.last tree last = last' lastValue map = snd <$> last' map insert version key value = modify version key (const $ Just value) modify version key transform (VMap tree) = VMap $ T.modifyVersioned (L.set cellVersion version) compareKey tree key ((Cell version key <$>) . transform . (getCellValue <$>)) delete version key = modify version key (const Nothing) foldrKeys visit seed = foldr (visit . getCellKey) seed . run keys = foldrKeys (:) [] foldrPairs visit seed = foldr (visit . pairKV) seed . run pairs = foldrPairs (:) [] foldrTriples visit seed = foldr (visit . triple) seed . run triples = foldrTriples (:) [] index version f = foldr (\v -> insert version (f v) v) empty union version small large = foldrPairs (\(k, v) -> insert version k v) large small subtract version small large = foldrKeys (delete version) large small pairKV (Cell _ k v) = (k, v) triple (Cell r k v) = (r, k, v) visitor visit a b = visit (fromJust ((getCellKey <$> a) <|> (getCellKey <$> b))) (getCellValue <$> a) (getCellValue <$> b) foldrDiff visit seed a b = T.foldrDiffVersioned cellVersionsEqual compare (visitor visit) seed (run a) (run b) diff version a b = foldrDiff visit (empty, empty) a b where visit k a b (obsolete, new) = (maybe obsolete (flip (insert version k) obsolete) a, maybe new (flip (insert version k) new) b)
Concelo/concelo
src/Database/Concelo/VMap.hs
bsd-3-clause
3,483
0
14
758
1,470
787
683
98
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} import Test.Hspec import Test.QuickCheck import Arith import FullUntyped import Lib import SimpleBool import TyArith import Untyped import FullSimple import FullRef import FullError import RcdSubBot import FullEquiRec import FullIsoRec import FullPoly import FullOmega test :: (fs :< fs) => Syntactic fs -> String -> [String] -> [String] -> SpecWith () test fs des input output = describe des (sequence_ ts) where ts = zipWith3 (\i r o -> it i $ r `shouldBe` o) input result output result = map (runP' fs) input testArith :: SpecWith () testArith = test s "Arith" input output where s :: Syntactic '[TmBool, TmNat, TmArith] s = crep input = [ "true" , "if false then true else false" , "0" , "succ (pred 0)" , "iszero (pred (succ (succ 0)))"] output = [ "true" , "(if false then true else false)" , "0" , "succ (pred (0))" , "iszero (pred (succ (succ (0))))"] testUntyped :: SpecWith () testUntyped = test s "Untyped" input output where s :: Syntactic '[TmApp, TmLam, TmVar] s = crep input = [ "x", "y'", "\\x.x", "(\\x.x) \\x.x", "\\x.(x)", "\\x.(x x)", "\\x.x \\x.x"] output = [ "x", "y'", "\\x.x", "(\\x.x \\x.x)", "\\x.x", "\\x.(x x)", "(\\x.x \\x.x)"] testFullUntyped :: SpecWith () testFullUntyped = test s "FullUntyped" input output where s :: Syntactic '[TmBool, TmNat, TmArith, TmApp, TmLam, TmLet, TmRecord, TmFloat, TmString, TmVar] s = crep input = [ "x", "y'", "if x then false else x", "\\x.x", "(\\x.x) \\x.x", "\\x.(x)", "\\x.(x x)", "\\x.x \\x.x", "2.0", "timesfloat 2.0 3.0", "timesfloat (timesfloat 2.0 3.0) (timesfloat 4.0 5.0)", "\"hello\"", "0", "succ (pred 0)", "iszero (pred (succ (succ 0)))", "let x=true in x", "{x=\\x.x, y=(\\x.x)(\\x.x)}", "{x=\\x.x, y=(\\x.x)(\\x.x)}.x", "{x=1.0}.t"] output = [ "x", "y'", "(if x then false else x)", "\\x.x", "(\\x.x \\x.x)", "\\x.x", "\\x.(x x)", "(\\x.x \\x.x)", "2.0", "timesfloat (2.0) (3.0)", "timesfloat (timesfloat (2.0) (3.0)) (timesfloat (4.0) (5.0))", "\"hello\"", "0", "succ (pred (0))", "iszero (pred (succ (succ (0))))", "let x = true in x", "{x=\\x.x, y=(\\x.x \\x.x)}", "{x=\\x.x, y=(\\x.x \\x.x)}.x", "{x=1.0}.t"] testTyArith :: SpecWith () testTyArith = test s "TyArith" input output where s :: Syntactic '[TmBool, TmNat, TmArith, TyNat, TyBool] s = crep input = [ "true", "if false then true else false", "0", "succ (pred 0)", "iszero (pred (succ (succ 0)))", "Nat", "Bool"] output = [ "true", "(if false then true else false)", "0", "succ (pred (0))", "iszero (pred (succ (succ (0))))", "Nat", "Bool"] testSimpleBool :: SpecWith () testSimpleBool = test s "SimpleBool" input output where s :: Syntactic '[TyArr, TmBool, TyBool, TmApp, TmLam2, TmVar] s = crep input = [ "true", "if false then true else false", "if (x) then true else false", "Bool", "\\x:Bool.x", "Bool->Bool", "(\\x:Bool->Bool.x)", "(\\x:Bool->Bool.if x false then true else false) (\\x:Bool.if x then false else true)"] output = [ "true", "(if false then true else false)", "(if x then true else false)", "Bool", "\\x:Bool.x", "Bool->Bool", "\\x:Bool->Bool.x", "(\\x:Bool->Bool.(if (x false) then true else false) \\x:Bool.(if x then false else true))"] testFullSimple :: SpecWith () testFullSimple = test s "FullSimple" input output where s :: Syntactic '[TmApp, TyArr, TmCase, TmRecord, TmFloat, TmLet, TmFix, TmString, TmLam2, TmBool, TmNat, TmArith, TmAscribe, TyVariant, TmTag, TmUnit, TyUnit, TyBool, TyNat, TyString, TyVar, TmVar] s = crep input = [ "x", "if x then false else x", "\\x:A.x", "timesfloat 2.0 3.0", "\"hello\"", "0", "succ (pred 0)", "iszero (pred (succ (succ 0)))", "true", "if false then true else false", "if (x) then true else false", "Bool", "\\x:Bool.x", "Bool->Bool", "(\\x:Bool->Bool.x)", "(\\x:Bool->Bool.if x false then true else false) (\\x:Bool.if x then false else true)", "\\x:Nat.succ x", "(\\x:Nat. succ (succ x)) (succ 0)", "\\f:T. \\x:Nat. f (f x)", "let x=true in x", "{x=1.0}.t", "Unit", "unit", "unit as Unit", "<l=unit> as <l:Unit, r:Unit>", "case a of <phy=x> => x.first | <vir=y> => y.name", "\\a:Unit.fix (\\x:T.x)"] output = [ "x", "(if x then false else x)", "\\x:A.x", "timesfloat (2.0) (3.0)", "\"hello\"", "0", "succ (pred (0))", "iszero (pred (succ (succ (0))))", "true", "(if false then true else false)", "(if x then true else false)", "Bool", "\\x:Bool.x", "Bool->Bool", "\\x:Bool->Bool.x", "(\\x:Bool->Bool.(if (x false) then true else false) \\x:Bool.(if x then false else true))", "\\x:Nat.succ (x)", "(\\x:Nat.succ (succ (x)) succ (0))", "(\\f:T.\\x:Nat.f (f x))", "let x = true in x", "{x=1.0}.t", "Unit", "unit", "(unit as Unit)", "(<l=unit> as <l:Unit, r:Unit>)", "case a of <phy=x> => x.first | <vir=y> => y.name", "\\a:Unit.fix (\\x:T.x)"] testFullRef :: SpecWith () testFullRef = test s "FullRef" input output where s :: Syntactic '[TmApp, TmAssign, TyArr, TmLet, TmLam2, TmRef, TmBool, TmDeref, TyRef, TySink, TySource, TmNat, TyNat, TyUnit, TmVar] s = crep input = [ "\\a:Ref (Nat->Nat).\\n:Nat.(!a n)", "\\a:Unit.ref (\\n:Nat.0)", "\\a:Ref (Nat->Nat).\\m:Nat.\\n:Nat.let oldf = !a in a := (\\n:Nat.if true then v else (oldf n))", "\\x:Top.x", "let t = Source Nat in \\x:t.unit", "\\x:Sink t.unit"] output = [ "\\a:Ref Nat->Nat.\\n:Nat.((!a) n)", "\\a:Unit.ref \\n:Nat.0", "\\a:Ref Nat->Nat.\\m:Nat.\\n:Nat.let oldf = (!a) in a := \\n:Nat.(if true then v else (oldf n))", "\\x:Top.x", "let t = Source Nat in \\x:t.unit", "\\x:Sink t.unit"] testFullError :: SpecWith () testFullError = test s "FullError" input output where s :: Syntactic '[TmApp, TmBool, TmLam2, TyTop, TyBot, TmError, TmTry, TyBool, TmVar] s = crep input = [ "\\x:Top.if error then (try x with true) else false", "error true", "(\\x:Bool.x) error"] output = [ "\\x:Top.(if error then try x with true else false)", "(error true)", "(\\x:Bool.x error)"] testRcdSubBot :: SpecWith () testRcdSubBot = test s "RcdSubBot" input output where s :: Syntactic '[TmApp, TyArr, TmBool, TmLam2, TyRecord, TmRecord, TyTop, TyBot, TmVar] s = crep input = [ "\\x:Top.x", "(\\r:{x:Top->Top}. r.x r.x) {x=\\z:Top.z, y=\\z:Top.z}", "\\x:Bot. x x"] output = [ "\\x:Top.x", "((\\r:{x:Top->Top}.r.x r.x) {x=\\z:Top.z, y=\\z:Top.z})", "(\\x:Bot.x x)"] testFullSub :: SpecWith () testFullSub = test s "FullSub" input output where s :: Syntactic '[TmApp, TyArr, TmCase, TmRecord, TyRecord, TmFloat, TmLet, TmFix, TmString, TmLam2, TmBool, TmNat, TmArith, TmAscribe, TmAssign, TyVariant, TmTag, TmTry, TmError, TyRef, TmRef, TmDeref, TySource ,TySink, TmUnit, TyUnit, TyBool, TyNat, TyTop, TyBot, TyString, TyVar, TmVar] s = crep input = [ "x", "if x then false else x", "\\x:A.x", "timesfloat 2.0 3.0", "\"hello\"", "0", "succ (pred 0)", "iszero (pred (succ (succ 0)))", "true", "if false then true else false", "if (x) then true else false", "Bool", "\\x:Bool.x", "Bool->Bool", "(\\x:Bool->Bool.x)", "(\\x:Bool->Bool.if x false then true else false) (\\x:Bool.if x then false else true)", "\\x:Nat.succ x", "(\\x:Nat. succ (succ x)) (succ 0)", "\\f:T. \\x:Nat. f (f x)", "let x=true in x", "{x=1.0}.t", "Unit", "unit", "unit as Unit", "<l=unit> as <l:Unit, r:Unit>", "case a of <phy=x> => x.first | <vir=y> => y.name", "\\x:Top.x", "(\\r:{x:Top->Top}. r.x r.x) {x=\\z:Top.z, y=\\z:Top.z}", "\\x:Bot. x x", "\\a:Ref (Nat->Nat).\\n:Nat.(!a n)", "\\a:Unit.ref (\\n:Nat.0)", "\\a:Ref (Nat->Nat).\\m:Nat.\\n:Nat.let oldf = !a in a := (\\n:Nat.if true then v else (oldf n))", "let t = Source Nat in \\x:t.unit", "\\x:Sink t.unit", "\\x:Top.if error then (try x with true) else false", "error true", "(\\x:Bool.x) error"] output = [ "x", "(if x then false else x)", "\\x:A.x", "timesfloat (2.0) (3.0)", "\"hello\"", "0", "succ (pred (0))", "iszero (pred (succ (succ (0))))", "true", "(if false then true else false)", "(if x then true else false)", "Bool", "\\x:Bool.x", "Bool->Bool", "\\x:Bool->Bool.x", "(\\x:Bool->Bool.(if (x false) then true else false) \\x:Bool.(if x then false else true))", "\\x:Nat.succ (x)", "(\\x:Nat.succ (succ (x)) succ (0))", "(\\f:T.\\x:Nat.f (f x))", "let x = true in x", "{x=1.0}.t", "Unit", "unit", "(unit as Unit)", "(<l=unit> as <l:Unit, r:Unit>)", "case a of <phy=x> => x.first | <vir=y> => y.name", "\\x:Top.x", "((\\r:{x:Top->Top}.r.x r.x) {x=\\z:Top.z, y=\\z:Top.z})", "(\\x:Bot.x x)", "\\a:Ref Nat->Nat.\\n:Nat.((!a) n)", "\\a:Unit.ref \\n:Nat.0", "\\a:Ref Nat->Nat.\\m:Nat.\\n:Nat.let oldf = (!a) in a := \\n:Nat.(if true then v else (oldf n))", "let t = Source Nat in \\x:t.unit", "\\x:Sink t.unit", "\\x:Top.(if error then try x with true else false)", "(error true)", "(\\x:Bool.x error)"] testFullEquiRec :: SpecWith () testFullEquiRec = test s "FullEquiRec" input output where s :: Syntactic '[TmApp, TyArr, TmCase, TmRecord, TyRecord, TmFloat, TmLet, TmFix, TmString, TmLam2, TmBool, TmNat, TmArith, TmAscribe, TmAssign, TyVariant, TmTag, TmTry, TmError, TyRec, TyRef, TmRef, TmDeref, TySource ,TySink, TmUnit, TyUnit, TyBool, TyNat, TyTop, TyBot, TyString, TyVar, TmVar] s = crep input = [ "\\f:(Rec X.A->A).\\x:A.f x", "\\x:<a:Bool, b:Bool>.x", "Rec P.{get:Nat, inc:Unit->P}", "Rec A.Nat->A", "let g = fix (\\f:Nat->(Rec A.Nat->A).\\n:Nat.f) in unit", "\\l:NList.case l of <nil=u> => true | <cons=p> => false", "fix (\\p:Nat->Nat->Nat.\\m:Nat.\\n:Nat.if iszero m then n else succ (p (pred m) n))"] output = [ "(\\f:Rec X.A->A.\\x:A.f x)", "\\x:<a:Bool, b:Bool>.x", "Rec P.{get:Nat, inc:Unit->P}", "Rec A.Nat->A", "let g = fix (\\f:Nat->Rec A.Nat->A.\\n:Nat.f) in unit", "\\l:NList.case l of <nil=u> => true | <cons=p> => false", "fix (\\p:Nat->Nat->Nat.\\m:Nat.\\n:Nat.(if iszero (m) then n else succ (((p pred (m)) n))))"] testFullIsoRec :: SpecWith () testFullIsoRec = test s "FullIsoRec" input output where s :: Syntactic '[TmApp, TyArr, TmCase, TmRecord, TyRecord, TmFloat, TmLet, TmFix, TmString, TmLam2, TmBool, TmFold, TmNat, TmArith, TmAscribe, TmAssign, TyVariant, TmTag, TmTry, TmError, TyRec, TyRef, TmRef, TmDeref, TySource ,TySink, TmUnit, TyUnit, TyBool, TyNat, TyTop, TyBot, TyString, TyVar, TmVar] s = crep input = [ "let Counter = Rec P.{get:Nat, inc:Unit->P} in fold [Counter] {get=unit, inc=unit}", "(unfold [Counter] p).get"] output = [ "let Counter = Rec P.{get:Nat, inc:Unit->P} in fold [Counter] {get=unit, inc=unit}", "unfold [Counter] p.get"] testFullPoly :: SpecWith () testFullPoly = test s "FullPoly" input output where s :: Syntactic '[TmTApp, TmApp, TyArr, TmCase, TmRecord, TyRecord, TmPack, TmUnpack, TyAll, TySome, TmFloat, TmLet, TmFix, TmString, TmTAbs, TmLam2, TmBool, TmFold, TmNat, TmArith, TmAscribe, TmAssign, TyVariant, TmTag, TmTry, TmError, TyRec, TyRef, TmRef, TmDeref, TySource ,TySink, TmUnit, TyUnit, TyBool, TyNat, TyTop, TyBot, TyString, TyVar, TmVar] s = crep input = [ "let Counter = Rec P.{get:Nat, inc:Unit->P} in fold [Counter] {get=unit, inc=unit}", "(unfold [Counter] p).get", "x", "if x then false else x", "\\x:A.x", "timesfloat 2.0 3.0", "\"hello\"", "(\\X.\\x:X.x) [All X.X->X]", "{Some X, {c:X, f:X->Nat}}", "{*All Y.Y, \\x:(All Y.Y).x} as {Some X, X->X}", "{*Nat, {c=0, f=\\x:Nat. succ x}} as {Some X, {c:X, f:X->Nat}}", "let {X,ops} = {*Nat, {c=0, f=\\x:Nat.succ x}} as {Some X, {c:X, f:X->Nat}} in (ops.f ops.c)"] output = [ "let Counter = Rec P.{get:Nat, inc:Unit->P} in fold [Counter] {get=unit, inc=unit}", "unfold [Counter] p.get", "x", "(if x then false else x)", "\\x:A.x", "timesfloat (2.0) (3.0)", "\"hello\"", "(\\X.\\x:X.x [All X.X->X])", "{Some X, {c:X, f:X->Nat}}", "{*All Y.Y, \\x:All Y.Y.x} as {Some X, X->X}", "{*Nat, {c=0, f=\\x:Nat.succ (x)}} as {Some X, {c:X, f:X->Nat}}", "let {X,ops} = {*Nat, {c=0, f=\\x:Nat.succ (x)}} as {Some X, {c:X, f:X->Nat}} in (ops.f ops.c)"] testFullOmega :: SpecWith () testFullOmega = test s "FullOmega" input output where s :: Syntactic '[TmTApp, TmApp, TyArr, KnArr, TmCase, TmRecord, TyRecord, TmPack, TmUnpack, TyAll2, TySome2, TmFloat, TmLet, TmFix, TmString, TmTAbs2, TmLam2, TmBool, TmFold, TmNat, TmArith, TmAscribe, TmAssign, TyVariant, TmTag, TmTry, TmError, TyRec, TyRef, TmRef, TmDeref, TySource ,TySink, TmUnit, TyUnit, TyBool, TyNat, TyTop, TyBot, TyString, KnStar, TyVar, TmVar] s = crep input = [ "\\X:Star.X", "\\X:Star=>Star.X", "let Counter = Rec P.{get:Nat, inc:Unit->P} in fold [Counter] {get=unit, inc=unit}", "unfold [Counter] p.get", "x", "(if x then false else x)", "\\x:A.x", "timesfloat (2.0) (3.0)", "\"hello\"", "All X:Star.X", "(\\X:Star.\\x:X.x) [All X:Star.X->X]", "{Some X:Star, {c:X, f:X->Nat}}", "{*All Y:Star.Y, \\x:All Y:Star.Y.x} as {Some X:Star, X->X}", "{*Nat, {c=0, f=\\x:Nat.succ (x)}} as {Some X:Star, {c:X, f:X->Nat}}", "let {X,ops} = {*Nat, {c=0, f=\\x:Nat.succ (x)}} as {Some X:Star, {c:X, f:X->Nat}} in (ops.f ops.c)"] output = [ "\\X:Star.X", "\\X:Star=>Star.X", "let Counter = Rec P.{get:Nat, inc:Unit->P} in fold [Counter] {get=unit, inc=unit}", "unfold [Counter] p.get", "x", "(if x then false else x)", "\\x:A.x", "timesfloat (2.0) (3.0)", "\"hello\"", "All X:Star.X", "(\\X:Star.\\x:X.x [All X:Star.X->X])", "{Some X:Star, {c:X, f:X->Nat}}", "{*All Y:Star.Y, \\x:All Y:Star.Y.x} as {Some X:Star, X->X}", "{*Nat, {c=0, f=\\x:Nat.succ (x)}} as {Some X:Star, {c:X, f:X->Nat}}", "let {X,ops} = {*Nat, {c=0, f=\\x:Nat.succ (x)}} as {Some X:Star, {c:X, f:X->Nat}} in (ops.f ops.c)"] main :: IO () main = hspec $ do testArith testUntyped testFullUntyped testTyArith testSimpleBool testFullSimple testFullRef testFullError testRcdSubBot testFullSub testFullEquiRec testFullIsoRec testFullPoly testFullOmega
hy-zhang/parser
Haskell/test/Spec.hs
bsd-3-clause
15,807
0
12
4,281
2,710
1,672
1,038
439
1
module Matter (Matter) where type Matter = String
dariush-alipour/kanoon-hs
src/Matter.hs
bsd-3-clause
51
0
4
9
15
10
5
2
0
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} module BCalib.MV2 where import Control.Applicative (ZipList (..)) import Data.Map.Strict as M import GHC.Float import GHC.Generics hiding (to) import BCalib.Imports data MV2Info = MV2Info { _mv2c00 :: Double , _mv2c10 :: Double , _mv2c20 :: Double , _mv2c100 :: Double , _mv2cl100 :: Double } deriving (Generic, Show) mv2Hs :: Fill MV2Info mv2Hs = M.unions <$> sequenceA [ hist1DDef (binD (-1) 50 1) "MV2c00" (dsigdXpbY "MV2" "1") "/mv2c00" <$$= mv2c00 , hist1DDef (binD (-1) 50 1) "MV2c10" (dsigdXpbY "MV2" "1") "/mv2c10" <$$= mv2c10 , hist1DDef (binD (-1) 50 1) "MV2c20" (dsigdXpbY "MV2" "1") "/mv2c20" <$$= mv2c20 ] readMV2s :: MonadIO m => TR m (ZipList MV2Info) readMV2s = do c00 <- readD "jetsMV2c00" c10 <- readD "jetsMV2c10" c20 <- readD "jetsMV2c20" c100 <- readD "jetsMV2c100" cl100 <- readD "jetsMV2cl100" return $ MV2Info <$> c00 <*> c10 <*> c20 <*> c100 <*> cl100 where readD n = fmap float2Double <$> readBranch n -- TODO -- can't get TH working with external libs (e.g. root) mv2c00 :: Lens' MV2Info Double mv2c00 f_ajeI (MV2Info x1_ajeJ x2_ajeK x3_ajeL x4_ajeM x5_ajeN) = fmap (\ y1_ajeO -> MV2Info y1_ajeO x2_ajeK x3_ajeL x4_ajeM x5_ajeN) (f_ajeI x1_ajeJ) {-# INLINE mv2c00 #-} mv2c10 :: Lens' MV2Info Double mv2c10 f_ajeP (MV2Info x1_ajeQ x2_ajeR x3_ajeS x4_ajeT x5_ajeU) = fmap (\ y1_ajeV -> MV2Info x1_ajeQ y1_ajeV x3_ajeS x4_ajeT x5_ajeU) (f_ajeP x2_ajeR) {-# INLINE mv2c10 #-} mv2c100 :: Lens' MV2Info Double mv2c100 f_ajeW (MV2Info x1_ajeX x2_ajeY x3_ajeZ x4_ajf0 x5_ajf1) = fmap (\ y1_ajf2 -> MV2Info x1_ajeX x2_ajeY x3_ajeZ y1_ajf2 x5_ajf1) (f_ajeW x4_ajf0) {-# INLINE mv2c100 #-} mv2c20 :: Lens' MV2Info Double mv2c20 f_ajf3 (MV2Info x1_ajf4 x2_ajf5 x3_ajf6 x4_ajf7 x5_ajf8) = fmap (\ y1_ajf9 -> MV2Info x1_ajf4 x2_ajf5 y1_ajf9 x4_ajf7 x5_ajf8) (f_ajf3 x3_ajf6) {-# INLINE mv2c20 #-} mv2cl100 :: Lens' MV2Info Double mv2cl100 f_ajfa (MV2Info x1_ajfb x2_ajfc x3_ajfd x4_ajfe x5_ajff) = fmap (\ y1_ajfg -> MV2Info x1_ajfb x2_ajfc x3_ajfd x4_ajfe y1_ajfg) (f_ajfa x5_ajff) {-# INLINE mv2cl100 #-}
cspollard/bcalib
src/BCalib/MV2.hs
bsd-3-clause
2,361
0
13
565
693
360
333
69
1
{-# LANGUAGE CPP #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE BangPatterns #-} -- | This module converts 'GHC.ApiAnns' into 'Anns' by traversing a -- structure created by the "Annotate" modue. -- -- == Structure of an Annotation -- -- As a rule of thumb, every located element in the GHC AST will have -- a corresponding entry in 'Anns'. An 'Annotation' contains 6 fields which -- can be modifed to change how the AST is printed. -- -- == Layout Calculation -- -- Certain expressions such as do blocks and let bindings obey -- <https://en.wikibooks.org/wiki/Haskell/Indentation layout rules>. We -- calculate the 'annEntryDelta' slightly differently when such rules -- apply. -- -- 1. The first element which the layout rule applies to is given -- a 'annEntryDelta' as normal. -- 2. Further elements which must obey the rules are then given -- 'annEntryDelta's relative to the LHS of the first element. -- -- For example, in the following expression the statement corresponding to -- `baz` will be given a 'annEntryDelta' of @DP (1, 2)@ as it appears -- 1 line and 2 columns after the @do@ keyword. On the other hand, @bar@ -- will be given a 'annEntryDelta' of @DP (1,0)@ as it appears 1 line -- further than @baz@ but in the same column as the start of the layout -- block. -- -- @ -- foo = do -- baz -- bar -- @ -- -- A useful way to think of these rules is that the 'DeltaPos' is relative -- to the further left an expression could have been placed. In the -- previous example, we could have placed @baz@ anywhere on the line as its -- position determines where the other statements must be. @bar@ could have -- not been placed any further left without resulting in a syntax error -- which is why the relative column is 0. -- -- === annTrueEntryDelta -- A very useful function is 'annTrueEntryDelta' which calculates the -- offset from the last synctactic element (ignoring comments). This is -- different to 'annEntryDelta' which does not ignore comments. -- -- -- module Language.Haskell.GHC.ExactPrint.Delta ( relativiseApiAnns , relativiseApiAnnsWithComments , relativiseApiAnnsWithOptions -- * Configuration , DeltaOptions(drRigidity) , deltaOptions , normalLayout ) where import Control.Monad.RWS import Control.Monad.Trans.Free import Data.Data (Data) import Data.List (sort, nub, partition, sortBy) import Data.Ord import Language.Haskell.GHC.ExactPrint.Utils #if __GLASGOW_HASKELL__ <= 710 import Language.Haskell.GHC.ExactPrint.Lookup #endif import Language.Haskell.GHC.ExactPrint.Types import Language.Haskell.GHC.ExactPrint.Annotate (AnnotationF(..), Annotated , annotate, Annotate(..)) import qualified GHC import qualified SrcLoc as GHC import qualified Data.Map as Map #if __GLASGOW_HASKELL__ <= 710 import qualified Data.Set as Set #endif -- import Debug.Trace -- --------------------------------------------------------------------- -- | Transform concrete annotations into relative annotations which are -- more useful when transforming an AST. relativiseApiAnns :: Annotate ast => GHC.Located ast -> GHC.ApiAnns -> Anns relativiseApiAnns = relativiseApiAnnsWithComments [] -- | Exactly the same as 'relativiseApiAnns' but with the possibilty to -- inject comments. This is typically used if the source has been preprocessed -- by e.g. CPP, and the parts stripped out of the original source are re-added -- as comments so they are not lost for round tripping. relativiseApiAnnsWithComments :: Annotate ast => [Comment] -> GHC.Located ast -> GHC.ApiAnns -> Anns relativiseApiAnnsWithComments = relativiseApiAnnsWithOptions normalLayout relativiseApiAnnsWithOptions :: Annotate ast => DeltaOptions -> [Comment] -> GHC.Located ast -> GHC.ApiAnns -> Anns relativiseApiAnnsWithOptions opts cs modu ghcAnns = runDeltaWithComments opts cs (annotate modu) ghcAnns (ss2pos $ GHC.getLoc modu) -- --------------------------------------------------------------------- -- -- | Type used in the Delta Monad. type Delta a = RWS DeltaOptions DeltaWriter DeltaState a runDeltaWithComments :: DeltaOptions -> [Comment] -> Annotated () -> GHC.ApiAnns -> Pos -> Anns runDeltaWithComments opts cs action ga priorEnd = mkAnns . snd . (\next -> execRWS next opts (defaultDeltaState cs priorEnd ga)) . deltaInterpret $ action where mkAnns :: DeltaWriter -> Anns mkAnns = f . dwAnns f :: Monoid a => Endo a -> a f = ($ mempty) . appEndo -- --------------------------------------------------------------------- data DeltaOptions = DeltaOptions { -- | Current `SrcSpan, part of current AnnKey` curSrcSpan :: !GHC.SrcSpan -- | Constuctor of current AST element, part of current AnnKey , annConName :: !AnnConName -- | Whether to use rigid or normal layout rules , drRigidity :: Rigidity } data DeltaWriter = DeltaWriter { -- | Final list of annotations, and sort keys dwAnns :: Endo (Map.Map AnnKey Annotation) -- | Used locally to pass Keywords, delta pairs relevant to a specific -- subtree to the parent. , annKds :: ![(KeywordId, DeltaPos)] , sortKeys :: !(Maybe [GHC.SrcSpan]) , dwCapturedSpan :: !(First AnnKey) } data DeltaState = DeltaState { -- | Position reached when processing the last element priorEndPosition :: !Pos -- | Ordered list of comments still to be allocated , apComments :: ![Comment] -- | The original GHC Delta Annotations , apAnns :: !GHC.ApiAnns , apMarkLayout :: Bool , apLayoutStart :: LayoutStartCol } -- --------------------------------------------------------------------- deltaOptions :: Rigidity -> DeltaOptions deltaOptions ridigity = DeltaOptions { curSrcSpan = GHC.noSrcSpan , annConName = annGetConstr () , drRigidity = ridigity } normalLayout :: DeltaOptions normalLayout = deltaOptions NormalLayout defaultDeltaState :: [Comment] -> Pos -> GHC.ApiAnns -> DeltaState defaultDeltaState injectedComments priorEnd ga = DeltaState { priorEndPosition = priorEnd , apComments = cs ++ injectedComments , apAnns = ga , apLayoutStart = 1 , apMarkLayout = False } where cs :: [Comment] cs = flattenedComments ga flattenedComments :: GHC.ApiAnns -> [Comment] flattenedComments (_,cm) = map tokComment . GHC.sortLocated . concat $ Map.elems cm -- Writer helpers tellFinalAnn :: (AnnKey, Annotation) -> Delta () tellFinalAnn (k, v) = -- tell (mempty { dwAnns = Endo (Map.insertWith (<>) k v) }) tell (mempty { dwAnns = Endo (Map.insert k v) }) tellSortKey :: [GHC.SrcSpan] -> Delta () tellSortKey xs = tell (mempty { sortKeys = Just xs } ) tellCapturedSpan :: AnnKey -> Delta () tellCapturedSpan key = tell ( mempty { dwCapturedSpan = First $ Just key }) tellKd :: (KeywordId, DeltaPos) -> Delta () tellKd kd = tell (mempty { annKds = [kd] }) instance Monoid DeltaWriter where mempty = DeltaWriter mempty mempty mempty mempty (DeltaWriter a b e g) `mappend` (DeltaWriter c d f h) = DeltaWriter (a <> c) (b <> d) (e <> f) (g <> h) ----------------------------------- -- Free Monad Interpretation code deltaInterpret :: Annotated a -> Delta a deltaInterpret = iterTM go where go :: AnnotationF (Delta a) -> Delta a go (MarkEOF next) = addEofAnnotation >> next go (MarkPrim kwid _ next) = addDeltaAnnotation kwid >> next go (MarkOutside akwid kwid next) = addDeltaAnnotationsOutside akwid kwid >> next go (MarkInside akwid next) = addDeltaAnnotationsInside akwid >> next go (MarkMany akwid next) = addDeltaAnnotations akwid >> next go (MarkOffsetPrim akwid n _ next) = addDeltaAnnotationLs akwid n >> next go (WithAST lss prog next) = withAST lss (deltaInterpret prog) >> next go (CountAnns kwid next) = countAnnsDelta kwid >>= next go (SetLayoutFlag r action next) = do rigidity <- asks drRigidity (if (r <= rigidity) then setLayoutFlag else id) (deltaInterpret action) next go (MarkExternal ss akwid _ next) = addDeltaAnnotationExt ss akwid >> next go (StoreOriginalSrcSpan key next) = storeOriginalSrcSpanDelta key >>= next go (GetSrcSpanForKw kw next) = getSrcSpanForKw kw >>= next #if __GLASGOW_HASKELL__ <= 710 go (StoreString s ss next) = storeString s ss >> next #endif go (AnnotationsToComments kws next) = annotationsToCommentsDelta kws >> next go (WithSortKey kws next) = withSortKey kws >> next withSortKey :: [(GHC.SrcSpan, Annotated b)] -> Delta () withSortKey kws = let order = sortBy (comparing fst) kws in do tellSortKey (map fst order) mapM_ (deltaInterpret . snd) order setLayoutFlag :: Delta () -> Delta () setLayoutFlag action = do oldLay <- gets apLayoutStart modify (\s -> s { apMarkLayout = True } ) let reset = do modify (\s -> s { apMarkLayout = False , apLayoutStart = oldLay }) action <* reset -- --------------------------------------------------------------------- storeOriginalSrcSpanDelta :: AnnKey -> Delta AnnKey storeOriginalSrcSpanDelta key = do tellCapturedSpan key return key #if __GLASGOW_HASKELL__ <= 710 storeString :: String -> GHC.SrcSpan -> Delta () storeString s ss = addAnnotationWorker (AnnString s) ss #endif -- --------------------------------------------------------------------- -- |In order to interleave annotations into the stream, we turn them into -- comments. annotationsToCommentsDelta :: [GHC.AnnKeywordId] -> Delta () annotationsToCommentsDelta kws = do ga <- gets apAnns ss <- getSrcSpan cs <- gets apComments let doOne :: GHC.AnnKeywordId -> [Comment] doOne kw = comments where spans = GHC.getAnnotation ga ss kw comments = map (mkKWComment kw) spans -- TODO:AZ make sure these are sorted/merged properly when the invariant for -- allocateComments is re-established. newComments = concatMap doOne kws putUnallocatedComments (cs ++ newComments) -- --------------------------------------------------------------------- -- | This function exists to overcome a shortcoming in the GHC AST for 7.10.1 getSrcSpanForKw :: GHC.AnnKeywordId -> Delta GHC.SrcSpan getSrcSpanForKw kw = do ga <- gets apAnns ss <- getSrcSpan case GHC.getAnnotation ga ss kw of [] -> return GHC.noSrcSpan (sp:_) -> return sp -- --------------------------------------------------------------------- getSrcSpan :: Delta GHC.SrcSpan getSrcSpan = asks curSrcSpan withSrcSpanDelta :: Data a => GHC.Located a -> Delta b -> Delta b withSrcSpanDelta (GHC.L l a) = local (\s -> s { curSrcSpan = l , annConName = annGetConstr a }) getUnallocatedComments :: Delta [Comment] getUnallocatedComments = gets apComments putUnallocatedComments :: [Comment] -> Delta () putUnallocatedComments cs = modify (\s -> s { apComments = cs } ) -- --------------------------------------------------------------------- adjustDeltaForOffsetM :: DeltaPos -> Delta DeltaPos adjustDeltaForOffsetM dp = do colOffset <- gets apLayoutStart return (adjustDeltaForOffset colOffset dp) adjustDeltaForOffset :: LayoutStartCol -> DeltaPos -> DeltaPos adjustDeltaForOffset _colOffset dp@(DP (0,_)) = dp -- same line adjustDeltaForOffset (LayoutStartCol colOffset) (DP (l,c)) = DP (l,c - colOffset) -- --------------------------------------------------------------------- getPriorEnd :: Delta Pos getPriorEnd = gets priorEndPosition setPriorEnd :: Pos -> Delta () setPriorEnd pe = modify (\s -> s { priorEndPosition = pe }) setPriorEndAST :: GHC.SrcSpan -> Delta () setPriorEndAST pe = do setLayoutStart (snd (ss2pos pe)) modify (\s -> s { priorEndPosition = (ss2posEnd pe) } ) setLayoutStart :: Int -> Delta () setLayoutStart p = do DeltaState{apMarkLayout} <- get when apMarkLayout ( modify (\s -> s { apMarkLayout = False , apLayoutStart = LayoutStartCol p})) -- ------------------------------------- peekAnnotationDelta :: GHC.AnnKeywordId -> Delta [GHC.SrcSpan] peekAnnotationDelta an = do ga <- gets apAnns ss <- getSrcSpan #if __GLASGOW_HASKELL__ <= 710 return $ GHC.getAnnotation ga ss an #else let unicodeAnns = case unicodeEquivalent an of [] -> [] [kw] -> GHC.getAnnotation ga ss kw return $ unicodeAnns ++ GHC.getAnnotation ga ss an #endif getAnnotationDelta :: GHC.AnnKeywordId -> Delta ([GHC.SrcSpan],GHC.AnnKeywordId) getAnnotationDelta an = do ss <- getSrcSpan getAndRemoveAnnotationDelta ss an getAndRemoveAnnotationDelta :: GHC.SrcSpan -> GHC.AnnKeywordId -> Delta ([GHC.SrcSpan],GHC.AnnKeywordId) getAndRemoveAnnotationDelta sp an = do ga <- gets apAnns #if __GLASGOW_HASKELL__ <= 710 let (r,ga') = GHC.getAndRemoveAnnotation ga sp an kw = an #else let (r,ga',kw) = case GHC.getAndRemoveAnnotation ga sp an of ([],_) -> (ss,g,k) where k = GHC.unicodeAnn an (ss,g) = GHC.getAndRemoveAnnotation ga sp k (ss,g) -> (ss,g,an) #endif modify (\s -> s { apAnns = ga' }) return (r,kw) getOneAnnotationDelta :: GHC.AnnKeywordId -> Delta ([GHC.SrcSpan],GHC.AnnKeywordId) getOneAnnotationDelta an = do ss <- getSrcSpan getAndRemoveOneAnnotationDelta ss an getAndRemoveOneAnnotationDelta :: GHC.SrcSpan -> GHC.AnnKeywordId -> Delta ([GHC.SrcSpan],GHC.AnnKeywordId) getAndRemoveOneAnnotationDelta sp an = do (anns,cs) <- gets apAnns #if __GLASGOW_HASKELL__ <= 710 let (r,ga',kw) = case Map.lookup (sp,an) anns of Nothing -> ([],(anns,cs),an) Just [] -> ([], (Map.delete (sp,an) anns,cs),an) Just (s:ss) -> ([s],(Map.insert (sp,an) ss anns,cs),an) #else let getKw kw = case Map.lookup (sp,kw) anns of Nothing -> ([],(anns,cs),kw) Just [] -> ([], (Map.delete (sp,kw) anns,cs),kw) Just (s:ss) -> ([s],(Map.insert (sp,kw) ss anns,cs),kw) let (r,ga',kw) = case getKw an of ([],_,_) -> getKw (GHC.unicodeAnn an) v -> v #endif modify (\s -> s { apAnns = ga' }) return (r,kw) -- --------------------------------------------------------------------- -- |Add some annotation to the currently active SrcSpan addAnnotationsDelta :: Annotation -> Delta () addAnnotationsDelta ann = do l <- ask tellFinalAnn (getAnnKey l,ann) getAnnKey :: DeltaOptions -> AnnKey getAnnKey DeltaOptions {curSrcSpan, annConName} = AnnKey curSrcSpan annConName -- ------------------------------------- addAnnDeltaPos :: KeywordId -> DeltaPos -> Delta () addAnnDeltaPos kw dp = tellKd (kw, dp) -- ------------------------------------- -- | Enter a new AST element. Maintain SrcSpan stack withAST :: Data a => GHC.Located a -> Delta b -> Delta b withAST lss@(GHC.L ss _) action = do -- Calculate offset required to get to the start of the SrcSPan off <- gets apLayoutStart (resetAnns . withSrcSpanDelta lss) (do let maskWriter s = s { annKds = [] , sortKeys = Nothing , dwCapturedSpan = mempty } -- make sure all kds are relative to the start of the SrcSpan let spanStart = ss2pos ss cs <- do priorEndBeforeComments <- getPriorEnd if GHC.isGoodSrcSpan ss && priorEndBeforeComments < ss2pos ss then commentAllocation (priorComment spanStart) return else return [] priorEndAfterComments <- getPriorEnd let edp = adjustDeltaForOffset -- Use the propagated offset if one is set -- Note that we need to use the new offset if it has -- changed. off (ss2delta priorEndAfterComments ss) -- Preparation complete, perform the action when (GHC.isGoodSrcSpan ss && priorEndAfterComments < ss2pos ss) (do modify (\s -> s { priorEndPosition = (ss2pos ss) } )) (res, w) <- censor maskWriter (listen action) let kds = annKds w an = Ann { annEntryDelta = edp , annPriorComments = cs , annFollowingComments = [] -- only used in Transform and Print , annsDP = kds , annSortKey = sortKeys w , annCapturedSpan = getFirst $ dwCapturedSpan w } addAnnotationsDelta an `debug` ("leaveAST:(annkey,an)=" ++ show (mkAnnKey lss,an)) return res) resetAnns :: Delta a -> Delta a resetAnns action = do ans <- gets apAnns action <* modify (\s -> s { apAnns = ans }) -- --------------------------------------------------------------------- -- |Split the ordered list of comments into ones that occur prior to -- the give SrcSpan and the rest priorComment :: Pos -> Comment -> Bool priorComment start c = (ss2pos . commentIdentifier $ c) < start -- TODO:AZ: We scan the entire comment list here. It may be better to impose an -- invariant that the comments are sorted, and consume them as the pos -- advances. It then becomes a process of using `takeWhile p` rather than a full -- partition. allocateComments :: (Comment -> Bool) -> [Comment] -> ([Comment], [Comment]) allocateComments = partition -- --------------------------------------------------------------------- addAnnotationWorker :: KeywordId -> GHC.SrcSpan -> Delta () addAnnotationWorker ann pa = -- Zero-width source spans are injected by the GHC Lexer when it puts virtual -- '{', ';' and '}' tokens in for layout unless (isPointSrcSpan pa) $ do pe <- getPriorEnd ss <- getSrcSpan let p = ss2delta pe pa case (ann,isGoodDelta p) of (G GHC.AnnComma,False) -> return () (G GHC.AnnSemi, False) -> return () (G GHC.AnnOpen, False) -> return () (G GHC.AnnClose,False) -> return () _ -> do p' <- adjustDeltaForOffsetM p commentAllocation (priorComment (ss2pos pa)) (mapM_ (uncurry addDeltaComment)) #if __GLASGOW_HASKELL__ <= 710 addAnnDeltaPos (checkUnicode ann pa) p' #else addAnnDeltaPos ann p' #endif setPriorEndAST pa `debug` ("addAnnotationWorker:(ss,ss,pe,pa,p,p',ann)=" ++ show (showGhc ss,showGhc ss,pe,showGhc pa,p,p',ann)) #if __GLASGOW_HASKELL__ <= 710 checkUnicode :: KeywordId -> GHC.SrcSpan -> KeywordId checkUnicode gkw@(G kw) ss = if kw `Set.member` unicodeSyntax then let s = keywordToString gkw in if (length s /= spanLength ss) then AnnUnicode kw else gkw else gkw where unicodeSyntax = Set.fromList [ GHC.AnnDcolon , GHC.AnnDarrow , GHC.AnnForall , GHC.AnnRarrow , GHC.AnnLarrow , GHC.Annlarrowtail , GHC.Annrarrowtail , GHC.AnnLarrowtail , GHC.AnnRarrowtail] checkUnicode kwid _ = kwid #else unicodeEquivalent :: GHC.AnnKeywordId -> [GHC.AnnKeywordId] unicodeEquivalent kw = case Map.lookup kw unicodeSyntax of Nothing -> [] Just kwu -> [kwu] where unicodeSyntax = Map.fromList [ (GHC.AnnDcolon, GHC.AnnDcolonU) , (GHC.AnnDarrow, GHC.AnnDarrowU) , (GHC.AnnForall, GHC.AnnForallU) , (GHC.AnnRarrow, GHC.AnnRarrowU) , (GHC.AnnLarrow, GHC.AnnLarrowU) , (GHC.Annlarrowtail, GHC.AnnlarrowtailU) , (GHC.Annrarrowtail, GHC.AnnrarrowtailU) , (GHC.AnnLarrowtail, GHC.AnnLarrowtailU) , (GHC.AnnRarrowtail, GHC.AnnRarrowtailU)] #endif -- --------------------------------------------------------------------- commentAllocation :: (Comment -> Bool) -> ([(Comment, DeltaPos)] -> Delta a) -> Delta a commentAllocation p k = do cs <- getUnallocatedComments let (allocated,cs') = allocateComments p cs putUnallocatedComments cs' k =<< mapM makeDeltaComment (sortBy (comparing commentIdentifier) allocated) makeDeltaComment :: Comment -> Delta (Comment, DeltaPos) makeDeltaComment c = do let pa = commentIdentifier c pe <- getPriorEnd let p = ss2delta pe pa p' <- adjustDeltaForOffsetM p setPriorEnd (ss2posEnd pa) return $ (c, p') addDeltaComment :: Comment -> DeltaPos -> Delta () addDeltaComment d p = do addAnnDeltaPos (AnnComment d) p -- --------------------------------------------------------------------- -- | Look up and add a Delta annotation at the current position, and -- advance the position to the end of the annotation addDeltaAnnotation :: GHC.AnnKeywordId -> Delta () addDeltaAnnotation ann' = do ss <- getSrcSpan (ma,ann) <- getOneAnnotationDelta ann' case nub ma of -- ++AZ++ TODO: get rid of duplicates earlier [] -> return () `debug` ("addDeltaAnnotation empty ma for:" ++ show (ss,ann)) [pa] -> addAnnotationWorker (G ann) pa (pa:_) -> addAnnotationWorker (G ann) pa `warn` ("addDeltaAnnotation:(ss,ann,ma)=" ++ showGhc (ss,ann,ma)) -- | Look up and add a Delta annotation at the current position, and -- advance the position to the end of the annotation addDeltaAnnotationLs :: GHC.AnnKeywordId -> Int -> Delta () addDeltaAnnotationLs ann off = do ss <- getSrcSpan ma <- peekAnnotationDelta ann let ma' = filter (\s -> (GHC.isSubspanOf s ss)) ma case drop off ma' of [] -> return () `debug` ("addDeltaAnnotationLs:missed:(off,ann,ma)=" ++ showGhc (off,ss,ann)) (pa:_) -> addAnnotationWorker (G ann) pa -- | Look up and add possibly multiple Delta annotation at the current -- position, and advance the position to the end of the annotations addDeltaAnnotations :: GHC.AnnKeywordId -> Delta () addDeltaAnnotations ann = do (ma,kw) <- getAnnotationDelta ann let do_one ap' = addAnnotationWorker (G kw) ap' `debug` ("addDeltaAnnotations:do_one:(ap',ann)=" ++ showGhc (ap',ann)) mapM_ do_one (sort ma) -- | Look up and add possibly multiple Delta annotations enclosed by -- the current SrcSpan at the current position, and advance the -- position to the end of the annotations addDeltaAnnotationsInside :: GHC.AnnKeywordId -> Delta () addDeltaAnnotationsInside ann = do ss <- getSrcSpan ma <- peekAnnotationDelta ann let do_one ap' = addAnnotationWorker (G ann) ap' -- `debug` ("addDeltaAnnotations:do_one:(ap',ann)=" ++ showGhc (ap',ann)) let filtered = sort $ filter (\s -> GHC.isSubspanOf s ss) ma mapM_ do_one filtered -- | Look up and add possibly multiple Delta annotations not enclosed by -- the current SrcSpan at the current position, and advance the -- position to the end of the annotations -- The first argument (gann) is the one to look up in the GHC annotations, the -- second is the one to apply in the ghc-exactprint ones. These are different -- for GHC.AnnSemi mapping to AnnSemiSep, to ensure that it reflects the ';' -- outside the current span. addDeltaAnnotationsOutside :: GHC.AnnKeywordId -> KeywordId -> Delta () addDeltaAnnotationsOutside gann ann = do ss <- getSrcSpan (ma,kw) <- getAndRemoveAnnotationDelta ss gann let do_one ap' = if ann == AnnSemiSep then addAnnotationWorker ann ap' else addAnnotationWorker (G kw) ap' mapM_ do_one (sort $ filter (\s -> not (GHC.isSubspanOf s ss)) ma) -- | Add a Delta annotation at the current position, and advance the -- position to the end of the annotation addDeltaAnnotationExt :: GHC.SrcSpan -> GHC.AnnKeywordId -> Delta () addDeltaAnnotationExt s ann = addAnnotationWorker (G ann) s addEofAnnotation :: Delta () addEofAnnotation = do pe <- getPriorEnd (ma,_kw) <- withSrcSpanDelta (GHC.noLoc ()) (getAnnotationDelta GHC.AnnEofPos) case ma of [] -> return () (pa:pss) -> do commentAllocation (const True) (mapM_ (uncurry addDeltaComment)) let DP (r,c) = ss2delta pe pa addAnnDeltaPos (G GHC.AnnEofPos) (DP (r, c - 1)) setPriorEndAST pa `warn` ("Trailing annotations after Eof: " ++ showGhc pss) countAnnsDelta :: GHC.AnnKeywordId -> Delta Int countAnnsDelta ann = do ma <- peekAnnotationDelta ann return (length ma)
mpickering/ghc-exactprint
src/Language/Haskell/GHC/ExactPrint/Delta.hs
bsd-3-clause
24,620
45
30
5,794
5,537
2,893
2,644
407
16
{-# LANGUAGE PackageImports #-} {-# LANGUAGE Strict #-} module Foreign.Erlang.Digest ( genChallenge , genDigest ) where import "cryptonite" Crypto.Hash (MD5 (MD5), hashFinalize, hashInitWith, hashUpdate) import Data.ByteArray (convert) import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as CS import Data.Word import System.Random (randomIO) genChallenge :: IO Word32 genChallenge = randomIO genDigest :: Word32 -> BS.ByteString -> BS.ByteString genDigest challenge cookie = let ctx0 = hashInitWith MD5 ctx1 = hashUpdate ctx0 cookie ctx2 = hashUpdate ctx1 (CS.pack (show challenge)) digest = hashFinalize ctx2 in convert digest
LTI2000/hinterface
src/Foreign/Erlang/Digest.hs
bsd-3-clause
843
0
13
272
182
105
77
21
1
----------------------------------------------------------------------------- -- | -- Module : XMonad.Prompt.Pass -- Copyright : (c) 2014 Igor Babuschkin, Antoine R. Dumont -- License : BSD3-style (see LICENSE) -- -- Maintainer : Antoine R. Dumont <[email protected]> -- Stability : unstable -- Portability : unportable -- -- This module provides 3 <XMonad.Prompt> to ease passwords manipulation (generate, read, remove): -- -- - one to lookup passwords in the password-storage. -- -- - one to generate a password for a given password label that the user inputs. -- -- - one to delete a stored password for a given password label that the user inputs. -- -- All those prompts benefit from the completion system provided by the module <XMonad.Prompt>. -- -- The password store is setuped through an environment variable PASSWORD_STORE_DIR. -- If this is set, use the content of the variable. -- Otherwise, the password store is located on user's home @$HOME\/.password-store@. -- -- -- Source: -- -- - The password storage implementation is <http://git.zx2c4.com/password-store the password-store cli>. -- -- - Inspired from <http://babushk.in/posts/combining-xmonad-and-pass.html> -- ----------------------------------------------------------------------------- module XMonad.Prompt.Pass ( -- * Usages -- $usages passPrompt , passGeneratePrompt , passRemovePrompt , passShowPrompt ) where import Control.Monad (liftM) import XMonad.Core import XMonad.Prompt ( XPrompt , showXPrompt , commandToComplete , nextCompletion , getNextCompletion , XPConfig , mkXPrompt , mkComplFunFromList) import System.Directory (getHomeDirectory) import System.FilePath (takeExtension, dropExtension, combine) import System.Posix.Env (getEnv) import XMonad.Util.Run (runProcessWithInput, runInTerm) -- $usages -- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@: -- -- > import XMonad.Prompt.Pass -- -- Then add a keybinding for 'passPrompt', 'passGeneratePrompt' or 'passRemovePrompt': -- -- > , ((modMask x , xK_p) , passPrompt xpconfig) -- > , ((modMask x .|. controlMask, xK_p) , passGeneratePrompt xpconfig) -- > , ((modMask x .|. controlMask .|. shiftMask, xK_p), passRemovePrompt xpconfig) -- -- For detailed instructions on: -- -- - editing your key bindings, see "XMonad.Doc.Extending#Editing_key_bindings". -- -- - how to setup the password storage, see <http://git.zx2c4.com/password-store/about/> -- type PromptLabel = String data Pass = Pass PromptLabel instance XPrompt Pass where showXPrompt (Pass prompt) = prompt ++ ": " commandToComplete _ c = c nextCompletion _ = getNextCompletion -- | Default password store folder in $HOME/.password-store -- passwordStoreFolderDefault :: String -> String passwordStoreFolderDefault home = combine home ".password-store" -- | Compute the password store's location. -- Use the PASSWORD_STORE_DIR environment variable to set the password store. -- If empty, return the password store located in user's home. -- passwordStoreFolder :: IO String passwordStoreFolder = getEnv "PASSWORD_STORE_DIR" >>= computePasswordStoreDir where computePasswordStoreDir Nothing = liftM passwordStoreFolderDefault getHomeDirectory computePasswordStoreDir (Just storeDir) = return storeDir -- | A pass prompt factory -- mkPassPrompt' :: (IO String) -> PromptLabel -> (String -> X ()) -> XPConfig -> X () mkPassPrompt' dir promptLabel passwordFunction xpconfig = do passwords <- io (dir >>= getPasswords) mkXPrompt (Pass promptLabel) xpconfig (mkComplFunFromList passwords) passwordFunction mkPassPrompt :: PromptLabel -> (String -> X ()) -> XPConfig -> X () mkPassPrompt = mkPassPrompt' passwordStoreFolder -- | A prompt to retrieve a password from a given entry. -- passPrompt :: XPConfig -> X () passPrompt = mkPassPrompt' (return "/home/yzhou/.password-store/store0") "Select password" selectPassword passShowPrompt :: XPConfig -> X () passShowPrompt = mkPassPrompt' (return "/home/yzhou/.password-store/store1") "Select password" selectShowPassword -- | A prompt to generate a password for a given entry. -- This can be used to override an already stored entry. -- (Beware that no confirmation is asked) -- passGeneratePrompt :: XPConfig -> X () passGeneratePrompt = mkPassPrompt "Generate password" generatePassword -- | A prompt to remove a password for a given entry. -- (Beware that no confirmation is asked) -- passRemovePrompt :: XPConfig -> X () passRemovePrompt = mkPassPrompt "Remove password" removePassword -- | Select a password. -- selectPassword :: String -> X () selectPassword passLabel = spawn $ "/home/yzhou/bin/scripts/pass0 --clip " ++ passLabel selectShowPassword :: String -> X () selectShowPassword passLabel = runInTerm "" $ "zsh -c \"/home/yzhou/bin/scripts/pass1 " ++ passLabel ++ "| less\"" -- | Generate a 30 characters password for a given entry. -- If the entry already exists, it is updated with a new password. -- generatePassword :: String -> X () generatePassword passLabel = spawn $ "pass generate --force " ++ passLabel ++ " 30" -- | Remove a password stored for a given entry. -- removePassword :: String -> X () removePassword passLabel = spawn $ "pass rm --force " ++ passLabel -- | Retrieve the list of passwords from the password storage 'passwordStoreDir getPasswords :: FilePath -> IO [String] getPasswords passwordStoreDir = do files <- runProcessWithInput "find" [ passwordStoreDir, "-type", "f", "-name", "*.gpg", "-printf", "%P\n"] [] return $ map removeGpgExtension $ lines files removeGpgExtension :: String -> String removeGpgExtension file | takeExtension file == ".gpg" = dropExtension file | otherwise = file
yzhou61/xmonad-contrib
XMonad/Prompt/Pass.hs
bsd-3-clause
6,166
0
11
1,332
830
467
363
65
2
module HSync.Common.Util where import ClassyPrelude.Yesod import qualified Data.Text as T import Text.Read(reads) -------------------------------------------------------------------------------- toPathPieceShow :: Show a => a -> Text toPathPieceShow = T.pack . show fromPathPieceRead :: Read a => Text -> Maybe a fromPathPieceRead t = case reads . T.unpack $ t of ((x,""):_) -> Just x _ -> Nothing
noinia/hsync-common
src/HSync/Common/Util.hs
bsd-3-clause
462
0
10
116
127
70
57
10
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TypeFamilies #-} {-| Use this module to either: * match `Text` with light-weight backtracking patterns, or: * parse structured values from `Text`. Example usage: >>> :set -XOverloadedStrings >>> match ("can" <|> "cat") "cat" ["cat"] >>> match ("can" <|> "cat") "dog" [] >>> match (decimal `sepBy` ",") "1,2,3" [[1,2,3]] This pattern has unlimited backtracking, and will return as many solutions as possible: >>> match (prefix (star anyChar)) "123" ["123","12","1",""] Use @do@ notation to structure more complex patterns: >>> :{ let bit = ("0" *> pure False) <|> ("1" *> pure True) :: Pattern Bool; portableBitMap = do { "P1" ; width <- spaces1 *> decimal ; height <- spaces1 *> decimal ; count width (count height (spaces1 *> bit)) }; in match (prefix portableBitMap) "P1\n2 2\n0 0\n1 0\n" :} [[[False,False],[True,False]]] -} module Turtle.Pattern ( -- * Pattern Pattern , match -- * Primitive patterns , anyChar , eof -- * Character patterns , dot , satisfy , char , notChar , text , asciiCI , oneOf , noneOf , space , spaces , spaces1 , tab , newline , crlf , upper , lower , alphaNum , letter , digit , hexDigit , octDigit -- * Numbers , decimal , signed -- * Combinators , prefix , suffix , has , once , star , plus , selfless , choice , count , option , between , skip , within , fixed , sepBy , sepBy1 -- * High-efficiency primitives , chars , chars1 ) where import Control.Applicative import Control.Monad import Control.Monad.Trans.State import Data.Char import Data.List (foldl') import Data.Monoid (Monoid(..), (<>)) import Data.String (IsString(..)) import Data.Text (Text) import qualified Data.Text as Text -- | A fully backtracking pattern that parses an @\'a\'@ from some `Text` newtype Pattern a = Pattern { runPattern :: StateT Text [] a } deriving (Functor, Applicative, Monad, Alternative, MonadPlus) instance Monoid a => Monoid (Pattern a) where mempty = pure mempty mappend = liftA2 mappend instance Num a => Num (Pattern a) where fromInteger n = pure (fromInteger n) (+) = liftA2 (+) (*) = liftA2 (*) (-) = liftA2 (-) abs = fmap abs signum = fmap signum negate = fmap negate instance Fractional a => Fractional (Pattern a) where fromRational n = pure (fromRational n) recip = fmap recip (/) = liftA2 (/) instance Floating a => Floating (Pattern a) where pi = pure pi exp = fmap exp sqrt = fmap sqrt log = fmap log sin = fmap sin tan = fmap tan cos = fmap cos asin = fmap sin atan = fmap atan acos = fmap acos sinh = fmap sinh tanh = fmap tanh cosh = fmap cosh asinh = fmap asinh atanh = fmap atanh acosh = fmap acosh (**) = liftA2 (**) logBase = liftA2 logBase instance (a ~ Text) => IsString (Pattern a) where fromString str = text (Text.pack str) {-| Match a `Pattern` against a `Text` input, returning all possible solutions The `Pattern` must match the entire `Text` -} match :: Pattern a -> Text -> [a] match p = evalStateT (runPattern (p <* eof)) {-| Match any character >>> match anyChar "1" "1" >>> match anyChar "" "" -} anyChar :: Pattern Char anyChar = Pattern (do Just (c, cs) <- fmap Text.uncons get put cs return c ) {-| Matches the end of input >>> match eof "1" [] >>> match eof "" [()] -} eof :: Pattern () eof = Pattern (do True <- fmap Text.null get return () ) -- | Synonym for `anyChar` dot :: Pattern Char dot = anyChar {-| Match any character that satisfies the given predicate >>> match (satisfy (== '1')) "1" "1" >>> match (satisfy (== '2')) "1" "" -} satisfy :: (Char -> Bool) -> Pattern Char satisfy predicate = do c <- anyChar guard (predicate c) return c {-| Match a specific character >>> match (char '1') "1" "1" >>> match (char '2') "1" "" -} char :: Char -> Pattern Char char c = satisfy (== c) {-| Match any character except the given one >>> match (notChar '2') "1" "1" >>> match (notChar '1') "1" "" -} notChar :: Char -> Pattern Char notChar c = satisfy (/= c) {-| Match a specific string >>> match (text "123") "123" ["123"] You can also omit the `text` function if you enable the @OverloadedStrings@ extension: >>> match "123" "123" ["123"] -} text :: Text -> Pattern Text text before' = Pattern (do txt <- get let (before, after) = Text.splitAt (Text.length before') txt guard (before == before') put after return before) {-| Match a specific string in a case-insensitive way This only handles ASCII strings >>> match (asciiCI "abc") "ABC" ["ABC"] -} asciiCI :: Text -> Pattern Text asciiCI before' = Pattern (do txt <- get let (before, after) = Text.splitAt (Text.length before') txt guard (lowerChars before == lowerChars before') put after return before ) where lowerChars = Text.map lowerChar lowerChar c | 'A' <= c && c <= 'Z' = chr (ord c + ord 'a' - ord 'A') | otherwise = c {-| Match any one of the given characters >>> match (oneOf "1a") "1" "1" >>> match (oneOf "2a") "1" "" -} oneOf :: [Char] -> Pattern Char oneOf cs = satisfy (`elem` cs) {-| Match anything other than the given characters >>> match (noneOf "2a") "1" "1" >>> match (noneOf "1a") "1" "" -} noneOf :: [Char] -> Pattern Char noneOf cs = satisfy (`notElem` cs) {-| Match a whitespace character >>> match space " " " " >>> match space "1" "" -} space :: Pattern Char space = satisfy isSpace {-| Match zero or more whitespace characters >>> match spaces " " [" "] >>> match spaces "" [""] -} spaces :: Pattern Text spaces = star space {-| Match one or more whitespace characters >>> match spaces1 " " [" "] >>> match spaces1 "" [] -} spaces1 :: Pattern Text spaces1 = plus space {-| Match the tab character (@\'\t\'@) >>> match tab "\t" "\t" >>> match tab " " "" -} tab :: Pattern Char tab = char '\t' {-| Match the newline character (@\'\n\'@) >>> match newline "\n" "\n" >>> match newline " " "" -} newline :: Pattern Char newline = char '\n' {-| Matches a carriage return (@\'\r\'@) followed by a newline (@\'\n\'@) >>> match crlf "\r\n" ["\r\n"] >>> match crlf "\n\r" [] -} crlf :: Pattern Text crlf = text "\r\n" {-| Match an uppercase letter >>> match upper "A" "A" >>> match upper "a" "" -} upper :: Pattern Char upper = satisfy isUpper {-| Match a lowercase letter >>> match lower "a" "a" >>> match lower "A" "" -} lower :: Pattern Char lower = satisfy isLower {-| Match a letter or digit >>> match alphaNum "1" "1" >>> match alphaNum "a" "a" >>> match alphaNum "A" "A" >>> match alphaNum "." "" -} alphaNum :: Pattern Char alphaNum = satisfy isAlphaNum {-| Match a letter >>> match letter "A" "A" >>> match letter "a" "a" >>> match letter "1" "" -} letter :: Pattern Char letter = satisfy isLetter {-| Match a digit >>> match digit "1" "1" >>> match digit "a" "" -} digit :: Pattern Char digit = satisfy isDigit {-| Match a hexadecimal digit >>> match hexDigit "1" "1" >>> match hexDigit "A" "A" >>> match hexDigit "a" "a" >>> match hexDigit "g" "" -} hexDigit :: Pattern Char hexDigit = satisfy isHexDigit {-| Match an octal digit >>> match octDigit "1" "1" >>> match octDigit "9" "" -} octDigit :: Pattern Char octDigit = satisfy isOctDigit {-| Match an unsigned decimal number >>> match decimal "123" [123] >>> match decimal "-123" [] -} decimal :: Num n => Pattern n decimal = do ds <- some digit return (foldl' step 0 ds) where step n d = n * 10 + fromIntegral (ord d - ord '0') {-| Transform a numeric parser to accept an optional leading @\'+\'@ or @\'-\'@ sign >>> match (signed decimal) "+123" [123] >>> match (signed decimal) "-123" [-123] >>> match (signed decimal) "123" [123] -} signed :: Num a => Pattern a -> Pattern a signed p = do sign <- (char '+' *> pure id) <|> (char '-' *> pure negate) <|> (pure id) fmap sign p {-| Match a `Char`, but return `Text` >>> match (once (char '1')) "1" ["1"] >>> match (once (char '1')) "" [] -} once :: Pattern Char -> Pattern Text once p = fmap Text.singleton p {-| Use this to match the prefix of a string >>> match "A" "ABC" [] >>> match (prefix "A") "ABC" ["A"] -} prefix :: Pattern a -> Pattern a prefix p = p <* chars {-| Use this to match the suffix of a string >>> match "C" "ABC" [] >>> match (suffix "C") "ABC" ["C"] -} suffix :: Pattern a -> Pattern a suffix p = chars *> p {-| Use this to match the interior of a string >>> match "B" "ABC" [] >>> match (has "B") "ABC" ["B"] -} has :: Pattern a -> Pattern a has p = chars *> p <* chars {-| Parse 0 or more occurrences of the given character >>> match (star anyChar) "123" ["123"] >>> match (star anyChar) "" [""] See also: `chars` -} star :: Pattern Char -> Pattern Text star p = fmap Text.pack (many p) {-| Parse 1 or more occurrences of the given character >>> match (plus anyChar) "123" ["123"] >>> match (plus anyChar) "" [] See also: `chars1` -} plus :: Pattern Char -> Pattern Text plus p = fmap Text.pack (some p) {-| Patterns that match multiple times are greedy by default, meaning that they try to match as many times as possible. The `selfless` combinator makes a pattern match as few times as possible This only changes the order in which solutions are returned, by prioritizing less greedy solutions >>> match (prefix (selfless (some anyChar))) "123" ["1","12","123"] >>> match (prefix (some anyChar) ) "123" ["123","12","1"] -} selfless :: Pattern a -> Pattern a selfless p = Pattern (StateT (\s -> reverse (runStateT (runPattern p) s))) {-| Apply the patterns in the list in order, until one of them succeeds >>> match (choice ["cat", "dog", "egg"]) "egg" ["egg"] >>> match (choice ["cat", "dog", "egg"]) "cat" ["cat"] >>> match (choice ["cat", "dog", "egg"]) "fan" [] -} choice :: [Pattern a] -> Pattern a choice = msum {-| Apply the given pattern a fixed number of times, collecting the results >>> match (count 3 anyChar) "123" ["123"] >>> match (count 4 anyChar) "123" [] -} count :: Int -> Pattern a -> Pattern [a] count = replicateM {-| Transform a parser to a succeed with an empty value instead of failing See also: `optional` >>> match (option "1" <> "2") "12" ["12"] >>> match (option "1" <> "2") "2" ["2"] -} option :: Monoid a => Pattern a -> Pattern a option p = p <|> mempty {-| @(between open close p)@ matches @\'p\'@ in between @\'open\'@ and @\'close\'@ >>> match (between (char '(') (char ')') (star anyChar)) "(123)" ["123"] >>> match (between (char '(') (char ')') (star anyChar)) "(123" [] -} between :: Pattern a -> Pattern b -> Pattern c -> Pattern c between open close p = open *> p <* close {-| Discard the pattern's result >>> match (skip anyChar) "1" [()] >>> match (skip anyChar) "" [] -} skip :: Pattern a -> Pattern () skip = void {-| Restrict the pattern to consume no more than the given number of characters >>> match (within 2 decimal) "12" [12] >>> match (within 2 decimal) "1" [1] >>> match (within 2 decimal) "123" [] -} within :: Int -> Pattern a -> Pattern a within n p = Pattern (do txt <- get let (before, after) = Text.splitAt n txt put before a <- runPattern p modify (<> after) return a ) {-| Require the pattern to consume exactly the given number of characters >>> match (fixed 2 decimal) "12" [12] >>> match (fixed 2 decimal) "1" [] -} fixed :: Int -> Pattern a -> Pattern a fixed n p = do txt <- Pattern get guard (Text.length txt >= n) within n (p <* eof) {-| @p `sepBy` sep@ matches zero or more occurrences of @p@ separated by @sep@ >>> match (decimal `sepBy` char ',') "1,2,3" [[1,2,3]] >>> match (decimal `sepBy` char ',') "" [[]] -} sepBy :: Pattern a -> Pattern b -> Pattern [a] p `sepBy` sep = (p `sepBy1` sep) <|> pure [] {-| @p `sepBy1` sep@ matches one or more occurrences of @p@ separated by @sep@ >>> match (decimal `sepBy1` ",") "1,2,3" [[1,2,3]] >>> match (decimal `sepBy1` ",") "" [] -} sepBy1 :: Pattern a -> Pattern b -> Pattern [a] p `sepBy1` sep = (:) <$> p <*> many (sep *> p) -- | Like @star dot@ or @star anyChar@, except more efficient chars :: Pattern Text chars = Pattern (StateT (\txt -> reverse (zip (Text.inits txt) (Text.tails txt)) )) -- | Like @plus dot@ or @plus anyChar@, except more efficient chars1 :: Pattern Text chars1 = Text.cons <$> dot <*> chars
maoe/Haskell-Turtle-Library
src/Turtle/Pattern.hs
bsd-3-clause
12,745
0
15
3,041
2,447
1,269
1,178
220
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE Rank2Types #-} module Ghost ( Ghost(Ghost), position, validExits, progress , mkGhost, nextPos, prevPos) where import Data.Maybe (fromMaybe) import Lens.Family2 import Lens.Family2.TH (makeLenses) import IPoint (IPoint) data Ghost = Ghost { _position :: IPoint , _validExits :: [IPoint] , _progress :: Float } deriving Show $(makeLenses ''Ghost) mkGhost :: IPoint -> Ghost mkGhost p = Ghost p [] 0 nextPos :: Getter' Ghost IPoint nextPos = getPos firstOf prevPos :: Getter' Ghost IPoint prevPos = getPos lastOf getPos :: (Fold' Ghost IPoint -> Ghost -> Maybe IPoint) -> Getter' Ghost IPoint getPos pick = to (fromMaybe . view position <*> pick (validExits . traverse))
kqr/pacmANN
src/Ghost.hs
bsd-3-clause
777
0
10
172
242
134
108
30
1
{-# Language OverloadedStrings #-} module Main where import Network.Openflow.Ethernet.Types import Network.Openflow.Ethernet.TCP import Network.Openflow.Ethernet.Generator import Network.Openflow.Misc import HCProbe.TCP import HCProbe.FakeSwitch (mcPrefix) import Nettle.OpenFlow.StrictPut import Data.Word import Control.Monad import System.IO import qualified Data.ByteString as BS data TestEthernetFrame = TestEthernetFrame !Int !MACAddr !MACAddr instance EthernetFrame TestEthernetFrame where dstMacAddress (TestEthernetFrame _ a _) = a {-# INLINE dstMacAddress #-} srcMacAddress (TestEthernetFrame _ _ b) = b {-# INLINE srcMacAddress #-} vlanID = const Nothing {-# INLINE vlanID #-} typeCode = const 0x806 {-# INLINE typeCode #-} putPayload (TestEthernetFrame n _ _) = putEmptyPayload n {-# INLINE putPayload #-} pktNum = 1000000 main = do let pkts = [TestEthernetFrame 128 i i | i <- [1..pktNum]] let chunks = map makeEthernetFrame pkts mapM_ (BS.hPutStr stdout) chunks
ARCCN/hcprobe
src/bench/TestPkgGen.hs
bsd-3-clause
1,030
0
13
175
250
138
112
36
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MonadComprehensions #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RebindableSyntax #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ViewPatterns #-} -- | TPC-H Q16 module Queries.TPCH.Standard.Q16 ( q16 , q16Default ) where import Database.DSH import Schema.TPCH byDescCount :: Q ((Text, Text, Integer), Integer) -> Q (Integer, Text, Text, Integer) byDescCount (view -> (g, c)) = case view g of (b, t, s) -> tup4 (-1 * c) b t s -- | TPC-H Query Q16 with standard validation parameters q16Default :: Q [((Text, Text, Integer), Integer)] q16Default = q16 "Brand#45" "MEDIUM POLISHED%" [49, 14, 23, 45, 19, 3, 36, 9] -- | TPC-H Query Q16 q16 :: Text -> Text -> [Integer] -> Q [((Text, Text, Integer), Integer)] q16 brand typ sizes = sortWith byDescCount $ groupAggr fst snd (length . nub) [ tup2 (tup3 (p_brandQ p) (p_typeQ p) (p_sizeQ p)) (ps_suppkeyQ ps) | ps <- partsupps , p <- parts , p_partkeyQ p == ps_partkeyQ ps , p_brandQ p /= toQ brand , not (p_typeQ p `like` toQ typ) , p_sizeQ p `elem` toQ sizes , not (ps_suppkeyQ ps `elem` [ s_suppkeyQ s | s <- suppliers , s_commentQ s `like` "%Customer%Complaints%" ]) ]
ulricha/dsh-example-queries
Queries/TPCH/Standard/Q16.hs
bsd-3-clause
1,546
0
15
458
450
251
199
33
1
-- | -- UTF-8 character parser and simple XML token parsers -- -- Version : $Id: XmlCharParser.hs,v 1.2 2005/05/31 16:01:12 hxml Exp $ module Yuuko.Text.XML.HXT.Parser.XmlCharParser ( xmlChar -- xml char parsers , xmlNameChar , xmlNameStartChar , xmlNCNameChar , xmlNCNameStartChar , xmlLetter , xmlSpaceChar ) where import Yuuko.Text.XML.HXT.DOM.Unicode import Text.ParserCombinators.Parsec -- ------------------------------------------------------------ -- -- Char (2.2) -- -- | -- parse a single Unicode character xmlChar :: GenParser Char state Unicode xmlChar = satisfy isXmlChar <?> "legal XML character" -- | -- parse a XML name character xmlNameChar :: GenParser Char state Unicode xmlNameChar = satisfy isXmlNameChar <?> "legal XML name character" -- | -- parse a XML name start character xmlNameStartChar :: GenParser Char state Unicode xmlNameStartChar = satisfy isXmlNameStartChar <?> "legal XML name start character" -- | -- parse a XML NCName character xmlNCNameChar :: GenParser Char state Unicode xmlNCNameChar = satisfy isXmlNCNameChar <?> "legal XML NCName character" -- | -- parse a XML NCName start character xmlNCNameStartChar :: GenParser Char state Unicode xmlNCNameStartChar = satisfy isXmlNCNameStartChar <?> "legal XML NCName start character" -- | -- parse a XML letter character xmlLetter :: GenParser Char state Unicode xmlLetter = satisfy isXmlLetter <?> "legal XML letter" -- | -- White Space (2.3) -- -- end of line handling (2.11) -- \#x0D and \#x0D\#x0A are mapped to \#x0A -- is done in XmlInput before parsing -- otherwise \#x0D in internal parsing, e.g. for entities would normalize, -- would be transformed xmlSpaceChar :: GenParser Char state Char xmlSpaceChar = satisfy isXmlSpaceChar <?> "white space" -- ------------------------------------------------------------
nfjinjing/yuuko
src/Yuuko/Text/XML/HXT/Parser/XmlCharParser.hs
bsd-3-clause
1,875
28
6
323
274
162
112
24
1
module Ttlv.Validator.MessagesSpec where import Test.Hspec import Control.Applicative ((<|>)) import Ttlv.Data import qualified Ttlv.Enum as TEnum import qualified Ttlv.Tag as T import Ttlv.Validator.Message import Ttlv.Validator.Structures import Data.Either (isLeft, isRight) ttlv :: T.TtlvTag -> TtlvData -> Ttlv ttlv t = Ttlv (T.Tag t) spec :: Spec spec = do describe "Messages" $ do describe "Protocol Version" $ do it "1.0" $ do let p = ttlv T.ProtocolVersion (TtlvStructure [ttlv T.ProtocolVersionMajor (TtlvInt 1), ttlv T.ProtocolVersionMinor (TtlvInt 0)]) runTtlvParser protocolVersion p `shouldBe` Right p it "1.9 (invalid)" $ do let p = ttlv T.ProtocolVersion (TtlvStructure [ttlv T.ProtocolVersionMajor (TtlvInt 1), ttlv T.ProtocolVersionMinor (TtlvInt 9)]) runTtlvParser protocolVersion p `shouldSatisfy` isLeft it "9.0 (invalid)" $ do let p = ttlv T.ProtocolVersion (TtlvStructure [ttlv T.ProtocolVersionMajor (TtlvInt 9), ttlv T.ProtocolVersionMinor (TtlvInt 0)]) runTtlvParser protocolVersion p `shouldSatisfy` isLeft
nymacro/hs-kmip
tests/Ttlv/Validator/MessagesSpec.hs
bsd-3-clause
1,364
0
25
458
371
190
181
27
1
module Gradient (numericalDiff ) where import Numeric.LinearAlgebra numericalDiff :: Fractional a => (a -> a) -> a -> a numericalDiff f x = (f (x+h) - f (x-h)) / (2*h) where h = 1e-4
ku00/deep-learning-practice
src/Gradient.hs
bsd-3-clause
197
0
10
48
96
52
44
6
1
-- Dada a função abaixo fun :: (Int) -> Int fun x | x < 10 = 1 | x < 5 = 2 | otherwise = 3 -- Qual o resultado das seguintes avaliações? -- a) Q: fun 1 -- R: 1 -- b) Q: fun 7 -- R: 1
Mazuh/Algs
src/haskell_uesb/c1/q10_evaluation_ii.hs
mit
211
0
8
75
59
31
28
4
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} module Yesod.Core.Types where import qualified Blaze.ByteString.Builder as BBuilder import qualified Blaze.ByteString.Builder.Char.Utf8 #if __GLASGOW_HASKELL__ < 710 import Control.Applicative (Applicative (..)) import Control.Applicative ((<$>)) import Data.Monoid (Monoid (..)) #endif import Control.Arrow (first) import Control.Exception (Exception) import Control.Monad (liftM, ap) import Control.Monad.Base (MonadBase (liftBase)) import Control.Monad.Catch (MonadCatch (..)) import Control.Monad.Catch (MonadMask (..)) import Control.Monad.IO.Class (MonadIO (liftIO)) import Control.Monad.Logger (LogLevel, LogSource, MonadLogger (..)) import Control.Monad.Trans.Control (MonadBaseControl (..)) import Control.Monad.Trans.Resource (MonadResource (..), InternalState, runInternalState, MonadThrow (..), monadThrow, ResourceT) import Data.ByteString (ByteString) import qualified Data.ByteString.Lazy as L import Data.Conduit (Flush, Source) import Data.IORef (IORef) import Data.Map (Map, unionWith) import qualified Data.Map as Map import Data.Monoid (Endo (..), Last (..)) import Data.Serialize (Serialize (..), putByteString) import Data.String (IsString (fromString)) import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.Lazy.Builder as TBuilder import Data.Time (UTCTime) import Data.Typeable (Typeable) import Language.Haskell.TH.Syntax (Loc) import qualified Network.HTTP.Types as H import Network.Wai (FilePart, RequestBodyLength) import qualified Network.Wai as W import qualified Network.Wai.Parse as NWP import System.Log.FastLogger (LogStr, LoggerSet, toLogStr, pushLogStr) import qualified System.Random.MWC as MWC import Network.Wai.Logger (DateCacheGetter) import Text.Blaze.Html (Html, toHtml) import Text.Hamlet (HtmlUrl) import Text.Julius (JavascriptUrl) import Web.Cookie (SetCookie) import Yesod.Core.Internal.Util (getTime, putTime) import Control.Monad.Trans.Class (MonadTrans (..)) import Yesod.Routes.Class (RenderRoute (..), ParseRoute (..)) import Control.Monad.Reader (MonadReader (..)) #if !MIN_VERSION_base(4, 6, 0) import Prelude hiding (catch) #endif import Control.DeepSeq (NFData (rnf)) import Data.Conduit.Lazy (MonadActive, monadActive) import Yesod.Core.TypeCache (TypeMap, KeyedTypeMap) #if MIN_VERSION_monad_logger(0, 3, 10) import Control.Monad.Logger (MonadLoggerIO (..)) #endif import Data.Semigroup (Semigroup) -- Sessions type SessionMap = Map Text ByteString type SaveSession = SessionMap -- ^ The session contents after running the handler -> IO [Header] newtype SessionBackend = SessionBackend { sbLoadSession :: W.Request -> IO (SessionMap, SaveSession) -- ^ Return the session data and a function to save the session } data SessionCookie = SessionCookie (Either UTCTime ByteString) ByteString SessionMap deriving (Show, Read) instance Serialize SessionCookie where put (SessionCookie a b c) = do either putTime putByteString a put b put (map (first T.unpack) $ Map.toList c) get = do a <- getTime b <- get c <- map (first T.pack) <$> get return $ SessionCookie (Left a) b (Map.fromList c) data ClientSessionDateCache = ClientSessionDateCache { csdcNow :: !UTCTime , csdcExpires :: !UTCTime , csdcExpiresSerialized :: !ByteString } deriving (Eq, Show) -- | The parsed request information. This type augments the standard WAI -- 'W.Request' with additional information. data YesodRequest = YesodRequest { reqGetParams :: ![(Text, Text)] -- ^ Same as 'W.queryString', but decoded to @Text@. , reqCookies :: ![(Text, Text)] , reqWaiRequest :: !W.Request , reqLangs :: ![Text] -- ^ Languages which the client supports. This is an ordered list by preference. , reqToken :: !(Maybe Text) -- ^ A random, session-specific token used to prevent CSRF attacks. , reqSession :: !SessionMap -- ^ Initial session sent from the client. -- -- Since 1.2.0 , reqAccept :: ![ContentType] -- ^ An ordered list of the accepted content types. -- -- Since 1.2.0 } -- | An augmented WAI 'W.Response'. This can either be a standard @Response@, -- or a higher-level data structure which Yesod will turn into a @Response@. data YesodResponse = YRWai !W.Response | YRWaiApp !W.Application | YRPlain !H.Status ![Header] !ContentType !Content !SessionMap -- | A tuple containing both the POST parameters and submitted files. type RequestBodyContents = ( [(Text, Text)] , [(Text, FileInfo)] ) data FileInfo = FileInfo { fileName :: !Text , fileContentType :: !Text , fileSourceRaw :: !(Source (ResourceT IO) ByteString) , fileMove :: !(FilePath -> IO ()) } data FileUpload = FileUploadMemory !(NWP.BackEnd L.ByteString) | FileUploadDisk !(InternalState -> NWP.BackEnd FilePath) | FileUploadSource !(NWP.BackEnd (Source (ResourceT IO) ByteString)) -- | How to determine the root of the application for constructing URLs. -- -- Note that future versions of Yesod may add new constructors without bumping -- the major version number. As a result, you should /not/ pattern match on -- @Approot@ values. data Approot master = ApprootRelative -- ^ No application root. | ApprootStatic !Text | ApprootMaster !(master -> Text) | ApprootRequest !(master -> W.Request -> Text) type ResolvedApproot = Text data AuthResult = Authorized | AuthenticationRequired | Unauthorized Text deriving (Eq, Show, Read) data ScriptLoadPosition master = BottomOfBody | BottomOfHeadBlocking | BottomOfHeadAsync (BottomOfHeadAsync master) type BottomOfHeadAsync master = [Text] -- ^ urls to load asynchronously -> Maybe (HtmlUrl (Route master)) -- ^ widget of js to run on async completion -> (HtmlUrl (Route master)) -- ^ widget to insert at the bottom of <head> type Texts = [Text] -- | Wrap up a normal WAI application as a Yesod subsite. newtype WaiSubsite = WaiSubsite { runWaiSubsite :: W.Application } data RunHandlerEnv site = RunHandlerEnv { rheRender :: !(Route site -> [(Text, Text)] -> Text) , rheRoute :: !(Maybe (Route site)) , rheSite :: !site , rheUpload :: !(RequestBodyLength -> FileUpload) , rheLog :: !(Loc -> LogSource -> LogLevel -> LogStr -> IO ()) , rheOnError :: !(ErrorResponse -> YesodApp) -- ^ How to respond when an error is thrown internally. -- -- Since 1.2.0 , rheMaxExpires :: !Text } data HandlerData site parentRoute = HandlerData { handlerRequest :: !YesodRequest , handlerEnv :: !(RunHandlerEnv site) , handlerState :: !(IORef GHState) , handlerToParent :: !(Route site -> parentRoute) , handlerResource :: !InternalState } data YesodRunnerEnv site = YesodRunnerEnv { yreLogger :: !Logger , yreSite :: !site , yreSessionBackend :: !(Maybe SessionBackend) , yreGen :: !MWC.GenIO , yreGetMaxExpires :: IO Text } data YesodSubRunnerEnv sub parent parentMonad = YesodSubRunnerEnv { ysreParentRunner :: !(ParentRunner parent parentMonad) , ysreGetSub :: !(parent -> sub) , ysreToParentRoute :: !(Route sub -> Route parent) , ysreParentEnv :: !(YesodRunnerEnv parent) -- FIXME maybe get rid of this and remove YesodRunnerEnv in ParentRunner? } type ParentRunner parent m = m TypedContent -> YesodRunnerEnv parent -> Maybe (Route parent) -> W.Application -- | A generic handler monad, which can have a different subsite and master -- site. We define a newtype for better error message. newtype HandlerT site m a = HandlerT { unHandlerT :: HandlerData site (MonadRoute m) -> m a } type family MonadRoute (m :: * -> *) type instance MonadRoute IO = () type instance MonadRoute (HandlerT site m) = (Route site) data GHState = GHState { ghsSession :: SessionMap , ghsRBC :: Maybe RequestBodyContents , ghsIdent :: Int , ghsCache :: TypeMap , ghsCacheBy :: KeyedTypeMap , ghsHeaders :: Endo [Header] } -- | An extension of the basic WAI 'W.Application' datatype to provide extra -- features needed by Yesod. Users should never need to use this directly, as -- the 'HandlerT' monad and template haskell code should hide it away. type YesodApp = YesodRequest -> ResourceT IO YesodResponse -- | A generic widget, allowing specification of both the subsite and master -- site datatypes. While this is simply a @WriterT@, we define a newtype for -- better error messages. newtype WidgetT site m a = WidgetT { unWidgetT :: HandlerData site (MonadRoute m) -> m (a, GWData (Route site)) } instance (a ~ (), Monad m) => Monoid (WidgetT site m a) where mempty = return () mappend x y = x >> y instance (a ~ (), Monad m) => Semigroup (WidgetT site m a) -- | A 'String' can be trivially promoted to a widget. -- -- For example, in a yesod-scaffold site you could use: -- -- @getHomeR = do defaultLayout "Widget text"@ instance (Monad m, a ~ ()) => IsString (WidgetT site m a) where fromString = toWidget . toHtml . T.pack where toWidget x = WidgetT $ const $ return $ ((), GWData (Body (const x)) mempty mempty mempty mempty mempty mempty) type RY master = Route master -> [(Text, Text)] -> Text -- | Newtype wrapper allowing injection of arbitrary content into CSS. -- -- Usage: -- -- > toWidget $ CssBuilder "p { color: red }" -- -- Since: 1.1.3 newtype CssBuilder = CssBuilder { unCssBuilder :: TBuilder.Builder } -- | Content for a web page. By providing this datatype, we can easily create -- generic site templates, which would have the type signature: -- -- > PageContent url -> HtmlUrl url data PageContent url = PageContent { pageTitle :: Html , pageHead :: HtmlUrl url , pageBody :: HtmlUrl url } data Content = ContentBuilder !BBuilder.Builder !(Maybe Int) -- ^ The content and optional content length. | ContentSource !(Source (ResourceT IO) (Flush BBuilder.Builder)) | ContentFile !FilePath !(Maybe FilePart) | ContentDontEvaluate !Content data TypedContent = TypedContent !ContentType !Content type RepHtml = Html {-# DEPRECATED RepHtml "Please use Html instead" #-} newtype RepJson = RepJson Content newtype RepPlain = RepPlain Content newtype RepXml = RepXml Content type ContentType = ByteString -- FIXME Text? -- | Prevents a response body from being fully evaluated before sending the -- request. -- -- Since 1.1.0 newtype DontFullyEvaluate a = DontFullyEvaluate { unDontFullyEvaluate :: a } -- | Responses to indicate some form of an error occurred. data ErrorResponse = NotFound | InternalError Text | InvalidArgs [Text] | NotAuthenticated | PermissionDenied Text | BadMethod H.Method deriving (Show, Eq, Typeable) ----- header stuff -- | Headers to be added to a 'Result'. data Header = AddCookie SetCookie | DeleteCookie ByteString ByteString | Header ByteString ByteString deriving (Eq, Show) -- FIXME In the next major version bump, let's just add strictness annotations -- to Header (and probably everywhere else). We can also add strictness -- annotations to SetCookie in the cookie package. instance NFData Header where rnf (AddCookie x) = rnf x rnf (DeleteCookie x y) = x `seq` y `seq` () rnf (Header x y) = x `seq` y `seq` () data Location url = Local url | Remote Text deriving (Show, Eq) -- | A diff list that does not directly enforce uniqueness. -- When creating a widget Yesod will use nub to make it unique. newtype UniqueList x = UniqueList ([x] -> [x]) data Script url = Script { scriptLocation :: Location url, scriptAttributes :: [(Text, Text)] } deriving (Show, Eq) data Stylesheet url = Stylesheet { styleLocation :: Location url, styleAttributes :: [(Text, Text)] } deriving (Show, Eq) newtype Title = Title { unTitle :: Html } newtype Head url = Head (HtmlUrl url) deriving Monoid instance Semigroup (Head a) newtype Body url = Body (HtmlUrl url) deriving Monoid instance Semigroup (Body a) type CssBuilderUrl a = (a -> [(Text, Text)] -> Text) -> TBuilder.Builder data GWData a = GWData { gwdBody :: !(Body a) , gwdTitle :: !(Last Title) , gwdScripts :: !(UniqueList (Script a)) , gwdStylesheets :: !(UniqueList (Stylesheet a)) , gwdCss :: !(Map (Maybe Text) (CssBuilderUrl a)) -- media type , gwdJavascript :: !(Maybe (JavascriptUrl a)) , gwdHead :: !(Head a) } instance Monoid (GWData a) where mempty = GWData mempty mempty mempty mempty mempty mempty mempty mappend (GWData a1 a2 a3 a4 a5 a6 a7) (GWData b1 b2 b3 b4 b5 b6 b7) = GWData (a1 `mappend` b1) (a2 `mappend` b2) (a3 `mappend` b3) (a4 `mappend` b4) (unionWith mappend a5 b5) (a6 `mappend` b6) (a7 `mappend` b7) instance Semigroup (GWData a) data HandlerContents = HCContent H.Status !TypedContent | HCError ErrorResponse | HCSendFile ContentType FilePath (Maybe FilePart) | HCRedirect H.Status Text | HCCreated Text | HCWai W.Response | HCWaiApp W.Application deriving Typeable instance Show HandlerContents where show (HCContent status (TypedContent t _)) = "HCContent " ++ show (status, t) show (HCError e) = "HCError " ++ show e show (HCSendFile ct fp mfp) = "HCSendFile " ++ show (ct, fp, mfp) show (HCRedirect s t) = "HCRedirect " ++ show (s, t) show (HCCreated t) = "HCCreated " ++ show t show (HCWai _) = "HCWai" show (HCWaiApp _) = "HCWaiApp" instance Exception HandlerContents -- Instances for WidgetT instance Monad m => Functor (WidgetT site m) where fmap = liftM instance Monad m => Applicative (WidgetT site m) where pure = return (<*>) = ap instance Monad m => Monad (WidgetT site m) where return a = WidgetT $ const $ return (a, mempty) WidgetT x >>= f = WidgetT $ \r -> do (a, wa) <- x r (b, wb) <- unWidgetT (f a) r return (b, wa `mappend` wb) instance MonadIO m => MonadIO (WidgetT site m) where liftIO = lift . liftIO instance MonadBase b m => MonadBase b (WidgetT site m) where liftBase = WidgetT . const . liftBase . fmap (, mempty) instance MonadBaseControl b m => MonadBaseControl b (WidgetT site m) where #if MIN_VERSION_monad_control(1,0,0) type StM (WidgetT site m) a = StM m (a, GWData (Route site)) liftBaseWith f = WidgetT $ \reader' -> liftBaseWith $ \runInBase -> liftM (\x -> (x, mempty)) (f $ runInBase . flip unWidgetT reader') restoreM = WidgetT . const . restoreM #else data StM (WidgetT site m) a = StW (StM m (a, GWData (Route site))) liftBaseWith f = WidgetT $ \reader' -> liftBaseWith $ \runInBase -> liftM (\x -> (x, mempty)) (f $ liftM StW . runInBase . flip unWidgetT reader') restoreM (StW base) = WidgetT $ const $ restoreM base #endif instance Monad m => MonadReader site (WidgetT site m) where ask = WidgetT $ \hd -> return (rheSite $ handlerEnv hd, mempty) local f (WidgetT g) = WidgetT $ \hd -> g hd { handlerEnv = (handlerEnv hd) { rheSite = f $ rheSite $ handlerEnv hd } } instance MonadTrans (WidgetT site) where lift = WidgetT . const . liftM (, mempty) instance MonadThrow m => MonadThrow (WidgetT site m) where throwM = lift . throwM instance MonadCatch m => MonadCatch (HandlerT site m) where catch (HandlerT m) c = HandlerT $ \r -> m r `catch` \e -> unHandlerT (c e) r instance MonadMask m => MonadMask (HandlerT site m) where mask a = HandlerT $ \e -> mask $ \u -> unHandlerT (a $ q u) e where q u (HandlerT b) = HandlerT (u . b) uninterruptibleMask a = HandlerT $ \e -> uninterruptibleMask $ \u -> unHandlerT (a $ q u) e where q u (HandlerT b) = HandlerT (u . b) instance MonadCatch m => MonadCatch (WidgetT site m) where catch (WidgetT m) c = WidgetT $ \r -> m r `catch` \e -> unWidgetT (c e) r instance MonadMask m => MonadMask (WidgetT site m) where mask a = WidgetT $ \e -> mask $ \u -> unWidgetT (a $ q u) e where q u (WidgetT b) = WidgetT (u . b) uninterruptibleMask a = WidgetT $ \e -> uninterruptibleMask $ \u -> unWidgetT (a $ q u) e where q u (WidgetT b) = WidgetT (u . b) instance (Applicative m, MonadIO m, MonadBase IO m, MonadThrow m) => MonadResource (WidgetT site m) where liftResourceT f = WidgetT $ \hd -> liftIO $ fmap (, mempty) $ runInternalState f (handlerResource hd) instance MonadIO m => MonadLogger (WidgetT site m) where monadLoggerLog a b c d = WidgetT $ \hd -> liftIO $ fmap (, mempty) $ rheLog (handlerEnv hd) a b c (toLogStr d) #if MIN_VERSION_monad_logger(0, 3, 10) instance MonadIO m => MonadLoggerIO (WidgetT site m) where askLoggerIO = WidgetT $ \hd -> return (rheLog (handlerEnv hd), mempty) #endif instance MonadActive m => MonadActive (WidgetT site m) where monadActive = lift monadActive instance MonadActive m => MonadActive (HandlerT site m) where monadActive = lift monadActive instance MonadTrans (HandlerT site) where lift = HandlerT . const -- Instances for HandlerT instance Monad m => Functor (HandlerT site m) where fmap = liftM instance Monad m => Applicative (HandlerT site m) where pure = return (<*>) = ap instance Monad m => Monad (HandlerT site m) where return = HandlerT . const . return HandlerT x >>= f = HandlerT $ \r -> x r >>= \x' -> unHandlerT (f x') r instance MonadIO m => MonadIO (HandlerT site m) where liftIO = lift . liftIO instance MonadBase b m => MonadBase b (HandlerT site m) where liftBase = lift . liftBase instance Monad m => MonadReader site (HandlerT site m) where ask = HandlerT $ return . rheSite . handlerEnv local f (HandlerT g) = HandlerT $ \hd -> g hd { handlerEnv = (handlerEnv hd) { rheSite = f $ rheSite $ handlerEnv hd } } -- | Note: although we provide a @MonadBaseControl@ instance, @lifted-base@'s -- @fork@ function is incompatible with the underlying @ResourceT@ system. -- Instead, if you must fork a separate thread, you should use -- @resourceForkIO@. -- -- Using fork usually leads to an exception that says -- \"Control.Monad.Trans.Resource.register\': The mutable state is being accessed -- after cleanup. Please contact the maintainers.\" instance MonadBaseControl b m => MonadBaseControl b (HandlerT site m) where #if MIN_VERSION_monad_control(1,0,0) type StM (HandlerT site m) a = StM m a liftBaseWith f = HandlerT $ \reader' -> liftBaseWith $ \runInBase -> f $ runInBase . (\(HandlerT r) -> r reader') restoreM = HandlerT . const . restoreM #else data StM (HandlerT site m) a = StH (StM m a) liftBaseWith f = HandlerT $ \reader' -> liftBaseWith $ \runInBase -> f $ liftM StH . runInBase . (\(HandlerT r) -> r reader') restoreM (StH base) = HandlerT $ const $ restoreM base #endif instance MonadThrow m => MonadThrow (HandlerT site m) where throwM = lift . monadThrow instance (MonadIO m, MonadBase IO m, MonadThrow m) => MonadResource (HandlerT site m) where liftResourceT f = HandlerT $ \hd -> liftIO $ runInternalState f (handlerResource hd) instance MonadIO m => MonadLogger (HandlerT site m) where monadLoggerLog a b c d = HandlerT $ \hd -> liftIO $ rheLog (handlerEnv hd) a b c (toLogStr d) #if MIN_VERSION_monad_logger(0, 3, 10) instance MonadIO m => MonadLoggerIO (HandlerT site m) where askLoggerIO = HandlerT $ \hd -> return (rheLog (handlerEnv hd)) #endif instance Monoid (UniqueList x) where mempty = UniqueList id UniqueList x `mappend` UniqueList y = UniqueList $ x . y instance Semigroup (UniqueList x) instance IsString Content where fromString = flip ContentBuilder Nothing . Blaze.ByteString.Builder.Char.Utf8.fromString instance RenderRoute WaiSubsite where data Route WaiSubsite = WaiSubsiteRoute [Text] [(Text, Text)] deriving (Show, Eq, Read, Ord) renderRoute (WaiSubsiteRoute ps qs) = (ps, qs) instance ParseRoute WaiSubsite where parseRoute (x, y) = Just $ WaiSubsiteRoute x y data Logger = Logger { loggerSet :: !LoggerSet , loggerDate :: !DateCacheGetter } loggerPutStr :: Logger -> LogStr -> IO () loggerPutStr (Logger ls _) = pushLogStr ls
MaxGabriel/yesod
yesod-core/Yesod/Core/Types.hs
mit
22,188
0
16
5,976
5,759
3,193
2,566
-1
-1
{- Copyright 2012 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -} {-# LANGUAGE OverloadedStrings #-} module Plush.Types.CommandSummary ( CommandSummary(..), parseSummaries, formatOptions, findOptionDescription, ) where import Data.Maybe (catMaybes, listToMaybe) import qualified Data.Text as T -- | Short description of a command and its options used by the interactive -- features of plush. It is used primarily during command entry, to provide -- annotations about the command. This information is not intended to replace a -- man page. -- -- Built in utilities also rely on this information to provide the usual -- diagnostic output on stderr. -- -- For each option, there is a list of options (synonyms), with their leading -- dash (possibly followed by an optional argument place-holder), and finally -- the description. data CommandSummary = CommandSummary { ciName :: T.Text -- ^ "foo - whips text into a lather" , ciSynopsis :: T.Text -- ^ "foo [-f] [-g n] [-a|-x|-h] file ..." , ciOptions :: [([T.Text], T.Text)] -- ^ options } -- | Summaries are kept in a text file, @summaries.txt@ in plush's data dir. -- Each command summary is just three parts: The "name" line, the "synopsis" -- line(s), and then lines for the options. See the file for more details on -- the formatting. parseSummaries :: T.Text -> [(String, CommandSummary)] parseSummaries = catMaybes . map build . splitOn divider . map T.strip . T.lines where build t = case coallesce $ splitOn T.null t of [] -> Nothing [n] -> build' n T.empty [] [n,s] -> build' n s [] (n:s:os) -> build' n s os build' n s os = Just (name n, CommandSummary n s (opts os)) name = T.unpack . T.concat . take 1 . T.words opts os = catMaybes $ map opt $ concatMap T.lines os opt o | T.null o = Nothing | otherwise = let (flags, desc) = T.breakOn " " o in Just (T.splitOn ", " flags, T.stripStart desc) splitOn p = splitOn' [] where splitOn' [] [] = [] splitOn' r [] = reverse r : [] splitOn' r (a:as) | p a = reverse r : splitOn' [] as | otherwise = splitOn' (a:r) as coallesce ([]:as) = coallesce as coallesce (a:as) = T.strip (T.unlines a) : coallesce as coallesce [] = [] divider t = not (T.null t) && T.all (== '-') t -- | Prepare the options summary as a series of lines, nicely formatted for -- textual output. formatOptions :: CommandSummary -> T.Text formatOptions (CommandSummary _ _ opts) = T.unlines $ zipWith line flags'' descs where (flags, descs) = unzip opts flags' = map (T.intercalate ", ") flags n = maximum $ map T.length flags' flags'' = map (T.justifyLeft n ' ') flags' line f d = T.concat [" ", f, " ", d] -- | Find an option description in a summary, if there. findOptionDescription :: String -> CommandSummary -> Maybe T.Text findOptionDescription a (CommandSummary _ _ opts) = listToMaybe $ map snd $ filter (any match . fst) opts where a' = T.pack a a'' = a' `T.snoc` ' ' match f = f == a' || a'' `T.isPrefixOf` f
mzero/plush
src/Plush/Types/CommandSummary.hs
apache-2.0
3,692
0
13
890
899
471
428
48
8
module Foundation ( Jabaraster (..) , JabarasterRoute (..) , JabarasterMessage (..) , resourcesJabaraster , Handler , Widget , Form , maybeAuth , requireAuth , module Yesod , module Settings , module Model , StaticRoute (..) , AuthRoute (..) ) where import Prelude import Yesod hiding (Form, AppConfig (..), withYamlEnvironment) import Yesod.Static (Static, base64md5, StaticRoute(..)) import Settings.StaticFiles import Yesod.Auth import Yesod.Auth.OpenId import Yesod.Default.Config import Yesod.Default.Util (addStaticContentExternal) import Yesod.Logger (Logger, logMsg, formatLogText) #ifdef DEVELOPMENT import Yesod.Logger (logLazyText) #endif import qualified Settings import qualified Data.ByteString.Lazy as L import qualified Database.Persist.Base import Database.Persist.GenericSql import Settings (widgetFile) import Model import Text.Jasmine (minifym) import Web.ClientSession (getKey) import Text.Hamlet (hamletFile) #if DEVELOPMENT import qualified Data.Text.Lazy.Encoding #else import Network.Mail.Mime (sendmail) #endif -- | The site argument for your application. This can be a good place to -- keep settings and values requiring initialization before your application -- starts running, such as database connections. Every handler will have -- access to the data present here. data Jabaraster = Jabaraster { settings :: AppConfig DefaultEnv () , getLogger :: Logger , getStatic :: Static -- ^ Settings for static file serving. , connPool :: Database.Persist.Base.PersistConfigPool Settings.PersistConfig -- ^ Database connection pool. } -- Set up i18n messages. See the message folder. mkMessage "Jabaraster" "messages" "en" -- This is where we define all of the routes in our application. For a full -- explanation of the syntax, please see: -- http://www.yesodweb.com/book/handler -- -- This function does three things: -- -- * Creates the route datatype JabarasterRoute. Every valid URL in your -- application can be represented as a value of this type. -- * Creates the associated type: -- type instance Route Jabaraster = JabarasterRoute -- * Creates the value resourcesJabaraster which contains information on the -- resources declared below. This is used in Handler.hs by the call to -- mkYesodDispatch -- -- What this function does *not* do is create a YesodSite instance for -- Jabaraster. Creating that instance requires all of the handler functions -- for our application to be in scope. However, the handler functions -- usually require access to the JabarasterRoute datatype. Therefore, we -- split these actions into two functions and place them in separate files. mkYesodData "Jabaraster" $(parseRoutesFile "config/routes") type Form x = Html -> MForm Jabaraster Jabaraster (FormResult x, Widget) -- Please see the documentation for the Yesod typeclass. There are a number -- of settings which can be configured by overriding methods here. instance Yesod Jabaraster where approot = appRoot . settings -- Place the session key file in the config folder encryptKey _ = fmap Just $ getKey "config/client_session_key.aes" defaultLayout widget = do mmsg <- getMessage -- We break up the default layout into two components: -- default-layout is the contents of the body tag, and -- default-layout-wrapper is the entire page. Since the final -- value passed to hamletToRepHtml cannot be a widget, this allows -- you to use normal widget features in default-layout. pc <- widgetToPageContent $ do $(widgetFile "normalize") $(widgetFile "default-layout") hamletToRepHtml $(hamletFile "templates/default-layout-wrapper.hamlet") -- This is done to provide an optimization for serving static files from -- a separate domain. Please see the staticRoot setting in Settings.hs urlRenderOverride y (StaticR s) = Just $ uncurry (joinPath y (Settings.staticRoot $ settings y)) $ renderRoute s urlRenderOverride _ _ = Nothing -- The page to be redirected to when authentication is required. authRoute _ = Just $ AuthR LoginR messageLogger y loc level msg = formatLogText (getLogger y) loc level msg >>= logMsg (getLogger y) -- This function creates static content files in the static folder -- and names them based on a hash of their content. This allows -- expiration dates to be set far in the future without worry of -- users receiving stale content. addStaticContent = addStaticContentExternal minifym base64md5 Settings.staticDir (StaticR . flip StaticRoute []) -- Enable Javascript async loading yepnopeJs _ = Just $ Right $ StaticR js_modernizr_js -- How to run database actions. instance YesodPersist Jabaraster where type YesodPersistBackend Jabaraster = SqlPersist runDB f = liftIOHandler $ fmap connPool getYesod >>= Database.Persist.Base.runPool (undefined :: Settings.PersistConfig) f instance YesodAuth Jabaraster where type AuthId Jabaraster = UserId -- Where to send a user after successful login loginDest _ = RootR -- Where to send a user after logout logoutDest _ = RootR getAuthId creds = runDB $ do x <- getBy $ UniqueUser $ credsIdent creds case x of Just (uid, _) -> return $ Just uid Nothing -> do fmap Just $ insert $ User (credsIdent creds) Nothing -- You can add other plugins like BrowserID, email or OAuth here authPlugins = [authOpenId] -- Sends off your mail. Requires sendmail in production! deliver :: Jabaraster -> L.ByteString -> IO () #ifdef DEVELOPMENT deliver y = logLazyText (getLogger y) . Data.Text.Lazy.Encoding.decodeUtf8 #else deliver _ = sendmail #endif -- This instance is required to use forms. You can modify renderMessage to -- achieve customized and internationalized form validation messages. instance RenderMessage Jabaraster FormMessage where renderMessage _ _ = defaultFormMessage
jabaraster/yefib
Foundation.hs
bsd-2-clause
6,049
0
17
1,220
917
525
392
-1
-1
module Math.Probably.ChunkedArray where import Data.Array.Vector import Data.List (foldl') class ReifyInt a where reifyInt :: a -> Int data D4 = D4 instance ReifyInt D4 where reifyInt _ = 4 data D512 = D512 instance ReifyInt D512 where reifyInt _ = 512 data D10000 = D10000 instance ReifyInt D10000 where reifyInt _ = 10000 newtype Chunked chsz a = CU [UArr a] deriving (Eq, Show) chunkedTypedChunkSize :: ReifyInt chsz => Chunked chsz a -> chsz chunkedTypedChunkSize = undefined chunkedChunkSize :: ReifyInt chsz => Chunked chsz a -> Int chunkedChunkSize ch = reifyInt (chunkedTypedChunkSize ch) consChunks :: UArr a -> Chunked chsz a -> Chunked chsz a consChunks arr (CU arrs) = CU (arr:arrs) replicateCU :: (ReifyInt chsz, UA a) => chsz -> Int -> a -> Chunked chsz a replicateCU chsz n e | n > reifyInt chsz = consChunks (replicateU (reifyInt chsz) e) $ replicateCU chsz (n-reifyInt chsz) e | otherwise = CU [replicateU n e] enumFromToCU :: ReifyInt chsz => chsz -> Int -> Int -> Chunked chsz Int enumFromToCU chsz from to = let sz = reifyInt chsz in if to-from > sz then consChunks (enumFromToU from (from+sz-1)) $ enumFromToCU chsz (from+sz) to else CU [enumFromToU from to] mapCU :: (UA a, UA b) => (a->b) -> Chunked chsz a -> Chunked chsz b mapCU _ (CU []) = CU [] mapCU f (CU arrs) = CU $ map (mapU f) arrs foldlCU :: UA b => (a -> b -> a) -> a -> Chunked chsz b -> a foldlCU f init (CU arrs) = foldl' (foldlU f) init arrs
glutamate/probably
Math/Probably/ChunkedArray.hs
bsd-3-clause
1,559
0
14
391
665
333
332
31
2
-- | Common code for parsing command line options based on getopt. module Futhark.Util.Options ( FunOptDescr , mainWithOptions , commonOptions ) where import Data.Version import System.Environment import Control.Monad.IO.Class import System.IO import System.Exit import System.Console.GetOpt import Futhark.Version -- | A command line option that either purely updates a configuration, -- or performs an IO action (and stops). type FunOptDescr cfg = OptDescr (Either (IO ()) (cfg -> cfg)) -- | Generate a main action that parses the given command line options -- (while always adding 'commonOptions'). mainWithOptions :: cfg -> [FunOptDescr cfg] -> ([String] -> cfg -> Maybe (IO ())) -> IO () mainWithOptions emptyConfig commandLineOptions f = do args <- getArgs case getOpt' Permute commandLineOptions' args of (opts, nonopts, [], []) -> case applyOpts opts of Right config | Just m <- f nonopts config -> m | otherwise -> invalid nonopts [] [] Left m -> m (_, nonopts, unrecs, errs) -> invalid nonopts unrecs errs where applyOpts opts = do fs <- sequence opts return $ foldl (.) id (reverse fs) emptyConfig invalid nonopts unrecs errs = do usage <- usageStr commandLineOptions' badOptions usage nonopts errs unrecs commandLineOptions' = commonOptions commandLineOptions ++ commandLineOptions usageStr :: [OptDescr a] -> IO String usageStr opts = do prog <- getProgName let header = "Help for " ++ prog ++ " (Futhark " ++ showVersion version ++ ")" return $ usageInfo header opts badOptions :: String -> [String] -> [String] -> [String] -> IO () badOptions usage nonopts errs unrecs = do mapM_ (errput . ("Junk argument: " ++)) nonopts mapM_ (errput . ("Unrecognised argument: " ++)) unrecs hPutStr stderr $ concat errs ++ usage exitWith $ ExitFailure 1 -- | Short-hand for 'liftIO . hPutStrLn stderr' errput :: MonadIO m => String -> m () errput = liftIO . hPutStrLn stderr -- | Common definitions for @-v@ and @-h@, given the list of all other -- options. commonOptions :: [FunOptDescr cfg] -> [FunOptDescr cfg] commonOptions options = [ Option "v" ["version"] (NoArg $ Left $ do header exitSuccess) "Print version information and exit." , Option "h" ["help"] (NoArg $ Left $ do header putStrLn "" putStrLn =<< usageStr (commonOptions [] ++ options) exitSuccess) "Print help and exit." ] where header = do putStrLn $ "Futhark " ++ versionString putStrLn "(C) HIPERFIT research centre" putStrLn "Department of Computer Science, University of Copenhagen (DIKU)"
CulpaBS/wbBach
src/Futhark/Util/Options.hs
bsd-3-clause
2,884
0
17
812
754
379
375
61
3
{-# LANGUAGE DeriveGeneric #-} -- | Basic operations on 2D vectors represented in an efficient, -- but not unique, way. module Game.LambdaHack.Common.Vector ( Vector(..), isUnit, isDiagonal, neg, chessDistVector, euclidDistSqVector , moves, movesCardinal, movesDiagonal, compassText, vicinity, vicinityCardinal , shift, shiftBounded, trajectoryToPath, trajectoryToPathBounded , vectorToFrom, pathToTrajectory , RadianAngle, rotate, towards ) where import Control.DeepSeq import Control.Exception.Assert.Sugar import Data.Binary import qualified Data.EnumMap.Strict as EM import Data.Int (Int32) import Data.Text (Text) import GHC.Generics (Generic) import Game.LambdaHack.Common.Point -- | 2D vectors in cartesian representation. Coordinates grow to the right -- and down, so that the (1, 1) vector points to the bottom-right corner -- of the screen. data Vector = Vector { vx :: !X , vy :: !Y } deriving (Eq, Ord, Show, Read, Generic) instance Binary Vector where put = put . (fromIntegral :: Int -> Int32) . fromEnum get = fmap (toEnum . (fromIntegral :: Int32 -> Int)) get instance Enum Vector where fromEnum = fromEnumVector toEnum = toEnumVector instance NFData Vector -- | Maximal supported vector X and Y coordinates. maxVectorDim :: Int {-# INLINE maxVectorDim #-} maxVectorDim = 2 ^ (maxLevelDimExponent - 1) - 1 fromEnumVector :: Vector -> Int {-# INLINE fromEnumVector #-} fromEnumVector (Vector vx vy) = vx + vy * (2 ^ maxLevelDimExponent) toEnumVector :: Int -> Vector {-# INLINE toEnumVector #-} toEnumVector n = let (y, x) = n `quotRem` (2 ^ maxLevelDimExponent) (vx, vy) | x > maxVectorDim = (x - 2 ^ maxLevelDimExponent, y + 1) | x < - maxVectorDim = (x + 2 ^ maxLevelDimExponent, y - 1) | otherwise = (x, y) in Vector{..} -- | Tells if a vector has length 1 in the chessboard metric. isUnit :: Vector -> Bool {-# INLINE isUnit #-} isUnit v = chessDistVector v == 1 -- | Checks whether a unit vector is a diagonal direction, -- as opposed to cardinal. If the vector is not unit, -- it checks that the vector is not horizontal nor vertical. isDiagonal :: Vector -> Bool {-# INLINE isDiagonal #-} isDiagonal (Vector x y) = x * y /= 0 -- | Reverse an arbirary vector. neg :: Vector -> Vector {-# INLINE neg #-} neg (Vector vx vy) = Vector (-vx) (-vy) -- | Squared euclidean distance between two vectors. euclidDistSqVector :: Vector -> Vector -> Int {-# INLINE euclidDistSqVector #-} euclidDistSqVector (Vector x0 y0) (Vector x1 y1) = let square n = n ^ (2 :: Int) in square (x1 - x0) + square (y1 - y0) -- | The lenght of a vector in the chessboard metric, -- where diagonal moves cost 1. chessDistVector :: Vector -> Int {-# INLINE chessDistVector #-} chessDistVector (Vector x y) = max (abs x) (abs y) -- | Vectors of all unit moves in the chessboard metric, -- clockwise, starting north-west. moves :: [Vector] {-# NOINLINE moves #-} moves = map (uncurry Vector) [(-1, -1), (0, -1), (1, -1), (1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0)] moveTexts :: [Text] moveTexts = ["NW", "N", "NE", "E", "SE", "S", "SW", "W"] compassText :: Vector -> Text compassText v = let m = EM.fromList $ zip moves moveTexts assFail = assert `failure` "not a unit vector" `twith` v in EM.findWithDefault assFail v m -- | Vectors of all cardinal direction unit moves, clockwise, starting north. movesCardinal :: [Vector] movesCardinal = map (uncurry Vector) [(0, -1), (1, 0), (0, 1), (-1, 0)] -- | Vectors of all diagonal direction unit moves, clockwise, starting north. movesDiagonal :: [Vector] movesDiagonal = map (uncurry Vector) [(-1, -1), (1, -1), (1, 1), (-1, 1)] -- | All (8 at most) closest neighbours of a point within an area. vicinity :: X -> Y -- ^ limit the search to this area -> Point -- ^ position to find neighbours of -> [Point] vicinity lxsize lysize p = if inside p (1, 1, lxsize - 2, lysize - 2) then vicinityUnsafe p else [ res | dxy <- moves , let res = shift p dxy , inside res (0, 0, lxsize - 1, lysize - 1) ] vicinityUnsafe :: Point -> [Point] vicinityUnsafe p = [ res | dxy <- moves , let res = shift p dxy ] -- | All (4 at most) cardinal direction neighbours of a point within an area. vicinityCardinal :: X -> Y -- ^ limit the search to this area -> Point -- ^ position to find neighbours of -> [Point] vicinityCardinal lxsize lysize p = [ res | dxy <- movesCardinal , let res = shift p dxy , inside res (0, 0, lxsize - 1, lysize - 1) ] -- | Translate a point by a vector. shift :: Point -> Vector -> Point {-# INLINE shift #-} shift (Point x0 y0) (Vector x1 y1) = Point (x0 + x1) (y0 + y1) -- | Translate a point by a vector, but only if the result fits in an area. shiftBounded :: X -> Y -> Point -> Vector -> Point shiftBounded lxsize lysize pos v@(Vector xv yv) = if inside pos (-xv, -yv, lxsize - xv - 1, lysize - yv - 1) then shift pos v else pos -- | A list of points that a list of vectors leads to. trajectoryToPath :: Point -> [Vector] -> [Point] trajectoryToPath _ [] = [] trajectoryToPath start (v : vs) = let next = shift start v in next : trajectoryToPath next vs -- | A list of points that a list of vectors leads to, bounded by level size. trajectoryToPathBounded :: X -> Y -> Point -> [Vector] -> [Point] trajectoryToPathBounded _ _ _ [] = [] trajectoryToPathBounded lxsize lysize start (v : vs) = let next = shiftBounded lxsize lysize start v in next : trajectoryToPathBounded lxsize lysize next vs -- | The vector between the second point and the first. We have -- -- > shift pos1 (pos2 `vectorToFrom` pos1) == pos2 -- -- The arguments are in the same order as in the underlying scalar subtraction. vectorToFrom :: Point -> Point -> Vector {-# INLINE vectorToFrom #-} vectorToFrom (Point x0 y0) (Point x1 y1) = Vector (x0 - x1) (y0 - y1) -- | A list of vectors between a list of points. pathToTrajectory :: [Point] -> [Vector] pathToTrajectory [] = [] pathToTrajectory lp1@(_ : lp2) = zipWith vectorToFrom lp2 lp1 type RadianAngle = Double -- | Rotate a vector by the given angle (expressed in radians) -- counterclockwise and return a unit vector approximately in the resulting -- direction. rotate :: RadianAngle -> Vector -> Vector rotate angle (Vector x' y') = let x = fromIntegral x' y = fromIntegral y' -- Minus before the angle comes from our coordinates being -- mirrored along the X axis (Y coordinates grow going downwards). dx = x * cos (-angle) - y * sin (-angle) dy = x * sin (-angle) + y * cos (-angle) in normalize dx dy -- TODO: use bla for that -- | Given a vector of arbitrary non-zero length, produce a unit vector -- that points in the same direction (in the chessboard metric). -- Of several equally good directions it picks one of those that visually -- (in the euclidean metric) maximally align with the original vector. normalize :: Double -> Double -> Vector normalize dx dy = assert (dx /= 0 || dy /= 0 `blame` "can't normalize zero" `twith` (dx, dy)) $ let angle :: Double angle = atan (dy / dx) / (pi / 2) dxy | angle <= -0.75 && angle >= -1.25 = (0, -1) | angle <= -0.25 = (1, -1) | angle <= 0.25 = (1, 0) | angle <= 0.75 = (1, 1) | angle <= 1.25 = (0, 1) | otherwise = assert `failure` "impossible angle" `twith` (dx, dy, angle) in if dx >= 0 then uncurry Vector dxy else neg $ uncurry Vector dxy normalizeVector :: Vector -> Vector normalizeVector v@(Vector vx vy) = let res = normalize (fromIntegral vx) (fromIntegral vy) in assert (not (isUnit v) || v == res `blame` "unit vector gets untrivially normalized" `twith` (v, res)) res -- TODO: Perhaps produce all acceptable directions and let AI choose. -- That would also eliminate the Doubles. Or only directions from bla? -- Smart monster could really use all dirs to be less predictable, -- but it wouldn't look as natural as bla, so for less smart bla is better. -- | Given two distinct positions, determine the direction (a unit vector) -- in which one should move from the first in order to get closer -- to the second. Ignores obstacles. Of several equally good directions -- (in the chessboard metric) it picks one of those that visually -- (in the euclidean metric) maximally align with the vector between -- the two points. towards :: Point -> Point -> Vector towards pos0 pos1 = assert (pos0 /= pos1 `blame` "towards self" `twith` (pos0, pos1)) $ normalizeVector $ pos1 `vectorToFrom` pos0
Concomitant/LambdaHack
Game/LambdaHack/Common/Vector.hs
bsd-3-clause
8,719
0
16
1,987
2,368
1,322
1,046
-1
-1
module MissingClass where import java "java.lang.Math1"
rahulmutt/ghcvm
tests/suite/java-imports/fail/MissingClass.hs
bsd-3-clause
57
1
5
7
12
6
6
-1
-1
{-# LANGUAGE Haskell98 #-} {-# LINE 1 "Data/Set.hs" #-} {-# LANGUAGE CPP #-} {-# LANGUAGE Safe #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Set -- Copyright : (c) Daan Leijen 2002 -- License : BSD-style -- Maintainer : [email protected] -- Portability : portable -- -- An efficient implementation of sets. -- -- These modules are intended to be imported qualified, to avoid name -- clashes with Prelude functions, e.g. -- -- > import Data.Set (Set) -- > import qualified Data.Set as Set -- -- The implementation of 'Set' is based on /size balanced/ binary trees (or -- trees of /bounded balance/) as described by: -- -- * Stephen Adams, \"/Efficient sets: a balancing act/\", -- Journal of Functional Programming 3(4):553-562, October 1993, -- <http://www.swiss.ai.mit.edu/~adams/BB/>. -- * J. Nievergelt and E.M. Reingold, -- \"/Binary search trees of bounded balance/\", -- SIAM journal of computing 2(1), March 1973. -- -- Bounds for 'union', 'intersection', and 'difference' are as given -- by -- -- * Guy Blelloch, Daniel Ferizovic, and Yihan Sun, -- \"/Just Join for Parallel Ordered Sets/\", -- <https://arxiv.org/abs/1602.02120v3>. -- -- Note that the implementation is /left-biased/ -- the elements of a -- first argument are always preferred to the second, for example in -- 'union' or 'insert'. Of course, left-biasing can only be observed -- when equality is an equivalence relation instead of structural -- equality. -- -- /Warning/: The size of the set must not exceed @maxBound::Int@. Violation of -- this condition is not detected and if the size limit is exceeded, its -- behaviour is undefined. ----------------------------------------------------------------------------- module Data.Set ( -- * Strictness properties -- $strictness -- * Set type Set -- instance Eq,Ord,Show,Read,Data,Typeable -- * Operators , (\\) -- * Query , S.null , size , member , notMember , lookupLT , lookupGT , lookupLE , lookupGE , isSubsetOf , isProperSubsetOf -- * Construction , empty , singleton , insert , delete -- * Combine , union , unions , difference , intersection -- * Filter , S.filter , takeWhileAntitone , dropWhileAntitone , spanAntitone , partition , split , splitMember , splitRoot -- * Indexed , lookupIndex , findIndex , elemAt , deleteAt , S.take , S.drop , S.splitAt -- * Map , S.map , mapMonotonic -- * Folds , S.foldr , S.foldl -- ** Strict folds , foldr' , foldl' -- ** Legacy folds , fold -- * Min\/Max , lookupMin , lookupMax , findMin , findMax , deleteMin , deleteMax , deleteFindMin , deleteFindMax , maxView , minView -- * Conversion -- ** List , elems , toList , fromList -- ** Ordered list , toAscList , toDescList , fromAscList , fromDescList , fromDistinctAscList , fromDistinctDescList -- * Debugging , showTree , showTreeWith , valid ) where import Data.Set.Internal as S -- $strictness -- -- This module satisfies the following strictness property: -- -- * Key arguments are evaluated to WHNF -- -- Here are some examples that illustrate the property: -- -- > delete undefined s == undefined
phischu/fragnix
tests/packages/scotty/Data.Set.hs
bsd-3-clause
4,597
0
5
2,002
301
224
77
70
0
{-# LANGUAGE TypeSynonymInstances, MultiParamTypeClasses #-} -- module Exp.Guess where import Autolib.Exp import Autolib.Exp.Some import Autolib.Exp.Inter import Autolib.NFA.Subseteq import Autolib.NFA.Minus import Autolib.NFA.Shortest ( some_shortest ) import Autolib.Util.Zufall import Autolib.Util.Sort import Autolib.Set import Autolib.Size import Tree.Like import qualified Tree.Guess as G import Control.Monad ( guard ) import System.IO main = G.run $ make "ab" $ read "All - All a b a b All" make sigma target = let a = inter_det (std_sigma sigma) target in G.Config { G.goal = a , G.eval = inter_det (std_sigma sigma) , G.distance = \ a b -> let ab = some_shortest ( minus a b ) ba = some_shortest ( minus b a ) in case ba of [] -> case ab of [] -> 0 w : _ -> 4 ^^ negate ( length w ) _ -> 100 , G.weight = fromIntegral . size , G.generate = do ( y, b ) <- some ( mkSet sigma ) 50 return y , G.mutate = implant , G.population = 100 } ------------------------------------------------------------------- simplified sigma x = let a = inter ( std_sigma sigma ) x f x = let ys = do y <- smaller x guard $ equivalent sigma a y return y in case ys of y : _ -> y -- f y -- not recursively [] -> x in f x simpf sigma x = do -- hPutStrLn stderr $ "simpf " ++ show x let y = simplified sigma x -- hPutStrLn stderr $ " ==> " ++ show y return y equivalent sigma a y = let b = inter (std_sigma sigma) y in null ( some_shortest $ minus a b ) && null ( some_shortest $ minus b a ) ----------------------------------------------------------------------------- implant x = do p <- eins $ positions x r <- eins [ "Eps", "Sigma" ] return $ poke x p $ Ref r ----------------------------------------------------------------------------- instance Tree.Like.Class Exp String where children t = case t of Union l r -> [l, r] Dot l r -> [l, r] PowerStar a -> [a] _ -> [] label t = case t of Union {} -> "+" Dot {} -> "*" PowerStar {} -> "^*" _ -> show t build f xs = case ( f, xs ) of ( "+", [l,r] ) -> Union l r ( "*", [l,r] ) -> Dot l r ( "^*", [a] ) -> PowerStar a ( _, [] ) -> read f
florianpilz/autotool
src/Exp/Guess.hs
gpl-2.0
2,502
13
21
834
840
437
403
76
3
{-# 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.ElastiCache.DescribeCacheSecurityGroups -- Copyright : (c) 2013-2014 Brendan Hay <[email protected]> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or -- you can obtain it at http://mozilla.org/MPL/2.0/. -- Maintainer : Brendan Hay <[email protected]> -- Stability : experimental -- Portability : non-portable (GHC extensions) -- -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | The /DescribeCacheSecurityGroups/ action returns a list of cache security group -- descriptions. If a cache security group name is specified, the list will -- contain only the description of that group. -- -- <http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_DescribeCacheSecurityGroups.html> module Network.AWS.ElastiCache.DescribeCacheSecurityGroups ( -- * Request DescribeCacheSecurityGroups -- ** Request constructor , describeCacheSecurityGroups -- ** Request lenses , dcsg1CacheSecurityGroupName , dcsg1Marker , dcsg1MaxRecords -- * Response , DescribeCacheSecurityGroupsResponse -- ** Response constructor , describeCacheSecurityGroupsResponse -- ** Response lenses , dcsgr1CacheSecurityGroups , dcsgr1Marker ) where import Network.AWS.Prelude import Network.AWS.Request.Query import Network.AWS.ElastiCache.Types import qualified GHC.Exts data DescribeCacheSecurityGroups = DescribeCacheSecurityGroups { _dcsg1CacheSecurityGroupName :: Maybe Text , _dcsg1Marker :: Maybe Text , _dcsg1MaxRecords :: Maybe Int } deriving (Eq, Ord, Read, Show) -- | 'DescribeCacheSecurityGroups' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'dcsg1CacheSecurityGroupName' @::@ 'Maybe' 'Text' -- -- * 'dcsg1Marker' @::@ 'Maybe' 'Text' -- -- * 'dcsg1MaxRecords' @::@ 'Maybe' 'Int' -- describeCacheSecurityGroups :: DescribeCacheSecurityGroups describeCacheSecurityGroups = DescribeCacheSecurityGroups { _dcsg1CacheSecurityGroupName = Nothing , _dcsg1MaxRecords = Nothing , _dcsg1Marker = Nothing } -- | The name of the cache security group to return details for. dcsg1CacheSecurityGroupName :: Lens' DescribeCacheSecurityGroups (Maybe Text) dcsg1CacheSecurityGroupName = lens _dcsg1CacheSecurityGroupName (\s a -> s { _dcsg1CacheSecurityGroupName = a }) -- | An optional marker returned from a prior request. Use this marker for -- pagination of results from this action. If this parameter is specified, the -- response includes only records beyond the marker, up to the value specified -- by /MaxRecords/. dcsg1Marker :: Lens' DescribeCacheSecurityGroups (Maybe Text) dcsg1Marker = lens _dcsg1Marker (\s a -> s { _dcsg1Marker = a }) -- | The maximum number of records to include in the response. If more records -- exist than the specified 'MaxRecords' value, a marker is included in the -- response so that the remaining results can be retrieved. -- -- Default: 100 -- -- Constraints: minimum 20; maximum 100. dcsg1MaxRecords :: Lens' DescribeCacheSecurityGroups (Maybe Int) dcsg1MaxRecords = lens _dcsg1MaxRecords (\s a -> s { _dcsg1MaxRecords = a }) data DescribeCacheSecurityGroupsResponse = DescribeCacheSecurityGroupsResponse { _dcsgr1CacheSecurityGroups :: List "member" CacheSecurityGroup , _dcsgr1Marker :: Maybe Text } deriving (Eq, Read, Show) -- | 'DescribeCacheSecurityGroupsResponse' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'dcsgr1CacheSecurityGroups' @::@ ['CacheSecurityGroup'] -- -- * 'dcsgr1Marker' @::@ 'Maybe' 'Text' -- describeCacheSecurityGroupsResponse :: DescribeCacheSecurityGroupsResponse describeCacheSecurityGroupsResponse = DescribeCacheSecurityGroupsResponse { _dcsgr1Marker = Nothing , _dcsgr1CacheSecurityGroups = mempty } -- | A list of cache security groups. Each element in the list contains detailed -- information about one group. dcsgr1CacheSecurityGroups :: Lens' DescribeCacheSecurityGroupsResponse [CacheSecurityGroup] dcsgr1CacheSecurityGroups = lens _dcsgr1CacheSecurityGroups (\s a -> s { _dcsgr1CacheSecurityGroups = a }) . _List -- | Provides an identifier to allow retrieval of paginated results. dcsgr1Marker :: Lens' DescribeCacheSecurityGroupsResponse (Maybe Text) dcsgr1Marker = lens _dcsgr1Marker (\s a -> s { _dcsgr1Marker = a }) instance ToPath DescribeCacheSecurityGroups where toPath = const "/" instance ToQuery DescribeCacheSecurityGroups where toQuery DescribeCacheSecurityGroups{..} = mconcat [ "CacheSecurityGroupName" =? _dcsg1CacheSecurityGroupName , "Marker" =? _dcsg1Marker , "MaxRecords" =? _dcsg1MaxRecords ] instance ToHeaders DescribeCacheSecurityGroups instance AWSRequest DescribeCacheSecurityGroups where type Sv DescribeCacheSecurityGroups = ElastiCache type Rs DescribeCacheSecurityGroups = DescribeCacheSecurityGroupsResponse request = post "DescribeCacheSecurityGroups" response = xmlResponse instance FromXML DescribeCacheSecurityGroupsResponse where parseXML = withElement "DescribeCacheSecurityGroupsResult" $ \x -> DescribeCacheSecurityGroupsResponse <$> x .@? "CacheSecurityGroups" .!@ mempty <*> x .@? "Marker" instance AWSPager DescribeCacheSecurityGroups where page rq rs | stop (rs ^. dcsgr1Marker) = Nothing | otherwise = (\x -> rq & dcsg1Marker ?~ x) <$> (rs ^. dcsgr1Marker)
kim/amazonka
amazonka-elasticache/gen/Network/AWS/ElastiCache/DescribeCacheSecurityGroups.hs
mpl-2.0
6,206
0
12
1,250
725
431
294
80
1
----------------------------------------------------------------------------- -- | -- Module : XMonad.Util.Loggers -- Copyright : (c) Brent Yorgey, Wirt Wolff -- License : BSD-style (see LICENSE) -- -- Maintainer : <[email protected]> -- Stability : unstable -- Portability : unportable -- -- A collection of simple logger functions and formatting utilities -- which can be used in the 'XMonad.Hooks.DynamicLog.ppExtras' field of -- a pretty-printing status logger format. See "XMonad.Hooks.DynamicLog" -- for more information. ----------------------------------------------------------------------------- module XMonad.Util.Loggers ( -- * Usage -- $usage Logger -- * System Loggers -- $system , aumixVolume , battery , date , loadAvg , maildirNew, maildirUnread , logCmd , logFileCount -- * XMonad Loggers -- $xmonad , logCurrent, logLayout, logTitle -- * Formatting Utilities -- $format , onLogger , wrapL, fixedWidthL , logSp, padL , shortenL , dzenColorL, xmobarColorL , (<$>) ) where import XMonad (liftIO) import XMonad.Core import qualified XMonad.StackSet as W import XMonad.Hooks.DynamicLog import XMonad.Util.Font (Align (..)) import XMonad.Util.NamedWindows (getName) import Prelude hiding (catch) import Control.Applicative ((<$>)) import Control.Exception import Data.List (isPrefixOf, isSuffixOf) import Data.Maybe (fromMaybe) import Data.Traversable (traverse) import System.Directory (getDirectoryContents) import System.IO import System.Locale import System.Process (runInteractiveCommand) import System.Time econst :: Monad m => a -> IOException -> m a econst = const . return -- $usage -- Use this module by importing it into your @~\/.xmonad\/xmonad.hs@: -- -- > import XMonad.Util.Loggers -- -- Then, add one or more loggers to the -- 'XMonad.Hooks.DynamicLog.ppExtras' field of your -- 'XMonad.Hooks.DynamicLoc.PP', possibly with extra formatting . -- For example: -- -- > -- display load averages and a pithy quote along with xmonad status. -- > , logHook = dynamicLogWithPP $ defaultPP { -- > ppExtras = [ padL loadAvg, logCmd "fortune -n 40 -s" ] -- > } -- > -- gives something like " 3.27 3.52 3.26 Drive defensively. Buy a tank." -- -- See the formatting section below for another example using -- a @where@ block to define some formatted loggers for a top-level -- @myLogHook@. -- -- Loggers are named either for their function, as in 'battery', -- 'aumixVolume', and 'maildirNew', or are prefixed with \"log\" when -- making use of other functions or by analogy with the pp* functions. -- For example, the logger version of 'XMonad.Hooks.DynamicLog.ppTitle' -- is 'logTitle', and 'logFileCount' loggerizes the result of file -- counting code. -- -- Formatting utility names are generally as short as possible and -- carry the suffix \"L\". For example, the logger version of -- 'XMonad.Hooks.DynamicLog.shorten' is 'shortenL'. -- -- Of course, there is nothing really special about these so-called -- \"loggers\": they are just @X (Maybe String)@ actions. So you can -- use them anywhere you would use an @X (Maybe String)@, not just -- with DynamicLog. -- -- Additional loggers welcome! -- | 'Logger' is just a convenient synonym for @X (Maybe String)@. type Logger = X (Maybe String) -- $system -- | Get the current volume with @aumix@. <http://jpj.net/~trevor/aumix.html> aumixVolume :: Logger aumixVolume = logCmd "aumix -vq" -- | Get the battery status (percent charge and charging\/discharging -- status). This is an ugly hack and may not work for some people. -- At some point it would be nice to make this more general\/have -- fewer dependencies (assumes @\/usr\/bin\/acpi@ and @sed@ are installed.) battery :: Logger battery = logCmd "/usr/bin/acpi | sed -r 's/.*?: (.*%).*/\\1/; s/[dD]ischarging, ([0-9]+%)/\\1-/; s/[cC]harging, ([0-9]+%)/\\1+/; s/[cC]harged, //'" -- | Get the current date and time, and format them via the -- given format string. The format used is the same as that used -- by the C library function strftime; for example, -- @date \"%a %b %d\"@ might display something like @Tue Feb 19@. -- For more information see something like -- <http://www.cplusplus.com/reference/clibrary/ctime/strftime.html>. date :: String -> Logger date fmt = io $ do cal <- (getClockTime >>= toCalendarTime) return . Just $ formatCalendarTime defaultTimeLocale fmt cal -- | Get the load average. This assumes that you have a -- utility called @\/usr\/bin\/uptime@ and that you have @sed@ -- installed; these are fairly common on GNU\/Linux systems but it -- would be nice to make this more general. loadAvg :: Logger loadAvg = logCmd "/usr/bin/uptime | sed 's/.*: //; s/,//g'" -- | Create a 'Logger' from an arbitrary shell command. logCmd :: String -> Logger logCmd c = io $ do (_, out, _, _) <- runInteractiveCommand c fmap Just (hGetLine out) `catch` econst Nothing -- no need to waitForProcess, we ignore SIGCHLD -- | Get a count of filtered files in a directory. -- See 'maildirUnread' and 'maildirNew' source for usage examples. logFileCount :: FilePath -- ^ directory in which to count files -> (String -> Bool) -- ^ predicate to match if file should be counted -> Logger logFileCount d p = do c <- liftIO ( getDirectoryContents d) let n = length $ Prelude.filter p c case n of 0 -> return Nothing _ -> return $ Just $ show n -- | Get a count of unread mails in a maildir. For maildir format -- details, to write loggers for other classes of mail, see -- <http://cr.yp.to/proto/maildir.html> and 'logFileCount'. maildirUnread :: FilePath -> Logger maildirUnread mdir = logFileCount (mdir ++ "/cur/") (isSuffixOf ",") -- | Get a count of new mails in a maildir. maildirNew :: FilePath -> Logger maildirNew mdir = logFileCount (mdir ++ "/new/") (not . isPrefixOf ".") -- $xmonad -- -- A very small sample of what you can log since you have access to X. For -- example you can loggerize the number of windows on each workspace, or -- titles on other workspaces, or the id of the previously focused workspace.... -- | Get the title (name) of the focused window. logTitle :: Logger logTitle = withWindowSet $ traverse (fmap show . getName) . W.peek -- | Get the name of the current layout. logLayout :: Logger logLayout = withWindowSet $ return . Just . ld where ld = description . W.layout . W.workspace . W.current -- | Get the name of the current workspace. logCurrent :: Logger logCurrent = withWindowSet $ return . Just . W.currentTag -- $format -- Combine logger formatting functions to make your -- 'XMonad.Hooks.DynamicLog.ppExtras' more colorful and readable. -- (For convenience this module exports 'Control.Applicative.<$>' to -- use instead of \'.\' or \'$\' in hard to read formatting lines. -- For example: -- -- > myLogHook = dynamicLogWithPP defaultPP { -- > -- skipped -- > , ppExtras = [lLoad, lTitle, logSp 3, wrapL "[" "]" $ date "%a %d %b"] -- > , ppOrder = \(ws,l,_,xs) -> [l,ws] ++ xs -- > } -- > where -- > -- lTitle = fixedWidthL AlignCenter "." 99 . dzenColorL "cornsilk3" "" . padL . shortenL 80 $ logTitle -- > -- or something like: -- > lTitle = fixedWidthL AlignCenter "." 99 <$> dzenColorL "cornsilk3" "" <$> padL . shortenL 80 $ logTitle -- > -- > lLoad = dzenColorL "#6A5ACD" "" . wrapL loadIcon " " . padL $ loadAvg -- > loadIcon = " ^i(/home/me/.dzen/icons/load.xbm)" -- -- Note: When applying 'shortenL' or 'fixedWidthL' to logger strings -- containing colors or other formatting commands, apply the formatting -- /after/ the length adjustment, or include \"invisible\" characters -- in the length specification, e.g. in the above \'^fg(cornsilk3)\' and -- \'^fg()' yields 19 invisible and 80 visible characters. -- | Use a string formatting function to edit a 'Logger' string. -- For example, to create a tag function to prefix or label loggers, -- as in \'tag: output\', use: -- -- > tagL l = onLogger $ wrap (l ++ ": ") "" -- > -- > tagL "bat" battery -- > tagL "load" loadAvg -- -- If you already have a (String -> String) function you want to -- apply to a logger: -- -- > revL = onLogger trim -- -- See formatting utility source code for more 'onLogger' usage examples. onLogger :: (String -> String) -> Logger -> Logger onLogger = fmap . fmap -- | Wrap a logger's output in delimiters, unless it is @X (Nothing)@ -- or @X (Just \"\")@. Some examples: -- -- > wrapL " | " " | " (date "%a %d %b") -- ' | Tue 19 Feb | ' -- > -- > wrapL "bat: " "" battery -- ' bat: battery_logger_output' wrapL :: String -> String -> Logger -> Logger wrapL l r = onLogger $ wrap l r -- | Make a logger's output constant width by padding with the given string, -- /even if the logger is/ @X (Nothing)@ /or/ @X (Just \"\")@. Useful to -- reduce visual noise as a title logger shrinks and grows, to use a fixed -- width for a logger that sometimes becomes Nothing, or even to create -- fancy spacers or character based art effects. -- -- It fills missing logger output with a repeated character like \".\", -- \":\" or pattern, like \" -.-\". The cycling padding string is reversed on -- the left of the logger output. This is mainly useful with AlignCenter. fixedWidthL :: Align -- ^ AlignCenter, AlignRight, or AlignLeft -> String -- ^ String to cycle to pad missing logger output -> Int -- ^ Fixed length to output (including invisible formatting characters) -> Logger -> Logger fixedWidthL a str n logger = do mbl <- logger let l = fromMaybe "" mbl case a of AlignCenter -> toL (take n $ padhalf l ++ l ++ cs) AlignRight -> toL (reverse (take n $ reverse l ++ cs)) _ -> toL (take n $ l ++ cs) where toL = return . Just cs = cycle str padhalf x = reverse $ take ((n - length x) `div` 2) cs -- | Create a \"spacer\" logger, e.g. @logSp 3 -- loggerizes \' \'@. -- For more complex \"spacers\", use 'fixedWidthL' with @return Nothing@. logSp :: Int -> Logger logSp n = return . Just . take n $ cycle " " -- | Pad a logger's output with a leading and trailing space, unless it -- is @X (Nothing)@ or @X (Just \"\")@. padL :: Logger -> Logger padL = onLogger pad -- | Limit a logger's length, adding \"...\" if truncated. shortenL :: Int -> Logger -> Logger shortenL = onLogger . shorten -- | Color a logger's output with dzen foreground and background colors. -- -- > dzenColorL "green" "#2A4C3F" battery dzenColorL :: String -> String -> Logger -> Logger dzenColorL fg bg = onLogger $ dzenColor fg bg -- | Color a logger's output with xmobar foreground and background colors. -- -- > xmobarColorL "#6A5ACD" "gray6" loadAverage xmobarColorL :: String -> String -> Logger -> Logger xmobarColorL fg bg = onLogger $ xmobarColor fg bg -- todo -- * dynamicLogXinerama logger? Or sorted onscreen Id's with "current" indicator? -- is logCurrent really useful at all? -- -- * ppVisible, etc. Resolve code dup. somehow. Refactor DynamicLog so can -- be used for regular PP stuff /and/ loggers? -- -- * fns for "ppExtras as a whole", combine loggers more nicely. -- -- * parsers to use with fixedWidthL to be smarter about invisible characters?
kmels/xmonad-launcher
XMonad/Util/Loggers.hs
bsd-3-clause
11,386
0
16
2,327
1,291
769
522
95
3
{-# LANGUAGE CPP #-} -- #hide module Distribution.Compat.FilePerms ( setFileOrdinary, setFileExecutable, ) where #ifndef mingw32_HOST_OS import System.Posix.Types ( FileMode ) import System.Posix.Internals ( c_chmod ) import Foreign.C ( withCString ) #if MIN_VERSION_base(4,0,0) import Foreign.C ( throwErrnoPathIfMinus1_ ) #else import Foreign.C ( throwErrnoIfMinus1_ ) #endif #endif /* mingw32_HOST_OS */ setFileOrdinary, setFileExecutable :: FilePath -> IO () #ifndef mingw32_HOST_OS setFileOrdinary path = setFileMode path 0o644 -- file perms -rw-r--r-- setFileExecutable path = setFileMode path 0o755 -- file perms -rwxr-xr-x setFileMode :: FilePath -> FileMode -> IO () setFileMode name m = withCString name $ \s -> do #if __GLASGOW_HASKELL__ >= 608 throwErrnoPathIfMinus1_ "setFileMode" name (c_chmod s m) #else throwErrnoIfMinus1_ name (c_chmod s m) #endif #else setFileOrdinary _ = return () setFileExecutable _ = return () #endif
IreneKnapp/Faction
faction/Distribution/Compat/FilePerms.hs
bsd-3-clause
1,028
0
11
212
173
101
72
19
1
{-# LANGUAGE OverloadedStrings #-} module NN.Examples.Demo where import Control.Lens import Control.Monad import Gen.Caffe.LayerParameter as LP import Gen.Caffe.NetParameter as NP import GHC.IO.Handle import System.IO.Temp import System.Process import Text.Printf import NN import NN.Backend.Caffe as Caffe import NN.Backend.Torch as Torch import NN.Backend.Torch.Flat import NN.Backend.Torch.Torch as Torch import NN.Examples.AlexNet import NN.Examples.GoogLeNet caffe :: IO () caffe = do let output = parse googLeNet & Caffe.middleEnd & Caffe.backend let names = output ^. NP._layer ^.. traverse . LP._name ^.. traverse . _Just print names torch :: IO () torch = do print $ parse alexNetSmall & clean & expand' print $ parse alexNetSmall & clean & flattenStructure let Just s' = parse alexNet & Torch.backend putStr s' return () torchFancy :: IO () torchFancy = do let gr' = do x <- layer' relu c <- layer' concat' forM_ [1..4] $ \_ -> do (b, t) <- sequential [conv, relu, maxPool, conv, relu] x >-> b t >-> c return (x, c) let gr = void $ gr' >- gr' >- sequential [ip 4096, relu, dropout 0.5, ip 1000] print $ parse gr & clean & expand' print $ parse gr & clean & flattenStructure visualize' gr let Just str = parse gr & Torch.backend putStr str return () visualize' :: NetBuilder () -> IO () visualize' g = do (file, handle) <- openTempFile "/tmp" "graph.png" hClose handle f <- parse g & visualize & png file _ <- system $ printf "open %s &" f return () visualizeGoogLeNetScaled :: IO () visualizeGoogLeNetScaled = do (file, handle) <- openTempFile "/tmp" "graphScaled.pdf" hClose handle f <- parse alexNetSmall & visualizeWith (scaled downscaleReLU) & pdf file _ <- system $ printf "open %s &" f return () where downscaleReLU lp = go (layerTy lp) where go ReLU = 1 go _ = 2 main :: IO () main = do torch caffe visualizeGoogLeNetScaled
sjfloat/dnngraph
NN/Examples/Demo.hs
bsd-3-clause
2,210
0
18
675
762
375
387
-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="ru-RU"> <title>Все включено в одно примечание</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/allinonenotes/src/main/javahelp/org/zaproxy/zap/extension/allinonenotes/resources/help_ru_RU/helpset_ru_RU.hs
apache-2.0
1,034
77
66
160
511
256
255
-1
-1
{-# Language PolyKinds #-} {-# Language TypeFamilies #-} {-# Language KindSignatures #-} {-# Language DataKinds #-} {-# Language MultiParamTypeClasses #-} module T15764a where import Data.Kind import Data.Proxy import GHC.TypeLits class C6 (k :: Type) (a :: k) (b :: Proxy (a :: k)) where type T6 (proxy :: Proxy '(k, (b :: Proxy a)))
sdiehl/ghc
testsuite/tests/indexed-types/should_compile/T15764a.hs
bsd-3-clause
339
0
13
58
94
58
36
-1
-1
{-# LANGUAGE DeriveGeneric #-} module T9630 where import T9630a import GHC.Generics import Control.Applicative data T = T () () () () ()()()()()()() ()()()()()()()()()()()()()()()() ()()()()()()()()()()()()()()()() ()()()()()()()()()()()()()()()() ()()()()()()()()()()()()()()()() ()()()()()()()()()()()()()()()() ()()()()()()()()()()()()()()()() ()()()()()()()()()()()()()()()() ()()()()()()()()()()()()()()()() deriving Generic instance Serialize T where get = to <$> gGet put = gPut . from
sdiehl/ghc
testsuite/tests/perf/compiler/T9630.hs
bsd-3-clause
591
0
7
144
610
310
300
19
0
{-# LANGUAGE BangPatterns, MagicHash, UnboxedTuples #-} {-# OPTIONS_GHC -O #-} -- We always optimise this, otherwise performance of a non-optimised -- compiler is severely affected -- ----------------------------------------------------------------------------- -- -- (c) The University of Glasgow, 1997-2006 -- -- Character encodings -- -- ----------------------------------------------------------------------------- module Encoding ( -- * UTF-8 utf8DecodeChar#, utf8PrevChar, utf8CharStart, utf8DecodeChar, utf8DecodeString, utf8EncodeChar, utf8EncodeString, utf8EncodedLength, countUTF8Chars, -- * Z-encoding zEncodeString, zDecodeString, -- * Base62-encoding toBase62, toBase62Padded ) where import Foreign import Data.Char import qualified Data.Char as Char import Numeric import GHC.Exts -- ----------------------------------------------------------------------------- -- UTF-8 -- We can't write the decoder as efficiently as we'd like without -- resorting to unboxed extensions, unfortunately. I tried to write -- an IO version of this function, but GHC can't eliminate boxed -- results from an IO-returning function. -- -- We assume we can ignore overflow when parsing a multibyte character here. -- To make this safe, we add extra sentinel bytes to unparsed UTF-8 sequences -- before decoding them (see StringBuffer.hs). {-# INLINE utf8DecodeChar# #-} utf8DecodeChar# :: Addr# -> (# Char#, Int# #) utf8DecodeChar# a# = let !ch0 = word2Int# (indexWord8OffAddr# a# 0#) in case () of _ | isTrue# (ch0 <=# 0x7F#) -> (# chr# ch0, 1# #) | isTrue# ((ch0 >=# 0xC0#) `andI#` (ch0 <=# 0xDF#)) -> let !ch1 = word2Int# (indexWord8OffAddr# a# 1#) in if isTrue# ((ch1 <# 0x80#) `orI#` (ch1 >=# 0xC0#)) then fail 1# else (# chr# (((ch0 -# 0xC0#) `uncheckedIShiftL#` 6#) +# (ch1 -# 0x80#)), 2# #) | isTrue# ((ch0 >=# 0xE0#) `andI#` (ch0 <=# 0xEF#)) -> let !ch1 = word2Int# (indexWord8OffAddr# a# 1#) in if isTrue# ((ch1 <# 0x80#) `orI#` (ch1 >=# 0xC0#)) then fail 1# else let !ch2 = word2Int# (indexWord8OffAddr# a# 2#) in if isTrue# ((ch2 <# 0x80#) `orI#` (ch2 >=# 0xC0#)) then fail 2# else (# chr# (((ch0 -# 0xE0#) `uncheckedIShiftL#` 12#) +# ((ch1 -# 0x80#) `uncheckedIShiftL#` 6#) +# (ch2 -# 0x80#)), 3# #) | isTrue# ((ch0 >=# 0xF0#) `andI#` (ch0 <=# 0xF8#)) -> let !ch1 = word2Int# (indexWord8OffAddr# a# 1#) in if isTrue# ((ch1 <# 0x80#) `orI#` (ch1 >=# 0xC0#)) then fail 1# else let !ch2 = word2Int# (indexWord8OffAddr# a# 2#) in if isTrue# ((ch2 <# 0x80#) `orI#` (ch2 >=# 0xC0#)) then fail 2# else let !ch3 = word2Int# (indexWord8OffAddr# a# 3#) in if isTrue# ((ch3 <# 0x80#) `orI#` (ch3 >=# 0xC0#)) then fail 3# else (# chr# (((ch0 -# 0xF0#) `uncheckedIShiftL#` 18#) +# ((ch1 -# 0x80#) `uncheckedIShiftL#` 12#) +# ((ch2 -# 0x80#) `uncheckedIShiftL#` 6#) +# (ch3 -# 0x80#)), 4# #) | otherwise -> fail 1# where -- all invalid sequences end up here: fail :: Int# -> (# Char#, Int# #) fail nBytes# = (# '\0'#, nBytes# #) -- '\xFFFD' would be the usual replacement character, but -- that's a valid symbol in Haskell, so will result in a -- confusing parse error later on. Instead we use '\0' which -- will signal a lexer error immediately. utf8DecodeChar :: Ptr Word8 -> (Char, Int) utf8DecodeChar (Ptr a#) = case utf8DecodeChar# a# of (# c#, nBytes# #) -> ( C# c#, I# nBytes# ) -- UTF-8 is cleverly designed so that we can always figure out where -- the start of the current character is, given any position in a -- stream. This function finds the start of the previous character, -- assuming there *is* a previous character. utf8PrevChar :: Ptr Word8 -> IO (Ptr Word8) utf8PrevChar p = utf8CharStart (p `plusPtr` (-1)) utf8CharStart :: Ptr Word8 -> IO (Ptr Word8) utf8CharStart p = go p where go p = do w <- peek p if w >= 0x80 && w < 0xC0 then go (p `plusPtr` (-1)) else return p utf8DecodeString :: Ptr Word8 -> Int -> IO [Char] utf8DecodeString ptr len = unpack ptr where !end = ptr `plusPtr` len unpack p | p >= end = return [] | otherwise = case utf8DecodeChar# (unPtr p) of (# c#, nBytes# #) -> do chs <- unpack (p `plusPtr#` nBytes#) return (C# c# : chs) countUTF8Chars :: Ptr Word8 -> Int -> IO Int countUTF8Chars ptr len = go ptr 0 where !end = ptr `plusPtr` len go p !n | p >= end = return n | otherwise = do case utf8DecodeChar# (unPtr p) of (# _, nBytes# #) -> go (p `plusPtr#` nBytes#) (n+1) unPtr :: Ptr a -> Addr# unPtr (Ptr a) = a plusPtr# :: Ptr a -> Int# -> Ptr a plusPtr# ptr nBytes# = ptr `plusPtr` (I# nBytes#) utf8EncodeChar :: Char -> Ptr Word8 -> IO (Ptr Word8) utf8EncodeChar c ptr = let x = ord c in case () of _ | x > 0 && x <= 0x007f -> do poke ptr (fromIntegral x) return (ptr `plusPtr` 1) -- NB. '\0' is encoded as '\xC0\x80', not '\0'. This is so that we -- can have 0-terminated UTF-8 strings (see GHC.Base.unpackCStringUtf8). | x <= 0x07ff -> do poke ptr (fromIntegral (0xC0 .|. ((x `shiftR` 6) .&. 0x1F))) pokeElemOff ptr 1 (fromIntegral (0x80 .|. (x .&. 0x3F))) return (ptr `plusPtr` 2) | x <= 0xffff -> do poke ptr (fromIntegral (0xE0 .|. (x `shiftR` 12) .&. 0x0F)) pokeElemOff ptr 1 (fromIntegral (0x80 .|. (x `shiftR` 6) .&. 0x3F)) pokeElemOff ptr 2 (fromIntegral (0x80 .|. (x .&. 0x3F))) return (ptr `plusPtr` 3) | otherwise -> do poke ptr (fromIntegral (0xF0 .|. (x `shiftR` 18))) pokeElemOff ptr 1 (fromIntegral (0x80 .|. ((x `shiftR` 12) .&. 0x3F))) pokeElemOff ptr 2 (fromIntegral (0x80 .|. ((x `shiftR` 6) .&. 0x3F))) pokeElemOff ptr 3 (fromIntegral (0x80 .|. (x .&. 0x3F))) return (ptr `plusPtr` 4) utf8EncodeString :: Ptr Word8 -> String -> IO () utf8EncodeString ptr str = go ptr str where go !_ [] = return () go ptr (c:cs) = do ptr' <- utf8EncodeChar c ptr go ptr' cs utf8EncodedLength :: String -> Int utf8EncodedLength str = go 0 str where go !n [] = n go n (c:cs) | ord c > 0 && ord c <= 0x007f = go (n+1) cs | ord c <= 0x07ff = go (n+2) cs | ord c <= 0xffff = go (n+3) cs | otherwise = go (n+4) cs -- ----------------------------------------------------------------------------- -- The Z-encoding {- This is the main name-encoding and decoding function. It encodes any string into a string that is acceptable as a C name. This is done right before we emit a symbol name into the compiled C or asm code. Z-encoding of strings is cached in the FastString interface, so we never encode the same string more than once. The basic encoding scheme is this. * Tuples (,,,) are coded as Z3T * Alphabetic characters (upper and lower) and digits all translate to themselves; except 'Z', which translates to 'ZZ' and 'z', which translates to 'zz' We need both so that we can preserve the variable/tycon distinction * Most other printable characters translate to 'zx' or 'Zx' for some alphabetic character x * The others translate as 'znnnU' where 'nnn' is the decimal number of the character Before After -------------------------- Trak Trak foo_wib foozuwib > zg >1 zg1 foo# foozh foo## foozhzh foo##1 foozhzh1 fooZ fooZZ :+ ZCzp () Z0T 0-tuple (,,,,) Z5T 5-tuple (# #) Z1H unboxed 1-tuple (note the space) (#,,,,#) Z5H unboxed 5-tuple (NB: There is no Z1T nor Z0H.) -} type UserString = String -- As the user typed it type EncodedString = String -- Encoded form zEncodeString :: UserString -> EncodedString zEncodeString cs = case maybe_tuple cs of Just n -> n -- Tuples go to Z2T etc Nothing -> go cs where go [] = [] go (c:cs) = encode_digit_ch c ++ go' cs go' [] = [] go' (c:cs) = encode_ch c ++ go' cs unencodedChar :: Char -> Bool -- True for chars that don't need encoding unencodedChar 'Z' = False unencodedChar 'z' = False unencodedChar c = c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' -- If a digit is at the start of a symbol then we need to encode it. -- Otherwise package names like 9pH-0.1 give linker errors. encode_digit_ch :: Char -> EncodedString encode_digit_ch c | c >= '0' && c <= '9' = encode_as_unicode_char c encode_digit_ch c | otherwise = encode_ch c encode_ch :: Char -> EncodedString encode_ch c | unencodedChar c = [c] -- Common case first -- Constructors encode_ch '(' = "ZL" -- Needed for things like (,), and (->) encode_ch ')' = "ZR" -- For symmetry with ( encode_ch '[' = "ZM" encode_ch ']' = "ZN" encode_ch ':' = "ZC" encode_ch 'Z' = "ZZ" -- Variables encode_ch 'z' = "zz" encode_ch '&' = "za" encode_ch '|' = "zb" encode_ch '^' = "zc" encode_ch '$' = "zd" encode_ch '=' = "ze" encode_ch '>' = "zg" encode_ch '#' = "zh" encode_ch '.' = "zi" encode_ch '<' = "zl" encode_ch '-' = "zm" encode_ch '!' = "zn" encode_ch '+' = "zp" encode_ch '\'' = "zq" encode_ch '\\' = "zr" encode_ch '/' = "zs" encode_ch '*' = "zt" encode_ch '_' = "zu" encode_ch '%' = "zv" encode_ch c = encode_as_unicode_char c encode_as_unicode_char :: Char -> EncodedString encode_as_unicode_char c = 'z' : if isDigit (head hex_str) then hex_str else '0':hex_str where hex_str = showHex (ord c) "U" -- ToDo: we could improve the encoding here in various ways. -- eg. strings of unicode characters come out as 'z1234Uz5678U', we -- could remove the 'U' in the middle (the 'z' works as a separator). zDecodeString :: EncodedString -> UserString zDecodeString [] = [] zDecodeString ('Z' : d : rest) | isDigit d = decode_tuple d rest | otherwise = decode_upper d : zDecodeString rest zDecodeString ('z' : d : rest) | isDigit d = decode_num_esc d rest | otherwise = decode_lower d : zDecodeString rest zDecodeString (c : rest) = c : zDecodeString rest decode_upper, decode_lower :: Char -> Char decode_upper 'L' = '(' decode_upper 'R' = ')' decode_upper 'M' = '[' decode_upper 'N' = ']' decode_upper 'C' = ':' decode_upper 'Z' = 'Z' decode_upper ch = {-pprTrace "decode_upper" (char ch)-} ch decode_lower 'z' = 'z' decode_lower 'a' = '&' decode_lower 'b' = '|' decode_lower 'c' = '^' decode_lower 'd' = '$' decode_lower 'e' = '=' decode_lower 'g' = '>' decode_lower 'h' = '#' decode_lower 'i' = '.' decode_lower 'l' = '<' decode_lower 'm' = '-' decode_lower 'n' = '!' decode_lower 'p' = '+' decode_lower 'q' = '\'' decode_lower 'r' = '\\' decode_lower 's' = '/' decode_lower 't' = '*' decode_lower 'u' = '_' decode_lower 'v' = '%' decode_lower ch = {-pprTrace "decode_lower" (char ch)-} ch -- Characters not having a specific code are coded as z224U (in hex) decode_num_esc :: Char -> EncodedString -> UserString decode_num_esc d rest = go (digitToInt d) rest where go n (c : rest) | isHexDigit c = go (16*n + digitToInt c) rest go n ('U' : rest) = chr n : zDecodeString rest go n other = error ("decode_num_esc: " ++ show n ++ ' ':other) decode_tuple :: Char -> EncodedString -> UserString decode_tuple d rest = go (digitToInt d) rest where -- NB. recurse back to zDecodeString after decoding the tuple, because -- the tuple might be embedded in a longer name. go n (c : rest) | isDigit c = go (10*n + digitToInt c) rest go 0 ('T':rest) = "()" ++ zDecodeString rest go n ('T':rest) = '(' : replicate (n-1) ',' ++ ")" ++ zDecodeString rest go 1 ('H':rest) = "(# #)" ++ zDecodeString rest go n ('H':rest) = '(' : '#' : replicate (n-1) ',' ++ "#)" ++ zDecodeString rest go n other = error ("decode_tuple: " ++ show n ++ ' ':other) {- Tuples are encoded as Z3T or Z3H for 3-tuples or unboxed 3-tuples respectively. No other encoding starts Z<digit> * "(# #)" is the tycon for an unboxed 1-tuple (not 0-tuple) There are no unboxed 0-tuples. * "()" is the tycon for a boxed 0-tuple. There are no boxed 1-tuples. -} maybe_tuple :: UserString -> Maybe EncodedString maybe_tuple "(# #)" = Just("Z1H") maybe_tuple ('(' : '#' : cs) = case count_commas (0::Int) cs of (n, '#' : ')' : _) -> Just ('Z' : shows (n+1) "H") _ -> Nothing maybe_tuple "()" = Just("Z0T") maybe_tuple ('(' : cs) = case count_commas (0::Int) cs of (n, ')' : _) -> Just ('Z' : shows (n+1) "T") _ -> Nothing maybe_tuple _ = Nothing count_commas :: Int -> String -> (Int, String) count_commas n (',' : cs) = count_commas (n+1) cs count_commas n cs = (n,cs) {- ************************************************************************ * * Base 62 * * ************************************************************************ Note [Base 62 encoding 128-bit integers] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Instead of base-62 encoding a single 128-bit integer (ceil(21.49) characters), we'll base-62 a pair of 64-bit integers (2 * ceil(10.75) characters). Luckily for us, it's the same number of characters! -} -------------------------------------------------------------------------- -- Base 62 -- The base-62 code is based off of 'locators' -- ((c) Operational Dynamics Consulting, BSD3 licensed) -- | Size of a 64-bit word when written as a base-62 string word64Base62Len :: Int word64Base62Len = 11 -- | Converts a 64-bit word into a base-62 string toBase62Padded :: Word64 -> String toBase62Padded w = pad ++ str where pad = replicate len '0' len = word64Base62Len - length str -- 11 == ceil(64 / lg 62) str = toBase62 w toBase62 :: Word64 -> String toBase62 w = showIntAtBase 62 represent w "" where represent :: Int -> Char represent x | x < 10 = Char.chr (48 + x) | x < 36 = Char.chr (65 + x - 10) | x < 62 = Char.chr (97 + x - 36) | otherwise = error "represent (base 62): impossible!"
siddhanathan/ghc
compiler/utils/Encoding.hs
bsd-3-clause
15,226
0
29
4,471
3,993
2,052
1,941
258
7
module T7869 where f = (\x -> f x) :: [a] -> b
wxwxwwxxx/ghc
testsuite/tests/typecheck/should_fail/T7869.hs
bsd-3-clause
48
0
7
14
30
18
12
2
1
module Shaker.HsHelper where import Control.Arrow import Data.List import Data.Maybe import Language.Haskell.Parser import Language.Haskell.Syntax import Shaker.Io import Shaker.Type parseHsFiles :: [FileListenInfo] -> IO [HsModule] parseHsFiles fliListenInfos = do files <- recurseMultipleListFiles fliListenInfos parseResults <- mapM parseFileToHsModule files return $ catMaybes parseResults parseFileToHsModule :: FilePath -> IO (Maybe HsModule) parseFileToHsModule fp = readFile fp >>= (parseModuleWithMode defaultParseMode { parseFilename = fp } >>> extractValue >>> return ) where extractValue parseResults = case parseResults of ParseOk val -> Just val _ -> Nothing hsModuleCollectProperties :: HsModule -> [String] hsModuleCollectProperties = getListFunction >>> filter (isPrefixOf "prop_") abstractCollectFunctionWithUnqualifiedType :: (HsQualType -> Bool) -> HsModule -> [String] abstractCollectFunctionWithUnqualifiedType fun = getTupleFunctionNameType >>> filterSnd fun >>> map fst filterSnd :: (b -> Bool) -> [(a,b)] -> [(a,b)] filterSnd fun = filter (snd >>> fun) mapSnd :: ( t1 -> t2 ) -> [ ( t, t1 ) ] -> [ ( t , t2 ) ] mapSnd fun = map ( second fun ) getListFunction :: HsModule -> [String] getListFunction = getDecls >>> mapMaybe getFunBindName getTupleFunctionNameType :: HsModule -> [(String, HsQualType)] getTupleFunctionNameType = getDecls >>> mapMaybe getSignature getSignature :: HsDecl -> Maybe (String, HsQualType) getSignature (HsTypeSig _ hsNames hsQualType) = Just (head >>> getIdentFromHsName $ hsNames, hsQualType) getSignature _ = Nothing getFunBindName :: HsDecl -> Maybe String getFunBindName (HsPatBind _ (HsPVar (HsIdent funName))_ _) = Just funName getFunBindName (HsFunBind (HsMatch _ (HsIdent funName) _ _ _ :_) ) = Just funName getFunBindName _ = Nothing getIdentFromHsName :: HsName -> String getIdentFromHsName (HsIdent v) = v getIdentFromHsName _ = "" getDecls :: HsModule -> [HsDecl] getDecls (HsModule _ _ _ _ decls) = decls hsModuleFileName :: HsModule -> String hsModuleFileName (HsModule loc _ _ _ _) = srcFilename loc hsModuleName :: HsModule -> String hsModuleName (HsModule _ (Module moduleName) _ _ _) = moduleName
bonnefoa/Shaker
src/Shaker/HsHelper.hs
isc
2,288
0
12
417
721
378
343
52
2
module Handler.RecentContentFeed where import Import getRecentContentFeedR :: Handler TypedContent getRecentContentFeedR = do recents <- getRecents 10 0 updated <- case recents of [] -> notFound (_, x):_ -> return $ hcWhen x newsFeed Feed { feedTitle = "Published Content- School of Haskell" , feedLinkSelf = RecentContentFeedR , feedLinkHome = HomeR , feedAuthor = "FP Complete" , feedDescription = "Recently published tutorials from the School of Haskell" , feedLanguage = "en" , feedUpdated = updated , feedEntries = map recentToEntry recents }
fpco/schoolofhaskell.com
src/Handler/RecentContentFeed.hs
mit
666
0
12
199
137
76
61
18
2
module Demi.StdLib where import qualified Data.Map.Strict as Map import qualified Data.Char as Char import Demi.Parser capitalized :: String -> String capitalized (head:tail) = Char.toUpper head : map Char.toLower tail capitalized [] = [] joinByCommas :: [String] -> String joinByCommas [] = "" joinByCommas [x] = x joinByCommas (x:xs) = x ++ ", " ++ (joinByCommas xs) printFn :: VarMap -> [VariableValue] -> IO VarMap printFn vars [(IntVar value)] = do print value return vars printFn vars [(DblVar value)] = do print value return vars printFn vars [(BoolVar value)] = do print value return vars printFn vars [(StrVar value)] = do putStrLn value return vars printFn vars [(FnVar params _ _)] = do putStrLn $ "function ("++(joinByCommas params)++") {...}" return vars printFn vars params = do print params return vars readFn :: VarMap -> [VariableValue] -> IO VarMap readFn vars [(StrVar "int")] = do line <- getLine return $ Map.insert "return" (IntVar $ read line) vars readFn vars [(StrVar "float")] = do line <- getLine return $ Map.insert "return" (DblVar $ read line) vars readFn vars [(StrVar "bool")] = do line <- getLine return $ Map.insert "return" (BoolVar $ read $ capitalized line) vars readFn vars [(StrVar "str")] = do line <- getLine return $ Map.insert "return" (StrVar line) vars readFn vars _ = fail "Unreadable type" libOf :: [String] -> (VarMap -> [VariableValue] -> IO VarMap) -> VariableValue libOf params fn = FnVar params Map.empty (Left $ Fn fn) stdlib = Map.fromList [("print", libOf ["output"] printFn) ,("read", libOf ["type"] readFn)]
oakfang/DemiLang
src/Demi/StdLib.hs
mit
1,705
0
11
390
703
351
352
48
1