diff --git a/.gitmodules b/.gitmodules index 75085f50f..ab0a3b52a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,9 +10,6 @@ [submodule "vendor/freer-cofreer"] path = vendor/freer-cofreer url = https://github.com/robrix/freer-cofreer.git -[submodule "vendor/grpc-haskell"] - path = vendor/grpc-haskell - url = https://github.com/joshvera/gRPC-haskell/ [submodule "vendor/fastsum"] path = vendor/fastsum url = git@github.com:patrickt/fastsum.git diff --git a/.licenses/semantic/cabal/QuickCheck.txt b/.licenses/semantic/cabal/QuickCheck.txt new file mode 100644 index 000000000..2b60b66a5 --- /dev/null +++ b/.licenses/semantic/cabal/QuickCheck.txt @@ -0,0 +1,37 @@ +--- +type: cabal +name: QuickCheck +version: 2.10.1 +summary: Automatic testing of Haskell programs +homepage: https://github.com/nick8325/quickcheck +license: bsd-3-clause +--- +(The following is the 3-clause BSD license.) + +Copyright (c) 2000-2017, Koen Claessen +Copyright (c) 2006-2008, Björn Bringert +Copyright (c) 2009-2017, Nick Smallbone + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +- Neither the names of the copyright owners nor the names of the + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/StateVar.txt b/.licenses/semantic/cabal/StateVar.txt new file mode 100644 index 000000000..d4a5831f7 --- /dev/null +++ b/.licenses/semantic/cabal/StateVar.txt @@ -0,0 +1,37 @@ +--- +type: cabal +name: StateVar +version: 1.1.1.0 +summary: State variables +homepage: https://github.com/haskell-opengl/StateVar +license: bsd-3-clause +--- +Copyright (c) 2014-2015, Edward Kmett +Copyright (c) 2009-2018, Sven Panne +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/adjunctions.txt b/.licenses/semantic/cabal/adjunctions.txt new file mode 100644 index 000000000..e14422245 --- /dev/null +++ b/.licenses/semantic/cabal/adjunctions.txt @@ -0,0 +1,34 @@ +--- +type: cabal +name: adjunctions +version: '4.4' +summary: Adjunctions and representable functors +homepage: https://github.com/ekmett/adjunctions/ +license: bsd-2-clause +--- +Copyright 2011-2014 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/aeson-pretty.txt b/.licenses/semantic/cabal/aeson-pretty.txt new file mode 100644 index 000000000..738e74ff3 --- /dev/null +++ b/.licenses/semantic/cabal/aeson-pretty.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: aeson-pretty +version: 0.8.7 +summary: JSON pretty-printing library and command-line tool. +homepage: https://github.com/informatikr/aeson-pretty +license: bsd-3-clause +--- +Copyright (c)2011, Falko Peters + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Falko Peters nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/aeson.txt b/.licenses/semantic/cabal/aeson.txt new file mode 100644 index 000000000..6037eeb26 --- /dev/null +++ b/.licenses/semantic/cabal/aeson.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: aeson +version: 1.3.1.1 +summary: Fast JSON parsing and encoding +homepage: https://github.com/bos/aeson +license: bsd-3-clause +--- +Copyright (c) 2011, MailRank, Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/algebraic-graphs.txt b/.licenses/semantic/cabal/algebraic-graphs.txt new file mode 100644 index 000000000..ea964a517 --- /dev/null +++ b/.licenses/semantic/cabal/algebraic-graphs.txt @@ -0,0 +1,29 @@ +--- +type: cabal +name: algebraic-graphs +version: 0.1.1.1 +summary: A library for algebraic graph construction and transformation +homepage: https://github.com/snowleopard/alga +license: mit +--- +MIT License + +Copyright (c) 2016-2018 Andrey Mokhov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.licenses/semantic/cabal/ansi-terminal.txt b/.licenses/semantic/cabal/ansi-terminal.txt new file mode 100644 index 000000000..e454763f9 --- /dev/null +++ b/.licenses/semantic/cabal/ansi-terminal.txt @@ -0,0 +1,30 @@ +--- +type: cabal +name: ansi-terminal +version: 0.8.0.4 +summary: Simple ANSI terminal support, with Windows compatibility +homepage: https://github.com/feuerbach/ansi-terminal +license: bsd-3-clause +--- +Copyright (c) 2008, Maximilian Bolingbroke +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted +provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of + conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. + * Neither the name of Maximilian Bolingbroke nor the names of other contributors may be used to + endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/.licenses/semantic/cabal/ansi-wl-pprint.txt b/.licenses/semantic/cabal/ansi-wl-pprint.txt new file mode 100644 index 000000000..6fbe9e30d --- /dev/null +++ b/.licenses/semantic/cabal/ansi-wl-pprint.txt @@ -0,0 +1,33 @@ +--- +type: cabal +name: ansi-wl-pprint +version: 0.6.8.2 +summary: The Wadler/Leijen Pretty Printer for colored ANSI terminal output +homepage: https://github.com/ekmett/ansi-wl-pprint +license: bsd-2-clause +--- +Copyright 2008, Daan Leijen and Max Bolingbroke. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +This software is provided by the copyright holders "as is" and any +express or implied warranties, including, but not limited to, the +implied warranties of merchantability and fitness for a particular +purpose are disclaimed. In no event shall the copyright holders be +liable for any direct, indirect, incidental, special, exemplary, or +consequential damages (including, but not limited to, procurement of +substitute goods or services; loss of use, data, or profits; or +business interruption) however caused and on any theory of liability, +whether in contract, strict liability, or tort (including negligence +or otherwise) arising in any way out of the use of this software, even +if advised of the possibility of such damage. diff --git a/.licenses/semantic/cabal/array.txt b/.licenses/semantic/cabal/array.txt new file mode 100644 index 000000000..5c2f45539 --- /dev/null +++ b/.licenses/semantic/cabal/array.txt @@ -0,0 +1,91 @@ +--- +type: cabal +name: array +version: 0.5.2.0 +summary: Mutable and immutable arrays +homepage: +license: bsd-3-clause +--- +This library (libraries/base) is derived from code from several +sources: + + * Code from the GHC project which is largely (c) The University of + Glasgow, and distributable under a BSD-style license (see below), + + * Code from the Haskell 98 Report which is (c) Simon Peyton Jones + and freely redistributable (but see the full license for + restrictions). + + * Code from the Haskell Foreign Function Interface specification, + which is (c) Manuel M. T. Chakravarty and freely redistributable + (but see the full license for restrictions). + +The full text of these licenses is reproduced below. All of the +licenses are BSD-style or compatible. + +----------------------------------------------------------------------------- + +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +----------------------------------------------------------------------------- + +Code derived from the document "Report on the Programming Language +Haskell 98", is distributed under the following license: + + Copyright (c) 2002 Simon Peyton Jones + + The authors intend this Report to belong to the entire Haskell + community, and so we grant permission to copy and distribute it for + any purpose, provided that it is reproduced in its entirety, + including this Notice. Modified versions of this Report may also be + copied and distributed for any purpose, provided that the modified + version is clearly presented as such, and that it does not claim to + be a definition of the Haskell 98 Language. + +----------------------------------------------------------------------------- + +Code derived from the document "The Haskell 98 Foreign Function +Interface, An Addendum to the Haskell 98 Report" is distributed under +the following license: + + Copyright (c) 2002 Manuel M. T. Chakravarty + + The authors intend this Report to belong to the entire Haskell + community, and so we grant permission to copy and distribute it for + any purpose, provided that it is reproduced in its entirety, + including this Notice. Modified versions of this Report may also be + copied and distributed for any purpose, provided that the modified + version is clearly presented as such, and that it does not claim to + be a definition of the Haskell 98 Foreign Function Interface. + +----------------------------------------------------------------------------- diff --git a/.licenses/semantic/cabal/asn1-encoding.txt b/.licenses/semantic/cabal/asn1-encoding.txt new file mode 100644 index 000000000..93405c9d7 --- /dev/null +++ b/.licenses/semantic/cabal/asn1-encoding.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: asn1-encoding +version: 0.9.5 +summary: ASN1 data reader and writer in RAW, BER and DER forms +homepage: https://github.com/vincenthz/hs-asn1 +license: bsd-3-clause +--- +Copyright (c) 2010-2013 Vincent Hanquez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/asn1-parse.txt b/.licenses/semantic/cabal/asn1-parse.txt new file mode 100644 index 000000000..17f7dd81e --- /dev/null +++ b/.licenses/semantic/cabal/asn1-parse.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: asn1-parse +version: 0.9.4 +summary: Simple monadic parser for ASN1 stream types. +homepage: https://github.com/vincenthz/hs-asn1 +license: bsd-3-clause +--- +Copyright (c) 2010-2013 Vincent Hanquez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/asn1-types.txt b/.licenses/semantic/cabal/asn1-types.txt new file mode 100644 index 000000000..f07aa14aa --- /dev/null +++ b/.licenses/semantic/cabal/asn1-types.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: asn1-types +version: 0.3.2 +summary: ASN.1 types +homepage: https://github.com/vincenthz/hs-asn1-types +license: bsd-3-clause +--- +Copyright (c) 2010-2013 Vincent Hanquez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/async.txt b/.licenses/semantic/cabal/async.txt new file mode 100644 index 000000000..00949ba94 --- /dev/null +++ b/.licenses/semantic/cabal/async.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: async +version: 2.1.1.1 +summary: Run IO operations asynchronously and wait for their results +homepage: https://github.com/simonmar/async +license: bsd-3-clause +--- +Copyright (c) 2012, Simon Marlow + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Simon Marlow nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/attoparsec.txt b/.licenses/semantic/cabal/attoparsec.txt new file mode 100644 index 000000000..7119910c1 --- /dev/null +++ b/.licenses/semantic/cabal/attoparsec.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: attoparsec +version: 0.13.2.2 +summary: Fast combinator parsing for bytestrings and text +homepage: https://github.com/bos/attoparsec +license: bsd-3-clause +--- +Copyright (c) Lennart Kolmodin + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/base-compat.txt b/.licenses/semantic/cabal/base-compat.txt new file mode 100644 index 000000000..0d7e3297d --- /dev/null +++ b/.licenses/semantic/cabal/base-compat.txt @@ -0,0 +1,27 @@ +--- +type: cabal +name: base-compat +version: 0.9.3 +summary: A compatibility layer for base +homepage: https://github.com/haskell-compat/base-compat +license: mit +--- +Copyright (c) 2012-2017 Simon Hengel and Ryan Scott + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/.licenses/semantic/cabal/base-orphans.txt b/.licenses/semantic/cabal/base-orphans.txt new file mode 100644 index 000000000..cdb0eca3f --- /dev/null +++ b/.licenses/semantic/cabal/base-orphans.txt @@ -0,0 +1,28 @@ +--- +type: cabal +name: base-orphans +version: '0.7' +summary: Backwards-compatible orphan instances for base +homepage: https://github.com/haskell-compat/base-orphans +license: mit +--- +Copyright (c) 2015-2017 Simon Hengel , João Cristóvão , Ryan Scott + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.licenses/semantic/cabal/base-prelude.txt b/.licenses/semantic/cabal/base-prelude.txt new file mode 100644 index 000000000..c95eb2e71 --- /dev/null +++ b/.licenses/semantic/cabal/base-prelude.txt @@ -0,0 +1,30 @@ +--- +type: cabal +name: base-prelude +version: 1.2.1 +summary: The most complete prelude formed solely from the "base" package +homepage: https://github.com/nikita-volkov/base-prelude +license: mit +--- +Copyright (c) 2014, Nikita Volkov + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/.licenses/semantic/cabal/base.txt b/.licenses/semantic/cabal/base.txt new file mode 100644 index 000000000..f635e3d4d --- /dev/null +++ b/.licenses/semantic/cabal/base.txt @@ -0,0 +1,91 @@ +--- +type: cabal +name: base +version: 4.10.1.0 +summary: Basic libraries +homepage: +license: bsd-3-clause +--- +This library (libraries/base) is derived from code from several +sources: + + * Code from the GHC project which is largely (c) The University of + Glasgow, and distributable under a BSD-style license (see below), + + * Code from the Haskell 98 Report which is (c) Simon Peyton Jones + and freely redistributable (but see the full license for + restrictions). + + * Code from the Haskell Foreign Function Interface specification, + which is (c) Manuel M. T. Chakravarty and freely redistributable + (but see the full license for restrictions). + +The full text of these licenses is reproduced below. All of the +licenses are BSD-style or compatible. + +----------------------------------------------------------------------------- + +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +----------------------------------------------------------------------------- + +Code derived from the document "Report on the Programming Language +Haskell 98", is distributed under the following license: + + Copyright (c) 2002 Simon Peyton Jones + + The authors intend this Report to belong to the entire Haskell + community, and so we grant permission to copy and distribute it for + any purpose, provided that it is reproduced in its entirety, + including this Notice. Modified versions of this Report may also be + copied and distributed for any purpose, provided that the modified + version is clearly presented as such, and that it does not claim to + be a definition of the Haskell 98 Language. + +----------------------------------------------------------------------------- + +Code derived from the document "The Haskell 98 Foreign Function +Interface, An Addendum to the Haskell 98 Report" is distributed under +the following license: + + Copyright (c) 2002 Manuel M. T. Chakravarty + + The authors intend this Report to belong to the entire Haskell + community, and so we grant permission to copy and distribute it for + any purpose, provided that it is reproduced in its entirety, + including this Notice. Modified versions of this Report may also be + copied and distributed for any purpose, provided that the modified + version is clearly presented as such, and that it does not claim to + be a definition of the Haskell 98 Foreign Function Interface. + +----------------------------------------------------------------------------- diff --git a/.licenses/semantic/cabal/base64-bytestring.txt b/.licenses/semantic/cabal/base64-bytestring.txt new file mode 100644 index 000000000..672b90a0f --- /dev/null +++ b/.licenses/semantic/cabal/base64-bytestring.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: base64-bytestring +version: 1.0.0.1 +summary: Fast base64 encoding and decoding for ByteStrings +homepage: https://github.com/bos/base64-bytestring +license: bsd-3-clause +--- +Copyright (c) 2010 Bryan O'Sullivan + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/basement.txt b/.licenses/semantic/cabal/basement.txt new file mode 100644 index 000000000..5acb74860 --- /dev/null +++ b/.licenses/semantic/cabal/basement.txt @@ -0,0 +1,36 @@ +--- +type: cabal +name: basement +version: 0.0.7 +summary: Foundation scrap box of array & string +homepage: https://github.com/haskell-foundation/foundation +license: bsd-3-clause +--- +Copyright (c) 2015-2017 Vincent Hanquez +Copyright (c) 2017 Foundation Maintainers + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/bifunctors.txt b/.licenses/semantic/cabal/bifunctors.txt new file mode 100644 index 000000000..86ab3841b --- /dev/null +++ b/.licenses/semantic/cabal/bifunctors.txt @@ -0,0 +1,34 @@ +--- +type: cabal +name: bifunctors +version: 5.5.2 +summary: Bifunctors +homepage: https://github.com/ekmett/bifunctors/ +license: bsd-2-clause +--- +Copyright 2008-2016 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/binary.txt b/.licenses/semantic/cabal/binary.txt new file mode 100644 index 000000000..8eaec18d3 --- /dev/null +++ b/.licenses/semantic/cabal/binary.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: binary +version: 0.8.5.1 +summary: Binary serialisation for Haskell values using lazy ByteStrings +homepage: https://github.com/kolmodin/binary +license: bsd-3-clause +--- +Copyright (c) Lennart Kolmodin + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/blaze-builder.txt b/.licenses/semantic/cabal/blaze-builder.txt new file mode 100644 index 000000000..a85772586 --- /dev/null +++ b/.licenses/semantic/cabal/blaze-builder.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: blaze-builder +version: 0.4.1.0 +summary: Efficient buffered output. +homepage: https://github.com/lpsmith/blaze-builder +license: bsd-3-clause +--- +Copyright Jasper Van der Jeugt 2010, Simon Meier 2010 & 2011 + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Jasper Van der Jeugt nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/byteable.txt b/.licenses/semantic/cabal/byteable.txt new file mode 100644 index 000000000..1853db32d --- /dev/null +++ b/.licenses/semantic/cabal/byteable.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: byteable +version: 0.1.1 +summary: Type class for sequence of bytes +homepage: https://github.com/vincenthz/hs-byteable +license: bsd-3-clause +--- +Copyright (c) 2013 Vincent Hanquez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/bytestring.txt b/.licenses/semantic/cabal/bytestring.txt new file mode 100644 index 000000000..acd938556 --- /dev/null +++ b/.licenses/semantic/cabal/bytestring.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: bytestring +version: 0.10.8.2 +summary: Fast, compact, strict and lazy byte strings with a list interface +homepage: https://github.com/haskell/bytestring +license: bsd-3-clause +--- +Copyright (c) Don Stewart 2005-2009 + (c) Duncan Coutts 2006-2015 + (c) David Roundy 2003-2005 + (c) Simon Meier 2010-2011 + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/call-stack.txt b/.licenses/semantic/cabal/call-stack.txt new file mode 100644 index 000000000..928ccd8b3 --- /dev/null +++ b/.licenses/semantic/cabal/call-stack.txt @@ -0,0 +1,27 @@ +--- +type: cabal +name: call-stack +version: 0.1.0 +summary: Use GHC call-stacks in a backward compatible way +homepage: https://github.com/sol/call-stack +license: mit +--- +Copyright (c) 2016 Simon Hengel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/.licenses/semantic/cabal/case-insensitive.txt b/.licenses/semantic/cabal/case-insensitive.txt new file mode 100644 index 000000000..c39b19161 --- /dev/null +++ b/.licenses/semantic/cabal/case-insensitive.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: case-insensitive +version: 1.2.0.11 +summary: Case insensitive string comparison +homepage: https://github.com/basvandijk/case-insensitive +license: bsd-3-clause +--- +Copyright (c) 2011-2013 Bas van Dijk + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * The name of Bas van Dijk and the names of contributors may NOT + be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/cereal.txt b/.licenses/semantic/cabal/cereal.txt new file mode 100644 index 000000000..b1ed9aed0 --- /dev/null +++ b/.licenses/semantic/cabal/cereal.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: cereal +version: 0.5.5.0 +summary: A binary serialization library +homepage: https://github.com/GaloisInc/cereal +license: bsd-3-clause +--- +Copyright (c) Lennart Kolmodin, Galois, Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/charset.txt b/.licenses/semantic/cabal/charset.txt new file mode 100644 index 000000000..10bc32886 --- /dev/null +++ b/.licenses/semantic/cabal/charset.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: charset +version: 0.3.7.1 +summary: Fast unicode character sets based on complemented PATRICIA tries +homepage: https://github.com/ekmett/charset +license: bsd-3-clause +--- +Copyright (c) 2010, Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Edward Kmett nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/clock.txt b/.licenses/semantic/cabal/clock.txt new file mode 100644 index 000000000..17bd704c5 --- /dev/null +++ b/.licenses/semantic/cabal/clock.txt @@ -0,0 +1,40 @@ +--- +type: cabal +name: clock +version: 0.7.2 +summary: 'High-resolution clock functions: monotonic, realtime, cputime.' +homepage: https://github.com/corsis/clock +license: bsd-3-clause +--- +Copyright (c) 2009-2012, Cetin Sert +Copyright (c) 2010, Eugene Kirpichov + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * The names of contributors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/cmark-gfm.txt b/.licenses/semantic/cabal/cmark-gfm.txt new file mode 100644 index 000000000..5fa19d73f --- /dev/null +++ b/.licenses/semantic/cabal/cmark-gfm.txt @@ -0,0 +1,144 @@ +--- +type: cabal +name: cmark-gfm +version: 0.1.3 +summary: Fast, accurate GitHub Flavored Markdown parser and renderer +homepage: https://github.com/kivikakk/cmark-gfm-hs +license: multiple +--- +Copyright (c) 2014, John MacFarlane + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of John MacFarlane nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---- +libcmark +Copyright (c) 2014, John MacFarlane + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---- + +houdini.h, houdini_href_e.c, houdini_html_e.c, houdini_html_u.c, +html_unescape.gperf, html_unescape.h + +derive from https://github.com/vmg/houdini (with some modifications) + +Copyright (C) 2012 Vicent Martí + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +----- + +buffer.h, buffer.c, chunk.h + +are derived from code (C) 2012 Github, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +----- + +utf8.c and utf8.c + +are derived from utf8proc +(), +(C) 2009 Public Software Group e. V., Berlin, Germany. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/.licenses/semantic/cabal/colour.txt b/.licenses/semantic/cabal/colour.txt new file mode 100644 index 000000000..eb222de11 --- /dev/null +++ b/.licenses/semantic/cabal/colour.txt @@ -0,0 +1,28 @@ +--- +type: cabal +name: colour +version: 2.3.4 +summary: A model for human colour/color perception +homepage: https://www.haskell.org/haskellwiki/Colour +license: mit +--- +Copyright (c) 2008, 2009 +Russell O'Connor + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/.licenses/semantic/cabal/comonad.txt b/.licenses/semantic/cabal/comonad.txt new file mode 100644 index 000000000..e446f16ce --- /dev/null +++ b/.licenses/semantic/cabal/comonad.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: comonad +version: 5.0.3 +summary: Comonads +homepage: https://github.com/ekmett/comonad/ +license: bsd-2-clause +--- +Copyright 2008-2014 Edward Kmett +Copyright 2004-2008 Dave Menendez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/connection.txt b/.licenses/semantic/cabal/connection.txt new file mode 100644 index 000000000..ca5508998 --- /dev/null +++ b/.licenses/semantic/cabal/connection.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: connection +version: 0.2.8 +summary: Simple and easy network connections API +homepage: https://github.com/vincenthz/hs-connection +license: bsd-3-clause +--- +Copyright (c) 2012 Vincent Hanquez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/containers.txt b/.licenses/semantic/cabal/containers.txt new file mode 100644 index 000000000..4d981dc8e --- /dev/null +++ b/.licenses/semantic/cabal/containers.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: containers +version: 0.5.10.2 +summary: Assorted concrete container types +homepage: https://github.com/haskell/containers +license: bsd-3-clause +--- +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/.licenses/semantic/cabal/contravariant.txt b/.licenses/semantic/cabal/contravariant.txt new file mode 100644 index 000000000..813537389 --- /dev/null +++ b/.licenses/semantic/cabal/contravariant.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: contravariant +version: 1.4.1 +summary: Contravariant functors +homepage: https://github.com/ekmett/contravariant/ +license: bsd-3-clause +--- +Copyright 2007-2015 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/cookie.txt b/.licenses/semantic/cabal/cookie.txt new file mode 100644 index 000000000..8b5b9fe65 --- /dev/null +++ b/.licenses/semantic/cabal/cookie.txt @@ -0,0 +1,28 @@ +--- +type: cabal +name: cookie +version: 0.4.4 +summary: HTTP cookie parsing and rendering +homepage: https://github.com/snoyberg/cookie +license: mit +--- +Copyright (c) 2010 Michael Snoyman, http://www.yesodweb.com/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.licenses/semantic/cabal/cryptohash.txt b/.licenses/semantic/cabal/cryptohash.txt new file mode 100644 index 000000000..7f355aff1 --- /dev/null +++ b/.licenses/semantic/cabal/cryptohash.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: cryptohash +version: 0.11.9 +summary: collection of crypto hashes, fast, pure and practical +homepage: https://github.com/vincenthz/hs-cryptohash +license: bsd-3-clause +--- +Copyright (c) 2010-2014 Vincent Hanquez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/cryptonite.txt b/.licenses/semantic/cabal/cryptonite.txt new file mode 100644 index 000000000..fdac59266 --- /dev/null +++ b/.licenses/semantic/cabal/cryptonite.txt @@ -0,0 +1,36 @@ +--- +type: cabal +name: cryptonite +version: '0.25' +summary: Cryptography Primitives sink +homepage: https://github.com/haskell-crypto/cryptonite +license: bsd-3-clause +--- +Copyright (c) 2006-2015 Vincent Hanquez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/data-default-class.txt b/.licenses/semantic/cabal/data-default-class.txt new file mode 100644 index 000000000..1a2ec61d2 --- /dev/null +++ b/.licenses/semantic/cabal/data-default-class.txt @@ -0,0 +1,34 @@ +--- +type: cabal +name: data-default-class +version: 0.1.2.0 +summary: A class for types with a default value +homepage: https://github.com/mauke/data-default +license: bsd-3-clause +--- +Copyright (c) 2013 Lukas Mai + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/deepseq-generics.txt b/.licenses/semantic/cabal/deepseq-generics.txt new file mode 100644 index 000000000..ed581f135 --- /dev/null +++ b/.licenses/semantic/cabal/deepseq-generics.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: deepseq-generics +version: 0.2.0.0 +summary: GHC.Generics-based Control.DeepSeq.rnf implementation +homepage: https://github.com/hvr/deepseq-generics +license: bsd-3-clause +--- +Copyright (c) 2012, Herbert Valerio Riedel + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Herbert Valerio Riedel nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/deepseq.txt b/.licenses/semantic/cabal/deepseq.txt new file mode 100644 index 000000000..6364c57f7 --- /dev/null +++ b/.licenses/semantic/cabal/deepseq.txt @@ -0,0 +1,47 @@ +--- +type: cabal +name: deepseq +version: 1.4.3.0 +summary: Deep evaluation of data structures +homepage: https://github.com/haskell/deepseq +license: bsd-3-clause +--- +This library (deepseq) is derived from code from the GHC project which +is largely (c) The University of Glasgow, and distributable under a +BSD-style license (see below). + +----------------------------------------------------------------------------- + +The Glasgow Haskell Compiler License + +Copyright 2001-2009, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +----------------------------------------------------------------------------- diff --git a/.licenses/semantic/cabal/directory-tree.txt b/.licenses/semantic/cabal/directory-tree.txt new file mode 100644 index 000000000..76863a67e --- /dev/null +++ b/.licenses/semantic/cabal/directory-tree.txt @@ -0,0 +1,34 @@ +--- +type: cabal +name: directory-tree +version: 0.12.1 +summary: A simple directory-like tree datatype, with useful IO functions +homepage: https://brandon.si/code/directory-tree-module-released/ +license: bsd-2-clause +--- +Copyright (c) 2009 Brandon Simmons + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/directory.txt b/.licenses/semantic/cabal/directory.txt new file mode 100644 index 000000000..1073a6c32 --- /dev/null +++ b/.licenses/semantic/cabal/directory.txt @@ -0,0 +1,71 @@ +--- +type: cabal +name: directory +version: 1.3.0.2 +summary: Platform-agnostic library for filesystem operations +homepage: https://github.com/haskell/directory +license: bsd-3-clause +--- +This library (libraries/base) is derived from code from two +sources: + + * Code from the GHC project which is largely (c) The University of + Glasgow, and distributable under a BSD-style license (see below), + + * Code from the Haskell 98 Report which is (c) Simon Peyton Jones + and freely redistributable (but see the full license for + restrictions). + +The full text of these licenses is reproduced below. Both of the +licenses are BSD-style or compatible. + +----------------------------------------------------------------------------- + +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +----------------------------------------------------------------------------- + +Code derived from the document "Report on the Programming Language +Haskell 98", is distributed under the following license: + + Copyright (c) 2002 Simon Peyton Jones + + The authors intend this Report to belong to the entire Haskell + community, and so we grant permission to copy and distribute it for + any purpose, provided that it is reproduced in its entirety, + including this Notice. Modified versions of this Report may also be + copied and distributed for any purpose, provided that the modified + version is clearly presented as such, and that it does not claim to + be a definition of the Haskell 98 Language. + +----------------------------------------------------------------------------- diff --git a/.licenses/semantic/cabal/distributive.txt b/.licenses/semantic/cabal/distributive.txt new file mode 100644 index 000000000..bdfb134c4 --- /dev/null +++ b/.licenses/semantic/cabal/distributive.txt @@ -0,0 +1,34 @@ +--- +type: cabal +name: distributive +version: 0.5.3 +summary: Distributive functors -- Dual to Traversable +homepage: https://github.com/ekmett/distributive/ +license: bsd-2-clause +--- +Copyright 2011-2016 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/dlist.txt b/.licenses/semantic/cabal/dlist.txt new file mode 100644 index 000000000..2a0879a1c --- /dev/null +++ b/.licenses/semantic/cabal/dlist.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: dlist +version: 0.8.0.4 +summary: Difference lists +homepage: https://github.com/spl/dlist +license: bsd-3-clause +--- +Copyright (c) 2006-2009 Don Stewart, 2013-2016 Sean Leather + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Don Stewart nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/effects.txt b/.licenses/semantic/cabal/effects.txt new file mode 100644 index 000000000..a5bc9160f --- /dev/null +++ b/.licenses/semantic/cabal/effects.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: effects +version: 0.3.2.0 +summary: Implementation of the Freer Monad +homepage: https://github.com/joshvera/effects +license: bsd-3-clause +--- +Original work Copyright (c) 2016, Allele Dev +Modified work Copyright 2016 Josh Vera + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Allele Dev nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/exceptions.txt b/.licenses/semantic/cabal/exceptions.txt new file mode 100644 index 000000000..cb9aa0c34 --- /dev/null +++ b/.licenses/semantic/cabal/exceptions.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: exceptions +version: 0.8.3 +summary: Extensible optionally-pure exceptions +homepage: https://github.com/ekmett/exceptions/ +license: bsd-3-clause +--- +Copyright 2013-2015 Edward Kmett +Copyright 2012 Google Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/fail.txt b/.licenses/semantic/cabal/fail.txt new file mode 100644 index 000000000..5813f1a22 --- /dev/null +++ b/.licenses/semantic/cabal/fail.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: fail +version: 4.9.0.0 +summary: Forward-compatible MonadFail class +homepage: https://prime.haskell.org/wiki/Libraries/Proposals/MonadFail +license: bsd-3-clause +--- +Copyright (c) 2015, David Luposchainsky & Herbert Valerio Riedel + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Herbert Valerio Riedel nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/fastsum.txt b/.licenses/semantic/cabal/fastsum.txt new file mode 100644 index 000000000..9c2fb6960 --- /dev/null +++ b/.licenses/semantic/cabal/fastsum.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: fastsum +version: 0.1.0.0 +summary: A fast open-union type suitable for 100+ contained alternatives +homepage: https://github.com/patrickt/fastsum +license: bsd-3-clause +--- +Original work Copyright (c) 2016, Allele Dev +Modified work Copyright (c) 2016, Patrick Thomson and Josh Vera + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Allele Dev nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/filepath.txt b/.licenses/semantic/cabal/filepath.txt new file mode 100644 index 000000000..519ef4455 --- /dev/null +++ b/.licenses/semantic/cabal/filepath.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: filepath +version: 1.4.1.2 +summary: Library for manipulating FilePaths in a cross platform way. +homepage: https://github.com/haskell/filepath +license: bsd-3-clause +--- +Copyright Neil Mitchell 2005-2017. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Neil Mitchell nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/fingertree.txt b/.licenses/semantic/cabal/fingertree.txt new file mode 100644 index 000000000..17c07f03c --- /dev/null +++ b/.licenses/semantic/cabal/fingertree.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: fingertree +version: 0.1.4.1 +summary: Generic finger-tree structure, with example instances +homepage: +license: bsd-3-clause +--- +The Glasgow Haskell Compiler License + +Copyright 2006, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/.licenses/semantic/cabal/foldl.txt b/.licenses/semantic/cabal/foldl.txt new file mode 100644 index 000000000..f2992c91a --- /dev/null +++ b/.licenses/semantic/cabal/foldl.txt @@ -0,0 +1,32 @@ +--- +type: cabal +name: foldl +version: 1.3.7 +summary: Composable, streaming, and efficient left folds +homepage: +license: bsd-3-clause +--- +Copyright (c) 2013 Gabriel Gonzalez +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Gabriel Gonzalez nor the names of other contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/foundation.txt b/.licenses/semantic/cabal/foundation.txt new file mode 100644 index 000000000..ca08d2c28 --- /dev/null +++ b/.licenses/semantic/cabal/foundation.txt @@ -0,0 +1,36 @@ +--- +type: cabal +name: foundation +version: 0.0.20 +summary: Alternative prelude with batteries and no dependencies +homepage: https://github.com/haskell-foundation/foundation +license: bsd-3-clause +--- +Copyright (c) 2015-2017 Vincent Hanquez +Copyright (c) 2017-2018 Foundation Maintainers + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/free.txt b/.licenses/semantic/cabal/free.txt new file mode 100644 index 000000000..cb59044d5 --- /dev/null +++ b/.licenses/semantic/cabal/free.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: free +version: 5.0.2 +summary: Monads for free +homepage: https://github.com/ekmett/free/ +license: bsd-3-clause +--- +Copyright 2008-2013 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/freer-cofreer.txt b/.licenses/semantic/cabal/freer-cofreer.txt new file mode 100644 index 000000000..e3a232f82 --- /dev/null +++ b/.licenses/semantic/cabal/freer-cofreer.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: freer-cofreer +version: 0.0.0.1 +summary: Freer monads and Cofreer comonads. +homepage: https://github.com/robrix/freer-cofreer +license: bsd-3-clause +--- +Copyright Rob Rix (c) 2017 + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Rob Rix nor the names of other contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/generics-sop.txt b/.licenses/semantic/cabal/generics-sop.txt new file mode 100644 index 000000000..c0663e433 --- /dev/null +++ b/.licenses/semantic/cabal/generics-sop.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: generics-sop +version: 0.3.2.0 +summary: Generic Programming using True Sums of Products +homepage: +license: bsd-3-clause +--- +Copyright (c) 2014-2015, Well-Typed LLP, Edsko de Vries, Andres Löh +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/ghc-boot-th.txt b/.licenses/semantic/cabal/ghc-boot-th.txt new file mode 100644 index 000000000..6952609bb --- /dev/null +++ b/.licenses/semantic/cabal/ghc-boot-th.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: ghc-boot-th +version: 8.2.2 +summary: Shared functionality between GHC and the @template-haskell@ +homepage: +license: bsd-3-clause +--- +The Glasgow Haskell Compiler License + +Copyright 2002, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/.licenses/semantic/cabal/ghc-boot.txt b/.licenses/semantic/cabal/ghc-boot.txt new file mode 100644 index 000000000..bbe2562f7 --- /dev/null +++ b/.licenses/semantic/cabal/ghc-boot.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: ghc-boot +version: 8.2.2 +summary: Shared functionality between GHC and its boot libraries +homepage: +license: bsd-3-clause +--- +The Glasgow Haskell Compiler License + +Copyright 2002, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/.licenses/semantic/cabal/ghc-prim.txt b/.licenses/semantic/cabal/ghc-prim.txt new file mode 100644 index 000000000..e4c4a419e --- /dev/null +++ b/.licenses/semantic/cabal/ghc-prim.txt @@ -0,0 +1,70 @@ +--- +type: cabal +name: ghc-prim +version: 0.5.1.1 +summary: GHC primitives +homepage: +license: bsd-3-clause +--- +This library (libraries/ghc-prim) is derived from code from several +sources: + + * Code from the GHC project which is largely (c) The University of + Glasgow, and distributable under a BSD-style license (see below), + + * Code from the Haskell 98 Report which is (c) Simon Peyton Jones + and freely redistributable (but see the full license for + restrictions). + +The full text of these licenses is reproduced below. All of the +licenses are BSD-style or compatible. + +----------------------------------------------------------------------------- + +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +----------------------------------------------------------------------------- + +Code derived from the document "Report on the Programming Language +Haskell 98", is distributed under the following license: + + Copyright (c) 2002 Simon Peyton Jones + + The authors intend this Report to belong to the entire Haskell + community, and so we grant permission to copy and distribute it for + any purpose, provided that it is reproduced in its entirety, + including this Notice. Modified versions of this Report may also be + copied and distributed for any purpose, provided that the modified + version is clearly presented as such, and that it does not claim to + be a definition of the Haskell 98 Language. + diff --git a/.licenses/semantic/cabal/ghc-tcplugins-extra.txt b/.licenses/semantic/cabal/ghc-tcplugins-extra.txt new file mode 100644 index 000000000..5ffef0f01 --- /dev/null +++ b/.licenses/semantic/cabal/ghc-tcplugins-extra.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: ghc-tcplugins-extra +version: 0.2.5 +summary: Utilities for writing GHC type-checker plugins +homepage: https://github.com/clash-lang/ghc-tcplugins-extra +license: bsd-2-clause +--- +Copyright (c) 2015-2016, University of Twente, + 2017-2018, QBayLogic +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/ghc-typelits-extra.txt b/.licenses/semantic/cabal/ghc-typelits-extra.txt new file mode 100644 index 000000000..483524e07 --- /dev/null +++ b/.licenses/semantic/cabal/ghc-typelits-extra.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: ghc-typelits-extra +version: 0.2.4 +summary: Additional type-level operations on GHC.TypeLits.Nat +homepage: https://www.clash-lang.org/ +license: bsd-2-clause +--- +Copyright (c) 2015-2016, University of Twente, + 2017-2018, QBayLogic B.V. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/ghc-typelits-knownnat.txt b/.licenses/semantic/cabal/ghc-typelits-knownnat.txt new file mode 100644 index 000000000..ff71adf4a --- /dev/null +++ b/.licenses/semantic/cabal/ghc-typelits-knownnat.txt @@ -0,0 +1,36 @@ +--- +type: cabal +name: ghc-typelits-knownnat +version: 0.4.2 +summary: Derive KnownNat constraints from other KnownNat constraints +homepage: https://clash-lang.org/ +license: bsd-2-clause +--- +Copyright (c) 2016 , University of Twente, + 2017-2018, QBayLogic B.V., + 2017 , Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/ghc-typelits-natnormalise.txt b/.licenses/semantic/cabal/ghc-typelits-natnormalise.txt new file mode 100644 index 000000000..0d1f8e1cd --- /dev/null +++ b/.licenses/semantic/cabal/ghc-typelits-natnormalise.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: ghc-typelits-natnormalise +version: 0.5.10 +summary: GHC typechecker plugin for types of kind GHC.TypeLits.Nat +homepage: https://www.clash-lang.org/ +license: bsd-2-clause +--- +Copyright (c) 2015-2016, University of Twente, + 2017-2018, QBayLogic B.V. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/ghc.txt b/.licenses/semantic/cabal/ghc.txt new file mode 100644 index 000000000..4379a004f --- /dev/null +++ b/.licenses/semantic/cabal/ghc.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: ghc +version: 8.2.2 +summary: The GHC API +homepage: https://www.haskell.org/ghc/ +license: bsd-3-clause +--- +The Glasgow Haskell Compiler License + +Copyright 2002, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/.licenses/semantic/cabal/ghci.txt b/.licenses/semantic/cabal/ghci.txt new file mode 100644 index 000000000..e978664f1 --- /dev/null +++ b/.licenses/semantic/cabal/ghci.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: ghci +version: 8.2.2 +summary: The library supporting GHC's interactive interpreter +homepage: +license: bsd-3-clause +--- +The Glasgow Haskell Compiler License + +Copyright 2002, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/.licenses/semantic/cabal/gitrev.txt b/.licenses/semantic/cabal/gitrev.txt new file mode 100644 index 000000000..cd447b4b9 --- /dev/null +++ b/.licenses/semantic/cabal/gitrev.txt @@ -0,0 +1,36 @@ +--- +type: cabal +name: gitrev +version: 1.3.1 +summary: Compile git revision info into Haskell projects +homepage: https://github.com/acfoltzer/gitrev +license: bsd-3-clause +--- +Copyright (c) 2015, Adam C. Foltzer +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of gitrev nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/.licenses/semantic/cabal/hashable.txt b/.licenses/semantic/cabal/hashable.txt new file mode 100644 index 000000000..f7e6a10a7 --- /dev/null +++ b/.licenses/semantic/cabal/hashable.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: hashable +version: 1.2.7.0 +summary: A class for types that can be converted to a hash value +homepage: https://github.com/tibbe/hashable +license: bsd-3-clause +--- +Copyright Milan Straka 2010 + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Milan Straka nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/haskell-lexer.txt b/.licenses/semantic/cabal/haskell-lexer.txt new file mode 100644 index 000000000..a11b919cd --- /dev/null +++ b/.licenses/semantic/cabal/haskell-lexer.txt @@ -0,0 +1,16 @@ +--- +type: cabal +name: haskell-lexer +version: 1.0.1 +summary: A fully compliant Haskell 98 lexer. +homepage: +license: mit +--- +Copyright (c) 2008 Thomas Hallgren +Copyright (c) 2008 Iavor S. Diatchki + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.licenses/semantic/cabal/haskell-src.txt b/.licenses/semantic/cabal/haskell-src.txt new file mode 100644 index 000000000..259179500 --- /dev/null +++ b/.licenses/semantic/cabal/haskell-src.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: haskell-src +version: 1.0.3.0 +summary: Support for manipulating Haskell source code +homepage: +license: bsd-3-clause +--- +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/.licenses/semantic/cabal/haskell-tree-sitter.txt b/.licenses/semantic/cabal/haskell-tree-sitter.txt new file mode 100644 index 000000000..8c381c04c --- /dev/null +++ b/.licenses/semantic/cabal/haskell-tree-sitter.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: haskell-tree-sitter +version: 0.1.0 +summary: haskell tree-sitter bindings +homepage: https://github.com/tree-sitter/haskell-tree-sitter +license: bsd-3-clause +--- +Copyright GitHub (c) 2015 + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Author name here nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/.licenses/semantic/cabal/heap.txt b/.licenses/semantic/cabal/heap.txt new file mode 100644 index 000000000..29d2ae834 --- /dev/null +++ b/.licenses/semantic/cabal/heap.txt @@ -0,0 +1,30 @@ +--- +type: cabal +name: heap +version: 1.0.4 +summary: Heaps in Haskell +homepage: +license: bsd-2-clause +--- +Copyright (c) 2008-2009, Stephan Friedrichs +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/hoopl.txt b/.licenses/semantic/cabal/hoopl.txt new file mode 100644 index 000000000..143308094 --- /dev/null +++ b/.licenses/semantic/cabal/hoopl.txt @@ -0,0 +1,41 @@ +--- +type: cabal +name: hoopl +version: 3.10.2.2 +summary: A library to support dataflow analysis and optimization +homepage: https://github.com/haskell/hoopl +license: bsd-3-clause +--- +Copyright (c) 2010, Jo�o Dias, Simon Marlow, Simon Peyton Jones, and Norman Ramsey +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +Neither the name of Tufts University nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +Neither the name of Microsoft nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/hostname.txt b/.licenses/semantic/cabal/hostname.txt new file mode 100644 index 000000000..4b21e02ee --- /dev/null +++ b/.licenses/semantic/cabal/hostname.txt @@ -0,0 +1,31 @@ +--- +type: cabal +name: hostname +version: '1.0' +summary: A very simple package providing a cross-platform means of determining the + hostname +homepage: +license: bsd-3-clause +--- +Copyright (c) 2008, Maximilian Bolingbroke +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted +provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of + conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. + * Neither the name of Maximilian Bolingbroke nor the names of other contributors may be used to + endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/.licenses/semantic/cabal/hourglass.txt b/.licenses/semantic/cabal/hourglass.txt new file mode 100644 index 000000000..780ee9a5e --- /dev/null +++ b/.licenses/semantic/cabal/hourglass.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: hourglass +version: 0.2.11 +summary: simple performant time related library +homepage: https://github.com/vincenthz/hs-hourglass +license: bsd-3-clause +--- +Copyright (c) 2014 Vincent Hanquez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/hpc.txt b/.licenses/semantic/cabal/hpc.txt new file mode 100644 index 000000000..3c73b285a --- /dev/null +++ b/.licenses/semantic/cabal/hpc.txt @@ -0,0 +1,33 @@ +--- +type: cabal +name: hpc +version: 0.6.0.3 +summary: Code Coverage Library for Haskell +homepage: +license: bsd-3-clause +--- +Copyright (c) 2006 Andy Gill, Colin Runciman +Copyright (c) 2007 Andy Gill +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/http-client-tls.txt b/.licenses/semantic/cabal/http-client-tls.txt new file mode 100644 index 000000000..8304ee694 --- /dev/null +++ b/.licenses/semantic/cabal/http-client-tls.txt @@ -0,0 +1,28 @@ +--- +type: cabal +name: http-client-tls +version: 0.3.5.3 +summary: http-client backend using the connection package and tls library +homepage: https://github.com/snoyberg/http-client +license: mit +--- +The MIT License (MIT) + +Copyright (c) 2013 Michael Snoyman + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.licenses/semantic/cabal/http-client.txt b/.licenses/semantic/cabal/http-client.txt new file mode 100644 index 000000000..99b81e9aa --- /dev/null +++ b/.licenses/semantic/cabal/http-client.txt @@ -0,0 +1,28 @@ +--- +type: cabal +name: http-client +version: 0.5.12.1 +summary: An HTTP client engine +homepage: https://github.com/snoyberg/http-client +license: mit +--- +The MIT License (MIT) + +Copyright (c) 2013 Michael Snoyman + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.licenses/semantic/cabal/http-media.txt b/.licenses/semantic/cabal/http-media.txt new file mode 100644 index 000000000..746cf018d --- /dev/null +++ b/.licenses/semantic/cabal/http-media.txt @@ -0,0 +1,28 @@ +--- +type: cabal +name: http-media +version: 0.7.1.2 +summary: Processing HTTP Content-Type and Accept headers +homepage: https://github.com/zmthy/http-media +license: mit +--- +Copyright (c) 2012-2015 Timothy Jones + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.licenses/semantic/cabal/http-types.txt b/.licenses/semantic/cabal/http-types.txt new file mode 100644 index 000000000..d46e4d174 --- /dev/null +++ b/.licenses/semantic/cabal/http-types.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: http-types +version: 0.12.1 +summary: Generic HTTP types for Haskell (for both client and server code). +homepage: https://github.com/aristidb/http-types +license: bsd-3-clause +--- +Copyright (c) 2011, Aristid Breitkreuz +Copyright (c) 2011, Michael Snoyman + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Aristid Breitkreuz nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/insert-ordered-containers.txt b/.licenses/semantic/cabal/insert-ordered-containers.txt new file mode 100644 index 000000000..b7e93be1a --- /dev/null +++ b/.licenses/semantic/cabal/insert-ordered-containers.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: insert-ordered-containers +version: 0.2.1.0 +summary: Associative containers retaining insertion order for traversals. +homepage: https://github.com/phadej/insert-ordered-containers +license: bsd-3-clause +--- +Copyright (c) 2015, Oleg Grenrus + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Oleg Grenrus nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/integer-gmp.txt b/.licenses/semantic/cabal/integer-gmp.txt new file mode 100644 index 000000000..f77694a0d --- /dev/null +++ b/.licenses/semantic/cabal/integer-gmp.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: integer-gmp +version: 1.0.1.0 +summary: Integer library based on GMP +homepage: +license: bsd-3-clause +--- +Copyright (c) 2014, Herbert Valerio Riedel + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Herbert Valerio Riedel nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/integer-logarithms.txt b/.licenses/semantic/cabal/integer-logarithms.txt new file mode 100644 index 000000000..e22678e34 --- /dev/null +++ b/.licenses/semantic/cabal/integer-logarithms.txt @@ -0,0 +1,24 @@ +--- +type: cabal +name: integer-logarithms +version: 1.0.2.1 +summary: Integer logarithms. +homepage: https://github.com/phadej/integer-logarithms +license: mit +--- +Copyright (c) 2011 Daniel Fischer, 2017 Oleg Grenrus + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.licenses/semantic/cabal/kan-extensions.txt b/.licenses/semantic/cabal/kan-extensions.txt new file mode 100644 index 000000000..32e8f7b88 --- /dev/null +++ b/.licenses/semantic/cabal/kan-extensions.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: kan-extensions +version: '5.1' +summary: Kan extensions, Kan lifts, the Yoneda lemma, and (co)density (co)monads +homepage: https://github.com/ekmett/kan-extensions/ +license: bsd-3-clause +--- +Copyright 2008-2016 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/kdt.txt b/.licenses/semantic/cabal/kdt.txt new file mode 100644 index 000000000..841d92f32 --- /dev/null +++ b/.licenses/semantic/cabal/kdt.txt @@ -0,0 +1,28 @@ +--- +type: cabal +name: kdt +version: 0.2.4 +summary: Fast and flexible k-d trees for various types of point queries. +homepage: https://github.com/giogadi/kdt +license: mit +--- +Copyright (c) 2014 Luis G. Torres + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.licenses/semantic/cabal/keys.txt b/.licenses/semantic/cabal/keys.txt new file mode 100644 index 000000000..d6ed31e1e --- /dev/null +++ b/.licenses/semantic/cabal/keys.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: keys +version: '3.12' +summary: Keyed functors and containers +homepage: https://github.com/ekmett/keys/ +license: bsd-3-clause +--- +Copyright 2011-2016 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/lens.txt b/.licenses/semantic/cabal/lens.txt new file mode 100644 index 000000000..c3c3fa653 --- /dev/null +++ b/.licenses/semantic/cabal/lens.txt @@ -0,0 +1,34 @@ +--- +type: cabal +name: lens +version: 4.16.1 +summary: Lenses, Folds and Traversals +homepage: https://github.com/ekmett/lens/ +license: bsd-2-clause +--- +Copyright 2012-2016 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/managed.txt b/.licenses/semantic/cabal/managed.txt new file mode 100644 index 000000000..250ce3840 --- /dev/null +++ b/.licenses/semantic/cabal/managed.txt @@ -0,0 +1,32 @@ +--- +type: cabal +name: managed +version: 1.0.6 +summary: A monad for managed values +homepage: +license: bsd-3-clause +--- +Copyright (c) 2014 Gabriel Gonzalez +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Gabriel Gonzalez nor the names of other contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/math-functions.txt b/.licenses/semantic/cabal/math-functions.txt new file mode 100644 index 000000000..d9ab9f393 --- /dev/null +++ b/.licenses/semantic/cabal/math-functions.txt @@ -0,0 +1,34 @@ +--- +type: cabal +name: math-functions +version: 0.2.1.0 +summary: Special functions and Chebyshev polynomials +homepage: https://github.com/bos/math-functions +license: bsd-2-clause +--- +Copyright (c) 2009, 2010 Bryan O'Sullivan +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/memory.txt b/.licenses/semantic/cabal/memory.txt new file mode 100644 index 000000000..71c3649be --- /dev/null +++ b/.licenses/semantic/cabal/memory.txt @@ -0,0 +1,36 @@ +--- +type: cabal +name: memory +version: 0.14.16 +summary: memory and related abstraction stuff +homepage: https://github.com/vincenthz/hs-memory +license: bsd-3-clause +--- +Copyright (c) 2015 Vincent Hanquez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/mersenne-random-pure64.txt b/.licenses/semantic/cabal/mersenne-random-pure64.txt new file mode 100644 index 000000000..c46ce9fb1 --- /dev/null +++ b/.licenses/semantic/cabal/mersenne-random-pure64.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: mersenne-random-pure64 +version: 0.2.2.0 +summary: Generate high quality pseudorandom numbers purely using a Mersenne Twister +homepage: https://code.haskell.org/~dons/code/mersenne-random-pure64/ +license: bsd-3-clause +--- +Copyright (c) Don Stewart 2008 + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/mime-types.txt b/.licenses/semantic/cabal/mime-types.txt new file mode 100644 index 000000000..f2b42ac46 --- /dev/null +++ b/.licenses/semantic/cabal/mime-types.txt @@ -0,0 +1,28 @@ +--- +type: cabal +name: mime-types +version: 0.1.0.7 +summary: Basic mime-type handling types and functions +homepage: https://github.com/yesodweb/wai +license: mit +--- +Copyright (c) 2012 Michael Snoyman, http://www.yesodweb.com/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.licenses/semantic/cabal/mtl.txt b/.licenses/semantic/cabal/mtl.txt new file mode 100644 index 000000000..321a6c347 --- /dev/null +++ b/.licenses/semantic/cabal/mtl.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: mtl +version: 2.2.2 +summary: Monad classes, using functional dependencies +homepage: https://github.com/haskell/mtl +license: bsd-3-clause +--- +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/.licenses/semantic/cabal/mwc-random.txt b/.licenses/semantic/cabal/mwc-random.txt new file mode 100644 index 000000000..4dcd6661c --- /dev/null +++ b/.licenses/semantic/cabal/mwc-random.txt @@ -0,0 +1,34 @@ +--- +type: cabal +name: mwc-random +version: 0.13.6.0 +summary: Fast, high quality pseudo random number generation +homepage: https://github.com/bos/mwc-random +license: bsd-2-clause +--- +Copyright (c) 2009, Bryan O'Sullivan +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/neat-interpolation.txt b/.licenses/semantic/cabal/neat-interpolation.txt new file mode 100644 index 000000000..876eed2b2 --- /dev/null +++ b/.licenses/semantic/cabal/neat-interpolation.txt @@ -0,0 +1,30 @@ +--- +type: cabal +name: neat-interpolation +version: 0.3.2.1 +summary: A quasiquoter for neat and simple multiline text interpolation +homepage: https://github.com/nikita-volkov/neat-interpolation +license: mit +--- +Copyright (c) 2013, Nikita Volkov + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/.licenses/semantic/cabal/network-uri.txt b/.licenses/semantic/cabal/network-uri.txt new file mode 100644 index 000000000..ba7f4c52d --- /dev/null +++ b/.licenses/semantic/cabal/network-uri.txt @@ -0,0 +1,37 @@ +--- +type: cabal +name: network-uri +version: 2.6.1.0 +summary: URI manipulation +homepage: https://github.com/haskell/network-uri +license: bsd-3-clause +--- +Copyright (c) 2002-2010, The University Court of the University of Glasgow. +Copyright (c) 2007-2010, Johan Tibell + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/.licenses/semantic/cabal/network.txt b/.licenses/semantic/cabal/network.txt new file mode 100644 index 000000000..ad171f83c --- /dev/null +++ b/.licenses/semantic/cabal/network.txt @@ -0,0 +1,37 @@ +--- +type: cabal +name: network +version: 2.6.3.5 +summary: Low-level networking interface +homepage: https://github.com/haskell/network +license: bsd-3-clause +--- +Copyright (c) 2002-2010, The University Court of the University of Glasgow. +Copyright (c) 2007-2010, Johan Tibell + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/.licenses/semantic/cabal/old-locale.txt b/.licenses/semantic/cabal/old-locale.txt new file mode 100644 index 000000000..1a21033e4 --- /dev/null +++ b/.licenses/semantic/cabal/old-locale.txt @@ -0,0 +1,71 @@ +--- +type: cabal +name: old-locale +version: 1.0.0.7 +summary: locale library +homepage: +license: bsd-3-clause +--- +This library (libraries/base) is derived from code from two +sources: + + * Code from the GHC project which is largely (c) The University of + Glasgow, and distributable under a BSD-style license (see below), + + * Code from the Haskell 98 Report which is (c) Simon Peyton Jones + and freely redistributable (but see the full license for + restrictions). + +The full text of these licenses is reproduced below. Both of the +licenses are BSD-style or compatible. + +----------------------------------------------------------------------------- + +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +----------------------------------------------------------------------------- + +Code derived from the document "Report on the Programming Language +Haskell 98", is distributed under the following license: + + Copyright (c) 2002 Simon Peyton Jones + + The authors intend this Report to belong to the entire Haskell + community, and so we grant permission to copy and distribute it for + any purpose, provided that it is reproduced in its entirety, + including this Notice. Modified versions of this Report may also be + copied and distributed for any purpose, provided that the modified + version is clearly presented as such, and that it does not claim to + be a definition of the Haskell 98 Language. + +----------------------------------------------------------------------------- diff --git a/.licenses/semantic/cabal/old-time.txt b/.licenses/semantic/cabal/old-time.txt new file mode 100644 index 000000000..7661c5c97 --- /dev/null +++ b/.licenses/semantic/cabal/old-time.txt @@ -0,0 +1,71 @@ +--- +type: cabal +name: old-time +version: 1.1.0.3 +summary: Time library +homepage: +license: bsd-3-clause +--- +This library (libraries/base) is derived from code from two +sources: + + * Code from the GHC project which is largely (c) The University of + Glasgow, and distributable under a BSD-style license (see below), + + * Code from the Haskell 98 Report which is (c) Simon Peyton Jones + and freely redistributable (but see the full license for + restrictions). + +The full text of these licenses is reproduced below. Both of the +licenses are BSD-style or compatible. + +----------------------------------------------------------------------------- + +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +----------------------------------------------------------------------------- + +Code derived from the document "Report on the Programming Language +Haskell 98", is distributed under the following license: + + Copyright (c) 2002 Simon Peyton Jones + + The authors intend this Report to belong to the entire Haskell + community, and so we grant permission to copy and distribute it for + any purpose, provided that it is reproduced in its entirety, + including this Notice. Modified versions of this Report may also be + copied and distributed for any purpose, provided that the modified + version is clearly presented as such, and that it does not claim to + be a definition of the Haskell 98 Language. + +----------------------------------------------------------------------------- diff --git a/.licenses/semantic/cabal/optional-args.txt b/.licenses/semantic/cabal/optional-args.txt new file mode 100644 index 000000000..6cc0d3789 --- /dev/null +++ b/.licenses/semantic/cabal/optional-args.txt @@ -0,0 +1,32 @@ +--- +type: cabal +name: optional-args +version: 1.0.2 +summary: Optional function arguments +homepage: +license: bsd-3-clause +--- +Copyright (c) 2015 Gabriel Gonzalez +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Gabriel Gonzalez nor the names of other contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/optparse-applicative.txt b/.licenses/semantic/cabal/optparse-applicative.txt new file mode 100644 index 000000000..056bb64fd --- /dev/null +++ b/.licenses/semantic/cabal/optparse-applicative.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: optparse-applicative +version: 0.14.2.0 +summary: Utilities and combinators for parsing command line options +homepage: https://github.com/pcapriotti/optparse-applicative +license: bsd-3-clause +--- +Copyright (c) 2012, Paolo Capriotti + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Paolo Capriotti nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/parallel.txt b/.licenses/semantic/cabal/parallel.txt new file mode 100644 index 000000000..6c1187a0a --- /dev/null +++ b/.licenses/semantic/cabal/parallel.txt @@ -0,0 +1,47 @@ +--- +type: cabal +name: parallel +version: 3.2.1.1 +summary: Parallel programming library +homepage: https://github.com/haskell/parallel +license: bsd-3-clause +--- +This library (libraries/parallel) is derived from code from +the GHC project which is largely (c) The University of +Glasgow, and distributable under a BSD-style license (see below). + +----------------------------------------------------------------------------- + +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +----------------------------------------------------------------------------- diff --git a/.licenses/semantic/cabal/parsec.txt b/.licenses/semantic/cabal/parsec.txt new file mode 100644 index 000000000..ba02a3d55 --- /dev/null +++ b/.licenses/semantic/cabal/parsec.txt @@ -0,0 +1,29 @@ +--- +type: cabal +name: parsec +version: 3.1.13.0 +summary: Monadic parser combinators +homepage: https://github.com/hvr/parsec +license: bsd-2-clause +--- +Copyright 1999-2000, Daan Leijen; 2007, Paolo Martini. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +This software is provided by the copyright holders "as is" and any express or +implied warranties, including, but not limited to, the implied warranties of +merchantability and fitness for a particular purpose are disclaimed. In no +event shall the copyright holders be liable for any direct, indirect, +incidental, special, exemplary, or consequential damages (including, but not +limited to, procurement of substitute goods or services; loss of use, data, +or profits; or business interruption) however caused and on any theory of +liability, whether in contract, strict liability, or tort (including +negligence or otherwise) arising in any way out of the use of this software, +even if advised of the possibility of such damage. diff --git a/.licenses/semantic/cabal/parsers.txt b/.licenses/semantic/cabal/parsers.txt new file mode 100644 index 000000000..977bebcb0 --- /dev/null +++ b/.licenses/semantic/cabal/parsers.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: parsers +version: 0.12.8 +summary: Parsing combinators +homepage: https://github.com/ekmett/parsers/ +license: bsd-3-clause +--- +Copyright 2011-2013 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/pem.txt b/.licenses/semantic/cabal/pem.txt new file mode 100644 index 000000000..1a1471856 --- /dev/null +++ b/.licenses/semantic/cabal/pem.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: pem +version: 0.2.4 +summary: Privacy Enhanced Mail (PEM) format reader and writer. +homepage: https://github.com/vincenthz/hs-pem +license: bsd-3-clause +--- +Copyright (c) 2010-2018 Vincent Hanquez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/pointed.txt b/.licenses/semantic/cabal/pointed.txt new file mode 100644 index 000000000..7a93872d7 --- /dev/null +++ b/.licenses/semantic/cabal/pointed.txt @@ -0,0 +1,34 @@ +--- +type: cabal +name: pointed +version: 5.0.1 +summary: Pointed and copointed data +homepage: https://github.com/ekmett/pointed/ +license: bsd-2-clause +--- +Copyright 2008-2011 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/pretty.txt b/.licenses/semantic/cabal/pretty.txt new file mode 100644 index 000000000..5f42e1527 --- /dev/null +++ b/.licenses/semantic/cabal/pretty.txt @@ -0,0 +1,47 @@ +--- +type: cabal +name: pretty +version: 1.1.3.3 +summary: Pretty-printing library +homepage: https://github.com/haskell/pretty +license: bsd-3-clause +--- +This library (libraries/pretty) is derived from code from +the GHC project which is largely (c) The University of +Glasgow, and distributable under a BSD-style license (see below). + +----------------------------------------------------------------------------- + +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +----------------------------------------------------------------------------- diff --git a/.licenses/semantic/cabal/primitive.txt b/.licenses/semantic/cabal/primitive.txt new file mode 100644 index 000000000..67acdc05d --- /dev/null +++ b/.licenses/semantic/cabal/primitive.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: primitive +version: 0.6.3.0 +summary: Primitive memory-related operations +homepage: https://github.com/haskell/primitive +license: bsd-3-clause +--- +Copyright (c) 2008-2009, Roman Leshchinskiy +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + diff --git a/.licenses/semantic/cabal/process.txt b/.licenses/semantic/cabal/process.txt new file mode 100644 index 000000000..6cddc7436 --- /dev/null +++ b/.licenses/semantic/cabal/process.txt @@ -0,0 +1,71 @@ +--- +type: cabal +name: process +version: 1.6.1.0 +summary: Process libraries +homepage: https://github.com/haskell/process +license: bsd-3-clause +--- +This library (libraries/process) is derived from code from two +sources: + + * Code from the GHC project which is largely (c) The University of + Glasgow, and distributable under a BSD-style license (see below), + + * Code from the Haskell 98 Report which is (c) Simon Peyton Jones + and freely redistributable (but see the full license for + restrictions). + +The full text of these licenses is reproduced below. Both of the +licenses are BSD-style or compatible. + +----------------------------------------------------------------------------- + +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +----------------------------------------------------------------------------- + +Code derived from the document "Report on the Programming Language +Haskell 98", is distributed under the following license: + + Copyright (c) 2002 Simon Peyton Jones + + The authors intend this Report to belong to the entire Haskell + community, and so we grant permission to copy and distribute it for + any purpose, provided that it is reproduced in its entirety, + including this Notice. Modified versions of this Report may also be + copied and distributed for any purpose, provided that the modified + version is clearly presented as such, and that it does not claim to + be a definition of the Haskell 98 Language. + +----------------------------------------------------------------------------- diff --git a/.licenses/semantic/cabal/profunctors.txt b/.licenses/semantic/cabal/profunctors.txt new file mode 100644 index 000000000..951708590 --- /dev/null +++ b/.licenses/semantic/cabal/profunctors.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: profunctors +version: 5.2.2 +summary: Profunctors +homepage: https://github.com/ekmett/profunctors/ +license: bsd-3-clause +--- +Copyright 2011-2015 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/proto3-suite.txt b/.licenses/semantic/cabal/proto3-suite.txt new file mode 100644 index 000000000..fd01c1256 --- /dev/null +++ b/.licenses/semantic/cabal/proto3-suite.txt @@ -0,0 +1,22 @@ +--- +type: cabal +name: proto3-suite +version: 0.2.0 +summary: A low level library for writing out data in the Protocol Buffers wire format +homepage: +license: apache-2.0 +--- + +Copyright 2017 Awake Networks + +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. diff --git a/.licenses/semantic/cabal/proto3-wire.txt b/.licenses/semantic/cabal/proto3-wire.txt new file mode 100644 index 000000000..09f0f4559 --- /dev/null +++ b/.licenses/semantic/cabal/proto3-wire.txt @@ -0,0 +1,21 @@ +--- +type: cabal +name: proto3-wire +version: 1.0.0 +summary: A low-level implementation of the Protocol Buffers (version 3) wire format +homepage: +license: apache-2.0 +--- +Copyright 2016 Awake Networks + +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. diff --git a/.licenses/semantic/cabal/quickcheck-instances.txt b/.licenses/semantic/cabal/quickcheck-instances.txt new file mode 100644 index 000000000..3225681b8 --- /dev/null +++ b/.licenses/semantic/cabal/quickcheck-instances.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: quickcheck-instances +version: 0.3.16.1 +summary: Common quickcheck instances +homepage: https://github.com/phadej/qc-instances +license: bsd-3-clause +--- +Copyright (c)2012, Antoine Latter + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Antoine Latter nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/random.txt b/.licenses/semantic/cabal/random.txt new file mode 100644 index 000000000..2f6521dfc --- /dev/null +++ b/.licenses/semantic/cabal/random.txt @@ -0,0 +1,71 @@ +--- +type: cabal +name: random +version: '1.1' +summary: random number library +homepage: https://github.com/haskell/random +license: bsd-3-clause +--- +This library (libraries/base) is derived from code from two +sources: + + * Code from the GHC project which is largely (c) The University of + Glasgow, and distributable under a BSD-style license (see below), + + * Code from the Haskell 98 Report which is (c) Simon Peyton Jones + and freely redistributable (but see the full license for + restrictions). + +The full text of these licenses is reproduced below. Both of the +licenses are BSD-style or compatible. + +----------------------------------------------------------------------------- + +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +----------------------------------------------------------------------------- + +Code derived from the document "Report on the Programming Language +Haskell 98", is distributed under the following license: + + Copyright (c) 2002 Simon Peyton Jones + + The authors intend this Report to belong to the entire Haskell + community, and so we grant permission to copy and distribute it for + any purpose, provided that it is reproduced in its entirety, + including this Notice. Modified versions of this Report may also be + copied and distributed for any purpose, provided that the modified + version is clearly presented as such, and that it does not claim to + be a definition of the Haskell 98 Language. + +----------------------------------------------------------------------------- diff --git a/.licenses/semantic/cabal/recursion-schemes.txt b/.licenses/semantic/cabal/recursion-schemes.txt new file mode 100644 index 000000000..c05c7096e --- /dev/null +++ b/.licenses/semantic/cabal/recursion-schemes.txt @@ -0,0 +1,34 @@ +--- +type: cabal +name: recursion-schemes +version: 5.0.2 +summary: Generalized bananas, lenses and barbed wire +homepage: https://github.com/ekmett/recursion-schemes/ +license: bsd-2-clause +--- +Copyright 2011-2015 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/reducers.txt b/.licenses/semantic/cabal/reducers.txt new file mode 100644 index 000000000..728878f0c --- /dev/null +++ b/.licenses/semantic/cabal/reducers.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: reducers +version: 3.12.2 +summary: Semigroups, specialized containers and a general map/reduce framework +homepage: https://github.com/ekmett/reducers/ +license: bsd-3-clause +--- +Copyright 2008-2016 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/reflection.txt b/.licenses/semantic/cabal/reflection.txt new file mode 100644 index 000000000..9cd1990bf --- /dev/null +++ b/.licenses/semantic/cabal/reflection.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: reflection +version: 2.1.3 +summary: Reifies arbitrary terms into types that can be reflected back into terms +homepage: https://github.com/ekmett/reflection +license: bsd-3-clause +--- +Copyright (c) 2009-2013 Edward Kmett +Copyright (c) 2004 Oleg Kiselyov and Chung-chieh Shan +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Edward Kmett nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/rts.txt b/.licenses/semantic/cabal/rts.txt new file mode 100644 index 000000000..689dca304 --- /dev/null +++ b/.licenses/semantic/cabal/rts.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: rts +version: '1.0' +summary: +homepage: +license: bsd-3-clause +--- +The Glasgow Haskell Compiler License + +Copyright 2002, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/.licenses/semantic/cabal/safe.txt b/.licenses/semantic/cabal/safe.txt new file mode 100644 index 000000000..711da324b --- /dev/null +++ b/.licenses/semantic/cabal/safe.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: safe +version: 0.3.17 +summary: Library of safe (exception free) functions +homepage: https://github.com/ndmitchell/safe +license: bsd-3-clause +--- +Copyright Neil Mitchell 2007-2018. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Neil Mitchell nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/scientific.txt b/.licenses/semantic/cabal/scientific.txt new file mode 100644 index 000000000..38eb6f763 --- /dev/null +++ b/.licenses/semantic/cabal/scientific.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: scientific +version: 0.3.6.2 +summary: Numbers represented using scientific notation +homepage: https://github.com/basvandijk/scientific +license: other +--- +Copyright (c) 2013, Bas van Dijk + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Bas van Dijk nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/semigroupoids.txt b/.licenses/semantic/cabal/semigroupoids.txt new file mode 100644 index 000000000..53b7b68ee --- /dev/null +++ b/.licenses/semantic/cabal/semigroupoids.txt @@ -0,0 +1,34 @@ +--- +type: cabal +name: semigroupoids +version: 5.2.2 +summary: 'Semigroupoids: Category sans id' +homepage: https://github.com/ekmett/semigroupoids +license: bsd-2-clause +--- +Copyright 2011-2015 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/semigroups.txt b/.licenses/semantic/cabal/semigroups.txt new file mode 100644 index 000000000..d2179cdc2 --- /dev/null +++ b/.licenses/semantic/cabal/semigroups.txt @@ -0,0 +1,34 @@ +--- +type: cabal +name: semigroups +version: 0.18.4 +summary: Anything that associates +homepage: https://github.com/ekmett/semigroups/ +license: bsd-2-clause +--- +Copyright 2011-2015 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/semilattices.txt b/.licenses/semantic/cabal/semilattices.txt new file mode 100644 index 000000000..44b9b4b9b --- /dev/null +++ b/.licenses/semantic/cabal/semilattices.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: semilattices +version: 0.0.0.1 +summary: Semilattices +homepage: https://github.com/robrix/semilattices +license: bsd-3-clause +--- +Copyright (c) 2017, Rob Rix + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Rob Rix nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/socks.txt b/.licenses/semantic/cabal/socks.txt new file mode 100644 index 000000000..d55d5f44f --- /dev/null +++ b/.licenses/semantic/cabal/socks.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: socks +version: 0.5.6 +summary: Socks proxy (ver 5) +homepage: https://github.com/vincenthz/hs-socks +license: bsd-3-clause +--- +Copyright (c) 2010-2011 Vincent Hanquez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/split.txt b/.licenses/semantic/cabal/split.txt new file mode 100644 index 000000000..91fce21c3 --- /dev/null +++ b/.licenses/semantic/cabal/split.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: split +version: 0.2.3.3 +summary: Combinator library for splitting lists. +homepage: https://github.com/byorgey/split +license: bsd-3-clause +--- +Copyright (c) 2008 Brent Yorgey, Louis Wasserman + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of other contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/stm-chans.txt b/.licenses/semantic/cabal/stm-chans.txt new file mode 100644 index 000000000..ecf113cbe --- /dev/null +++ b/.licenses/semantic/cabal/stm-chans.txt @@ -0,0 +1,42 @@ +--- +type: cabal +name: stm-chans +version: 3.0.0.4 +summary: Additional types of channels for STM. +homepage: https://code.haskell.org/~wren/ +license: bsd-3-clause +--- +=== stm-chans license === + +Copyright (c) 2011--2013, wren gayle romano. +ALL RIGHTS RESERVED. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of the copyright holders nor the names of + other contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/stm.txt b/.licenses/semantic/cabal/stm.txt new file mode 100644 index 000000000..f9e939a80 --- /dev/null +++ b/.licenses/semantic/cabal/stm.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: stm +version: 2.4.5.0 +summary: Software Transactional Memory +homepage: https://wiki.haskell.org/Software_transactional_memory +license: bsd-3-clause +--- +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/.licenses/semantic/cabal/streaming-commons.txt b/.licenses/semantic/cabal/streaming-commons.txt new file mode 100644 index 000000000..9966cf83b --- /dev/null +++ b/.licenses/semantic/cabal/streaming-commons.txt @@ -0,0 +1,29 @@ +--- +type: cabal +name: streaming-commons +version: 0.1.19 +summary: Common lower-level functions needed by various streaming data libraries +homepage: https://github.com/fpco/streaming-commons +license: mit +--- +The MIT License (MIT) + +Copyright (c) 2014 FP Complete + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/.licenses/semantic/cabal/swagger2.txt b/.licenses/semantic/cabal/swagger2.txt new file mode 100644 index 000000000..3cfde18ad --- /dev/null +++ b/.licenses/semantic/cabal/swagger2.txt @@ -0,0 +1,36 @@ +--- +type: cabal +name: swagger2 +version: 2.1.6 +summary: Swagger 2.0 data model +homepage: https://github.com/GetShopTV/swagger2 +license: bsd-3-clause +--- +Copyright (c) 2015-2017, GetShopTV +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of swagger2 nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/.licenses/semantic/cabal/syb.txt b/.licenses/semantic/cabal/syb.txt new file mode 100644 index 000000000..f9f064d43 --- /dev/null +++ b/.licenses/semantic/cabal/syb.txt @@ -0,0 +1,91 @@ +--- +type: cabal +name: syb +version: '0.7' +summary: Scrap Your Boilerplate +homepage: https://www.cs.uu.nl/wiki/GenericProgramming/SYB +license: bsd-3-clause +--- +This library (libraries/syb) is derived from code from several +sources: + + * Code from the GHC project which is largely (c) The University of + Glasgow, and distributable under a BSD-style license (see below), + + * Code from the Haskell 98 Report which is (c) Simon Peyton Jones + and freely redistributable (but see the full license for + restrictions). + + * Code from the Haskell Foreign Function Interface specification, + which is (c) Manuel M. T. Chakravarty and freely redistributable + (but see the full license for restrictions). + +The full text of these licenses is reproduced below. All of the +licenses are BSD-style or compatible. + +----------------------------------------------------------------------------- + +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +----------------------------------------------------------------------------- + +Code derived from the document "Report on the Programming Language +Haskell 98", is distributed under the following license: + + Copyright (c) 2002 Simon Peyton Jones + + The authors intend this Report to belong to the entire Haskell + community, and so we grant permission to copy and distribute it for + any purpose, provided that it is reproduced in its entirety, + including this Notice. Modified versions of this Report may also be + copied and distributed for any purpose, provided that the modified + version is clearly presented as such, and that it does not claim to + be a definition of the Haskell 98 Language. + +----------------------------------------------------------------------------- + +Code derived from the document "The Haskell 98 Foreign Function +Interface, An Addendum to the Haskell 98 Report" is distributed under +the following license: + + Copyright (c) 2002 Manuel M. T. Chakravarty + + The authors intend this Report to belong to the entire Haskell + community, and so we grant permission to copy and distribute it for + any purpose, provided that it is reproduced in its entirety, + including this Notice. Modified versions of this Report may also be + copied and distributed for any purpose, provided that the modified + version is clearly presented as such, and that it does not claim to + be a definition of the Haskell 98 Foreign Function Interface. + +----------------------------------------------------------------------------- diff --git a/.licenses/semantic/cabal/system-fileio.txt b/.licenses/semantic/cabal/system-fileio.txt new file mode 100644 index 000000000..4fabfcc5d --- /dev/null +++ b/.licenses/semantic/cabal/system-fileio.txt @@ -0,0 +1,30 @@ +--- +type: cabal +name: system-fileio +version: 0.3.16.3 +summary: Consistent filesystem interaction across GHC versions (deprecated) +homepage: https://github.com/fpco/haskell-filesystem +license: mit +--- +Copyright (c) 2011 John Millikin + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/.licenses/semantic/cabal/system-filepath.txt b/.licenses/semantic/cabal/system-filepath.txt new file mode 100644 index 000000000..ba4899d33 --- /dev/null +++ b/.licenses/semantic/cabal/system-filepath.txt @@ -0,0 +1,30 @@ +--- +type: cabal +name: system-filepath +version: 0.4.14 +summary: High-level, byte-based file and directory path manipulations (deprecated) +homepage: https://github.com/fpco/haskell-filesystem +license: mit +--- +Copyright (c) 2010 John Millikin + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/.licenses/semantic/cabal/tagged.txt b/.licenses/semantic/cabal/tagged.txt new file mode 100644 index 000000000..471855725 --- /dev/null +++ b/.licenses/semantic/cabal/tagged.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: tagged +version: 0.8.5 +summary: Haskell 98 phantom types to avoid unsafely passing dummy arguments +homepage: https://github.com/ekmett/tagged +license: bsd-3-clause +--- +Copyright (c) 2009-2015 Edward Kmett +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Edward Kmett nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/template-haskell.txt b/.licenses/semantic/cabal/template-haskell.txt new file mode 100644 index 000000000..3966e0c06 --- /dev/null +++ b/.licenses/semantic/cabal/template-haskell.txt @@ -0,0 +1,40 @@ +--- +type: cabal +name: template-haskell +version: 2.12.0.0 +summary: Support library for Template Haskell +homepage: +license: bsd-3-clause +--- + +The Glasgow Haskell Compiler License + +Copyright 2002-2007, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/.licenses/semantic/cabal/temporary.txt b/.licenses/semantic/cabal/temporary.txt new file mode 100644 index 000000000..a053720ed --- /dev/null +++ b/.licenses/semantic/cabal/temporary.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: temporary +version: 1.2.1.1 +summary: Portable temporary file and directory support +homepage: https://github.com/feuerbach/temporary +license: bsd-3-clause +--- +Copyright + (c) 2003-2006, Isaac Jones + (c) 2005-2009, Duncan Coutts + (c) 2008, Maximilian Bolingbroke + ... and other contributors + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted +provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of + conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. + * Neither the name of Maximilian Bolingbroke nor the names of other contributors may be used to + endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/terminfo.txt b/.licenses/semantic/cabal/terminfo.txt new file mode 100644 index 000000000..d020aefdb --- /dev/null +++ b/.licenses/semantic/cabal/terminfo.txt @@ -0,0 +1,31 @@ +--- +type: cabal +name: terminfo +version: 0.4.1.0 +summary: Haskell bindings to the terminfo library. +homepage: https://github.com/judah/terminfo +license: bsd-2-clause +--- +Copyright 2007, Judah Jacobson. +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistribution of source code must retain the above copyright notice, +this list of conditions and the following disclamer. + +- Redistribution in binary form must reproduce the above copyright notice, +this list of conditions and the following disclamer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/text.txt b/.licenses/semantic/cabal/text.txt new file mode 100644 index 000000000..02bde9312 --- /dev/null +++ b/.licenses/semantic/cabal/text.txt @@ -0,0 +1,34 @@ +--- +type: cabal +name: text +version: 1.2.3.0 +summary: An efficient packed Unicode text type. +homepage: https://github.com/haskell/text +license: bsd-2-clause +--- +Copyright (c) 2008-2009, Tom Harper +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/tf-random.txt b/.licenses/semantic/cabal/tf-random.txt new file mode 100644 index 000000000..38e222713 --- /dev/null +++ b/.licenses/semantic/cabal/tf-random.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: tf-random +version: '0.5' +summary: High-quality splittable pseudorandom number generator +homepage: https://hub.darcs.net/michal.palka/tf-random +license: bsd-3-clause +--- +Copyright (c) 2012-2013, Michał Pałka + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * The names of the authors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/th-abstraction.txt b/.licenses/semantic/cabal/th-abstraction.txt new file mode 100644 index 000000000..2f3ea8686 --- /dev/null +++ b/.licenses/semantic/cabal/th-abstraction.txt @@ -0,0 +1,21 @@ +--- +type: cabal +name: th-abstraction +version: 0.2.6.0 +summary: Nicer interface for reified information about data types +homepage: https://github.com/glguy/th-abstraction +license: isc +--- +Copyright (c) 2017 Eric Mertens + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/.licenses/semantic/cabal/these.txt b/.licenses/semantic/cabal/these.txt new file mode 100644 index 000000000..fdf952411 --- /dev/null +++ b/.licenses/semantic/cabal/these.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: these +version: 0.7.4 +summary: An either-or-both data type & a generalized 'zip with padding' typeclass +homepage: https://github.com/isomorphism/these +license: bsd-3-clause +--- +Copyright (c)2012, C. McCann + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of C. McCann nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/time-locale-compat.txt b/.licenses/semantic/cabal/time-locale-compat.txt new file mode 100644 index 000000000..62f7aa1ec --- /dev/null +++ b/.licenses/semantic/cabal/time-locale-compat.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: time-locale-compat +version: 0.1.1.4 +summary: Compatibile module for time-format locale +homepage: https://github.com/khibino/haskell-time-locale-compat +license: bsd-3-clause +--- +Copyright (c) 2014, Kei Hibino + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Kei Hibino nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/time.txt b/.licenses/semantic/cabal/time.txt new file mode 100644 index 000000000..02ff5b949 --- /dev/null +++ b/.licenses/semantic/cabal/time.txt @@ -0,0 +1,18 @@ +--- +type: cabal +name: time +version: 1.8.0.2 +summary: A time library +homepage: https://github.com/haskell/time +license: bsd-2-clause +--- +TimeLib is Copyright (c) Ashley Yakeley, 2004-2014. All rights reserved. +Certain sections are Copyright 2004, The University Court of the University of Glasgow. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +- Neither name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/tls.txt b/.licenses/semantic/cabal/tls.txt new file mode 100644 index 000000000..ebd90e8f7 --- /dev/null +++ b/.licenses/semantic/cabal/tls.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: tls +version: 1.4.1 +summary: TLS/SSL protocol native implementation (Server and Client) +homepage: https://github.com/vincenthz/hs-tls +license: bsd-3-clause +--- +Copyright (c) 2010-2015 Vincent Hanquez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/transformers-base.txt b/.licenses/semantic/cabal/transformers-base.txt new file mode 100644 index 000000000..280a5ee80 --- /dev/null +++ b/.licenses/semantic/cabal/transformers-base.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: transformers-base +version: 0.4.4 +summary: Lift computations from the bottom of a transformer stack +homepage: https://github.com/mvv/transformers-base +license: bsd-3-clause +--- +Copyright (c) 2011, Mikhail Vorozhtsov, Bas van Dijk +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +- Neither the names of the copyright owners nor the names of the + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/.licenses/semantic/cabal/transformers-compat.txt b/.licenses/semantic/cabal/transformers-compat.txt new file mode 100644 index 000000000..622a339f1 --- /dev/null +++ b/.licenses/semantic/cabal/transformers-compat.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: transformers-compat +version: 0.5.1.4 +summary: A small compatibility shim exposing the new types from transformers 0.3 and + 0.4 to older Haskell platforms. +homepage: https://github.com/ekmett/transformers-compat/ +license: bsd-3-clause +--- +Copyright 2012-2015 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/transformers.txt b/.licenses/semantic/cabal/transformers.txt new file mode 100644 index 000000000..f898f0b46 --- /dev/null +++ b/.licenses/semantic/cabal/transformers.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: transformers +version: 0.5.2.0 +summary: Concrete functor and monad transformers +homepage: https://hub.darcs.net/ross/transformers +license: bsd-3-clause +--- +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/.licenses/semantic/cabal/turtle.txt b/.licenses/semantic/cabal/turtle.txt new file mode 100644 index 000000000..a268895f5 --- /dev/null +++ b/.licenses/semantic/cabal/turtle.txt @@ -0,0 +1,32 @@ +--- +type: cabal +name: turtle +version: 1.5.8 +summary: Shell programming, Haskell-style +homepage: +license: bsd-3-clause +--- +Copyright (c) 2017 Gabriel Gonzalez +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Gabriel Gonzalez nor the names of other contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/unix-compat.txt b/.licenses/semantic/cabal/unix-compat.txt new file mode 100644 index 000000000..77a13c922 --- /dev/null +++ b/.licenses/semantic/cabal/unix-compat.txt @@ -0,0 +1,37 @@ +--- +type: cabal +name: unix-compat +version: 0.5.0.1 +summary: Portable POSIX-compatibility layer. +homepage: https://github.com/jystic/unix-compat +license: bsd-3-clause +--- +Copyright (c) 2007-2008, Björn Bringert +Copyright (c) 2007-2009, Duncan Coutts +Copyright (c) 2010-2011, Jacob Stanley +Copyright (c) 2011, Bryan O'Sullivan +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +- Neither the names of the copyright owners nor the names of the + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/unix.txt b/.licenses/semantic/cabal/unix.txt new file mode 100644 index 000000000..d6942e9b1 --- /dev/null +++ b/.licenses/semantic/cabal/unix.txt @@ -0,0 +1,39 @@ +--- +type: cabal +name: unix +version: 2.7.2.2 +summary: POSIX functionality +homepage: https://github.com/haskell/unix +license: bsd-3-clause +--- +The Glasgow Haskell Compiler License + +Copyright 2004, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/.licenses/semantic/cabal/unordered-containers.txt b/.licenses/semantic/cabal/unordered-containers.txt new file mode 100644 index 000000000..1ce0da899 --- /dev/null +++ b/.licenses/semantic/cabal/unordered-containers.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: unordered-containers +version: 0.2.9.0 +summary: Efficient hashing-based container types +homepage: https://github.com/tibbe/unordered-containers +license: bsd-3-clause +--- +Copyright (c) 2010, Johan Tibell + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Johan Tibell nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/utf8-string.txt b/.licenses/semantic/cabal/utf8-string.txt new file mode 100644 index 000000000..8ce39c9bc --- /dev/null +++ b/.licenses/semantic/cabal/utf8-string.txt @@ -0,0 +1,32 @@ +--- +type: cabal +name: utf8-string +version: 1.0.1.1 +summary: Support for reading and writing UTF8 Strings +homepage: https://github.com/glguy/utf8-string/ +license: bsd-3-clause +--- +* Copyright (c) 2007, Galois Inc. +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of Galois Inc. nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY Galois Inc. ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL Galois Inc. BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/uuid-types.txt b/.licenses/semantic/cabal/uuid-types.txt new file mode 100644 index 000000000..5d5e5c73e --- /dev/null +++ b/.licenses/semantic/cabal/uuid-types.txt @@ -0,0 +1,36 @@ +--- +type: cabal +name: uuid-types +version: 1.0.3 +summary: Type definitions for Universally Unique Identifiers +homepage: https://github.com/aslatter/uuid +license: bsd-3-clause +--- +Copyright (c) 2008, Antoine Latter + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + * The names of the authors may not be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/vector-builder.txt b/.licenses/semantic/cabal/vector-builder.txt new file mode 100644 index 000000000..627b8ba54 --- /dev/null +++ b/.licenses/semantic/cabal/vector-builder.txt @@ -0,0 +1,30 @@ +--- +type: cabal +name: vector-builder +version: 0.3.4.1 +summary: Vector builder +homepage: https://github.com/nikita-volkov/vector-builder +license: mit +--- +Copyright (c) 2016, Nikita Volkov + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/.licenses/semantic/cabal/vector-instances.txt b/.licenses/semantic/cabal/vector-instances.txt new file mode 100644 index 000000000..30ca5c063 --- /dev/null +++ b/.licenses/semantic/cabal/vector-instances.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: vector-instances +version: '3.4' +summary: Orphan Instances for 'Data.Vector' +homepage: https://github.com/ekmett/vector-instances +license: bsd-3-clause +--- +Copyright (c)2010, Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Edward Kmett nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/vector-th-unbox.txt b/.licenses/semantic/cabal/vector-th-unbox.txt new file mode 100644 index 000000000..f620b6c8b --- /dev/null +++ b/.licenses/semantic/cabal/vector-th-unbox.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: vector-th-unbox +version: 0.2.1.6 +summary: Deriver for Data.Vector.Unboxed using Template Haskell +homepage: +license: bsd-3-clause +--- +Copyright (c) 2012−2015, Liyang HU + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Liyang HU nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/vector.txt b/.licenses/semantic/cabal/vector.txt new file mode 100644 index 000000000..62b837bc2 --- /dev/null +++ b/.licenses/semantic/cabal/vector.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: vector +version: 0.12.0.1 +summary: Efficient Arrays +homepage: https://github.com/haskell/vector +license: bsd-3-clause +--- +Copyright (c) 2008-2012, Roman Leshchinskiy +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + diff --git a/.licenses/semantic/cabal/void.txt b/.licenses/semantic/cabal/void.txt new file mode 100644 index 000000000..947443cd9 --- /dev/null +++ b/.licenses/semantic/cabal/void.txt @@ -0,0 +1,38 @@ +--- +type: cabal +name: void +version: 0.7.2 +summary: A Haskell 98 logically uninhabited data type +homepage: https://github.com/ekmett/void +license: bsd-3-clause +--- +Copyright 2015 Edward Kmett + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/wl-pprint.txt b/.licenses/semantic/cabal/wl-pprint.txt new file mode 100644 index 000000000..f1f23284d --- /dev/null +++ b/.licenses/semantic/cabal/wl-pprint.txt @@ -0,0 +1,33 @@ +--- +type: cabal +name: wl-pprint +version: 1.2.1 +summary: The Wadler/Leijen Pretty Printer +homepage: +license: bsd-2-clause +--- +Copyright 2000, Daan Leijen. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +This software is provided by the copyright holders "as is" and any +express or implied warranties, including, but not limited to, the +implied warranties of merchantability and fitness for a particular +purpose are disclaimed. In no event shall the copyright holders be +liable for any direct, indirect, incidental, special, exemplary, or +consequential damages (including, but not limited to, procurement of +substitute goods or services; loss of use, data, or profits; or +business interruption) however caused and on any theory of liability, +whether in contract, strict liability, or tort (including negligence +or otherwise) arising in any way out of the use of this software, even +if advised of the possibility of such damage. diff --git a/.licenses/semantic/cabal/x509-store.txt b/.licenses/semantic/cabal/x509-store.txt new file mode 100644 index 000000000..6afd0e05c --- /dev/null +++ b/.licenses/semantic/cabal/x509-store.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: x509-store +version: 1.6.6 +summary: X.509 collection accessing and storing methods +homepage: https://github.com/vincenthz/hs-certificate +license: bsd-3-clause +--- +Copyright (c) 2010-2013 Vincent Hanquez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/x509-system.txt b/.licenses/semantic/cabal/x509-system.txt new file mode 100644 index 000000000..788bd0b55 --- /dev/null +++ b/.licenses/semantic/cabal/x509-system.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: x509-system +version: 1.6.6 +summary: Handle per-operating-system X.509 accessors and storage +homepage: https://github.com/vincenthz/hs-certificate +license: bsd-3-clause +--- +Copyright (c) 2010-2013 Vincent Hanquez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/x509-validation.txt b/.licenses/semantic/cabal/x509-validation.txt new file mode 100644 index 000000000..d7ee685b7 --- /dev/null +++ b/.licenses/semantic/cabal/x509-validation.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: x509-validation +version: 1.6.10 +summary: X.509 Certificate and CRL validation +homepage: https://github.com/vincenthz/hs-certificate +license: bsd-3-clause +--- +Copyright (c) 2010-2013 Vincent Hanquez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/x509.txt b/.licenses/semantic/cabal/x509.txt new file mode 100644 index 000000000..bf711cf7c --- /dev/null +++ b/.licenses/semantic/cabal/x509.txt @@ -0,0 +1,35 @@ +--- +type: cabal +name: x509 +version: 1.7.3 +summary: X509 reader and writer +homepage: https://github.com/vincenthz/hs-certificate +license: bsd-3-clause +--- +Copyright (c) 2010-2013 Vincent Hanquez + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the author nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/.licenses/semantic/cabal/zlib.txt b/.licenses/semantic/cabal/zlib.txt new file mode 100644 index 000000000..379c231dc --- /dev/null +++ b/.licenses/semantic/cabal/zlib.txt @@ -0,0 +1,32 @@ +--- +type: cabal +name: zlib +version: 0.6.2 +summary: Compression and decompression in the gzip and zlib formats +homepage: +license: bsd-3-clause +--- +Copyright (c) 2006-2016, Duncan Coutts +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. This clause is intentionally left blank. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/proto/code_analysis.proto b/proto/code_analysis.proto index e02ac1c56..059b615e6 100644 --- a/proto/code_analysis.proto +++ b/proto/code_analysis.proto @@ -1,10 +1,16 @@ syntax = "proto3"; + +package github.semantic; + +import "ruby.proto"; +import "json.proto"; +import "typescript.proto"; import "types.proto"; import "error_details.proto"; option java_package = "com.github.semantic.analysis"; option go_package = "github.com/semantic/analysis/;analysis"; -package github.semantic; + // Semantic's CodeAnalysis service provides endpoints for parsing, analyzing, and // comparing source code. @@ -12,7 +18,7 @@ service CodeAnalysis { // Parsing // // Parse source code blobs and return abstract syntax trees. - rpc ParseTree(ParseTreeRequest) returns (ParseTreeResponse); + rpc ParseTree (ParseTreeRequest) returns (ParseTreeResponse); // Diffing // @@ -37,8 +43,23 @@ message ParseTreeRequest { } message ParseTreeResponse { - bytes json_tree = 1; - repeated ParseError errors = 2; + oneof response_type { + RubyResponse ruby = 1; + JSONResponse json = 2; + TypeScriptResponse typescript = 3; + } +} + +message RubyResponse { + repeated ruby.RubyTerm terms = 1; +} + +message JSONResponse { + repeated json.JSONTerm terms = 1; +} + +message TypeScriptResponse { + repeated typescript.TypeScriptTerm terms = 1; } message SummarizeDiffRequest { diff --git a/proto/error_details.proto b/proto/error_details.proto index cfaab5347..d3b573059 100644 --- a/proto/error_details.proto +++ b/proto/error_details.proto @@ -14,7 +14,7 @@ syntax = "proto3"; -package google.rpc; +package github.semantic; // import "google/protobuf/duration.proto"; diff --git a/proto/json.proto b/proto/json.proto new file mode 100644 index 000000000..39286ab97 --- /dev/null +++ b/proto/json.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; + +package github.semantic.json; + +import "types.proto"; + +option java_package = "com.github.semantic.json"; +option go_package = "github.com/semantic/json;json"; + +message JSONTerm { + JSONSyntax syntax = 1; +} + +message JSONSyntax { + oneof syntax { + Null null = 1; + Array array = 2; + Boolean boolean = 3; + Hash hash = 4; + Float float = 5; + KeyValue keyValue = 6; + TextElement textElement = 7; + Error error = 8; + } +} + +message Null { } + +message Array { + repeated JSONTerm arrayElements = 1; +} + +message Boolean { + bool booleanContent = 1; +} + +message Hash { + repeated JSONTerm hashElements = 1; +} + +message Float { + string floatContent = 1; +} + +message KeyValue { + JSONTerm key = 1; + JSONTerm value = 2; +} + +message TextElement { + string textElementContent = 1; +} + +message Error { + repeated ErrorSite errorCallStack = 1; + repeated string errorExpected = 2; + string errorActual = 3; + repeated JSONTerm errorChildren = 4; +} diff --git a/proto/ruby.proto b/proto/ruby.proto new file mode 100644 index 000000000..9d72b4f69 --- /dev/null +++ b/proto/ruby.proto @@ -0,0 +1,480 @@ +syntax = "proto3"; + +package github.semantic.ruby; + +import "types.proto"; + +option java_package = "com.github.semantic.ruby"; +option go_package = "github.com/semantic/ruby;ruby"; + +message RubyTerm { + RubySyntax syntax = 1; +} + +message Comment { + string commentContent = 1; +} + +message Function { + repeated RubyTerm functionContext = 1; + RubyTerm functionName = 2; + repeated RubyTerm functionParameters = 3; + RubyTerm functionBody = 4; +} + +message Method { + repeated RubyTerm methodContext = 1; + RubyTerm methodReceiver = 2; + RubyTerm methodName = 3; + repeated RubyTerm methodParameters = 4; + RubyTerm methodBody = 5; +} + +message File { } + +message Line { } + +message Error { + repeated ErrorSite errorCallStack = 1; + repeated string errorExpected = 2; + string errorActual = 3; + repeated RubyTerm errorChildren = 4; +} + +message And { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message BAnd { + RubyTerm left = 1; + RubyTerm right = 2; +} + +message BOr { + RubyTerm left = 1; + RubyTerm right = 2; +} + +message BXOr { + RubyTerm left = 1; + RubyTerm right = 2; +} + +message Call { + repeated RubyTerm callContext = 1; + RubyTerm callFunction = 2; + repeated RubyTerm callParams = 3; + RubyTerm callBlock = 4; +} + +message Comparison { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message Complement { + RubyTerm value = 1; +} + +message DividedBy { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message Enumeration { + RubyTerm enumerationStart = 1; + RubyTerm enumerationEnd = 2; + RubyTerm enumerationStep = 3; +} + +message Equal { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message FloorDivision { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message GreaterThan { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message GreaterThanEqual { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message LShift { + RubyTerm left = 1; + RubyTerm right = 2; +} + +message LessThan { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message LessThanEqual { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message Matches { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message Member { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message MemberAccess { + RubyTerm lhs = 1; + bytes rhs = 2; +} + +message Minus { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message Modulo { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message Negate { + RubyTerm term = 1; +} + +message Not { + RubyTerm term = 1; +} + +message NotMatches { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message Or { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message Plus { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message Power { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message RShift { + RubyTerm left = 1; + RubyTerm right = 2; +} + +message ScopeResolution { + repeated RubyTerm scopes = 1; +} + +message StrictEqual { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message Subscript { + RubyTerm lhs = 1; + repeated RubyTerm rhs = 2; +} + +message Times { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message XOr { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message Array { + repeated RubyTerm arrayElements = 1; +} + +message Boolean { + bool booleanContent = 1; +} + +message Complex { + string value = 1; +} + +message Float { + string floatContent = 1; +} + +message Hash { + repeated RubyTerm hashElements = 1; +} + +message Integer { + string integerContent = 1; +} + +message KeyValue { + RubyTerm key = 1; + RubyTerm value = 2; +} + +message Null { } + +message Rational { + string value = 1; +} + +message Regex { + string regexContent = 1; +} + +message String { + repeated RubyTerm stringElements = 1; +} + +message Symbol { + string symbolContent = 1; +} + +message TextElement { + string textElementContent = 1; +} + +message Class { + RubyTerm classIdentifier = 1; + repeated RubyTerm classSuperClass = 2; + RubyTerm classBody = 3; +} + +message Load { + RubyTerm loadPath = 1; + repeated RubyTerm loadWrap = 2; +} + +message LowPrecedenceAnd { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message LowPrecedenceOr { + RubyTerm lhs = 1; + RubyTerm rhs = 2; +} + +message Module { + RubyTerm moduleIdentifier = 1; + repeated RubyTerm moduleStatements = 2; +} + +message Require { + bool requireRelative = 1; + RubyTerm requirePath = 2; +} + +message Send { + repeated RubyTerm sendReceiver = 1; + repeated RubyTerm sendSelector = 2; + repeated RubyTerm sendArgs = 3; + repeated RubyTerm sendBlock = 4; +} + +message Assignment { + repeated RubyTerm assignmentContext = 1; + RubyTerm assignmentTarget = 2; + RubyTerm assignmentValue = 3; +} + +message Break { + RubyTerm term = 1; +} + +message Catch { + RubyTerm catchException = 1; + RubyTerm catchBody = 2; +} + +message Continue { + RubyTerm term = 1; +} + +message Else { + RubyTerm elseCondition = 1; + RubyTerm elseBody = 2; +} + +message Finally { + RubyTerm term = 1; +} + +message ForEach { + RubyTerm forEachBinding = 1; + RubyTerm forEachSubject = 2; + RubyTerm forEachBody = 3; +} + +message If { + RubyTerm ifCondition = 1; + RubyTerm ifThenBody = 2; + RubyTerm ifElseBody = 3; +} + +message Match { + RubyTerm matchSubject = 1; + RubyTerm matchPatterns = 2; +} + +message Pattern { + RubyTerm value = 1; + RubyTerm patternBody = 2; +} + +message Retry { + RubyTerm term = 1; +} + +message Return { + RubyTerm term = 1; +} + +message ScopeEntry { + repeated RubyTerm terms = 1; +} + +message ScopeExit { + repeated RubyTerm terms = 1; +} + +message Statements { + repeated RubyTerm statements = 1; +} + +message Try { + RubyTerm tryBody = 1; + repeated RubyTerm tryCatch = 2; +} + +message While { + RubyTerm whileCondition = 1; + RubyTerm whileBody = 2; +} + +message Yield { + RubyTerm term = 1; +} + +message RubySyntax { + oneof syntax { + Comment comment = 1; + Function function = 2; + Boolean boolean = 3; + Method method = 4; + File file = 5; + Line line = 6; + Plus plus = 7; + Minus minus = 8; + Times times = 9; + DividedBy dividedBy = 10; + Modulo modulo = 11; + Power power = 12; + Negate negate = 13; + FloorDivision floorDivision = 14; + BAnd bAnd = 15; + BOr bOr = 16; + BXOr bXOr = 17; + LShift lShift = 18; + RShift rShift = 19; + Complement complement = 20; + And and = 21; + Not not = 22; + Or or = 23; + XOr xOr = 24; + Call call = 25; + LessThan lessThan = 26; + LessThanEqual lessThanEqual = 27; + GreaterThan greaterThan = 28; + GreaterThanEqual greaterThanEqual = 29; + Equal equal = 30; + StrictEqual strictEqual = 31; + Comparison comparison = 32; + Enumeration enumeration = 33; + Matches matches = 34; + NotMatches notMatches = 35; + MemberAccess memberAccess = 36; + ScopeResolution scopeResolution = 37; + Subscript subscript = 38; + Member member = 39; + Array array = 40; + Complex complex = 41; + Float float = 42; + Hash hash = 43; + Integer integer = 44; + KeyValue keyValue = 45; + Null null = 46; + Rational rational = 47; + Regex regex = 48; + String string = 49; + Symbol symbol = 50; + TextElement textElement = 51; + Assignment assignment = 52; + Break break = 53; + Catch catch = 54; + Continue continue = 55; + Else else = 56; + Finally finally = 57; + ForEach forEach = 58; + If if = 59; + Match match = 60; + Pattern pattern = 61; + Retry retry = 62; + Return return = 63; + ScopeEntry scopeEntry = 64; + ScopeExit scopeExit = 65; + Statements statements = 66; + Try try = 67; + While while = 68; + Yield yield = 69; + Context context = 70; + Empty empty = 71; + Error error = 72; + Identifier identifier = 73; + Class class = 74; + Load load = 75; + LowPrecedenceAnd lowPrecedenceAnd = 76; + LowPrecedenceOr lowPrecedenceOr = 77; + Module module = 78; + Require require = 79; + Send send = 80; + List list = 81; + } +} + +message Context { + repeated RubyTerm contextTerms = 1; + RubyTerm contextSubject = 2; +} + +message Empty { } + +message Identifier { + bytes name = 1; +} + +message List { + repeated RubyTerm listContent = 1; +} diff --git a/proto/types.proto b/proto/types.proto index cd6523670..22dc2f2bf 100644 --- a/proto/types.proto +++ b/proto/types.proto @@ -1,67 +1,81 @@ syntax = "proto3"; + package github.semantic; + option java_package = "com.github.semantic.types"; option go_package = "github.com/semantic/types;types"; -enum Language {UNKNOWN = 0; - GO = 1; - HASKELL = 2; - JAVA = 3; - JAVASCRIPT = 4; - JSON = 5; - JSX = 6; - MARKDOWN = 7; - PYTHON = 8; - RUBY = 9; - TYPESCRIPT = 10; - PHP = 11;} -enum VertexType {PACKAGE = 0; - MODULE = 1; - VARIABLE = 2;} -message Blob { bytes blobSource = 1; - string blobPath = 2; - Language blobLanguage = 3; - } -message Pos { int64 posLine = 1; - int64 posColumn = 2; - } -message Span { Pos spanStart = 1; - Pos spanEnd = 2; - } -message ImportGraph { repeated Vertex graphVertices = 1; - repeated Edge graphEdges = 2; - } -message Vertex { VertexType vertexType = 1; - string vertexContents = 2; - uint64 vertexTag = 3; - } -message Edge { uint64 edgeFrom = 1; - uint64 edgeTo = 2; - } -message Project { string projectRootDir = 1; - repeated Blob projectBlobs = 2; - Language projectLanguage = 3; - repeated string projectExcludeDirs = 4 [packed = false]; - } -message Array { repeated Term arrayElements = 1; - } -message Boolean { bool booleanContent = 1; - } -message Hash { repeated Term hashElements = 1; - } -message Float { string floatContent = 1; - } -message KeyValue { Term key = 1; - Term value = 2; - } -message Null { - } -message TextElement { string textElementContent = 1; - } -message Term { oneof syntax {Array array = 1; - Boolean boolean = 2; - Hash hash = 3; - Float float = 4; - KeyValue keyValue = 5; - Null null = 6; - TextElement textElement = 7;} - } \ No newline at end of file + +enum Language { + UNKNOWN = 0; + GO = 1; + HASKELL = 2; + JAVA = 3; + JAVASCRIPT = 4; + JSON = 5; + JSX = 6; + MARKDOWN = 7; + PYTHON = 8; + RUBY = 9; + TYPESCRIPT = 10; + PHP = 11; +} + +enum VertexType { + PACKAGE = 0; + MODULE = 1; + VARIABLE = 2; +} + +message Blob { + bytes blobSource = 1; + string blobPath = 2; + Language blobLanguage = 3; +} + +message Edge { + uint64 edgeFrom = 1; + uint64 edgeTo = 2; +} + +message ErrorSite { + string errorMessage = 1; + SrcLoc errorLocation = 2; +} + +message ImportGraph { + repeated Vertex graphVertices = 1; + repeated Edge graphEdges = 2; +} + +message Pos { + int64 posLine = 1; + int64 posColumn = 2; +} + +message Project { + string projectRootDir = 1; + repeated Blob projectBlobs = 2; + Language projectLanguage = 3; + repeated string projectExcludeDirs = 4[packed = false] ; +} + +message Span { + Pos spanStart = 1; + Pos spanEnd = 2; +} + +message SrcLoc { + string srcLocPackage = 1; + string srcLocModule = 2; + string srcLocFile = 3; + int64 srcLocStartLine = 4; + int64 srcLocStartCol = 5; + int64 srcLocEndLine = 6; + int64 srcLocEndCol = 7; +} + +message Vertex { + VertexType vertexType = 1; + string vertexContents = 2; + uint64 vertexTag = 3; +} diff --git a/proto/typescript.proto b/proto/typescript.proto new file mode 100644 index 000000000..e3fdb4f56 --- /dev/null +++ b/proto/typescript.proto @@ -0,0 +1,962 @@ +syntax = "proto3"; + +package github.semantic.typescript; + +import "types.proto"; + +option java_package = "com.github.semantic.typescript"; +option go_package = "github.com/semantic/typescript;typescript"; + +message TypeScriptTerm { + TypeScriptSyntax syntax = 1; +} + +message Alias { + bytes aliasValue = 1; + bytes aliasName = 2; +} + +message ImportPath { + string unPath = 1; + IsRelative pathIsRelative = 2; +} + +enum IsRelative { + Unknown = 0; + Relative = 1; + NonRelative = 2; +} + +message TypeScriptSyntax { + oneof syntax { + Comment comment = 1; + HashBang hashBang = 2; + Class class = 3; + Function function = 4; + Method method = 5; + MethodSignature methodSignature = 6; + InterfaceDeclaration interfaceDeclaration = 7; + PublicFieldDefinition publicFieldDefinition = 8; + VariableDeclaration variableDeclaration = 9; + TypeAlias typeAlias = 10; + Plus plus = 11; + Minus minus = 12; + Times times = 13; + DividedBy dividedBy = 14; + Modulo modulo = 15; + Power power = 16; + Negate negate = 17; + FloorDivision floorDivision = 18; + BAnd bAnd = 19; + BOr bOr = 20; + BXOr bXOr = 21; + LShift lShift = 22; + RShift rShift = 23; + UnsignedRShift unsignedRShift = 24; + Complement complement = 25; + And and = 26; + Not not = 27; + Or or = 28; + XOr xOr = 29; + Call call = 30; + Cast cast = 31; + LessThan lessThan = 32; + LessThanEqual lessThanEqual = 33; + GreaterThan greaterThan = 34; + GreaterThanEqual greaterThanEqual = 35; + Equal equal = 36; + StrictEqual strictEqual = 37; + Comparison comparison = 38; + Enumeration enumeration = 39; + MemberAccess memberAccess = 40; + NonNullExpression nonNullExpression = 41; + ScopeResolution scopeResolution = 42; + SequenceExpression sequenceExpression = 43; + Subscript subscript = 44; + Member member = 45; + Delete delete = 46; + Void void = 47; + Typeof typeof = 48; + InstanceOf instanceOf = 49; + New new = 50; + Await await = 51; + Array array = 52; + Boolean boolean = 53; + Float float = 54; + Hash hash = 55; + Integer integer = 56; + KeyValue keyValue = 57; + Null null = 58; + String string = 59; + TextElement textElement = 60; + Regex regex = 61; + Assignment assignment = 62; + Break break = 63; + Catch catch = 64; + Continue continue = 65; + DoWhile doWhile = 66; + Else else = 67; + Finally finally = 68; + For for = 69; + ForEach forEach = 70; + If if = 71; + Match match = 72; + Pattern pattern = 73; + Retry retry = 74; + Return return = 75; + ScopeEntry scopeEntry = 76; + ScopeExit scopeExit = 77; + Statements statements = 78; + Throw throw = 79; + Try try = 80; + While while = 81; + Yield yield = 82; + AccessibilityModifier accessibilityModifier = 83; + Empty empty = 84; + Error error = 85; + Identifier identifier = 86; + Context context = 87; + Readonly readonly = 88; + TypeParameters typeParameters = 89; + TypeParameter typeParameter = 90; + Constraint constraint = 91; + ParenthesizedType parenthesizedType = 92; + DefaultType defaultType = 93; + PredefinedType predefinedType = 94; + TypeIdentifier typeIdentifier = 95; + NestedIdentifier nestedIdentifier = 96; + NestedTypeIdentifier nestedTypeIdentifier = 97; + GenericType genericType = 98; + TypeArguments typeArguments = 99; + TypePredicate typePredicate = 100; + CallSignature callSignature = 101; + ConstructSignature constructSignature = 102; + ArrayType arrayType = 103; + LookupType lookupType = 104; + FlowMaybeType flowMaybeType = 105; + TypeQuery typeQuery = 106; + IndexTypeQuery indexTypeQuery = 107; + ThisType thisType = 108; + ExistentialType existentialType = 109; + AbstractMethodSignature abstractMethodSignature = 110; + IndexSignature indexSignature = 111; + ObjectType objectType = 112; + LiteralType literalType = 113; + Union union = 114; + Intersection intersection = 115; + Module module = 116; + InternalModule internalModule = 117; + FunctionType functionType = 118; + Tuple tuple = 119; + Constructor constructor = 120; + TypeAssertion typeAssertion = 121; + ImportAlias importAlias = 122; + Debugger debugger = 123; + ShorthandPropertyIdentifier shorthandPropertyIdentifier = 124; + Super super = 125; + Undefined undefined = 126; + ClassHeritage classHeritage = 127; + AbstractClass abstractClass = 128; + ImplementsClause implementsClause = 129; + JsxElement jsxElement = 130; + JsxSelfClosingElement jsxSelfClosingElement = 131; + JsxOpeningElement jsxOpeningElement = 132; + JsxText jsxText = 133; + JsxClosingElement jsxClosingElement = 134; + JsxExpression jsxExpression = 135; + JsxAttribute jsxAttribute = 136; + JsxFragment jsxFragment = 137; + JsxNamespaceName jsxNamespaceName = 138; + OptionalParameter optionalParameter = 139; + RequiredParameter requiredParameter = 140; + RestParameter restParameter = 141; + PropertySignature propertySignature = 142; + AmbientDeclaration ambientDeclaration = 143; + EnumDeclaration enumDeclaration = 144; + ExtendsClause extendsClause = 145; + AmbientFunction ambientFunction = 146; + ImportRequireClause importRequireClause = 147; + ImportClause importClause = 148; + LabeledStatement labeledStatement = 149; + Annotation annotation = 150; + With with = 151; + ForOf forOf = 152; + This this = 153; + Update update = 154; + ComputedPropertyName computedPropertyName = 155; + Decorator decorator = 156; + Import import = 157; + QualifiedAliasedImport qualifiedAliasedImport = 158; + SideEffectImport sideEffectImport = 159; + DefaultExport defaultExport = 160; + QualifiedExport qualifiedExport = 161; + QualifiedExportFrom qualifiedExportFrom = 162; + JavaScriptRequire javaScriptRequire = 163; + List list = 164; + } +} + +message Comment { + string commentContent = 1; +} + +message HashBang { + string value = 1; +} + +message Class { + repeated TypeScriptTerm classContext = 1; + TypeScriptTerm classIdentifier = 2; + repeated TypeScriptTerm classSuperclasses = 3; + TypeScriptTerm classBody = 4; +} + +message Function { + repeated TypeScriptTerm functionContext = 1; + TypeScriptTerm functionName = 2; + repeated TypeScriptTerm functionParameters = 3; + TypeScriptTerm functionBody = 4; +} + +message Method { + repeated TypeScriptTerm methodContext = 1; + TypeScriptTerm methodReceiver = 2; + TypeScriptTerm methodName = 3; + repeated TypeScriptTerm methodParameters = 4; + TypeScriptTerm methodBody = 5; +} + +message MethodSignature { + repeated TypeScriptTerm methodSignatureContext = 1; + TypeScriptTerm methodSignatureName = 2; + repeated TypeScriptTerm methodSignatureParameters = 3; +} + +message InterfaceDeclaration { + repeated TypeScriptTerm interfaceDeclarationContext = 1; + TypeScriptTerm interfaceDeclarationIdentifier = 2; + TypeScriptTerm interfaceDeclarationBody = 3; +} + +message PublicFieldDefinition { + repeated TypeScriptTerm publicFieldContext = 1; + TypeScriptTerm publicFieldPropertyName = 2; + TypeScriptTerm publicFieldValue = 3; +} + +message VariableDeclaration { + repeated TypeScriptTerm variableDeclarations = 1; +} + +message TypeAlias { + repeated TypeScriptTerm typeAliasContext = 1; + TypeScriptTerm typeAliasIdentifier = 2; + TypeScriptTerm typeAliasKind = 3; +} + +message Plus { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message Minus { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message Times { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message DividedBy { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message Modulo { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message Power { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message Negate { + TypeScriptTerm term = 1; +} + +message FloorDivision { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message BAnd { + TypeScriptTerm left = 1; + TypeScriptTerm right = 2; +} + +message BOr { + TypeScriptTerm left = 1; + TypeScriptTerm right = 2; +} + +message BXOr { + TypeScriptTerm left = 1; + TypeScriptTerm right = 2; +} + +message LShift { + TypeScriptTerm left = 1; + TypeScriptTerm right = 2; +} + +message RShift { + TypeScriptTerm left = 1; + TypeScriptTerm right = 2; +} + +message UnsignedRShift { + TypeScriptTerm left = 1; + TypeScriptTerm right = 2; +} + +message Complement { + TypeScriptTerm value = 1; +} + +message And { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message Not { + TypeScriptTerm term = 1; +} + +message Or { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message XOr { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message Call { + repeated TypeScriptTerm callContext = 1; + TypeScriptTerm callFunction = 2; + repeated TypeScriptTerm callParams = 3; + TypeScriptTerm callBlock = 4; +} + +message Cast { + TypeScriptTerm castSubject = 1; + TypeScriptTerm castType = 2; +} + +message LessThan { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message LessThanEqual { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message GreaterThan { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message GreaterThanEqual { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message Equal { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message StrictEqual { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message Comparison { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message Enumeration { + TypeScriptTerm enumerationStart = 1; + TypeScriptTerm enumerationEnd = 2; + TypeScriptTerm enumerationStep = 3; +} + +message MemberAccess { + TypeScriptTerm lhs = 1; + bytes rhs = 2; +} + +message NonNullExpression { + TypeScriptTerm nonNullExpression = 1; +} + +message ScopeResolution { + repeated TypeScriptTerm scopes = 1; +} + +message SequenceExpression { + TypeScriptTerm firstExpression = 1; + TypeScriptTerm secondExpression = 2; +} + +message Subscript { + TypeScriptTerm lhs = 1; + repeated TypeScriptTerm rhs = 2; +} + +message Member { + TypeScriptTerm lhs = 1; + TypeScriptTerm rhs = 2; +} + +message Delete { + TypeScriptTerm value = 1; +} + +message Void { + TypeScriptTerm value = 1; +} + +message Typeof { + TypeScriptTerm value = 1; +} + +message InstanceOf { + TypeScriptTerm instanceOfSubject = 1; + TypeScriptTerm instanceOfObject = 2; +} + +message New { + repeated TypeScriptTerm newSubject = 1; +} + +message Await { + TypeScriptTerm awaitSubject = 1; +} + +message Array { + repeated TypeScriptTerm arrayElements = 1; +} + +message Boolean { + bool booleanContent = 1; +} + +message Float { + string floatContent = 1; +} + +message Hash { + repeated TypeScriptTerm hashElements = 1; +} + +message Integer { + string integerContent = 1; +} + +message KeyValue { + TypeScriptTerm key = 1; + TypeScriptTerm value = 2; +} + +message Null { } + +message String { + repeated TypeScriptTerm stringElements = 1; +} + +message TextElement { + string textElementContent = 1; +} + +message Regex { + string regexContent = 1; +} + +message Assignment { + repeated TypeScriptTerm assignmentContext = 1; + TypeScriptTerm assignmentTarget = 2; + TypeScriptTerm assignmentValue = 3; +} + +message Break { + TypeScriptTerm term = 1; +} + +message Catch { + TypeScriptTerm catchException = 1; + TypeScriptTerm catchBody = 2; +} + +message Continue { + TypeScriptTerm term = 1; +} + +message DoWhile { + TypeScriptTerm doWhileCondition = 1; + TypeScriptTerm doWhileBody = 2; +} + +message Else { + TypeScriptTerm elseCondition = 1; + TypeScriptTerm elseBody = 2; +} + +message Finally { + TypeScriptTerm term = 1; +} + +message For { + TypeScriptTerm forBefore = 1; + TypeScriptTerm forCondition = 2; + TypeScriptTerm forStep = 3; + TypeScriptTerm forBody = 4; +} + +message ForEach { + TypeScriptTerm forEachBinding = 1; + TypeScriptTerm forEachSubject = 2; + TypeScriptTerm forEachBody = 3; +} + +message If { + TypeScriptTerm ifCondition = 1; + TypeScriptTerm ifThenBody = 2; + TypeScriptTerm ifElseBody = 3; +} + +message Match { + TypeScriptTerm matchSubject = 1; + TypeScriptTerm matchPatterns = 2; +} + +message Pattern { + TypeScriptTerm value = 1; + TypeScriptTerm patternBody = 2; +} + +message Retry { + TypeScriptTerm term = 1; +} + +message Return { + TypeScriptTerm term = 1; +} + +message ScopeEntry { + repeated TypeScriptTerm terms = 1; +} + +message ScopeExit { + repeated TypeScriptTerm terms = 1; +} + +message Statements { + repeated TypeScriptTerm statements = 1; +} + +message Throw { + TypeScriptTerm value = 1; +} + +message Try { + TypeScriptTerm tryBody = 1; + repeated TypeScriptTerm tryCatch = 2; +} + +message While { + TypeScriptTerm whileCondition = 1; + TypeScriptTerm whileBody = 2; +} + +message Yield { + TypeScriptTerm term = 1; +} + +message AccessibilityModifier { + string contents = 1; +} + +message Empty { } + +message Error { + repeated ErrorSite errorCallStack = 1; + repeated string errorExpected = 2; + string errorActual = 3; + repeated TypeScriptTerm errorChildren = 4; +} + +message Identifier { + bytes name = 1; +} + +message Context { + repeated TypeScriptTerm contextTerms = 1; + TypeScriptTerm contextSubject = 2; +} + +message Readonly { } + +message TypeParameters { + repeated TypeScriptTerm terms = 1; +} + +message TypeParameter { + TypeScriptTerm typeParameter = 1; + TypeScriptTerm typeParameterConstraint = 2; + TypeScriptTerm typeParameterDefaultType = 3; +} + +message Constraint { + TypeScriptTerm constraintType = 1; +} + +message ParenthesizedType { + TypeScriptTerm parenthesizedType = 1; +} + +message DefaultType { + TypeScriptTerm defaultType = 1; +} + +message PredefinedType { + string predefinedType = 1; +} + +message TypeIdentifier { + string contents = 1; +} + +message NestedIdentifier { + TypeScriptTerm left = 1; + TypeScriptTerm right = 2; +} + +message NestedTypeIdentifier { + TypeScriptTerm left = 1; + TypeScriptTerm right = 2; +} + +message GenericType { + TypeScriptTerm genericTypeIdentifier = 1; + TypeScriptTerm genericTypeArguments = 2; +} + +message TypeArguments { + repeated TypeScriptTerm typeArguments = 1; +} + +message TypePredicate { + TypeScriptTerm typePredicateIdentifier = 1; + TypeScriptTerm typePredicateType = 2; +} + +message CallSignature { + TypeScriptTerm callSignatureTypeParameters = 1; + repeated TypeScriptTerm callSignatureParameters = 2; + TypeScriptTerm callSignatureType = 3; +} + +message ConstructSignature { + TypeScriptTerm constructSignatureTypeParameters = 1; + repeated TypeScriptTerm constructSignatureParameters = 2; + TypeScriptTerm constructSignatureType = 3; +} + +message ArrayType { + TypeScriptTerm arrayType = 1; +} + +message LookupType { + TypeScriptTerm lookupTypeIdentifier = 1; + TypeScriptTerm lookupTypeKey = 2; +} + +message FlowMaybeType { + TypeScriptTerm flowMaybeType = 1; +} + +message TypeQuery { + TypeScriptTerm typeQuerySubject = 1; +} + +message IndexTypeQuery { + TypeScriptTerm indexTypeQuerySubject = 1; +} + +message ThisType { + string contents = 1; +} + +message ExistentialType { + string contents = 1; +} + +message AbstractMethodSignature { + repeated TypeScriptTerm abstractMethodSignatureContext = 1; + TypeScriptTerm abstractMethodSignatureName = 2; + repeated TypeScriptTerm abstractMethodSignatureParameters = 3; +} + +message IndexSignature { + TypeScriptTerm indexSignatureSubject = 1; + TypeScriptTerm indexSignatureType = 2; +} + +message ObjectType { + repeated TypeScriptTerm objectTypeElements = 1; +} + +message LiteralType { + TypeScriptTerm literalTypeSubject = 1; +} + +message Union { + TypeScriptTerm unionLeft = 1; + TypeScriptTerm unionRight = 2; +} + +message Intersection { + TypeScriptTerm intersectionLeft = 1; + TypeScriptTerm intersectionRight = 2; +} + +message Module { + TypeScriptTerm moduleIdentifier = 1; + repeated TypeScriptTerm moduleStatements = 2; +} + +message InternalModule { + TypeScriptTerm internalModuleIdentifier = 1; + repeated TypeScriptTerm internalModuleStatements = 2; +} + +message FunctionType { + TypeScriptTerm functionTypeParameters = 1; + repeated TypeScriptTerm functionFormalParameters = 2; + TypeScriptTerm functionType = 3; +} + +message Tuple { + repeated TypeScriptTerm tupleElements = 1; +} + +message Constructor { + TypeScriptTerm constructorTypeParameters = 1; + repeated TypeScriptTerm constructorFormalParameters = 2; + TypeScriptTerm constructorType = 3; +} + +message TypeAssertion { + TypeScriptTerm typeAssertionParameters = 1; + TypeScriptTerm typeAssertionExpression = 2; +} + +message ImportAlias { + TypeScriptTerm importAliasSubject = 1; + TypeScriptTerm importAlias = 2; +} + +message Debugger { } + +message ShorthandPropertyIdentifier { + string contents = 1; +} + +message Super { } + +message Undefined { } + +message ClassHeritage { + TypeScriptTerm classHeritageExtendsClause = 1; + TypeScriptTerm implementsClause = 2; +} + +message AbstractClass { + TypeScriptTerm abstractClassIdentifier = 1; + TypeScriptTerm abstractClassTypeParameters = 2; + repeated TypeScriptTerm classHeritage = 3; + TypeScriptTerm classBody = 4; +} + +message ExtendsClause { + repeated TypeScriptTerm extendsClauses = 1; +} + +message ImplementsClause { + repeated TypeScriptTerm implementsClauseTypes = 1; +} + +message JsxElement { + TypeScriptTerm jsxOpeningElement = 1; + repeated TypeScriptTerm jsxElements = 2; + TypeScriptTerm jsxClosingElement = 3; +} + +message JsxSelfClosingElement { + TypeScriptTerm jsxSelfClosingElementIdentifier = 1; + repeated TypeScriptTerm jsxSelfClosingElementAttributes = 2; +} + +message JsxOpeningElement { + TypeScriptTerm jsxOpeningElementIdentifier = 1; + repeated TypeScriptTerm jsxAttributes = 2; +} + +message JsxText { + string contents = 1; +} + +message JsxClosingElement { + TypeScriptTerm jsxClosingElementIdentifier = 1; +} + +message JsxExpression { + TypeScriptTerm jsxExpression = 1; +} + +message JsxAttribute { + TypeScriptTerm jsxAttributeTarget = 1; + TypeScriptTerm jsxAttributeValue = 2; +} + +message JsxFragment { + repeated TypeScriptTerm terms = 1; +} + +message JsxNamespaceName { + TypeScriptTerm left = 1; + TypeScriptTerm right = 2; +} + +message OptionalParameter { + repeated TypeScriptTerm optionalParameterContext = 1; + TypeScriptTerm optionalParameterSubject = 2; +} + +message RequiredParameter { + repeated TypeScriptTerm requiredParameterContext = 1; + TypeScriptTerm requiredParameterSubject = 2; +} + +message RestParameter { + repeated TypeScriptTerm restParameterContext = 1; + TypeScriptTerm restParameterSubject = 2; +} + +message PropertySignature { + repeated TypeScriptTerm modifiers = 1; + TypeScriptTerm propertySignaturePropertyName = 2; +} + +message AmbientDeclaration { + TypeScriptTerm ambientDeclarationBody = 1; +} + +message EnumDeclaration { + TypeScriptTerm enumDeclarationIdentifier = 1; + repeated TypeScriptTerm enumDeclarationBody = 2; +} + +message AmbientFunction { + repeated TypeScriptTerm ambientFunctionContext = 1; + TypeScriptTerm ambientFunctionIdentifier = 2; + repeated TypeScriptTerm ambientFunctionParameters = 3; +} + +message ImportRequireClause { + TypeScriptTerm importRequireIdentifier = 1; + TypeScriptTerm importRequireSubject = 2; +} + +message ImportClause { + repeated TypeScriptTerm importClauseElements = 1; +} + +message LabeledStatement { + TypeScriptTerm labeledStatementIdentifier = 1; + TypeScriptTerm labeledStatementSubject = 2; +} + +message Annotation { + TypeScriptTerm annotationType = 1; +} + +message With { + TypeScriptTerm withExpression = 1; + TypeScriptTerm withBody = 2; +} + +message ForOf { + TypeScriptTerm forOfBinding = 1; + TypeScriptTerm forOfSubject = 2; + TypeScriptTerm forOfBody = 3; +} + +message This { } + +message Update { + TypeScriptTerm updateSubject = 1; +} + +message ComputedPropertyName { + TypeScriptTerm propertyName = 1; +} + +message Decorator { + TypeScriptTerm decoratorTerm = 1; +} + +message Import { + repeated Alias importSymbols = 1; + ImportPath importFrom = 2; +} + +message QualifiedAliasedImport { + TypeScriptTerm qualifiedAliasedImportAlias = 1; + ImportPath qualifiedAliasedImportFrom = 2; +} + +message SideEffectImport { + ImportPath sideEffectImportFrom = 1; +} + +message DefaultExport { + TypeScriptTerm defaultExport = 1; +} + +message QualifiedExport { + repeated Alias qualifiedExportSymbols = 1; +} + +message QualifiedExportFrom { + ImportPath qualifiedExportFrom = 1; + repeated Alias qualifiedExportFromSymbols = 2; +} + +message JavaScriptRequire { + TypeScriptTerm javascriptRequireIden = 1; + ImportPath javascriptRequireFrom = 2; +} + +message List { + repeated TypeScriptTerm listContent = 1; +} diff --git a/script/generate-example b/script/generate-example index 7b7d12b9c..ec5c7b8b0 100755 --- a/script/generate-example +++ b/script/generate-example @@ -5,8 +5,8 @@ #/ Generate expected output for a test fixture example or directory of examples. #/ #/ Example: -#/ script/generate-example test/fixtures/ruby/and-or.{A,B}.rb -#/ script/generate-example test/fixtures/ruby +#/ script/generate-example test/fixtures/ruby/corpus/and-or.{A,B}.rb +#/ script/generate-example test/fixtures/ruby/corpus set -e [ $# -eq 0 ] && set -- --help diff --git a/semantic.cabal b/semantic.cabal index 0064ae6b4..a34fe8a12 100644 --- a/semantic.cabal +++ b/semantic.cabal @@ -31,6 +31,7 @@ library , Analysis.PackageDef -- Semantic assignment , Assigning.Assignment + , Assigning.Assignment.Deterministic , Assigning.Assignment.Table -- Control structures & interfaces for abstract interpretation , Control.Abstract @@ -64,8 +65,9 @@ library , Data.Abstract.Package , Data.Abstract.Path , Data.Abstract.Ref - , Data.Abstract.Type - , Data.Abstract.Value + , Data.Abstract.Value.Abstract + , Data.Abstract.Value.Concrete + , Data.Abstract.Value.Type -- General datatype definitions & generic algorithms , Data.Algebra , Data.AST @@ -142,7 +144,6 @@ library , Paths_semantic -- Rendering formats , Rendering.Graph - , Rendering.Imports , Rendering.JSON , Rendering.Renderer , Rendering.Symbol diff --git a/src/Analysis/Abstract/Caching.hs b/src/Analysis/Abstract/Caching.hs index 20c85b4b2..4630149db 100644 --- a/src/Analysis/Abstract/Caching.hs +++ b/src/Analysis/Abstract/Caching.hs @@ -127,7 +127,7 @@ scatter :: (Foldable t, Member NonDet effects, Member (State (Heap address (Cell scatter = foldMapA (\ (Cached value heap') -> TermEvaluator (putHeap heap') $> value) -caching :: Alternative f => TermEvaluator term address value (NonDet ': Reader (Cache term address (Cell address) value) ': State (Cache term address (Cell address) value) ': effects) a -> TermEvaluator term address value effects (f a, Cache term address (Cell address) value) +caching :: (Alternative f, Effects effects) => TermEvaluator term address value (NonDet ': Reader (Cache term address (Cell address) value) ': State (Cache term address (Cell address) value) ': effects) a -> TermEvaluator term address value effects (Cache term address (Cell address) value, f a) caching = runState lowerBound . runReader lowerBound diff --git a/src/Analysis/Abstract/Collecting.hs b/src/Analysis/Abstract/Collecting.hs index f8300d287..f6fce77da 100644 --- a/src/Analysis/Abstract/Collecting.hs +++ b/src/Analysis/Abstract/Collecting.hs @@ -21,5 +21,5 @@ collectingTerms recur term = do v <$ TermEvaluator (gc (roots <> valueRoots v)) -providingLiveSet :: Effectful (m address value) => m address value (Reader (Live address) ': effects) a -> m address value effects a +providingLiveSet :: (Effectful (m address value), Effects effects) => m address value (Reader (Live address) ': effects) a -> m address value effects a providingLiveSet = runReader lowerBound diff --git a/src/Analysis/Abstract/Dead.hs b/src/Analysis/Abstract/Dead.hs index 6a8f0e360..35e8e7198 100644 --- a/src/Analysis/Abstract/Dead.hs +++ b/src/Analysis/Abstract/Dead.hs @@ -48,5 +48,5 @@ killingModules :: ( Foldable (Base term) -> SubtermAlgebra Module term (TermEvaluator term address value effects a) killingModules recur m = killAll (subterms (subterm (moduleBody m))) *> recur m -providingDeadSet :: TermEvaluator term address value (State (Dead term) ': effects) a -> TermEvaluator term address value effects (a, Dead term) +providingDeadSet :: Effects effects => TermEvaluator term address value (State (Dead term) ': effects) a -> TermEvaluator term address value effects (Dead term, a) providingDeadSet = runState lowerBound diff --git a/src/Analysis/Abstract/Graph.hs b/src/Analysis/Abstract/Graph.hs index bfc661a6d..5d5640845 100644 --- a/src/Analysis/Abstract/Graph.hs +++ b/src/Analysis/Abstract/Graph.hs @@ -71,7 +71,8 @@ graphingPackages recur m = packageInclusion (moduleVertex (moduleInfo m)) *> rec -- | Add vertices to the graph for imported modules. graphingModules :: forall term address value effects a - . ( Member (Modules address) effects + . ( Effects effects + , Member (Modules address) effects , Member (Reader ModuleInfo) effects , Member (State (Graph Vertex)) effects ) @@ -79,15 +80,16 @@ graphingModules :: forall term address value effects a -> SubtermAlgebra Module term (TermEvaluator term address value effects a) graphingModules recur m = do appendGraph (vertex (moduleVertex (moduleInfo m))) - interpose @(Modules address) pure (\ m yield -> case m of - Load path -> moduleInclusion (moduleVertex (ModuleInfo path)) >> send m >>= yield - Lookup path -> moduleInclusion (moduleVertex (ModuleInfo path)) >> send m >>= yield - _ -> send m >>= yield) + eavesdrop @(Modules address) (\ m -> case m of + Load path -> moduleInclusion (moduleVertex (ModuleInfo path)) + Lookup path -> moduleInclusion (moduleVertex (ModuleInfo path)) + _ -> pure ()) (recur m) -- | Add vertices to the graph for imported modules. graphingModuleInfo :: forall term address value effects a - . ( Member (Modules address) effects + . ( Effects effects + , Member (Modules address) effects , Member (Reader ModuleInfo) effects , Member (State (Graph ModuleInfo)) effects ) @@ -95,10 +97,10 @@ graphingModuleInfo :: forall term address value effects a -> SubtermAlgebra Module term (TermEvaluator term address value effects a) graphingModuleInfo recur m = do appendGraph (vertex (moduleInfo m)) - interpose @(Modules address) pure (\ eff yield -> case eff of - Load path -> currentModule >>= appendGraph . (`connect` vertex (ModuleInfo path)) . vertex >> send eff >>= yield - Lookup path -> currentModule >>= appendGraph . (`connect` vertex (ModuleInfo path)) . vertex >> send eff >>= yield - _ -> send eff >>= yield) + eavesdrop @(Modules address) (\ eff -> case eff of + Load path -> currentModule >>= appendGraph . (`connect` vertex (ModuleInfo path)) . vertex + Lookup path -> currentModule >>= appendGraph . (`connect` vertex (ModuleInfo path)) . vertex + _ -> pure ()) (recur m) -- | Add an edge from the current package to the passed vertex. @@ -139,5 +141,5 @@ appendGraph :: (Effectful m, Member (State (Graph v)) effects) => Graph v -> m e appendGraph = modify' . (<>) -graphing :: Effectful m => m (State (Graph Vertex) ': effects) result -> m effects (result, Graph Vertex) +graphing :: (Effectful m, Effects effects) => m (State (Graph Vertex) ': effects) result -> m effects (Graph Vertex, result) graphing = runState mempty diff --git a/src/Analysis/Abstract/Tracing.hs b/src/Analysis/Abstract/Tracing.hs index ee6cc58b6..7f8f453f3 100644 --- a/src/Analysis/Abstract/Tracing.hs +++ b/src/Analysis/Abstract/Tracing.hs @@ -27,5 +27,5 @@ tracingTerms proxy recur term = getConfiguration (embedSubterm term) >>= trace . trace :: Member (Writer (trace (Configuration term address (Cell address) value))) effects => trace (Configuration term address (Cell address) value) -> TermEvaluator term address value effects () trace = tell -tracing :: Monoid (trace (Configuration term address (Cell address) value)) => TermEvaluator term address value (Writer (trace (Configuration term address (Cell address) value)) ': effects) a -> TermEvaluator term address value effects (a, trace (Configuration term address (Cell address) value)) +tracing :: (Monoid (trace (Configuration term address (Cell address) value)), Effects effects) => TermEvaluator term address value (Writer (trace (Configuration term address (Cell address) value)) ': effects) a -> TermEvaluator term address value effects (trace (Configuration term address (Cell address) value), a) tracing = runWriter diff --git a/src/Assigning/Assignment/Deterministic.hs b/src/Assigning/Assignment/Deterministic.hs new file mode 100644 index 000000000..b96397588 --- /dev/null +++ b/src/Assigning/Assignment/Deterministic.hs @@ -0,0 +1,190 @@ +{-# LANGUAGE FunctionalDependencies #-} +-- | Deterministic assignment, à la _Deterministic, Error-Correcting Combinator Parsers_, S. Doaitse Swierstra & Luc Duponcheel: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.80.9967&rep=rep1&type=pdf +module Assigning.Assignment.Deterministic +( Assigning(..) +, parseError +, Assignment(..) +, assign +, runAssignment +, State(..) +) where + +import Data.AST +import Data.Error +import qualified Data.IntMap as IntMap +import qualified Data.IntSet as IntSet +import Data.Range +import Data.Record +import Data.Source as Source +import Data.Span +import qualified Data.Syntax as Syntax +import Data.Term (Term, termIn, termAnnotation, termOut) +import Data.Text.Encoding (decodeUtf8') +import Prologue + +class (Alternative f, Ord symbol, Show symbol) => Assigning symbol f | f -> symbol where + leafNode :: symbol -> f Text + branchNode :: symbol -> f a -> f a + + toTerm :: (Element syntax syntaxes, Element Syntax.Error syntaxes) + => f (syntax (Term (Sum syntaxes) (Record Location))) + -> f (Term (Sum syntaxes) (Record Location)) + +parseError :: ( Bounded symbol + , Element Syntax.Error syntaxes + , HasCallStack + , Assigning symbol f + ) + => f (Term (Sum syntaxes) (Record Location)) +parseError = toTerm (leafNode maxBound $> Syntax.Error (Syntax.ErrorStack (Syntax.errorSite <$> getCallStack (freezeCallStack callStack))) [] (Just "ParseError") []) + + +data Assignment symbol a = Assignment + { nullable :: Nullable symbol a + , firstSet :: IntSet + , choices :: [(symbol, Cont symbol a)] + } + deriving (Functor) + +type Cont symbol a = Source -> State symbol -> [IntSet] -> Either (Error (Either String symbol)) (State symbol, a) + +combine :: Nullable symbol a -> IntSet -> IntSet -> IntSet +combine (Nullable _) s1 s2 = s1 <> s2 +combine _ s1 _ = s1 + +choose :: (Enum symbol, HasCallStack) + => Nullable symbol a + -> IntSet + -> IntMap (Cont symbol a) + -> Cont symbol a +choose nullable firstSet table src state follow = case stateInput state of + [] -> case nullable of + Nullable f -> Right (state, f state) + _ -> Left (withFrozenCallStack (Error (stateSpan state) (Right . toEnum <$> IntSet.toList firstSet) Nothing)) + s:_ -> case fromEnum (astSymbol s) `IntMap.lookup` table of + Just k -> k src state follow + _ -> notFound (astSymbol s) state follow + where notFound s state follow = case nullable of + Nullable f | any (fromEnum s `IntSet.member`) follow -> Right (state, f state) + _ -> Left (withFrozenCallStack (Error (stateSpan state) (Right . toEnum <$> IntSet.toList firstSet) (Just (Right s)))) + +instance (Enum symbol, Ord symbol) => Applicative (Assignment symbol) where + pure a = Assignment (pure a) lowerBound [] + {-# INLINABLE pure #-} + + Assignment n1 f1 t1 <*> ~(Assignment n2 f2 t2) = Assignment (n1 <*> n2) (combine n1 f1 f2) (t1 `tseq` t2) + where table2 = IntMap.fromList (map (first fromEnum) t2) + t1 `tseq` t2 + = map (fmap (\ p src state follow -> do + (state', p') <- p src state (f2 : follow) + (state'', q') <- choose n2 f2 table2 src state' follow + let pq = p' q' + pq `seq` pure (state'', pq))) t1 + <> case n1 of + Nullable p -> map (fmap (\ q src state follow -> do + let p' = p state + (state', q') <- p' `seq` q src state follow + let pq = p' q' + pq `seq` pure (state', pq))) t2 + _ -> [] + {-# INLINABLE (<*>) #-} + +instance (Enum symbol, Ord symbol) => Alternative (Assignment symbol) where + empty = Assignment NotNullable lowerBound [] + {-# INLINABLE empty #-} + + Assignment n1 f1 t1 <|> Assignment n2 f2 t2 = Assignment (n1 <|> n2) (f1 <> f2) (t1 <> t2) + {-# INLINABLE (<|>) #-} + +instance (Enum symbol, Ord symbol, Show symbol) => Assigning symbol (Assignment symbol) where + leafNode s = Assignment NotNullable (IntSet.singleton (fromEnum s)) + [ (s, \ src state _ -> case stateInput state of + [] -> Left (withFrozenCallStack (Error (stateSpan state) [Right s] Nothing)) + s:_ -> case decodeUtf8' (sourceBytes (Source.slice (astRange s) src)) of + Left err -> Left (withFrozenCallStack (Error (astSpan s) [Left "valid utf-8"] (Just (Left (show err))))) + Right text -> Right (advanceState state, text)) + ] + + branchNode s a = Assignment NotNullable (IntSet.singleton (fromEnum s)) + [ (s, \ src state _ -> case stateInput state of + [] -> Left (withFrozenCallStack (Error (stateSpan state) [Right s] Nothing)) + s:_ -> first (const (advanceState state)) <$> runAssignment a src state { stateInput = astChildren s }) + ] + + toTerm a = Assignment + (case nullable a of + Nullable f -> Nullable (\ state -> termIn (stateLocation state) (inject (f state))) + NotNullable -> NotNullable) + (firstSet a) + (map (fmap (\ match src state follow -> case match src state follow of + Left err + | Just _ <- errorActual err -> Right (advanceState state, termIn (stateLocation state) (inject (Syntax.errorSyntax (either id show <$> err) []))) + | otherwise -> Left err + Right (state', syntax) -> Right (state', termIn (stateLocation state) (inject syntax)))) (choices a)) + + +assign :: (Enum symbol, Show symbol) => Source -> Assignment symbol a -> AST [] symbol -> Either (Error String) a +assign src assignment = bimap (fmap (either id show)) snd . runAssignment assignment src . State 0 lowerBound . pure + +runAssignment :: Enum symbol => Assignment symbol a -> Source -> State symbol -> Either (Error (Either String symbol)) (State symbol, a) +runAssignment (Assignment nullable firstSet table) src input + = case choose nullable firstSet (IntMap.fromList (map (first fromEnum) table)) src input lowerBound of + Left err -> Left err + Right (state', a') -> case stateInput state' of + [] -> Right (state', a') + s':_ -> Left (withFrozenCallStack (Error (stateSpan state') [] (Just (Right (astSymbol s'))))) + + +data Nullable symbol a + = NotNullable + | Nullable (State symbol -> a) + deriving (Functor) + +instance Applicative (Nullable symbol) where + pure = Nullable . const + + Nullable f <*> Nullable a = Nullable (\ state -> f state (a state)) + _ <*> _ = NotNullable + +instance Alternative (Nullable symbol) where + empty = NotNullable + + Nullable a <|> _ = Nullable a + _ <|> b = b + + +data State symbol = State + { stateBytes :: {-# UNPACK #-} !Int + , statePos :: {-# UNPACK #-} !Pos + , stateInput :: ![AST [] symbol] + } + deriving (Eq, Ord, Show) + +stateRange :: State s -> Range +stateRange state@(State _ _ []) = Range (stateBytes state) (stateBytes state) +stateRange (State _ _ (s:_)) = astRange s + +stateSpan :: State s -> Span +stateSpan state@(State _ _ []) = Span (statePos state) (statePos state) +stateSpan (State _ _ (s:_)) = astSpan s + +stateLocation :: State s -> Record Location +stateLocation state = stateRange state :. stateSpan state :. Nil + +advanceState :: State s -> State s +advanceState state + | s:ss <- stateInput state = State (end (astRange s)) (spanEnd (astSpan s)) ss + | otherwise = state + + +astSymbol :: AST [] symbol -> symbol +astSymbol = nodeSymbol . termAnnotation + +astRange :: AST [] symbol -> Range +astRange = nodeByteRange . termAnnotation + +astSpan :: AST [] symbol -> Span +astSpan = nodeSpan . termAnnotation + +astChildren :: AST [] symbol -> [AST [] symbol] +astChildren = termOut diff --git a/src/Control/Abstract/Environment.hs b/src/Control/Abstract/Environment.hs index 5681f51dd..3b628bdca 100644 --- a/src/Control/Abstract/Environment.hs +++ b/src/Control/Abstract/Environment.hs @@ -53,10 +53,7 @@ bindAll = foldr ((>>) . uncurry bind) (pure ()) . Env.flatPairs -- | Run an action in a new local scope. locally :: forall address value effects a . Member (Env address) effects => Evaluator address value effects a -> Evaluator address value effects a -locally a = do - send (Push @address) - a' <- a - a' <$ send (Pop @address) +locally = send . Locally @address . lowerEff close :: Member (Env address) effects => Set Name -> Evaluator address value effects (Environment address) close = send . Close @@ -64,45 +61,49 @@ close = send . Close -- Effects -data Env address return where - Lookup :: Name -> Env address (Maybe address) - Bind :: Name -> address -> Env address () - Close :: Set Name -> Env address (Environment address) - Push :: Env address () - Pop :: Env address () - GetEnv :: Env address (Environment address) - Export :: Name -> Name -> Maybe address -> Env address () - PutEnv :: Environment address -> Env address () +data Env address m return where + Lookup :: Name -> Env address m (Maybe address) + Bind :: Name -> address -> Env address m () + Close :: Set Name -> Env address m (Environment address) + Locally :: m a -> Env address m a + GetEnv :: Env address m (Environment address) + Export :: Name -> Name -> Maybe address -> Env address m () + PutEnv :: Environment address -> Env address m () +instance Effect (Env address) where + handleState c dist (Request (Lookup name) k) = Request (Lookup name) (dist . (<$ c) . k) + handleState c dist (Request (Bind name addr) k) = Request (Bind name addr) (dist . (<$ c) . k) + handleState c dist (Request (Close names) k) = Request (Close names) (dist . (<$ c) . k) + handleState c dist (Request (Locally action) k) = Request (Locally (dist (action <$ c))) (dist . fmap k) + handleState c dist (Request GetEnv k) = Request GetEnv (dist . (<$ c) . k) + handleState c dist (Request (Export name alias addr) k) = Request (Export name alias addr) (dist . (<$ c) . k) + handleState c dist (Request (PutEnv e) k) = Request (PutEnv e) (dist . (<$ c) . k) -handleEnv :: forall address effects value result - . ( Member (State (Environment address)) effects - , Member (State (Exports address)) effects - ) - => Env address result - -> Evaluator address value effects result +runEnv :: Effects effects + => Environment address + -> Evaluator address value (Env address ': effects) a + -> Evaluator address value effects (Environment address, a) +runEnv initial = fmap (filterEnv . fmap (first Env.head)) . runState lowerBound . runState (Env.push initial) . reinterpret2 handleEnv + where -- TODO: If the set of exports is empty because no exports have been + -- defined, do we export all terms, or no terms? This behavior varies across + -- languages. We need better semantics rather than doing it ad-hoc. + filterEnv (ports, (binds, a)) + | Exports.null ports = (Env.newEnv binds, a) + | otherwise = (Env.newEnv (Exports.toBindings ports <> Env.aliasBindings (Exports.aliases ports) binds), a) + +handleEnv :: forall address value effects a . Effects effects => Env address (Eff (Env address ': effects)) a -> Evaluator address value (State (Environment address) ': State (Exports address) ': effects) a handleEnv = \case Lookup name -> Env.lookup name <$> get Bind name addr -> modify (Env.insert name addr) Close names -> Env.intersect names <$> get - Push -> modify (Env.push @address) - Pop -> modify (Env.pop @address) + Locally action -> do + modify' (Env.push @address) + a <- reinterpret2 handleEnv (raiseEff action) + a <$ modify' (Env.pop @address) GetEnv -> get PutEnv e -> put e Export name alias addr -> modify (Exports.insert name alias addr) -runEnv :: Environment address - -> Evaluator address value (Env address ': effects) a - -> Evaluator address value effects (a, Environment address) -runEnv initial = fmap (uncurry filterEnv . first (fmap Env.head)) . runState lowerBound . runState (Env.push initial) . reinterpret2 handleEnv - where -- TODO: If the set of exports is empty because no exports have been - -- defined, do we export all terms, or no terms? This behavior varies across - -- languages. We need better semantics rather than doing it ad-hoc. - filterEnv (a, binds) ports - | Exports.null ports = (a, Env.newEnv binds) - | otherwise = (a, Env.newEnv (Exports.toBindings ports <> Env.aliasBindings (Exports.aliases ports) binds)) - - -- | Errors involving the environment. data EnvironmentError address return where FreeVariable :: Name -> EnvironmentError address address @@ -115,8 +116,8 @@ instance Eq1 (EnvironmentError address) where liftEq _ (FreeVariable n1) (FreeVa freeVariableError :: Member (Resumable (EnvironmentError address)) effects => Name -> Evaluator address value effects address freeVariableError = throwResumable . FreeVariable -runEnvironmentError :: Effectful (m address value) => m address value (Resumable (EnvironmentError address) ': effects) a -> m address value effects (Either (SomeExc (EnvironmentError address)) a) +runEnvironmentError :: (Effectful (m address value), Effects effects) => m address value (Resumable (EnvironmentError address) ': effects) a -> m address value effects (Either (SomeExc (EnvironmentError address)) a) runEnvironmentError = runResumable -runEnvironmentErrorWith :: Effectful (m address value) => (forall resume . EnvironmentError address resume -> m address value effects resume) -> m address value (Resumable (EnvironmentError address) ': effects) a -> m address value effects a +runEnvironmentErrorWith :: (Effectful (m address value), Effects effects) => (forall resume . EnvironmentError address resume -> m address value effects resume) -> m address value (Resumable (EnvironmentError address) ': effects) a -> m address value effects a runEnvironmentErrorWith = runResumableWith diff --git a/src/Control/Abstract/Evaluator.hs b/src/Control/Abstract/Evaluator.hs index 48124670b..342d13769 100644 --- a/src/Control/Abstract/Evaluator.hs +++ b/src/Control/Abstract/Evaluator.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE GADTs, GeneralizedNewtypeDeriving, RankNTypes, ScopedTypeVariables, TypeOperators #-} +{-# LANGUAGE GeneralizedNewtypeDeriving, TypeOperators #-} module Control.Abstract.Evaluator ( Evaluator(..) -- * Effects @@ -16,13 +16,14 @@ module Control.Abstract.Evaluator import Control.Monad.Effect as X import Control.Monad.Effect.Fresh as X -import Control.Monad.Effect.Internal +import Control.Monad.Effect.Exception as X +import qualified Control.Monad.Effect.Internal as Eff import Control.Monad.Effect.NonDet as X import Control.Monad.Effect.Reader as X import Control.Monad.Effect.Resumable as X import Control.Monad.Effect.State as X import Control.Monad.Effect.Trace as X -import Prologue +import Prologue hiding (MonadError(..)) -- | An 'Evaluator' is a thin wrapper around 'Eff' with (phantom) type parameters for the address, term, and value types. -- @@ -37,46 +38,39 @@ deriving instance Member NonDet effects => Alternative (Evaluator address value -- Effects -- | An effect for explicitly returning out of a function/method body. -data Return address resume where - Return :: address -> Return address address +newtype Return address = Return { unReturn :: address } + deriving (Eq, Ord, Show) -deriving instance Eq address => Eq (Return address a) -deriving instance Show address => Show (Return address a) - -earlyReturn :: Member (Return address) effects +earlyReturn :: Member (Exc (Return address)) effects => address -> Evaluator address value effects address -earlyReturn = send . Return +earlyReturn = throwError . Return -catchReturn :: Member (Return address) effects => Evaluator address value effects a -> (forall x . Return address x -> Evaluator address value effects a) -> Evaluator address value effects a -catchReturn action handler = interpose pure (\ ret _ -> handler ret) action +catchReturn :: (Member (Exc (Return address)) effects, Effectful (m address value)) => m address value effects address -> m address value effects address +catchReturn = Eff.raiseHandler (handleError (\ (Return addr) -> pure addr)) -runReturn :: Effectful (m address value) => m address value (Return address ': effects) address -> m address value effects address -runReturn = raiseHandler (relay pure (\ (Return value) _ -> pure value)) +runReturn :: (Effectful (m address value), Effects effects) => m address value (Exc (Return address) ': effects) address -> m address value effects address +runReturn = Eff.raiseHandler (fmap (either unReturn id) . runError) -- | Effects for control flow around loops (breaking and continuing). -data LoopControl address resume where - Break :: address -> LoopControl address address - Continue :: address -> LoopControl address address +data LoopControl address + = Break { unLoopControl :: address } + | Continue { unLoopControl :: address } + deriving (Eq, Ord, Show) -deriving instance Eq address => Eq (LoopControl address a) -deriving instance Show address => Show (LoopControl address a) - -throwBreak :: Member (LoopControl address) effects +throwBreak :: Member (Exc (LoopControl address)) effects => address -> Evaluator address value effects address -throwBreak = send . Break +throwBreak = throwError . Break -throwContinue :: Member (LoopControl address) effects +throwContinue :: Member (Exc (LoopControl address)) effects => address -> Evaluator address value effects address -throwContinue = send . Continue +throwContinue = throwError . Continue -catchLoopControl :: Member (LoopControl address) effects => Evaluator address value effects a -> (forall x . LoopControl address x -> Evaluator address value effects a) -> Evaluator address value effects a -catchLoopControl action handler = interpose pure (\ control _ -> handler control) action +catchLoopControl :: (Member (Exc (LoopControl address)) effects, Effectful (m address value)) => m address value effects a -> (LoopControl address -> m address value effects a) -> m address value effects a +catchLoopControl = catchError -runLoopControl :: Effectful (m address value) => m address value (LoopControl address ': effects) address -> m address value effects address -runLoopControl = raiseHandler (relay pure (\ eff _ -> case eff of - Break value -> pure value - Continue value -> pure value)) +runLoopControl :: (Effectful (m address value), Effects effects) => m address value (Exc (LoopControl address) ': effects) address -> m address value effects address +runLoopControl = Eff.raiseHandler (fmap (either unLoopControl id) . runError) diff --git a/src/Control/Abstract/Heap.hs b/src/Control/Abstract/Heap.hs index bb6787cdf..579990c50 100644 --- a/src/Control/Abstract/Heap.hs +++ b/src/Control/Abstract/Heap.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE GADTs, RankNTypes, TypeFamilies, TypeOperators, UndecidableInstances #-} +{-# LANGUAGE GADTs, KindSignatures, RankNTypes, TypeOperators, UndecidableInstances #-} module Control.Abstract.Heap ( Heap , Configuration(..) @@ -148,16 +148,17 @@ reachable roots heap = go mempty roots -- Effects -sendAllocator :: Member (Allocator address value) effects => Allocator address value return -> Evaluator address value effects return +sendAllocator :: Member (Allocator address value) effects => Allocator address value (Eff effects) return -> Evaluator address value effects return sendAllocator = send -data Allocator address value return where - Alloc :: Name -> Allocator address value address - Deref :: address -> Allocator address value value - Assign :: address -> value -> Allocator address value () - GC :: Live address -> Allocator address value () +data Allocator address value (m :: * -> *) return where + Alloc :: Name -> Allocator address value m address + Deref :: address -> Allocator address value m value + Assign :: address -> value -> Allocator address value m () + GC :: Live address -> Allocator address value m () runAllocator :: ( Addressable address effects + , Effects effects , Foldable (Cell address) , Member (Resumable (AddressError address value)) effects , Member (State (Heap address (Cell address) value)) effects @@ -172,6 +173,12 @@ runAllocator = interpret $ \ eff -> case eff of Assign addr value -> modifyHeap (heapInsert addr value) GC roots -> modifyHeap (heapRestrict <*> reachable roots) +instance Effect (Allocator address value) where + handleState c dist (Request (Alloc name) k) = Request (Alloc name) (dist . (<$ c) . k) + handleState c dist (Request (Deref addr) k) = Request (Deref addr) (dist . (<$ c) . k) + handleState c dist (Request (Assign addr value) k) = Request (Assign addr value) (dist . (<$ c) . k) + handleState c dist (Request (GC roots) k) = Request (GC roots) (dist . (<$ c) . k) + data AddressError address value resume where UnallocatedAddress :: address -> AddressError address value (Cell address value) @@ -187,8 +194,8 @@ instance Eq address => Eq1 (AddressError address value) where liftEq _ _ _ = False -runAddressError :: Effectful (m address value) => m address value (Resumable (AddressError address value) ': effects) a -> m address value effects (Either (SomeExc (AddressError address value)) a) +runAddressError :: (Effectful (m address value), Effects effects) => m address value (Resumable (AddressError address value) ': effects) a -> m address value effects (Either (SomeExc (AddressError address value)) a) runAddressError = runResumable -runAddressErrorWith :: Effectful (m address value) => (forall resume . AddressError address value resume -> m address value effects resume) -> m address value (Resumable (AddressError address value) ': effects) a -> m address value effects a +runAddressErrorWith :: (Effectful (m address value), Effects effects) => (forall resume . AddressError address value resume -> m address value effects resume) -> m address value (Resumable (AddressError address value) ': effects) a -> m address value effects a runAddressErrorWith = runResumableWith diff --git a/src/Control/Abstract/Modules.hs b/src/Control/Abstract/Modules.hs index e60094c65..7a31dbd3f 100644 --- a/src/Control/Abstract/Modules.hs +++ b/src/Control/Abstract/Modules.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE GADTs, LambdaCase, RankNTypes, ScopedTypeVariables, TypeOperators #-} +{-# LANGUAGE GADTs, LambdaCase, KindSignatures, RankNTypes, ScopedTypeVariables, TypeOperators #-} module Control.Abstract.Modules ( lookupModule , resolve @@ -9,7 +9,6 @@ module Control.Abstract.Modules , runModules , LoadError(..) , moduleNotFound -, resumeLoadError , runLoadError , runLoadErrorWith , ResolutionError(..) @@ -29,7 +28,7 @@ import Prologue import System.FilePath.Posix (takeDirectory) -- | Retrieve an evaluated module, if any. @Nothing@ means we’ve never tried to load it, and @Just (env, value)@ indicates the result of a completed load. -lookupModule :: Member (Modules address) effects => ModulePath -> Evaluator address value effects (Maybe (address, Environment address)) +lookupModule :: Member (Modules address) effects => ModulePath -> Evaluator address value effects (Maybe (Environment address, address)) lookupModule = sendModules . Lookup -- | Resolve a list of module paths to a possible module table entry. @@ -43,26 +42,33 @@ listModulesInDir = sendModules . List -- | Require/import another module by name and return its environment and value. -- -- Looks up the module's name in the cache of evaluated modules first, returns if found, otherwise loads/evaluates the module. -require :: Member (Modules address) effects => ModulePath -> Evaluator address value effects (address, Environment address) +require :: Member (Modules address) effects => ModulePath -> Evaluator address value effects (Environment address, address) require path = lookupModule path >>= maybeM (load path) -- | Load another module by name and return its environment and value. -- -- Always loads/evaluates. -load :: Member (Modules address) effects => ModulePath -> Evaluator address value effects (address, Environment address) +load :: Member (Modules address) effects => ModulePath -> Evaluator address value effects (Environment address, address) load path = sendModules (Load path) -data Modules address return where - Load :: ModulePath -> Modules address (address, Environment address) - Lookup :: ModulePath -> Modules address (Maybe (address, Environment address)) - Resolve :: [FilePath] -> Modules address (Maybe ModulePath) - List :: FilePath -> Modules address [ModulePath] +data Modules address (m :: * -> *) return where + Load :: ModulePath -> Modules address m (Environment address, address) + Lookup :: ModulePath -> Modules address m (Maybe (Environment address, address)) + Resolve :: [FilePath] -> Modules address m (Maybe ModulePath) + List :: FilePath -> Modules address m [ModulePath] -sendModules :: Member (Modules address) effects => Modules address return -> Evaluator address value effects return +instance Effect (Modules address) where + handleState c dist (Request (Load path) k) = Request (Load path) (dist . (<$ c) . k) + handleState c dist (Request (Lookup path) k) = Request (Lookup path) (dist . (<$ c) . k) + handleState c dist (Request (Resolve paths) k) = Request (Resolve paths) (dist . (<$ c) . k) + handleState c dist (Request (List path) k) = Request (List path) (dist . (<$ c) . k) + +sendModules :: Member (Modules address) effects => Modules address (Eff effects) return -> Evaluator address value effects return sendModules = send -runModules :: ( Member (State (ModuleTable (NonEmpty (Module (address, Environment address))))) effects -- FIXME: This should really be a Reader effect but for https://github.com/joshvera/effects/issues/47 +runModules :: ( Effects effects + , Member (Reader (ModuleTable (NonEmpty (Module (Environment address, address))))) effects , Member (Resumable (LoadError address)) effects ) => Set ModulePath @@ -74,19 +80,19 @@ runModules paths = interpret $ \case Resolve names -> pure (find (`Set.member` paths) names) List dir -> pure (filter ((dir ==) . takeDirectory) (toList paths)) -askModuleTable :: Member (State (ModuleTable (NonEmpty (Module (address, Environment address))))) effects => Evaluator address value effects (ModuleTable (NonEmpty (Module (address, Environment address)))) -askModuleTable = get +askModuleTable :: Member (Reader (ModuleTable (NonEmpty (Module (Environment address, address))))) effects => Evaluator address value effects (ModuleTable (NonEmpty (Module (Environment address, address)))) +askModuleTable = ask -newtype Merging address = Merging { runMerging :: (address, Environment address) } +newtype Merging address = Merging { runMerging :: (Environment address, address) } instance Semigroup (Merging address) where - Merging (_, env1) <> Merging (addr, env2) = Merging (addr, mergeEnvs env1 env2) + Merging (env1, _) <> Merging (env2, addr) = Merging (mergeEnvs env1 env2, addr) -- | An error thrown when loading a module from the list of provided modules. Indicates we weren't able to find a module with the given name. data LoadError address resume where - ModuleNotFound :: ModulePath -> LoadError address (address, Environment address) + ModuleNotFound :: ModulePath -> LoadError address (Environment address, address) deriving instance Eq (LoadError address resume) deriving instance Show (LoadError address resume) @@ -95,16 +101,13 @@ instance Show1 (LoadError address) where instance Eq1 (LoadError address) where liftEq _ (ModuleNotFound a) (ModuleNotFound b) = a == b -moduleNotFound :: Member (Resumable (LoadError address)) effects => ModulePath -> Evaluator address value effects (address, Environment address) +moduleNotFound :: Member (Resumable (LoadError address)) effects => ModulePath -> Evaluator address value effects (Environment address, address) moduleNotFound = throwResumable . ModuleNotFound -resumeLoadError :: Member (Resumable (LoadError address)) effects => Evaluator address value effects a -> (forall resume . LoadError address resume -> Evaluator address value effects resume) -> Evaluator address value effects a -resumeLoadError = catchResumable - -runLoadError :: Effectful (m address value) => m address value (Resumable (LoadError address) ': effects) a -> m address value effects (Either (SomeExc (LoadError address)) a) +runLoadError :: (Effectful (m address value), Effects effects) => m address value (Resumable (LoadError address) ': effects) a -> m address value effects (Either (SomeExc (LoadError address)) a) runLoadError = runResumable -runLoadErrorWith :: Effectful (m address value) => (forall resume . LoadError address resume -> m address value effects resume) -> m address value (Resumable (LoadError address) ': effects) a -> m address value effects a +runLoadErrorWith :: (Effectful (m address value), Effects effects) => (forall resume . LoadError address resume -> m address value effects resume) -> m address value (Resumable (LoadError address) ': effects) a -> m address value effects a runLoadErrorWith = runResumableWith @@ -125,8 +128,8 @@ instance Eq1 ResolutionError where liftEq _ (GoImportError a) (GoImportError b) = a == b liftEq _ _ _ = False -runResolutionError :: Effectful m => m (Resumable ResolutionError ': effects) a -> m effects (Either (SomeExc ResolutionError) a) +runResolutionError :: (Effectful m, Effects effects) => m (Resumable ResolutionError ': effects) a -> m effects (Either (SomeExc ResolutionError) a) runResolutionError = runResumable -runResolutionErrorWith :: Effectful m => (forall resume . ResolutionError resume -> m effects resume) -> m (Resumable ResolutionError ': effects) a -> m effects a +runResolutionErrorWith :: (Effectful m, Effects effects) => (forall resume . ResolutionError resume -> m effects resume) -> m (Resumable ResolutionError ': effects) a -> m effects a runResolutionErrorWith = runResumableWith diff --git a/src/Control/Abstract/Primitive.hs b/src/Control/Abstract/Primitive.hs index c7ee8ae42..e990ad0ca 100644 --- a/src/Control/Abstract/Primitive.hs +++ b/src/Control/Abstract/Primitive.hs @@ -21,8 +21,8 @@ define :: ( HasCallStack -> Evaluator address value effects () define name def = withCurrentCallStack callStack $ do addr <- alloc name - bind name addr def >>= assign addr + bind name addr defineClass :: ( AbstractValue address value effects , HasCallStack @@ -41,6 +41,22 @@ defineClass name superclasses scope = define name $ do Env.newEnv . Env.head <$> getEnv klass name (map (string . formatName) superclasses) env +defineNamespace :: ( AbstractValue address value effects + , HasCallStack + , Member (Allocator address value) effects + , Member (Env address) effects + , Member (Reader ModuleInfo) effects + , Member (Reader Span) effects + ) + => Name + -> Evaluator address value effects a + -> Evaluator address value effects () +defineNamespace name scope = define name $ do + env <- locally $ do + void scope + Env.newEnv . Env.head <$> getEnv + namespace name env + lambda :: (AbstractFunction address value effects, Member Fresh effects) => (Name -> Evaluator address value effects address) -> Evaluator address value effects value diff --git a/src/Data/AST.hs b/src/Data/AST.hs index c9c6d0abd..38af9fc15 100644 --- a/src/Data/AST.hs +++ b/src/Data/AST.hs @@ -17,7 +17,7 @@ data Node grammar = Node , nodeByteRange :: {-# UNPACK #-} !Range , nodeSpan :: {-# UNPACK #-} !Span } - deriving (Eq, Show) + deriving (Eq, Ord, Show) instance Show grammar => ToJSONFields (Node grammar) where diff --git a/src/Data/Abstract/Evaluatable.hs b/src/Data/Abstract/Evaluatable.hs index 7252443b8..b773f0824 100644 --- a/src/Data/Abstract/Evaluatable.hs +++ b/src/Data/Abstract/Evaluatable.hs @@ -42,13 +42,14 @@ import Data.Term import Prologue -- | The 'Evaluatable' class defines the necessary interface for a term to be evaluated. While a default definition of 'eval' is given, instances with computational content must implement 'eval' to perform their small-step operational semantics. -class Show1 constr => Evaluatable constr where +class (Show1 constr, Foldable constr) => Evaluatable constr where eval :: ( AbstractValue address value effects , Declarations term , FreeVariables term , Member (Allocator address value) effects , Member (Env address) effects - , Member (LoopControl address) effects + , Member (Exc (LoopControl address)) effects + , Member (Exc (Return address)) effects , Member (Modules address) effects , Member (Reader ModuleInfo) effects , Member (Reader PackageInfo) effects @@ -57,24 +58,27 @@ class Show1 constr => Evaluatable constr where , Member (Resumable EvalError) effects , Member (Resumable ResolutionError) effects , Member (Resumable (Unspecialized value)) effects - , Member (Return address) effects , Member Trace effects , Member Fresh effects ) => SubtermAlgebra constr term (Evaluator address value effects (ValueRef address)) - eval expr = rvalBox =<< throwResumable (Unspecialized ("Eval unspecialized for " <> liftShowsPrec (const (const id)) (const id) 0 expr "")) + eval expr = do + void $ traverse_ subtermValue expr + v <- throwResumable (Unspecialized ("Eval unspecialized for " <> liftShowsPrec (const (const id)) (const id) 0 expr "")) + rvalBox v evaluate :: ( AbstractValue address value inner , Addressable address (Reader ModuleInfo ': effects) , Declarations term + , Effects effects , Evaluatable (Base term) , Foldable (Cell address) , FreeVariables term , HasPrelude lang , Member Fresh effects , Member (Modules address) effects - , Member (State (ModuleTable (NonEmpty (Module (address, Environment address))))) effects + , Member (Reader (ModuleTable (NonEmpty (Module (Environment address, address))))) effects , Member (Reader PackageInfo) effects , Member (Reader Span) effects , Member (Resumable (AddressError address value)) effects @@ -87,27 +91,26 @@ evaluate :: ( AbstractValue address value inner , Recursive term , Reducer value (Cell address value) , ValueRoots address value - , inner ~ (LoopControl address ': Return address ': Env address ': Allocator address value ': Reader ModuleInfo ': effects) + , inner ~ (Exc (LoopControl address) ': Exc (Return address) ': Env address ': Allocator address value ': Reader ModuleInfo ': effects) ) => proxy lang -> (SubtermAlgebra Module term (TermEvaluator term address value inner address) -> SubtermAlgebra Module term (TermEvaluator term address value inner address)) -> (SubtermAlgebra (Base term) term (TermEvaluator term address value inner (ValueRef address)) -> SubtermAlgebra (Base term) term (TermEvaluator term address value inner (ValueRef address))) -> [Module term] - -> TermEvaluator term address value effects (ModuleTable (NonEmpty (Module (address, Environment address)))) + -> TermEvaluator term address value effects (ModuleTable (NonEmpty (Module (Environment address, address)))) evaluate lang analyzeModule analyzeTerm modules = do - (_, preludeEnv) <- TermEvaluator . runInModule lowerBound moduleInfoFromCallStack $ do + (preludeEnv, _) <- TermEvaluator . runInModule lowerBound moduleInfoFromCallStack $ do defineBuiltins definePrelude lang box unit - foldr (run preludeEnv) get modules + foldr (run preludeEnv) ask modules where run preludeEnv m rest = do evaluated <- coerce (runInModule preludeEnv (moduleInfo m)) (analyzeModule (subtermRef . moduleBody) (evalTerm <$> m)) -- FIXME: this should be some sort of Monoidal insert à la the Heap to accommodate multiple Go files being part of the same module. - modify' (ModuleTable.insert (modulePath (moduleInfo m)) ((evaluated <$ m) :| [])) - rest + local (ModuleTable.insert (modulePath (moduleInfo m)) ((evaluated <$ m) :| [])) rest evalTerm term = Subterm term (foldSubterms (analyzeTerm (TermEvaluator . eval . fmap (second runTermEvaluator))) term >>= TermEvaluator . address) @@ -143,7 +146,6 @@ class HasPrelude (language :: Language) where instance HasPrelude 'Go instance HasPrelude 'Haskell instance HasPrelude 'Java -instance HasPrelude 'JavaScript instance HasPrelude 'PHP builtInPrint :: ( AbstractIntro value @@ -171,9 +173,15 @@ instance HasPrelude 'Ruby where defineClass (name "Object") [] $ do define (name "inspect") (lambda (const (box (string "")))) -instance HasPrelude 'TypeScript - -- FIXME: define console.log using __semantic_print +instance HasPrelude 'TypeScript where + definePrelude _ = + defineNamespace (name "console") $ do + define (name "log") (lambda builtInPrint) +instance HasPrelude 'JavaScript where + definePrelude _ = do + defineNamespace (name "console") $ do + define (name "log") (lambda builtInPrint) -- Effects @@ -205,10 +213,10 @@ instance Show1 EvalError where throwEvalError :: (Effectful m, Member (Resumable EvalError) effects) => EvalError resume -> m effects resume throwEvalError = throwResumable -runEvalError :: Effectful m => m (Resumable EvalError ': effects) a -> m effects (Either (SomeExc EvalError) a) +runEvalError :: (Effectful m, Effects effects) => m (Resumable EvalError ': effects) a -> m effects (Either (SomeExc EvalError) a) runEvalError = runResumable -runEvalErrorWith :: Effectful m => (forall resume . EvalError resume -> m effects resume) -> m (Resumable EvalError ': effects) a -> m effects a +runEvalErrorWith :: (Effectful m, Effects effects) => (forall resume . EvalError resume -> m effects resume) -> m (Resumable EvalError ': effects) a -> m effects a runEvalErrorWith = runResumableWith @@ -224,17 +232,17 @@ instance Eq1 (Unspecialized a) where instance Show1 (Unspecialized a) where liftShowsPrec _ _ = showsPrec -runUnspecialized :: Effectful (m value) => m value (Resumable (Unspecialized value) ': effects) a -> m value effects (Either (SomeExc (Unspecialized value)) a) +runUnspecialized :: (Effectful (m value), Effects effects) => m value (Resumable (Unspecialized value) ': effects) a -> m value effects (Either (SomeExc (Unspecialized value)) a) runUnspecialized = runResumable -runUnspecializedWith :: Effectful (m value) => (forall resume . Unspecialized value resume -> m value effects resume) -> m value (Resumable (Unspecialized value) ': effects) a -> m value effects a +runUnspecializedWith :: (Effectful (m value), Effects effects) => (forall resume . Unspecialized value resume -> m value effects resume) -> m value (Resumable (Unspecialized value) ': effects) a -> m value effects a runUnspecializedWith = runResumableWith -- Instances -- | If we can evaluate any syntax which can occur in a 'Sum', we can evaluate the 'Sum'. -instance (Apply Evaluatable fs, Apply Show1 fs) => Evaluatable (Sum fs) where +instance (Apply Evaluatable fs, Apply Show1 fs, Apply Foldable fs) => Evaluatable (Sum fs) where eval = apply @Evaluatable eval -- | Evaluating a 'TermF' ignores its annotation, evaluating the underlying syntax. diff --git a/src/Data/Abstract/Name.hs b/src/Data/Abstract/Name.hs index d5e0afa5b..a29cf6be2 100644 --- a/src/Data/Abstract/Name.hs +++ b/src/Data/Abstract/Name.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE DeriveAnyClass #-} module Data.Abstract.Name ( Name -- * Constructors @@ -13,13 +14,26 @@ import Data.Aeson import qualified Data.Char as Char import Data.Text (Text) import qualified Data.Text as Text +import qualified Data.Text.Lazy as LT import Prologue +import Proto3.Suite +import qualified Proto3.Wire.Decode as Decode +import qualified Proto3.Wire.Encode as Encode -- | The type of variable names. data Name = Name Text | I Int - deriving (Eq, Ord) + deriving (Eq, Ord, MessageField) + +instance HasDefault Name where + def = Name mempty + +instance Primitive Name where + encodePrimitive num (Name text) = Encode.text num (LT.fromStrict text) + encodePrimitive num (I index) = Encode.int num index + decodePrimitive = Name . LT.toStrict <$> Decode.text <|> I <$> Decode.int + primType _ = Bytes gensym :: (Functor (m effs), Member Fresh effs, Effectful m) => m effs Name gensym = I <$> fresh diff --git a/src/Data/Abstract/Type.hs b/src/Data/Abstract/Type.hs deleted file mode 100644 index c311a8c5c..000000000 --- a/src/Data/Abstract/Type.hs +++ /dev/null @@ -1,195 +0,0 @@ -{-# LANGUAGE GADTs, RankNTypes, TypeFamilies, TypeOperators, UndecidableInstances #-} -module Data.Abstract.Type - ( Type (..) - , TypeError (..) - , runTypeError - , runTypeErrorWith - , unify - ) where - -import Control.Abstract -import Data.Abstract.Environment as Env -import Data.Semigroup.Foldable (foldMap1) -import Prologue hiding (TypeError) - -type TName = Int - --- | A datatype representing primitive types and combinations thereof. -data Type - = Int -- ^ Primitive int type. - | Bool -- ^ Primitive boolean type. - | String -- ^ Primitive string type. - | Symbol -- ^ Type of unique symbols. - | Unit -- ^ The unit type. - | Float -- ^ Floating-point type. - | Rational -- ^ Rational type. - | Type :-> Type -- ^ Binary function types. - | Var TName -- ^ A type variable. - | Type :* Type -- ^ Binary products. - | Type :+ Type -- ^ Binary sums. - | Void -- ^ Uninhabited void type. - | Array Type -- ^ Arrays. - | Hash [(Type, Type)] -- ^ Heterogenous key-value maps. - | Object -- ^ Objects. Once we have some notion of inheritance we'll need to store a superclass. - | Null -- ^ The null type. Unlike 'Unit', this unifies with any other type. - | Hole -- ^ The hole type. - deriving (Eq, Ord, Show) - -infixl 6 :+ -infixl 7 :* -infixr 0 :-> - -newtype Product = Product { getProduct :: Type } - -instance Semigroup Product where - Product a <> Product b = Product (a :* b) - -instance Monoid Product where - mempty = Product Unit - mappend = (<>) - -oneOrMoreProduct :: NonEmpty Type -> Type -oneOrMoreProduct = getProduct . foldMap1 Product - -zeroOrMoreProduct :: [Type] -> Type -zeroOrMoreProduct = maybe Unit oneOrMoreProduct . nonEmpty - --- TODO: À la carte representation of types. - --- | Errors representing failures in typechecking. Note that we should in general constrain allowable types by 'unify'ing, and thus throwing 'UnificationError's when constraints aren’t met, in order to allow uniform resumption with one or the other parameter type. -data TypeError resume where - UnificationError :: Type -> Type -> TypeError Type - -deriving instance Eq (TypeError resume) -deriving instance Ord (TypeError resume) -deriving instance Show (TypeError resume) - -instance Eq1 TypeError where liftEq _ (UnificationError a1 b1) (UnificationError a2 b2) = a1 == a2 && b1 == b2 -instance Ord1 TypeError where liftCompare _ (UnificationError a1 b1) (UnificationError a2 b2) = compare a1 a2 <> compare b1 b2 -instance Show1 TypeError where liftShowsPrec _ _ = showsPrec - - -runTypeError :: Effectful m => m (Resumable TypeError ': effects) a -> m effects (Either (SomeExc TypeError) a) -runTypeError = runResumable - -runTypeErrorWith :: Effectful m => (forall resume . TypeError resume -> m effects resume) -> m (Resumable TypeError ': effects) a -> m effects a -runTypeErrorWith = runResumableWith - - --- | Unify two 'Type's. -unify :: (Effectful m, Applicative (m effects), Member (Resumable TypeError) effects) => Type -> Type -> m effects Type -unify (a1 :-> b1) (a2 :-> b2) = (:->) <$> unify a1 a2 <*> unify b1 b2 -unify a Null = pure a -unify Null b = pure b --- FIXME: this should be constructing a substitution. -unify (Var _) b = pure b -unify a (Var _) = pure a -unify (Array t1) (Array t2) = Array <$> unify t1 t2 --- FIXME: unifying with sums should distribute nondeterministically. --- FIXME: ordering shouldn’t be significant for undiscriminated sums. -unify (a1 :+ b1) (a2 :+ b2) = (:+) <$> unify a1 a2 <*> unify b1 b2 -unify (a1 :* b1) (a2 :* b2) = (:*) <$> unify a1 a2 <*> unify b1 b2 -unify t1 t2 - | t1 == t2 = pure t2 - | otherwise = throwResumable (UnificationError t1 t2) - -instance Ord address => ValueRoots address Type where - valueRoots _ = mempty - - -instance AbstractHole Type where - hole = Hole - -instance AbstractIntro Type where - unit = Unit - integer _ = Int - boolean _ = Bool - string _ = String - float _ = Float - symbol _ = Symbol - rational _ = Rational - hash = Hash - kvPair k v = k :* v - - null = Null - - -instance ( Member (Allocator address Type) effects - , Member (Env address) effects - , Member Fresh effects - , Member (Resumable TypeError) effects - , Member (Return address) effects - ) - => AbstractFunction address Type effects where - closure names _ body = do - (env, tvars) <- foldr (\ name rest -> do - addr <- alloc name - tvar <- Var <$> fresh - assign addr tvar - bimap (Env.insert name addr) (tvar :) <$> rest) (pure (lowerBound, [])) names - (zeroOrMoreProduct tvars :->) <$> (deref =<< locally (bindAll env *> body `catchReturn` \ (Return ptr) -> pure ptr)) - - call op params = do - tvar <- fresh - paramTypes <- traverse (>>= deref) params - let needed = zeroOrMoreProduct paramTypes :-> Var tvar - unified <- op `unify` needed - case unified of - _ :-> ret -> box ret - gotten -> box =<< throwResumable (UnificationError needed gotten) - - --- | Discard the value arguments (if any), constructing a 'Type' instead. -instance ( Member (Allocator address Type) effects - , Member (Env address) effects - , Member Fresh effects - , Member NonDet effects - , Member (Resumable TypeError) effects - , Member (Return address) effects - ) - => AbstractValue address Type effects where - array fields = do - var <- fresh - fieldTypes <- traverse deref fields - Array <$> foldr (\ t1 -> (unify t1 =<<)) (pure (Var var)) fieldTypes - - tuple fields = zeroOrMoreProduct <$> traverse deref fields - - klass _ _ _ = pure Object - namespace _ _ = pure Unit - - scopedEnvironment _ = pure (Just lowerBound) - - asString t = unify t String $> "" - asPair t = do - t1 <- fresh - t2 <- fresh - unify t (Var t1 :* Var t2) $> (Var t1, Var t2) - - index arr sub = do - _ <- unify sub Int - field <- fresh - _ <- unify (Array (Var field)) arr - box (Var field) - - ifthenelse cond if' else' = unify cond Bool *> (if' <|> else') - - liftNumeric _ = unify (Int :+ Float :+ Rational) - liftNumeric2 _ left right = case (left, right) of - (Float, Int) -> pure Float - (Int, Float) -> pure Float - _ -> unify left right - - liftBitwise _ = unify Int - liftBitwise2 _ t1 t2 = unify Int t1 >>= flip unify t2 - - liftComparison (Concrete _) left right = case (left, right) of - (Float, Int) -> pure Bool - (Int, Float) -> pure Bool - _ -> unify left right $> Bool - liftComparison Generalized left right = case (left, right) of - (Float, Int) -> pure Int - (Int, Float) -> pure Int - _ -> unify left right $> Bool - - loop f = f empty diff --git a/src/Data/Abstract/Value/Abstract.hs b/src/Data/Abstract/Value/Abstract.hs new file mode 100644 index 000000000..3a4561fc4 --- /dev/null +++ b/src/Data/Abstract/Value/Abstract.hs @@ -0,0 +1,79 @@ +{-# LANGUAGE GADTs, UndecidableInstances #-} +module Data.Abstract.Value.Abstract where + +import Control.Abstract +import Data.Abstract.Environment as Env +import Prologue + +data Abstract = Abstract + deriving (Eq, Ord, Show) + + +instance Ord address => ValueRoots address Abstract where + valueRoots = mempty + +instance AbstractHole Abstract where + hole = Abstract + +instance AbstractIntro Abstract where + unit = Abstract + integer _ = Abstract + boolean _ = Abstract + string _ = Abstract + float _ = Abstract + symbol _ = Abstract + rational _ = Abstract + hash _ = Abstract + kvPair _ _ = Abstract + null = Abstract + +instance ( Member (Allocator address Abstract) effects + , Member (Env address) effects + , Member (Exc (Return address)) effects + , Member Fresh effects + ) + => AbstractFunction address Abstract effects where + closure names _ body = do + env <- foldr (\ name rest -> do + addr <- alloc name + assign addr Abstract + Env.insert name addr <$> rest) (pure lowerBound) names + addr <- locally (bindAll env *> catchReturn body) + deref addr + + call Abstract params = do + traverse_ (>>= deref) params + box Abstract + +instance ( Member (Allocator address Abstract) effects + , Member (Env address) effects + , Member (Exc (Return address)) effects + , Member NonDet effects + , Member Fresh effects + ) + => AbstractValue address Abstract effects where + array _ = pure Abstract + + tuple _ = pure Abstract + + klass _ _ _ = pure Abstract + namespace _ _ = pure Abstract + + scopedEnvironment _ = pure lowerBound + + asString _ = pure "" + asPair _ = pure (Abstract, Abstract) + + index _ _ = box Abstract + + ifthenelse _ if' else' = if' <|> else' + + liftNumeric _ _ = pure Abstract + liftNumeric2 _ _ _ = pure Abstract + + liftBitwise _ _ = pure Abstract + liftBitwise2 _ _ _ = pure Abstract + + liftComparison _ _ _ = pure Abstract + + loop f = f empty diff --git a/src/Data/Abstract/Value.hs b/src/Data/Abstract/Value/Concrete.hs similarity index 92% rename from src/Data/Abstract/Value.hs rename to src/Data/Abstract/Value/Concrete.hs index b14021db7..29ad5e8f7 100644 --- a/src/Data/Abstract/Value.hs +++ b/src/Data/Abstract/Value/Concrete.hs @@ -1,5 +1,5 @@ {-# LANGUAGE GADTs, RankNTypes, TypeOperators, UndecidableInstances #-} -module Data.Abstract.Value where +module Data.Abstract.Value.Concrete where import Control.Abstract import Data.Abstract.Environment (Environment, mergeEnvs) @@ -60,7 +60,7 @@ instance ( Coercible body (Eff effects) , Member (Reader ModuleInfo) effects , Member (Reader PackageInfo) effects , Member (Resumable (ValueError address body)) effects - , Member (Return address) effects + , Member (Exc (Return address)) effects , Show address ) => AbstractFunction address (Value address body) effects where @@ -79,7 +79,7 @@ instance ( Coercible body (Eff effects) bindings <- foldr (\ (name, param) rest -> do addr <- param Env.insert name addr <$> rest) (pure env) (zip names params) - locally (bindAll bindings *> raiseEff (coerce body) `catchReturn` \ (Return ptr) -> pure ptr) + locally (catchReturn (bindAll bindings *> raiseEff (coerce body))) _ -> box =<< throwValueError (CallError op) @@ -102,12 +102,12 @@ instance Show address => AbstractIntro (Value address body) where instance ( Coercible body (Eff effects) , Member (Allocator address (Value address body)) effects , Member (Env address) effects + , Member (Exc (LoopControl address)) effects + , Member (Exc (Return address)) effects , Member Fresh effects - , Member (LoopControl address) effects , Member (Reader ModuleInfo) effects , Member (Reader PackageInfo) effects , Member (Resumable (ValueError address body)) effects - , Member (Return address) effects , Show address ) => AbstractValue address (Value address body) effects where @@ -123,10 +123,10 @@ instance ( Coercible body (Eff effects) product <- foldl mergeEnvs lowerBound . catMaybes <$> traverse scopedEnvironment supers pure $ Class n (mergeEnvs product env) - namespace n env = do - maybeAddr <- lookupEnv n + namespace name env = do + maybeAddr <- lookupEnv name env' <- maybe (pure lowerBound) (asNamespaceEnv <=< deref) maybeAddr - pure (Namespace n (Env.mergeNewer env' env)) + pure (Namespace name (Env.mergeNewer env' env)) where asNamespaceEnv v | Namespace _ env' <- v = pure env' | otherwise = throwValueError $ NamespaceError ("expected " <> show v <> " to be a namespace") @@ -260,8 +260,8 @@ instance Show address => Show1 (ValueError address body) where throwValueError :: Member (Resumable (ValueError address body)) effects => ValueError address body resume -> Evaluator address (Value address body) effects resume throwValueError = throwResumable -runValueError :: Effectful (m address (Value address body)) => m address (Value address body) (Resumable (ValueError address body) ': effects) a -> m address (Value address body) effects (Either (SomeExc (ValueError address body)) a) +runValueError :: (Effectful (m address (Value address body)), Effects effects) => m address (Value address body) (Resumable (ValueError address body) ': effects) a -> m address (Value address body) effects (Either (SomeExc (ValueError address body)) a) runValueError = runResumable -runValueErrorWith :: Effectful (m address (Value address body)) => (forall resume . ValueError address body resume -> m address (Value address body) effects resume) -> m address (Value address body) (Resumable (ValueError address body) ': effects) a -> m address (Value address body) effects a +runValueErrorWith :: (Effectful (m address (Value address body)), Effects effects) => (forall resume . ValueError address body resume -> m address (Value address body) effects resume) -> m address (Value address body) (Resumable (ValueError address body) ': effects) a -> m address (Value address body) effects a runValueErrorWith = runResumableWith diff --git a/src/Data/Abstract/Value/Type.hs b/src/Data/Abstract/Value/Type.hs new file mode 100644 index 000000000..a7b594c38 --- /dev/null +++ b/src/Data/Abstract/Value/Type.hs @@ -0,0 +1,315 @@ +{-# LANGUAGE GADTs, RankNTypes, TypeFamilies, TypeOperators, UndecidableInstances, LambdaCase #-} +module Data.Abstract.Value.Type + ( Type (..) + , TypeError (..) + , TypeMap + , runTypes + , runTypesWith + , unify + ) where + +import Control.Abstract hiding (raiseHandler) +import Control.Monad.Effect.Internal (raiseHandler) +import Data.Abstract.Environment as Env +import Data.Semigroup.Foldable (foldMap1) +import qualified Data.Map as Map +import Prologue hiding (TypeError) + +type TName = Int + +-- | A datatype representing primitive types and combinations thereof. +data Type + = Int -- ^ Primitive int type. + | Bool -- ^ Primitive boolean type. + | String -- ^ Primitive string type. + | Symbol -- ^ Type of unique symbols. + | Unit -- ^ The unit type. + | Float -- ^ Floating-point type. + | Rational -- ^ Rational type. + | Type :-> Type -- ^ Binary function types. + | Var TName -- ^ A type variable. + | Type :* Type -- ^ Binary products. + | Type :+ Type -- ^ Binary sums. + | Void -- ^ Uninhabited void type. + | Array Type -- ^ Arrays. + | Hash [(Type, Type)] -- ^ Heterogenous key-value maps. + | Object -- ^ Objects. Once we have some notion of inheritance we'll need to store a superclass. + | Null -- ^ The null type. Unlike 'Unit', this unifies with any other type. + | Hole -- ^ The hole type. + deriving (Eq, Ord, Show) + +infixl 6 :+ +infixl 7 :* +infixr 0 :-> + +newtype Product = Product { getProduct :: Type } + +instance Semigroup Product where + Product a <> Product b = Product (a :* b) + +instance Monoid Product where + mempty = Product Unit + mappend = (<>) + +oneOrMoreProduct :: NonEmpty Type -> Type +oneOrMoreProduct = getProduct . foldMap1 Product + +zeroOrMoreProduct :: [Type] -> Type +zeroOrMoreProduct = maybe Unit oneOrMoreProduct . nonEmpty + +-- TODO: À la carte representation of types. + +-- | Errors representing failures in typechecking. Note that we should in general constrain allowable types by 'unify'ing, and thus throwing 'UnificationError's when constraints aren’t met, in order to allow uniform resumption with one or the other parameter type. +data TypeError resume where + UnificationError :: Type -> Type -> TypeError Type + InfiniteType :: Type -> Type -> TypeError Type + +deriving instance Eq (TypeError resume) +deriving instance Ord (TypeError resume) +deriving instance Show (TypeError resume) + +instance Eq1 TypeError where + liftEq _ (UnificationError a1 b1) (UnificationError a2 b2) = a1 == a2 && b1 == b2 + liftEq _ (InfiniteType a1 b1) (InfiniteType a2 b2) = a1 == a2 && b1 == b2 + liftEq _ _ _ = False + +instance Ord1 TypeError where + liftCompare _ (UnificationError a1 b1) (UnificationError a2 b2) = compare a1 a2 <> compare b1 b2 + liftCompare _ (InfiniteType a1 b1) (InfiniteType a2 b2) = compare a1 a2 <> compare b1 b2 + liftCompare _ (InfiniteType _ _) (UnificationError _ _) = LT + liftCompare _ (UnificationError _ _) (InfiniteType _ _) = GT + +instance Show1 TypeError where liftShowsPrec _ _ = showsPrec + +runTypeError :: (Effectful m, Effects effects) => m (Resumable TypeError ': effects) a -> m effects (Either (SomeExc TypeError) a) +runTypeError = runResumable + +runTypeErrorWith :: (Effectful m, Effects effects) => (forall resume . TypeError resume -> m effects resume) -> m (Resumable TypeError ': effects) a -> m effects a +runTypeErrorWith = runResumableWith + +runTypeMap :: ( Effectful m + , Effects effects + ) + => m (State TypeMap ': effects) a + -> m effects a +runTypeMap = raiseHandler (runState emptyTypeMap >=> pure . snd) + +runTypes :: ( Effectful m + , Effects effects + ) + => m (Resumable TypeError ': State TypeMap ': effects) a + -> m effects (Either (SomeExc TypeError) a) +runTypes = runTypeMap . runTypeError + +runTypesWith :: ( Effectful m + , Effects effects + ) + => (forall resume . TypeError resume -> m (State TypeMap ': effects) resume) + -> m (Resumable TypeError ': State TypeMap ': effects) a + -> m effects a +runTypesWith with = runTypeMap . runTypeErrorWith with + +-- TODO: change my name? +newtype TypeMap = TypeMap { unTypeMap :: Map.Map TName Type } + +emptyTypeMap :: TypeMap +emptyTypeMap = TypeMap Map.empty + +modifyTypeMap :: ( Effectful m + , Member (State TypeMap) effects + ) + => (Map.Map TName Type -> Map.Map TName Type) + -> m effects () +modifyTypeMap f = modify (TypeMap . f . unTypeMap) + +-- | Prunes substituted type variables +prune :: ( Effectful m + , Monad (m effects) + , Member (State TypeMap) effects + ) + => Type + -> m effects Type +prune (Var id) = Map.lookup id . unTypeMap <$> get >>= \case + Just ty -> do + pruned <- prune ty + modifyTypeMap (Map.insert id pruned) + pure pruned + Nothing -> pure (Var id) +prune ty = pure ty + +-- | Checks whether a type variable name occurs within another type. This +-- function is used in 'substitute' to prevent unification of infinite types +occur :: ( Effectful m + , Monad (m effects) + , Member (State TypeMap) effects + ) + => TName + -> Type + -> m effects Bool +occur id = prune >=> \case + Int -> pure False + Bool -> pure False + String -> pure False + Symbol -> pure False + Unit -> pure False + Float -> pure False + Rational -> pure False + Void -> pure False + Object -> pure False + Null -> pure False + Hole -> pure False + a :-> b -> eitherM (occur id) (a, b) + a :* b -> eitherM (occur id) (a, b) + a :+ b -> eitherM (occur id) (a, b) + Array ty -> occur id ty + Hash kvs -> or <$> traverse (eitherM (occur id)) kvs + Var vid -> pure (vid == id) + where + eitherM :: Applicative m => (a -> m Bool) -> (a, a) -> m Bool + eitherM f (a, b) = (||) <$> f a <*> f b + +-- | Substitutes a type variable name for another type +substitute :: ( Effectful m + , Monad (m effects) + , Member (Resumable TypeError) effects + , Member (State TypeMap) effects + ) + => TName + -> Type + -> m effects Type +substitute id ty = do + infiniteType <- occur id ty + ty <- if infiniteType + then throwResumable (InfiniteType (Var id) ty) + else pure ty + modifyTypeMap (Map.insert id ty) + pure ty + +-- | Unify two 'Type's. +unify :: ( Effectful m + , Monad (m effects) + , Member (Resumable TypeError) effects + , Member (State TypeMap) effects + ) + => Type + -> Type + -> m effects Type +unify a b = do + a' <- prune a + b' <- prune b + case (a', b') of + (a1 :-> b1, a2 :-> b2) -> (:->) <$> unify a1 a2 <*> unify b1 b2 + (a, Null) -> pure a + (Null, b) -> pure b + (Var id, ty) -> substitute id ty + (ty, Var id) -> substitute id ty + (Array t1, Array t2) -> Array <$> unify t1 t2 + -- FIXME: unifying with sums should distribute nondeterministically. + -- FIXME: ordering shouldn’t be significant for undiscriminated sums. + (a1 :+ b1, a2 :+ b2) -> (:+) <$> unify a1 a2 <*> unify b1 b2 + (a1 :* b1, a2 :* b2) -> (:*) <$> unify a1 a2 <*> unify b1 b2 + (t1, t2) | t1 == t2 -> pure t2 + _ -> throwResumable (UnificationError a b) + +instance Ord address => ValueRoots address Type where + valueRoots _ = mempty + + +instance AbstractHole Type where + hole = Hole + +instance AbstractIntro Type where + unit = Unit + integer _ = Int + boolean _ = Bool + string _ = String + float _ = Float + symbol _ = Symbol + rational _ = Rational + hash = Hash + kvPair k v = k :* v + + null = Null + + +instance ( Member (Allocator address Type) effects + , Member (Env address) effects + , Member (Exc (Return address)) effects + , Member Fresh effects + , Member (Resumable TypeError) effects + , Member (State TypeMap) effects + ) + => AbstractFunction address Type effects where + closure names _ body = do + (env, tvars) <- foldr (\ name rest -> do + addr <- alloc name + tvar <- Var <$> fresh + assign addr tvar + bimap (Env.insert name addr) (tvar :) <$> rest) (pure (lowerBound, [])) names + (zeroOrMoreProduct tvars :->) <$> (deref =<< locally (catchReturn (bindAll env *> body))) + + call op params = do + tvar <- fresh + paramTypes <- traverse (>>= deref) params + let needed = zeroOrMoreProduct paramTypes :-> Var tvar + unified <- op `unify` needed + case unified of + _ :-> ret -> box ret + gotten -> box =<< throwResumable (UnificationError needed gotten) + + +-- | Discard the value arguments (if any), constructing a 'Type' instead. +instance ( Member (Allocator address Type) effects + , Member (Env address) effects + , Member (Exc (Return address)) effects + , Member Fresh effects + , Member NonDet effects + , Member (Resumable TypeError) effects + , Member (State TypeMap) effects + ) + => AbstractValue address Type effects where + array fields = do + var <- fresh + fieldTypes <- traverse deref fields + Array <$> foldr (\ t1 -> (unify t1 =<<)) (pure (Var var)) fieldTypes + + tuple fields = zeroOrMoreProduct <$> traverse deref fields + + klass _ _ _ = pure Object + namespace _ _ = pure Unit + + scopedEnvironment _ = pure (Just lowerBound) + + asString t = unify t String $> "" + asPair t = do + t1 <- fresh + t2 <- fresh + unify t (Var t1 :* Var t2) $> (Var t1, Var t2) + + index arr sub = do + _ <- unify sub Int + field <- fresh + _ <- unify (Array (Var field)) arr + box (Var field) + + ifthenelse cond if' else' = unify cond Bool *> (if' <|> else') + + liftNumeric _ = unify (Int :+ Float :+ Rational) + liftNumeric2 _ left right = case (left, right) of + (Float, Int) -> pure Float + (Int, Float) -> pure Float + _ -> unify left right + + liftBitwise _ = unify Int + liftBitwise2 _ t1 t2 = unify Int t1 >>= flip unify t2 + + liftComparison (Concrete _) left right = case (left, right) of + (Float, Int) -> pure Bool + (Int, Float) -> pure Bool + _ -> unify left right $> Bool + liftComparison Generalized left right = case (left, right) of + (Float, Int) -> pure Int + (Int, Float) -> pure Int + _ -> unify left right $> Bool + + loop f = f empty diff --git a/src/Data/Graph.hs b/src/Data/Graph.hs index 499ece76d..8dba6d352 100644 --- a/src/Data/Graph.hs +++ b/src/Data/Graph.hs @@ -54,7 +54,7 @@ topologicalSort :: forall v . Ord v => Graph v -> [v] topologicalSort = go . toAdjacencyMap . G.transpose . unGraph where go :: A.AdjacencyMap v -> [v] go graph - = visitedOrder . snd + = visitedOrder . fst . run . runState (Visited lowerBound []) . traverse_ visit diff --git a/src/Data/Graph/Adjacency/Import.hs b/src/Data/Graph/Adjacency/Import.hs index 7987c75a0..f80294828 100644 --- a/src/Data/Graph/Adjacency/Import.hs +++ b/src/Data/Graph/Adjacency/Import.hs @@ -124,7 +124,7 @@ tagGraph :: forall a . (Eq a, Hashable a) => Graph a -> Graph (a, Tag) tagGraph = unwrap . traverse go where unwrap :: Eff '[Fresh, State (HashMap a Tag)] (Graph (a, Tag)) -> Graph (a, Tag) - unwrap = run . fmap fst . runState HashMap.empty . runFresh 1 + unwrap = run . fmap snd . runState HashMap.empty . runFresh 1 go :: a -> Eff '[Fresh, State (HashMap a Tag)] (a, Tag) go v = gets (HashMap.lookup v) >>= \case diff --git a/src/Data/Span.hs b/src/Data/Span.hs index 6e7c0bdf1..1bc4fd936 100644 --- a/src/Data/Span.hs +++ b/src/Data/Span.hs @@ -43,6 +43,9 @@ instance A.FromJSON Pos where [line, col] <- A.parseJSON arr pure $ Pos line col +instance Lower Pos where + lowerBound = Pos 1 1 + data Span = Span { spanStart :: Pos , spanEnd :: Pos @@ -74,4 +77,4 @@ instance ToJSONFields Span where toJSONFields sourceSpan = [ "sourceSpan" .= sourceSpan ] instance Lower Span where - lowerBound = Span (Pos 1 1) (Pos 1 1) + lowerBound = Span lowerBound lowerBound diff --git a/src/Data/Syntax.hs b/src/Data/Syntax.hs index a64676e78..f2e1a40fd 100644 --- a/src/Data/Syntax.hs +++ b/src/Data/Syntax.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE AllowAmbiguousTypes, DeriveAnyClass, GADTs, TypeOperators, MultiParamTypeClasses, UndecidableInstances, ScopedTypeVariables, KindSignatures, RankNTypes, ConstraintKinds #-} +{-# LANGUAGE AllowAmbiguousTypes, DeriveAnyClass, GADTs, TypeOperators, MultiParamTypeClasses, UndecidableInstances, ScopedTypeVariables, KindSignatures, RankNTypes, ConstraintKinds, GeneralizedNewtypeDeriving, DerivingStrategies #-} {-# OPTIONS_GHC -Wno-redundant-constraints -fno-warn-orphans #-} -- For HasCallStack module Data.Syntax where @@ -17,11 +17,12 @@ import Prologue import qualified Assigning.Assignment as Assignment import qualified Data.Error as Error import Proto3.Suite.Class -import Proto3.Wire.Decode import Proto3.Wire.Types import GHC.Types (Constraint) import GHC.TypeLits import qualified Proto3.Suite.DotProto as Proto +import qualified Proto3.Wire.Encode as Encode +import qualified Proto3.Wire.Decode as Decode import Data.Char (toLower) -- Combinators @@ -57,11 +58,11 @@ emptyTerm = makeTerm . startLocation <$> Assignment.location <*> pure Empty -- | Catch assignment errors into an error term. handleError :: (HasCallStack, Error :< syntaxes, Enum grammar, Eq1 ast, Ix grammar, Show grammar, Apply Foldable syntaxes) => Assignment.Assignment ast grammar (Term (Sum syntaxes) (Record Location)) -> Assignment.Assignment ast grammar (Term (Sum syntaxes) (Record Location)) -handleError = flip catchError (\ err -> makeTerm <$> Assignment.location <*> pure (errorSyntax (either id show <$> err) []) <* Assignment.source) +handleError = flip Assignment.catchError (\ err -> makeTerm <$> Assignment.location <*> pure (errorSyntax (either id show <$> err) []) <* Assignment.source) -- | Catch parse errors into an error term. parseError :: (HasCallStack, Error :< syntaxes, Bounded grammar, Enum grammar, Ix grammar, Apply Foldable syntaxes) => Assignment.Assignment ast grammar (Term (Sum syntaxes) (Record Location)) -parseError = makeTerm <$> Assignment.token maxBound <*> pure (Error (ErrorStack (getCallStack (freezeCallStack callStack))) [] (Just "ParseError") []) +parseError = makeTerm <$> Assignment.token maxBound <*> pure (Error (ErrorStack $ errorSite <$> getCallStack (freezeCallStack callStack)) [] (Just "ParseError") []) -- | Match context terms before a subject term, wrapping both up in a Context term if any context terms matched, or otherwise returning the subject term. @@ -105,11 +106,16 @@ infixContext :: (Context :< syntaxes, Assignment.Parsing m, Semigroup ann, HasCa infixContext context left right operators = uncurry (&) <$> postContextualizeThrough context left (asum operators) <*> postContextualize context right instance (Apply Message1 fs, Generate Message1 fs fs, Generate Named1 fs fs) => Message1 (Sum fs) where - liftEncodeMessage encodeMessage num = apply @Message1 (liftEncodeMessage encodeMessage num) - liftDecodeMessage decodeMessage _ = oneof undefined listOfParsers + liftEncodeMessage encodeMessage _ fs = Encode.embedded (fromIntegral . succ $ elemIndex fs) message + where message = apply @Message1 (liftEncodeMessage encodeMessage 1) fs + liftDecodeMessage decodeMessage subMessageNum = Decode.oneof undefined listOfParsers where listOfParsers = - generate @Message1 @fs @fs (\ (_ :: proxy f) i -> let num = FieldNumber (fromInteger (succ i)) in [(num, trustMe <$> embedded (inject @f @fs <$> liftDecodeMessage decodeMessage num))]) + generate @Message1 @fs @fs (\ (_ :: proxy f) i -> + let + num = fromInteger (succ i) + in + [(num, trustMe <$> Decode.embedded (inject @f @fs <$> liftDecodeMessage decodeMessage subMessageNum))]) trustMe (Just a) = a trustMe Nothing = error "liftDecodeMessage (Sum): embedded parser returned Nothing" liftDotProto _ = @@ -132,11 +138,25 @@ instance Generate c all '[] where instance (Element f all, c f, Generate c all fs) => Generate c all (f ': fs) where generate each = each (Proxy @f) (natVal (Proxy @(ElemIndex f all))) `mappend` generate @c @all @fs each +instance Named1 [] where + nameOf1 _ = "List" + +instance Message1 [] where + liftEncodeMessage encodeMessage num = foldMap (Encode.embedded num . encodeMessage (fieldNumber 1)) + liftDecodeMessage decodeMessage num = toList <$> Decode.repeated (Decode.embedded' oneMsg) `Decode.at` num + where + oneMsg = decodeMessage (fieldNumber 1) + liftDotProto (_ :: Proxy [a]) = [ Proto.DotProtoMessageField $ Proto.DotProtoField (fieldNumber 1) ty (Proto.Single "listContent") [] Nothing ] + where ty = Proto.NestedRepeated (Proto.Named (Proto.Single (nameOf (Proxy @a)))) + + -- Common -- | An identifier of some other construct, whether a containing declaration (e.g. a class name) or a reference (e.g. a variable). newtype Identifier a = Identifier { name :: Name } - deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, Named1, ToJSONFields1) + deriving newtype (Eq, Ord, Show) + deriving stock (Foldable, Functor, Generic1, Traversable) + deriving anyclass (Diffable, Hashable1, Mergeable, Message1, Named1, ToJSONFields1) instance Eq1 Identifier where liftEq = genericLiftEq instance Ord1 Identifier where liftCompare = genericLiftCompare @@ -152,8 +172,10 @@ instance Declarations1 Identifier where liftDeclaredName _ (Identifier x) = pure x -- | An accessibility modifier, e.g. private, public, protected, etc. -newtype AccessibilityModifier a = AccessibilityModifier Text - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype AccessibilityModifier a = AccessibilityModifier { contents :: Text } + deriving newtype (Eq, Ord, Show) + deriving stock (Foldable, Functor, Generic1, Traversable) + deriving anyclass (Declarations1, Diffable, FreeVariables1, Hashable1, Mergeable, Message1, Named1, ToJSONFields1) instance Eq1 AccessibilityModifier where liftEq = genericLiftEq instance Ord1 AccessibilityModifier where liftCompare = genericLiftCompare @@ -177,7 +199,7 @@ instance Evaluatable Empty where -- | Syntax representing a parsing or assignment error. data Error a = Error { errorCallStack :: ErrorStack, errorExpected :: [String], errorActual :: Maybe String, errorChildren :: [a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Error where liftEq = genericLiftEq instance Ord1 Error where liftCompare = genericLiftCompare @@ -185,23 +207,52 @@ instance Show1 Error where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Error +instance Named String where + nameOf _ = "string" + +instance Message String where + encodeMessage = encodeMessageField + decodeMessage = Decode.at decodeMessageField + dotProto _ = [ Proto.DotProtoMessageField $ protoType (Proxy @String) ] + errorSyntax :: Error.Error String -> [a] -> Error a -errorSyntax Error.Error{..} = Error (ErrorStack (getCallStack callStack)) errorExpected errorActual +errorSyntax Error.Error{..} = Error (ErrorStack $ errorSite <$> getCallStack callStack) errorExpected errorActual unError :: Span -> Error a -> Error.Error String -unError span Error{..} = Error.withCallStack (freezeCallStack (fromCallSiteList (unErrorStack errorCallStack))) (Error.Error span errorExpected errorActual) +unError span Error{..} = Error.withCallStack (freezeCallStack (fromCallSiteList $ unErrorSite <$> unErrorStack errorCallStack)) (Error.Error span errorExpected errorActual) -newtype ErrorStack = ErrorStack { unErrorStack :: [(String, SrcLoc)] } - deriving (Eq) +data ErrorSite = ErrorSite { errorMessage :: String, errorLocation :: SrcLoc } + deriving (Eq, Show, Generic, Named, Message) -instance Show ErrorStack where - showsPrec _ = shows . map showPair . unErrorStack - where showPair (sym, loc) = sym <> " " <> srcLocFile loc <> ":" <> show (srcLocStartLine loc) <> ":" <> show (srcLocStartCol loc) +errorSite :: (String, SrcLoc) -> ErrorSite +errorSite = uncurry ErrorSite + +unErrorSite :: ErrorSite -> (String, SrcLoc) +unErrorSite ErrorSite{..} = (errorMessage, errorLocation) + +newtype ErrorStack = ErrorStack { unErrorStack :: [ErrorSite] } + deriving stock (Eq, Show, Generic) + deriving anyclass (Named, Message) + deriving newtype (MessageField) + +instance HasDefault ErrorStack where + def = ErrorStack mempty + +deriving instance Generic SrcLoc +deriving instance Message SrcLoc +deriving instance Named SrcLoc +instance MessageField SrcLoc where + encodeMessageField num = Encode.embedded num . encodeMessage (fieldNumber 1) + decodeMessageField = fromMaybe def <$> Decode.embedded (decodeMessage (fieldNumber 1)) + protoType _ = messageField (Proto.Prim (Proto.Named (Proto.Single (nameOf (Proxy @SrcLoc))))) Nothing + +instance HasDefault SrcLoc where + def = SrcLoc mempty mempty mempty 1 1 1 1 instance ToJSON ErrorStack where toJSON (ErrorStack es) = toJSON (jSite <$> es) where - jSite (site, SrcLoc{..}) = object + jSite (ErrorSite site SrcLoc{..}) = object [ "site" .= site , "package" .= srcLocPackage , "module" .= srcLocModule @@ -212,10 +263,10 @@ instance ToJSON ErrorStack where ] instance Hashable ErrorStack where - hashWithSalt = hashUsing (map (second ((,,,,,,) <$> srcLocPackage <*> srcLocModule <*> srcLocFile <*> srcLocStartLine <*> srcLocStartCol <*> srcLocEndLine <*> srcLocEndCol)) . unErrorStack) + hashWithSalt = hashUsing (map (second ((,,,,,,) <$> srcLocPackage <*> srcLocModule <*> srcLocFile <*> srcLocStartLine <*> srcLocStartCol <*> srcLocEndLine <*> srcLocEndCol) . unErrorSite) . unErrorStack) instance Ord ErrorStack where - compare = liftCompare (liftCompare compareSrcLoc) `on` unErrorStack + compare = liftCompare (liftCompare compareSrcLoc) `on` (fmap unErrorSite . unErrorStack) where compareSrcLoc s1 s2 = mconcat [ (compare `on` srcLocPackage) s1 s2 , (compare `on` srcLocModule) s1 s2 @@ -228,7 +279,7 @@ instance Ord ErrorStack where data Context a = Context { contextTerms :: NonEmpty a, contextSubject :: a } - deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Mergeable, FreeVariables1, Declarations1, ToJSONFields1) + deriving (Declarations1, Eq, Foldable, FreeVariables1, Functor, Generic1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Diffable Context where subalgorithmFor blur focus (Context n s) = Context <$> traverse blur n <*> focus s diff --git a/src/Data/Syntax/Comment.hs b/src/Data/Syntax/Comment.hs index d4b91bfe3..ce7854c59 100644 --- a/src/Data/Syntax/Comment.hs +++ b/src/Data/Syntax/Comment.hs @@ -1,14 +1,15 @@ {-# LANGUAGE DeriveAnyClass, MultiParamTypeClasses #-} module Data.Syntax.Comment where -import Prologue import Data.Abstract.Evaluatable import Data.JSON.Fields import Diffing.Algorithm +import Prologue +import Proto3.Suite.Class -- | An unnested comment (line or block). newtype Comment a = Comment { commentContent :: Text } - deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1, ToJSONFields1) + deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1, ToJSONFields1, Named1, Message1) instance Eq1 Comment where liftEq = genericLiftEq instance Ord1 Comment where liftCompare = genericLiftCompare @@ -23,8 +24,8 @@ instance Evaluatable Comment where -- TODO: Differentiate between line/block comments? -- | HashBang line (e.g. `#!/usr/bin/env node`) -newtype HashBang a = HashBang Text - deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1, ToJSONFields1) +newtype HashBang a = HashBang { value :: Text } + deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1, ToJSONFields1, Named1, Message1) instance Eq1 HashBang where liftEq = genericLiftEq instance Ord1 HashBang where liftCompare = genericLiftCompare diff --git a/src/Data/Syntax/Declaration.hs b/src/Data/Syntax/Declaration.hs index 67ea2dbd6..7cf859c98 100644 --- a/src/Data/Syntax/Declaration.hs +++ b/src/Data/Syntax/Declaration.hs @@ -2,14 +2,15 @@ module Data.Syntax.Declaration where import qualified Data.Abstract.Environment as Env -import Data.Abstract.Evaluatable -import Data.JSON.Fields +import Data.Abstract.Evaluatable +import Data.JSON.Fields import qualified Data.Set as Set (fromList) -import Diffing.Algorithm -import Prologue +import Diffing.Algorithm +import Prologue +import Proto3.Suite.Class data Function a = Function { functionContext :: ![a], functionName :: !a, functionParameters :: ![a], functionBody :: !a } - deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Mergeable, FreeVariables1, Declarations1, ToJSONFields1) + deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Mergeable, FreeVariables1, Declarations1, ToJSONFields1, Named1, Message1) instance Diffable Function where equivalentBySubterm = Just . functionName @@ -34,7 +35,7 @@ instance Declarations a => Declarations (Function a) where data Method a = Method { methodContext :: ![a], methodReceiver :: !a, methodName :: !a, methodParameters :: ![a], methodBody :: !a } - deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Mergeable, FreeVariables1, Declarations1, ToJSONFields1) + deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Mergeable, FreeVariables1, Declarations1, ToJSONFields1, Named1, Message1) instance Eq1 Method where liftEq = genericLiftEq instance Ord1 Method where liftCompare = genericLiftCompare @@ -55,8 +56,8 @@ instance Evaluatable Method where -- | A method signature in TypeScript or a method spec in Go. -data MethodSignature a = MethodSignature { _methodSignatureContext :: ![a], _methodSignatureName :: !a, _methodSignatureParameters :: ![a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data MethodSignature a = MethodSignature { methodSignatureContext :: ![a], methodSignatureName :: !a, methodSignatureParameters :: ![a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 MethodSignature where liftEq = genericLiftEq instance Ord1 MethodSignature where liftCompare = genericLiftCompare @@ -67,7 +68,7 @@ instance Evaluatable MethodSignature newtype RequiredParameter a = RequiredParameter { requiredParameter :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 RequiredParameter where liftEq = genericLiftEq instance Ord1 RequiredParameter where liftCompare = genericLiftCompare @@ -78,7 +79,7 @@ instance Evaluatable RequiredParameter newtype OptionalParameter a = OptionalParameter { optionalParameter :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 OptionalParameter where liftEq = genericLiftEq instance Ord1 OptionalParameter where liftCompare = genericLiftCompare @@ -93,7 +94,7 @@ instance Evaluatable OptionalParameter -- TODO: It would be really nice to have a more meaningful type contained in here than [a] -- | A declaration of possibly many variables such as var foo = 5, bar = 6 in JavaScript. newtype VariableDeclaration a = VariableDeclaration { variableDeclarations :: [a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 VariableDeclaration where liftEq = genericLiftEq instance Ord1 VariableDeclaration where liftCompare = genericLiftCompare @@ -111,7 +112,7 @@ instance Declarations a => Declarations (VariableDeclaration a) where -- | A TypeScript/Java style interface declaration to implement. data InterfaceDeclaration a = InterfaceDeclaration { interfaceDeclarationContext :: ![a], interfaceDeclarationIdentifier :: !a, interfaceDeclarationBody :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 InterfaceDeclaration where liftEq = genericLiftEq instance Ord1 InterfaceDeclaration where liftCompare = genericLiftCompare @@ -126,7 +127,7 @@ instance Declarations a => Declarations (InterfaceDeclaration a) where -- | A public field definition such as a field definition in a JavaScript class. data PublicFieldDefinition a = PublicFieldDefinition { publicFieldContext :: ![a], publicFieldPropertyName :: !a, publicFieldValue :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 PublicFieldDefinition where liftEq = genericLiftEq instance Ord1 PublicFieldDefinition where liftCompare = genericLiftCompare @@ -137,7 +138,7 @@ instance Evaluatable PublicFieldDefinition data Variable a = Variable { variableName :: !a, variableType :: !a, variableValue :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Variable where liftEq = genericLiftEq instance Ord1 Variable where liftCompare = genericLiftCompare @@ -147,7 +148,7 @@ instance Show1 Variable where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Variable data Class a = Class { classContext :: ![a], classIdentifier :: !a, classSuperclasses :: ![a], classBody :: !a } - deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Mergeable, FreeVariables1, Declarations1, ToJSONFields1) + deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Mergeable, FreeVariables1, Declarations1, ToJSONFields1, Named1, Message1) instance Declarations a => Declarations (Class a) where declaredName (Class _ name _ _) = declaredName name @@ -172,7 +173,7 @@ instance Evaluatable Class where -- | A decorator in Python data Decorator a = Decorator { decoratorIdentifier :: !a, decoratorParamaters :: ![a], decoratorBody :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Decorator where liftEq = genericLiftEq instance Ord1 Decorator where liftCompare = genericLiftCompare @@ -186,7 +187,7 @@ instance Evaluatable Decorator -- | An ADT, i.e. a disjoint sum of products, like 'data' in Haskell, or 'enum' in Rust or Swift. data Datatype a = Datatype { datatypeContext :: a, datatypeName :: a, datatypeConstructors :: [a], datatypeDeriving :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Data.Syntax.Declaration.Datatype where liftEq = genericLiftEq instance Ord1 Data.Syntax.Declaration.Datatype where liftCompare = genericLiftCompare @@ -198,7 +199,7 @@ instance Evaluatable Data.Syntax.Declaration.Datatype -- | A single constructor in a datatype, or equally a 'struct' in C, Rust, or Swift. data Constructor a = Constructor { constructorContext :: [a], constructorName :: a, constructorFields :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Data.Syntax.Declaration.Constructor where liftEq = genericLiftEq instance Ord1 Data.Syntax.Declaration.Constructor where liftCompare = genericLiftCompare @@ -210,7 +211,7 @@ instance Evaluatable Data.Syntax.Declaration.Constructor -- | Comprehension (e.g. ((a for b in c if a()) in Python) data Comprehension a = Comprehension { comprehensionValue :: !a, comprehensionBody :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Comprehension where liftEq = genericLiftEq instance Ord1 Comprehension where liftCompare = genericLiftCompare @@ -222,7 +223,7 @@ instance Evaluatable Comprehension -- | A declared type (e.g. `a []int` in Go). data Type a = Type { typeName :: !a, typeKind :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Type where liftEq = genericLiftEq instance Ord1 Type where liftCompare = genericLiftCompare @@ -234,7 +235,7 @@ instance Evaluatable Type -- | Type alias declarations in Javascript/Haskell, etc. data TypeAlias a = TypeAlias { typeAliasContext :: ![a], typeAliasIdentifier :: !a, typeAliasKind :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 TypeAlias where liftEq = genericLiftEq instance Ord1 TypeAlias where liftCompare = genericLiftCompare diff --git a/src/Data/Syntax/Directive.hs b/src/Data/Syntax/Directive.hs index 693d4591e..9fe5df02a 100644 --- a/src/Data/Syntax/Directive.hs +++ b/src/Data/Syntax/Directive.hs @@ -2,16 +2,17 @@ module Data.Syntax.Directive where import Data.Abstract.Evaluatable -import Data.Abstract.Module (ModuleInfo(..)) -import qualified Data.Text as T +import Data.Abstract.Module (ModuleInfo (..)) import Data.JSON.Fields import Data.Span +import qualified Data.Text as T import Diffing.Algorithm import Prologue +import Proto3.Suite.Class -- A file directive like the Ruby constant `__FILE__`. data File a = File - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 File where liftEq = genericLiftEq instance Ord1 File where liftCompare = genericLiftCompare @@ -23,7 +24,7 @@ instance Evaluatable File where -- A line directive like the Ruby constant `__LINE__`. data Line a = Line - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Line where liftEq = genericLiftEq instance Ord1 Line where liftCompare = genericLiftCompare diff --git a/src/Data/Syntax/Expression.hs b/src/Data/Syntax/Expression.hs index 4e3049414..6ebd10654 100644 --- a/src/Data/Syntax/Expression.hs +++ b/src/Data/Syntax/Expression.hs @@ -1,16 +1,17 @@ -{-# LANGUAGE DeriveAnyClass, MultiParamTypeClasses, ScopedTypeVariables, UndecidableInstances #-} +{-# LANGUAGE DeriveAnyClass, MultiParamTypeClasses, ScopedTypeVariables, UndecidableInstances, DuplicateRecordFields #-} module Data.Syntax.Expression where -import Data.Abstract.Evaluatable +import Data.Abstract.Evaluatable hiding (Member) import Data.Abstract.Number (liftIntegralFrac, liftReal, liftedExponent, liftedFloorDiv) import Data.Fixed import Data.JSON.Fields import Diffing.Algorithm -import Prologue hiding (index) +import Prologue hiding (index, Member) +import Proto3.Suite.Class -- | Typical prefix function application, like `f(x)` in many languages, or `f x` in Haskell. data Call a = Call { callContext :: ![a], callFunction :: !a, callParams :: ![a], callBlock :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Call where liftEq = genericLiftEq instance Ord1 Call where liftCompare = genericLiftCompare @@ -21,15 +22,84 @@ instance Evaluatable Call where op <- subtermValue callFunction Rval <$> call op (map subtermAddress callParams) -data Comparison a - = LessThan !a !a - | LessThanEqual !a !a - | GreaterThan !a !a - | GreaterThanEqual !a !a - | Equal !a !a - | StrictEqual !a !a - | Comparison !a !a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data LessThan a = LessThan { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 LessThan where liftEq = genericLiftEq +instance Ord1 LessThan where liftCompare = genericLiftCompare +instance Show1 LessThan where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable LessThan where + eval t = rvalBox =<< (traverse subtermValue t >>= go) where + go x = case x of + (LessThan a b) -> liftComparison (Concrete (<)) a b + +data LessThanEqual a = LessThanEqual { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 LessThanEqual where liftEq = genericLiftEq +instance Ord1 LessThanEqual where liftCompare = genericLiftCompare +instance Show1 LessThanEqual where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable LessThanEqual where + eval t = rvalBox =<< (traverse subtermValue t >>= go) where + go x = case x of + (LessThanEqual a b) -> liftComparison (Concrete (<=)) a b + +data GreaterThan a = GreaterThan { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 GreaterThan where liftEq = genericLiftEq +instance Ord1 GreaterThan where liftCompare = genericLiftCompare +instance Show1 GreaterThan where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable GreaterThan where + eval t = rvalBox =<< (traverse subtermValue t >>= go) where + go x = case x of + (GreaterThan a b) -> liftComparison (Concrete (>)) a b + +data GreaterThanEqual a = GreaterThanEqual { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 GreaterThanEqual where liftEq = genericLiftEq +instance Ord1 GreaterThanEqual where liftCompare = genericLiftCompare +instance Show1 GreaterThanEqual where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable GreaterThanEqual where + eval t = rvalBox =<< (traverse subtermValue t >>= go) where + go x = case x of + (GreaterThanEqual a b) -> liftComparison (Concrete (>=)) a b + +data Equal a = Equal { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 Equal where liftEq = genericLiftEq +instance Ord1 Equal where liftCompare = genericLiftCompare +instance Show1 Equal where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable Equal where + eval t = rvalBox =<< (traverse subtermValue t >>= go) where + go x = case x of + -- TODO: in PHP and JavaScript, the equals operator performs type coercion. + -- We need some mechanism to customize this behavior per-language. + (Equal a b) -> liftComparison (Concrete (==)) a b + +data StrictEqual a = StrictEqual { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 StrictEqual where liftEq = genericLiftEq +instance Ord1 StrictEqual where liftCompare = genericLiftCompare +instance Show1 StrictEqual where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable StrictEqual where + eval t = rvalBox =<< (traverse subtermValue t >>= go) where + go x = case x of + -- TODO: in PHP and JavaScript, the equals operator performs type coercion. + -- We need some mechanism to customize this behavior per-language. + (StrictEqual a b) -> liftComparison (Concrete (==)) a b + +data Comparison a = Comparison { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Comparison where liftEq = genericLiftEq instance Ord1 Comparison where liftCompare = genericLiftCompare @@ -38,83 +108,164 @@ instance Show1 Comparison where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Comparison where eval t = rvalBox =<< (traverse subtermValue t >>= go) where go x = case x of - (LessThan a b) -> liftComparison (Concrete (<)) a b - (LessThanEqual a b) -> liftComparison (Concrete (<=)) a b - (GreaterThan a b) -> liftComparison (Concrete (>)) a b - (GreaterThanEqual a b) -> liftComparison (Concrete (>=)) a b - -- TODO: in PHP and JavaScript, the equals operator performs type coercion. - -- We need some mechanism to customize this behavior per-language. - (Equal a b) -> liftComparison (Concrete (==)) a b - (StrictEqual a b) -> liftComparison (Concrete (==)) a b - (Comparison a b) -> liftComparison Generalized a b + (Comparison a b) -> liftComparison (Concrete (==)) a b --- | Binary arithmetic operators. -data Arithmetic a - = Plus !a !a - | Minus !a !a - | Times !a !a - | DividedBy !a !a - | FloorDivision !a !a - | Modulo !a !a - | Power !a !a - | Negate !a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data Plus a = Plus { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) -instance Eq1 Arithmetic where liftEq = genericLiftEq -instance Ord1 Arithmetic where liftCompare = genericLiftCompare -instance Show1 Arithmetic where liftShowsPrec = genericLiftShowsPrec +instance Eq1 Plus where liftEq = genericLiftEq +instance Ord1 Plus where liftCompare = genericLiftCompare +instance Show1 Plus where liftShowsPrec = genericLiftShowsPrec -instance Evaluatable Arithmetic where +instance Evaluatable Plus where eval t = rvalBox =<< (traverse subtermValue t >>= go) where go (Plus a b) = liftNumeric2 add a b where add = liftReal (+) + +data Minus a = Minus { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 Minus where liftEq = genericLiftEq +instance Ord1 Minus where liftCompare = genericLiftCompare +instance Show1 Minus where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable Minus where + eval t = rvalBox =<< (traverse subtermValue t >>= go) where go (Minus a b) = liftNumeric2 sub a b where sub = liftReal (-) + +data Times a = Times { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 Times where liftEq = genericLiftEq +instance Ord1 Times where liftCompare = genericLiftCompare +instance Show1 Times where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable Times where + eval t = rvalBox =<< (traverse subtermValue t >>= go) where go (Times a b) = liftNumeric2 mul a b where mul = liftReal (*) + +data DividedBy a = DividedBy { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 DividedBy where liftEq = genericLiftEq +instance Ord1 DividedBy where liftCompare = genericLiftCompare +instance Show1 DividedBy where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable DividedBy where + eval t = rvalBox =<< (traverse subtermValue t >>= go) where go (DividedBy a b) = liftNumeric2 div' a b where div' = liftIntegralFrac div (/) + +data Modulo a = Modulo { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 Modulo where liftEq = genericLiftEq +instance Ord1 Modulo where liftCompare = genericLiftCompare +instance Show1 Modulo where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable Modulo where + eval t = rvalBox =<< (traverse subtermValue t >>= go) where go (Modulo a b) = liftNumeric2 mod'' a b where mod'' = liftIntegralFrac mod mod' + +data Power a = Power { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 Power where liftEq = genericLiftEq +instance Ord1 Power where liftCompare = genericLiftCompare +instance Show1 Power where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable Power where + eval t = rvalBox =<< (traverse subtermValue t >>= go) where go (Power a b) = liftNumeric2 liftedExponent a b + +newtype Negate a = Negate { term :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 Negate where liftEq = genericLiftEq +instance Ord1 Negate where liftCompare = genericLiftCompare +instance Show1 Negate where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable Negate where + eval t = rvalBox =<< (traverse subtermValue t >>= go) where go (Negate a) = liftNumeric negate a + +data FloorDivision a = FloorDivision { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 FloorDivision where liftEq = genericLiftEq +instance Ord1 FloorDivision where liftCompare = genericLiftCompare +instance Show1 FloorDivision where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable FloorDivision where + eval t = rvalBox =<< (traverse subtermValue t >>= go) where go (FloorDivision a b) = liftNumeric2 liftedFloorDiv a b -- | Regex matching operators (Ruby's =~ and ~!) -data Match a - = Matches !a !a - | NotMatches !a !a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data Matches a = Matches { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) -instance Eq1 Match where liftEq = genericLiftEq -instance Ord1 Match where liftCompare = genericLiftCompare -instance Show1 Match where liftShowsPrec = genericLiftShowsPrec +instance Eq1 Matches where liftEq = genericLiftEq +instance Ord1 Matches where liftCompare = genericLiftCompare +instance Show1 Matches where liftShowsPrec = genericLiftShowsPrec +instance Evaluatable Matches --- TODO: Implement Eval instance for Match -instance Evaluatable Match +data NotMatches a = NotMatches { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) --- | Boolean operators. -data Boolean a - = Or !a !a - | And !a !a - | Not !a - | XOr !a !a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +instance Eq1 NotMatches where liftEq = genericLiftEq +instance Ord1 NotMatches where liftCompare = genericLiftCompare +instance Show1 NotMatches where liftShowsPrec = genericLiftShowsPrec +instance Evaluatable NotMatches -instance Eq1 Boolean where liftEq = genericLiftEq -instance Ord1 Boolean where liftCompare = genericLiftCompare -instance Show1 Boolean where liftShowsPrec = genericLiftShowsPrec +data Or a = Or { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) -instance Evaluatable Boolean where - -- N.B. we have to use Monad rather than Applicative/Traversable on 'And' and 'Or' so that we don't evaluate both operands +instance Eq1 Or where liftEq = genericLiftEq +instance Ord1 Or where liftCompare = genericLiftCompare +instance Show1 Or where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable Or where + eval t = rvalBox =<< go (fmap subtermValue t) where + go (Or a b) = do + cond <- a + ifthenelse cond (pure cond) b + +data And a = And { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 And where liftEq = genericLiftEq +instance Ord1 And where liftCompare = genericLiftCompare +instance Show1 And where liftShowsPrec = genericLiftShowsPrec +instance Evaluatable And where eval t = rvalBox =<< go (fmap subtermValue t) where go (And a b) = do cond <- a ifthenelse cond b (pure cond) - go (Or a b) = do - cond <- a - ifthenelse cond (pure cond) b + +newtype Not a = Not { term :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 Not where liftEq = genericLiftEq +instance Ord1 Not where liftCompare = genericLiftCompare +instance Show1 Not where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable Not where + eval t = rvalBox =<< go (fmap subtermValue t) where go (Not a) = a >>= fmap (boolean . not) . asBool + +data XOr a = XOr { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 XOr where liftEq = genericLiftEq +instance Ord1 XOr where liftCompare = genericLiftCompare +instance Show1 XOr where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable XOr where + -- N.B. we have to use Monad rather than Applicative/Traversable on 'And' and 'Or' so that we don't evaluate both operands + eval t = rvalBox =<< go (fmap subtermValue t) where go (XOr a b) = boolean <$> liftA2 (/=) (a >>= asBool) (b >>= asBool) -- | Javascript delete operator -newtype Delete a = Delete a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Delete a = Delete { value :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Delete where liftEq = genericLiftEq instance Ord1 Delete where liftCompare = genericLiftCompare @@ -125,8 +276,8 @@ instance Evaluatable Delete -- | A sequence expression such as Javascript or C's comma operator. -data SequenceExpression a = SequenceExpression { _firstExpression :: !a, _secondExpression :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data SequenceExpression a = SequenceExpression { firstExpression :: !a, secondExpression :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 SequenceExpression where liftEq = genericLiftEq instance Ord1 SequenceExpression where liftCompare = genericLiftCompare @@ -137,8 +288,8 @@ instance Evaluatable SequenceExpression -- | Javascript void operator -newtype Void a = Void a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Void a = Void { value :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Void where liftEq = genericLiftEq instance Ord1 Void where liftCompare = genericLiftCompare @@ -149,8 +300,8 @@ instance Evaluatable Void -- | Javascript typeof operator -newtype Typeof a = Typeof a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Typeof a = Typeof { value :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Typeof where liftEq = genericLiftEq instance Ord1 Typeof where liftCompare = genericLiftCompare @@ -159,39 +310,67 @@ instance Show1 Typeof where liftShowsPrec = genericLiftShowsPrec -- TODO: Implement Eval instance for Typeof instance Evaluatable Typeof - -- | Bitwise operators. -data Bitwise a - = BOr !a !a - | BAnd !a !a - | BXOr !a !a - | LShift !a !a - | RShift !a !a - | UnsignedRShift !a !a - | Complement a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data BOr a = BOr { left :: a, right :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) -instance Eq1 Bitwise where liftEq = genericLiftEq -instance Ord1 Bitwise where liftCompare = genericLiftCompare -instance Show1 Bitwise where liftShowsPrec = genericLiftShowsPrec +instance Eq1 BOr where liftEq = genericLiftEq +instance Ord1 BOr where liftCompare = genericLiftCompare +instance Show1 BOr where liftShowsPrec = genericLiftShowsPrec +instance Evaluatable BOr where -instance Evaluatable Bitwise where - eval t = rvalBox =<< (traverse subtermValue t >>= go) where - genLShift x y = shiftL x (fromIntegral y) - genRShift x y = shiftR x (fromIntegral y) - go x = case x of - (BOr a b) -> liftBitwise2 (.|.) a b - (BAnd a b) -> liftBitwise2 (.&.) a b - (BXOr a b) -> liftBitwise2 xor a b - (LShift a b) -> liftBitwise2 genLShift a b - (RShift a b) -> liftBitwise2 genRShift a b - (UnsignedRShift a b) -> liftBitwise2 genRShift a b - (Complement a) -> liftBitwise complement a +data BAnd a = BAnd { left :: a, right :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 BAnd where liftEq = genericLiftEq +instance Ord1 BAnd where liftCompare = genericLiftCompare +instance Show1 BAnd where liftShowsPrec = genericLiftShowsPrec +instance Evaluatable BAnd where + +data BXOr a = BXOr { left :: a, right :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 BXOr where liftEq = genericLiftEq +instance Ord1 BXOr where liftCompare = genericLiftCompare +instance Show1 BXOr where liftShowsPrec = genericLiftShowsPrec +instance Evaluatable BXOr where + +data LShift a = LShift { left :: a, right :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 LShift where liftEq = genericLiftEq +instance Ord1 LShift where liftCompare = genericLiftCompare +instance Show1 LShift where liftShowsPrec = genericLiftShowsPrec +instance Evaluatable LShift where + +data RShift a = RShift { left :: a, right :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 RShift where liftEq = genericLiftEq +instance Ord1 RShift where liftCompare = genericLiftCompare +instance Show1 RShift where liftShowsPrec = genericLiftShowsPrec +instance Evaluatable RShift where + +data UnsignedRShift a = UnsignedRShift { left :: a, right :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 UnsignedRShift where liftEq = genericLiftEq +instance Ord1 UnsignedRShift where liftCompare = genericLiftCompare +instance Show1 UnsignedRShift where liftShowsPrec = genericLiftShowsPrec +instance Evaluatable UnsignedRShift where + +newtype Complement a = Complement { value :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 Complement where liftEq = genericLiftEq +instance Ord1 Complement where liftCompare = genericLiftCompare +instance Show1 Complement where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable Complement where -- | Member Access (e.g. a.b) -data MemberAccess a - = MemberAccess !a !Name - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data MemberAccess a = MemberAccess { lhs :: a, rhs :: Name } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 MemberAccess where liftEq = genericLiftEq instance Ord1 MemberAccess where liftCompare = genericLiftCompare @@ -203,10 +382,8 @@ instance Evaluatable MemberAccess where pure $! LvalMember ptr propName -- | Subscript (e.g a[1]) -data Subscript a - = Subscript !a ![a] - | Member !a !a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data Subscript a = Subscript { lhs :: a, rhs :: [a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Subscript where liftEq = genericLiftEq instance Ord1 Subscript where liftCompare = genericLiftCompare @@ -217,12 +394,19 @@ instance Show1 Subscript where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Subscript where eval (Subscript l [r]) = Rval <$> join (index <$> subtermValue l <*> subtermValue r) eval (Subscript _ _) = rvalBox =<< throwResumable (Unspecialized "Eval unspecialized for subscript with slices") - eval (Member _ _) = rvalBox =<< throwResumable (Unspecialized "Eval unspecialized for member access") +data Member a = Member { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Eq1 Member where liftEq = genericLiftEq +instance Ord1 Member where liftCompare = genericLiftCompare +instance Show1 Member where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable Member where -- | Enumeration (e.g. a[1:10:1] in Python (start at index 1, stop at index 10, step 1 element from start to stop)) data Enumeration a = Enumeration { enumerationStart :: !a, enumerationEnd :: !a, enumerationStep :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Enumeration where liftEq = genericLiftEq instance Ord1 Enumeration where liftCompare = genericLiftCompare @@ -234,7 +418,7 @@ instance Evaluatable Enumeration -- | InstanceOf (e.g. a instanceof b in JavaScript data InstanceOf a = InstanceOf { instanceOfSubject :: !a, instanceOfObject :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 InstanceOf where liftEq = genericLiftEq instance Ord1 InstanceOf where liftCompare = genericLiftCompare @@ -245,20 +429,22 @@ instance Evaluatable InstanceOf -- | ScopeResolution (e.g. import a.b in Python or a::b in C++) -newtype ScopeResolution a = ScopeResolution [a] - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype ScopeResolution a = ScopeResolution { scopes :: NonEmpty a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) +instance Hashable1 ScopeResolution where liftHashWithSalt = foldl instance Eq1 ScopeResolution where liftEq = genericLiftEq instance Ord1 ScopeResolution where liftCompare = genericLiftCompare instance Show1 ScopeResolution where liftShowsPrec = genericLiftShowsPrec --- TODO: Implement Eval instance for ScopeResolution -instance Evaluatable ScopeResolution +instance Evaluatable ScopeResolution where + eval (ScopeResolution xs) = Rval <$> foldl1 f (fmap subtermAddress xs) + where f ns = evaluateInScopedEnv (ns >>= deref) -- | A non-null expression such as Typescript or Swift's ! expression. newtype NonNullExpression a = NonNullExpression { nonNullExpression :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 NonNullExpression where liftEq = genericLiftEq instance Ord1 NonNullExpression where liftCompare = genericLiftCompare @@ -270,7 +456,7 @@ instance Evaluatable NonNullExpression -- | An await expression in Javascript or C#. newtype Await a = Await { awaitSubject :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Await where liftEq = genericLiftEq instance Ord1 Await where liftCompare = genericLiftCompare @@ -282,7 +468,7 @@ instance Evaluatable Await -- | An object constructor call in Javascript, Java, etc. newtype New a = New { newSubject :: [a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 New where liftEq = genericLiftEq instance Ord1 New where liftCompare = genericLiftCompare @@ -293,7 +479,7 @@ instance Evaluatable New -- | A cast expression to a specified type. data Cast a = Cast { castSubject :: !a, castType :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Cast where liftEq = genericLiftEq instance Ord1 Cast where liftCompare = genericLiftCompare diff --git a/src/Data/Syntax/Literal.hs b/src/Data/Syntax/Literal.hs index da1e21ea7..386d8c9cb 100644 --- a/src/Data/Syntax/Literal.hs +++ b/src/Data/Syntax/Literal.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DataKinds, DeriveAnyClass, DeriveGeneric, MultiParamTypeClasses, ViewPatterns, ScopedTypeVariables #-} +{-# LANGUAGE DeriveAnyClass, ViewPatterns, ScopedTypeVariables, DuplicateRecordFields #-} module Data.Syntax.Literal where import Data.Abstract.Evaluatable @@ -34,7 +34,7 @@ instance Evaluatable Boolean where -- | A literal integer of unspecified width. No particular base is implied. newtype Integer a = Integer { integerContent :: Text } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Data.Syntax.Literal.Integer where liftEq = genericLiftEq instance Ord1 Data.Syntax.Literal.Integer where liftCompare = genericLiftCompare @@ -59,8 +59,8 @@ instance Evaluatable Data.Syntax.Literal.Float where rvalBox =<< (float <$> either (const (throwEvalError (FloatFormatError s))) pure (parseScientific s)) -- Rational literals e.g. `2/3r` -newtype Rational a = Rational Text - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Rational a = Rational { value :: Text } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Data.Syntax.Literal.Rational where liftEq = genericLiftEq instance Ord1 Data.Syntax.Literal.Rational where liftCompare = genericLiftCompare @@ -74,8 +74,8 @@ instance Evaluatable Data.Syntax.Literal.Rational where in rvalBox =<< (rational <$> maybe (throwEvalError (RationalFormatError r)) (pure . toRational) parsed) -- Complex literals e.g. `3 + 2i` -newtype Complex a = Complex Text - deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1, ToJSONFields1) +newtype Complex a = Complex { value :: Text } + deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1, ToJSONFields1, Named1, Message1) instance Eq1 Data.Syntax.Literal.Complex where liftEq = genericLiftEq instance Ord1 Data.Syntax.Literal.Complex where liftCompare = genericLiftCompare @@ -87,7 +87,7 @@ instance Evaluatable Complex -- Strings, symbols newtype String a = String { stringElements :: [a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Data.Syntax.Literal.String where liftEq = genericLiftEq instance Ord1 Data.Syntax.Literal.String where liftCompare = genericLiftCompare @@ -99,7 +99,7 @@ instance Show1 Data.Syntax.Literal.String where liftShowsPrec = genericLiftShows instance Evaluatable Data.Syntax.Literal.String newtype Character a = Character { characterContent :: Text } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Data.Syntax.Literal.Character where liftEq = genericLiftEq instance Ord1 Data.Syntax.Literal.Character where liftCompare = genericLiftCompare @@ -109,7 +109,7 @@ instance Evaluatable Data.Syntax.Literal.Character -- | An interpolation element within a string literal. newtype InterpolationElement a = InterpolationElement { interpolationBody :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 InterpolationElement where liftEq = genericLiftEq instance Ord1 InterpolationElement where liftCompare = genericLiftCompare @@ -139,7 +139,7 @@ instance Show1 Null where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Null where eval _ = rvalBox null newtype Symbol a = Symbol { symbolContent :: Text } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Symbol where liftEq = genericLiftEq instance Ord1 Symbol where liftCompare = genericLiftCompare @@ -149,7 +149,7 @@ instance Evaluatable Symbol where eval (Symbol s) = rvalBox (symbol s) newtype Regex a = Regex { regexContent :: Text } - deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1, ToJSONFields1) + deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1, ToJSONFields1, Named1, Message1) instance Eq1 Regex where liftEq = genericLiftEq instance Ord1 Regex where liftCompare = genericLiftCompare @@ -194,7 +194,7 @@ instance Evaluatable KeyValue where rvalBox =<< (kvPair <$> key <*> value) newtype Tuple a = Tuple { tupleContents :: [a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Tuple where liftEq = genericLiftEq instance Ord1 Tuple where liftCompare = genericLiftCompare @@ -204,7 +204,7 @@ instance Evaluatable Tuple where eval (Tuple cs) = rvalBox =<< tuple =<< traverse subtermAddress cs newtype Set a = Set { setElements :: [a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Set where liftEq = genericLiftEq instance Ord1 Set where liftCompare = genericLiftCompare @@ -218,7 +218,7 @@ instance Evaluatable Set -- | A declared pointer (e.g. var pointer *int in Go) newtype Pointer a = Pointer a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Pointer where liftEq = genericLiftEq instance Ord1 Pointer where liftCompare = genericLiftCompare @@ -230,7 +230,7 @@ instance Evaluatable Pointer -- | A reference to a pointer's address (e.g. &pointer in Go) newtype Reference a = Reference a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Reference where liftEq = genericLiftEq instance Ord1 Reference where liftCompare = genericLiftCompare diff --git a/src/Data/Syntax/Statement.hs b/src/Data/Syntax/Statement.hs index 6f9df5a16..ab4df4768 100644 --- a/src/Data/Syntax/Statement.hs +++ b/src/Data/Syntax/Statement.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DeriveAnyClass, MultiParamTypeClasses, ScopedTypeVariables, UndecidableInstances, ViewPatterns #-} +{-# LANGUAGE DeriveAnyClass, ScopedTypeVariables, UndecidableInstances, ViewPatterns, DuplicateRecordFields #-} module Data.Syntax.Statement where import Data.Abstract.Evaluatable @@ -9,14 +9,15 @@ import Data.Semigroup.Foldable import Diffing.Algorithm import Prelude import Prologue +import Proto3.Suite.Class -- | Imperative sequence of statements/declarations s.t.: -- -- 1. Each statement’s effects on the store are accumulated; -- 2. Each statement can affect the environment of later statements (e.g. by 'modify'-ing the environment); and -- 3. Only the last statement’s return value is returned. -newtype Statements a = Statements [a] - deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1, ToJSONFields1) +newtype Statements a = Statements { statements :: [a] } + deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1, ToJSONFields1, Named1, Message1) instance Eq1 Statements where liftEq = genericLiftEq instance Ord1 Statements where liftCompare = genericLiftCompare @@ -28,7 +29,7 @@ instance Evaluatable Statements where -- | Conditional. This must have an else block, which can be filled with some default value when omitted in the source, e.g. 'pure ()' for C-style if-without-else or 'pure Nothing' for Ruby-style, in both cases assuming some appropriate Applicative context into which the If will be lifted. data If a = If { ifCondition :: !a, ifThenBody :: !a, ifElseBody :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 If where liftEq = genericLiftEq instance Ord1 If where liftCompare = genericLiftCompare @@ -41,7 +42,7 @@ instance Evaluatable If where -- | Else statement. The else condition is any term, that upon successful completion, continues evaluation to the elseBody, e.g. `for ... else` in Python. data Else a = Else { elseCondition :: !a, elseBody :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Else where liftEq = genericLiftEq instance Ord1 Else where liftCompare = genericLiftCompare @@ -54,7 +55,7 @@ instance Evaluatable Else -- | Goto statement (e.g. `goto a` in Go). newtype Goto a = Goto { gotoLocation :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Goto where liftEq = genericLiftEq instance Ord1 Goto where liftCompare = genericLiftCompare @@ -66,7 +67,7 @@ instance Evaluatable Goto -- | A pattern-matching or computed jump control-flow statement, like 'switch' in C or JavaScript, or 'case' in Ruby or Haskell. data Match a = Match { matchSubject :: !a, matchPatterns :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Match where liftEq = genericLiftEq instance Ord1 Match where liftCompare = genericLiftCompare @@ -77,8 +78,8 @@ instance Evaluatable Match -- | A pattern in a pattern-matching or computed jump control-flow statement, like 'case' in C or JavaScript, 'when' in Ruby, or the left-hand side of '->' in the body of Haskell 'case' expressions. -data Pattern a = Pattern { _pattern :: !a, patternBody :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data Pattern a = Pattern { value :: !a, patternBody :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Pattern where liftEq = genericLiftEq instance Ord1 Pattern where liftCompare = genericLiftCompare @@ -90,7 +91,7 @@ instance Evaluatable Pattern -- | A let statement or local binding, like 'a as b' or 'let a = b'. data Let a = Let { letVariable :: !a, letValue :: !a, letBody :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Let where liftEq = genericLiftEq instance Ord1 Let where liftCompare = genericLiftCompare @@ -107,7 +108,7 @@ instance Evaluatable Let where -- | Assignment to a variable or other lvalue. data Assignment a = Assignment { assignmentContext :: ![a], assignmentTarget :: !a, assignmentValue :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Assignment where liftEq = genericLiftEq instance Ord1 Assignment where liftCompare = genericLiftCompare @@ -134,7 +135,7 @@ instance Evaluatable Assignment where -- | Post increment operator (e.g. 1++ in Go, or i++ in C). newtype PostIncrement a = PostIncrement a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 PostIncrement where liftEq = genericLiftEq instance Ord1 PostIncrement where liftCompare = genericLiftCompare @@ -146,7 +147,7 @@ instance Evaluatable PostIncrement -- | Post decrement operator (e.g. 1-- in Go, or i-- in C). newtype PostDecrement a = PostDecrement a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 PostDecrement where liftEq = genericLiftEq instance Ord1 PostDecrement where liftCompare = genericLiftCompare @@ -181,8 +182,8 @@ instance Evaluatable PreDecrement -- Returns -newtype Return a = Return a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Return a = Return { term :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Return where liftEq = genericLiftEq instance Ord1 Return where liftCompare = genericLiftCompare @@ -191,8 +192,8 @@ instance Show1 Return where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Return where eval (Return x) = Rval <$> (subtermAddress x >>= earlyReturn) -newtype Yield a = Yield a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Yield a = Yield { term :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Yield where liftEq = genericLiftEq instance Ord1 Yield where liftCompare = genericLiftCompare @@ -202,8 +203,8 @@ instance Show1 Yield where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Yield -newtype Break a = Break a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Break a = Break { term :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Break where liftEq = genericLiftEq instance Ord1 Break where liftCompare = genericLiftCompare @@ -212,8 +213,8 @@ instance Show1 Break where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Break where eval (Break x) = Rval <$> (subtermAddress x >>= throwBreak) -newtype Continue a = Continue a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Continue a = Continue { term :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Continue where liftEq = genericLiftEq instance Ord1 Continue where liftCompare = genericLiftCompare @@ -222,8 +223,8 @@ instance Show1 Continue where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Continue where eval (Continue x) = Rval <$> (subtermAddress x >>= throwContinue) -newtype Retry a = Retry a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Retry a = Retry { term :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Retry where liftEq = genericLiftEq instance Ord1 Retry where liftCompare = genericLiftCompare @@ -234,7 +235,7 @@ instance Evaluatable Retry newtype NoOp a = NoOp a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 NoOp where liftEq = genericLiftEq instance Ord1 NoOp where liftCompare = genericLiftCompare @@ -246,7 +247,7 @@ instance Evaluatable NoOp where -- Loops data For a = For { forBefore :: !a, forCondition :: !a, forStep :: !a, forBody :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 For where liftEq = genericLiftEq instance Ord1 For where liftCompare = genericLiftCompare @@ -257,7 +258,7 @@ instance Evaluatable For where data ForEach a = ForEach { forEachBinding :: !a, forEachSubject :: !a, forEachBody :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 ForEach where liftEq = genericLiftEq instance Ord1 ForEach where liftCompare = genericLiftCompare @@ -268,7 +269,7 @@ instance Evaluatable ForEach data While a = While { whileCondition :: !a, whileBody :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 While where liftEq = genericLiftEq instance Ord1 While where liftCompare = genericLiftCompare @@ -278,7 +279,7 @@ instance Evaluatable While where eval While{..} = rvalBox =<< while (subtermValue whileCondition) (subtermValue whileBody) data DoWhile a = DoWhile { doWhileCondition :: !a, doWhileBody :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 DoWhile where liftEq = genericLiftEq instance Ord1 DoWhile where liftCompare = genericLiftCompare @@ -289,8 +290,8 @@ instance Evaluatable DoWhile where -- Exception handling -newtype Throw a = Throw a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Throw a = Throw { value :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Throw where liftEq = genericLiftEq instance Ord1 Throw where liftCompare = genericLiftCompare @@ -301,7 +302,7 @@ instance Evaluatable Throw data Try a = Try { tryBody :: !a, tryCatch :: ![a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Try where liftEq = genericLiftEq instance Ord1 Try where liftCompare = genericLiftCompare @@ -312,7 +313,7 @@ instance Evaluatable Try data Catch a = Catch { catchException :: !a, catchBody :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Catch where liftEq = genericLiftEq instance Ord1 Catch where liftCompare = genericLiftCompare @@ -322,8 +323,8 @@ instance Show1 Catch where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Catch -newtype Finally a = Finally a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Finally a = Finally { term :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Finally where liftEq = genericLiftEq instance Ord1 Finally where liftCompare = genericLiftCompare @@ -336,8 +337,8 @@ instance Evaluatable Finally -- Scoping -- | ScopeEntry (e.g. `BEGIN {}` block in Ruby or Perl). -newtype ScopeEntry a = ScopeEntry [a] - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype ScopeEntry a = ScopeEntry { terms :: [a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 ScopeEntry where liftEq = genericLiftEq instance Ord1 ScopeEntry where liftCompare = genericLiftCompare @@ -348,8 +349,8 @@ instance Evaluatable ScopeEntry -- | ScopeExit (e.g. `END {}` block in Ruby or Perl). -newtype ScopeExit a = ScopeExit [a] - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype ScopeExit a = ScopeExit { terms :: [a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 ScopeExit where liftEq = genericLiftEq instance Ord1 ScopeExit where liftCompare = genericLiftCompare diff --git a/src/Data/Syntax/Type.hs b/src/Data/Syntax/Type.hs index f95c83d5f..fd1230229 100644 --- a/src/Data/Syntax/Type.hs +++ b/src/Data/Syntax/Type.hs @@ -4,11 +4,12 @@ module Data.Syntax.Type where import Data.Abstract.Evaluatable import Data.JSON.Fields import Diffing.Algorithm -import Prelude hiding (Int, Float, Bool) +import Prelude hiding (Bool, Float, Int, Double) import Prologue hiding (Map) +import Proto3.Suite.Class data Array a = Array { arraySize :: !(Maybe a), arrayElementType :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Array where liftEq = genericLiftEq instance Ord1 Array where liftCompare = genericLiftCompare @@ -20,7 +21,7 @@ instance Evaluatable Array -- TODO: What about type variables? re: FreeVariables1 data Annotation a = Annotation { annotationSubject :: !a, annotationType :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Annotation where liftEq = genericLiftEq instance Ord1 Annotation where liftCompare = genericLiftCompare @@ -32,7 +33,7 @@ instance Evaluatable Annotation where data Function a = Function { functionParameters :: ![a], functionReturn :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Function where liftEq = genericLiftEq instance Ord1 Function where liftCompare = genericLiftCompare @@ -43,7 +44,7 @@ instance Evaluatable Function newtype Interface a = Interface [a] - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Interface where liftEq = genericLiftEq instance Ord1 Interface where liftCompare = genericLiftCompare @@ -54,7 +55,7 @@ instance Evaluatable Interface data Map a = Map { mapKeyType :: !a, mapElementType :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Map where liftEq = genericLiftEq instance Ord1 Map where liftCompare = genericLiftCompare @@ -65,7 +66,7 @@ instance Evaluatable Map newtype Parenthesized a = Parenthesized a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Parenthesized where liftEq = genericLiftEq instance Ord1 Parenthesized where liftCompare = genericLiftCompare @@ -76,7 +77,7 @@ instance Evaluatable Parenthesized newtype Pointer a = Pointer a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Pointer where liftEq = genericLiftEq instance Ord1 Pointer where liftCompare = genericLiftCompare @@ -87,7 +88,7 @@ instance Evaluatable Pointer newtype Product a = Product [a] - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Product where liftEq = genericLiftEq instance Ord1 Product where liftCompare = genericLiftCompare @@ -98,7 +99,7 @@ instance Evaluatable Product data Readonly a = Readonly - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Readonly where liftEq = genericLiftEq instance Ord1 Readonly where liftCompare = genericLiftCompare @@ -108,8 +109,8 @@ instance Show1 Readonly where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Readonly -newtype Slice a = Slice a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Slice a = Slice { value :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Slice where liftEq = genericLiftEq instance Ord1 Slice where liftCompare = genericLiftCompare @@ -119,8 +120,8 @@ instance Show1 Slice where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Slice -newtype TypeParameters a = TypeParameters [a] - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype TypeParameters a = TypeParameters { terms :: [a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 TypeParameters where liftEq = genericLiftEq instance Ord1 TypeParameters where liftCompare = genericLiftCompare @@ -151,7 +152,7 @@ instance Show1 Int where liftShowsPrec = genericLiftShowsPrec -- TODO: Implement Eval instance for Int instance Evaluatable Int -data Float a = Float | Double +data Float a = Float deriving (Diffable, Eq, Foldable, Functor, Generic1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1, ToJSONFields1, Hashable1) instance Eq1 Float where liftEq = genericLiftEq @@ -161,6 +162,16 @@ instance Show1 Float where liftShowsPrec = genericLiftShowsPrec -- TODO: Implement Eval instance for Float instance Evaluatable Float +data Double a = Double + deriving (Diffable, Eq, Foldable, Functor, Generic1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1, ToJSONFields1, Hashable1) + +instance Eq1 Double where liftEq = genericLiftEq +instance Ord1 Double where liftCompare = genericLiftCompare +instance Show1 Double where liftShowsPrec = genericLiftShowsPrec + +-- TODO: Implement Eval instance for Double +instance Evaluatable Double + data Bool a = Bool deriving (Diffable, Eq, Foldable, Functor, Generic1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1, ToJSONFields1, Hashable1) diff --git a/src/Data/Term.hs b/src/Data/Term.hs index e4f7d2282..acbe2312e 100644 --- a/src/Data/Term.hs +++ b/src/Data/Term.hs @@ -17,6 +17,9 @@ import Data.JSON.Fields import Data.Record import Text.Show import Proto3.Suite.Class +import Proto3.Suite.DotProto +import qualified Proto3.Wire.Encode as Encode +import qualified Proto3.Wire.Decode as Decode -- | A Term with an abstract syntax tree and an annotation. newtype Term syntax ann = Term { unTerm :: TermF syntax ann (Term syntax ann) } @@ -79,13 +82,10 @@ instance Show1 f => Show1 (Term f) where instance (Show1 f, Show a) => Show (Term f a) where showsPrec = showsPrec1 -instance Message1 f => Message (Term f ()) where - encodeMessage num (Term (In _ f)) = liftEncodeMessage encodeMessage num f - decodeMessage num = termIn () <$> liftDecodeMessage decodeMessage num - dotProto _ = liftDotProto (Proxy @(f (Term f ()))) - -instance Named (Term f a) where - nameOf _ = "Term" +instance (Named1 f, Message1 f) => Message (Term f ()) where + encodeMessage num (Term (In _ f)) = Encode.embedded num (liftEncodeMessage encodeMessage 1 f) + decodeMessage num = termIn () . fromMaybe undefined <$> Decode.at (Decode.embedded (liftDecodeMessage decodeMessage 1)) num + dotProto (_ :: Proxy (Term f ())) = [ DotProtoMessageField (DotProtoField 1 (Prim . Named $ Single (nameOf1 (Proxy @f))) (Single "syntax") [] Nothing) ] instance Ord1 f => Ord1 (Term f) where liftCompare comp = go where go t1 t2 = liftCompare2 comp go (unTerm t1) (unTerm t2) diff --git a/src/Language/Go/Assignment.hs b/src/Language/Go/Assignment.hs index a42ff0efd..d3ec4ab3a 100644 --- a/src/Language/Go/Assignment.hs +++ b/src/Language/Go/Assignment.hs @@ -33,9 +33,38 @@ type Syntax = , Declaration.MethodSignature , Declaration.Type , Declaration.TypeAlias - , Expression.Arithmetic - , Expression.Bitwise - , Expression.Boolean + , Expression.Plus + , Expression.Minus + , Expression.Times + , Expression.DividedBy + , Expression.Modulo + , Expression.Power + , Expression.Negate + , Expression.FloorDivision + , Expression.BOr + , Expression.BAnd + , Expression.BXOr + , Expression.LShift + , Expression.RShift + , Expression.UnsignedRShift + , Expression.Complement + , Expression.Call + , Expression.LessThan + , Expression.LessThanEqual + , Expression.GreaterThan + , Expression.GreaterThanEqual + , Expression.Equal + , Expression.StrictEqual + , Expression.Comparison + , Expression.Subscript + , Expression.Member + , Statement.PostDecrement + , Statement.PostIncrement + , Expression.MemberAccess + , Expression.And + , Expression.Not + , Expression.Or + , Expression.XOr , Expression.Call , Expression.Comparison , Expression.Subscript diff --git a/src/Language/Go/Syntax.hs b/src/Language/Go/Syntax.hs index 1f7cb5dac..603f6a735 100644 --- a/src/Language/Go/Syntax.hs +++ b/src/Language/Go/Syntax.hs @@ -66,7 +66,7 @@ instance Evaluatable Import where paths <- resolveGoImport importPath for_ paths $ \path -> do traceResolve (unPath importPath) path - importedEnv <- snd <$> require path + importedEnv <- fst <$> require path bindAll importedEnv rvalBox unit @@ -88,7 +88,7 @@ instance Evaluatable QualifiedImport where void . letrec' alias $ \addr -> do for_ paths $ \p -> do traceResolve (unPath importPath) p - importedEnv <- snd <$> require p + importedEnv <- fst <$> require p bindAll importedEnv makeNamespace alias addr Nothing rvalBox unit diff --git a/src/Language/Haskell/Assignment.hs b/src/Language/Haskell/Assignment.hs index 40a5d4523..3153b30f3 100644 --- a/src/Language/Haskell/Assignment.hs +++ b/src/Language/Haskell/Assignment.hs @@ -632,7 +632,7 @@ module' = makeTerm <*> moduleExports <*> term (where' <|> expressions <|> emptyTerm)) where - moduleExports = (symbol ModuleExports *> children (manyTerm export)) + moduleExports = symbol ModuleExports *> children (manyTerm export) <|> pure [] moduleExport :: Assignment Term diff --git a/src/Language/JSON/Assignment.hs b/src/Language/JSON/Assignment.hs index fa7e3b232..e0f29764a 100644 --- a/src/Language/JSON/Assignment.hs +++ b/src/Language/JSON/Assignment.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} -- FIXME module Language.JSON.Assignment ( assignment , Syntax @@ -6,56 +6,66 @@ module Language.JSON.Assignment , Term) where -import Assigning.Assignment hiding (Assignment, Error) -import qualified Assigning.Assignment as Assignment +import Assigning.Assignment.Deterministic hiding (Assignment) +import qualified Assigning.Assignment.Deterministic as Deterministic +import Data.AST import Data.Record import Data.Sum -import Data.Syntax (makeTerm, parseError) import qualified Data.Syntax as Syntax import qualified Data.Syntax.Literal as Literal import qualified Data.Term as Term import Language.JSON.Grammar as Grammar +import Proto3.Suite (Named1(..), Named(..)) +import Prologue +import Text.Parser.Combinators type Syntax = - [ Literal.Array + [ Literal.Null + , Literal.Array , Literal.Boolean , Literal.Hash , Literal.Float , Literal.KeyValue - , Literal.Null , Literal.TextElement , Syntax.Error ] type Term = Term.Term (Sum Syntax) (Record Location) -type Assignment = Assignment.Assignment [] Grammar +type Assignment = Deterministic.Assignment Grammar + +instance Named1 (Sum Syntax) where + nameOf1 _ = "JSONSyntax" + +instance Named (Term.Term (Sum Syntax) ()) where + nameOf _ = "JSONTerm" assignment :: Assignment Term -assignment = Syntax.handleError (value <|> parseError) +assignment = value <|> parseError value :: Assignment Term -value = symbol Value *> children (object <|> array) +value = branchNode Value (object <|> array <|> parseError) jsonValue :: Assignment Term -jsonValue = object <|> array <|> number <|> string <|> boolean <|> none +jsonValue = object <|> array <|> number <|> string <|> boolean <|> none <|> parseError object :: Assignment Term -object = makeTerm <$> symbol Object <*> children (Literal.Hash <$> many pairs) - where pairs = makeTerm <$> symbol Pair <*> children (Literal.KeyValue <$> (number <|> string) <*> jsonValue) +object = toTerm (branchNode Object (Literal.Hash <$ leafNode AnonLBrace <*> sepBy pairs (leafNode AnonComma) <* leafNode AnonRBrace)) + where pairs = toTerm (branchNode Pair (Literal.KeyValue <$> (number <|> string <|> parseError) <* leafNode AnonColon <*> jsonValue)) <|> parseError array :: Assignment Term -array = makeTerm <$> symbol Array <*> children (Literal.Array <$> many jsonValue) +array = toTerm (branchNode Array (Literal.Array <$ leafNode AnonLBracket <*> sepBy jsonValue (leafNode AnonComma) <* leafNode AnonRBracket)) number :: Assignment Term -number = makeTerm <$> symbol Number <*> (Literal.Float <$> source) +number = toTerm (Literal.Float <$> leafNode Number) string :: Assignment Term -string = makeTerm <$> symbol String <*> (Literal.TextElement <$> source) +string = toTerm (Literal.TextElement <$> leafNode String) boolean :: Assignment Term -boolean = makeTerm <$> symbol Grammar.True <*> (Literal.true <$ rawSource) - <|> makeTerm <$> symbol Grammar.False <*> (Literal.false <$ rawSource) +boolean = toTerm + ( leafNode Grammar.True $> Literal.true + <|> leafNode Grammar.False $> Literal.false) none :: Assignment Term -none = makeTerm <$> symbol Null <*> (Literal.Null <$ rawSource) +none = toTerm (leafNode Null $> Literal.Null) diff --git a/src/Language/Java/Assignment.hs b/src/Language/Java/Assignment.hs index cc6ede6ab..1556addae 100644 --- a/src/Language/Java/Assignment.hs +++ b/src/Language/Java/Assignment.hs @@ -33,14 +33,37 @@ type Syntax = , Declaration.InterfaceDeclaration , Declaration.Method , Declaration.VariableDeclaration - , Expression.Arithmetic + , Expression.Plus + , Expression.Minus + , Expression.Times + , Expression.DividedBy + , Expression.Modulo + , Expression.Power + , Expression.Negate + , Expression.FloorDivision , Expression.Call + , Expression.LessThan + , Expression.LessThanEqual + , Expression.GreaterThan + , Expression.GreaterThanEqual + , Expression.Equal + , Expression.StrictEqual , Expression.Comparison - , Expression.Bitwise - , Expression.Boolean + , Expression.BOr + , Expression.BXOr + , Expression.BAnd + , Expression.LShift + , Expression.RShift + , Expression.UnsignedRShift + , Expression.Complement + , Expression.And + , Expression.Not + , Expression.Or + , Expression.XOr , Expression.InstanceOf , Expression.MemberAccess , Expression.Subscript + , Expression.Member , Expression.Super , Expression.This , Java.Syntax.Annotation diff --git a/src/Language/PHP/Assignment.hs b/src/Language/PHP/Assignment.hs index e629ff1e6..1a90337db 100644 --- a/src/Language/PHP/Assignment.hs +++ b/src/Language/PHP/Assignment.hs @@ -41,17 +41,38 @@ type Syntax = '[ , Declaration.Function , Declaration.Method , Declaration.VariableDeclaration - , Expression.Arithmetic - , Expression.Bitwise - , Expression.Boolean + , Expression.Plus + , Expression.Minus + , Expression.Times + , Expression.DividedBy + , Expression.Modulo + , Expression.Power + , Expression.Negate + , Expression.FloorDivision + , Expression.BAnd + , Expression.BOr + , Expression.BXOr + , Expression.LShift + , Expression.RShift + , Expression.And + , Expression.Not + , Expression.Or + , Expression.XOr , Expression.Call , Expression.Cast + , Expression.LessThan + , Expression.LessThanEqual + , Expression.GreaterThan + , Expression.GreaterThanEqual + , Expression.Equal + , Expression.StrictEqual , Expression.Comparison , Expression.InstanceOf , Expression.MemberAccess , Expression.New , Expression.SequenceExpression , Expression.Subscript + , Expression.Member , Literal.Array , Literal.Float , Literal.Integer diff --git a/src/Language/PHP/Syntax.hs b/src/Language/PHP/Syntax.hs index 6d65ec2c0..4f7205451 100644 --- a/src/Language/PHP/Syntax.hs +++ b/src/Language/PHP/Syntax.hs @@ -55,13 +55,13 @@ include :: ( AbstractValue address value effects , Member Trace effects ) => Subterm term (Evaluator address value effects (ValueRef address)) - -> (ModulePath -> Evaluator address value effects (address, Environment address)) + -> (ModulePath -> Evaluator address value effects (Environment address, address)) -> Evaluator address value effects (ValueRef address) include pathTerm f = do name <- subtermValue pathTerm >>= asString path <- resolvePHPName name traceResolve name path - (v, importedEnv) <- f path + (importedEnv, v) <- f path bindAll importedEnv pure (Rval v) diff --git a/src/Language/Python/Assignment.hs b/src/Language/Python/Assignment.hs index bf0ea64a0..efeeb0f1a 100644 --- a/src/Language/Python/Assignment.hs +++ b/src/Language/Python/Assignment.hs @@ -46,15 +46,37 @@ type Syntax = , Declaration.Decorator , Declaration.Function , Declaration.Variable - , Expression.Arithmetic - , Expression.Boolean - , Expression.Bitwise + , Expression.Plus + , Expression.Minus + , Expression.Times + , Expression.DividedBy + , Expression.Modulo + , Expression.Power + , Expression.Negate + , Expression.FloorDivision + , Expression.And + , Expression.Not + , Expression.Or + , Expression.XOr + , Expression.BAnd + , Expression.BOr + , Expression.BXOr + , Expression.LShift + , Expression.RShift + , Expression.Complement , Expression.Call + , Expression.LessThan + , Expression.LessThanEqual + , Expression.GreaterThan + , Expression.GreaterThanEqual + , Expression.Equal + , Expression.StrictEqual , Expression.Comparison , Expression.Enumeration , Expression.ScopeResolution , Expression.MemberAccess , Expression.Subscript + , Expression.Member , Literal.Array , Literal.Boolean , Literal.Float diff --git a/src/Language/Python/Syntax.hs b/src/Language/Python/Syntax.hs index c79eb1dcb..e2ed33d99 100644 --- a/src/Language/Python/Syntax.hs +++ b/src/Language/Python/Syntax.hs @@ -113,7 +113,7 @@ instance Evaluatable Import where -- Last module path is the one we want to import let path = NonEmpty.last modulePaths - importedEnv <- snd <$> require path + importedEnv <- fst <$> require path bindAll (select importedEnv) rvalBox unit where @@ -130,7 +130,7 @@ evalQualifiedImport :: ( AbstractValue address value effects ) => Name -> ModulePath -> Evaluator address value effects value evalQualifiedImport name path = letrec' name $ \addr -> do - importedEnv <- snd <$> require path + importedEnv <- fst <$> require path bindAll importedEnv unit <$ makeNamespace name addr Nothing @@ -174,7 +174,7 @@ instance Evaluatable QualifiedAliasedImport where alias <- either (throwEvalError . FreeVariablesError) pure (freeVariable $ subterm aliasTerm) rvalBox =<< letrec' alias (\addr -> do let path = NonEmpty.last modulePaths - importedEnv <- snd <$> require path + importedEnv <- fst <$> require path bindAll importedEnv unit <$ makeNamespace alias addr Nothing) diff --git a/src/Language/Ruby/Assignment.hs b/src/Language/Ruby/Assignment.hs index ea0eba20b..1b062b7b4 100644 --- a/src/Language/Ruby/Assignment.hs +++ b/src/Language/Ruby/Assignment.hs @@ -1,4 +1,5 @@ {-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} -- FIXME module Language.Ruby.Assignment ( assignment , Syntax @@ -6,11 +7,14 @@ module Language.Ruby.Assignment , Term ) where -import Assigning.Assignment hiding (Assignment, Error) -import Data.Abstract.Name (name) -import Data.List (elem) -import Data.Record -import Data.Syntax +import Assigning.Assignment hiding (Assignment, Error) +import qualified Assigning.Assignment as Assignment +import Data.Abstract.Name (name) +import Data.List (elem) +import qualified Data.List.NonEmpty as NonEmpty +import Data.Record +import Data.Sum +import Data.Syntax ( contextualize , emptyTerm , handleError @@ -22,9 +26,6 @@ import Data.Syntax , parseError , postContextualize ) -import Language.Ruby.Grammar as Grammar -import qualified Assigning.Assignment as Assignment -import Data.Sum import qualified Data.Syntax as Syntax import qualified Data.Syntax.Comment as Comment import qualified Data.Syntax.Declaration as Declaration @@ -33,28 +34,53 @@ import qualified Data.Syntax.Expression as Expression import qualified Data.Syntax.Literal as Literal import qualified Data.Syntax.Statement as Statement import qualified Data.Term as Term +import Language.Ruby.Grammar as Grammar import qualified Language.Ruby.Syntax as Ruby.Syntax -import Prologue hiding (for) +import Prologue hiding (for) +import Proto3.Suite (Named (..), Named1 (..)) -- | The type of Ruby syntax. type Syntax = '[ Comment.Comment , Declaration.Function + , Literal.Boolean , Declaration.Method , Directive.File , Directive.Line - , Expression.Arithmetic - , Expression.Bitwise - , Expression.Boolean + , Expression.Plus + , Expression.Minus + , Expression.Times + , Expression.DividedBy + , Expression.Modulo + , Expression.Power + , Expression.Negate + , Expression.FloorDivision + , Expression.BAnd + , Expression.BOr + , Expression.BXOr + , Expression.LShift + , Expression.RShift + , Expression.Complement + , Expression.And + , Expression.Not + , Expression.Or + , Expression.XOr , Expression.Call + , Expression.LessThan + , Expression.LessThanEqual + , Expression.GreaterThan + , Expression.GreaterThanEqual + , Expression.Equal + , Expression.StrictEqual , Expression.Comparison , Expression.Enumeration - , Expression.Match + , Expression.Matches + , Expression.NotMatches , Expression.MemberAccess , Expression.ScopeResolution , Expression.Subscript + , Expression.Member , Literal.Array - , Literal.Boolean , Literal.Complex , Literal.Float , Literal.Hash @@ -90,7 +116,8 @@ type Syntax = '[ , Syntax.Identifier , Ruby.Syntax.Class , Ruby.Syntax.Load - , Ruby.Syntax.LowPrecedenceBoolean + , Ruby.Syntax.LowPrecedenceAnd + , Ruby.Syntax.LowPrecedenceOr , Ruby.Syntax.Module , Ruby.Syntax.Require , Ruby.Syntax.Send @@ -100,6 +127,12 @@ type Syntax = '[ type Term = Term.Term (Sum Syntax) (Record Location) type Assignment = Assignment.Assignment [] Grammar +instance Named1 (Sum Syntax) where + nameOf1 _ = "RubySyntax" + +instance Named (Term.Term (Sum Syntax) ()) where + nameOf _ = "RubyTerm" + -- | Assignment from AST in Ruby’s grammar onto a program in Ruby’s syntax. assignment :: Assignment Term assignment = handleError $ makeTerm <$> symbol Program <*> children (Statement.Statements <$> many expression) <|> parseError @@ -243,7 +276,7 @@ module' :: Assignment Term module' = makeTerm <$> symbol Module <*> (withNewScope . children) (Ruby.Syntax.Module <$> expression <*> many expression) scopeResolution :: Assignment Term -scopeResolution = makeTerm <$> symbol ScopeResolution <*> children (Expression.ScopeResolution <$> many expression) +scopeResolution = makeTerm <$> symbol ScopeResolution <*> children (Expression.ScopeResolution <$> NonEmpty.some1 expression) parameter :: Assignment Term parameter = postContextualize comment (term uncontextualizedParameter) @@ -451,19 +484,19 @@ unary = symbol Unary >>= \ location -> -- TODO: Distinguish `===` from `==` ? binary :: Assignment Term binary = makeTerm' <$> symbol Binary <*> children (infixTerm expression expression - [ (inject .) . Expression.Plus <$ symbol AnonPlus - , (inject .) . Expression.Minus <$ symbol AnonMinus' - , (inject .) . Expression.Times <$ symbol AnonStar' - , (inject .) . Expression.Power <$ symbol AnonStarStar - , (inject .) . Expression.DividedBy <$ symbol AnonSlash - , (inject .) . Expression.Modulo <$ symbol AnonPercent - , (inject .) . Expression.And <$ symbol AnonAmpersandAmpersand - , (inject .) . Ruby.Syntax.LowAnd <$ symbol AnonAnd - , (inject .) . Expression.BAnd <$ symbol AnonAmpersand - , (inject .) . Expression.Or <$ symbol AnonPipePipe - , (inject .) . Ruby.Syntax.LowOr <$ symbol AnonOr - , (inject .) . Expression.BOr <$ symbol AnonPipe - , (inject .) . Expression.BXOr <$ symbol AnonCaret + [ (inject .) . Expression.Plus <$ symbol AnonPlus + , (inject .) . Expression.Minus <$ symbol AnonMinus' + , (inject .) . Expression.Times <$ symbol AnonStar' + , (inject .) . Expression.Power <$ symbol AnonStarStar + , (inject .) . Expression.DividedBy <$ symbol AnonSlash + , (inject .) . Expression.Modulo <$ symbol AnonPercent + , (inject .) . Expression.And <$ symbol AnonAmpersandAmpersand + , (inject .) . Ruby.Syntax.LowPrecedenceAnd <$ symbol AnonAnd + , (inject .) . Expression.BAnd <$ symbol AnonAmpersand + , (inject .) . Expression.Or <$ symbol AnonPipePipe + , (inject .) . Ruby.Syntax.LowPrecedenceOr <$ symbol AnonOr + , (inject .) . Expression.BOr <$ symbol AnonPipe + , (inject .) . Expression.BXOr <$ symbol AnonCaret -- TODO: AnonEqualEqualEqual corresponds to Ruby's "case equality" -- function, which (unless overridden) is true if b is an instance -- of or inherits from a. We need a custom equality operator diff --git a/src/Language/Ruby/Syntax.hs b/src/Language/Ruby/Syntax.hs index ab894e430..8afd9276c 100644 --- a/src/Language/Ruby/Syntax.hs +++ b/src/Language/Ruby/Syntax.hs @@ -1,15 +1,16 @@ -{-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE DeriveAnyClass, DuplicateRecordFields #-} module Language.Ruby.Syntax where import Control.Monad (unless) import Data.Abstract.Evaluatable import qualified Data.Abstract.Module as M import Data.Abstract.Path -import qualified Data.Text as T import Data.JSON.Fields import qualified Data.Language as Language +import qualified Data.Text as T import Diffing.Algorithm import Prologue +import Proto3.Suite.Class import System.FilePath.Posix @@ -42,7 +43,7 @@ cleanNameOrPath :: Text -> String cleanNameOrPath = T.unpack . dropRelativePrefix . stripQuotes data Send a = Send { sendReceiver :: Maybe a, sendSelector :: Maybe a, sendArgs :: [a], sendBlock :: Maybe a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Send where liftEq = genericLiftEq instance Ord1 Send where liftCompare = genericLiftCompare @@ -57,7 +58,7 @@ instance Evaluatable Send where Rval <$> call func (map subtermAddress sendArgs) -- TODO pass through sendBlock data Require a = Require { requireRelative :: Bool, requirePath :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Require where liftEq = genericLiftEq instance Ord1 Require where liftCompare = genericLiftCompare @@ -68,7 +69,7 @@ instance Evaluatable Require where name <- subtermValue x >>= asString path <- resolveRubyName name traceResolve name path - (v, importedEnv) <- doRequire path + (importedEnv, v) <- doRequire path bindAll importedEnv rvalBox v -- Returns True if the file was loaded, False if it was already loaded. http://ruby-doc.org/core-2.5.0/Kernel.html#method-i-require @@ -76,16 +77,16 @@ doRequire :: ( AbstractValue address value effects , Member (Modules address) effects ) => M.ModulePath - -> Evaluator address value effects (value, Environment address) + -> Evaluator address value effects (Environment address, value) doRequire path = do result <- lookupModule path case result of - Nothing -> (,) (boolean True) . snd <$> load path - Just (_, env) -> pure (boolean False, env) + Nothing -> flip (,) (boolean True) . fst <$> load path + Just (env, _) -> pure (env, boolean False) data Load a = Load { loadPath :: a, loadWrap :: Maybe a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Load where liftEq = genericLiftEq instance Ord1 Load where liftCompare = genericLiftCompare @@ -112,14 +113,14 @@ doLoad :: ( AbstractValue address value effects doLoad path shouldWrap = do path' <- resolveRubyPath path traceResolve path path' - importedEnv <- snd <$> load path' + importedEnv <- fst <$> load path' unless shouldWrap $ bindAll importedEnv pure (boolean Prelude.True) -- load always returns true. http://ruby-doc.org/core-2.5.0/Kernel.html#method-i-load -- TODO: autoload data Class a = Class { classIdentifier :: !a, classSuperClass :: !(Maybe a), classBody :: !a } - deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Mergeable, FreeVariables1, Declarations1, ToJSONFields1) + deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Mergeable, FreeVariables1, Declarations1, ToJSONFields1, Named1, Message1) instance Diffable Class where equivalentBySubterm = Just . classIdentifier @@ -136,7 +137,7 @@ instance Evaluatable Class where subtermValue classBody <* makeNamespace name addr super) data Module a = Module { moduleIdentifier :: !a, moduleStatements :: ![a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Module where liftEq = genericLiftEq instance Ord1 Module where liftCompare = genericLiftCompare @@ -148,21 +149,30 @@ instance Evaluatable Module where rvalBox =<< letrec' name (\addr -> value =<< (eval xs <* makeNamespace name addr Nothing)) -data LowPrecedenceBoolean a - = LowAnd !a !a - | LowOr !a !a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data LowPrecedenceAnd a = LowPrecedenceAnd { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) -instance Evaluatable LowPrecedenceBoolean where +instance Evaluatable LowPrecedenceAnd where -- N.B. we have to use Monad rather than Applicative/Traversable on 'And' and 'Or' so that we don't evaluate both operands eval t = rvalBox =<< go (fmap subtermValue t) where - go (LowAnd a b) = do + go (LowPrecedenceAnd a b) = do cond <- a ifthenelse cond b (pure cond) - go (LowOr a b) = do + +instance Eq1 LowPrecedenceAnd where liftEq = genericLiftEq +instance Ord1 LowPrecedenceAnd where liftCompare = genericLiftCompare +instance Show1 LowPrecedenceAnd where liftShowsPrec = genericLiftShowsPrec + +data LowPrecedenceOr a = LowPrecedenceOr { lhs :: a, rhs :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) + +instance Evaluatable LowPrecedenceOr where + -- N.B. we have to use Monad rather than Applicative/Traversable on 'And' and 'Or' so that we don't evaluate both operands + eval t = rvalBox =<< go (fmap subtermValue t) where + go (LowPrecedenceOr a b) = do cond <- a ifthenelse cond (pure cond) b -instance Eq1 LowPrecedenceBoolean where liftEq = genericLiftEq -instance Ord1 LowPrecedenceBoolean where liftCompare = genericLiftCompare -instance Show1 LowPrecedenceBoolean where liftShowsPrec = genericLiftShowsPrec +instance Eq1 LowPrecedenceOr where liftEq = genericLiftEq +instance Ord1 LowPrecedenceOr where liftCompare = genericLiftCompare +instance Show1 LowPrecedenceOr where liftShowsPrec = genericLiftShowsPrec diff --git a/src/Language/TypeScript/Assignment.hs b/src/Language/TypeScript/Assignment.hs index 55967f50e..987401f1a 100644 --- a/src/Language/TypeScript/Assignment.hs +++ b/src/Language/TypeScript/Assignment.hs @@ -1,4 +1,5 @@ {-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} -- FIXME module Language.TypeScript.Assignment ( assignment , Syntax @@ -34,6 +35,7 @@ import qualified Data.Term as Term import Language.TypeScript.Grammar as Grammar import qualified Language.TypeScript.Syntax as TypeScript.Syntax import Prologue +import Proto3.Suite (Named1(..), Named(..)) -- | The type of TypeScript syntax. type Syntax = '[ @@ -47,11 +49,33 @@ type Syntax = '[ , Declaration.PublicFieldDefinition , Declaration.VariableDeclaration , Declaration.TypeAlias - , Expression.Arithmetic - , Expression.Bitwise - , Expression.Boolean + , Expression.Plus + , Expression.Minus + , Expression.Times + , Expression.DividedBy + , Expression.Modulo + , Expression.Power + , Expression.Negate + , Expression.FloorDivision + , Expression.BAnd + , Expression.BOr + , Expression.BXOr + , Expression.LShift + , Expression.RShift + , Expression.UnsignedRShift + , Expression.Complement + , Expression.And + , Expression.Not + , Expression.Or + , Expression.XOr , Expression.Call , Expression.Cast + , Expression.LessThan + , Expression.LessThanEqual + , Expression.GreaterThan + , Expression.GreaterThanEqual + , Expression.Equal + , Expression.StrictEqual , Expression.Comparison , Expression.Enumeration , Expression.MemberAccess @@ -59,6 +83,7 @@ type Syntax = '[ , Expression.ScopeResolution , Expression.SequenceExpression , Expression.Subscript + , Expression.Member , Expression.Delete , Expression.Void , Expression.Typeof @@ -142,7 +167,6 @@ type Syntax = '[ , TypeScript.Syntax.Undefined , TypeScript.Syntax.ClassHeritage , TypeScript.Syntax.AbstractClass - , TypeScript.Syntax.ExtendsClause , TypeScript.Syntax.ImplementsClause , TypeScript.Syntax.JsxElement , TypeScript.Syntax.JsxSelfClosingElement @@ -184,6 +208,12 @@ type Syntax = '[ type Term = Term.Term (Sum Syntax) (Record Location) type Assignment = Assignment.Assignment [] Grammar +instance Named1 (Sum Syntax) where + nameOf1 _ = "TypeScriptSyntax" + +instance Named (Term.Term (Sum Syntax) ()) where + nameOf _ = "TypeScriptTerm" + -- | Assignment from AST in TypeScript’s grammar onto a program in TypeScript’s syntax. assignment :: Assignment Term assignment = handleError $ makeTerm <$> symbol Program <*> children (Statement.Statements <$> manyTerm statement) <|> parseError @@ -671,7 +701,7 @@ importStatement = makeImportTerm <$> symbol Grammar.ImportStatement <*> childr <|> (pure <$> defaultImport)) makeImportTerm1 loc from (Just alias, _) = makeTerm loc (TypeScript.Syntax.QualifiedAliasedImport alias from) - makeImportTerm1 loc from (Nothing, symbols) = makeTerm loc (TypeScript.Syntax.Import symbols from) + makeImportTerm1 loc from (Nothing, symbols) = makeTerm loc (TypeScript.Syntax.Import (uncurry TypeScript.Syntax.Alias <$> symbols) from) makeImportTerm loc ([x], from) = makeImportTerm1 loc from x makeImportTerm loc (xs, from) = makeTerm loc $ fmap (makeImportTerm1 loc from) xs importSymbol = symbol Grammar.ImportSpecifier *> children (makeNameAliasPair <$> rawIdentifier <*> ((Just <$> rawIdentifier) <|> pure Nothing)) @@ -732,8 +762,8 @@ exportStatement = makeTerm <$> symbol Grammar.ExportStatement <*> children (flip exportClause = symbol Grammar.ExportClause *> children (many exportSymbol) exportSymbol = symbol Grammar.ExportSpecifier *> children (makeNameAliasPair <$> rawIdentifier <*> (Just <$> rawIdentifier)) <|> symbol Grammar.ExportSpecifier *> children (makeNameAliasPair <$> rawIdentifier <*> pure Nothing) - makeNameAliasPair from (Just alias) = (from, alias) - makeNameAliasPair from Nothing = (from, from) + makeNameAliasPair from (Just alias) = TypeScript.Syntax.Alias from alias + makeNameAliasPair from Nothing = TypeScript.Syntax.Alias from from rawIdentifier = (symbol Identifier <|> symbol Identifier') *> (name <$> source) -- TODO: Need to validate that inline comments are still handled with this change in assigning to Path and not a Term. fromClause = symbol Grammar.String *> (TypeScript.Syntax.importPath <$> source) diff --git a/src/Language/TypeScript/Syntax.hs b/src/Language/TypeScript/Syntax.hs index 9dfdd4336..21fbf0227 100644 --- a/src/Language/TypeScript/Syntax.hs +++ b/src/Language/TypeScript/Syntax.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE DeriveAnyClass, DuplicateRecordFields #-} module Language.TypeScript.Syntax where import qualified Data.Abstract.Environment as Env @@ -14,12 +14,31 @@ import qualified Data.Text as T import Diffing.Algorithm import Prologue import System.FilePath.Posix +import Proto3.Suite +import qualified Proto3.Wire.Encode as Encode +import qualified Proto3.Wire.Decode as Decode -data Relative = Relative | NonRelative - deriving (Eq, Generic, Hashable, Ord, Show, ToJSON) +data IsRelative = Unknown | Relative | NonRelative + deriving (Bounded, Enum, Finite, MessageField, Named, Eq, Generic, Hashable, Ord, Show, ToJSON) -data ImportPath = ImportPath { unPath :: FilePath, pathIsRelative :: Relative } - deriving (Eq, Generic, Hashable, Ord, Show, ToJSON) +instance Primitive IsRelative where + encodePrimitive = Encode.enum + decodePrimitive = either (const def) id <$> Decode.enum + primType _ = Named (Single (nameOf (Proxy @IsRelative))) + +instance HasDefault IsRelative where + def = Unknown + +data ImportPath = ImportPath { unPath :: FilePath, pathIsRelative :: IsRelative } + deriving (Eq, Generic, Hashable, Message, Named, Ord, Show, ToJSON) + +instance MessageField ImportPath where + encodeMessageField num = Encode.embedded num . encodeMessage (fieldNumber 1) + decodeMessageField = fromMaybe def <$> Decode.embedded (decodeMessage (fieldNumber 1)) + protoType _ = messageField (Prim $ Named (Single (nameOf (Proxy @ImportPath)))) Nothing + +instance HasDefault ImportPath where + def = ImportPath mempty Relative -- TODO: fix the duplication present in this and Python importPath :: Text -> ImportPath @@ -44,8 +63,8 @@ resolveWithNodejsStrategy :: ( Member (Modules address) effects => ImportPath -> [String] -> Evaluator address value effects M.ModulePath -resolveWithNodejsStrategy (ImportPath path Relative) exts = resolveRelativePath path exts resolveWithNodejsStrategy (ImportPath path NonRelative) exts = resolveNonRelativePath path exts +resolveWithNodejsStrategy (ImportPath path _) exts = resolveRelativePath path exts -- | Resolve a relative TypeScript import to a known 'ModuleName' or fail. -- @@ -139,12 +158,12 @@ evalRequire :: ( AbstractValue address value effects -> Name -> Evaluator address value effects value evalRequire modulePath alias = letrec' alias $ \addr -> do - importedEnv <- snd <$> require modulePath + importedEnv <- fst <$> require modulePath bindAll importedEnv unit <$ makeNamespace alias addr Nothing -data Import a = Import { importSymbols :: ![(Name, Name)], importFrom :: ImportPath } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data Import a = Import { importSymbols :: ![Alias], importFrom :: ImportPath } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Import where liftEq = genericLiftEq instance Ord1 Import where liftCompare = genericLiftCompare @@ -154,16 +173,16 @@ instance Show1 Import where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Import where eval (Import symbols importPath) = do modulePath <- resolveWithNodejsStrategy importPath typescriptExtensions - importedEnv <- snd <$> require modulePath + importedEnv <- fst <$> require modulePath bindAll (renamed importedEnv) rvalBox unit where renamed importedEnv | Prologue.null symbols = importedEnv - | otherwise = Env.overwrite symbols importedEnv + | otherwise = Env.overwrite (toTuple <$> symbols) importedEnv data JavaScriptRequire a = JavaScriptRequire { javascriptRequireIden :: !a, javascriptRequireFrom :: ImportPath } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 JavaScriptRequire where liftEq = genericLiftEq instance Ord1 JavaScriptRequire where liftCompare = genericLiftCompare @@ -177,7 +196,7 @@ instance Evaluatable JavaScriptRequire where data QualifiedAliasedImport a = QualifiedAliasedImport { qualifiedAliasedImportAlias :: !a, qualifiedAliasedImportFrom :: ImportPath } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 QualifiedAliasedImport where liftEq = genericLiftEq instance Ord1 QualifiedAliasedImport where liftCompare = genericLiftCompare @@ -190,7 +209,7 @@ instance Evaluatable QualifiedAliasedImport where rvalBox =<< evalRequire modulePath alias newtype SideEffectImport a = SideEffectImport { sideEffectImportFrom :: ImportPath } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 SideEffectImport where liftEq = genericLiftEq instance Ord1 SideEffectImport where liftCompare = genericLiftCompare @@ -204,8 +223,8 @@ instance Evaluatable SideEffectImport where -- | Qualified Export declarations -newtype QualifiedExport a = QualifiedExport { qualifiedExportSymbols :: [(Name, Name)] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype QualifiedExport a = QualifiedExport { qualifiedExportSymbols :: [Alias] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 QualifiedExport where liftEq = genericLiftEq instance Ord1 QualifiedExport where liftCompare = genericLiftCompare @@ -214,14 +233,19 @@ instance Show1 QualifiedExport where liftShowsPrec = genericLiftShowsPrec instance Evaluatable QualifiedExport where eval (QualifiedExport exportSymbols) = do -- Insert the aliases with no addresses. - for_ exportSymbols $ \(name, alias) -> - export name alias Nothing + for_ exportSymbols $ \Alias{..} -> + export aliasValue aliasName Nothing rvalBox unit +data Alias = Alias { aliasValue :: Name, aliasName :: Name } + deriving (Eq, Generic, Hashable, Ord, Show, Message, Named, ToJSON) + +toTuple :: Alias -> (Name, Name) +toTuple Alias{..} = (aliasValue, aliasName) -- | Qualified Export declarations that export from another module. -data QualifiedExportFrom a = QualifiedExportFrom { qualifiedExportFrom :: ImportPath, qualifiedExportFromSymbols :: ![(Name, Name)]} - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data QualifiedExportFrom a = QualifiedExportFrom { qualifiedExportFrom :: ImportPath, qualifiedExportFromSymbols :: ![Alias]} + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 QualifiedExportFrom where liftEq = genericLiftEq instance Ord1 QualifiedExportFrom where liftCompare = genericLiftCompare @@ -230,15 +254,15 @@ instance Show1 QualifiedExportFrom where liftShowsPrec = genericLiftShowsPrec instance Evaluatable QualifiedExportFrom where eval (QualifiedExportFrom importPath exportSymbols) = do modulePath <- resolveWithNodejsStrategy importPath typescriptExtensions - importedEnv <- snd <$> require modulePath + importedEnv <- fst <$> require modulePath -- Look up addresses in importedEnv and insert the aliases with addresses into the exports. - for_ exportSymbols $ \(name, alias) -> do - let address = Env.lookup name importedEnv - maybe (throwEvalError $ ExportError modulePath name) (export name alias . Just) address + for_ exportSymbols $ \Alias{..} -> do + let address = Env.lookup aliasValue importedEnv + maybe (throwEvalError $ ExportError modulePath aliasValue) (export aliasValue aliasName . Just) address rvalBox unit newtype DefaultExport a = DefaultExport { defaultExport :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 DefaultExport where liftEq = genericLiftEq instance Ord1 DefaultExport where liftCompare = genericLiftCompare @@ -259,7 +283,7 @@ instance Evaluatable DefaultExport where -- | Lookup type for a type-level key in a typescript map. data LookupType a = LookupType { lookupTypeIdentifier :: a, lookupTypeKey :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 LookupType where liftEq = genericLiftEq instance Ord1 LookupType where liftCompare = genericLiftCompare @@ -267,64 +291,64 @@ instance Show1 LookupType where liftShowsPrec = genericLiftShowsPrec instance Evaluatable LookupType -- | ShorthandPropertyIdentifier used in object patterns such as var baz = { foo } to mean var baz = { foo: foo } -newtype ShorthandPropertyIdentifier a = ShorthandPropertyIdentifier T.Text - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype ShorthandPropertyIdentifier a = ShorthandPropertyIdentifier { contents :: T.Text } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 ShorthandPropertyIdentifier where liftEq = genericLiftEq instance Ord1 ShorthandPropertyIdentifier where liftCompare = genericLiftCompare instance Show1 ShorthandPropertyIdentifier where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ShorthandPropertyIdentifier -data Union a = Union { _unionLeft :: !a, _unionRight :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data Union a = Union { unionLeft :: !a, unionRight :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Language.TypeScript.Syntax.Union where liftEq = genericLiftEq instance Ord1 Language.TypeScript.Syntax.Union where liftCompare = genericLiftCompare instance Show1 Language.TypeScript.Syntax.Union where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Language.TypeScript.Syntax.Union -data Intersection a = Intersection { _intersectionLeft :: !a, _intersectionRight :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data Intersection a = Intersection { intersectionLeft :: !a, intersectionRight :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Intersection where liftEq = genericLiftEq instance Ord1 Intersection where liftCompare = genericLiftCompare instance Show1 Intersection where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Intersection -data FunctionType a = FunctionType { _functionTypeParameters :: !a, _functionFormalParameters :: ![a], _functionType :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data FunctionType a = FunctionType { functionTypeParameters :: !a, functionFormalParameters :: ![a], functionType :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 FunctionType where liftEq = genericLiftEq instance Ord1 FunctionType where liftCompare = genericLiftCompare instance Show1 FunctionType where liftShowsPrec = genericLiftShowsPrec instance Evaluatable FunctionType -data AmbientFunction a = AmbientFunction { _ambientFunctionContext :: ![a], _ambientFunctionIdentifier :: !a, _ambientFunctionParameters :: ![a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data AmbientFunction a = AmbientFunction { ambientFunctionContext :: ![a], ambientFunctionIdentifier :: !a, ambientFunctionParameters :: ![a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 AmbientFunction where liftEq = genericLiftEq instance Ord1 AmbientFunction where liftCompare = genericLiftCompare instance Show1 AmbientFunction where liftShowsPrec = genericLiftShowsPrec instance Evaluatable AmbientFunction -data ImportRequireClause a = ImportRequireClause { _importRequireIdentifier :: !a, _importRequireSubject :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data ImportRequireClause a = ImportRequireClause { importRequireIdentifier :: !a, importRequireSubject :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 ImportRequireClause where liftEq = genericLiftEq instance Ord1 ImportRequireClause where liftCompare = genericLiftCompare instance Show1 ImportRequireClause where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ImportRequireClause -newtype ImportClause a = ImportClause { _importClauseElements :: [a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype ImportClause a = ImportClause { importClauseElements :: [a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 ImportClause where liftEq = genericLiftEq instance Ord1 ImportClause where liftCompare = genericLiftCompare instance Show1 ImportClause where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ImportClause -newtype Tuple a = Tuple { _tupleElements :: [a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Tuple a = Tuple { tupleElements :: [a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Tuple where liftEq = genericLiftEq instance Ord1 Tuple where liftCompare = genericLiftCompare @@ -333,144 +357,144 @@ instance Show1 Tuple where liftShowsPrec = genericLiftShowsPrec -- This is a tuple type, not a tuple value, so we can't lean on the shared Tuple value instance Evaluatable Tuple -data Constructor a = Constructor { _constructorTypeParameters :: !a, _constructorFormalParameters :: ![a], _constructorType :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data Constructor a = Constructor { constructorTypeParameters :: !a, constructorFormalParameters :: ![a], constructorType :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Language.TypeScript.Syntax.Constructor where liftEq = genericLiftEq instance Ord1 Language.TypeScript.Syntax.Constructor where liftCompare = genericLiftCompare instance Show1 Language.TypeScript.Syntax.Constructor where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Language.TypeScript.Syntax.Constructor -data TypeParameter a = TypeParameter { _typeParameter :: !a, _typeParameterConstraint :: !a, _typeParameterDefaultType :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data TypeParameter a = TypeParameter { typeParameter :: !a, typeParameterConstraint :: !a, typeParameterDefaultType :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 TypeParameter where liftEq = genericLiftEq instance Ord1 TypeParameter where liftCompare = genericLiftCompare instance Show1 TypeParameter where liftShowsPrec = genericLiftShowsPrec instance Evaluatable TypeParameter -data TypeAssertion a = TypeAssertion { _typeAssertionParameters :: !a, _typeAssertionExpression :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data TypeAssertion a = TypeAssertion { typeAssertionParameters :: !a, typeAssertionExpression :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 TypeAssertion where liftEq = genericLiftEq instance Ord1 TypeAssertion where liftCompare = genericLiftCompare instance Show1 TypeAssertion where liftShowsPrec = genericLiftShowsPrec instance Evaluatable TypeAssertion -newtype Annotation a = Annotation { _annotationType :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Annotation a = Annotation { annotationType :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Annotation where liftEq = genericLiftEq instance Ord1 Annotation where liftCompare = genericLiftCompare instance Show1 Annotation where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Annotation -newtype Decorator a = Decorator { _decoratorTerm :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Decorator a = Decorator { decoratorTerm :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Decorator where liftEq = genericLiftEq instance Ord1 Decorator where liftCompare = genericLiftCompare instance Show1 Decorator where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Decorator -newtype ComputedPropertyName a = ComputedPropertyName a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype ComputedPropertyName a = ComputedPropertyName { propertyName :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 ComputedPropertyName where liftEq = genericLiftEq instance Ord1 ComputedPropertyName where liftCompare = genericLiftCompare instance Show1 ComputedPropertyName where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ComputedPropertyName -newtype Constraint a = Constraint { _constraintType :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Constraint a = Constraint { constraintType :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Constraint where liftEq = genericLiftEq instance Ord1 Constraint where liftCompare = genericLiftCompare instance Show1 Constraint where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Constraint -newtype DefaultType a = DefaultType { _defaultType :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype DefaultType a = DefaultType { defaultType :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 DefaultType where liftEq = genericLiftEq instance Ord1 DefaultType where liftCompare = genericLiftCompare instance Show1 DefaultType where liftShowsPrec = genericLiftShowsPrec instance Evaluatable DefaultType -newtype ParenthesizedType a = ParenthesizedType { _parenthesizedType :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype ParenthesizedType a = ParenthesizedType { parenthesizedType :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 ParenthesizedType where liftEq = genericLiftEq instance Ord1 ParenthesizedType where liftCompare = genericLiftCompare instance Show1 ParenthesizedType where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ParenthesizedType -newtype PredefinedType a = PredefinedType { _predefinedType :: T.Text } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype PredefinedType a = PredefinedType { predefinedType :: T.Text } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 PredefinedType where liftEq = genericLiftEq instance Ord1 PredefinedType where liftCompare = genericLiftCompare instance Show1 PredefinedType where liftShowsPrec = genericLiftShowsPrec instance Evaluatable PredefinedType -newtype TypeIdentifier a = TypeIdentifier T.Text - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype TypeIdentifier a = TypeIdentifier { contents :: T.Text } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 TypeIdentifier where liftEq = genericLiftEq instance Ord1 TypeIdentifier where liftCompare = genericLiftCompare instance Show1 TypeIdentifier where liftShowsPrec = genericLiftShowsPrec instance Evaluatable TypeIdentifier -data NestedIdentifier a = NestedIdentifier !a !a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data NestedIdentifier a = NestedIdentifier { left :: !a, right :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 NestedIdentifier where liftEq = genericLiftEq instance Ord1 NestedIdentifier where liftCompare = genericLiftCompare instance Show1 NestedIdentifier where liftShowsPrec = genericLiftShowsPrec instance Evaluatable NestedIdentifier -data NestedTypeIdentifier a = NestedTypeIdentifier !a !a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data NestedTypeIdentifier a = NestedTypeIdentifier { left :: !a, right :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 NestedTypeIdentifier where liftEq = genericLiftEq instance Ord1 NestedTypeIdentifier where liftCompare = genericLiftCompare instance Show1 NestedTypeIdentifier where liftShowsPrec = genericLiftShowsPrec instance Evaluatable NestedTypeIdentifier -data GenericType a = GenericType { _genericTypeIdentifier :: !a, _genericTypeArguments :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data GenericType a = GenericType { genericTypeIdentifier :: !a, genericTypeArguments :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 GenericType where liftEq = genericLiftEq instance Ord1 GenericType where liftCompare = genericLiftCompare instance Show1 GenericType where liftShowsPrec = genericLiftShowsPrec instance Evaluatable GenericType -data TypePredicate a = TypePredicate { _typePredicateIdentifier :: !a, _typePredicateType :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data TypePredicate a = TypePredicate { typePredicateIdentifier :: !a, typePredicateType :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 TypePredicate where liftEq = genericLiftEq instance Ord1 TypePredicate where liftCompare = genericLiftCompare instance Show1 TypePredicate where liftShowsPrec = genericLiftShowsPrec instance Evaluatable TypePredicate -newtype ObjectType a = ObjectType { _objectTypeElements :: [a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype ObjectType a = ObjectType { objectTypeElements :: [a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 ObjectType where liftEq = genericLiftEq instance Ord1 ObjectType where liftCompare = genericLiftCompare instance Show1 ObjectType where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ObjectType -data With a = With { _withExpression :: !a, _withBody :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data With a = With { withExpression :: !a, withBody :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 With where liftEq = genericLiftEq instance Ord1 With where liftCompare = genericLiftCompare instance Show1 With where liftShowsPrec = genericLiftShowsPrec instance Evaluatable With -newtype AmbientDeclaration a = AmbientDeclaration { _ambientDeclarationBody :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype AmbientDeclaration a = AmbientDeclaration { ambientDeclarationBody :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 AmbientDeclaration where liftEq = genericLiftEq instance Ord1 AmbientDeclaration where liftCompare = genericLiftCompare @@ -479,8 +503,8 @@ instance Show1 AmbientDeclaration where liftShowsPrec = genericLiftShowsPrec instance Evaluatable AmbientDeclaration where eval (AmbientDeclaration body) = subtermRef body -data EnumDeclaration a = EnumDeclaration { enumDeclarationIdentifier :: !a, _enumDeclarationBody :: ![a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data EnumDeclaration a = EnumDeclaration { enumDeclarationIdentifier :: !a, enumDeclarationBody :: ![a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 EnumDeclaration where liftEq = genericLiftEq instance Ord1 EnumDeclaration where liftCompare = genericLiftCompare @@ -490,88 +514,88 @@ instance Evaluatable EnumDeclaration instance Declarations a => Declarations (EnumDeclaration a) where declaredName EnumDeclaration{..} = declaredName enumDeclarationIdentifier -newtype ExtendsClause a = ExtendsClause { _extendsClauses :: [a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype ExtendsClause a = ExtendsClause { extendsClauses :: [a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 ExtendsClause where liftEq = genericLiftEq instance Ord1 ExtendsClause where liftCompare = genericLiftCompare instance Show1 ExtendsClause where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ExtendsClause -newtype ArrayType a = ArrayType { _arrayType :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype ArrayType a = ArrayType { arrayType :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 ArrayType where liftEq = genericLiftEq instance Ord1 ArrayType where liftCompare = genericLiftCompare instance Show1 ArrayType where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ArrayType -newtype FlowMaybeType a = FlowMaybeType { _flowMaybeType :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype FlowMaybeType a = FlowMaybeType { flowMaybeType :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 FlowMaybeType where liftEq = genericLiftEq instance Ord1 FlowMaybeType where liftCompare = genericLiftCompare instance Show1 FlowMaybeType where liftShowsPrec = genericLiftShowsPrec instance Evaluatable FlowMaybeType -newtype TypeQuery a = TypeQuery { _typeQuerySubject :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype TypeQuery a = TypeQuery { typeQuerySubject :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 TypeQuery where liftEq = genericLiftEq instance Ord1 TypeQuery where liftCompare = genericLiftCompare instance Show1 TypeQuery where liftShowsPrec = genericLiftShowsPrec instance Evaluatable TypeQuery -newtype IndexTypeQuery a = IndexTypeQuery { _indexTypeQuerySubject :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype IndexTypeQuery a = IndexTypeQuery { indexTypeQuerySubject :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 IndexTypeQuery where liftEq = genericLiftEq instance Ord1 IndexTypeQuery where liftCompare = genericLiftCompare instance Show1 IndexTypeQuery where liftShowsPrec = genericLiftShowsPrec instance Evaluatable IndexTypeQuery -newtype TypeArguments a = TypeArguments { _typeArguments :: [a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype TypeArguments a = TypeArguments { typeArguments :: [a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 TypeArguments where liftEq = genericLiftEq instance Ord1 TypeArguments where liftCompare = genericLiftCompare instance Show1 TypeArguments where liftShowsPrec = genericLiftShowsPrec instance Evaluatable TypeArguments -newtype ThisType a = ThisType T.Text - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype ThisType a = ThisType { contents :: T.Text } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 ThisType where liftEq = genericLiftEq instance Ord1 ThisType where liftCompare = genericLiftCompare instance Show1 ThisType where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ThisType -newtype ExistentialType a = ExistentialType T.Text - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype ExistentialType a = ExistentialType { contents :: T.Text } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 ExistentialType where liftEq = genericLiftEq instance Ord1 ExistentialType where liftCompare = genericLiftCompare instance Show1 ExistentialType where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ExistentialType -newtype LiteralType a = LiteralType { _literalTypeSubject :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype LiteralType a = LiteralType { literalTypeSubject :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 LiteralType where liftEq = genericLiftEq instance Ord1 LiteralType where liftCompare = genericLiftCompare instance Show1 LiteralType where liftShowsPrec = genericLiftShowsPrec instance Evaluatable LiteralType -data PropertySignature a = PropertySignature { _modifiers :: ![a], _propertySignaturePropertyName :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data PropertySignature a = PropertySignature { modifiers :: ![a], propertySignaturePropertyName :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 PropertySignature where liftEq = genericLiftEq instance Ord1 PropertySignature where liftCompare = genericLiftCompare instance Show1 PropertySignature where liftShowsPrec = genericLiftShowsPrec instance Evaluatable PropertySignature -data CallSignature a = CallSignature { _callSignatureTypeParameters :: !a, _callSignatureParameters :: ![a], _callSignatureType :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data CallSignature a = CallSignature { callSignatureTypeParameters :: !a, callSignatureParameters :: ![a], callSignatureType :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 CallSignature where liftEq = genericLiftEq instance Ord1 CallSignature where liftCompare = genericLiftCompare @@ -579,24 +603,24 @@ instance Show1 CallSignature where liftShowsPrec = genericLiftShowsPrec instance Evaluatable CallSignature -- | Todo: Move type params and type to context -data ConstructSignature a = ConstructSignature { _constructSignatureTypeParameters :: !a, _constructSignatureParameters :: ![a], _constructSignatureType :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data ConstructSignature a = ConstructSignature { constructSignatureTypeParameters :: !a, constructSignatureParameters :: ![a], constructSignatureType :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 ConstructSignature where liftEq = genericLiftEq instance Ord1 ConstructSignature where liftCompare = genericLiftCompare instance Show1 ConstructSignature where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ConstructSignature -data IndexSignature a = IndexSignature { _indexSignatureSubject :: a, _indexSignatureType :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data IndexSignature a = IndexSignature { indexSignatureSubject :: a, indexSignatureType :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 IndexSignature where liftEq = genericLiftEq instance Ord1 IndexSignature where liftCompare = genericLiftCompare instance Show1 IndexSignature where liftShowsPrec = genericLiftShowsPrec instance Evaluatable IndexSignature -data AbstractMethodSignature a = AbstractMethodSignature { _abstractMethodSignatureContext :: ![a], _abstractMethodSignatureName :: !a, _abstractMethodSignatureParameters :: ![a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data AbstractMethodSignature a = AbstractMethodSignature { abstractMethodSignatureContext :: ![a], abstractMethodSignatureName :: !a, abstractMethodSignatureParameters :: ![a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 AbstractMethodSignature where liftEq = genericLiftEq instance Ord1 AbstractMethodSignature where liftCompare = genericLiftCompare @@ -604,15 +628,15 @@ instance Show1 AbstractMethodSignature where liftShowsPrec = genericLiftShowsPre instance Evaluatable AbstractMethodSignature data Debugger a = Debugger - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Debugger where liftEq = genericLiftEq instance Ord1 Debugger where liftCompare = genericLiftCompare instance Show1 Debugger where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Debugger -data ForOf a = ForOf { _forOfBinding :: !a, _forOfSubject :: !a, _forOfBody :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data ForOf a = ForOf { forOfBinding :: !a, forOfSubject :: !a, forOfBody :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 ForOf where liftEq = genericLiftEq instance Ord1 ForOf where liftCompare = genericLiftCompare @@ -620,23 +644,23 @@ instance Show1 ForOf where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ForOf data This a = This - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 This where liftEq = genericLiftEq instance Ord1 This where liftCompare = genericLiftCompare instance Show1 This where liftShowsPrec = genericLiftShowsPrec instance Evaluatable This -data LabeledStatement a = LabeledStatement { _labeledStatementIdentifier :: !a, _labeledStatementSubject :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data LabeledStatement a = LabeledStatement { labeledStatementIdentifier :: !a, labeledStatementSubject :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 LabeledStatement where liftEq = genericLiftEq instance Ord1 LabeledStatement where liftCompare = genericLiftCompare instance Show1 LabeledStatement where liftShowsPrec = genericLiftShowsPrec instance Evaluatable LabeledStatement -newtype Update a = Update { _updateSubject :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype Update a = Update { updateSubject :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Update where liftEq = genericLiftEq instance Ord1 Update where liftCompare = genericLiftCompare @@ -644,7 +668,7 @@ instance Show1 Update where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Update data Module a = Module { moduleIdentifier :: !a, moduleStatements :: ![a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Module where liftEq = genericLiftEq instance Ord1 Module where liftCompare = genericLiftCompare @@ -657,9 +681,8 @@ instance Evaluatable Module where value =<< (eval xs <* makeNamespace name addr Nothing)) - data InternalModule a = InternalModule { internalModuleIdentifier :: !a, internalModuleStatements :: ![a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 InternalModule where liftEq = genericLiftEq instance Ord1 InternalModule where liftCompare = genericLiftCompare @@ -675,8 +698,8 @@ instance Declarations a => Declarations (InternalModule a) where declaredName InternalModule{..} = declaredName internalModuleIdentifier -data ImportAlias a = ImportAlias { _importAliasSubject :: !a, _importAlias :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data ImportAlias a = ImportAlias { importAliasSubject :: !a, importAlias :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 ImportAlias where liftEq = genericLiftEq instance Ord1 ImportAlias where liftCompare = genericLiftCompare @@ -684,7 +707,7 @@ instance Show1 ImportAlias where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ImportAlias data Super a = Super - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Super where liftEq = genericLiftEq instance Ord1 Super where liftCompare = genericLiftCompare @@ -692,23 +715,23 @@ instance Show1 Super where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Super data Undefined a = Undefined - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Undefined where liftEq = genericLiftEq instance Ord1 Undefined where liftCompare = genericLiftCompare instance Show1 Undefined where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Undefined -data ClassHeritage a = ClassHeritage { _classHeritageExtendsClause :: !a, _implementsClause :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data ClassHeritage a = ClassHeritage { classHeritageExtendsClause :: !a, implementsClause :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 ClassHeritage where liftEq = genericLiftEq instance Ord1 ClassHeritage where liftCompare = genericLiftCompare instance Show1 ClassHeritage where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ClassHeritage -data AbstractClass a = AbstractClass { abstractClassIdentifier :: !a, _abstractClassTypeParameters :: !a, classHeritage :: ![a], classBody :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data AbstractClass a = AbstractClass { abstractClassIdentifier :: !a, abstractClassTypeParameters :: !a, classHeritage :: ![a], classBody :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 AbstractClass where liftEq = genericLiftEq instance Ord1 AbstractClass where liftCompare = genericLiftCompare @@ -727,104 +750,104 @@ instance Evaluatable AbstractClass where rvalBox =<< (v <$ bind name addr) -data JsxElement a = JsxElement { _jsxOpeningElement :: !a, _jsxElements :: ![a], _jsxClosingElement :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data JsxElement a = JsxElement { jsxOpeningElement :: !a, jsxElements :: ![a], jsxClosingElement :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 JsxElement where liftEq = genericLiftEq instance Ord1 JsxElement where liftCompare = genericLiftCompare instance Show1 JsxElement where liftShowsPrec = genericLiftShowsPrec instance Evaluatable JsxElement -newtype JsxText a = JsxText T.Text - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype JsxText a = JsxText { contents :: T.Text } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 JsxText where liftEq = genericLiftEq instance Ord1 JsxText where liftCompare = genericLiftCompare instance Show1 JsxText where liftShowsPrec = genericLiftShowsPrec instance Evaluatable JsxText -newtype JsxExpression a = JsxExpression { _jsxExpression :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype JsxExpression a = JsxExpression { jsxExpression :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 JsxExpression where liftEq = genericLiftEq instance Ord1 JsxExpression where liftCompare = genericLiftCompare instance Show1 JsxExpression where liftShowsPrec = genericLiftShowsPrec instance Evaluatable JsxExpression -data JsxOpeningElement a = JsxOpeningElement { _jsxOpeningElementIdentifier :: !a, _jsxAttributes :: ![a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data JsxOpeningElement a = JsxOpeningElement { jsxOpeningElementIdentifier :: !a, jsxAttributes :: ![a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 JsxOpeningElement where liftEq = genericLiftEq instance Ord1 JsxOpeningElement where liftCompare = genericLiftCompare instance Show1 JsxOpeningElement where liftShowsPrec = genericLiftShowsPrec instance Evaluatable JsxOpeningElement -newtype JsxClosingElement a = JsxClosingElement { _jsxClosingElementIdentifier :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype JsxClosingElement a = JsxClosingElement { jsxClosingElementIdentifier :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 JsxClosingElement where liftEq = genericLiftEq instance Ord1 JsxClosingElement where liftCompare = genericLiftCompare instance Show1 JsxClosingElement where liftShowsPrec = genericLiftShowsPrec instance Evaluatable JsxClosingElement -data JsxSelfClosingElement a = JsxSelfClosingElement { _jsxSelfClosingElementIdentifier :: !a, _jsxSelfClosingElementAttributes :: ![a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data JsxSelfClosingElement a = JsxSelfClosingElement { jsxSelfClosingElementIdentifier :: !a, jsxSelfClosingElementAttributes :: ![a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 JsxSelfClosingElement where liftEq = genericLiftEq instance Ord1 JsxSelfClosingElement where liftCompare = genericLiftCompare instance Show1 JsxSelfClosingElement where liftShowsPrec = genericLiftShowsPrec instance Evaluatable JsxSelfClosingElement -data JsxAttribute a = JsxAttribute { _jsxAttributeTarget :: !a, _jsxAttributeValue :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data JsxAttribute a = JsxAttribute { jsxAttributeTarget :: !a, jsxAttributeValue :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 JsxAttribute where liftEq = genericLiftEq instance Ord1 JsxAttribute where liftCompare = genericLiftCompare instance Show1 JsxAttribute where liftShowsPrec = genericLiftShowsPrec instance Evaluatable JsxAttribute -newtype ImplementsClause a = ImplementsClause { _implementsClauseTypes :: [a] } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype ImplementsClause a = ImplementsClause { implementsClauseTypes :: [a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 ImplementsClause where liftEq = genericLiftEq instance Ord1 ImplementsClause where liftCompare = genericLiftCompare instance Show1 ImplementsClause where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ImplementsClause -data OptionalParameter a = OptionalParameter { _optionalParameterContext :: ![a], _optionalParameterSubject :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data OptionalParameter a = OptionalParameter { optionalParameterContext :: ![a], optionalParameterSubject :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 OptionalParameter where liftEq = genericLiftEq instance Ord1 OptionalParameter where liftCompare = genericLiftCompare instance Show1 OptionalParameter where liftShowsPrec = genericLiftShowsPrec instance Evaluatable OptionalParameter -data RequiredParameter a = RequiredParameter { _requiredParameterContext :: ![a], _requiredParameterSubject :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data RequiredParameter a = RequiredParameter { requiredParameterContext :: ![a], requiredParameterSubject :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 RequiredParameter where liftEq = genericLiftEq instance Ord1 RequiredParameter where liftCompare = genericLiftCompare instance Show1 RequiredParameter where liftShowsPrec = genericLiftShowsPrec instance Evaluatable RequiredParameter -data RestParameter a = RestParameter { _restParameterContext :: ![a], _restParameterSubject :: !a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data RestParameter a = RestParameter { restParameterContext :: ![a], restParameterSubject :: !a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 RestParameter where liftEq = genericLiftEq instance Ord1 RestParameter where liftCompare = genericLiftCompare instance Show1 RestParameter where liftShowsPrec = genericLiftShowsPrec instance Evaluatable RestParameter -newtype JsxFragment a = JsxFragment [a] - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +newtype JsxFragment a = JsxFragment { terms :: [a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 JsxFragment where liftEq = genericLiftEq instance Ord1 JsxFragment where liftCompare = genericLiftCompare instance Show1 JsxFragment where liftShowsPrec = genericLiftShowsPrec instance Evaluatable JsxFragment -data JsxNamespaceName a = JsxNamespaceName a a - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) +data JsxNamespaceName a = JsxNamespaceName { left :: a, right :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Message1, Named1, Ord, Show, ToJSONFields1, Traversable) instance Eq1 JsxNamespaceName where liftEq = genericLiftEq instance Ord1 JsxNamespaceName where liftCompare = genericLiftCompare diff --git a/src/Parsing/Parser.hs b/src/Parsing/Parser.hs index 855457531..84d42e080 100644 --- a/src/Parsing/Parser.hs +++ b/src/Parsing/Parser.hs @@ -3,6 +3,8 @@ module Parsing.Parser ( Parser(..) , SomeTerm(..) , withSomeTerm +, SomeSyntaxTerm +, withSomeSyntaxTerm , SomeAnalysisParser(..) , SomeASTParser(..) , someParser @@ -15,6 +17,7 @@ module Parsing.Parser , javaParser , javaASTParser , jsonParser +, jsonASTParser , markdownParser , pythonParser , rubyParser @@ -24,6 +27,7 @@ module Parsing.Parser ) where import Assigning.Assignment +import qualified Assigning.Assignment.Deterministic as Deterministic import qualified CMarkGFM import Data.Abstract.Evaluatable (HasPrelude) import Data.AST @@ -101,6 +105,10 @@ data Parser term where => Parser (Term ast (Node grammar)) -- A parser producing AST. -> Assignment ast grammar (Term (Sum fs) (Record Location)) -- An assignment from AST onto 'Term's. -> Parser (Term (Sum fs) (Record Location)) -- A parser producing 'Term's. + DeterministicParser :: (Enum grammar, Ord grammar, Show grammar, Element Syntax.Error syntaxes, Apply Foldable syntaxes, Apply Functor syntaxes) + => Parser (AST [] grammar) + -> Deterministic.Assignment grammar (Term (Sum syntaxes) (Record Location)) + -> Parser (Term (Sum syntaxes) (Record Location)) -- | A parser for 'Markdown' using cmark. MarkdownParser :: Parser (Term (TermF [] CMarkGFM.NodeType) (Node Markdown.Grammar)) -- | An abstraction over parsers when we don’t know the details of the term type. @@ -161,7 +169,10 @@ javaASTParser :: Parser (AST [] Java.Grammar) javaASTParser = ASTParser tree_sitter_java jsonParser :: Parser JSON.Term -jsonParser = AssignmentParser (ASTParser tree_sitter_json) JSON.assignment +jsonParser = DeterministicParser jsonASTParser JSON.assignment + +jsonASTParser :: Parser (AST [] JSON.Grammar) +jsonASTParser = ASTParser tree_sitter_json typescriptParser :: Parser TypeScript.Term typescriptParser = AssignmentParser (ASTParser tree_sitter_typescript) TypeScript.assignment @@ -179,6 +190,11 @@ data SomeTerm typeclasses ann where withSomeTerm :: (forall syntax . ApplyAll typeclasses syntax => Term syntax ann -> a) -> SomeTerm typeclasses ann -> a withSomeTerm with (SomeTerm term) = with term +data SomeSyntaxTerm syntax ann where + SomeSyntaxTerm :: Term syntax ann -> SomeSyntaxTerm syntax ann + +withSomeSyntaxTerm :: (forall syntax . Term syntax ann -> a) -> SomeSyntaxTerm syntax ann -> a +withSomeSyntaxTerm with (SomeSyntaxTerm term) = with term -- | A parser for producing specialized (tree-sitter) ASTs. data SomeASTParser where diff --git a/src/Parsing/TreeSitter.hs b/src/Parsing/TreeSitter.hs index d47af78e6..28f438771 100644 --- a/src/Parsing/TreeSitter.hs +++ b/src/Parsing/TreeSitter.hs @@ -58,7 +58,7 @@ runParser parser blobSource = unsafeUseAsCStringLen (sourceBytes blobSource) $ -- | Parse 'Source' with the given 'TS.Language' and return its AST. -- Returns Nothing if the operation timed out. -parseToAST :: (Bounded grammar, Enum grammar, Member IO effects, Member Trace effects) => Timeout -> Ptr TS.Language -> Blob -> Eff effects (Maybe (AST [] grammar)) +parseToAST :: (Bounded grammar, Enum grammar, Member (Lift IO) effects, Member Trace effects) => Timeout -> Ptr TS.Language -> Blob -> Eff effects (Maybe (AST [] grammar)) parseToAST (Milliseconds s) language Blob{..} = bracket TS.ts_parser_new TS.ts_parser_delete $ \ parser -> do let parserTimeout = s * 1000 @@ -66,7 +66,7 @@ parseToAST (Milliseconds s) language Blob{..} = bracket TS.ts_parser_new TS.ts_p TS.ts_parser_halt_on_error parser (CBool 1) TS.ts_parser_set_language parser language - trace "tree-sitter: beginning parsing" + trace $ "tree-sitter: beginning parsing " <> blobPath parsing <- liftIO . async $ runParser parser blobSource @@ -74,10 +74,10 @@ parseToAST (Milliseconds s) language Blob{..} = bracket TS.ts_parser_new TS.ts_p res <- liftIO . timeout parserTimeout $ wait parsing case res of - Just Failed -> Nothing <$ trace "tree-sitter: parsing failed" - Just (Succeeded ast) -> Just ast <$ trace "tree-sitter: parsing succeeded" + Just Failed -> Nothing <$ trace ("tree-sitter: parsing failed " <> blobPath) + Just (Succeeded ast) -> Just ast <$ trace ("tree-sitter: parsing succeeded " <> blobPath) Nothing -> do - trace "tree-sitter: parsing timed out" + trace $ "tree-sitter: parsing timed out " <> blobPath Nothing <$ liftIO (TS.ts_parser_set_enabled parser (CBool 0)) diff --git a/src/Rendering/Imports.hs b/src/Rendering/Imports.hs deleted file mode 100644 index ee7f5d8e2..000000000 --- a/src/Rendering/Imports.hs +++ /dev/null @@ -1,161 +0,0 @@ -{-# LANGUAGE RankNTypes, ScopedTypeVariables, TypeFamilies, TypeOperators, UndecidableInstances #-} -module Rendering.Imports -( renderToImports -, ImportSummary(..) -) where - -import Prologue -import Analysis.Declaration -import Analysis.PackageDef -import Data.Aeson -import Data.Blob -import Data.Language (ensureLanguage) -import Data.Record -import Data.Span -import Data.Term -import System.FilePath.Posix (takeBaseName) -import qualified Data.Text as T -import qualified Data.Map as Map -import Rendering.TOC (termTableOfContentsBy, declaration, getDeclaration, toCategoryName) - - -newtype ImportSummary = ImportSummary (Map.Map T.Text Module) deriving (Eq, Show) - -instance Semigroup ImportSummary where - (<>) (ImportSummary m1) (ImportSummary m2) = ImportSummary (Map.unionWith mappend m1 m2) - -instance Monoid ImportSummary where - mempty = ImportSummary mempty - mappend = (<>) - -instance ToJSON ImportSummary where - toJSON (ImportSummary m) = object [ "modules" .= m ] - -renderToImports :: (HasField fields (Maybe PackageDef), HasField fields (Maybe Declaration), HasField fields Span, Foldable f, Functor f) => Blob -> Term f (Record fields) -> ImportSummary -renderToImports blob term = ImportSummary $ toMap (termToModule blob term) - where - toMap m@Module{..} = Map.singleton moduleName m - termToModule :: (HasField fields (Maybe PackageDef), HasField fields (Maybe Declaration), HasField fields Span, Foldable f, Functor f) => Blob -> Term f (Record fields) -> Module - termToModule blob@Blob{..} term = makeModule detectModuleName blob declarations - where - declarations = termTableOfContentsBy declaration term - defaultModuleName = T.pack (takeBaseName blobPath) - detectModuleName = case termTableOfContentsBy moduleDef term of - x:_ | Just PackageDef{..} <- getPackageDef x -> moduleDefIdentifier - _ -> defaultModuleName - -makeModule :: (HasField fields Span, HasField fields (Maybe Declaration)) => T.Text -> Blob -> [Record fields] -> Module -makeModule name Blob{..} ds = Module name [T.pack blobPath] (T.pack . show <$> ensureLanguage blobLanguage) (mapMaybe importSummary ds) (mapMaybe (declarationSummary name) ds) (mapMaybe referenceSummary ds) - - -getPackageDef :: HasField fields (Maybe PackageDef) => Record fields -> Maybe PackageDef -getPackageDef = getField - --- | Produce the annotations of nodes representing moduleDefs. -moduleDef :: HasField fields (Maybe PackageDef) => TermF f (Record fields) a -> Maybe (Record fields) -moduleDef (In annotation _) = annotation <$ getPackageDef annotation - -declarationSummary :: (HasField fields (Maybe Declaration), HasField fields Span) => Text -> Record fields -> Maybe SymbolDeclaration -declarationSummary module' record = case getDeclaration record of - Just declaration | FunctionDeclaration{} <- declaration -> Just (makeSymbolDeclaration declaration) - | MethodDeclaration{} <- declaration -> Just (makeSymbolDeclaration declaration) - _ -> Nothing - where makeSymbolDeclaration declaration = SymbolDeclaration - { declarationName = declarationIdentifier declaration - , declarationKind = toCategoryName declaration - , declarationSpan = getField record - , declarationModule = module' - } - -importSummary :: (HasField fields (Maybe Declaration), HasField fields Span) => Record fields -> Maybe ImportStatement -importSummary record = case getDeclaration record of - Just ImportDeclaration{..} -> Just $ ImportStatement declarationIdentifier declarationAlias (uncurry ImportSymbol <$> declarationSymbols) (getField record) - _ -> Nothing - -referenceSummary :: (HasField fields (Maybe Declaration), HasField fields Span) => Record fields -> Maybe CallExpression -referenceSummary record = case getDeclaration record of - Just CallReference{..} -> Just $ CallExpression declarationIdentifier declarationImportIdentifier (getField record) - _ -> Nothing - -data Module = Module - { moduleName :: T.Text - , modulePaths :: [T.Text] - , moduleLanguage :: Maybe T.Text - , moduleImports :: [ImportStatement] - , moduleDeclarations :: [SymbolDeclaration] - , moduleCalls :: [CallExpression] - } deriving (Generic, Eq, Show) - -instance Semigroup Module where - (<>) (Module n1 p1 l1 i1 d1 r1) (Module _ p2 _ i2 d2 r2) = Module n1 (p1 <> p2) l1 (i1 <> i2) (d1 <> d2) (r1 <> r2) - -instance Monoid Module where - mempty = mempty - mappend = (<>) - -instance ToJSON Module where - toJSON Module{..} = object - [ "name" .= moduleName - , "paths" .= modulePaths - , "language" .= moduleLanguage - , "imports" .= moduleImports - , "declarations" .= moduleDeclarations - , "calls" .= moduleCalls - ] - -data SymbolDeclaration = SymbolDeclaration - { declarationName :: T.Text - , declarationKind :: T.Text - , declarationSpan :: Span - , declarationModule :: T.Text - } deriving (Generic, Eq, Show) - -instance ToJSON SymbolDeclaration where - toJSON SymbolDeclaration{..} = object - [ "name" .= declarationName - , "kind" .= declarationKind - , "span" .= declarationSpan - , "module" .= declarationModule - ] - -data ImportStatement = ImportStatement - { importPath :: T.Text - , importAlias :: T.Text - , importSymbols :: [ImportSymbol] - , importSpan :: Span - } deriving (Generic, Eq, Show) - -instance ToJSON ImportStatement where - toJSON ImportStatement{..} = object - [ "path" .= importPath - , "alias" .= importAlias - , "symbols" .= importSymbols - , "span" .= importSpan - ] - -data ImportSymbol = ImportSymbol - { importSymbolName :: T.Text - , importSymbolAlias :: T.Text - } deriving (Generic, Eq, Show) - -instance ToJSON ImportSymbol where - toJSON ImportSymbol{..} = object - [ "name" .= importSymbolName - , "alias" .= importSymbolAlias - ] - -data CallExpression = CallExpression - { callSymbol :: T.Text - , callTargets :: [T.Text] - , callSpan :: Span - } deriving (Generic, Eq, Show) - -instance ToJSON CallExpression where - toJSON CallExpression{..} = objectWithoutNulls - [ "symbol" .= callSymbol - , "targets" .= callTargets - , "span" .= callSpan - ] - -objectWithoutNulls :: [(T.Text, Value)] -> Value -objectWithoutNulls = object . filter (\(_, v) -> v /= Null) diff --git a/src/Rendering/Renderer.hs b/src/Rendering/Renderer.hs index 8c99f9452..d211ea243 100644 --- a/src/Rendering/Renderer.hs +++ b/src/Rendering/Renderer.hs @@ -10,8 +10,6 @@ module Rendering.Renderer , renderToCTerm , renderSymbolTerms , renderToSymbols -, ImportSummary(..) -, renderToImports , renderTreeGraph , Summaries(..) , TOCSummary(..) @@ -23,7 +21,6 @@ module Rendering.Renderer import Data.ByteString.Builder import Data.Graph import Rendering.Graph as R -import Rendering.Imports as R import Rendering.JSON as R import Rendering.Symbol as R import Rendering.TOC as R diff --git a/src/Semantic/AST.hs b/src/Semantic/AST.hs index 292029172..20d40566a 100644 --- a/src/Semantic/AST.hs +++ b/src/Semantic/AST.hs @@ -25,7 +25,7 @@ astParseBlob blob@Blob{..} data ASTFormat = SExpression | JSON | Show deriving (Show) -runASTParse :: (Member (Distribute WrappedTask) effects, Member Task effects) => ASTFormat -> [Blob] -> Eff effects F.Builder -runASTParse SExpression = distributeFoldMap (WrapTask . (astParseBlob >=> withSomeAST (serialize (F.SExpression F.ByShow)))) -runASTParse Show = distributeFoldMap (WrapTask . (astParseBlob >=> withSomeAST (serialize F.Show))) -runASTParse JSON = distributeFoldMap (\ blob -> WrapTask (astParseBlob blob >>= withSomeAST (render (renderJSONAST blob)))) >=> serialize F.JSON +runASTParse :: (Member Distribute effects, Member (Exc SomeException) effects, Member Task effects) => ASTFormat -> [Blob] -> Eff effects F.Builder +runASTParse SExpression = distributeFoldMap (astParseBlob >=> withSomeAST (serialize (F.SExpression F.ByShow))) +runASTParse Show = distributeFoldMap (astParseBlob >=> withSomeAST (serialize F.Show)) +runASTParse JSON = distributeFoldMap (\ blob -> astParseBlob blob >>= withSomeAST (render (renderJSONAST blob))) >=> serialize F.JSON diff --git a/src/Semantic/Diff.hs b/src/Semantic/Diff.hs index c36d23b57..b2add5f8e 100644 --- a/src/Semantic/Diff.hs +++ b/src/Semantic/Diff.hs @@ -19,7 +19,7 @@ import Semantic.Telemetry as Stat import Semantic.Task as Task import Serializing.Format -runDiff :: (Member (Distribute WrappedTask) effs, Member Task effs) => DiffRenderer output -> [BlobPair] -> Eff effs Builder +runDiff :: (Member Distribute effs, Member (Exc SomeException) effs, Member (Lift IO) effs, Member Task effs, Member Telemetry effs) => DiffRenderer output -> [BlobPair] -> Eff effs Builder runDiff ToCDiffRenderer = withParsedBlobPairs (decorate . declarationAlgebra) (render . renderToCDiff) >=> serialize JSON runDiff JSONDiffRenderer = withParsedBlobPairs (const pure) (render . renderJSONDiff) >=> serialize JSON runDiff SExpressionDiffRenderer = withParsedBlobPairs (const pure) (const (serialize (SExpression ByConstructorName))) @@ -32,28 +32,28 @@ data SomeTermPair typeclasses ann where withSomeTermPair :: (forall syntax . ApplyAll typeclasses syntax => Join These (Term syntax ann) -> a) -> SomeTermPair typeclasses ann -> a withSomeTermPair with (SomeTermPair terms) = with terms -diffBlobTOCPairs :: Member (Distribute WrappedTask) effs => [BlobPair] -> Eff effs ([TOCSummary], [TOCSummary]) +diffBlobTOCPairs :: (Member Distribute effs, Member (Exc SomeException) effs, Member (Lift IO) effs, Member Task effs, Member Telemetry effs) => [BlobPair] -> Eff effs ([TOCSummary], [TOCSummary]) diffBlobTOCPairs = withParsedBlobPairs (decorate . declarationAlgebra) (render . renderRPCToCDiff) type CanDiff syntax = (ConstructorName syntax, Diffable syntax, Eq1 syntax, HasDeclaration syntax, Hashable1 syntax, Show1 syntax, ToJSONFields1 syntax, Traversable syntax) -withParsedBlobPairs :: (Member (Distribute WrappedTask) effs, Monoid output) - => (forall syntax . CanDiff syntax => Blob -> Term syntax (Record Location) -> TaskEff (Term syntax (Record fields))) - -> (forall syntax . CanDiff syntax => BlobPair -> Diff syntax (Record fields) (Record fields) -> TaskEff output) +withParsedBlobPairs :: (Member Distribute effs, Member (Exc SomeException) effs, Member (Lift IO) effs, Member Task effs, Member Telemetry effs, Monoid output) + => (forall syntax . CanDiff syntax => Blob -> Term syntax (Record Location) -> Eff effs (Term syntax (Record fields))) + -> (forall syntax . CanDiff syntax => BlobPair -> Diff syntax (Record fields) (Record fields) -> Eff effs output) -> [BlobPair] -> Eff effs output -withParsedBlobPairs decorate render = distributeFoldMap (\ blobs -> WrapTask (withParsedBlobPair decorate blobs >>= withSomeTermPair (diffTerms blobs >=> render blobs))) - where diffTerms :: (Diffable syntax, Eq1 syntax, Hashable1 syntax, Traversable syntax, Member IO effs, Member Task effs, Member Telemetry effs) => BlobPair -> Join These (Term syntax (Record fields)) -> Eff effs (Diff syntax (Record fields) (Record fields)) +withParsedBlobPairs decorate render = distributeFoldMap (\ blobs -> withParsedBlobPair decorate blobs >>= withSomeTermPair (diffTerms blobs >=> render blobs)) + where diffTerms :: (Diffable syntax, Eq1 syntax, Hashable1 syntax, Traversable syntax, Member (Lift IO) effs, Member Task effs, Member Telemetry effs) => BlobPair -> Join These (Term syntax (Record fields)) -> Eff effs (Diff syntax (Record fields) (Record fields)) diffTerms blobs terms = time "diff" languageTag $ do diff <- diff (runJoin terms) diff <$ writeStat (Stat.count "diff.nodes" (bilength diff) languageTag) where languageTag = languageTagForBlobPair blobs -withParsedBlobPair :: (Member (Distribute WrappedTask) effs, Member (Exc SomeException) effs) - => (forall syntax . (CanDiff syntax) => Blob -> Term syntax (Record Location) -> TaskEff (Term syntax (Record fields))) +withParsedBlobPair :: (Member Distribute effs, Member (Exc SomeException) effs, Member Task effs) + => (forall syntax . (CanDiff syntax) => Blob -> Term syntax (Record Location) -> Eff effs (Term syntax (Record fields))) -> BlobPair -> Eff effs (SomeTermPair '[ConstructorName, Diffable, Eq1, HasDeclaration, Hashable1, Show1, ToJSONFields1, Traversable] (Record fields)) withParsedBlobPair decorate blobs | Just (SomeParser parser) <- someParser @'[ConstructorName, Diffable, Eq1, HasDeclaration, Hashable1, Show1, ToJSONFields1, Traversable] (languageForBlobPair blobs) - = SomeTermPair <$> distributeFor blobs (\ blob -> WrapTask (parse parser blob >>= decorate blob)) + = SomeTermPair <$> distributeFor blobs (\ blob -> parse parser blob >>= decorate blob) | otherwise = noLanguageForBlob (pathForBlobPair blobs) diff --git a/src/Semantic/Distribute.hs b/src/Semantic/Distribute.hs index af176b2d2..69b162606 100644 --- a/src/Semantic/Distribute.hs +++ b/src/Semantic/Distribute.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE GADTs, RankNTypes, TypeOperators, UndecidableInstances #-} +{-# LANGUAGE TypeOperators #-} module Semantic.Distribute ( distribute , distributeFor @@ -8,37 +8,37 @@ module Semantic.Distribute ) where import qualified Control.Concurrent.Async as Async -import Control.Monad.Effect -import Control.Monad.Effect.Exception -import Control.Monad.IO.Class import Control.Parallel.Strategies +import Control.Monad.Effect +import Control.Monad.IO.Class import Prologue hiding (MonadError (..)) -- | Distribute a 'Traversable' container of tasks over the available cores (i.e. execute them concurrently), collecting their results. -- -- This is a concurrent analogue of 'sequenceA'. -distribute :: (Member (Distribute task) effs, Traversable t) => t (task output) -> Eff effs (t output) -distribute = send . Distribute +distribute :: (Member Distribute effs, Traversable t) => t (Eff effs output) -> Eff effs (t output) +distribute = fmap (withStrategy (parTraversable rseq)) <$> traverse (send . Distribute) -- | Distribute the application of a function to each element of a 'Traversable' container of inputs over the available cores (i.e. perform the function concurrently for each element), collecting the results. -- -- This is a concurrent analogue of 'for' or 'traverse' (with the arguments flipped). -distributeFor :: (Member (Distribute task) effs, Traversable t) => t a -> (a -> task output) -> Eff effs (t output) +distributeFor :: (Member Distribute effs, Traversable t) => t a -> (a -> Eff effs output) -> Eff effs (t output) distributeFor inputs toTask = distribute (fmap toTask inputs) -- | Distribute the application of a function to each element of a 'Traversable' container of inputs over the available cores (i.e. perform the function concurrently for each element), combining the results 'Monoid'ally into a final value. -- -- This is a concurrent analogue of 'foldMap'. -distributeFoldMap :: (Member (Distribute task) effs, Monoid output, Traversable t) => (a -> task output) -> t a -> Eff effs output +distributeFoldMap :: (Member Distribute effs, Monoid output, Traversable t) => (a -> Eff effs output) -> t a -> Eff effs output distributeFoldMap toTask inputs = fmap fold (distribute (fmap toTask inputs)) -- | Distribute effects run tasks concurrently. -data Distribute task output where - Distribute :: Traversable t => t (task output) -> Distribute task (t output) +newtype Distribute task output = Distribute (task output) + +instance Effect Distribute where + handleState c dist (Request (Distribute task) k) = Request (Distribute (dist (task <$ c))) (dist . fmap k) -- | Evaluate a 'Distribute' effect concurrently. -runDistribute :: (Member (Exc SomeException) effs, Member IO effs) => (forall output . task output -> IO (Either SomeException output)) -> Eff (Distribute task ': effs) a -> Eff effs a -runDistribute action = interpret (\ (Distribute tasks) -> - liftIO (Async.mapConcurrently action tasks) >>= either throwError pure . sequenceA . withStrategy (parTraversable (parTraversable rseq))) +runDistribute :: Eff '[Distribute, Lift IO] a -> Eff '[Lift IO] a +runDistribute = interpret (\ (Distribute task) -> liftIO (Async.runConcurrently (Async.Concurrently (runM (runDistribute task))))) diff --git a/src/Semantic/Graph.hs b/src/Semantic/Graph.hs index d89b1c8ca..6d55a3afa 100644 --- a/src/Semantic/Graph.hs +++ b/src/Semantic/Graph.hs @@ -32,8 +32,8 @@ import Data.Abstract.Evaluatable import Data.Abstract.Module import qualified Data.Abstract.ModuleTable as ModuleTable import Data.Abstract.Package as Package -import Data.Abstract.Type -import Data.Abstract.Value (Value, ValueError (..), runValueErrorWith) +import Data.Abstract.Value.Type +import Data.Abstract.Value.Concrete (Value, ValueError (..), runValueErrorWith) import Data.Graph import Data.Project import Data.Record @@ -46,9 +46,9 @@ import Semantic.Task as Task data GraphType = ImportGraph | CallGraph -type AnalysisClasses = '[ Declarations1, Eq1, Evaluatable, FreeVariables1, Functor, Ord1, Show1 ] +type AnalysisClasses = '[ Declarations1, Eq1, Evaluatable, FreeVariables1, Foldable, Functor, Ord1, Show1 ] -runGraph :: (Member (Distribute WrappedTask) effs, Member Resolution effs, Member Task effs, Member Trace effs) +runGraph :: forall effs. (Member Distribute effs, Member (Exc SomeException) effs, Member Resolution effs, Member Task effs, Member Trace effs, Effects effs) => GraphType -> Bool -> Project @@ -72,8 +72,9 @@ runCallGraph :: ( HasField ann Span , Evaluatable (Base term) , FreeVariables term , HasPrelude lang - , Member Task effs + , Member Trace effs , Recursive term + , Effects effs ) => Proxy lang -> Bool @@ -83,12 +84,10 @@ runCallGraph :: ( HasField ann Span runCallGraph lang includePackages modules package = do let analyzeTerm = withTermSpans . graphingTerms . cachingTerms analyzeModule = (if includePackages then graphingPackages else id) . convergingModules . graphingModules - extractGraph (((_, graph), _), _) = simplify graph + extractGraph (_, (_, (graph, _))) = simplify graph runGraphAnalysis - = run - . runState (lowerBound @(Heap (Hole (Located Monovariant)) All Type)) + = runState (lowerBound @(Heap (Hole (Located Monovariant)) All Type)) . runFresh 0 - . runIgnoringTrace . resumingLoadError . resumingUnspecialized . resumingEnvironmentError @@ -102,19 +101,20 @@ runCallGraph lang includePackages modules package = do . runReader (packageInfo package) . runReader (lowerBound @Span) . providingLiveSet - . fmap fst - . runState (lowerBound @(ModuleTable (NonEmpty (Module (Hole (Located Monovariant), Environment (Hole (Located Monovariant))))))) + . runReader (lowerBound @(ModuleTable (NonEmpty (Module (Environment (Hole (Located Monovariant)), Hole (Located Monovariant)))))) . raiseHandler (runModules (ModuleTable.modulePaths (packageModules package))) - extractGraph <$> analyze runGraphAnalysis (evaluate lang analyzeModule analyzeTerm modules) + extractGraph <$> runEvaluator (runGraphAnalysis (evaluate lang analyzeModule analyzeTerm modules)) -runImportGraph :: ( Declarations term + +runImportGraph :: forall effs lang term. + ( Declarations term , Evaluatable (Base term) , FreeVariables term , HasPrelude lang - , Member Task effs , Member Trace effs , Recursive term + , Effects effs ) => Proxy lang -> Package term @@ -124,14 +124,12 @@ runImportGraph lang (package :: Package term) | [m :| []] <- toList (packageModules package) = vertex m <$ trace ("single module, skipping import graph computation for " <> modulePath (moduleInfo m)) | otherwise = let analyzeModule = graphingModuleInfo - extractGraph (((_, graph), _), _) = do + extractGraph (_, (_, (graph, _))) = do info <- graph maybe lowerBound (foldMap vertex) (ModuleTable.lookup (modulePath info) (packageModules package)) runImportGraphAnalysis - = run - . runState lowerBound + = runState lowerBound . runFresh 0 - . runIgnoringTrace . resumingLoadError . resumingUnspecialized . resumingEnvironmentError @@ -140,42 +138,40 @@ runImportGraph lang (package :: Package term) . resumingAddressError . resumingValueError . runState lowerBound - . fmap fst - . runState lowerBound + . runReader lowerBound . runModules (ModuleTable.modulePaths (packageModules package)) - . runTermEvaluator @_ @_ @(Value (Hole Precise) (ImportGraphEff term (Hole Precise))) + . runTermEvaluator @_ @_ @(Value (Hole Precise) (ImportGraphEff term (Hole Precise) effs)) . runReader (packageInfo package) . runReader lowerBound - in extractGraph <$> analyze runImportGraphAnalysis (evaluate @_ @_ @_ @_ @term lang analyzeModule id (ModuleTable.toPairs (packageModules package) >>= toList . snd)) + in extractGraph <$> runEvaluator (runImportGraphAnalysis (evaluate @_ @_ @_ @_ @term lang analyzeModule id (ModuleTable.toPairs (packageModules package) >>= toList . snd))) -newtype ImportGraphEff term address a = ImportGraphEff - { runImportGraphEff :: Eff '[ LoopControl address - , Return address - , Env address - , Allocator address (Value address (ImportGraphEff term address)) - , Reader ModuleInfo - , Reader Span - , Reader PackageInfo - , Modules address - -- FIXME: This should really be a Reader effect but for https://github.com/joshvera/effects/issues/47 - , State (ModuleTable (NonEmpty (Module (address, Environment address)))) - , State (Graph ModuleInfo) - , Resumable (ValueError address (ImportGraphEff term address)) - , Resumable (AddressError address (Value address (ImportGraphEff term address))) - , Resumable ResolutionError - , Resumable EvalError - , Resumable (EnvironmentError address) - , Resumable (Unspecialized (Value address (ImportGraphEff term address))) - , Resumable (LoadError address) - , Trace - , Fresh - , State (Heap address Latest (Value address (ImportGraphEff term address))) - ] a +newtype ImportGraphEff term address outerEffects a = ImportGraphEff + { runImportGraphEff :: Eff ( Exc (LoopControl address) + ': Exc (Return address) + ': Env address + ': Allocator address (Value address (ImportGraphEff term address outerEffects)) + ': Reader ModuleInfo + ': Reader Span + ': Reader PackageInfo + ': Modules address + ': Reader (ModuleTable (NonEmpty (Module (Environment address, address)))) + ': State (Graph ModuleInfo) + ': Resumable (ValueError address (ImportGraphEff term address outerEffects)) + ': Resumable (AddressError address (Value address (ImportGraphEff term address outerEffects))) + ': Resumable ResolutionError + ': Resumable EvalError + ': Resumable (EnvironmentError address) + ': Resumable (Unspecialized (Value address (ImportGraphEff term address outerEffects))) + ': Resumable (LoadError address) + ': Fresh + ': State (Heap address Latest (Value address (ImportGraphEff term address outerEffects))) + ': outerEffects + ) a } -- | Parse a list of files into a 'Package'. -parsePackage :: (Member (Distribute WrappedTask) effs, Member Resolution effs, Member Trace effs) +parsePackage :: (Member Distribute effs, Member (Exc SomeException) effs, Member Resolution effs, Member Task effs, Member Trace effs) => Parser term -- ^ A parser. -> Project -- ^ Project to parse into a package. -> Eff effs (Package term) @@ -189,8 +185,8 @@ parsePackage parser project@Project{..} = do n = name (projectName project) -- | Parse all files in a project into 'Module's. - parseModules :: Member (Distribute WrappedTask) effs => Parser term -> Project -> Eff effs [Module term] - parseModules parser p@Project{..} = distributeFor (projectFiles p) (WrapTask . parseModule p parser) + parseModules :: (Member Distribute effs, Member (Exc SomeException) effs, Member Task effs) => Parser term -> Project -> Eff effs [Module term] + parseModules parser p@Project{..} = distributeFor (projectFiles p) (parseModule p parser) -- | Parse a file into a 'Module'. parseModule :: (Member (Exc SomeException) effs, Member Task effs) => Project -> Parser term -> File -> Eff effs (Module term) @@ -207,15 +203,15 @@ withTermSpans :: ( HasField fields Span -> SubtermAlgebra (TermF syntax (Record fields)) term (TermEvaluator term address value effects a) withTermSpans recur term = withCurrentSpan (getField (termFAnnotation term)) (recur term) -resumingResolutionError :: (Applicative (m effects), Effectful m, Member Trace effects) => m (Resumable ResolutionError ': effects) a -> m effects a +resumingResolutionError :: (Applicative (m effects), Effectful m, Member Trace effects, Effects effects) => m (Resumable ResolutionError ': effects) a -> m effects a resumingResolutionError = runResolutionErrorWith (\ err -> trace ("ResolutionError:" <> show err) *> case err of NotFoundError nameToResolve _ _ -> pure nameToResolve GoImportError pathToResolve -> pure [pathToResolve]) -resumingLoadError :: (Member Trace effects, AbstractHole address) => Evaluator address value (Resumable (LoadError address) ': effects) a -> Evaluator address value effects a -resumingLoadError = runLoadErrorWith (\ (ModuleNotFound path) -> trace ("LoadError: " <> path) $> (hole, lowerBound)) +resumingLoadError :: (Member Trace effects, AbstractHole address, Effects effects) => Evaluator address value (Resumable (LoadError address) ': effects) a -> Evaluator address value effects a +resumingLoadError = runLoadErrorWith (\ (ModuleNotFound path) -> trace ("LoadError: " <> path) $> (lowerBound, hole)) -resumingEvalError :: Member Trace effects => Evaluator address value (Resumable EvalError ': effects) a -> Evaluator address value effects a +resumingEvalError :: (Member Trace effects, Effects effects) => Evaluator address value (Resumable EvalError ': effects) a -> Evaluator address value effects a resumingEvalError = runEvalErrorWith (\ err -> trace ("EvalError" <> show err) *> case err of DefaultExportError{} -> pure () ExportError{} -> pure () @@ -224,15 +220,15 @@ resumingEvalError = runEvalErrorWith (\ err -> trace ("EvalError" <> show err) * RationalFormatError{} -> pure 0 FreeVariablesError names -> pure (fromMaybeLast (name "unknown") names)) -resumingUnspecialized :: (Member Trace effects, AbstractHole value) => Evaluator address value (Resumable (Unspecialized value) ': effects) a -> Evaluator address value effects a +resumingUnspecialized :: (Member Trace effects, AbstractHole value, Effects effects) => Evaluator address value (Resumable (Unspecialized value) ': effects) a -> Evaluator address value effects a resumingUnspecialized = runUnspecializedWith (\ err@(Unspecialized _) -> trace ("Unspecialized:" <> show err) $> hole) -resumingAddressError :: (AbstractHole value, Lower (Cell address value), Member Trace effects, Show address) => Evaluator address value (Resumable (AddressError address value) ': effects) a -> Evaluator address value effects a +resumingAddressError :: (AbstractHole value, Lower (Cell address value), Member Trace effects, Show address, Effects effects) => Evaluator address value (Resumable (AddressError address value) ': effects) a -> Evaluator address value effects a resumingAddressError = runAddressErrorWith (\ err -> trace ("AddressError:" <> show err) *> case err of UnallocatedAddress _ -> pure lowerBound UninitializedAddress _ -> pure hole) -resumingValueError :: (Member Trace effects, Show address) => Evaluator address (Value address body) (Resumable (ValueError address body) ': effects) a -> Evaluator address (Value address body) effects a +resumingValueError :: (Member Trace effects, Show address, Effects effects) => Evaluator address (Value address body) (Resumable (ValueError address body) ': effects) a -> Evaluator address (Value address body) effects a resumingValueError = runValueErrorWith (\ err -> trace ("ValueError" <> show err) *> case err of CallError val -> pure val StringError val -> pure (pack (show val)) @@ -248,13 +244,18 @@ resumingValueError = runValueErrorWith (\ err -> trace ("ValueError" <> show err KeyValueError{} -> pure (hole, hole) ArithmeticError{} -> pure hole) -resumingEnvironmentError :: AbstractHole address => Evaluator address value (Resumable (EnvironmentError address) ': effects) a -> Evaluator address value effects (a, [Name]) +resumingEnvironmentError :: (AbstractHole address, Effects effects) => Evaluator address value (Resumable (EnvironmentError address) ': effects) a -> Evaluator address value effects ([Name], a) resumingEnvironmentError = runState [] . reinterpret (\ (Resumable (FreeVariable name)) -> modify' (name :) $> hole) -resumingTypeError :: (Alternative (m address Type effects), Effectful (m address Type), Member Trace effects) - => m address Type (Resumable TypeError ': effects) a +resumingTypeError :: ( Alternative (m address Type (State TypeMap ': effects)) + , Effects effects + , Effectful (m address Type) + , Member Trace effects + ) + => m address Type (Resumable TypeError ': State TypeMap ': effects) a -> m address Type effects a -resumingTypeError = runTypeErrorWith (\err -> trace ("TypeError " <> show err) *> case err of - UnificationError l r -> pure l <|> pure r) +resumingTypeError = runTypesWith (\err -> trace ("TypeError " <> show err) *> case err of + UnificationError l r -> pure l <|> pure r + InfiniteType _ r -> pure r) diff --git a/src/Semantic/IO.hs b/src/Semantic/IO.hs index 05f9480dd..445f294de 100644 --- a/src/Semantic/IO.hs +++ b/src/Semantic/IO.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DeriveAnyClass, DeriveDataTypeable, DuplicateRecordFields, GADTs, ScopedTypeVariables, TypeOperators, UndecidableInstances #-} +{-# LANGUAGE DeriveAnyClass, DeriveDataTypeable, DuplicateRecordFields, GADTs, KindSignatures, ScopedTypeVariables, TypeOperators, UndecidableInstances #-} module Semantic.IO ( Destination(..) , Files @@ -214,14 +214,20 @@ data Source blob where data Destination = ToPath FilePath | ToHandle (Handle 'IO.WriteMode) -- | An effect to read/write 'Blob's from 'Handle's or 'FilePath's. -data Files out where - Read :: Source out -> Files out - ReadProject :: Maybe FilePath -> FilePath -> Language -> [FilePath] -> Files Project - FindFiles :: FilePath -> [String] -> [FilePath] -> Files [FilePath] - Write :: Destination -> B.Builder -> Files () +data Files (m :: * -> *) out where + Read :: Source out -> Files m out + ReadProject :: Maybe FilePath -> FilePath -> Language -> [FilePath] -> Files m Project + FindFiles :: FilePath -> [String] -> [FilePath] -> Files m [FilePath] + Write :: Destination -> B.Builder -> Files m () + +instance Effect Files where + handleState c dist (Request (Read source) k) = Request (Read source) (dist . (<$ c) . k) + handleState c dist (Request (ReadProject rootDir dir language excludeDirs) k) = Request (ReadProject rootDir dir language excludeDirs) (dist . (<$ c) . k) + handleState c dist (Request (FindFiles dir exts paths) k) = Request (FindFiles dir exts paths) (dist . (<$ c) . k) + handleState c dist (Request (Write destination builder) k) = Request (Write destination builder) (dist . (<$ c) . k) -- | Run a 'Files' effect in 'IO'. -runFiles :: (Member (Exc SomeException) effs, Member IO effs) => Eff (Files ': effs) a -> Eff effs a +runFiles :: (Member (Exc SomeException) effs, Member (Lift IO) effs, Effects effs) => Eff (Files ': effs) a -> Eff effs a runFiles = interpret $ \ files -> case files of Read (FromPath path) -> rethrowing (readBlobFromPath path) Read (FromHandle handle) -> rethrowing (readBlobsFromHandle handle) diff --git a/src/Semantic/Parse.hs b/src/Semantic/Parse.hs index 579e3fdb1..d8e2791ec 100644 --- a/src/Semantic/Parse.hs +++ b/src/Semantic/Parse.hs @@ -16,16 +16,34 @@ import Rendering.Renderer import Semantic.IO (noLanguageForBlob) import Semantic.Task import Serializing.Format +import qualified Language.Ruby.Assignment as Ruby +import qualified Language.TypeScript.Assignment as TypeScript +import qualified Language.JSON.Assignment as JSON -runParse :: (Member (Distribute WrappedTask) effs, Member Task effs) => TermRenderer output -> [Blob] -> Eff effs Builder +runParse :: (Member Distribute effs, Member (Exc SomeException) effs, Member Task effs) => TermRenderer output -> [Blob] -> Eff effs Builder runParse JSONTermRenderer = withParsedBlobs (render . renderJSONTerm) >=> serialize JSON runParse SExpressionTermRenderer = withParsedBlobs (const (serialize (SExpression ByConstructorName))) runParse ShowTermRenderer = withParsedBlobs (const (serialize Show)) runParse (SymbolsTermRenderer fields) = withParsedBlobs (\ blob -> decorate (declarationAlgebra blob) >=> render (renderSymbolTerms . renderToSymbols fields blob)) >=> serialize JSON runParse DOTTermRenderer = withParsedBlobs (const (render renderTreeGraph)) >=> serialize (DOT (termStyle "terms")) -withParsedBlobs :: (Member (Distribute WrappedTask) effs, Monoid output) => (forall syntax . (ConstructorName syntax, Foldable syntax, Functor syntax, HasDeclaration syntax, HasPackageDef syntax, Show1 syntax, ToJSONFields1 syntax) => Blob -> Term syntax (Record Location) -> TaskEff output) -> [Blob] -> Eff effs output -withParsedBlobs render = distributeFoldMap (\ blob -> WrapTask (parseSomeBlob blob >>= withSomeTerm (render blob))) +runRubyParse :: (Member Distribute effs, Member Task effs) => [Blob] -> Eff effs [Term (Sum Ruby.Syntax) ()] +runRubyParse = flip distributeFor (\ blob -> do + term <- parse rubyParser blob + pure (() <$ term)) + +runTypeScriptParse :: (Member Distribute effs, Member Task effs) => [Blob] -> Eff effs [Term (Sum TypeScript.Syntax) ()] +runTypeScriptParse = flip distributeFor (\ blob -> do + term <- parse typescriptParser blob + pure (() <$ term)) + +runJSONParse :: (Member Distribute effs, Member Task effs) => [Blob] -> Eff effs [Term (Sum JSON.Syntax) ()] +runJSONParse = flip distributeFor (\ blob -> do + term <- parse jsonParser blob + pure (() <$ term)) + +withParsedBlobs :: (Member Distribute effs, Member (Exc SomeException) effs, Member Task effs, Monoid output) => (forall syntax . (ConstructorName syntax, Foldable syntax, Functor syntax, HasDeclaration syntax, HasPackageDef syntax, Show1 syntax, ToJSONFields1 syntax) => Blob -> Term syntax (Record Location) -> Eff effs output) -> [Blob] -> Eff effs output +withParsedBlobs render = distributeFoldMap (\ blob -> parseSomeBlob blob >>= withSomeTerm (render blob)) parseSomeBlob :: (Member (Exc SomeException) effs, Member Task effs) => Blob -> Eff effs (SomeTerm '[ConstructorName, Foldable, Functor, HasDeclaration, HasPackageDef, Show1, ToJSONFields1] (Record Location)) parseSomeBlob blob@Blob{..} = maybe (noLanguageForBlob blobPath) (`parse` blob) (someParser blobLanguage) diff --git a/src/Semantic/Resolution.hs b/src/Semantic/Resolution.hs index 438af10c3..62ed86246 100644 --- a/src/Semantic/Resolution.hs +++ b/src/Semantic/Resolution.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE ConstraintKinds, GADTs, ScopedTypeVariables, TypeOperators, UndecidableInstances #-} +{-# LANGUAGE ConstraintKinds, GADTs, KindSignatures, ScopedTypeVariables, TypeOperators, UndecidableInstances #-} module Semantic.Resolution where import Control.Monad.Effect @@ -35,11 +35,15 @@ resolutionMap Project{..} = case projectLanguage of JavaScript -> send (NodeJSResolution projectRootDir "main" projectExcludeDirs) _ -> send NoResolution -data Resolution output where - NodeJSResolution :: FilePath -> Text -> [FilePath] -> Resolution (Map FilePath FilePath) - NoResolution :: Resolution (Map FilePath FilePath) +data Resolution (m :: * -> *) output where + NodeJSResolution :: FilePath -> Text -> [FilePath] -> Resolution m (Map FilePath FilePath) + NoResolution :: Resolution m (Map FilePath FilePath) -runResolution :: Member Files effs => Eff (Resolution ': effs) a -> Eff effs a +instance Effect Resolution where + handleState c dist (Request (NodeJSResolution path key paths) k) = Request (NodeJSResolution path key paths) (dist . (<$ c) . k) + handleState c dist (Request NoResolution k) = Request NoResolution (dist . (<$ c) . k) + +runResolution :: (Member Files effs, Effects effs) => Eff (Resolution ': effs) a -> Eff effs a runResolution = interpret $ \ res -> case res of NodeJSResolution dir prop excludeDirs -> nodeJSResolutionMap dir prop excludeDirs - NoResolution -> pure Map.empty + NoResolution -> pure Map.empty diff --git a/src/Semantic/Task.hs b/src/Semantic/Task.hs index 277367372..cb1cf6266 100644 --- a/src/Semantic/Task.hs +++ b/src/Semantic/Task.hs @@ -1,8 +1,7 @@ -{-# LANGUAGE ConstraintKinds, GADTs, GeneralizedNewtypeDeriving, ScopedTypeVariables, TypeOperators #-} +{-# LANGUAGE ConstraintKinds, GADTs, KindSignatures, ScopedTypeVariables, TypeOperators #-} module Semantic.Task ( Task , TaskEff -, WrappedTask(..) , Level(..) , RAlgebra -- * I/O @@ -43,6 +42,7 @@ module Semantic.Task , Distribute , Eff , Exc +, Lift , throwError , SomeException , Telemetry @@ -50,6 +50,7 @@ module Semantic.Task import Analysis.Decorator (decoratorWithAlgebra) import qualified Assigning.Assignment as Assignment +import qualified Assigning.Assignment.Deterministic as Deterministic import qualified Control.Abstract as Analysis import Control.Monad import Control.Monad.Effect @@ -62,6 +63,7 @@ import Data.ByteString.Builder import Data.Diff import qualified Data.Error as Error import Data.Record +import Data.Source (Source) import Data.Sum import qualified Data.Syntax as Syntax import Data.Term @@ -80,19 +82,16 @@ import Serializing.Format hiding (Options) import System.Exit (die) -- | A high-level task producing some result, e.g. parsing, diffing, rendering. 'Task's can also specify explicit concurrency via 'distribute', 'distributeFor', and 'distributeFoldMap' -type TaskEff = Eff '[Distribute WrappedTask - , Task +type TaskEff = Eff '[ Task , Resolution , IO.Files , Reader Config , Trace , Telemetry , Exc SomeException - , IO] - --- | A wrapper for a 'Task', to embed in other effects. -newtype WrappedTask a = WrapTask { unwrapTask :: TaskEff a } - deriving (Applicative, Functor, Monad) + , Distribute + , Lift IO + ] -- | A function to render terms or diffs. type Renderer i o = i -> o @@ -139,33 +138,43 @@ runTaskWithConfig :: Config -> LogQueue -> StatQueue -> TaskEff a -> IO (Either runTaskWithConfig options logger statter task = do (result, stat) <- withTiming "run" [] $ do let run :: TaskEff a -> IO (Either SomeException a) - run = runM . runError - . runTelemetry logger statter - . runTraceInTelemetry - . runReader options - . IO.runFiles - . runResolution - . runTaskF - . runDistribute (run . unwrapTask) + run + = runM + . runDistribute + . runError + . runTelemetry logger statter + . runTraceInTelemetry + . runReader options + . IO.runFiles + . runResolution + . runTaskF run task queueStat statter stat pure result -runTraceInTelemetry :: Member Telemetry effects => Eff (Trace ': effects) a -> Eff effects a +runTraceInTelemetry :: (Member Telemetry effects, Effects effects) => Eff (Trace ': effects) a -> Eff effects a runTraceInTelemetry = interpret (\ (Trace str) -> writeLog Debug str []) -- | An effect describing high-level tasks to be performed. -data Task output where - Parse :: Parser term -> Blob -> Task term - Analyze :: (Analysis.TermEvaluator term address value effects a -> result) -> Analysis.TermEvaluator term address value effects a -> Task result - Decorate :: Functor f => RAlgebra (TermF f (Record fields)) (Term f (Record fields)) field -> Term f (Record fields) -> Task (Term f (Record (field ': fields))) - Diff :: (Diffable syntax, Eq1 syntax, Hashable1 syntax, Traversable syntax) => These (Term syntax (Record fields1)) (Term syntax (Record fields2)) -> Task (Diff syntax (Record fields1) (Record fields2)) - Render :: Renderer input output -> input -> Task output - Serialize :: Format input -> input -> Task Builder +data Task (m :: * -> *) output where + Parse :: Parser term -> Blob -> Task m term + Analyze :: (Analysis.TermEvaluator term address value effects a -> result) -> Analysis.TermEvaluator term address value effects a -> Task m result + Decorate :: Functor f => RAlgebra (TermF f (Record fields)) (Term f (Record fields)) field -> Term f (Record fields) -> Task m (Term f (Record (field ': fields))) + Diff :: (Diffable syntax, Eq1 syntax, Hashable1 syntax, Traversable syntax) => These (Term syntax (Record fields1)) (Term syntax (Record fields2)) -> Task m (Diff syntax (Record fields1) (Record fields2)) + Render :: Renderer input output -> input -> Task m output + Serialize :: Format input -> input -> Task m Builder + +instance Effect Task where + handleState c dist (Request (Parse parser blob) k) = Request (Parse parser blob) (dist . (<$ c) . k) + handleState c dist (Request (Analyze run analysis) k) = Request (Analyze run analysis) (dist . (<$ c) . k) + handleState c dist (Request (Decorate decorator term) k) = Request (Decorate decorator term) (dist . (<$ c) . k) + handleState c dist (Request (Semantic.Task.Diff terms) k) = Request (Semantic.Task.Diff terms) (dist . (<$ c) . k) + handleState c dist (Request (Render renderer input) k) = Request (Render renderer input) (dist . (<$ c) . k) + handleState c dist (Request (Serialize format input) k) = Request (Serialize format input) (dist . (<$ c) . k) -- | Run a 'Task' effect by performing the actions in 'IO'. -runTaskF :: (Member (Exc SomeException) effs, Member IO effs, Member (Reader Config) effs, Member Telemetry effs, Member Trace effs) => Eff (Task ': effs) a -> Eff effs a +runTaskF :: (Member (Exc SomeException) effs, Member (Lift IO) effs, Member (Reader Config) effs, Member Telemetry effs, Member Trace effs, Effects effs) => Eff (Task ': effs) a -> Eff effs a runTaskF = interpret $ \ task -> case task of Parse parser blob -> runParser blob parser Analyze interpret analysis -> pure (interpret analysis) @@ -186,7 +195,7 @@ data ParserCancelled = ParserTimedOut deriving (Show, Typeable) instance Exception ParserCancelled -- | Parse a 'Blob' in 'IO'. -runParser :: (Member (Exc SomeException) effs, Member IO effs, Member (Reader Config) effs, Member Telemetry effs, Member Trace effs) => Blob -> Parser term -> Eff effs term +runParser :: (Member (Exc SomeException) effs, Member (Lift IO) effs, Member (Reader Config) effs, Member Telemetry effs, Member Trace effs) => Blob -> Parser term -> Eff effs term runParser blob@Blob{..} parser = case parser of ASTParser language -> time "parse.tree_sitter_ast_parse" languageTag $ do @@ -194,29 +203,9 @@ runParser blob@Blob{..} parser = case parser of parseToAST (configTreeSitterParseTimeout config) language blob >>= maybeM (throwError (SomeException ParserTimedOut)) - AssignmentParser parser assignment -> do - ast <- runParser blob parser `catchError` \ (SomeException err) -> do - writeStat (increment "parse.parse_failures" languageTag) - writeLog Error "failed parsing" (("task", "parse") : blobFields) - throwError (toException err) - config <- ask - time "parse.assign" languageTag $ - case Assignment.assign blobSource assignment ast of - Left err -> do - writeStat (increment "parse.assign_errors" languageTag) - logError config Error blob err (("task", "assign") : blobFields) - throwError (toException err) - Right term -> do - for_ (errors term) $ \ err -> case Error.errorActual err of - Just "ParseError" -> do - writeStat (increment "parse.parse_errors" languageTag) - logError config Warning blob err (("task", "parse") : blobFields) - _ -> do - writeStat (increment "parse.assign_warnings" languageTag) - logError config Warning blob err (("task", "assign") : blobFields) - when (optionsFailOnWarning (configOptions config)) $ throwError (toException err) - writeStat (count "parse.nodes" (length term) languageTag) - pure term + AssignmentParser parser assignment -> runAssignment Assignment.assign parser assignment + DeterministicParser parser assignment -> runAssignment Deterministic.assign parser assignment + MarkdownParser -> time "parse.cmark_parse" languageTag $ let term = cmarkParser blobSource @@ -228,3 +217,38 @@ runParser blob@Blob{..} parser = case parser of errors = cata $ \ (In a syntax) -> case syntax of _ | Just err@Syntax.Error{} <- project syntax -> [Syntax.unError (getField a) err] _ -> fold syntax + runAssignment :: ( Apply Foldable syntaxes + , Apply Functor syntaxes + , Element Syntax.Error syntaxes + , Member (Exc SomeException) effs + , Member (Lift IO) effs + , Member (Reader Config) effs + , Member Telemetry effs + , Member Trace effs + ) + => (Source -> assignment (Term (Sum syntaxes) (Record Assignment.Location)) -> ast -> Either (Error.Error String) (Term (Sum syntaxes) (Record Assignment.Location))) + -> Parser ast + -> assignment (Term (Sum syntaxes) (Record Assignment.Location)) + -> Eff effs (Term (Sum syntaxes) (Record Assignment.Location)) + runAssignment assign parser assignment = do + ast <- runParser blob parser `catchError` \ (SomeException err) -> do + writeStat (increment "parse.parse_failures" languageTag) + writeLog Error "failed parsing" (("task", "parse") : blobFields) + throwError (toException err) + config <- ask + time "parse.assign" languageTag $ + case assign blobSource assignment ast of + Left err -> do + writeStat (increment "parse.assign_errors" languageTag) + logError config Error blob err (("task", "assign") : blobFields) + throwError (toException err) + Right term -> do + for_ (errors term) $ \ err -> case Error.errorActual err of + Just "ParseError" -> do + writeStat (increment "parse.parse_errors" languageTag) + logError config Warning blob err (("task", "parse") : blobFields) + _ -> do + writeStat (increment "parse.assign_warnings" languageTag) + logError config Warning blob err (("task", "assign") : blobFields) + when (optionsFailOnWarning (configOptions config)) $ throwError (toException err) + term <$ writeStat (count "parse.nodes" (length term) languageTag) diff --git a/src/Semantic/Telemetry.hs b/src/Semantic/Telemetry.hs index cf67db6b7..e42152619 100644 --- a/src/Semantic/Telemetry.hs +++ b/src/Semantic/Telemetry.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE GADTs, RankNTypes, TypeOperators, UndecidableInstances #-} +{-# LANGUAGE GADTs, KindSignatures, RankNTypes, TypeOperators, UndecidableInstances #-} module Semantic.Telemetry ( -- Async telemetry interface @@ -122,25 +122,29 @@ writeStat :: Member Telemetry effs => Stat -> Eff effs () writeStat stat = send (WriteStat stat) -- | A task which measures and stats the timing of another task. -time :: (Member IO effs, Member Telemetry effs) => String -> [(String, String)] -> Eff effs output -> Eff effs output +time :: (Member (Lift IO) effs, Member Telemetry effs) => String -> [(String, String)] -> Eff effs output -> Eff effs output time statName tags task = do (a, stat) <- withTiming statName tags task a <$ writeStat stat -- | Statting and logging effects. -data Telemetry output where - WriteStat :: Stat -> Telemetry () - WriteLog :: Level -> String -> [(String, String)] -> Telemetry () +data Telemetry (m :: * -> *) output where + WriteStat :: Stat -> Telemetry m () + WriteLog :: Level -> String -> [(String, String)] -> Telemetry m () + +instance Effect Telemetry where + handleState c dist (Request (WriteStat stat) k) = Request (WriteStat stat) (dist . (<$ c) . k) + handleState c dist (Request (WriteLog level message pairs) k) = Request (WriteLog level message pairs) (dist . (<$ c) . k) -- | Run a 'Telemetry' effect by expecting a 'Reader' of 'Queue's to write stats and logs to. -runTelemetry :: Member IO effects => LogQueue -> StatQueue -> Eff (Telemetry ': effects) a -> Eff effects a +runTelemetry :: (Member (Lift IO) effects, Effects effects) => LogQueue -> StatQueue -> Eff (Telemetry ': effects) a -> Eff effects a runTelemetry logger statter = interpret (\ t -> case t of WriteStat stat -> queueStat statter stat WriteLog level message pairs -> queueLogMessage logger level message pairs) -- | Run a 'Telemetry' effect by ignoring statting/logging. -ignoreTelemetry :: Eff (Telemetry ': effs) a -> Eff effs a +ignoreTelemetry :: Effects effs => Eff (Telemetry ': effs) a -> Eff effs a ignoreTelemetry = interpret (\ t -> case t of WriteStat{} -> pure () WriteLog{} -> pure ()) diff --git a/src/Semantic/Util.hs b/src/Semantic/Util.hs index 052227828..eac134188 100644 --- a/src/Semantic/Util.hs +++ b/src/Semantic/Util.hs @@ -10,11 +10,11 @@ import Control.Abstract import Control.Monad.Effect.Trace (runPrintingTrace) import Data.Abstract.Address import Data.Abstract.Evaluatable -import Data.Abstract.Value import Data.Abstract.Module import qualified Data.Abstract.ModuleTable as ModuleTable import Data.Abstract.Package -import Data.Abstract.Type +import Data.Abstract.Value.Concrete +import Data.Abstract.Value.Type import Data.Blob import Data.Functor.Foldable import Data.Graph (topologicalSort) @@ -42,33 +42,33 @@ justEvaluating . fmap reassociate . runLoadError . runUnspecialized - . runResolutionError . runEnvironmentError . runEvalError + . runResolutionError . runAddressError . runValueError newtype UtilEff address a = UtilEff - { runUtilEff :: Eff '[ LoopControl address - , Return address + { runUtilEff :: Eff '[ Exc (LoopControl address) + , Exc (Return address) , Env address , Allocator address (Value address (UtilEff address)) , Reader ModuleInfo , Modules address - , State (ModuleTable (NonEmpty (Module (address, Environment address)))) + , Reader (ModuleTable (NonEmpty (Module (Environment address, address)))) , Reader Span , Reader PackageInfo , Resumable (ValueError address (UtilEff address)) , Resumable (AddressError address (Value address (UtilEff address))) + , Resumable ResolutionError , Resumable EvalError , Resumable (EnvironmentError address) - , Resumable ResolutionError , Resumable (Unspecialized (Value address (UtilEff address))) , Resumable (LoadError address) , Trace , Fresh , State (Heap address Latest (Value address (UtilEff address))) - , IO + , Lift IO ] a } @@ -87,7 +87,7 @@ checking . runEnvironmentError . runEvalError . runAddressError - . runTypeError + . runTypes evalGoProject = justEvaluating <=< evaluateProject (Proxy :: Proxy 'Language.Go) goParser Language.Go evalRubyProject = justEvaluating <=< evaluateProject (Proxy :: Proxy 'Language.Ruby) rubyParser Language.Ruby @@ -117,11 +117,9 @@ evaluateProject proxy parser lang paths = runTaskWithOptions debugOptions $ do pure (runTermEvaluator @_ @_ @(Value Precise (UtilEff Precise)) (runReader (packageInfo package) (runReader (lowerBound @Span) - -- FIXME: This should really be a Reader effect but for https://github.com/joshvera/effects/issues/47 - (fmap fst - (runState (lowerBound @(ModuleTable (NonEmpty (Module (Precise, Environment Precise))))) + (runReader (lowerBound @(ModuleTable (NonEmpty (Module (Environment Precise, Precise))))) (raiseHandler (runModules (ModuleTable.modulePaths (packageModules package))) - (evaluate proxy id withTermSpans modules))))))) + (evaluate proxy id withTermSpans modules)))))) evaluateProjectWithCaching proxy parser lang path = runTaskWithOptions debugOptions $ do project <- readProject Nothing path lang [] @@ -129,11 +127,9 @@ evaluateProjectWithCaching proxy parser lang path = runTaskWithOptions debugOpti modules <- topologicalSort <$> runImportGraph proxy package pure (runReader (packageInfo package) (runReader (lowerBound @Span) - -- FIXME: This should really be a Reader effect but for https://github.com/joshvera/effects/issues/47 - (fmap fst - (runState (lowerBound @(ModuleTable (NonEmpty (Module (Monovariant, Environment Monovariant))))) + (runReader (lowerBound @(ModuleTable (NonEmpty (Module (Environment Monovariant, Monovariant))))) (raiseHandler (runModules (ModuleTable.modulePaths (packageModules package))) - (evaluate proxy id withTermSpans modules)))))) + (evaluate proxy id withTermSpans modules))))) parseFile :: Parser term -> FilePath -> IO term diff --git a/test/Analysis/Go/Spec.hs b/test/Analysis/Go/Spec.hs index 415ac2a78..80bcd3a18 100644 --- a/test/Analysis/Go/Spec.hs +++ b/test/Analysis/Go/Spec.hs @@ -12,17 +12,17 @@ spec :: Spec spec = parallel $ do describe "Go" $ do it "imports and wildcard imports" $ do - ((res, heap), _) <- evaluate ["main.go", "foo/foo.go", "bar/bar.go", "bar/rab.go"] + (_, (heap, res)) <- evaluate ["main.go", "foo/foo.go", "bar/bar.go", "bar/rab.go"] case ModuleTable.lookup "main.go" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> do + Right (Just (Module _ (env, addr) :| [])) -> do Env.names env `shouldBe` [ "Bar", "Rab", "foo", "main" ] (derefQName heap ("foo" :| []) env >>= deNamespace) `shouldBe` Just ("foo", ["New"]) other -> expectationFailure (show other) it "imports with aliases (and side effects only)" $ do - ((res, heap), _) <- evaluate ["main1.go", "foo/foo.go", "bar/bar.go", "bar/rab.go"] + (_, (heap, res)) <- evaluate ["main1.go", "foo/foo.go", "bar/bar.go", "bar/rab.go"] case ModuleTable.lookup "main1.go" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> do + Right (Just (Module _ (env, addr) :| [])) -> do Env.names env `shouldBe` [ "f", "main" ] (derefQName heap ("f" :| []) env >>= deNamespace) `shouldBe` Just ("f", ["New"]) other -> expectationFailure (show other) diff --git a/test/Analysis/PHP/Spec.hs b/test/Analysis/PHP/Spec.hs index 7da92c101..6f6ef388d 100644 --- a/test/Analysis/PHP/Spec.hs +++ b/test/Analysis/PHP/Spec.hs @@ -13,25 +13,25 @@ spec :: Spec spec = parallel $ do describe "PHP" $ do it "evaluates include and require" $ do - ((res, heap), _) <- evaluate ["main.php", "foo.php", "bar.php"] + (_, (heap, res)) <- evaluate ["main.php", "foo.php", "bar.php"] case ModuleTable.lookup "main.php" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> do + Right (Just (Module _ (env, addr) :| [])) -> do heapLookupAll addr heap `shouldBe` Just [unit] Env.names env `shouldBe` [ "bar", "foo" ] other -> expectationFailure (show other) it "evaluates include_once and require_once" $ do - ((res, heap), _) <- evaluate ["main_once.php", "foo.php", "bar.php"] + (_, (heap, res)) <- evaluate ["main_once.php", "foo.php", "bar.php"] case ModuleTable.lookup "main_once.php" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> do + Right (Just (Module _ (env, addr) :| [])) -> do heapLookupAll addr heap `shouldBe` Just [unit] Env.names env `shouldBe` [ "bar", "foo" ] other -> expectationFailure (show other) it "evaluates namespaces" $ do - ((res, heap), _) <- evaluate ["namespaces.php"] + (_, (heap, res)) <- evaluate ["namespaces.php"] case ModuleTable.lookup "namespaces.php" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> do + Right (Just (Module _ (env, addr) :| [])) -> do Env.names env `shouldBe` [ "Foo", "NS1" ] (derefQName heap ("NS1" :| []) env >>= deNamespace) `shouldBe` Just ("NS1", ["Sub1", "b", "c"]) diff --git a/test/Analysis/Python/Spec.hs b/test/Analysis/Python/Spec.hs index cceabf849..6fcf647ff 100644 --- a/test/Analysis/Python/Spec.hs +++ b/test/Analysis/Python/Spec.hs @@ -3,7 +3,7 @@ module Analysis.Python.Spec (spec) where import Data.Abstract.Environment as Env import Data.Abstract.Evaluatable (EvalError(..)) import qualified Data.Abstract.ModuleTable as ModuleTable -import Data.Abstract.Value +import Data.Abstract.Value.Concrete import qualified Language.Python.Assignment as Python import qualified Data.Language as Language @@ -14,9 +14,9 @@ spec :: Spec spec = parallel $ do describe "Python" $ do it "imports" $ do - ((res, heap), _) <- evaluate ["main.py", "a.py", "b/__init__.py", "b/c.py"] + (_, (heap, res)) <- evaluate ["main.py", "a.py", "b/__init__.py", "b/c.py"] case ModuleTable.lookup "main.py" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> do + Right (Just (Module _ (env, addr) :| [])) -> do Env.names env `shouldContain` [ "a", "b" ] (derefQName heap ("a" :| []) env >>= deNamespace) `shouldBe` Just ("a", ["foo"]) @@ -25,35 +25,35 @@ spec = parallel $ do other -> expectationFailure (show other) it "imports with aliases" $ do - ((res, _), _) <- evaluate ["main1.py", "a.py", "b/__init__.py", "b/c.py"] + (_, (_, res)) <- evaluate ["main1.py", "a.py", "b/__init__.py", "b/c.py"] case ModuleTable.lookup "main1.py" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> Env.names env `shouldContain` [ "b", "e" ] + Right (Just (Module _ (env, addr) :| [])) -> Env.names env `shouldContain` [ "b", "e" ] other -> expectationFailure (show other) it "imports using 'from' syntax" $ do - ((res, _), _) <- evaluate ["main2.py", "a.py", "b/__init__.py", "b/c.py"] + (_, (_, res)) <- evaluate ["main2.py", "a.py", "b/__init__.py", "b/c.py"] case ModuleTable.lookup "main2.py" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> Env.names env `shouldContain` [ "bar", "foo" ] + Right (Just (Module _ (env, addr) :| [])) -> Env.names env `shouldContain` [ "bar", "foo" ] other -> expectationFailure (show other) it "imports with relative syntax" $ do - ((res, heap), _) <- evaluate ["main3.py", "c/__init__.py", "c/utils.py"] + (_, (heap, res)) <- evaluate ["main3.py", "c/__init__.py", "c/utils.py"] case ModuleTable.lookup "main3.py" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> do + Right (Just (Module _ (env, addr) :| [])) -> do Env.names env `shouldContain` [ "utils" ] (derefQName heap ("utils" :| []) env >>= deNamespace) `shouldBe` Just ("utils", ["to_s"]) other -> expectationFailure (show other) it "subclasses" $ do - ((res, heap), _) <- evaluate ["subclass.py"] + (_, (heap, res)) <- evaluate ["subclass.py"] case ModuleTable.lookup "subclass.py" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> heapLookupAll addr heap `shouldBe` Just [String "\"bar\""] + Right (Just (Module _ (env, addr) :| [])) -> heapLookupAll addr heap `shouldBe` Just [String "\"bar\""] other -> expectationFailure (show other) it "handles multiple inheritance left-to-right" $ do - ((res, heap), _) <- evaluate ["multiple_inheritance.py"] + (_, (heap, res)) <- evaluate ["multiple_inheritance.py"] case ModuleTable.lookup "multiple_inheritance.py" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> heapLookupAll addr heap `shouldBe` Just [String "\"foo!\""] + Right (Just (Module _ (env, addr) :| [])) -> heapLookupAll addr heap `shouldBe` Just [String "\"foo!\""] other -> expectationFailure (show other) where diff --git a/test/Analysis/Ruby/Spec.hs b/test/Analysis/Ruby/Spec.hs index e935e437e..72bb69b5f 100644 --- a/test/Analysis/Ruby/Spec.hs +++ b/test/Analysis/Ruby/Spec.hs @@ -2,9 +2,9 @@ module Analysis.Ruby.Spec (spec) where import Data.Abstract.Environment as Env import Data.Abstract.Evaluatable -import Data.Abstract.Value as Value import qualified Data.Abstract.ModuleTable as ModuleTable import Data.Abstract.Number as Number +import Data.Abstract.Value.Concrete as Value import Data.AST import Control.Monad.Effect (SomeExc(..)) import Data.List.NonEmpty (NonEmpty(..)) @@ -19,29 +19,29 @@ spec :: Spec spec = parallel $ do describe "Ruby" $ do it "evaluates require_relative" $ do - ((res, heap), _) <- evaluate ["main.rb", "foo.rb"] + (_, (heap, res)) <- evaluate ["main.rb", "foo.rb"] case ModuleTable.lookup "main.rb" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> do + Right (Just (Module _ (env, addr) :| [])) -> do heapLookupAll addr heap `shouldBe` Just [Value.Integer (Number.Integer 1)] Env.names env `shouldContain` [ "foo" ] other -> expectationFailure (show other) it "evaluates load" $ do - ((res, heap), _) <- evaluate ["load.rb", "foo.rb"] + (_, (heap, res)) <- evaluate ["load.rb", "foo.rb"] case ModuleTable.lookup "load.rb" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> do + Right (Just (Module _ (env, addr) :| [])) -> do heapLookupAll addr heap `shouldBe` Just [Value.Integer (Number.Integer 1)] Env.names env `shouldContain` [ "foo" ] other -> expectationFailure (show other) it "evaluates load with wrapper" $ do - ((res, _), _) <- evaluate ["load-wrap.rb", "foo.rb"] + (_, (_, res)) <- evaluate ["load-wrap.rb", "foo.rb"] res `shouldBe` Left (SomeExc (inject @(EnvironmentError Precise) (FreeVariable "foo"))) it "evaluates subclass" $ do - ((res, heap), _) <- evaluate ["subclass.rb"] + (_, (heap, res)) <- evaluate ["subclass.rb"] case ModuleTable.lookup "subclass.rb" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> do + Right (Just (Module _ (env, addr) :| [])) -> do heapLookupAll addr heap `shouldBe` Just [String "\"\""] Env.names env `shouldContain` [ "Bar", "Foo" ] @@ -49,53 +49,53 @@ spec = parallel $ do other -> expectationFailure (show other) it "evaluates modules" $ do - ((res, heap), _) <- evaluate ["modules.rb"] + (_, (heap, res)) <- evaluate ["modules.rb"] case ModuleTable.lookup "modules.rb" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> do + Right (Just (Module _ (env, addr) :| [])) -> do heapLookupAll addr heap `shouldBe` Just [String "\"\""] Env.names env `shouldContain` [ "Bar" ] other -> expectationFailure (show other) it "handles break correctly" $ do - ((res, heap), _) <- evaluate ["break.rb"] + (_, (heap, res)) <- evaluate ["break.rb"] case ModuleTable.lookup "break.rb" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> heapLookupAll addr heap `shouldBe` Just [Value.Integer (Number.Integer 3)] + Right (Just (Module _ (env, addr) :| [])) -> heapLookupAll addr heap `shouldBe` Just [Value.Integer (Number.Integer 3)] other -> expectationFailure (show other) it "handles next correctly" $ do - ((res, heap), _) <- evaluate ["next.rb"] + (_, (heap, res)) <- evaluate ["next.rb"] case ModuleTable.lookup "next.rb" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> heapLookupAll addr heap `shouldBe` Just [Value.Integer (Number.Integer 8)] + Right (Just (Module _ (env, addr) :| [])) -> heapLookupAll addr heap `shouldBe` Just [Value.Integer (Number.Integer 8)] other -> expectationFailure (show other) it "calls functions with arguments" $ do - ((res, heap), _) <- evaluate ["call.rb"] + (_, (heap, res)) <- evaluate ["call.rb"] case ModuleTable.lookup "call.rb" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> heapLookupAll addr heap `shouldBe` Just [Value.Integer (Number.Integer 579)] + Right (Just (Module _ (env, addr) :| [])) -> heapLookupAll addr heap `shouldBe` Just [Value.Integer (Number.Integer 579)] other -> expectationFailure (show other) it "evaluates early return statements" $ do - ((res, heap), _) <- evaluate ["early-return.rb"] + (_, (heap, res)) <- evaluate ["early-return.rb"] case ModuleTable.lookup "early-return.rb" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> heapLookupAll addr heap `shouldBe` Just [Value.Integer (Number.Integer 123)] + Right (Just (Module _ (env, addr) :| [])) -> heapLookupAll addr heap `shouldBe` Just [Value.Integer (Number.Integer 123)] other -> expectationFailure (show other) it "has prelude" $ do - ((res, heap), _) <- evaluate ["preluded.rb"] + (_, (heap, res)) <- evaluate ["preluded.rb"] case ModuleTable.lookup "preluded.rb" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> heapLookupAll addr heap `shouldBe` Just [String "\"\""] + Right (Just (Module _ (env, addr) :| [])) -> heapLookupAll addr heap `shouldBe` Just [String "\"\""] other -> expectationFailure (show other) it "evaluates __LINE__" $ do - ((res, heap), _) <- evaluate ["line.rb"] + (_, (heap, res)) <- evaluate ["line.rb"] case ModuleTable.lookup "line.rb" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> heapLookupAll addr heap `shouldBe` Just [Value.Integer (Number.Integer 4)] + Right (Just (Module _ (env, addr) :| [])) -> heapLookupAll addr heap `shouldBe` Just [Value.Integer (Number.Integer 4)] other -> expectationFailure (show other) it "resolves builtins used in the prelude" $ do - ((res, heap), traces) <- evaluate ["puts.rb"] + (traces, (heap, res)) <- evaluate ["puts.rb"] case ModuleTable.lookup "puts.rb" <$> res of - Right (Just (Module _ (addr, env) :| [])) -> do + Right (Just (Module _ (env, addr) :| [])) -> do heapLookupAll addr heap `shouldBe` Just [Unit] traces `shouldContain` [ "\"hello\"" ] other -> expectationFailure (show other) diff --git a/test/Analysis/TypeScript/Spec.hs b/test/Analysis/TypeScript/Spec.hs index 2f422ded3..fd9bb8488 100644 --- a/test/Analysis/TypeScript/Spec.hs +++ b/test/Analysis/TypeScript/Spec.hs @@ -3,9 +3,9 @@ module Analysis.TypeScript.Spec (spec) where import Control.Arrow ((&&&)) import Data.Abstract.Environment as Env import Data.Abstract.Evaluatable -import Data.Abstract.Value as Value import Data.Abstract.Number as Number import qualified Data.Abstract.ModuleTable as ModuleTable +import Data.Abstract.Value.Concrete as Value import qualified Data.Language as Language import qualified Data.List.NonEmpty as NonEmpty import Data.Sum @@ -15,15 +15,15 @@ spec :: Spec spec = parallel $ do describe "TypeScript" $ do it "imports with aliased symbols" $ do - ((res, _), _) <- evaluate ["main.ts", "foo.ts", "a.ts", "foo/b.ts"] + (_, (_, res)) <- evaluate ["main.ts", "foo.ts", "a.ts", "foo/b.ts"] case ModuleTable.lookup "main.ts" <$> res of - Right (Just (Module _ (_, env) :| [])) -> Env.names env `shouldBe` [ "bar", "quz" ] + Right (Just (Module _ (env, _) :| [])) -> Env.names env `shouldBe` [ "bar", "quz" ] other -> expectationFailure (show other) it "imports with qualified names" $ do - ((res, heap), _) <- evaluate ["main1.ts", "foo.ts", "a.ts"] + (_, (heap, res)) <- evaluate ["main1.ts", "foo.ts", "a.ts"] case ModuleTable.lookup "main1.ts" <$> res of - Right (Just (Module _ (_, env) :| [])) -> do + Right (Just (Module _ (env, _) :| [])) -> do Env.names env `shouldBe` [ "b", "z" ] (derefQName heap ("b" :| []) env >>= deNamespace) `shouldBe` Just ("b", [ "baz", "foo" ]) @@ -31,19 +31,19 @@ spec = parallel $ do other -> expectationFailure (show other) it "side effect only imports" $ do - ((res, _), _) <- evaluate ["main2.ts", "a.ts", "foo.ts"] + (_, (_, res)) <- evaluate ["main2.ts", "a.ts", "foo.ts"] case ModuleTable.lookup "main2.ts" <$> res of - Right (Just (Module _ (_, env) :| [])) -> env `shouldBe` lowerBound + Right (Just (Module _ (env, _) :| [])) -> env `shouldBe` lowerBound other -> expectationFailure (show other) it "fails exporting symbols not defined in the module" $ do - ((res, _), _) <- evaluate ["bad-export.ts", "pip.ts", "a.ts", "foo.ts"] + (_, (_, res)) <- evaluate ["bad-export.ts", "pip.ts", "a.ts", "foo.ts"] res `shouldBe` Left (SomeExc (inject @EvalError (ExportError "foo.ts" (name "pip")))) it "evaluates early return statements" $ do - ((res, heap), _) <- evaluate ["early-return.ts"] + (_, (heap, res)) <- evaluate ["early-return.ts"] case ModuleTable.lookup "early-return.ts" <$> res of - Right (Just (Module _ (addr, _) :| [])) -> heapLookupAll addr heap `shouldBe` Just [Value.Float (Number.Decimal 123.0)] + Right (Just (Module _ (_, addr) :| [])) -> heapLookupAll addr heap `shouldBe` Just [Value.Float (Number.Decimal 123.0)] other -> expectationFailure (show other) where diff --git a/test/Control/Abstract/Evaluator/Spec.hs b/test/Control/Abstract/Evaluator/Spec.hs index 0d54f31b9..72f9ea1d4 100644 --- a/test/Control/Abstract/Evaluator/Spec.hs +++ b/test/Control/Abstract/Evaluator/Spec.hs @@ -8,7 +8,7 @@ import Control.Abstract import Data.Abstract.Module import qualified Data.Abstract.Number as Number import Data.Abstract.Package -import Data.Abstract.Value as Value +import Data.Abstract.Value.Concrete as Value import Data.Algebra import Data.Bifunctor (first) import Data.Functor.Const @@ -18,11 +18,11 @@ import SpecHelpers hiding (reassociate) spec :: Spec spec = parallel $ do it "constructs integers" $ do - (expected, _) <- evaluate (box (integer 123)) + (_, expected) <- evaluate (box (integer 123)) expected `shouldBe` Right (Value.Integer (Number.Integer 123)) it "calls functions" $ do - (expected, _) <- evaluate $ do + (_, expected) <- evaluate $ do identity <- closure [name "x"] lowerBound (variable (name "x")) call identity [box (integer 123)] expected `shouldBe` Right (Value.Integer (Number.Integer 123)) @@ -38,7 +38,7 @@ evaluate . runEnvironmentError . runAddressError . runAllocator @Precise @_ @Val - . (>>= deref . fst) + . (>>= deref . snd) . runEnv lowerBound . runReturn . runLoopControl @@ -48,8 +48,8 @@ reassociate = mergeExcs . mergeExcs . mergeExcs . Right type Val = Value Precise SpecEff newtype SpecEff a = SpecEff - { runSpecEff :: Eff '[ LoopControl Precise - , Return Precise + { runSpecEff :: Eff '[ Exc (LoopControl Precise) + , Exc (Return Precise) , Env Precise , Allocator Precise Val , Resumable (AddressError Precise Val) @@ -59,6 +59,6 @@ newtype SpecEff a = SpecEff , Reader PackageInfo , Fresh , State (Heap Precise Latest Val) - , IO + , Lift IO ] a } diff --git a/test/Data/Functor/Listable.hs b/test/Data/Functor/Listable.hs index 095ae4518..891389588 100644 --- a/test/Data/Functor/Listable.hs +++ b/test/Data/Functor/Listable.hs @@ -44,9 +44,13 @@ import Data.Semigroup (Semigroup(..)) import Data.Source import Data.Span import qualified Data.Syntax as Syntax +import qualified Data.Syntax.Literal as Literal import qualified Data.Syntax.Comment as Comment import qualified Data.Syntax.Declaration as Declaration +import qualified Data.Syntax.Directive as Directive import qualified Data.Syntax.Statement as Statement +import qualified Data.Syntax.Expression as Expression +import qualified Language.Ruby.Syntax as Ruby.Syntax import qualified Data.Abstract.Name as Name import Data.Term import Data.Text as T (Text, pack) @@ -246,6 +250,226 @@ instance Listable1 Syntax.Empty where instance Listable1 Syntax.Identifier where liftTiers _ = cons1 Syntax.Identifier +instance Listable1 Literal.KeyValue where + liftTiers tiers = liftCons2 tiers tiers Literal.KeyValue + +instance Listable1 Literal.Array where + liftTiers tiers = liftCons1 (liftTiers tiers) Literal.Array + +instance Listable1 Literal.Boolean where + liftTiers tiers = cons1 Literal.Boolean + +instance Listable1 Literal.Hash where + liftTiers tiers = liftCons1 (liftTiers tiers) Literal.Hash + +instance Listable1 Literal.Float where + liftTiers tiers = cons1 Literal.Float + +instance Listable1 Literal.Null where + liftTiers tiers = cons0 Literal.Null + +instance Listable1 Literal.TextElement where + liftTiers tiers = cons1 Literal.TextElement + +instance Listable1 Statement.Statements where + liftTiers tiers = liftCons1 (liftTiers tiers) Statement.Statements + +instance Listable1 Syntax.Error where + liftTiers tiers = liftCons4 mempty mempty mempty (liftTiers tiers) Syntax.Error + +instance Listable1 Directive.File where + liftTiers tiers = cons0 Directive.File + +instance Listable1 Directive.Line where + liftTiers tiers = cons0 Directive.Line + +instance Listable1 Expression.Plus where + liftTiers tiers = liftCons2 tiers tiers Expression.Plus + +instance Listable1 Expression.Minus where + liftTiers tiers = liftCons2 tiers tiers Expression.Minus + +instance Listable1 Expression.Times where + liftTiers tiers = liftCons2 tiers tiers Expression.Times + +instance Listable1 Expression.DividedBy where + liftTiers tiers = liftCons2 tiers tiers Expression.DividedBy + +instance Listable1 Expression.FloorDivision where + liftTiers tiers = liftCons2 tiers tiers Expression.FloorDivision + +instance Listable1 Expression.Modulo where + liftTiers tiers = liftCons2 tiers tiers Expression.Modulo + +instance Listable1 Expression.Power where + liftTiers tiers = liftCons2 tiers tiers Expression.Power + +instance Listable1 Expression.Negate where + liftTiers tiers = liftCons1 tiers Expression.Negate + +instance Listable1 Expression.BOr where + liftTiers tiers = liftCons2 tiers tiers Expression.BOr + +instance Listable1 Expression.BAnd where + liftTiers tiers = liftCons2 tiers tiers Expression.BAnd + +instance Listable1 Expression.BXOr where + liftTiers tiers = liftCons2 tiers tiers Expression.BXOr + +instance Listable1 Expression.LShift where + liftTiers tiers = liftCons2 tiers tiers Expression.LShift + +instance Listable1 Expression.RShift where + liftTiers tiers = liftCons2 tiers tiers Expression.RShift + +instance Listable1 Expression.UnsignedRShift where + liftTiers tiers = liftCons2 tiers tiers Expression.UnsignedRShift + +instance Listable1 Expression.Complement where + liftTiers tiers = liftCons1 tiers Expression.Complement + +instance Listable1 Expression.Or where + liftTiers tiers = liftCons2 tiers tiers Expression.Or + +instance Listable1 Expression.And where + liftTiers tiers = liftCons2 tiers tiers Expression.And + +instance Listable1 Expression.Not where + liftTiers tiers = liftCons1 tiers Expression.Not + +instance Listable1 Expression.XOr where + liftTiers tiers = liftCons2 tiers tiers Expression.XOr + +instance Listable1 Expression.Call where + liftTiers tiers = liftCons4 (liftTiers tiers) tiers (liftTiers tiers) tiers Expression.Call + +instance Listable1 Expression.LessThan where + liftTiers tiers = liftCons2 tiers tiers Expression.LessThan + +instance Listable1 Expression.LessThanEqual where + liftTiers tiers = liftCons2 tiers tiers Expression.LessThanEqual + +instance Listable1 Expression.GreaterThan where + liftTiers tiers = liftCons2 tiers tiers Expression.GreaterThan + +instance Listable1 Expression.GreaterThanEqual where + liftTiers tiers = liftCons2 tiers tiers Expression.GreaterThanEqual + +instance Listable1 Expression.Equal where + liftTiers tiers = liftCons2 tiers tiers Expression.Equal + +instance Listable1 Expression.StrictEqual where + liftTiers tiers = liftCons2 tiers tiers Expression.StrictEqual + +instance Listable1 Expression.Comparison where + liftTiers tiers = liftCons2 tiers tiers Expression.Comparison + +instance Listable1 Expression.Enumeration where + liftTiers tiers = liftCons3 tiers tiers tiers Expression.Enumeration + +instance Listable1 Expression.Matches where + liftTiers tiers = liftCons2 tiers tiers Expression.Matches + +instance Listable1 Expression.NotMatches where + liftTiers tiers = liftCons2 tiers tiers Expression.NotMatches + +instance Listable1 Expression.MemberAccess where + liftTiers tiers = liftCons2 tiers mempty Expression.MemberAccess + +instance Listable1 Expression.ScopeResolution where + liftTiers tiers = liftCons1 (liftTiers tiers) Expression.ScopeResolution + +instance Listable1 Expression.Subscript where + liftTiers tiers = liftCons2 tiers (liftTiers tiers) Expression.Subscript + +instance Listable1 Expression.Member where + liftTiers tiers = liftCons2 tiers tiers Expression.Member + +instance Listable1 Literal.Complex where + liftTiers tiers = cons1 Literal.Complex + +instance Listable1 Literal.Integer where + liftTiers tiers = cons1 Literal.Integer + +instance Listable1 Literal.Rational where + liftTiers tiers = cons1 Literal.Rational + +instance Listable1 Literal.Regex where + liftTiers tiers = cons1 Literal.Regex + +instance Listable1 Literal.String where + liftTiers tiers = liftCons1 (liftTiers tiers) Literal.String + +instance Listable1 Literal.Symbol where + liftTiers tiers = cons1 Literal.Symbol + +instance Listable1 Statement.Assignment where + liftTiers tiers = liftCons3 (liftTiers tiers) tiers tiers Statement.Assignment + +instance Listable1 Statement.Break where + liftTiers tiers = liftCons1 tiers Statement.Break + +instance Listable1 Statement.Catch where + liftTiers tiers = liftCons2 tiers tiers Statement.Catch + +instance Listable1 Statement.Continue where + liftTiers tiers = liftCons1 tiers Statement.Continue + +instance Listable1 Statement.Else where + liftTiers tiers = liftCons2 tiers tiers Statement.Else + +instance Listable1 Statement.Finally where + liftTiers tiers = liftCons1 tiers Statement.Finally + +instance Listable1 Statement.ForEach where + liftTiers tiers = liftCons3 tiers tiers tiers Statement.ForEach + +instance Listable1 Statement.Match where + liftTiers tiers = liftCons2 tiers tiers Statement.Match + +instance Listable1 Statement.Pattern where + liftTiers tiers = liftCons2 tiers tiers Statement.Pattern + +instance Listable1 Statement.Retry where + liftTiers tiers = liftCons1 tiers Statement.Retry + +instance Listable1 Statement.ScopeEntry where + liftTiers tiers = liftCons1 (liftTiers tiers) Statement.ScopeEntry + +instance Listable1 Statement.ScopeExit where + liftTiers tiers = liftCons1 (liftTiers tiers) Statement.ScopeExit + +instance Listable1 Statement.Try where + liftTiers tiers = liftCons2 tiers (liftTiers tiers) Statement.Try + +instance Listable1 Statement.While where + liftTiers tiers = liftCons2 tiers tiers Statement.While + +instance Listable1 Statement.Yield where + liftTiers tiers = liftCons1 tiers Statement.Yield + +instance Listable1 Ruby.Syntax.Class where + liftTiers tiers = liftCons3 tiers (liftTiers tiers) tiers Ruby.Syntax.Class + +instance Listable1 Ruby.Syntax.Load where + liftTiers tiers = liftCons2 tiers (liftTiers tiers) Ruby.Syntax.Load + +instance Listable1 Ruby.Syntax.LowPrecedenceOr where + liftTiers tiers = liftCons2 tiers tiers Ruby.Syntax.LowPrecedenceOr + +instance Listable1 Ruby.Syntax.LowPrecedenceAnd where + liftTiers tiers = liftCons2 tiers tiers Ruby.Syntax.LowPrecedenceAnd + +instance Listable1 Ruby.Syntax.Module where + liftTiers tiers = liftCons2 tiers (liftTiers tiers) Ruby.Syntax.Module + +instance Listable1 Ruby.Syntax.Require where + liftTiers tiers' = liftCons2 tiers tiers' Ruby.Syntax.Require + +instance Listable1 Ruby.Syntax.Send where + liftTiers tiers = liftCons4 (liftTiers tiers) (liftTiers tiers) (liftTiers tiers) (liftTiers tiers) Ruby.Syntax.Send + + type ListableSyntax = Sum '[ Comment.Comment , Declaration.Function @@ -297,7 +521,6 @@ instance Listable Pos where instance Listable Span where tiers = cons2 Span - instance Listable Source where tiers = fromUTF8 `mapT` tiers diff --git a/test/Proto3/Roundtrip.hs b/test/Proto3/Roundtrip.hs index 364e2598a..37c095564 100644 --- a/test/Proto3/Roundtrip.hs +++ b/test/Proto3/Roundtrip.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeApplications, ScopedTypeVariables #-} module Proto3.Roundtrip (spec) where @@ -9,17 +9,69 @@ import qualified Data.ByteString.Lazy as L import Data.Source import Proto3.Suite import qualified Proto3.Wire.Encode as E +import qualified Data.Syntax.Literal as Literal +import qualified Data.Syntax.Statement as Statement +import qualified Data.Syntax.Declaration as Declaration +import Data.Term (Term) +import Data.Sum +import Language.JSON.Assignment (Syntax) +import qualified Language.Ruby.Assignment as Ruby +import Data.Functor.Classes shouldRoundtrip :: (Eq a, Show a, Message a) => a -> Expectation shouldRoundtrip a = go a `shouldBe` Right a where go = fromByteString . L.toStrict . toLazyByteString +shouldRoundtrip1 :: forall f a. (Show (f a), Eq (f a), Show1 f, Eq1 f, Eq a, Show a, Message1 f, Message a) => f a -> Expectation +shouldRoundtrip1 a = go a `shouldBe` Right a + where go = fromByteString1 . L.toStrict . toLazyByteString1 + spec :: Spec spec = parallel $ do describe "spans" $ prop "roundtrips" $ \sp -> shouldRoundtrip @Span sp + describe "nulls" $ + prop "roundtrips" $ + \sp -> shouldRoundtrip1 @Literal.Null @(Term (Sum Syntax) ()) (unListableF sp) + + describe "text elements" $ + prop "roundtrips" $ + \sp -> shouldRoundtrip1 @Literal.TextElement @(Term (Sum Syntax) ()) (unListableF sp) + + describe "floats" $ + prop "roundtrips" $ + \sp -> shouldRoundtrip1 @Literal.Float @(Term (Sum Syntax) ()) (unListableF sp) + + describe "booleans" $ + prop "roundtrips" $ + \sp -> shouldRoundtrip1 @Literal.Boolean @(Term (Sum Syntax) ()) (unListableF sp) + + describe "terms of syntax" $ + prop "roundtrips" $ + \sp -> shouldRoundtrip @(Term (Sum Syntax) ()) (unListableF sp) + + describe "arrays" $ + prop "roundtrips" $ + \sp -> shouldRoundtrip1 @Literal.Array @(Term (Sum Syntax) ()) (unListableF sp) + + describe "key values" $ + prop "roundtrips" $ + \sp -> shouldRoundtrip1 @Literal.KeyValue @(Term (Sum Syntax) ()) (unListableF sp) + + describe "statements" $ + prop "roundtrips" $ + \sp -> shouldRoundtrip @(Term (Sum Syntax) ()) (unListableF sp) + + describe "statements1" $ + prop "roundtrips" $ + \sp -> shouldRoundtrip1 @Statement.Statements @(Term (Sum Syntax) ()) (unListableF sp) + + describe "methods" $ + prop "roundtrips" $ + \sp -> shouldRoundtrip1 @Declaration.Method @(Term (Sum Syntax) ()) (unListableF sp) + describe "blobs" $ do it "should roundtrip given a Message instance" $ do let bl = Blob (fromUTF8 "puts 'hi'") "example.rb" Ruby diff --git a/test/Rendering/TOC/Spec.hs b/test/Rendering/TOC/Spec.hs index 9c57eb843..cad8fc354 100644 --- a/test/Rendering/TOC/Spec.hs +++ b/test/Rendering/TOC/Spec.hs @@ -242,10 +242,10 @@ diffWithParser :: ( HasField fields Data.Span.Span , Diffable syntax , HasDeclaration syntax , Hashable1 syntax - , Member (Distribute WrappedTask) effs + , Member Distribute effs , Member Task effs ) => Parser (Term syntax (Record fields)) -> BlobPair -> Eff effs (Diff syntax (Record (Maybe Declaration ': fields)) (Record (Maybe Declaration ': fields))) -diffWithParser parser blobs = distributeFor blobs (\ blob -> WrapTask $ parse parser blob >>= decorate (declarationAlgebra blob)) >>= SpecHelpers.diff . runJoin +diffWithParser parser blobs = distributeFor blobs (\ blob -> parse parser blob >>= decorate (declarationAlgebra blob)) >>= SpecHelpers.diff . runJoin diff --git a/test/SpecHelpers.hs b/test/SpecHelpers.hs index c156b6326..1eeed7dd6 100644 --- a/test/SpecHelpers.hs +++ b/test/SpecHelpers.hs @@ -27,7 +27,7 @@ import Data.Abstract.Heap as X import Data.Abstract.Module as X import Data.Abstract.ModuleTable as X hiding (lookup) import Data.Abstract.Name as X -import Data.Abstract.Value (Value(..), ValueError, runValueError) +import Data.Abstract.Value.Concrete (Value(..), ValueError, runValueError) import Data.Bifunctor (first) import Data.Blob as X import Data.ByteString.Builder (toLazyByteString) @@ -91,43 +91,44 @@ readFilePair paths = let paths' = fmap file paths in type TestEvaluatingEffects = '[ Resumable (ValueError Precise (UtilEff Precise)) , Resumable (AddressError Precise Val) - , Resumable EvalError, Resumable (EnvironmentError Precise) , Resumable ResolutionError + , Resumable EvalError + , Resumable (EnvironmentError Precise) , Resumable (Unspecialized Val) , Resumable (LoadError Precise) , Trace , Fresh , State (Heap Precise Latest Val) - , IO + , Lift IO ] type TestEvaluatingErrors = '[ ValueError Precise (UtilEff Precise) , AddressError Precise Val + , ResolutionError , EvalError , EnvironmentError Precise - , ResolutionError , Unspecialized Val , LoadError Precise ] -testEvaluating :: Evaluator Precise Val TestEvaluatingEffects (ModuleTable (NonEmpty (Module (Precise, Environment Precise)))) +testEvaluating :: Evaluator Precise Val TestEvaluatingEffects (ModuleTable (NonEmpty (Module (Environment Precise, Precise)))) -> IO - ( ( Either (SomeExc (Data.Sum.Sum TestEvaluatingErrors)) - (ModuleTable (NonEmpty (Module (Precise, Environment Precise)))) - , Heap Precise Latest Val + ( [String] + , ( Heap Precise Latest Val + , Either (SomeExc (Data.Sum.Sum TestEvaluatingErrors)) + (ModuleTable (NonEmpty (Module (Environment Precise, Precise)))) ) - , [String] ) testEvaluating = runM - . fmap (\ ((res, traces), heap) -> ((res, heap), traces)) + . fmap (\ (heap, (traces, res)) -> (traces, (heap, res))) . runState lowerBound . runFresh 0 . runReturningTrace . fmap reassociate . runLoadError . runUnspecialized - . runResolutionError . runEnvironmentError . runEvalError + . runResolutionError . runAddressError . runValueError @_ @Precise @(UtilEff Precise) diff --git a/test/fixtures/cli/diff-tree.json b/test/fixtures/cli/diff-tree.json index 683fdf539..3c4e4222a 100644 --- a/test/fixtures/cli/diff-tree.json +++ b/test/fixtures/cli/diff-tree.json @@ -1,47 +1,32 @@ { - "diffs": [ - { - "diff": - { - "merge": - { + "diffs": [{ + "diff": { + "merge": { "term": "Statements", - "children": [ - { - "merge": - { + "statements": [{ + "merge": { "term": "Method", - "methodBody": - { - "merge": - { - "children": [ - { - "patch": - { - "insert": - { + "methodBody": { + "merge": { + "children": [{ + "patch": { + "insert": { "term": "Send", "sourceRange": [13, 16], "sendReceiver": null, "sendBlock": null, "sendArgs": [], - "sourceSpan": - { + "sourceSpan": { "start": [2, 3], "end": [2, 6] }, - "sendSelector": - { - "patch": - { - "insert": - { + "sendSelector": { + "patch": { + "insert": { "term": "Identifier", "name": "baz", "sourceRange": [13, 16], - "sourceSpan": - { + "sourceSpan": { "start": [2, 3], "end": [2, 6] } @@ -51,20 +36,16 @@ } } }], - "before": - { + "before": { "sourceRange": [8, 11], - "sourceSpan": - { + "sourceSpan": { "start": [2, 1], "end": [2, 4] } }, - "after": - { + "after": { "sourceRange": [13, 16], - "sourceSpan": - { + "sourceSpan": { "start": [2, 3], "end": [2, 6] } @@ -72,127 +53,100 @@ } }, "methodContext": [], - "methodName": - { - "patch": - { - "replace": [ - { + "methodName": { + "patch": { + "replace": [{ "term": "Identifier", "name": "foo", "sourceRange": [4, 7], - "sourceSpan": - { + "sourceSpan": { "start": [1, 5], "end": [1, 8] } - }, - { + }, { "term": "Identifier", "name": "bar", "sourceRange": [4, 7], - "sourceSpan": - { + "sourceSpan": { "start": [1, 5], "end": [1, 8] } }] } }, - "methodParameters": [ - { - "patch": - { - "insert": - { + "methodParameters": [{ + "patch": { + "insert": { "term": "Identifier", "name": "a", "sourceRange": [8, 9], - "sourceSpan": - { + "sourceSpan": { "start": [1, 9], "end": [1, 10] } } } }], - "methodReceiver": - { - "merge": - { + "methodReceiver": { + "merge": { "term": "Empty", - "before": - { + "before": { "sourceRange": [0, 0], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [1, 1] } }, - "after": - { + "after": { "sourceRange": [0, 0], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [1, 1] } } } }, - "before": - { + "before": { "sourceRange": [0, 11], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [2, 4] } }, - "after": - { + "after": { "sourceRange": [0, 20], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [3, 4] } } } }], - "before": - { + "before": { "sourceRange": [0, 12], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [3, 1] } }, - "after": - { + "after": { "sourceRange": [0, 21], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [4, 1] } } } }, - "stat": - { - "path": "test/fixtures/ruby/corpus/method-declaration.A.rb -> test/fixtures/ruby/corpus/method-declaration.B.rb", - "replace": [ - { + "stat": { + "path": "test/fixtures/ruby/corpus/method-declaration.A.rb->test/fixtures/ruby/corpus/method-declaration.B.rb", + "replace": [{ "path": "test/fixtures/ruby/corpus/method-declaration.A.rb", "language": "Ruby" - }, - { + }, { "path": "test/fixtures/ruby/corpus/method-declaration.B.rb", "language": "Ruby" }] } }] -} +} \ No newline at end of file diff --git a/test/fixtures/cli/parse-tree.json b/test/fixtures/cli/parse-tree.json index 43e07d9b4..745c11a91 100644 --- a/test/fixtures/cli/parse-tree.json +++ b/test/fixtures/cli/parse-tree.json @@ -1,69 +1,57 @@ { - "trees": [ - { - "tree": - { + "trees": [{ + "tree": { "term": "Statements", - "children": [ - { - "term": "LowAnd", - "children": [ - { + "statements": [{ + "term": "LowPrecedenceAnd", + "lhs": { "term": "Send", "sendArgs": [], "sendBlock": null, "sendReceiver": null, - "sendSelector": - { + "sendSelector": { "term": "Identifier", "name": "foo", "sourceRange": [0, 3], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [1, 4] } }, "sourceRange": [0, 3], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [1, 4] } }, - { + "rhs": { "term": "Send", "sendArgs": [], "sendBlock": null, "sendReceiver": null, - "sendSelector": - { + "sendSelector": { "term": "Identifier", "name": "bar", "sourceRange": [8, 11], - "sourceSpan": - { + "sourceSpan": { "start": [1, 9], "end": [1, 12] } }, "sourceRange": [8, 11], - "sourceSpan": - { + "sourceSpan": { "start": [1, 9], "end": [1, 12] } - }], + }, "sourceRange": [0, 11], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [1, 12] } }], "sourceRange": [0, 12], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [2, 1] } @@ -71,4 +59,4 @@ "path": "test/fixtures/ruby/corpus/and-or.A.rb", "language": "Ruby" }] -} +} \ No newline at end of file diff --git a/test/fixtures/cli/parse-trees.json b/test/fixtures/cli/parse-trees.json index 7beb46a0c..3f91bf823 100644 --- a/test/fixtures/cli/parse-trees.json +++ b/test/fixtures/cli/parse-trees.json @@ -1,229 +1,191 @@ { - "trees": [ - { - "tree": - { + "trees": [{ + "tree": { "term": "Statements", - "children": [ - { - "term": "LowAnd", - "children": [ - { + "statements": [{ + "term": "LowPrecedenceAnd", + "lhs": { "term": "Send", "sendArgs": [], "sendBlock": null, "sendReceiver": null, - "sendSelector": - { + "sendSelector": { "term": "Identifier", "name": "foo", "sourceRange": [0, 3], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [1, 4] } }, "sourceRange": [0, 3], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [1, 4] } }, - { + "rhs": { "term": "Send", "sendArgs": [], "sendBlock": null, "sendReceiver": null, - "sendSelector": - { + "sendSelector": { "term": "Identifier", "name": "bar", "sourceRange": [8, 11], - "sourceSpan": - { + "sourceSpan": { "start": [1, 9], "end": [1, 12] } }, "sourceRange": [8, 11], - "sourceSpan": - { + "sourceSpan": { "start": [1, 9], "end": [1, 12] } - }], + }, "sourceRange": [0, 11], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [1, 12] } }], "sourceRange": [0, 12], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [2, 1] } }, "path": "test/fixtures/ruby/corpus/and-or.A.rb", "language": "Ruby" - }, - { - "tree": - { + }, { + "tree": { "term": "Statements", - "children": [ - { - "term": "LowOr", - "children": [ - { + "statements": [{ + "term": "LowPrecedenceOr", + "lhs": { "term": "Send", "sendArgs": [], "sendBlock": null, "sendReceiver": null, - "sendSelector": - { + "sendSelector": { "term": "Identifier", "name": "foo", "sourceRange": [0, 3], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [1, 4] } }, "sourceRange": [0, 3], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [1, 4] } }, - { + "rhs": { "term": "Send", "sendArgs": [], "sendBlock": null, "sendReceiver": null, - "sendSelector": - { + "sendSelector": { "term": "Identifier", "name": "bar", "sourceRange": [7, 10], - "sourceSpan": - { + "sourceSpan": { "start": [1, 8], "end": [1, 11] } }, "sourceRange": [7, 10], - "sourceSpan": - { + "sourceSpan": { "start": [1, 8], "end": [1, 11] } - }], + }, "sourceRange": [0, 10], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [1, 11] } - }, - { - "term": "LowAnd", - "children": [ - { - "term": "LowOr", - "children": [ - { + }, { + "term": "LowPrecedenceAnd", + "lhs": { + "term": "LowPrecedenceOr", + "lhs": { "term": "Send", "sendArgs": [], "sendBlock": null, "sendReceiver": null, - "sendSelector": - { + "sendSelector": { "term": "Identifier", "name": "a", "sourceRange": [11, 12], - "sourceSpan": - { + "sourceSpan": { "start": [2, 1], "end": [2, 2] } }, "sourceRange": [11, 12], - "sourceSpan": - { + "sourceSpan": { "start": [2, 1], "end": [2, 2] } }, - { + "rhs": { "term": "Send", "sendArgs": [], "sendBlock": null, "sendReceiver": null, - "sendSelector": - { + "sendSelector": { "term": "Identifier", "name": "b", "sourceRange": [16, 17], - "sourceSpan": - { + "sourceSpan": { "start": [2, 6], "end": [2, 7] } }, "sourceRange": [16, 17], - "sourceSpan": - { + "sourceSpan": { "start": [2, 6], "end": [2, 7] } - }], + }, "sourceRange": [11, 17], - "sourceSpan": - { + "sourceSpan": { "start": [2, 1], "end": [2, 7] } }, - { + "rhs": { "term": "Send", "sendArgs": [], "sendBlock": null, "sendReceiver": null, - "sendSelector": - { + "sendSelector": { "term": "Identifier", "name": "c", "sourceRange": [22, 23], - "sourceSpan": - { + "sourceSpan": { "start": [2, 12], "end": [2, 13] } }, "sourceRange": [22, 23], - "sourceSpan": - { + "sourceSpan": { "start": [2, 12], "end": [2, 13] } - }], + }, "sourceRange": [11, 23], - "sourceSpan": - { + "sourceSpan": { "start": [2, 1], "end": [2, 13] } }], "sourceRange": [0, 24], - "sourceSpan": - { + "sourceSpan": { "start": [1, 1], "end": [3, 1] } @@ -231,4 +193,4 @@ "path": "test/fixtures/ruby/corpus/and-or.B.rb", "language": "Ruby" }] -} +} \ No newline at end of file diff --git a/test/fixtures/go/corpus/assignment-statements.diffA-B.txt b/test/fixtures/go/corpus/assignment-statements.diffA-B.txt index b562fd143..dfe0c7afa 100644 --- a/test/fixtures/go/corpus/assignment-statements.diffA-B.txt +++ b/test/fixtures/go/corpus/assignment-statements.diffA-B.txt @@ -45,15 +45,11 @@ {+(RShift {+(Identifier)+} {+(Integer)+})+})+} - (Assignment - { (Identifier) - ->(Identifier) } - { (Times - {-(Identifier)-} - {-(Integer)-}) - ->(DividedBy + {+(Assignment + {+(Identifier)+} + {+(DividedBy {+(Identifier)+} - {+(Integer)+}) }) + {+(Integer)+})+})+} {+(Assignment {+(Identifier)+} {+(BXOr @@ -82,6 +78,11 @@ {+(KeyValue {+(Identifier)+} {+(Integer)+})+})+})+})+})+})+} + {-(Assignment + {-(Identifier)-} + {-(Times + {-(Identifier)-} + {-(Integer)-})-})-} {-(Assignment {-(Identifier)-} {-(Plus diff --git a/test/fixtures/go/corpus/assignment-statements.diffB-A.txt b/test/fixtures/go/corpus/assignment-statements.diffB-A.txt index d51320bca..117c5546f 100644 --- a/test/fixtures/go/corpus/assignment-statements.diffB-A.txt +++ b/test/fixtures/go/corpus/assignment-statements.diffB-A.txt @@ -30,25 +30,29 @@ {+(Times {+(Identifier)+} {+(Integer)+})+})+} + {+(Assignment + {+(Identifier)+} + {+(Plus + {+(Identifier)+} + {+(Integer)+})+})+} (Assignment { (Identifier) ->(Identifier) } { (Times {-(Identifier)-} {-(Integer)-}) - ->(Plus + ->(LShift {+(Identifier)+} {+(Integer)+}) }) - {+(Assignment - {+(Identifier)+} - {+(LShift + (Assignment + { (Identifier) + ->(Identifier) } + { (Plus + {-(Identifier)-} + {-(Integer)-}) + ->(RShift {+(Identifier)+} - {+(Integer)+})+})+} - {+(Assignment - {+(Identifier)+} - {+(RShift - {+(Identifier)+} - {+(Integer)+})+})+} + {+(Integer)+}) }) {+(Assignment {+(Identifier)+} {+(DividedBy @@ -64,16 +68,12 @@ {+(Modulo {+(Identifier)+} {+(Integer)+})+})+} - (Assignment - { (Identifier) - ->(Identifier) } - { (Plus - {-(Identifier)-} - {-(Integer)-}) - ->(Not + {+(Assignment + {+(Identifier)+} + {+(Not {+(BAnd {+(Identifier)+} - {+(Integer)+})+}) }) + {+(Integer)+})+})+})+} {+(Assignment {+(Identifier)+} {+(Statements diff --git a/test/fixtures/go/corpus/const-with-implicit-values.diffA-B.txt b/test/fixtures/go/corpus/const-with-implicit-values.diffA-B.txt index 10cf87c5b..334b625e2 100644 --- a/test/fixtures/go/corpus/const-with-implicit-values.diffA-B.txt +++ b/test/fixtures/go/corpus/const-with-implicit-values.diffA-B.txt @@ -6,15 +6,21 @@ (Identifier) (Statements) (Statements - (Assignment - { (Identifier) - ->(Identifier) } - (Identifier)) - (Assignment - { (Identifier) - ->(Identifier) } - (Statements)) - (Assignment - { (Identifier) - ->(Identifier) } - (Statements))))) + {+(Assignment + {+(Identifier)+} + {+(Identifier)+})+} + {+(Assignment + {+(Identifier)+} + {+(Statements)+})+} + {+(Assignment + {+(Identifier)+} + {+(Statements)+})+} + {-(Assignment + {-(Identifier)-} + {-(Identifier)-})-} + {-(Assignment + {-(Identifier)-} + {-(Statements)-})-} + {-(Assignment + {-(Identifier)-} + {-(Statements)-})-}))) diff --git a/test/fixtures/go/corpus/const-with-implicit-values.diffB-A.txt b/test/fixtures/go/corpus/const-with-implicit-values.diffB-A.txt index 10cf87c5b..b8eaed8d5 100644 --- a/test/fixtures/go/corpus/const-with-implicit-values.diffB-A.txt +++ b/test/fixtures/go/corpus/const-with-implicit-values.diffB-A.txt @@ -6,15 +6,20 @@ (Identifier) (Statements) (Statements + {+(Assignment + {+(Identifier)+} + {+(Identifier)+})+} + {+(Assignment + {+(Identifier)+} + {+(Statements)+})+} (Assignment { (Identifier) ->(Identifier) } - (Identifier)) - (Assignment { (Identifier) - ->(Identifier) } - (Statements)) - (Assignment - { (Identifier) - ->(Identifier) } - (Statements))))) + ->(Statements) }) + {-(Assignment + {-(Identifier)-} + {-(Statements)-})-} + {-(Assignment + {-(Identifier)-} + {-(Statements)-})-}))) diff --git a/test/fixtures/go/corpus/for-statements.diffB-A.txt b/test/fixtures/go/corpus/for-statements.diffB-A.txt index 1e6d90a9c..883185c00 100644 --- a/test/fixtures/go/corpus/for-statements.diffB-A.txt +++ b/test/fixtures/go/corpus/for-statements.diffB-A.txt @@ -92,28 +92,31 @@ {+(Identifier)+} {+(Identifier)+})+} {+(Empty)+})+})+} - (For - (Empty) - { (Empty) - ->(LessThan + {+(For + {+(Empty)+} + {+(LessThan {+(Integer)+} - {+(Integer)+}) } - (Empty) - { (Statements + {+(Integer)+})+} + {+(Empty)+} + {+(Call + {+(Identifier)+} + {+(Statements)+} + {+(Empty)+})+})+} + {+(ForEach + {+(Empty)+} + {+(Identifier)+} + {+(Statements)+})+} + {-(For + {-(Empty)-} + {-(Empty)-} + {-(Empty)-} + {-(Statements {-(Call {-(Identifier)-} {-(Statements)-} {-(Empty)-})-} {-(Continue - {-(Identifier)-})-}) - ->(Call - {+(Identifier)+} - {+(Statements)+} - {+(Empty)+}) }) - {+(ForEach - {+(Empty)+} - {+(Identifier)+} - {+(Statements)+})+} + {-(Identifier)-})-})-})-} {-(For {-(LessThan {-(Identifier)-} diff --git a/test/fixtures/go/corpus/slice-expressions.diffA-B.txt b/test/fixtures/go/corpus/slice-expressions.diffA-B.txt index fec4aed20..73ed3736c 100644 --- a/test/fixtures/go/corpus/slice-expressions.diffA-B.txt +++ b/test/fixtures/go/corpus/slice-expressions.diffA-B.txt @@ -18,33 +18,24 @@ { (Integer) ->(Integer) } (Empty)) - {+(Slice - {+(Identifier)+} - {+(Integer)+} - {+(Integer)+} - {+(Empty)+})+} - {+(Slice - {+(Identifier)+} - {+(Integer)+} - {+(Integer)+} - {+(Integer)+})+} - {+(Slice - {+(Identifier)+} - {+(Integer)+} - {+(Integer)+} - {+(Empty)+})+} - {-(Slice - {-(Identifier)-} - {-(Empty)-} - {-(Empty)-} - {-(Empty)-})-} - {-(Slice - {-(Identifier)-} - {-(Integer)-} - {-(Integer)-} - {-(Integer)-})-} - {-(Slice - {-(Identifier)-} - {-(Integer)-} - {-(Integer)-} - {-(Empty)-})-}))) + (Slice + (Identifier) + { (Empty) + ->(Integer) } + { (Empty) + ->(Integer) } + (Empty)) + (Slice + (Identifier) + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) }) + (Slice + { (Identifier) + ->(Identifier) } + (Integer) + (Integer) + (Empty))))) diff --git a/test/fixtures/go/corpus/slice-expressions.diffB-A.txt b/test/fixtures/go/corpus/slice-expressions.diffB-A.txt index d5a6b757f..f60a36c01 100644 --- a/test/fixtures/go/corpus/slice-expressions.diffB-A.txt +++ b/test/fixtures/go/corpus/slice-expressions.diffB-A.txt @@ -18,29 +18,24 @@ { (Integer) ->(Integer) } (Empty)) - {+(Slice - {+(Identifier)+} - {+(Empty)+} - {+(Empty)+} - {+(Empty)+})+} - {+(Slice - {+(Identifier)+} - {+(Integer)+} - {+(Integer)+} - {+(Integer)+})+} + (Slice + (Identifier) + { (Integer) + ->(Empty) } + { (Integer) + ->(Empty) } + (Empty)) + (Slice + (Identifier) + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) } + { (Integer) + ->(Integer) }) (Slice { (Identifier) ->(Identifier) } (Integer) (Integer) - (Empty)) - {-(Slice - {-(Identifier)-} - {-(Integer)-} - {-(Integer)-} - {-(Integer)-})-} - {-(Slice - {-(Identifier)-} - {-(Integer)-} - {-(Integer)-} - {-(Empty)-})-}))) + (Empty))))) diff --git a/test/fixtures/go/corpus/type-conversion-expressions.diffA-B.txt b/test/fixtures/go/corpus/type-conversion-expressions.diffA-B.txt index e81d186c8..f9564eca2 100644 --- a/test/fixtures/go/corpus/type-conversion-expressions.diffA-B.txt +++ b/test/fixtures/go/corpus/type-conversion-expressions.diffA-B.txt @@ -65,17 +65,13 @@ {-(Identifier)-}) ->(MemberAccess {+(Identifier)+}) }) - (TypeConversion - (Parenthesized - (Slice - { (MemberAccess - {-(Identifier)-}) - ->(MemberAccess - {+(Identifier)+}) })) - { (MemberAccess - {-(Identifier)-}) - ->(MemberAccess - {+(Identifier)+}) }) + {+(TypeConversion + {+(Parenthesized + {+(Slice + {+(MemberAccess + {+(Identifier)+})+})+})+} + {+(MemberAccess + {+(Identifier)+})+})+} {+(Call {+(MemberAccess {+(Identifier)+})+} @@ -86,6 +82,13 @@ {+(Identifier)+})+} {+(Identifier)+} {+(Empty)+})+} + {-(TypeConversion + {-(Parenthesized + {-(Slice + {-(MemberAccess + {-(Identifier)-})-})-})-} + {-(MemberAccess + {-(Identifier)-})-})-} {-(Call {-(MemberAccess {-(Identifier)-})-} diff --git a/test/fixtures/go/corpus/type-conversion-expressions.diffB-A.txt b/test/fixtures/go/corpus/type-conversion-expressions.diffB-A.txt index e81d186c8..f9564eca2 100644 --- a/test/fixtures/go/corpus/type-conversion-expressions.diffB-A.txt +++ b/test/fixtures/go/corpus/type-conversion-expressions.diffB-A.txt @@ -65,17 +65,13 @@ {-(Identifier)-}) ->(MemberAccess {+(Identifier)+}) }) - (TypeConversion - (Parenthesized - (Slice - { (MemberAccess - {-(Identifier)-}) - ->(MemberAccess - {+(Identifier)+}) })) - { (MemberAccess - {-(Identifier)-}) - ->(MemberAccess - {+(Identifier)+}) }) + {+(TypeConversion + {+(Parenthesized + {+(Slice + {+(MemberAccess + {+(Identifier)+})+})+})+} + {+(MemberAccess + {+(Identifier)+})+})+} {+(Call {+(MemberAccess {+(Identifier)+})+} @@ -86,6 +82,13 @@ {+(Identifier)+})+} {+(Identifier)+} {+(Empty)+})+} + {-(TypeConversion + {-(Parenthesized + {-(Slice + {-(MemberAccess + {-(Identifier)-})-})-})-} + {-(MemberAccess + {-(Identifier)-})-})-} {-(Call {-(MemberAccess {-(Identifier)-})-} diff --git a/test/fixtures/go/corpus/type-switch-statements.diffA-B.txt b/test/fixtures/go/corpus/type-switch-statements.diffA-B.txt index b3b687a1c..41646d707 100644 --- a/test/fixtures/go/corpus/type-switch-statements.diffA-B.txt +++ b/test/fixtures/go/corpus/type-switch-statements.diffA-B.txt @@ -61,12 +61,12 @@ (Statements { (TextElement) ->(TextElement) } - { (Times - {-(Identifier)-} - {-(Integer)-}) - ->(DividedBy + {+(DividedBy {+(Integer)+} - {+(Identifier)+}) }) + {+(Identifier)+})+} + {-(Times + {-(Identifier)-} + {-(Integer)-})-}) (Empty))) (Pattern { (Identifier) @@ -77,12 +77,12 @@ (Statements { (TextElement) ->(TextElement) } - { (DividedBy - {-(Integer)-} - {-(Identifier)-}) - ->(Times + {+(Times {+(Identifier)+} - {+(Integer)+}) }) + {+(Integer)+})+} + {-(DividedBy + {-(Integer)-} + {-(Identifier)-})-}) (Empty))) (Pattern (Identifier) diff --git a/test/fixtures/go/corpus/type-switch-statements.diffB-A.txt b/test/fixtures/go/corpus/type-switch-statements.diffB-A.txt index 9e1d91e53..f6503461f 100644 --- a/test/fixtures/go/corpus/type-switch-statements.diffB-A.txt +++ b/test/fixtures/go/corpus/type-switch-statements.diffB-A.txt @@ -61,12 +61,12 @@ (Statements { (TextElement) ->(TextElement) } - { (DividedBy - {-(Integer)-} - {-(Identifier)-}) - ->(Times + {+(Times {+(Identifier)+} - {+(Integer)+}) }) + {+(Integer)+})+} + {-(DividedBy + {-(Integer)-} + {-(Identifier)-})-}) (Empty))) (Pattern { (Identifier) @@ -77,12 +77,12 @@ (Statements { (TextElement) ->(TextElement) } - { (Times - {-(Identifier)-} - {-(Integer)-}) - ->(DividedBy + {+(DividedBy {+(Integer)+} - {+(Identifier)+}) }) + {+(Identifier)+})+} + {-(Times + {-(Identifier)-} + {-(Integer)-})-}) (Empty))) (Pattern (Identifier) diff --git a/test/fixtures/go/corpus/unary-expressions.diffA-B.txt b/test/fixtures/go/corpus/unary-expressions.diffA-B.txt index 45d6fc72f..f826a11c7 100644 --- a/test/fixtures/go/corpus/unary-expressions.diffA-B.txt +++ b/test/fixtures/go/corpus/unary-expressions.diffA-B.txt @@ -8,35 +8,25 @@ (Statements { (Identifier) ->(Identifier) } - {+(Negate - {+(Identifier)+})+} - {+(Not - {+(ReceiveOperator - {+(Identifier)+})+})+} - {+(Pointer - {+(Call - {+(Identifier)+} - {+(Statements)+} - {+(Empty)+})+})+} - {+(Complement - {+(Identifier)+})+} - {+(Reference - {+(Identifier)+})+} - {+(ReceiveOperator - {+(Identifier)+})+} - {-(Negate - {-(Identifier)-})-} - {-(Not - {-(ReceiveOperator - {-(Identifier)-})-})-} - {-(Pointer - {-(Call - {-(Identifier)-} - {-(Statements)-} - {-(Empty)-})-})-} - {-(Complement - {-(Identifier)-})-} - {-(Reference - {-(Identifier)-})-} - {-(ReceiveOperator - {-(Identifier)-})-}))) + (Negate + { (Identifier) + ->(Identifier) }) + (Not + (ReceiveOperator + { (Identifier) + ->(Identifier) })) + (Pointer + (Call + { (Identifier) + ->(Identifier) } + (Statements) + (Empty))) + (Complement + { (Identifier) + ->(Identifier) }) + (Reference + { (Identifier) + ->(Identifier) }) + (ReceiveOperator + { (Identifier) + ->(Identifier) })))) diff --git a/test/fixtures/go/corpus/unary-expressions.diffB-A.txt b/test/fixtures/go/corpus/unary-expressions.diffB-A.txt index 45d6fc72f..f826a11c7 100644 --- a/test/fixtures/go/corpus/unary-expressions.diffB-A.txt +++ b/test/fixtures/go/corpus/unary-expressions.diffB-A.txt @@ -8,35 +8,25 @@ (Statements { (Identifier) ->(Identifier) } - {+(Negate - {+(Identifier)+})+} - {+(Not - {+(ReceiveOperator - {+(Identifier)+})+})+} - {+(Pointer - {+(Call - {+(Identifier)+} - {+(Statements)+} - {+(Empty)+})+})+} - {+(Complement - {+(Identifier)+})+} - {+(Reference - {+(Identifier)+})+} - {+(ReceiveOperator - {+(Identifier)+})+} - {-(Negate - {-(Identifier)-})-} - {-(Not - {-(ReceiveOperator - {-(Identifier)-})-})-} - {-(Pointer - {-(Call - {-(Identifier)-} - {-(Statements)-} - {-(Empty)-})-})-} - {-(Complement - {-(Identifier)-})-} - {-(Reference - {-(Identifier)-})-} - {-(ReceiveOperator - {-(Identifier)-})-}))) + (Negate + { (Identifier) + ->(Identifier) }) + (Not + (ReceiveOperator + { (Identifier) + ->(Identifier) })) + (Pointer + (Call + { (Identifier) + ->(Identifier) } + (Statements) + (Empty))) + (Complement + { (Identifier) + ->(Identifier) }) + (Reference + { (Identifier) + ->(Identifier) }) + (ReceiveOperator + { (Identifier) + ->(Identifier) })))) diff --git a/test/fixtures/javascript/corpus/boolean-operator.diffA-B.txt b/test/fixtures/javascript/corpus/boolean-operator.diffA-B.txt index a257366e8..6eb4374fd 100644 --- a/test/fixtures/javascript/corpus/boolean-operator.diffA-B.txt +++ b/test/fixtures/javascript/corpus/boolean-operator.diffA-B.txt @@ -1,7 +1,7 @@ (Statements -{ (Or - {-(Identifier)-} - {-(Identifier)-}) -->(And +{+(And {+(Identifier)+} - {+(Identifier)+}) }) + {+(Identifier)+})+} +{-(Or + {-(Identifier)-} + {-(Identifier)-})-}) diff --git a/test/fixtures/javascript/corpus/boolean-operator.diffB-A.txt b/test/fixtures/javascript/corpus/boolean-operator.diffB-A.txt index ef610ad5c..77b373871 100644 --- a/test/fixtures/javascript/corpus/boolean-operator.diffB-A.txt +++ b/test/fixtures/javascript/corpus/boolean-operator.diffB-A.txt @@ -1,7 +1,7 @@ (Statements -{ (And - {-(Identifier)-} - {-(Identifier)-}) -->(Or +{+(Or {+(Identifier)+} - {+(Identifier)+}) }) + {+(Identifier)+})+} +{-(And + {-(Identifier)-} + {-(Identifier)-})-}) diff --git a/test/fixtures/javascript/corpus/export.diffA-B.txt b/test/fixtures/javascript/corpus/export.diffA-B.txt index 2d05a4ca2..a4bb6d82b 100644 --- a/test/fixtures/javascript/corpus/export.diffA-B.txt +++ b/test/fixtures/javascript/corpus/export.diffA-B.txt @@ -35,15 +35,15 @@ (Identifier) { (Empty) ->(Identifier) }) + {+(Assignment + {+(Empty)+} + {+(Identifier)+} + {+(Empty)+})+} (Assignment (Empty) { (Identifier) ->(Identifier) } - (Empty)) - {+(Assignment - {+(Empty)+} - {+(Identifier)+} - {+(Empty)+})+})) + (Empty)))) (DefaultExport { (Identifier) ->(Identifier) }) diff --git a/test/fixtures/javascript/corpus/export.diffB-A.txt b/test/fixtures/javascript/corpus/export.diffB-A.txt index 25c78e485..e2f1d19fb 100644 --- a/test/fixtures/javascript/corpus/export.diffB-A.txt +++ b/test/fixtures/javascript/corpus/export.diffB-A.txt @@ -35,11 +35,14 @@ (Identifier) { (Identifier) ->(Empty) }) - (Assignment - (Empty) - { (Identifier) - ->(Identifier) } - (Empty)) + {+(Assignment + {+(Empty)+} + {+(Identifier)+} + {+(Empty)+})+} + {-(Assignment + {-(Empty)-} + {-(Identifier)-} + {-(Empty)-})-} {-(Assignment {-(Empty)-} {-(Identifier)-} diff --git a/test/fixtures/javascript/corpus/import.diffA-B.txt b/test/fixtures/javascript/corpus/import.diffA-B.txt index c66f6c3c9..ae06e60a3 100644 --- a/test/fixtures/javascript/corpus/import.diffA-B.txt +++ b/test/fixtures/javascript/corpus/import.diffA-B.txt @@ -1,12 +1,8 @@ (Statements -{ (Import) -->(Import) } -{ (QualifiedAliasedImport - {-(Identifier)-}) -->(QualifiedAliasedImport - {+(Identifier)+}) } -{ (Import) -->(Import) } +{+(Import)+} +{+(QualifiedAliasedImport + {+(Identifier)+})+} +{+(Import)+} {+(Import)+} {+(Import)+} {+(Statements @@ -18,6 +14,10 @@ {+(Identifier)+})+})+} {+(SideEffectImport)+} {-(Import)-} +{-(QualifiedAliasedImport + {-(Identifier)-})-} +{-(Import)-} +{-(Import)-} {-(Import)-} {-(Statements {-(Import)-} diff --git a/test/fixtures/javascript/corpus/import.diffB-A.txt b/test/fixtures/javascript/corpus/import.diffB-A.txt index c66f6c3c9..ae06e60a3 100644 --- a/test/fixtures/javascript/corpus/import.diffB-A.txt +++ b/test/fixtures/javascript/corpus/import.diffB-A.txt @@ -1,12 +1,8 @@ (Statements -{ (Import) -->(Import) } -{ (QualifiedAliasedImport - {-(Identifier)-}) -->(QualifiedAliasedImport - {+(Identifier)+}) } -{ (Import) -->(Import) } +{+(Import)+} +{+(QualifiedAliasedImport + {+(Identifier)+})+} +{+(Import)+} {+(Import)+} {+(Import)+} {+(Statements @@ -18,6 +14,10 @@ {+(Identifier)+})+})+} {+(SideEffectImport)+} {-(Import)-} +{-(QualifiedAliasedImport + {-(Identifier)-})-} +{-(Import)-} +{-(Import)-} {-(Import)-} {-(Statements {-(Import)-} diff --git a/test/fixtures/javascript/corpus/relational-operator.diffA-B.txt b/test/fixtures/javascript/corpus/relational-operator.diffA-B.txt index d98198807..427544e8f 100644 --- a/test/fixtures/javascript/corpus/relational-operator.diffA-B.txt +++ b/test/fixtures/javascript/corpus/relational-operator.diffA-B.txt @@ -1,7 +1,7 @@ (Statements -{ (LessThan - {-(Identifier)-} - {-(Identifier)-}) -->(LessThanEqual +{+(LessThanEqual {+(Identifier)+} - {+(Identifier)+}) }) + {+(Identifier)+})+} +{-(LessThan + {-(Identifier)-} + {-(Identifier)-})-}) diff --git a/test/fixtures/javascript/corpus/relational-operator.diffB-A.txt b/test/fixtures/javascript/corpus/relational-operator.diffB-A.txt index 17bca315b..0272c61d9 100644 --- a/test/fixtures/javascript/corpus/relational-operator.diffB-A.txt +++ b/test/fixtures/javascript/corpus/relational-operator.diffB-A.txt @@ -1,7 +1,7 @@ (Statements -{ (LessThanEqual - {-(Identifier)-} - {-(Identifier)-}) -->(LessThan +{+(LessThan {+(Identifier)+} - {+(Identifier)+}) }) + {+(Identifier)+})+} +{-(LessThanEqual + {-(Identifier)-} + {-(Identifier)-})-}) diff --git a/test/fixtures/json/corpus/hash.diffA-B.txt b/test/fixtures/json/corpus/hash.diffA-B.txt index 757fbd853..f9fa320ed 100644 --- a/test/fixtures/json/corpus/hash.diffA-B.txt +++ b/test/fixtures/json/corpus/hash.diffA-B.txt @@ -1,20 +1,18 @@ (Hash -{-(KeyValue - {-(TextElement)-} - {-(Float)-})-} + {-(KeyValue + {-(TextElement)-} + {-(Float)-})-} (KeyValue (TextElement) (Float)) -{+(KeyValue + (KeyValue + { (TextElement) + ->(TextElement) } + (Float)) + (KeyValue + (TextElement) + { (Float) + ->(Float)}) + {+(KeyValue {+(TextElement)+} - {+(Float)+})+} - (KeyValue - { (TextElement) - ->(TextElement) } - { (Float) - ->(Float) }) - (KeyValue - { (TextElement) - ->(TextElement) } - { (Float) - ->(Float) })) + {+(Float)+})+}) diff --git a/test/fixtures/json/corpus/hash.diffB-A.txt b/test/fixtures/json/corpus/hash.diffB-A.txt index 6e8923fa2..952d54b0d 100644 --- a/test/fixtures/json/corpus/hash.diffB-A.txt +++ b/test/fixtures/json/corpus/hash.diffB-A.txt @@ -5,17 +5,14 @@ (KeyValue (TextElement) (Float)) -{+(KeyValue - {+(TextElement)+} - {+(Float)+})+} (KeyValue { (TextElement) - ->(TextElement) } + ->(TextElement)} + (Float)) + (KeyValue + (TextElement) { (Float) - ->(Float) }) + ->(Float)}) {-(KeyValue {-(TextElement)-} - {-(Float)-})-} -{-(KeyValue - {-(TextElement)-} - {-(Float)-})-}) + {-(Float)-})-}) \ No newline at end of file diff --git a/test/fixtures/python/corpus/assignment.diffB-A.txt b/test/fixtures/python/corpus/assignment.diffB-A.txt index eedd8e486..7dd330e6d 100644 --- a/test/fixtures/python/corpus/assignment.diffB-A.txt +++ b/test/fixtures/python/corpus/assignment.diffB-A.txt @@ -10,13 +10,14 @@ {-(Integer)-} (Integer) {+(Integer)+})) - (Assignment - { (Identifier) - ->(Identifier) } - { (Integer) - ->(Statements +{+(Assignment + {+(Identifier)+} + {+(Statements {+(Integer)+} - {+(Integer)+}) }) + {+(Integer)+})+})+} +{-(Assignment + {-(Identifier)-} + {-(Integer)-})-} {-(Assignment {-(Identifier)-} {-(Statements diff --git a/test/fixtures/python/corpus/binary-operator.diffA-B.txt b/test/fixtures/python/corpus/binary-operator.diffA-B.txt index 4019d9609..be38a7ca1 100644 --- a/test/fixtures/python/corpus/binary-operator.diffA-B.txt +++ b/test/fixtures/python/corpus/binary-operator.diffA-B.txt @@ -26,18 +26,12 @@ (Modulo (Identifier) (Identifier)) -{ (FloorDivision - {-(Identifier)-} - {-(Identifier)-}) -->(Power +{+(Power {+(Identifier)+} - {+(Identifier)+}) } -{ (Power - {-(Identifier)-} - {-(Identifier)-}) -->(FloorDivision + {+(Identifier)+})+} +{+(FloorDivision {+(Identifier)+} - {+(Identifier)+}) } + {+(Identifier)+})+} {+(Modulo {+(Identifier)+} {+(Identifier)+})+} @@ -53,6 +47,12 @@ {+(Plus {+(Identifier)+} {+(Identifier)+})+} +{-(FloorDivision + {-(Identifier)-} + {-(Identifier)-})-} +{-(Power + {-(Identifier)-} + {-(Identifier)-})-} {-(BOr {-(Identifier)-} {-(Identifier)-})-} diff --git a/test/fixtures/python/corpus/binary-operator.diffB-A.txt b/test/fixtures/python/corpus/binary-operator.diffB-A.txt index 8c510ef80..925877a8e 100644 --- a/test/fixtures/python/corpus/binary-operator.diffB-A.txt +++ b/test/fixtures/python/corpus/binary-operator.diffB-A.txt @@ -26,18 +26,12 @@ (Modulo (Identifier) (Identifier)) -{ (Power - {-(Identifier)-} - {-(Identifier)-}) -->(FloorDivision +{+(FloorDivision {+(Identifier)+} - {+(Identifier)+}) } -{ (FloorDivision - {-(Identifier)-} - {-(Identifier)-}) -->(Power + {+(Identifier)+})+} +{+(Power {+(Identifier)+} - {+(Identifier)+}) } + {+(Identifier)+})+} {+(BOr {+(Identifier)+} {+(Identifier)+})+} @@ -53,6 +47,12 @@ {+(RShift {+(Identifier)+} {+(Identifier)+})+} +{-(Power + {-(Identifier)-} + {-(Identifier)-})-} +{-(FloorDivision + {-(Identifier)-} + {-(Identifier)-})-} {-(Modulo {-(Identifier)-} {-(Identifier)-})-} diff --git a/test/fixtures/python/corpus/boolean-operator.diffA-B.txt b/test/fixtures/python/corpus/boolean-operator.diffA-B.txt index 859f4bb46..d26d4894a 100644 --- a/test/fixtures/python/corpus/boolean-operator.diffA-B.txt +++ b/test/fixtures/python/corpus/boolean-operator.diffA-B.txt @@ -1,13 +1,12 @@ (Statements -{ (And - {-(Identifier)-} - {-(Identifier)-}) -->(Or +{+(Or {+(Identifier)+} - {+(Identifier)+}) } -{ (Or + {+(Identifier)+})+} + (And + { (Identifier) + ->(Identifier) } + { (Identifier) + ->(Identifier) }) +{-(Or {-(Identifier)-} - {-(Identifier)-}) -->(And - {+(Identifier)+} - {+(Identifier)+}) }) + {-(Identifier)-})-}) diff --git a/test/fixtures/python/corpus/boolean-operator.diffB-A.txt b/test/fixtures/python/corpus/boolean-operator.diffB-A.txt index 1176814b9..e7242e271 100644 --- a/test/fixtures/python/corpus/boolean-operator.diffB-A.txt +++ b/test/fixtures/python/corpus/boolean-operator.diffB-A.txt @@ -1,13 +1,12 @@ (Statements -{ (Or - {-(Identifier)-} - {-(Identifier)-}) -->(And +{+(And {+(Identifier)+} - {+(Identifier)+}) } -{ (And + {+(Identifier)+})+} + (Or + { (Identifier) + ->(Identifier) } + { (Identifier) + ->(Identifier) }) +{-(And {-(Identifier)-} - {-(Identifier)-}) -->(Or - {+(Identifier)+} - {+(Identifier)+}) }) + {-(Identifier)-})-}) diff --git a/test/fixtures/python/corpus/comparison-operator.diffB-A.txt b/test/fixtures/python/corpus/comparison-operator.diffB-A.txt index 42aeebf51..fcbfd6c3f 100644 --- a/test/fixtures/python/corpus/comparison-operator.diffB-A.txt +++ b/test/fixtures/python/corpus/comparison-operator.diffB-A.txt @@ -5,25 +5,20 @@ {+(LessThanEqual {+(Identifier)+} {+(Identifier)+})+} - (Not - (Equal - { (Identifier) - ->(Identifier) } - { (Identifier) - ->(Identifier) })) +{+(Not + {+(Equal + {+(Identifier)+} + {+(Identifier)+})+})+} {+(GreaterThanEqual {+(Identifier)+} {+(Identifier)+})+} {+(GreaterThan {+(Identifier)+} {+(Identifier)+})+} - (Not - { (Member - {-(Identifier)-} - {-(Identifier)-}) - ->(Equal +{+(Not + {+(Equal {+(Identifier)+} - {+(Identifier)+}) }) + {+(Identifier)+})+})+} {+(Member {+(Identifier)+} {+(Identifier)+})+} @@ -34,10 +29,16 @@ {+(Member {+(Identifier)+} {+(Identifier)+})+})+} -{+(Not - {+(Equal - {+(Identifier)+} - {+(Identifier)+})+})+} + (Not + (Equal + { (Identifier) + ->(Identifier) } + { (Identifier) + ->(Identifier) })) +{-(Not + {-(Member + {-(Identifier)-} + {-(Identifier)-})-})-} {-(Equal {-(Identifier)-} {-(Identifier)-})-} diff --git a/test/fixtures/python/corpus/exec-statement.diffA-B.txt b/test/fixtures/python/corpus/exec-statement.diffA-B.txt index 6646dda54..f51260a9b 100644 --- a/test/fixtures/python/corpus/exec-statement.diffA-B.txt +++ b/test/fixtures/python/corpus/exec-statement.diffA-B.txt @@ -1,21 +1,28 @@ (Statements +{+(Call + {+(Identifier)+} + {+(TextElement)+} + {+(Identifier)+} + {+(Empty)+})+} +{+(Call + {+(Identifier)+} + {+(TextElement)+} + {+(Identifier)+} + {+(Identifier)+} + {+(Empty)+})+} (Call (Identifier) { (TextElement) ->(TextElement) } - {+(Identifier)+} (Empty)) - (Call - (Identifier) - (TextElement) - {+(Identifier)+} - {+(Identifier)+} +{-(Call + {-(Identifier)-} + {-(TextElement)-} {-(Null)-} - (Empty)) - (Call - (Identifier) - { (TextElement) - ->(TextElement) } + {-(Empty)-})-} +{-(Call + {-(Identifier)-} + {-(TextElement)-} {-(Identifier)-} {-(Identifier)-} - (Empty))) + {-(Empty)-})-}) diff --git a/test/fixtures/python/corpus/exec-statement.diffB-A.txt b/test/fixtures/python/corpus/exec-statement.diffB-A.txt index 0d66e13b5..278c9efaf 100644 --- a/test/fixtures/python/corpus/exec-statement.diffB-A.txt +++ b/test/fixtures/python/corpus/exec-statement.diffB-A.txt @@ -1,21 +1,22 @@ (Statements - (Call - (Identifier) - { (TextElement) - ->(TextElement) } - {-(Identifier)-} - (Empty)) +{+(Call + {+(Identifier)+} + {+(TextElement)+} + {+(Empty)+})+} (Call (Identifier) (TextElement) {+(Null)+} - {-(Identifier)-} {-(Identifier)-} (Empty)) (Call (Identifier) - { (TextElement) - ->(TextElement) } + (TextElement) {+(Identifier)+} - {+(Identifier)+} - (Empty))) + (Identifier) + {-(Identifier)-} + (Empty)) +{-(Call + {-(Identifier)-} + {-(TextElement)-} + {-(Empty)-})-}) diff --git a/test/fixtures/python/corpus/float.diffA-B.txt b/test/fixtures/python/corpus/float.diffA-B.txt index cec2e6d1b..625f9e866 100644 --- a/test/fixtures/python/corpus/float.diffA-B.txt +++ b/test/fixtures/python/corpus/float.diffA-B.txt @@ -8,11 +8,11 @@ {+(Float)+} {+(Float)+} {+(Float)+} +{ (Float) +->(Float) } {+(Float)+} {+(Float)+} {+(Float)+} -{+(Float)+} -{-(Float)-} {-(Float)-} {-(Float)-} {-(Float)-} diff --git a/test/fixtures/python/corpus/float.diffB-A.txt b/test/fixtures/python/corpus/float.diffB-A.txt index 61dd738e3..77fccee5f 100644 --- a/test/fixtures/python/corpus/float.diffB-A.txt +++ b/test/fixtures/python/corpus/float.diffB-A.txt @@ -5,15 +5,15 @@ { (Float) ->(Float) } {+(Float)+} -{+(Float)+} -{+(Float)+} { (Float) ->(Float) } {+(Float)+} {+(Float)+} {+(Float)+} {+(Float)+} -{-(Float)-} +{+(Float)+} +{ (Float) +->(Float) } {-(Float)-} {-(Float)-} {-(Float)-} diff --git a/test/fixtures/python/corpus/import-from-statement.diffA-B.txt b/test/fixtures/python/corpus/import-from-statement.diffA-B.txt index 80eb129cd..707005652 100644 --- a/test/fixtures/python/corpus/import-from-statement.diffA-B.txt +++ b/test/fixtures/python/corpus/import-from-statement.diffA-B.txt @@ -1,11 +1,11 @@ (Statements +{+(Import)+} +{+(Import)+} +{+(Import)+} +{+(Import)+} { (Import) ->(Import) } {+(Import)+} -{+(Import)+} -{+(Import)+} -{+(Import)+} -{+(Import)+} {-(Import)-} {-(Import)-} {-(Import)-} diff --git a/test/fixtures/python/corpus/import-from-statement.diffB-A.txt b/test/fixtures/python/corpus/import-from-statement.diffB-A.txt index a9010a5b6..1df038db2 100644 --- a/test/fixtures/python/corpus/import-from-statement.diffB-A.txt +++ b/test/fixtures/python/corpus/import-from-statement.diffB-A.txt @@ -1,11 +1,11 @@ (Statements +{+(Import)+} { (Import) ->(Import) } {+(Import)+} {+(Import)+} -{+(Import)+} -{+(Import)+} -{-(Import)-} +{ (Import) +->(Import) } {-(Import)-} {-(Import)-} {-(Import)-} diff --git a/test/fixtures/python/corpus/integer.diffB-A.txt b/test/fixtures/python/corpus/integer.diffB-A.txt index 5670c9b1a..50bb9395b 100644 --- a/test/fixtures/python/corpus/integer.diffB-A.txt +++ b/test/fixtures/python/corpus/integer.diffB-A.txt @@ -13,11 +13,11 @@ {+(Integer)+} {+(Integer)+} {+(Integer)+} -{ (Integer) -->(Integer) } {+(Integer)+} {+(Integer)+} {+(Integer)+} +{+(Integer)+} +{-(Integer)-} {-(Negate {-(Integer)-})-} {-(Integer)-} diff --git a/test/fixtures/python/corpus/string.diffA-B.txt b/test/fixtures/python/corpus/string.diffA-B.txt index 53f220d04..b8c7007ec 100644 --- a/test/fixtures/python/corpus/string.diffA-B.txt +++ b/test/fixtures/python/corpus/string.diffA-B.txt @@ -1,12 +1,12 @@ (Statements {+(TextElement)+} (TextElement) +{+(TextElement)+} +{+(TextElement)+} { (TextElement) ->(TextElement) } {+(TextElement)+} {+(TextElement)+} -{+(TextElement)+} -{+(TextElement)+} {-(TextElement)-} {-(TextElement)-} {-(TextElement)-} diff --git a/test/fixtures/python/corpus/string.diffB-A.txt b/test/fixtures/python/corpus/string.diffB-A.txt index d618132d0..2a50b5e11 100644 --- a/test/fixtures/python/corpus/string.diffB-A.txt +++ b/test/fixtures/python/corpus/string.diffB-A.txt @@ -1,15 +1,15 @@ (Statements {-(TextElement)-} (TextElement) -{ (TextElement) -->(TextElement) } -{+(TextElement)+} {+(TextElement)+} { (TextElement) ->(TextElement) } {+(TextElement)+} -{ (TextElement) -->(TextElement) } +{+(TextElement)+} +{+(TextElement)+} +{+(TextElement)+} +{-(TextElement)-} +{-(TextElement)-} {-(TextElement)-} {-(TextElement)-} (TextElement) diff --git a/test/fixtures/python/corpus/unary-operator.diffB-A.txt b/test/fixtures/python/corpus/unary-operator.diffB-A.txt index 00f0a0845..a0086cd4b 100644 --- a/test/fixtures/python/corpus/unary-operator.diffB-A.txt +++ b/test/fixtures/python/corpus/unary-operator.diffB-A.txt @@ -2,10 +2,9 @@ {+(Negate {+(Identifier)+})+} {+(Identifier)+} -{+(Complement - {+(Identifier)+})+} -{-(Complement - {-(Identifier)-})-} + (Complement + { (Identifier) + ->(Identifier) }) {-(Negate {-(Identifier)-})-} {-(Identifier)-}) diff --git a/test/fixtures/ruby/corpus/and-or.diffA-B.txt b/test/fixtures/ruby/corpus/and-or.diffA-B.txt index 6001a69d8..bb7f2bcad 100644 --- a/test/fixtures/ruby/corpus/and-or.diffA-B.txt +++ b/test/fixtures/ruby/corpus/and-or.diffA-B.txt @@ -1,13 +1,13 @@ (Statements -{+(LowOr +{+(LowPrecedenceOr {+(Send {+(Identifier)+})+} {+(Send {+(Identifier)+})+})+} - (LowAnd + (LowPrecedenceAnd { (Send {-(Identifier)-}) - ->(LowOr + ->(LowPrecedenceOr {+(Send {+(Identifier)+})+} {+(Send diff --git a/test/fixtures/ruby/corpus/and-or.diffB-A.txt b/test/fixtures/ruby/corpus/and-or.diffB-A.txt index e594e31db..00922fd98 100644 --- a/test/fixtures/ruby/corpus/and-or.diffB-A.txt +++ b/test/fixtures/ruby/corpus/and-or.diffB-A.txt @@ -1,16 +1,16 @@ (Statements -{+(LowAnd +{+(LowPrecedenceAnd {+(Send {+(Identifier)+})+} {+(Send {+(Identifier)+})+})+} -{-(LowOr +{-(LowPrecedenceOr {-(Send {-(Identifier)-})-} {-(Send {-(Identifier)-})-})-} -{-(LowAnd - {-(LowOr +{-(LowPrecedenceAnd + {-(LowPrecedenceOr {-(Send {-(Identifier)-})-} {-(Send diff --git a/test/fixtures/ruby/corpus/and-or.parseA.txt b/test/fixtures/ruby/corpus/and-or.parseA.txt index 0267bc80c..cb6c2ab49 100644 --- a/test/fixtures/ruby/corpus/and-or.parseA.txt +++ b/test/fixtures/ruby/corpus/and-or.parseA.txt @@ -1,5 +1,5 @@ (Statements - (LowAnd + (LowPrecedenceAnd (Send (Identifier)) (Send diff --git a/test/fixtures/ruby/corpus/and-or.parseB.txt b/test/fixtures/ruby/corpus/and-or.parseB.txt index 64d04781c..2a0a6e646 100644 --- a/test/fixtures/ruby/corpus/and-or.parseB.txt +++ b/test/fixtures/ruby/corpus/and-or.parseB.txt @@ -1,11 +1,11 @@ (Statements - (LowOr + (LowPrecedenceOr (Send (Identifier)) (Send (Identifier))) - (LowAnd - (LowOr + (LowPrecedenceAnd + (LowPrecedenceOr (Send (Identifier)) (Send diff --git a/test/fixtures/ruby/corpus/binary.parseA.txt b/test/fixtures/ruby/corpus/binary.parseA.txt index 2e3cdc250..18236c726 100644 --- a/test/fixtures/ruby/corpus/binary.parseA.txt +++ b/test/fixtures/ruby/corpus/binary.parseA.txt @@ -4,12 +4,12 @@ (Identifier)) (Send (Identifier))) - (LowAnd + (LowPrecedenceAnd (Send (Identifier)) (Send (Identifier))) - (LowOr + (LowPrecedenceOr (Send (Identifier)) (Send diff --git a/test/fixtures/ruby/corpus/bitwise-operator.diffA-B.txt b/test/fixtures/ruby/corpus/bitwise-operator.diffA-B.txt index 46752e4d7..12f9a06f8 100644 --- a/test/fixtures/ruby/corpus/bitwise-operator.diffA-B.txt +++ b/test/fixtures/ruby/corpus/bitwise-operator.diffA-B.txt @@ -1,19 +1,19 @@ (Statements -{ (BOr - {-(Send - {-(Identifier)-})-} - {-(Send - {-(Identifier)-})-}) -->(BAnd +{+(BAnd {+(Send {+(Identifier)+})+} {+(Send - {+(Identifier)+})+}) } + {+(Identifier)+})+})+} {+(LShift {+(Send {+(Identifier)+})+} {+(Send {+(Identifier)+})+})+} +{-(BOr + {-(Send + {-(Identifier)-})-} + {-(Send + {-(Identifier)-})-})-} {-(RShift {-(Send {-(Identifier)-})-} diff --git a/test/fixtures/ruby/corpus/bitwise-operator.diffB-A.txt b/test/fixtures/ruby/corpus/bitwise-operator.diffB-A.txt index 63873b8c9..b900aad88 100644 --- a/test/fixtures/ruby/corpus/bitwise-operator.diffB-A.txt +++ b/test/fixtures/ruby/corpus/bitwise-operator.diffB-A.txt @@ -1,14 +1,9 @@ (Statements -{ (BAnd - {-(Send - {-(Identifier)-})-} - {-(Send - {-(Identifier)-})-}) -->(BOr +{+(BOr {+(Send {+(Identifier)+})+} {+(Send - {+(Identifier)+})+}) } + {+(Identifier)+})+})+} {+(RShift {+(Send {+(Identifier)+})+} @@ -19,6 +14,11 @@ {+(Identifier)+})+} {+(Send {+(Identifier)+})+})+} +{-(BAnd + {-(Send + {-(Identifier)-})-} + {-(Send + {-(Identifier)-})-})-} {-(LShift {-(Send {-(Identifier)-})-} diff --git a/test/fixtures/ruby/corpus/boolean-operator.diffA-B.txt b/test/fixtures/ruby/corpus/boolean-operator.diffA-B.txt index 5cf1cd77c..98ecfbae4 100644 --- a/test/fixtures/ruby/corpus/boolean-operator.diffA-B.txt +++ b/test/fixtures/ruby/corpus/boolean-operator.diffA-B.txt @@ -1,11 +1,11 @@ (Statements -{ (Or - {-(Send - {-(Identifier)-})-} - {-(Send - {-(Identifier)-})-}) -->(And +{+(And {+(Send {+(Identifier)+})+} {+(Send - {+(Identifier)+})+}) }) + {+(Identifier)+})+})+} +{-(Or + {-(Send + {-(Identifier)-})-} + {-(Send + {-(Identifier)-})-})-}) diff --git a/test/fixtures/ruby/corpus/boolean-operator.diffB-A.txt b/test/fixtures/ruby/corpus/boolean-operator.diffB-A.txt index f1c2b9ff3..0ac55d751 100644 --- a/test/fixtures/ruby/corpus/boolean-operator.diffB-A.txt +++ b/test/fixtures/ruby/corpus/boolean-operator.diffB-A.txt @@ -1,11 +1,11 @@ (Statements -{ (And - {-(Send - {-(Identifier)-})-} - {-(Send - {-(Identifier)-})-}) -->(Or +{+(Or {+(Send {+(Identifier)+})+} {+(Send - {+(Identifier)+})+}) }) + {+(Identifier)+})+})+} +{-(And + {-(Send + {-(Identifier)-})-} + {-(Send + {-(Identifier)-})-})-}) diff --git a/test/fixtures/ruby/corpus/comparision-operator.diffA-B.txt b/test/fixtures/ruby/corpus/comparision-operator.diffA-B.txt index 855900d22..b9c350b1d 100644 --- a/test/fixtures/ruby/corpus/comparision-operator.diffA-B.txt +++ b/test/fixtures/ruby/corpus/comparision-operator.diffA-B.txt @@ -1,19 +1,19 @@ (Statements -{ (LessThan - {-(Send - {-(Identifier)-})-} - {-(Send - {-(Identifier)-})-}) -->(LessThanEqual +{+(LessThanEqual {+(Send {+(Identifier)+})+} {+(Send - {+(Identifier)+})+}) } + {+(Identifier)+})+})+} {+(GreaterThanEqual {+(Send {+(Identifier)+})+} {+(Send {+(Identifier)+})+})+} +{-(LessThan + {-(Send + {-(Identifier)-})-} + {-(Send + {-(Identifier)-})-})-} {-(GreaterThan {-(Send {-(Identifier)-})-} diff --git a/test/fixtures/ruby/corpus/comparision-operator.diffB-A.txt b/test/fixtures/ruby/corpus/comparision-operator.diffB-A.txt index ec4379f2b..b9530b0cd 100644 --- a/test/fixtures/ruby/corpus/comparision-operator.diffB-A.txt +++ b/test/fixtures/ruby/corpus/comparision-operator.diffB-A.txt @@ -1,19 +1,19 @@ (Statements -{ (LessThanEqual - {-(Send - {-(Identifier)-})-} - {-(Send - {-(Identifier)-})-}) -->(LessThan +{+(LessThan {+(Send {+(Identifier)+})+} {+(Send - {+(Identifier)+})+}) } + {+(Identifier)+})+})+} {+(GreaterThan {+(Send {+(Identifier)+})+} {+(Send {+(Identifier)+})+})+} +{-(LessThanEqual + {-(Send + {-(Identifier)-})-} + {-(Send + {-(Identifier)-})-})-} {-(GreaterThanEqual {-(Send {-(Identifier)-})-} diff --git a/test/fixtures/ruby/corpus/delimiter.diffA-B.txt b/test/fixtures/ruby/corpus/delimiter.diffA-B.txt index 38a6e80fd..08ea7c6ad 100644 --- a/test/fixtures/ruby/corpus/delimiter.diffA-B.txt +++ b/test/fixtures/ruby/corpus/delimiter.diffA-B.txt @@ -1,12 +1,12 @@ (Statements {+(TextElement)+} {+(TextElement)+} -{ (TextElement) -->(TextElement) } -{ (TextElement) -->(TextElement) } {+(TextElement)+} {+(TextElement)+} +{+(TextElement)+} +{+(TextElement)+} +{-(TextElement)-} +{-(TextElement)-} {-(TextElement)-} {-(TextElement)-} {-(TextElement)-} diff --git a/test/fixtures/ruby/corpus/delimiter.diffB-A.txt b/test/fixtures/ruby/corpus/delimiter.diffB-A.txt index b29b1ec5a..08ea7c6ad 100644 --- a/test/fixtures/ruby/corpus/delimiter.diffB-A.txt +++ b/test/fixtures/ruby/corpus/delimiter.diffB-A.txt @@ -4,8 +4,8 @@ {+(TextElement)+} {+(TextElement)+} {+(TextElement)+} -{ (TextElement) -->(TextElement) } +{+(TextElement)+} +{-(TextElement)-} {-(TextElement)-} {-(TextElement)-} {-(TextElement)-} diff --git a/test/fixtures/ruby/corpus/hash.diffA-B.txt b/test/fixtures/ruby/corpus/hash.diffA-B.txt index bf1a1d711..0e5ab9818 100644 --- a/test/fixtures/ruby/corpus/hash.diffA-B.txt +++ b/test/fixtures/ruby/corpus/hash.diffA-B.txt @@ -1,23 +1,20 @@ (Statements (Hash - {+(KeyValue - {+(Symbol)+} - {+(TextElement)+})+} - {+(KeyValue - {+(Symbol)+} - {+(Integer)+})+} - {+(KeyValue - {+(Symbol)+} - {+(Boolean)+})+} - {-(KeyValue - {-(Symbol)-} - {-(TextElement)-})-} - {-(KeyValue - {-(Symbol)-} - {-(Integer)-})-} - {-(KeyValue - {-(TextElement)-} - {-(Boolean)-})-} + (KeyValue + { (Symbol) + ->(Symbol) } + { (TextElement) + ->(TextElement) }) + (KeyValue + { (Symbol) + ->(Symbol) } + { (Integer) + ->(Integer) }) + (KeyValue + { (TextElement) + ->(Symbol) } + { (Boolean) + ->(Boolean) }) {-(KeyValue {-(Symbol)-} {-(Integer)-})-}) diff --git a/test/fixtures/ruby/corpus/hash.diffB-A.txt b/test/fixtures/ruby/corpus/hash.diffB-A.txt index 451f828fb..e93b7d8d4 100644 --- a/test/fixtures/ruby/corpus/hash.diffB-A.txt +++ b/test/fixtures/ruby/corpus/hash.diffB-A.txt @@ -1,25 +1,23 @@ (Statements (Hash - {+(KeyValue - {+(Symbol)+} - {+(TextElement)+})+} (KeyValue { (Symbol) ->(Symbol) } { (TextElement) + ->(TextElement) }) + (KeyValue + { (Symbol) + ->(Symbol) } + { (Integer) ->(Integer) }) - {+(KeyValue - {+(TextElement)+} - {+(Boolean)+})+} + (KeyValue + { (Symbol) + ->(TextElement) } + { (Boolean) + ->(Boolean) }) {+(KeyValue {+(Symbol)+} - {+(Integer)+})+} - {-(KeyValue - {-(Symbol)-} - {-(Integer)-})-} - {-(KeyValue - {-(Symbol)-} - {-(Boolean)-})-}) + {+(Integer)+})+}) {+(Hash)+} {+(Hash {+(Context diff --git a/test/fixtures/ruby/corpus/number.diffA-B.txt b/test/fixtures/ruby/corpus/number.diffA-B.txt index 3abef44c1..597e35f80 100644 --- a/test/fixtures/ruby/corpus/number.diffA-B.txt +++ b/test/fixtures/ruby/corpus/number.diffA-B.txt @@ -1,5 +1,6 @@ (Statements -{+(Integer)+} +{ (Integer) +->(Integer) } {+(Integer)+} {+(Integer)+} {+(Integer)+} @@ -11,5 +12,4 @@ {-(Integer)-} {-(Integer)-} {-(Integer)-} -{-(Integer)-} {-(Float)-}) diff --git a/test/fixtures/ruby/corpus/number.diffB-A.txt b/test/fixtures/ruby/corpus/number.diffB-A.txt index 3e5155e3a..a815bd847 100644 --- a/test/fixtures/ruby/corpus/number.diffB-A.txt +++ b/test/fixtures/ruby/corpus/number.diffB-A.txt @@ -1,15 +1,15 @@ (Statements +{ (Integer) +->(Integer) } {+(Integer)+} { (Integer) ->(Integer) } {+(Integer)+} -{+(Integer)+} -{+(Integer)+} { (Integer) ->(Integer) } +{+(Integer)+} {+(Float)+} {-(Integer)-} {-(Integer)-} {-(Integer)-} -{-(Integer)-} {-(Float)-}) diff --git a/test/fixtures/ruby/corpus/relational-operator.diffA-B.txt b/test/fixtures/ruby/corpus/relational-operator.diffA-B.txt index d4d5b5c27..5e5247eed 100644 --- a/test/fixtures/ruby/corpus/relational-operator.diffA-B.txt +++ b/test/fixtures/ruby/corpus/relational-operator.diffA-B.txt @@ -1,14 +1,9 @@ (Statements -{ (Equal - {-(Send - {-(Identifier)-})-} - {-(Send - {-(Identifier)-})-}) -->(Comparison +{+(Comparison {+(Send {+(Identifier)+})+} {+(Send - {+(Identifier)+})+}) } + {+(Identifier)+})+})+} {+(Matches {+(Send {+(Identifier)+})+} @@ -19,6 +14,11 @@ {+(Not {+(Send {+(Identifier)+})+})+})+} +{-(Equal + {-(Send + {-(Identifier)-})-} + {-(Send + {-(Identifier)-})-})-} {-(Not {-(Equal {-(Send diff --git a/test/fixtures/ruby/corpus/relational-operator.diffB-A.txt b/test/fixtures/ruby/corpus/relational-operator.diffB-A.txt index c80173643..8da93eabf 100644 --- a/test/fixtures/ruby/corpus/relational-operator.diffB-A.txt +++ b/test/fixtures/ruby/corpus/relational-operator.diffB-A.txt @@ -1,14 +1,9 @@ (Statements -{ (Comparison - {-(Send - {-(Identifier)-})-} - {-(Send - {-(Identifier)-})-}) -->(Equal +{+(Equal {+(Send {+(Identifier)+})+} {+(Send - {+(Identifier)+})+}) } + {+(Identifier)+})+})+} {+(Not {+(Equal {+(Send @@ -20,6 +15,11 @@ {+(Identifier)+})+} {+(Send {+(Identifier)+})+})+} +{-(Comparison + {-(Send + {-(Identifier)-})-} + {-(Send + {-(Identifier)-})-})-} {-(Matches {-(Send {-(Identifier)-})-} diff --git a/test/fixtures/ruby/corpus/symbol.diffA-B.txt b/test/fixtures/ruby/corpus/symbol.diffA-B.txt index 8a4097008..d30cef941 100644 --- a/test/fixtures/ruby/corpus/symbol.diffA-B.txt +++ b/test/fixtures/ruby/corpus/symbol.diffA-B.txt @@ -1,7 +1,7 @@ (Statements +{+(Symbol)+} { (Symbol) ->(Symbol) } { (Symbol) ->(Symbol) } -{ (Symbol) -->(Symbol) }) +{-(Symbol)-}) diff --git a/test/fixtures/ruby/corpus/symbol.diffB-A.txt b/test/fixtures/ruby/corpus/symbol.diffB-A.txt index 8a4097008..4711d610e 100644 --- a/test/fixtures/ruby/corpus/symbol.diffB-A.txt +++ b/test/fixtures/ruby/corpus/symbol.diffB-A.txt @@ -1,7 +1,7 @@ (Statements -{ (Symbol) -->(Symbol) } -{ (Symbol) -->(Symbol) } -{ (Symbol) -->(Symbol) }) +{+(Symbol)+} +{+(Symbol)+} +{+(Symbol)+} +{-(Symbol)-} +{-(Symbol)-} +{-(Symbol)-}) diff --git a/test/fixtures/typescript/corpus/boolean-operator.diffA-B.txt b/test/fixtures/typescript/corpus/boolean-operator.diffA-B.txt index a257366e8..6eb4374fd 100644 --- a/test/fixtures/typescript/corpus/boolean-operator.diffA-B.txt +++ b/test/fixtures/typescript/corpus/boolean-operator.diffA-B.txt @@ -1,7 +1,7 @@ (Statements -{ (Or - {-(Identifier)-} - {-(Identifier)-}) -->(And +{+(And {+(Identifier)+} - {+(Identifier)+}) }) + {+(Identifier)+})+} +{-(Or + {-(Identifier)-} + {-(Identifier)-})-}) diff --git a/test/fixtures/typescript/corpus/boolean-operator.diffB-A.txt b/test/fixtures/typescript/corpus/boolean-operator.diffB-A.txt index ef610ad5c..77b373871 100644 --- a/test/fixtures/typescript/corpus/boolean-operator.diffB-A.txt +++ b/test/fixtures/typescript/corpus/boolean-operator.diffB-A.txt @@ -1,7 +1,7 @@ (Statements -{ (And - {-(Identifier)-} - {-(Identifier)-}) -->(Or +{+(Or {+(Identifier)+} - {+(Identifier)+}) }) + {+(Identifier)+})+} +{-(And + {-(Identifier)-} + {-(Identifier)-})-}) diff --git a/test/fixtures/typescript/corpus/export.diffA-B.txt b/test/fixtures/typescript/corpus/export.diffA-B.txt index 2d05a4ca2..a4bb6d82b 100644 --- a/test/fixtures/typescript/corpus/export.diffA-B.txt +++ b/test/fixtures/typescript/corpus/export.diffA-B.txt @@ -35,15 +35,15 @@ (Identifier) { (Empty) ->(Identifier) }) + {+(Assignment + {+(Empty)+} + {+(Identifier)+} + {+(Empty)+})+} (Assignment (Empty) { (Identifier) ->(Identifier) } - (Empty)) - {+(Assignment - {+(Empty)+} - {+(Identifier)+} - {+(Empty)+})+})) + (Empty)))) (DefaultExport { (Identifier) ->(Identifier) }) diff --git a/test/fixtures/typescript/corpus/export.diffB-A.txt b/test/fixtures/typescript/corpus/export.diffB-A.txt index 25c78e485..e2f1d19fb 100644 --- a/test/fixtures/typescript/corpus/export.diffB-A.txt +++ b/test/fixtures/typescript/corpus/export.diffB-A.txt @@ -35,11 +35,14 @@ (Identifier) { (Identifier) ->(Empty) }) - (Assignment - (Empty) - { (Identifier) - ->(Identifier) } - (Empty)) + {+(Assignment + {+(Empty)+} + {+(Identifier)+} + {+(Empty)+})+} + {-(Assignment + {-(Empty)-} + {-(Identifier)-} + {-(Empty)-})-} {-(Assignment {-(Empty)-} {-(Identifier)-} diff --git a/test/fixtures/typescript/corpus/import.diffA-B.txt b/test/fixtures/typescript/corpus/import.diffA-B.txt index 0fd6b3985..c6936b321 100644 --- a/test/fixtures/typescript/corpus/import.diffA-B.txt +++ b/test/fixtures/typescript/corpus/import.diffA-B.txt @@ -1,12 +1,8 @@ (Statements -{ (Import) -->(Import) } -{ (QualifiedAliasedImport - {-(Identifier)-}) -->(QualifiedAliasedImport - {+(Identifier)+}) } -{ (Import) -->(Import) } +{+(Import)+} +{+(QualifiedAliasedImport + {+(Identifier)+})+} +{+(Import)+} {+(Import)+} {+(Import)+} {+(Statements @@ -18,6 +14,10 @@ {+(Identifier)+})+})+} {+(SideEffectImport)+} {-(Import)-} +{-(QualifiedAliasedImport + {-(Identifier)-})-} +{-(Import)-} +{-(Import)-} {-(Import)-} {-(Statements {-(Import)-} diff --git a/test/fixtures/typescript/corpus/import.diffB-A.txt b/test/fixtures/typescript/corpus/import.diffB-A.txt index 4379f8cbe..e7f961a71 100644 --- a/test/fixtures/typescript/corpus/import.diffB-A.txt +++ b/test/fixtures/typescript/corpus/import.diffB-A.txt @@ -1,12 +1,8 @@ (Statements -{ (Import) -->(Import) } -{ (QualifiedAliasedImport - {-(Identifier)-}) -->(QualifiedAliasedImport - {+(Identifier)+}) } -{ (Import) -->(Import) } +{+(Import)+} +{+(QualifiedAliasedImport + {+(Identifier)+})+} +{+(Import)+} {+(Import)+} {+(Import)+} {+(Statements @@ -17,8 +13,10 @@ {+(QualifiedAliasedImport {+(Identifier)+})+})+} {+(SideEffectImport)+} -{+(QualifiedAliasedImport - {+(Identifier)+})+} +{+(QualifiedAliasedImport{+(Identifier)+})+} +{-(Import)-} +{-(QualifiedAliasedImport{-(Identifier)-})-} +{-(Import)-} {-(Import)-} {-(Import)-} {-(Statements diff --git a/test/fixtures/typescript/corpus/public-field-definition.diffA-B.txt b/test/fixtures/typescript/corpus/public-field-definition.diffA-B.txt index b9c715434..a183f7984 100644 --- a/test/fixtures/typescript/corpus/public-field-definition.diffA-B.txt +++ b/test/fixtures/typescript/corpus/public-field-definition.diffA-B.txt @@ -59,28 +59,43 @@ (TypeIdentifier)) (Identifier) (Float)) - (PublicFieldDefinition + {+(PublicFieldDefinition {+(Identifier)+} + {+(Readonly)+} + {+(Annotation + {+(TypeIdentifier)+})+} + {+(Identifier)+} + {+(TextElement)+})+} + {+(PublicFieldDefinition + {+(Empty)+} + {+(Empty)+} + {+(Annotation + {+(TypeIdentifier)+})+} + {+(Identifier)+} + {+(Float)+})+} + {+(PublicFieldDefinition + {+(Empty)+} + {+(Empty)+} + {+(Empty)+} + {+(Identifier)+} + {+(Float)+})+} + {-(PublicFieldDefinition {-(Empty)-} - (Readonly) - (Annotation - { (TypeIdentifier) - ->(TypeIdentifier) }) - (Identifier) - { (Float) - ->(TextElement) }) - (PublicFieldDefinition - (Empty) - (Empty) - (Annotation - (TypeIdentifier)) - { (Identifier) - ->(Identifier) } - (Float)) - (PublicFieldDefinition - (Empty) - (Empty) - (Empty) - (Identifier) - { (Float) - ->(Float) })))) + {-(Readonly)-} + {-(Annotation + {-(TypeIdentifier)-})-} + {-(Identifier)-} + {-(Float)-})-} + {-(PublicFieldDefinition + {-(Empty)-} + {-(Empty)-} + {-(Annotation + {-(TypeIdentifier)-})-} + {-(Identifier)-} + {-(Float)-})-} + {-(PublicFieldDefinition + {-(Empty)-} + {-(Empty)-} + {-(Empty)-} + {-(Identifier)-} + {-(Float)-})-}))) diff --git a/test/fixtures/typescript/corpus/public-field-definition.diffB-A.txt b/test/fixtures/typescript/corpus/public-field-definition.diffB-A.txt index 8b6d14ff2..664aca00b 100644 --- a/test/fixtures/typescript/corpus/public-field-definition.diffB-A.txt +++ b/test/fixtures/typescript/corpus/public-field-definition.diffB-A.txt @@ -59,28 +59,43 @@ (TypeIdentifier)) (Identifier) (Float)) - (PublicFieldDefinition + {+(PublicFieldDefinition {+(Empty)+} + {+(Readonly)+} + {+(Annotation + {+(TypeIdentifier)+})+} + {+(Identifier)+} + {+(Float)+})+} + {+(PublicFieldDefinition + {+(Empty)+} + {+(Empty)+} + {+(Annotation + {+(TypeIdentifier)+})+} + {+(Identifier)+} + {+(Float)+})+} + {+(PublicFieldDefinition + {+(Empty)+} + {+(Empty)+} + {+(Empty)+} + {+(Identifier)+} + {+(Float)+})+} + {-(PublicFieldDefinition {-(Identifier)-} - (Readonly) - (Annotation - { (TypeIdentifier) - ->(TypeIdentifier) }) - (Identifier) - { (TextElement) - ->(Float) }) - (PublicFieldDefinition - (Empty) - (Empty) - (Annotation - (TypeIdentifier)) - { (Identifier) - ->(Identifier) } - (Float)) - (PublicFieldDefinition - (Empty) - (Empty) - (Empty) - (Identifier) - { (Float) - ->(Float) })))) + {-(Readonly)-} + {-(Annotation + {-(TypeIdentifier)-})-} + {-(Identifier)-} + {-(TextElement)-})-} + {-(PublicFieldDefinition + {-(Empty)-} + {-(Empty)-} + {-(Annotation + {-(TypeIdentifier)-})-} + {-(Identifier)-} + {-(Float)-})-} + {-(PublicFieldDefinition + {-(Empty)-} + {-(Empty)-} + {-(Empty)-} + {-(Identifier)-} + {-(Float)-})-}))) diff --git a/test/fixtures/typescript/corpus/relational-operator.diffA-B.txt b/test/fixtures/typescript/corpus/relational-operator.diffA-B.txt index d98198807..427544e8f 100644 --- a/test/fixtures/typescript/corpus/relational-operator.diffA-B.txt +++ b/test/fixtures/typescript/corpus/relational-operator.diffA-B.txt @@ -1,7 +1,7 @@ (Statements -{ (LessThan - {-(Identifier)-} - {-(Identifier)-}) -->(LessThanEqual +{+(LessThanEqual {+(Identifier)+} - {+(Identifier)+}) }) + {+(Identifier)+})+} +{-(LessThan + {-(Identifier)-} + {-(Identifier)-})-}) diff --git a/test/fixtures/typescript/corpus/relational-operator.diffB-A.txt b/test/fixtures/typescript/corpus/relational-operator.diffB-A.txt index 17bca315b..0272c61d9 100644 --- a/test/fixtures/typescript/corpus/relational-operator.diffB-A.txt +++ b/test/fixtures/typescript/corpus/relational-operator.diffB-A.txt @@ -1,7 +1,7 @@ (Statements -{ (LessThanEqual - {-(Identifier)-} - {-(Identifier)-}) -->(LessThan +{+(LessThan {+(Identifier)+} - {+(Identifier)+}) }) + {+(Identifier)+})+} +{-(LessThanEqual + {-(Identifier)-} + {-(Identifier)-})-}) diff --git a/vendor/effects b/vendor/effects index 8181375d6..f1f98bb60 160000 --- a/vendor/effects +++ b/vendor/effects @@ -1 +1 @@ -Subproject commit 8181375d6386de302a8c9807dad2f096e8d490aa +Subproject commit f1f98bb60f7df34359f4a6e1487353a0c644311b diff --git a/vendor/grpc-haskell b/vendor/grpc-haskell deleted file mode 160000 index 96e42fe13..000000000 --- a/vendor/grpc-haskell +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 96e42fe1383a4d8a2694c26ca592233aabd2b265 diff --git a/vendor/haskell-tree-sitter b/vendor/haskell-tree-sitter index 6176c8c8e..9ada8cc48 160000 --- a/vendor/haskell-tree-sitter +++ b/vendor/haskell-tree-sitter @@ -1 +1 @@ -Subproject commit 6176c8c8e7c59760a881a2487d81bcbdb26efe9c +Subproject commit 9ada8cc48be1a25b971aca1a49c0963897c09d7c