1
0
Fork 0

Initial commit.

This commit is contained in:
Jonathan Chan 2018-11-25 18:32:15 -08:00
commit 19c0078549
58 changed files with 358 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.stack-work/
adventofcode.cabal
*~

3
ChangeLog.md Normal file
View File

@ -0,0 +1,3 @@
# Changelog for adventofcode
## Unreleased changes

30
LICENSE Normal file
View File

@ -0,0 +1,30 @@
Copyright Jonathan Chan (c) 2018
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* 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.
* Neither the name of Jonathan Chan nor the names of other
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
OWNER 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.

35
README.md Normal file
View File

@ -0,0 +1,35 @@
# Advent of Code 2018
## Blog Posts
To arrive at [⟨ortho|normal⟩](https://hilb.ert.space) as December comes.
## Runtimes
| Day | Runtime (s) | With `-O2` |
|-----|-------------|------------|
| 01 | |
| 02 | |
| 03 | |
| 04 | |
| 05 | |
| 06 | |
| 07 | |
| 08 | |
| 09 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |

2
Setup.hs Normal file
View File

@ -0,0 +1,2 @@
import Distribution.Simple
main = defaultMain

33
app/Main.hs Normal file
View File

@ -0,0 +1,33 @@
-- Some possibly-useful GHC extensions:
{-# LANGUAGE BangPatterns, TupleSections, ScopedTypeVariables, GADTs, GeneralizedNewtypeDeriving #-}
module Main where
import qualified Day01
import qualified Day02
import qualified Day03
import qualified Day04
import qualified Day05
import qualified Day06
import qualified Day07
import qualified Day08
import qualified Day09
import qualified Day10
import qualified Day11
import qualified Day12
import qualified Day13
import qualified Day14
import qualified Day15
import qualified Day16
import qualified Day17
import qualified Day18
import qualified Day19
import qualified Day20
import qualified Day21
import qualified Day22
import qualified Day23
import qualified Day24
import qualified Day25
main :: IO ()
main = Day01.main

0
input/01.txt Normal file
View File

0
input/02.txt Normal file
View File

0
input/03.txt Normal file
View File

0
input/04.txt Normal file
View File

0
input/05.txt Normal file
View File

0
input/06.txt Normal file
View File

0
input/07.txt Normal file
View File

0
input/08.txt Normal file
View File

0
input/09.txt Normal file
View File

0
input/10.txt Normal file
View File

0
input/11.txt Normal file
View File

0
input/12.txt Normal file
View File

0
input/13.txt Normal file
View File

0
input/14.txt Normal file
View File

0
input/15.txt Normal file
View File

0
input/16.txt Normal file
View File

0
input/17.txt Normal file
View File

0
input/18.txt Normal file
View File

0
input/19.txt Normal file
View File

0
input/20.txt Normal file
View File

0
input/21.txt Normal file
View File

0
input/22.txt Normal file
View File

0
input/23.txt Normal file
View File

0
input/24.txt Normal file
View File

0
input/25.txt Normal file
View File

37
package.yaml Normal file
View File

@ -0,0 +1,37 @@
name: adventofcode
version: 0.1.0.0
github: "ionathanch/adventofcode"
license: BSD3
author: "Jonathan Chan"
maintainer: "afnl686@gmail.com"
copyright: "2018 Jonathan Chan"
extra-source-files:
- README.md
- ChangeLog.md
# Metadata used when publishing your package
# synopsis: Short description of your package
# category: Web
# To avoid duplicated efforts in documentation and dealing with the
# complications of embedding Haddock markup inside cabal files, it is
# common to point users to the README.md file.
description: Please see the README on GitHub at <https://github.com/ionathanch/adventofcode#readme>
dependencies:
- base >= 4.7 && < 5
library:
source-dirs: src
executables:
adventofcode-exe:
main: Main.hs
source-dirs: app
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- adventofcode

6
src/Day01.hs Normal file
View File

@ -0,0 +1,6 @@
module Day01 (main) where
main :: IO ()
main = do
input <- readFile "input/01.txt"
print input

6
src/Day02.hs Normal file
View File

@ -0,0 +1,6 @@
module Day02 (main) where
main :: IO ()
main = do
input <- readFile "input/02.txt"
print input

6
src/Day03.hs Normal file
View File

@ -0,0 +1,6 @@
module Day03 (main) where
main :: IO ()
main = do
input <- readFile "input/03.txt"
print input

6
src/Day04.hs Normal file
View File

@ -0,0 +1,6 @@
module Day04 (main) where
main :: IO ()
main = do
input <- readFile "input/04.txt"
print input

6
src/Day05.hs Normal file
View File

@ -0,0 +1,6 @@
module Day05 (main) where
main :: IO ()
main = do
input <- readFile "input/05.txt"
print input

6
src/Day06.hs Normal file
View File

@ -0,0 +1,6 @@
module Day06 (main) where
main :: IO ()
main = do
input <- readFile "input/06.txt"
print input

6
src/Day07.hs Normal file
View File

@ -0,0 +1,6 @@
module Day07 (main) where
main :: IO ()
main = do
input <- readFile "input/07.txt"
print input

6
src/Day08.hs Normal file
View File

@ -0,0 +1,6 @@
module Day08 (main) where
main :: IO ()
main = do
input <- readFile "input/08.txt"
print input

6
src/Day09.hs Normal file
View File

@ -0,0 +1,6 @@
module Day09 (main) where
main :: IO ()
main = do
input <- readFile "input/09.txt"
print input

6
src/Day10.hs Normal file
View File

@ -0,0 +1,6 @@
module Day10 (main) where
main :: IO ()
main = do
input <- readFile "input/10.txt"
print input

6
src/Day11.hs Normal file
View File

@ -0,0 +1,6 @@
module Day11 (main) where
main :: IO ()
main = do
input <- readFile "input/11.txt"
print input

6
src/Day12.hs Normal file
View File

@ -0,0 +1,6 @@
module Day12 (main) where
main :: IO ()
main = do
input <- readFile "input/12.txt"
print input

6
src/Day13.hs Normal file
View File

@ -0,0 +1,6 @@
module Day13 (main) where
main :: IO ()
main = do
input <- readFile "input/13.txt"
print input

6
src/Day14.hs Normal file
View File

@ -0,0 +1,6 @@
module Day14 (main) where
main :: IO ()
main = do
input <- readFile "input/14.txt"
print input

6
src/Day15.hs Normal file
View File

@ -0,0 +1,6 @@
module Day15 (main) where
main :: IO ()
main = do
input <- readFile "input/15.txt"
print input

6
src/Day16.hs Normal file
View File

@ -0,0 +1,6 @@
module Day16 (main) where
main :: IO ()
main = do
input <- readFile "input/16.txt"
print input

6
src/Day17.hs Normal file
View File

@ -0,0 +1,6 @@
module Day17 (main) where
main :: IO ()
main = do
input <- readFile "input/17.txt"
print input

6
src/Day18.hs Normal file
View File

@ -0,0 +1,6 @@
module Day18 (main) where
main :: IO ()
main = do
input <- readFile "input/18.txt"
print input

6
src/Day19.hs Normal file
View File

@ -0,0 +1,6 @@
module Day19 (main) where
main :: IO ()
main = do
input <- readFile "input/19.txt"
print input

6
src/Day20.hs Normal file
View File

@ -0,0 +1,6 @@
module Day20 (main) where
main :: IO ()
main = do
input <- readFile "input/20.txt"
print input

6
src/Day21.hs Normal file
View File

@ -0,0 +1,6 @@
module Day21 (main) where
main :: IO ()
main = do
input <- readFile "input/21.txt"
print input

6
src/Day22.hs Normal file
View File

@ -0,0 +1,6 @@
module Day22 (main) where
main :: IO ()
main = do
input <- readFile "input/22.txt"
print input

6
src/Day23.hs Normal file
View File

@ -0,0 +1,6 @@
module Day23 (main) where
main :: IO ()
main = do
input <- readFile "input/23.txt"
print input

6
src/Day24.hs Normal file
View File

@ -0,0 +1,6 @@
module Day24 (main) where
main :: IO ()
main = do
input <- readFile "input/24.txt"
print input

6
src/Day25.hs Normal file
View File

@ -0,0 +1,6 @@
module Day25 (main) where
main :: IO ()
main = do
input <- readFile "input/25.txt"
print input

65
stack.yaml Normal file
View File

@ -0,0 +1,65 @@
# This file was automatically generated by 'stack init'
#
# Some commonly used options have been documented as comments in this file.
# For advanced use and comprehensive documentation of the format, please see:
# https://docs.haskellstack.org/en/stable/yaml_configuration/
# Resolver to choose a 'specific' stackage snapshot or a compiler version.
# A snapshot resolver dictates the compiler version and the set of packages
# to be used for project dependencies. For example:
#
# resolver: lts-3.5
# resolver: nightly-2015-09-21
# resolver: ghc-7.10.2
# resolver: ghcjs-0.1.0_ghc-7.10.2
#
# The location of a snapshot can be provided as a file or url. Stack assumes
# a snapshot provided as a file might change, whereas a url resource does not.
#
# resolver: ./custom-snapshot.yaml
# resolver: https://example.com/snapshots/2018-01-01.yaml
resolver: lts-12.19
# User packages to be built.
# Various formats can be used as shown in the example below.
#
# packages:
# - some-directory
# - https://example.com/foo/bar/baz-0.0.2.tar.gz
# - location:
# git: https://github.com/commercialhaskell/stack.git
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
# - location: https://github.com/commercialhaskell/stack/commit/e7b331f14bcffb8367cd58fbfc8b40ec7642100a
# subdirs:
# - auto-update
# - wai
packages:
- .
# Dependency packages to be pulled from upstream that are not in the resolver
# using the same syntax as the packages field.
# (e.g., acme-missiles-0.3)
# extra-deps: []
# Override default flag values for local packages and extra-deps
# flags: {}
# Extra package databases containing global packages
# extra-package-dbs: []
# Control whether we use the GHC we find on the path
# system-ghc: true
#
# Require a specific version of stack, using version ranges
# require-stack-version: -any # Default
# require-stack-version: ">=1.7"
#
# Override the architecture used by stack, especially useful on Windows
# arch: i386
# arch: x86_64
#
# Extra directories used by stack for building
# extra-include-dirs: [/path/to/dir]
# extra-lib-dirs: [/path/to/dir]
#
# Allow a newer minor version of GHC than the snapshot specifies
# compiler-check: newer-minor