# HG changeset patch # User wenzelm # Date 1611840037 -3600 # Node ID d300574cee4e111d7451d091e0cce5797a9d6179 # Parent a9eaf8c3b728a065df0538b6793e032dee662d11 more robust type signatures, notably for the sake of haskell-stack-trace-plugin-0.1.1.1; diff -r a9eaf8c3b728 -r d300574cee4e src/Tools/Haskell/Haskell.thy --- a/src/Tools/Haskell/Haskell.thy Wed Jan 27 14:56:40 2021 +0100 +++ b/src/Tools/Haskell/Haskell.thy Thu Jan 28 14:20:37 2021 +0100 @@ -377,8 +377,11 @@ properties more_props (elem, props) = (elem, fold_rev Properties.put more_props props) -markup_elem name = (name, (name, []) :: T) -markup_string name prop = (name, \s -> (name, [(prop, s)]) :: T) +markup_elem :: String -> T +markup_elem name = (name, []) + +markup_string :: String -> String -> String -> T +markup_string name prop = \s -> (name, [(prop, s)]) {- misc properties -} @@ -401,11 +404,14 @@ {- formal entities -} -bindingN :: String; binding :: T -(bindingN, binding) = markup_elem \Markup.bindingN\ - -entityN :: String; entity :: String -> String -> T +bindingN :: String +bindingN = \Markup.bindingN\ +binding :: T +binding = markup_elem bindingN + +entityN :: String entityN = \Markup.entityN\ +entity :: String -> String -> T entity kind name = (entityN, (if null name then [] else [(nameN, name)]) ++ (if null kind then [] else [(kindN, kind)])) @@ -419,11 +425,15 @@ {- completion -} -completionN :: String; completion :: T -(completionN, completion) = markup_elem \Markup.completionN\ - -no_completionN :: String; no_completion :: T -(no_completionN, no_completion) = markup_elem \Markup.no_completionN\ +completionN :: String +completionN = \Markup.completionN\ +completion :: T +completion = markup_elem completionN + +no_completionN :: String +no_completionN = \Markup.no_completionN\ +no_completion :: T +no_completion = markup_elem no_completionN {- position -} @@ -440,8 +450,10 @@ fileN = \Markup.fileN\ idN = \Markup.idN\ -positionN :: String; position :: T -(positionN, position) = markup_elem \Markup.positionN\ +positionN :: String +positionN = \Markup.positionN\ +position :: T +position = markup_elem positionN {- expression -} @@ -455,29 +467,37 @@ {- citation -} -citationN :: String; citation :: String -> T -(citationN, citation) = markup_string \Markup.citationN\ nameN +citationN :: String +citationN = \Markup.citationN\ +citation :: String -> T +citation = markup_string nameN citationN {- external resources -} -pathN :: String; path :: String -> T -(pathN, path) = markup_string \Markup.pathN\ nameN - -urlN :: String; url :: String -> T -(urlN, url) = markup_string \Markup.urlN\ nameN - -docN :: String; doc :: String -> T -(docN, doc) = markup_string \Markup.docN\ nameN +pathN :: String +pathN = \Markup.pathN\ +path :: String -> T +path = markup_string pathN nameN + +urlN :: String +urlN = \Markup.urlN\ +url :: String -> T +url = markup_string urlN nameN + +docN :: String +docN = \Markup.docN\ +doc :: String -> T +doc = markup_string docN nameN {- pretty printing -} markupN, consistentN, unbreakableN, indentN :: String -markupN = \Markup.markupN\; -consistentN = \Markup.consistentN\; -unbreakableN = \Markup.unbreakableN\; -indentN = \Markup.indentN\; +markupN = \Markup.markupN\ +consistentN = \Markup.consistentN\ +unbreakableN = \Markup.unbreakableN\ +indentN = \Markup.indentN\ widthN :: String widthN = \Markup.widthN\ @@ -498,183 +518,285 @@ (if w /= 0 then [(widthN, Value.print_int w)] else []) ++ (if i /= 0 then [(indentN, Value.print_int i)] else [])) -fbreakN :: String; fbreak :: T -(fbreakN, fbreak) = markup_elem \Markup.fbreakN\ - -itemN :: String; item :: T -(itemN, item) = markup_elem \Markup.itemN\ +fbreakN :: String +fbreakN = \Markup.fbreakN\ +fbreak :: T +fbreak = markup_elem fbreakN + +itemN :: String +itemN = \Markup.itemN\ +item :: T +item = markup_elem itemN {- text properties -} -wordsN :: String; words :: T -(wordsN, words) = markup_elem \Markup.wordsN\ +wordsN :: String +wordsN = \Markup.wordsN\ +words :: T +words = markup_elem wordsN {- inner syntax -} -tfreeN :: String; tfree :: T -(tfreeN, tfree) = markup_elem \Markup.tfreeN\ - -tvarN :: String; tvar :: T -(tvarN, tvar) = markup_elem \Markup.tvarN\ - -freeN :: String; free :: T -(freeN, free) = markup_elem \Markup.freeN\ - -skolemN :: String; skolem :: T -(skolemN, skolem) = markup_elem \Markup.skolemN\ - -boundN :: String; bound :: T -(boundN, bound) = markup_elem \Markup.boundN\ - -varN :: String; var :: T -(varN, var) = markup_elem \Markup.varN\ - -numeralN :: String; numeral :: T -(numeralN, numeral) = markup_elem \Markup.numeralN\ - -literalN :: String; literal :: T -(literalN, literal) = markup_elem \Markup.literalN\ - -delimiterN :: String; delimiter :: T -(delimiterN, delimiter) = markup_elem \Markup.delimiterN\ - -inner_stringN :: String; inner_string :: T -(inner_stringN, inner_string) = markup_elem \Markup.inner_stringN\ - -inner_cartoucheN :: String; inner_cartouche :: T -(inner_cartoucheN, inner_cartouche) = markup_elem \Markup.inner_cartoucheN\ - - -token_rangeN :: String; token_range :: T -(token_rangeN, token_range) = markup_elem \Markup.token_rangeN\ - - -sortingN :: String; sorting :: T -(sortingN, sorting) = markup_elem \Markup.sortingN\ - -typingN :: String; typing :: T -(typingN, typing) = markup_elem \Markup.typingN\ - -class_parameterN :: String; class_parameter :: T -(class_parameterN, class_parameter) = markup_elem \Markup.class_parameterN\ +tfreeN :: String +tfreeN = \Markup.tfreeN\ +tfree :: T +tfree = markup_elem tfreeN + +tvarN :: String +tvarN = \Markup.tvarN\ +tvar :: T +tvar = markup_elem tvarN + +freeN :: String +freeN = \Markup.freeN\ +free :: T +free = markup_elem freeN + +skolemN :: String +skolemN = \Markup.skolemN\ +skolem :: T +skolem = markup_elem skolemN + +boundN :: String +boundN = \Markup.boundN\ +bound :: T +bound = markup_elem boundN + +varN :: String +varN = \Markup.varN\ +var :: T +var = markup_elem varN + +numeralN :: String +numeralN = \Markup.numeralN\ +numeral :: T +numeral = markup_elem numeralN + +literalN :: String +literalN = \Markup.literalN\ +literal :: T +literal = markup_elem literalN + +delimiterN :: String +delimiterN = \Markup.delimiterN\ +delimiter :: T +delimiter = markup_elem delimiterN + +inner_stringN :: String +inner_stringN = \Markup.inner_stringN\ +inner_string :: T +inner_string = markup_elem inner_stringN + +inner_cartoucheN :: String +inner_cartoucheN = \Markup.inner_cartoucheN\ +inner_cartouche :: T +inner_cartouche = markup_elem inner_cartoucheN + + +token_rangeN :: String +token_rangeN = \Markup.token_rangeN\ +token_range :: T +token_range = markup_elem token_rangeN + + +sortingN :: String +sortingN = \Markup.sortingN\ +sorting :: T +sorting = markup_elem sortingN + +typingN :: String +typingN = \Markup.typingN\ +typing :: T +typing = markup_elem typingN + +class_parameterN :: String +class_parameterN = \Markup.class_parameterN\ +class_parameter :: T +class_parameter = markup_elem class_parameterN {- antiquotations -} -antiquotedN :: String; antiquoted :: T -(antiquotedN, antiquoted) = markup_elem \Markup.antiquotedN\ - -antiquoteN :: String; antiquote :: T -(antiquoteN, antiquote) = markup_elem \Markup.antiquoteN\ +antiquotedN :: String +antiquotedN = \Markup.antiquotedN\ +antiquoted :: T +antiquoted = markup_elem antiquotedN + +antiquoteN :: String +antiquoteN = \Markup.antiquoteN\ +antiquote :: T +antiquote = markup_elem antiquoteN {- text structure -} -paragraphN :: String; paragraph :: T -(paragraphN, paragraph) = markup_elem \Markup.paragraphN\ - -text_foldN :: String; text_fold :: T -(text_foldN, text_fold) = markup_elem \Markup.text_foldN\ +paragraphN :: String +paragraphN = \Markup.paragraphN\ +paragraph :: T +paragraph = markup_elem paragraphN + +text_foldN :: String +text_foldN = \Markup.text_foldN\ +text_fold :: T +text_fold = markup_elem text_foldN {- outer syntax -} -keyword1N :: String; keyword1 :: T -(keyword1N, keyword1) = markup_elem \Markup.keyword1N\ - -keyword2N :: String; keyword2 :: T -(keyword2N, keyword2) = markup_elem \Markup.keyword2N\ - -keyword3N :: String; keyword3 :: T -(keyword3N, keyword3) = markup_elem \Markup.keyword3N\ - -quasi_keywordN :: String; quasi_keyword :: T -(quasi_keywordN, quasi_keyword) = markup_elem \Markup.quasi_keywordN\ - -improperN :: String; improper :: T -(improperN, improper) = markup_elem \Markup.improperN\ - -operatorN :: String; operator :: T -(operatorN, operator) = markup_elem \Markup.operatorN\ - -stringN :: String; string :: T -(stringN, string) = markup_elem \Markup.stringN\ - -alt_stringN :: String; alt_string :: T -(alt_stringN, alt_string) = markup_elem \Markup.alt_stringN\ - -verbatimN :: String; verbatim :: T -(verbatimN, verbatim) = markup_elem \Markup.verbatimN\ - -cartoucheN :: String; cartouche :: T -(cartoucheN, cartouche) = markup_elem \Markup.cartoucheN\ - -commentN :: String; comment :: T -(commentN, comment) = markup_elem \Markup.commentN\ +keyword1N :: String +keyword1N = \Markup.keyword1N\ +keyword1 :: T +keyword1 = markup_elem keyword1N + +keyword2N :: String +keyword2N = \Markup.keyword2N\ +keyword2 :: T +keyword2 = markup_elem keyword2N + +keyword3N :: String +keyword3N = \Markup.keyword3N\ +keyword3 :: T +keyword3 = markup_elem keyword3N + +quasi_keywordN :: String +quasi_keywordN = \Markup.quasi_keywordN\ +quasi_keyword :: T +quasi_keyword = markup_elem quasi_keywordN + +improperN :: String +improperN = \Markup.improperN\ +improper :: T +improper = markup_elem improperN + +operatorN :: String +operatorN = \Markup.operatorN\ +operator :: T +operator = markup_elem operatorN + +stringN :: String +stringN = \Markup.stringN\ +string :: T +string = markup_elem stringN + +alt_stringN :: String +alt_stringN = \Markup.alt_stringN\ +alt_string :: T +alt_string = markup_elem alt_stringN + +verbatimN :: String +verbatimN = \Markup.verbatimN\ +verbatim :: T +verbatim = markup_elem verbatimN + +cartoucheN :: String +cartoucheN = \Markup.cartoucheN\ +cartouche :: T +cartouche = markup_elem cartoucheN + +commentN :: String +commentN = \Markup.commentN\ +comment :: T +comment = markup_elem commentN {- comments -} -comment1N :: String; comment1 :: T -(comment1N, comment1) = markup_elem \Markup.comment1N\ - -comment2N :: String; comment2 :: T -(comment2N, comment2) = markup_elem \Markup.comment2N\ - -comment3N :: String; comment3 :: T -(comment3N, comment3) = markup_elem \Markup.comment3N\ +comment1N :: String +comment1N = \Markup.comment1N\ +comment1 :: T +comment1 = markup_elem comment1N + +comment2N :: String +comment2N = \Markup.comment2N\ +comment2 :: T +comment2 = markup_elem comment2N + +comment3N :: String +comment3N = \Markup.comment3N\ +comment3 :: T +comment3 = markup_elem comment3N {- command status -} forkedN, joinedN, runningN, finishedN, failedN, canceledN, initializedN, finalizedN, consolidatedN :: String +forkedN = \Markup.forkedN\ +joinedN = \Markup.joinedN\ +runningN = \Markup.runningN\ +finishedN = \Markup.finishedN\ +failedN = \Markup.failedN\ +canceledN = \Markup.canceledN\ +initializedN = \Markup.initializedN\ +finalizedN = \Markup.finalizedN\ +consolidatedN = \Markup.consolidatedN\ + forked, joined, running, finished, failed, canceled, initialized, finalized, consolidated :: T -(forkedN, forked) = markup_elem \Markup.forkedN\ -(joinedN, joined) = markup_elem \Markup.joinedN\ -(runningN, running) = markup_elem \Markup.runningN\ -(finishedN, finished) = markup_elem \Markup.finishedN\ -(failedN, failed) = markup_elem \Markup.failedN\ -(canceledN, canceled) = markup_elem \Markup.canceledN\ -(initializedN, initialized) = markup_elem \Markup.initializedN\ -(finalizedN, finalized) = markup_elem \Markup.finalizedN\ -(consolidatedN, consolidated) = markup_elem \Markup.consolidatedN\ +forked = markup_elem forkedN +joined = markup_elem joinedN +running = markup_elem runningN +finished = markup_elem finishedN +failed = markup_elem failedN +canceled = markup_elem canceledN +initialized = markup_elem initializedN +finalized = markup_elem finalizedN +consolidated = markup_elem consolidatedN {- messages -} -writelnN :: String; writeln :: T -(writelnN, writeln) = markup_elem \Markup.writelnN\ - -stateN :: String; state :: T -(stateN, state) = markup_elem \Markup.stateN\ - -informationN :: String; information :: T -(informationN, information) = markup_elem \Markup.informationN\ - -tracingN :: String; tracing :: T -(tracingN, tracing) = markup_elem \Markup.tracingN\ - -warningN :: String; warning :: T -(warningN, warning) = markup_elem \Markup.warningN\ - -legacyN :: String; legacy :: T -(legacyN, legacy) = markup_elem \Markup.legacyN\ - -errorN :: String; error :: T -(errorN, error) = markup_elem \Markup.errorN\ - -reportN :: String; report :: T -(reportN, report) = markup_elem \Markup.reportN\ - -no_reportN :: String; no_report :: T -(no_reportN, no_report) = markup_elem \Markup.no_reportN\ - -intensifyN :: String; intensify :: T -(intensifyN, intensify) = markup_elem \Markup.intensifyN\ +writelnN :: String +writelnN = \Markup.writelnN\ +writeln :: T +writeln = markup_elem writelnN + +stateN :: String +stateN = \Markup.stateN\ +state :: T +state = markup_elem stateN + +informationN :: String +informationN = \Markup.informationN\ +information :: T +information = markup_elem informationN + +tracingN :: String +tracingN = \Markup.tracingN\ +tracing :: T +tracing = markup_elem tracingN + +warningN :: String +warningN = \Markup.warningN\ +warning :: T +warning = markup_elem warningN + +legacyN :: String +legacyN = \Markup.legacyN\ +legacy :: T +legacy = markup_elem legacyN + +errorN :: String +errorN = \Markup.errorN\ +error :: T +error = markup_elem errorN + +reportN :: String +reportN = \Markup.reportN\ +report :: T +report = markup_elem reportN + +no_reportN :: String +no_reportN = \Markup.no_reportN\ +no_report :: T +no_report = markup_elem no_reportN + +intensifyN :: String +intensifyN = \Markup.intensifyN\ +intensify :: T +intensify = markup_elem intensifyN {- output -}