g2q (empty) → 0.1.0.0
raw patch · 6 files changed
+89/−0 lines, 6 filesdep +basedep +g2setup-changed
Dependencies added: base, g2
Files
- ChangeLog.md +5/−0
- LICENSE +30/−0
- README.md +15/−0
- Setup.hs +2/−0
- g2q.cabal +31/−0
- src/G2Q/Interface.hs +6/−0
+ ChangeLog.md view
@@ -0,0 +1,5 @@+# Revision history for g2q++## 0.1.0.0 -- YYYY-mm-dd++* First version. Released on an unsuspecting world.
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright (c) 2019, William Hallahan, Anton Xue++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 William Hallahan, Anton Xue 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.
+ README.md view
@@ -0,0 +1,15 @@+## G2Q+---+#### About+G2Q allows constraint programming, via writing Haskell predicates.+A quasiquoter, g2, is provided which can take concrete arguments at runtime, and solve for unknown symbolic arguments.++For example, to find inputs from a list xs which sum to a given number n, you can write:+``` +sumToN :: Int -> [Int] -> IO (Maybe [Int])+sumToN = [g2| \(n :: Int) (xs :: [Int]) ->+ ?(ys :: [Int])+ | sum ys == n+ && all (\e -> e `elem` xs) ys+ && length ys >= 1 |]+```
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ g2q.cabal view
@@ -0,0 +1,31 @@+-- Initial g2q.cabal generated by cabal init. For further documentation, +-- see http://haskell.org/cabal/users-guide/++name: g2q+version: 0.1.0.0+synopsis: G2Q allows constraint programming, via writing Haskell predicates.+description: G2Q allows constraint programming, via writing Haskell predicates.+ A quasiquoter, g2, is provided which can take concrete arguments at runtime, and solve for unknown symbolic arguments.+license: BSD3+license-file: LICENSE+author: William Hallahan, Anton Xue+maintainer: william.hallahan@yale.edu+-- copyright: +category: Formal Methods, Symbolic Computation+build-type: Simple+extra-source-files: README.md, ChangeLog.md+cabal-version: >=1.10++source-repository head+ type: git+ location: https://github.com/BillHallahan/G2Q.git+++library+ exposed-modules: G2Q.Interface+ -- other-modules: + -- other-extensions: + build-depends: base >=4.10 && <4.11+ , g2 >= 0.1.0.1 && < 0.1.1.0+ hs-source-dirs: src+ default-language: Haskell2010
+ src/G2Q/Interface.hs view
@@ -0,0 +1,6 @@+module G2Q.Interface ( g2+ , G2Rep (..)+ , derivingG2Rep) where++import G2.QuasiQuotes.QuasiQuotes+import G2.QuasiQuotes.G2Rep