cabal-version:       2.2
name:                hslua-examples
version:             2.0.0
synopsis:            Examples of how to combine Haskell and Lua.
description:         The HsLua modules provide wrappers of Lua language
                     interpreter as described on the official
                     <https://www.lua.org/ Lua website).
                     .
                     This package contains example programs, demonstrating
                     the possibility to work with Lua from within Haskell
                     and /vice versa/.
homepage:            https://hslua.org/
bug-reports:         https://github.com/hslua/hslua/issues
license:             MIT
license-File:        LICENSE
author:              Albert Krewinkel
copyright:           © 2020–2021 Albert Krewinkel
maintainer:          Albert Krewinkel <albert+hslua@zeitkraut.de>
category:            Foreign
build-type:          Simple
extra-source-files:  README.md
                     CHANGELOG.md
                     wishlist/filter.lua

source-repository head
  type:                git
  location:            https://github.com/hslua/hslua.git
  subdir:              hslua-examples

common common-options
  default-language:    Haskell2010
  build-depends:       base              >= 4.9 && < 5
  ghc-options:         -Wall
                       -Wincomplete-record-updates
                       -Wnoncanonical-monad-instances
                       -Wredundant-constraints
  if impl(ghc >= 8.2)
    ghc-options:         -Wcpp-undef
                         -Werror=missing-home-modules
  if impl(ghc >= 8.4)
    ghc-options:         -Widentities
                         -Wincomplete-uni-patterns
                         -Wpartial-fields
                         -fhide-source-paths

executable print-version
  import:              common-options
  main-is:             print-version.hs
  hs-source-dirs:      print-version
  build-depends:       lua               >= 2.0 && < 2.1

executable run-lua
  import:              common-options
  main-is:             run-lua.hs
  hs-source-dirs:      run-lua
  build-depends:       bytestring
                     , hslua             >= 2.0 && < 2.1

executable wishlist
  import:              common-options
  main-is:             wishlist.hs
  hs-source-dirs:      wishlist
  build-depends:       bytestring
                     , hslua             >= 2.0 && < 2.1
                     , hslua-marshalling >= 2.0 && < 2.1
                     , text

executable factorial
  import:              common-options
  main-is:             factorial.hs
  hs-source-dirs:      factorial
  build-depends:       bytestring
                     , hslua             >= 2.0 && < 2.1

executable low-level-factorial
  import:              common-options
  main-is:             low-level-factorial.hs
  hs-source-dirs:      low-level-factorial
  build-depends:       lua               >= 2.0 && < 2.1