chore: sample1

This commit is contained in:
2025-11-19 22:41:00 +09:00
commit 17414e5e3a
8 changed files with 157 additions and 0 deletions

16
.github/template.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: Haskell Project Template
description: "Haskell project template"
inputs:
project_name:
description: "Name of your new project"
required: true
default: "haskell-template"
author_name:
description: "Author of the project"
required: true
default: "mincomk"
author_email:
description: "Author email of the project"
required: true
default: "mail@drchi.co.kr"

30
.gitignore vendored Normal file
View File

@@ -0,0 +1,30 @@
# Created by https://www.toptal.com/developers/gitignore/api/haskell
# Edit at https://www.toptal.com/developers/gitignore?templates=haskell
### Haskell ###
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.*
# End of https://www.toptal.com/developers/gitignore/api/haskell

20
LICENSE Normal file
View File

@@ -0,0 +1,20 @@
Copyright (c) 2025 minco
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.

1
README.md Normal file
View File

@@ -0,0 +1 @@
# {{ project_name }}

8
app/Main.hs Normal file
View File

@@ -0,0 +1,8 @@
module Main where
import Lib qualified (someFunc)
main :: IO ()
main = do
putStrLn "Hello, Haskell!"
Lib.someFunc

47
package.yaml Normal file
View File

@@ -0,0 +1,47 @@
name: {{ project_name }}
version: 0.1.0.0
license: MIT
author: "{{ author_name }}"
maintainer: "{{ author_email }}"
extra-source-files:
- README.md
dependencies:
- base
- containers
- text
- bytestring
- mtl
- transformers
- unordered-containers
- optics
library:
source-dirs: src
dependencies:
- base
executables:
{{ project_name }}:
main: Main.hs
source-dirs: app
ghc-options: -threaded -rtsopts -with-rtsopts=-N
dependencies:
- base
- {{ project_name }}
tests:
{{ project_name }}-test:
main: Main.hs
source-dirs: test
dependencies:
- base
- {{ project_name }}
- tasty
- tasty-hunit
- tasty-quickcheck
- QuickCheck

4
src/Lib.hs Normal file
View File

@@ -0,0 +1,4 @@
module Lib (someFunc) where
someFunc :: IO ()
someFunc = putStrLn "someFunc"

31
test/Main.hs Normal file
View File

@@ -0,0 +1,31 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main (main) where
import Data.Aeson.Key qualified as K
import Data.Aeson.KeyMap qualified as KM
import Data.List (isInfixOf)
import Data.List qualified as L
import Data.Text qualified as T
import Data.Yaml hiding (Parser)
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck as QC
main :: IO ()
main = spec >>= defaultMain
spec :: IO TestTree
spec = return $ testGroup "{{ project_name }} tests" [baseTests]
baseTests :: TestTree
baseTests =
testGroup
"Base"
[ QC.testProperty "example function works" $
\(num :: Integer) ->
num * 0 == 0
]