ToyLib is my Haskell library for solving AtCoder problems.
toy-lib-exe
is the source file bunlder.
Generate a template that bundles all the source files:
$ cabal run toy-lib-exe > template.hs
Minify the toy-lib modules and their dependencies into one line:
$ cabal run toy-lib-exe -m Data.Graph.Sparse Data.UnionFind.Mutable
Embed toy-lib modules:
$ cat Example.hs
-- {{{ toy-lib import
import Math.Manhattan
-- }}} toy-lib import
$ cabal run toy-lib-exe -e Examle.hs
rot45 :: (Int, Int) -> (Int, Int);rot45 (!x, !y) = (x - y, x + y)
As of 2024, AtCoder is using GHC 9.4.5 (Source: AtCoder judge environment 2023, the spreadsheet), which roughly corresponds to lts-21.7).
I'm using GHC 9.4.6 in this repository for using recent version of HLS. See also: GHC version support.
No exports are assumed, as they're bundled into one file (Main.hs
):
ghc-options:
- -Wno-missing-export-lists
We're using Haskell2010
because haskell-src-exts
(the parser) does not understand GHC2021
, but all the extensions enabled by it are enabled as default-extensisons
:
default-language: Haskell2010
default-extensions:
- BangPatterns
# and lots more
Run doctest
via REPL:
$ cabal repl --with-ghc=doctest --repl-options='-w -Wdefault'
Run haddock
from command line:
$ cabal haddock
$ cabal haddock --open
We have limitations coming from haskell-src-exts:
-
Can't use
MultiWayIf
haskell-src-exts
does not understand it well. -
Can't use
GHC2021
syntax
For exampleimport X qualified as Y
is not available.
- cojna/iota iota is surely the best resource!
- meooow25/haccepted Beautiful library compatible with Codeforces.
- minoki/my-atcoder-solutions Solutions to EDPC and more.
- unnohideyuki/AtHaskell
- mizunashi-mana/haskell-atcoder-template