chore: add template

This commit is contained in:
2025-11-19 22:56:20 +09:00
parent 17414e5e3a
commit 0853a65e3b
7 changed files with 25 additions and 31 deletions

16
.github/template.yml vendored
View File

@@ -1,16 +0,0 @@
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"

5
.gitignore vendored
View File

@@ -1,5 +1,3 @@
# Created by https://www.toptal.com/developers/gitignore/api/haskell
# Edit at https://www.toptal.com/developers/gitignore?templates=haskell
### Haskell ###
dist
@@ -26,5 +24,4 @@ cabal.project.local~
.HTF/
.ghc.environment.*
# End of https://www.toptal.com/developers/gitignore/api/haskell
example-project.cabal

View File

@@ -1 +1,7 @@
# {{ project_name }}
# example-project
## Build
```
hpack
cabal build
```

View File

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

View File

@@ -1,8 +1,8 @@
name: {{ project_name }}
name: example-project
version: 0.1.0.0
license: MIT
author: "{{ author_name }}"
maintainer: "{{ author_email }}"
author: "mincomk"
maintainer: "mail@drchi.co.kr"
extra-source-files:
- README.md
@@ -23,23 +23,23 @@ library:
- base
executables:
{{ project_name }}:
example-project:
main: Main.hs
source-dirs: app
ghc-options: -threaded -rtsopts -with-rtsopts=-N
dependencies:
- base
- {{ project_name }}
- example-project
tests:
{{ project_name }}-test:
example-project-test:
main: Main.hs
source-dirs: test
dependencies:
- base
- {{ project_name }}
- example-project
- tasty
- tasty-hunit

7
scripts/hello.hs Executable file
View File

@@ -0,0 +1,7 @@
#! /usr/bin/env cabal
{- cabal:
build-depends: base
-}
main :: IO ()
main = putStrLn "Hello, world!"

View File

@@ -19,7 +19,7 @@ main :: IO ()
main = spec >>= defaultMain
spec :: IO TestTree
spec = return $ testGroup "{{ project_name }} tests" [baseTests]
spec = return $ testGroup "example tests" [baseTests]
baseTests :: TestTree
baseTests =