summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Data
AgeCommit message (Collapse)Author
2025-08-02define return in terms of pure, >> as *>, mappend as <>Inari Listenmaa
In preparation for deprecation, see https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/semigroup-monoid and https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/monad-of-no-return
2021-07-07Replace tabs for whitespace in source codeJohn J. Camilleri
2020-09-05Fix wrong indentAndreas Källberg
2020-09-05MonadFail: Make backwards-compatibleAndreas Källberg
2020-08-05Fix most build errorsAndreas Källberg
2020-08-05fix newer ghc: Don't try to be backwards compatibleAndreas Källberg
2020-08-05First attempt at fixing incompabilities with newer cabalAndreas Källberg
2019-09-20more dead codekrangelov
2019-09-20removed more dead codekrangelov
2019-09-20remove obsolete codekrangelov
2017-09-04eliminate modules PGF.Lexing, PGF.LexingAGreek. Make PGF.Utilities an ↵Krasimir Angelov
internal module in the runtime. These are not really part of the core runtime.
2015-12-01GF.Data.Str: change matchPrefix to agree with the GF book and the run-time ↵hallgren
system The matchPrefix function is used in str2strings and the partial evaluator to compute pre{...} tokens. But unlike the description in the GF book and the implementation in the run-time system, matchPrefix looked at the concatenation(!) of all following tokens and not just the next token when deciding how to compute a pre{...} token. This is a backwards incompatible change, but it is subtle and probably won't cause any problems. In particular, the example grammars are unaffected.
2015-12-01GF.Data.Str: unexport & comment out unused functionshallgren
2015-08-28Comment out some dead code found with -fwarn-unused-bindshallgren
Also fixed some warnings and tightened some imports
2015-08-26GF shell: change parse & linearize to obtain useful results from p|l and l|p ↵hallgren
in more cases These changes are inspired by the gf -cshell implementation of these commands. The output of the linearize command has been changed to remove superfluous blank lines and commas, and deliver the result as a list of strings instead of a single multi-line string. This makes it possible to use -all and pipe the results to the parse command. This also means that with -treebank -all, the language tag will be repeated for each result from the same language. The parse command, when trying to parse with more than one language, would "forget" other results after a failed parse, and thus not send all successful parses through the pipe. For example, if English is not the first language in the grammar, p "hello" | l would output nothing, instead of translations of "hello" to all languages, forcing the user to write p -lang=Eng "hello" | l instead, to get the expected result. The cause of this behaviour was in the function fromParse, which was rather messy, so I assume it is not intentional, but the result of a programming mistake at some point. The fromParse function has now been refactored from a big recursive function into fromParse opts = foldr (joinPiped . fromParse1 opts) void where the helper functions fromParse1 deals with a single parse result and joinPiped combines multiple parse results.
2015-08-13GF Shell: refactoring for improved modularity and reusability:hallgren
+ Generalize the CommandInfo type by parameterizing it on the monad instead of just the environment. + Generalize the commands defined in GF.Command.{Commands,Commands2,CommonCommands,SourceCommands,HelpCommand} to work in any monad that supports the needed operations. + Liberate GF.Command.Interpreter from the IO monad. Also, move the current PGF from CommandEnv to GFEnv in GF.Interactive, making the command interpreter even more generic. + Use a state monad to maintain the state of the interpreter in GF.{Interactive,Interactive2}.
2014-10-22Various small changes for improved documentationhallgren
2014-10-20Remove some dead codehallgren
* The following modules are no longer used and have been removed completely: GF.Compile.Compute.ConcreteLazy GF.Compile.Compute.ConcreteStrict GF.Compile.Refresh * The STM monad has been commented out. It was only used in GF.Compile.SubExpOpt, where could be replaced with a plain State monad, since no error handling was needed. One of the functions was hardwired to the Err monad, but did in fact not use error handling, so it was turned into a pure function. * The function errVal has been renamed to fromErr (since it is analogous to fromMaybe). * Replaced 'fail' with 'raise' and 'return ()' with 'done' in a few places. * Some additional old code that was already commented out has been removed.
2014-10-16More haddock documentation improvementshallgren
2014-08-13Fix warnings in 16 modules, mostly forward compatibility warnings from GHC 7.8hallgren
2014-04-28Spring cleaninghallgren
Nothing major...
2013-11-20Removed some code duplication in GF.Compile.Updatehallgren
2013-11-20Reduced clutter in monadic codehallgren
+ Eliminated vairous ad-hoc coersion functions between specific monads (IO, Err, IOE, Check) in favor of more general lifting functions (liftIO, liftErr). + Generalized many basic monadic operations from specific monads to arbitrary monads in the appropriate class (MonadIO and/or ErrorMonad), thereby completely eliminating the need for lifting functions in lots of places. This can be considered a small step forward towards a cleaner compiler API and more malleable compiler code in general.
2013-11-05Eliminate mutual dependencies between the GF compiler and the PGF libraryhallgren
+ References to modules under src/compiler have been eliminated from the PGF library (under src/runtime/haskell). Only two functions had to be moved (from GF.Data.Utilities to PGF.Utilities) to make this possible, other apparent dependencies turned out to be vacuous. + In gf.cabal, the GF executable no longer directly depends on the PGF library source directory, but only on the exposed library modules. This means that there is less duplication in gf.cabal and that the 30 modules in the PGF library will no longer be compiled twice while building GF. To make this possible, additional PGF library modules have been exposed, even though they should probably be considered for internal use only. They could be collected in a PGF.Internal module, or marked as "unstable", to make this explicit. + Also, by using the -fwarn-unused-imports flag, ~220 redundant imports were found and removed, reducing the total number of imports by ~15%.
2013-02-28Fix a bug that could cause "Prelude.head: empty list"hallgren
In Data.Operations, the function topoTest2 assumed too much about the form of the input, compared to the older function topoTest.
2012-11-07Some changed/new utility functionshallgren
GF.Data.Utilities: Rename mapFst to apFst, mapSnd to apSnd. Add apBoth, mapFst, mapSnd, mapBoth. GF.Data.Operations: Remove onSnd (same as apSnd)
2012-08-29Added an O(n log n) version of nubpeter.ljunglof
The new nub is called nub', and it replaces the old sortNub which was not lazy and did not retain the order between the elements.
2012-06-26Report many type errors instead of stopping after the first onehallgren
In GF.Compile.CheckGrammar, use a new topological sorting function that groups independent judgements, allowing them all to be checked before continuing or reporting errors.
2011-04-06avoid warning from ghc-7.0hallgren
Warning: -fglasgow-exts is deprecated: Use individual extensions instead
2010-12-08some more functions in GF.Data.TrieMapkrasimir
2010-07-15fix the algorithm for items cutting in the partial parserkrasimir
2010-07-01redesign the open-literals APIkrasimir
2010-04-24convert GF.Data.SortedList to UTF8krasimir
2010-04-19use the native unicode support from GHC 6.12krasimir
2009-12-14remove some more dead codekrasimir
2009-12-13reorganize the directories under src, and rescue the JavaScript interpreter ↵krasimir
from deprecated