diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8f8bfbb --- /dev/null +++ b/.gitignore @@ -0,0 +1,28 @@ +dist +dist-* +cabal-dev +*.o +*.hi +*.hie +*.chi +*.chs.h +*.dyn_o +*.dyn_hi +.hpc +.hsenv +.cabal-sandbox/ +cabal.sandbox.config +*.prof +*.aux +*.hp +*.eventlog +.stack-work/ +cabal.project.local +cabal.project.local~ +.HTF/ +.ghc.environment.* +stack*.yaml.lock +local* +Local* +*~ +*.swp diff --git a/ChangeLog.md b/ChangeLog.md new file mode 100644 index 0000000..9f8d78d --- /dev/null +++ b/ChangeLog.md @@ -0,0 +1,3 @@ +# Changelog for foreign + +## Unreleased changes diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0ad669a --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2022, mu +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/README.md b/README.md new file mode 100644 index 0000000..f748995 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# foreign diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..4467109 --- /dev/null +++ b/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/foreign.cabal b/foreign.cabal new file mode 100644 index 0000000..4600388 --- /dev/null +++ b/foreign.cabal @@ -0,0 +1,54 @@ +cabal-version: 2.4 +name: foreign +version: 0.1.0.0 + +-- synopsis: +description: + Please see the README on Github at + +license: BSD-3-Clause +license-file: LICENSE +copyright: Copyright (c) +author: mu +maintainer: mu@laxcat.xyz +tested-with: GHC ==8.8.4 || ==8.10.7 +category: Foreign +homepage: https://github.com/4eUeP/foreign +bug-reports: https://github.com/4eUeP/foreign/issues +build-type: Simple +extra-source-files: + ChangeLog.md + README.md + +source-repository head + type: git + location: https://github.com/4eUeP/foreign + +library + hs-source-dirs: src + exposed-modules: Lib + build-depends: + , base >=4.11 && <5 + , ghc-prim >=0.5 && <1.0 + , primitive ^>=0.7 + + default-language: Haskell2010 + ghc-options: + -Wall -Wcompat -Widentities -Wincomplete-record-updates + -Wincomplete-uni-patterns -Wpartial-fields -Wredundant-constraints + +test-suite foreign-test + type: exitcode-stdio-1.0 + main-is: Spec.hs + hs-source-dirs: test + build-depends: + , base >=4.11 && <5 + , foreign + , hspec + + default-language: Haskell2010 + build-tool-depends: hspec-discover:hspec-discover >=2 && <3 + ghc-options: + -Wall -Wcompat -Widentities -Wincomplete-record-updates + -Wincomplete-uni-patterns -Wpartial-fields -Wredundant-constraints + -threaded -rtsopts -with-rtsopts=-N diff --git a/src/Lib.hs b/src/Lib.hs new file mode 100644 index 0000000..c5d9b49 --- /dev/null +++ b/src/Lib.hs @@ -0,0 +1,4 @@ +module Lib where + +sum :: Num a => a -> a -> a +sum = (+) diff --git a/test/Spec.hs b/test/Spec.hs new file mode 100644 index 0000000..a824f8c --- /dev/null +++ b/test/Spec.hs @@ -0,0 +1 @@ +{-# OPTIONS_GHC -F -pgmF hspec-discover #-}