Make stack project for Haskell
This commit is contained in:
parent
751673989c
commit
71783f4043
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
Python/__pycache__
|
Python/__pycache__
|
||||||
ProblemsOverviews/*
|
ProblemsOverviews/*
|
||||||
|
Haskell/.stack-work
|
||||||
|
67
Haskell/project-euler-solutions.cabal
Normal file
67
Haskell/project-euler-solutions.cabal
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
cabal-version: 2.2
|
||||||
|
|
||||||
|
name: project-euler-solutions
|
||||||
|
version: 0.1.0.0
|
||||||
|
-- synopsis:
|
||||||
|
-- description:
|
||||||
|
homepage: https://github.com/Fuxino/project-euler-solutions#readme
|
||||||
|
license: MIT
|
||||||
|
author: Daniele Fucini
|
||||||
|
maintainer: dfucini@gmail.com
|
||||||
|
copyright: 2024 Daniele Fucini
|
||||||
|
category: Web
|
||||||
|
build-type: Simple
|
||||||
|
|
||||||
|
executable projecteuler
|
||||||
|
hs-source-dirs: src
|
||||||
|
main-is: Main.hs
|
||||||
|
default-language: Haskell2010
|
||||||
|
build-depends: base >= 4.7 && < 5
|
||||||
|
, containers
|
||||||
|
, split
|
||||||
|
, time
|
||||||
|
, data-ordlist
|
||||||
|
ghc-options: -Wall
|
||||||
|
-Wcompat
|
||||||
|
-Widentities
|
||||||
|
-Wincomplete-record-updates
|
||||||
|
-Wincomplete-uni-patterns
|
||||||
|
-Wmissing-export-lists
|
||||||
|
-Wmissing-home-modules
|
||||||
|
-Wpartial-fields
|
||||||
|
-Wredundant-constraints
|
||||||
|
other-modules:
|
||||||
|
P001
|
||||||
|
P002
|
||||||
|
P003
|
||||||
|
P004
|
||||||
|
P005
|
||||||
|
P006
|
||||||
|
P007
|
||||||
|
P008
|
||||||
|
P009
|
||||||
|
P010
|
||||||
|
P011
|
||||||
|
P012
|
||||||
|
P013
|
||||||
|
P014
|
||||||
|
P015
|
||||||
|
P016
|
||||||
|
P019
|
||||||
|
P020
|
||||||
|
P021
|
||||||
|
P022
|
||||||
|
P023
|
||||||
|
P024
|
||||||
|
P025
|
||||||
|
P026
|
||||||
|
P027
|
||||||
|
P029
|
||||||
|
P030
|
||||||
|
P034
|
||||||
|
P035
|
||||||
|
P036
|
||||||
|
P041
|
||||||
|
P052
|
||||||
|
P054
|
||||||
|
ProjectEuler
|
75
Haskell/src/Main.hs
Normal file
75
Haskell/src/Main.hs
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
module Main (main) where
|
||||||
|
|
||||||
|
import P001
|
||||||
|
import P002
|
||||||
|
import P003
|
||||||
|
import P004
|
||||||
|
import P005
|
||||||
|
import P006
|
||||||
|
import P007
|
||||||
|
import P008
|
||||||
|
import P009
|
||||||
|
import P010
|
||||||
|
import P011
|
||||||
|
import P012
|
||||||
|
import P013
|
||||||
|
import P014
|
||||||
|
import P015
|
||||||
|
import P016
|
||||||
|
import P019
|
||||||
|
import P020
|
||||||
|
import P021
|
||||||
|
import P022
|
||||||
|
import P023
|
||||||
|
import P024
|
||||||
|
import P025
|
||||||
|
import P026
|
||||||
|
import P027
|
||||||
|
import P029
|
||||||
|
import P030
|
||||||
|
import P034
|
||||||
|
import P035
|
||||||
|
import P036
|
||||||
|
import P041
|
||||||
|
import P052
|
||||||
|
import P054
|
||||||
|
import System.Environment (getArgs)
|
||||||
|
|
||||||
|
main :: IO ()
|
||||||
|
main = do
|
||||||
|
args <- getArgs
|
||||||
|
case args of
|
||||||
|
"1" : _ -> p001
|
||||||
|
"2" : _ -> p002
|
||||||
|
"3" : _ -> p003
|
||||||
|
"4" : _ -> p004
|
||||||
|
"5" : _ -> p005
|
||||||
|
"6" : _ -> p006
|
||||||
|
"7" : _ -> p007
|
||||||
|
"8" : _ -> p008
|
||||||
|
"9" : _ -> p009
|
||||||
|
"10" : _ -> p010
|
||||||
|
"11" : _ -> p011
|
||||||
|
"12" : _ -> p012
|
||||||
|
"13" : _ -> p013
|
||||||
|
"14" : _ -> p014
|
||||||
|
"15" : _ -> p015
|
||||||
|
"16" : _ -> p016
|
||||||
|
"19" : _ -> p019
|
||||||
|
"20" : _ -> p020
|
||||||
|
"21" : _ -> p021
|
||||||
|
"22" : _ -> p022
|
||||||
|
"23" : _ -> p023
|
||||||
|
"24" : _ -> p024
|
||||||
|
"25" : _ -> p025
|
||||||
|
"26" : _ -> p026
|
||||||
|
"27" : _ -> p027
|
||||||
|
"29" : _ -> p029
|
||||||
|
"30" : _ -> p030
|
||||||
|
"34" : _ -> p034
|
||||||
|
"35" : _ -> p035
|
||||||
|
"36" : _ -> p036
|
||||||
|
"41" : _ -> p041
|
||||||
|
"52" : _ -> p052
|
||||||
|
"54" : _ -> p054
|
||||||
|
_ -> error "Not implemented"
|
@ -2,12 +2,15 @@
|
|||||||
--
|
--
|
||||||
-- Find the sum of all the multiples of 3 or 5 below 1000.
|
-- Find the sum of all the multiples of 3 or 5 below 1000.
|
||||||
|
|
||||||
|
module P001 (p001) where
|
||||||
|
|
||||||
sumMultiples :: Int
|
sumMultiples :: Int
|
||||||
sumMultiples = sum $ filter p [1 .. 999]
|
sumMultiples = sum $ filter p [1 .. 999]
|
||||||
where
|
where
|
||||||
p n = n `mod` 3 == 0 || n `mod` 5 == 0
|
p n = n `mod` 3 == 0 || n `mod` 5 == 0
|
||||||
|
|
||||||
main = do
|
p001 :: IO ()
|
||||||
|
p001 = do
|
||||||
let result = sumMultiples
|
let result = sumMultiples
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 1\n"
|
"Project Euler, Problem 1\n"
|
@ -4,6 +4,8 @@
|
|||||||
--
|
--
|
||||||
-- By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
|
-- By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
|
||||||
|
|
||||||
|
module P002 (p002) where
|
||||||
|
|
||||||
fib :: Int -> Int
|
fib :: Int -> Int
|
||||||
fib 0 = 0
|
fib 0 = 0
|
||||||
fib 1 = 1
|
fib 1 = 1
|
||||||
@ -12,7 +14,8 @@ fib n = fib (n - 1) + fib (n - 2)
|
|||||||
sumEvenFib :: Int
|
sumEvenFib :: Int
|
||||||
sumEvenFib = sum $ filter even $ takeWhile (<= 4000000) (map fib [0 ..])
|
sumEvenFib = sum $ filter even $ takeWhile (<= 4000000) (map fib [0 ..])
|
||||||
|
|
||||||
main = do
|
p002 :: IO ()
|
||||||
|
p002 = do
|
||||||
let result = sumEvenFib
|
let result = sumEvenFib
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 2\n"
|
"Project Euler, Problem 2\n"
|
@ -1,6 +1,8 @@
|
|||||||
-- The prime factors of 13195 are 5, 7, 13 and 29. --
|
-- The prime factors of 13195 are 5, 7, 13 and 29. --
|
||||||
-- What is the largest prime factor of the number 600851475143?
|
-- What is the largest prime factor of the number 600851475143?
|
||||||
|
|
||||||
|
module P003 (p003) where
|
||||||
|
|
||||||
import ProjectEuler (isPrime)
|
import ProjectEuler (isPrime)
|
||||||
|
|
||||||
maxPrimeFactor :: Int -> Int
|
maxPrimeFactor :: Int -> Int
|
||||||
@ -9,7 +11,8 @@ maxPrimeFactor n
|
|||||||
| even n = maxPrimeFactor $ n `div` 2
|
| even n = maxPrimeFactor $ n `div` 2
|
||||||
| otherwise = maxPrimeFactor $ n `div` head [i | i <- [3, 5 ..], n `mod` i == 0 && isPrime i]
|
| otherwise = maxPrimeFactor $ n `div` head [i | i <- [3, 5 ..], n `mod` i == 0 && isPrime i]
|
||||||
|
|
||||||
main = do
|
p003 :: IO ()
|
||||||
|
p003 = do
|
||||||
let result = maxPrimeFactor 600851475143
|
let result = maxPrimeFactor 600851475143
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 3\n"
|
"Project Euler, Problem 3\n"
|
@ -2,6 +2,8 @@
|
|||||||
--
|
--
|
||||||
-- Find the largest palindrome made from the product of two 3-digit numbers.
|
-- Find the largest palindrome made from the product of two 3-digit numbers.
|
||||||
|
|
||||||
|
module P004 (p004) where
|
||||||
|
|
||||||
isPalindrome :: Int -> Bool
|
isPalindrome :: Int -> Bool
|
||||||
isPalindrome n = show n == reverse (show n)
|
isPalindrome n = show n == reverse (show n)
|
||||||
|
|
||||||
@ -9,7 +11,8 @@ maxPalindrome :: Int
|
|||||||
maxPalindrome =
|
maxPalindrome =
|
||||||
maximum . filter isPalindrome $ (*) <$> [100 .. 999] <*> [100 .. 999]
|
maximum . filter isPalindrome $ (*) <$> [100 .. 999] <*> [100 .. 999]
|
||||||
|
|
||||||
main = do
|
p004 :: IO ()
|
||||||
|
p004 = do
|
||||||
let result = maxPalindrome
|
let result = maxPalindrome
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 4\n"
|
"Project Euler, Problem 4\n"
|
@ -2,9 +2,12 @@
|
|||||||
--
|
--
|
||||||
-- What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
|
-- What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
|
||||||
|
|
||||||
|
module P005 (p005) where
|
||||||
|
|
||||||
import ProjectEuler (lcmm)
|
import ProjectEuler (lcmm)
|
||||||
|
|
||||||
main = do
|
p005 :: IO ()
|
||||||
|
p005 = do
|
||||||
let result = lcmm [1 .. 20]
|
let result = lcmm [1 .. 20]
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 5\n"
|
"Project Euler, Problem 5\n"
|
@ -10,10 +10,13 @@
|
|||||||
--
|
--
|
||||||
-- Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.
|
-- Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.
|
||||||
|
|
||||||
|
module P006 (p006) where
|
||||||
|
|
||||||
sumSquareDiff :: Int -> Int
|
sumSquareDiff :: Int -> Int
|
||||||
sumSquareDiff n = (sum [1 .. n] ^ 2) - sum (map (^ 2) [1 .. n])
|
sumSquareDiff n = (sum [1 .. n] ^ 2) - sum (map (^ 2) [1 .. n])
|
||||||
|
|
||||||
main = do
|
p006 :: IO ()
|
||||||
|
p006 = do
|
||||||
let result = sumSquareDiff 100
|
let result = sumSquareDiff 100
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 6\n"
|
"Project Euler, Problem 6\n"
|
@ -1,13 +1,16 @@
|
|||||||
-- By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
|
-- By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
|
||||||
--
|
--
|
||||||
-- What is the 10 001st prime number?
|
-- What is the 10 001st prime number?
|
||||||
--
|
|
||||||
|
module P007 (p007) where
|
||||||
|
|
||||||
import ProjectEuler (isPrime)
|
import ProjectEuler (isPrime)
|
||||||
|
|
||||||
nthPrime :: Int -> Int
|
nthPrime :: Int -> Int
|
||||||
nthPrime n = last $ take n [x | x <- [1 ..], isPrime x]
|
nthPrime n = last $ take n [x | x <- [1 ..], isPrime x]
|
||||||
|
|
||||||
main = do
|
p007 :: IO ()
|
||||||
|
p007 = do
|
||||||
let result = nthPrime 10001
|
let result = nthPrime 10001
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 7\n"
|
"Project Euler, Problem 7\n"
|
@ -23,6 +23,8 @@
|
|||||||
--
|
--
|
||||||
-- Find the thirteen adjacent digits in the 1000-digit number that have the greatest product. What is the value of this product?
|
-- Find the thirteen adjacent digits in the 1000-digit number that have the greatest product. What is the value of this product?
|
||||||
|
|
||||||
|
module P008 (p008) where
|
||||||
|
|
||||||
import Data.Char (digitToInt)
|
import Data.Char (digitToInt)
|
||||||
|
|
||||||
nDigitProduct :: Int -> String -> Int
|
nDigitProduct :: Int -> String -> Int
|
||||||
@ -30,7 +32,8 @@ nDigitProduct n s
|
|||||||
| length s < n = -1
|
| length s < n = -1
|
||||||
| otherwise = max (product (map digitToInt (take n s))) (nDigitProduct n (tail s))
|
| otherwise = max (product (map digitToInt (take n s))) (nDigitProduct n (tail s))
|
||||||
|
|
||||||
main = do
|
p008 :: IO ()
|
||||||
|
p008 = do
|
||||||
let s =
|
let s =
|
||||||
"73167176531330624919225119674426574742355349194934"
|
"73167176531330624919225119674426574742355349194934"
|
||||||
++ "96983520312774506326239578318016984801869478851843"
|
++ "96983520312774506326239578318016984801869478851843"
|
@ -8,13 +8,16 @@
|
|||||||
--
|
--
|
||||||
-- Find the product abc.
|
-- Find the product abc.
|
||||||
|
|
||||||
|
module P009 (p009) where
|
||||||
|
|
||||||
pythagoreanTriplet :: Int -> (Int, Int, Int)
|
pythagoreanTriplet :: Int -> (Int, Int, Int)
|
||||||
pythagoreanTriplet n = head [(x, y, z) | x <- [1 .. n], y <- [x .. n], z <- [y .. n], x + y + z == n, x ^ 2 + y ^ 2 == z ^ 2]
|
pythagoreanTriplet n = head [(x, y, z) | x <- [1 .. n], y <- [x .. n], z <- [y .. n], x + y + z == n, x ^ 2 + y ^ 2 == z ^ 2]
|
||||||
|
|
||||||
prodTriplet :: (Int, Int, Int) -> Int
|
prodTriplet :: (Int, Int, Int) -> Int
|
||||||
prodTriplet (x, y, z) = x * y * z
|
prodTriplet (x, y, z) = x * y * z
|
||||||
|
|
||||||
main = do
|
p009 :: IO ()
|
||||||
|
p009 = do
|
||||||
let result = prodTriplet $ pythagoreanTriplet 1000
|
let result = prodTriplet $ pythagoreanTriplet 1000
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 9\n"
|
"Project Euler, Problem 9\n"
|
@ -2,9 +2,12 @@
|
|||||||
--
|
--
|
||||||
-- Find the sum of all the primes below two million.
|
-- Find the sum of all the primes below two million.
|
||||||
|
|
||||||
|
module P010 (p010) where
|
||||||
|
|
||||||
import ProjectEuler (primeSieve)
|
import ProjectEuler (primeSieve)
|
||||||
|
|
||||||
main = do
|
p010 :: IO ()
|
||||||
|
p010 = do
|
||||||
let result = sum $ takeWhile (< 2000000) primeSieve
|
let result = sum $ takeWhile (< 2000000) primeSieve
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 10\n"
|
"Project Euler, Problem 10\n"
|
@ -25,6 +25,8 @@
|
|||||||
--
|
--
|
||||||
-- What is the greatest product of four adjacent numbers in the same direction (up, down, left, right, or diagonally) in the 20×20 grid?
|
-- What is the greatest product of four adjacent numbers in the same direction (up, down, left, right, or diagonally) in the 20×20 grid?
|
||||||
|
|
||||||
|
module P011 (p011) where
|
||||||
|
|
||||||
import Data.List (transpose)
|
import Data.List (transpose)
|
||||||
|
|
||||||
diagonals :: [[Int]] -> [[Int]]
|
diagonals :: [[Int]] -> [[Int]]
|
||||||
@ -38,7 +40,8 @@ maxProd4 :: [Int] -> Int
|
|||||||
maxProd4 [x, y, z] = 0
|
maxProd4 [x, y, z] = 0
|
||||||
maxProd4 (w : x : y : z : xs) = max (w * x * y * z) (maxProd4 (x : y : z : xs))
|
maxProd4 (w : x : y : z : xs) = max (w * x * y * z) (maxProd4 (x : y : z : xs))
|
||||||
|
|
||||||
main = do
|
p011 :: IO ()
|
||||||
|
p011 = do
|
||||||
let grid =
|
let grid =
|
||||||
[ [8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8],
|
[ [8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8],
|
||||||
[49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0],
|
[49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0],
|
@ -17,6 +17,8 @@
|
|||||||
--
|
--
|
||||||
-- What is the value of the first triangle number to have over five hundred divisors?
|
-- What is the value of the first triangle number to have over five hundred divisors?
|
||||||
|
|
||||||
|
module P012 (p012) where
|
||||||
|
|
||||||
import Data.List (nub)
|
import Data.List (nub)
|
||||||
import ProjectEuler (countDivisors)
|
import ProjectEuler (countDivisors)
|
||||||
|
|
||||||
@ -26,7 +28,8 @@ triangNumbers = scanl1 (+) [1 ..]
|
|||||||
triang500 :: Int
|
triang500 :: Int
|
||||||
triang500 = head [x | x <- triangNumbers, countDivisors x > 500]
|
triang500 = head [x | x <- triangNumbers, countDivisors x > 500]
|
||||||
|
|
||||||
main = do
|
p012 :: IO ()
|
||||||
|
p012 = do
|
||||||
let result = triang500
|
let result = triang500
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 12\n"
|
"Project Euler, Problem 12\n"
|
@ -101,10 +101,13 @@
|
|||||||
-- 20849603980134001723930671666823555245252804609722
|
-- 20849603980134001723930671666823555245252804609722
|
||||||
-- 53503534226472524250874054075591789781264330331690
|
-- 53503534226472524250874054075591789781264330331690
|
||||||
|
|
||||||
|
module P013 (p013) where
|
||||||
|
|
||||||
firstDigitsSum :: Int -> [Integer] -> Int
|
firstDigitsSum :: Int -> [Integer] -> Int
|
||||||
firstDigitsSum n xs = read . take n . show $ sum xs
|
firstDigitsSum n xs = read . take n . show $ sum xs
|
||||||
|
|
||||||
main = do
|
p013 :: IO ()
|
||||||
|
p013 = do
|
||||||
let result =
|
let result =
|
||||||
firstDigitsSum
|
firstDigitsSum
|
||||||
10
|
10
|
@ -14,6 +14,8 @@
|
|||||||
--
|
--
|
||||||
-- NOTE: Once the chain starts the terms are allowed to go above one million.
|
-- NOTE: Once the chain starts the terms are allowed to go above one million.
|
||||||
|
|
||||||
|
module P014 (p014) where
|
||||||
|
|
||||||
collatz :: Int -> [Int]
|
collatz :: Int -> [Int]
|
||||||
collatz 1 = [1]
|
collatz 1 = [1]
|
||||||
collatz n
|
collatz n
|
||||||
@ -23,7 +25,8 @@ collatz n
|
|||||||
maxCollatzLength :: Int -> Int
|
maxCollatzLength :: Int -> Int
|
||||||
maxCollatzLength n = snd $ maximum $ zip [length (collatz x) | x <- [1 .. n - 1]] [1 .. n - 1]
|
maxCollatzLength n = snd $ maximum $ zip [length (collatz x) | x <- [1 .. n - 1]] [1 .. n - 1]
|
||||||
|
|
||||||
main = do
|
p014 :: IO ()
|
||||||
|
p014 = do
|
||||||
let result = maxCollatzLength 1000000
|
let result = maxCollatzLength 1000000
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 14\n"
|
"Project Euler, Problem 14\n"
|
@ -1,11 +1,14 @@
|
|||||||
-- Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner
|
-- Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner
|
||||||
-- How many such routes are there through a 20×20 grid?
|
-- How many such routes are there through a 20×20 grid?
|
||||||
|
|
||||||
|
module P015 (p015) where
|
||||||
|
|
||||||
factorial :: (Integral a) => a -> a
|
factorial :: (Integral a) => a -> a
|
||||||
factorial 0 = 1
|
factorial 0 = 1
|
||||||
factorial n = n * factorial (n - 1)
|
factorial n = n * factorial (n - 1)
|
||||||
|
|
||||||
main = do
|
p015 :: IO ()
|
||||||
|
p015 = do
|
||||||
let result = factorial 40 `div` factorial 20 ^ 2
|
let result = factorial 40 `div` factorial 20 ^ 2
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 15\n"
|
"Project Euler, Problem 15\n"
|
@ -2,9 +2,12 @@
|
|||||||
--
|
--
|
||||||
-- What is the sum of the digits of the number 2^1000?
|
-- What is the sum of the digits of the number 2^1000?
|
||||||
|
|
||||||
|
module P016 (p016) where
|
||||||
|
|
||||||
import ProjectEuler (digitSum)
|
import ProjectEuler (digitSum)
|
||||||
|
|
||||||
main = do
|
p016 :: IO ()
|
||||||
|
p016 = do
|
||||||
let result = digitSum $ 2 ^ 1000
|
let result = digitSum $ 2 ^ 1000
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 16\n"
|
"Project Euler, Problem 16\n"
|
@ -11,6 +11,8 @@
|
|||||||
--
|
--
|
||||||
-- How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)?
|
-- How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)?
|
||||||
|
|
||||||
|
module P019 (p019) where
|
||||||
|
|
||||||
import Data.Time.Calendar (Day, DayOfWeek (Sunday), dayOfWeek, fromGregorian)
|
import Data.Time.Calendar (Day, DayOfWeek (Sunday), dayOfWeek, fromGregorian)
|
||||||
|
|
||||||
countSundaysFirst :: Day -> Day -> Int
|
countSundaysFirst :: Day -> Day -> Int
|
||||||
@ -18,7 +20,8 @@ countSundaysFirst start end =
|
|||||||
let days = [start .. end]
|
let days = [start .. end]
|
||||||
in length $ filter (\x -> dayOfWeek x == Sunday && [last (init (show x)), last (show x)] == "01") days
|
in length $ filter (\x -> dayOfWeek x == Sunday && [last (init (show x)), last (show x)] == "01") days
|
||||||
|
|
||||||
main = do
|
p019 :: IO ()
|
||||||
|
p019 = do
|
||||||
let startDate = fromGregorian 1901 1 1
|
let startDate = fromGregorian 1901 1 1
|
||||||
endDate = fromGregorian 2000 12 31
|
endDate = fromGregorian 2000 12 31
|
||||||
result = countSundaysFirst startDate endDate
|
result = countSundaysFirst startDate endDate
|
@ -5,13 +5,16 @@
|
|||||||
--
|
--
|
||||||
-- Find the sum of the digits in the number 100!
|
-- Find the sum of the digits in the number 100!
|
||||||
|
|
||||||
|
module P020 (p020) where
|
||||||
|
|
||||||
import ProjectEuler (digitSum)
|
import ProjectEuler (digitSum)
|
||||||
|
|
||||||
factorial :: (Integral a) => a -> a
|
factorial :: (Integral a) => a -> a
|
||||||
factorial 0 = 1
|
factorial 0 = 1
|
||||||
factorial n = n * factorial (n - 1)
|
factorial n = n * factorial (n - 1)
|
||||||
|
|
||||||
main = do
|
p020 :: IO ()
|
||||||
|
p020 = do
|
||||||
let result = digitSum $ factorial 100
|
let result = digitSum $ factorial 100
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 20\n"
|
"Project Euler, Problem 20\n"
|
@ -6,6 +6,8 @@
|
|||||||
--
|
--
|
||||||
-- Evaluate the sum of all the amicable numbers under 10000.
|
-- Evaluate the sum of all the amicable numbers under 10000.
|
||||||
|
|
||||||
|
module P021 (p021) where
|
||||||
|
|
||||||
import ProjectEuler (sumProperDivisors)
|
import ProjectEuler (sumProperDivisors)
|
||||||
|
|
||||||
properDivisors :: (Integral a) => a -> [a]
|
properDivisors :: (Integral a) => a -> [a]
|
||||||
@ -17,7 +19,8 @@ amicable x y = x /= y && sumProperDivisors x == y && sumProperDivisors y == x
|
|||||||
sumAmicable :: (Integral a) => a -> a
|
sumAmicable :: (Integral a) => a -> a
|
||||||
sumAmicable n = sum [x | x <- [1 .. n - 1], amicable x $ sumProperDivisors x]
|
sumAmicable n = sum [x | x <- [1 .. n - 1], amicable x $ sumProperDivisors x]
|
||||||
|
|
||||||
main = do
|
p021 :: IO ()
|
||||||
|
p021 = do
|
||||||
let result = sumAmicable 10000
|
let result = sumAmicable 10000
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 21\n"
|
"Project Euler, Problem 21\n"
|
@ -6,6 +6,8 @@
|
|||||||
--
|
--
|
||||||
-- What is the total of all the name scores in the file?
|
-- What is the total of all the name scores in the file?
|
||||||
|
|
||||||
|
module P022 (p022) where
|
||||||
|
|
||||||
import Data.Char (ord)
|
import Data.Char (ord)
|
||||||
import Data.List (sort)
|
import Data.List (sort)
|
||||||
import Data.List.Split (splitOn)
|
import Data.List.Split (splitOn)
|
||||||
@ -15,7 +17,8 @@ nameScore s =
|
|||||||
let a = ord 'A' - 1
|
let a = ord 'A' - 1
|
||||||
in sum $ map ((\x -> x - a) . ord) s
|
in sum $ map ((\x -> x - a) . ord) s
|
||||||
|
|
||||||
main = do
|
p022 :: IO ()
|
||||||
|
p022 = do
|
||||||
contents <- readFile "p022_names.txt"
|
contents <- readFile "p022_names.txt"
|
||||||
let name_scores = map nameScore . sort . splitOn "," $ filter (/= '"') contents
|
let name_scores = map nameScore . sort . splitOn "," $ filter (/= '"') contents
|
||||||
result = sum $ zipWith (*) name_scores [1 ..]
|
result = sum $ zipWith (*) name_scores [1 ..]
|
@ -9,6 +9,9 @@
|
|||||||
-- as the sum of two abundant numbers is less than this limit.
|
-- as the sum of two abundant numbers is less than this limit.
|
||||||
--
|
--
|
||||||
-- Find the sum of all the positive integers which cannot be written as the sum of two abundant numbers.
|
-- Find the sum of all the positive integers which cannot be written as the sum of two abundant numbers.
|
||||||
|
|
||||||
|
module P023 (p023) where
|
||||||
|
|
||||||
import Data.List ((\\))
|
import Data.List ((\\))
|
||||||
import qualified Data.Set as Set
|
import qualified Data.Set as Set
|
||||||
import ProjectEuler (sumProperDivisors)
|
import ProjectEuler (sumProperDivisors)
|
||||||
@ -24,7 +27,8 @@ abundantSums = Set.toList $ Set.fromList [x + y | x <- abundantList, y <- abunda
|
|||||||
sumNotAbundant :: (Integral a) => a
|
sumNotAbundant :: (Integral a) => a
|
||||||
sumNotAbundant = sum $ [1 .. 28123] \\ abundantSums
|
sumNotAbundant = sum $ [1 .. 28123] \\ abundantSums
|
||||||
|
|
||||||
main = do
|
p023 :: IO ()
|
||||||
|
p023 = do
|
||||||
let result = sumNotAbundant
|
let result = sumNotAbundant
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 23\n"
|
"Project Euler, Problem 23\n"
|
@ -5,9 +5,12 @@
|
|||||||
--
|
--
|
||||||
-- What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?
|
-- What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?
|
||||||
|
|
||||||
|
module P024 (p024) where
|
||||||
|
|
||||||
import Data.List (permutations, sort)
|
import Data.List (permutations, sort)
|
||||||
|
|
||||||
main = do
|
p024 :: IO ()
|
||||||
|
p024 = do
|
||||||
let result = sort (permutations "0123456789") !! 999999
|
let result = sort (permutations "0123456789") !! 999999
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 24\n"
|
"Project Euler, Problem 24\n"
|
@ -19,12 +19,15 @@
|
|||||||
--
|
--
|
||||||
-- What is the index of the first term in the Fibonacci sequence to contain 1000 digits?
|
-- What is the index of the first term in the Fibonacci sequence to contain 1000 digits?
|
||||||
|
|
||||||
|
module P025 (p025) where
|
||||||
|
|
||||||
fibs :: [Integer]
|
fibs :: [Integer]
|
||||||
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
|
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
|
||||||
|
|
||||||
thousandDigitFib = length $ takeWhile (\x -> length (show x) < 1000) fibs
|
thousandDigitFib = length $ takeWhile (\x -> length (show x) < 1000) fibs
|
||||||
|
|
||||||
main = do
|
p025 :: IO ()
|
||||||
|
p025 = do
|
||||||
let result = thousandDigitFib
|
let result = thousandDigitFib
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 25\n"
|
"Project Euler, Problem 25\n"
|
@ -14,6 +14,8 @@
|
|||||||
--
|
--
|
||||||
-- Find the value of d < 1000 for which 1/d contains the longest recurring cycle in its decimal fraction part.
|
-- Find the value of d < 1000 for which 1/d contains the longest recurring cycle in its decimal fraction part.
|
||||||
|
|
||||||
|
module P026 (p026) where
|
||||||
|
|
||||||
removeFactor :: (Integral a) => a -> a -> a
|
removeFactor :: (Integral a) => a -> a -> a
|
||||||
removeFactor f n
|
removeFactor f n
|
||||||
| n `mod` f /= 0 = n
|
| n `mod` f /= 0 = n
|
||||||
@ -33,7 +35,8 @@ maxRepeatingCycle a b = snd . maximum $ zip xs [1 ..]
|
|||||||
where
|
where
|
||||||
xs = map findCycleLength [a .. b]
|
xs = map findCycleLength [a .. b]
|
||||||
|
|
||||||
main = do
|
p026 :: IO ()
|
||||||
|
p026 = do
|
||||||
let result = maxRepeatingCycle 1 999
|
let result = maxRepeatingCycle 1 999
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 26\n"
|
"Project Euler, Problem 26\n"
|
@ -18,6 +18,8 @@
|
|||||||
-- Find the product of the coefficients, a and b, for the quadratic expression that produces the maximum number of primes for consecutive values of n,
|
-- Find the product of the coefficients, a and b, for the quadratic expression that produces the maximum number of primes for consecutive values of n,
|
||||||
-- starting with n=0.
|
-- starting with n=0.
|
||||||
|
|
||||||
|
module P027 (p027) where
|
||||||
|
|
||||||
import Data.Function (on)
|
import Data.Function (on)
|
||||||
import Data.List (maximumBy)
|
import Data.List (maximumBy)
|
||||||
import ProjectEuler (isPrime)
|
import ProjectEuler (isPrime)
|
||||||
@ -31,7 +33,8 @@ findCoefficients =
|
|||||||
cs = [(a, b) | a <- as, b <- bs]
|
cs = [(a, b) | a <- as, b <- bs]
|
||||||
in fst $ maximumBy (compare `on` snd) [(c, l) | c <- cs, let l = uncurry findLengthPrimeSequence c]
|
in fst $ maximumBy (compare `on` snd) [(c, l) | c <- cs, let l = uncurry findLengthPrimeSequence c]
|
||||||
|
|
||||||
main = do
|
p027 :: IO ()
|
||||||
|
p027 = do
|
||||||
let coefficients = findCoefficients
|
let coefficients = findCoefficients
|
||||||
result = uncurry (*) coefficients
|
result = uncurry (*) coefficients
|
||||||
putStrLn $
|
putStrLn $
|
@ -10,12 +10,16 @@
|
|||||||
-- 4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125
|
-- 4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125
|
||||||
--
|
--
|
||||||
-- How many distinct terms are in the sequence generated by ab for 2 ≤ a ≤ 100 and 2 ≤ b ≤ 100?
|
-- How many distinct terms are in the sequence generated by ab for 2 ≤ a ≤ 100 and 2 ≤ b ≤ 100?
|
||||||
|
|
||||||
|
module P029 (p029) where
|
||||||
|
|
||||||
import Data.List (nub)
|
import Data.List (nub)
|
||||||
|
|
||||||
powerCombinations :: (Integral a) => a -> [a]
|
powerCombinations :: (Integral a) => a -> [a]
|
||||||
powerCombinations n = nub [x ^ y | x <- [2 .. n], y <- [2 .. n]]
|
powerCombinations n = nub [x ^ y | x <- [2 .. n], y <- [2 .. n]]
|
||||||
|
|
||||||
main = do
|
p029 :: IO ()
|
||||||
|
p029 = do
|
||||||
let result = length $ powerCombinations 100
|
let result = length $ powerCombinations 100
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 29\n"
|
"Project Euler, Problem 29\n"
|
@ -10,6 +10,8 @@
|
|||||||
--
|
--
|
||||||
-- Find the sum of all the numbers that can be written as the sum of fifth powers of their digits.
|
-- Find the sum of all the numbers that can be written as the sum of fifth powers of their digits.
|
||||||
|
|
||||||
|
module P030 (p030) where
|
||||||
|
|
||||||
import Data.Char (digitToInt)
|
import Data.Char (digitToInt)
|
||||||
|
|
||||||
sumNthPowerDigit :: Int -> Int -> Int
|
sumNthPowerDigit :: Int -> Int -> Int
|
||||||
@ -18,7 +20,8 @@ sumNthPowerDigit p n = sum [x ^ p | x <- map digitToInt (show n)]
|
|||||||
equalsSumNthPowerDigit :: Int -> Int -> Bool
|
equalsSumNthPowerDigit :: Int -> Int -> Bool
|
||||||
equalsSumNthPowerDigit p n = n == sumNthPowerDigit p n
|
equalsSumNthPowerDigit p n = n == sumNthPowerDigit p n
|
||||||
|
|
||||||
main = do
|
p030 :: IO ()
|
||||||
|
p030 = do
|
||||||
let result = sum $ filter (equalsSumNthPowerDigit 5) [10 .. 354295]
|
let result = sum $ filter (equalsSumNthPowerDigit 5) [10 .. 354295]
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 30\n"
|
"Project Euler, Problem 30\n"
|
@ -4,6 +4,8 @@
|
|||||||
--
|
--
|
||||||
-- Note: as 1! = 1 and 2! = 2 are not sums they are not included.
|
-- Note: as 1! = 1 and 2! = 2 are not sums they are not included.
|
||||||
|
|
||||||
|
module P034 (p034) where
|
||||||
|
|
||||||
import Data.Char
|
import Data.Char
|
||||||
|
|
||||||
factorial :: (Integral a) => a -> a
|
factorial :: (Integral a) => a -> a
|
||||||
@ -18,7 +20,8 @@ equalsDigitFactorial n =
|
|||||||
let fact_digit_sum = sum $ [factDigits !! x | x <- map digitToInt (show n)]
|
let fact_digit_sum = sum $ [factDigits !! x | x <- map digitToInt (show n)]
|
||||||
in fact_digit_sum == n
|
in fact_digit_sum == n
|
||||||
|
|
||||||
main = do
|
p034 :: IO ()
|
||||||
|
p034 = do
|
||||||
let result = sum $ filter equalsDigitFactorial [10 .. 9999999]
|
let result = sum $ filter equalsDigitFactorial [10 .. 9999999]
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 34\n"
|
"Project Euler, Problem 34\n"
|
@ -4,6 +4,7 @@
|
|||||||
--
|
--
|
||||||
-- How many circular primes are there below one million?
|
-- How many circular primes are there below one million?
|
||||||
|
|
||||||
|
module P035 (p035) where
|
||||||
import Data.List (inits, tails)
|
import Data.List (inits, tails)
|
||||||
import ProjectEuler (isPrime, primeSieve)
|
import ProjectEuler (isPrime, primeSieve)
|
||||||
|
|
||||||
@ -16,7 +17,8 @@ isCircularPrime n
|
|||||||
where
|
where
|
||||||
rotations = zipWith (++) (tails (show n)) (init (inits (show n)))
|
rotations = zipWith (++) (tails (show n)) (init (inits (show n)))
|
||||||
|
|
||||||
main = do
|
p035 :: IO ()
|
||||||
|
p035 = do
|
||||||
let result = length $ filter isCircularPrime (takeWhile (< 1000000) primeSieve)
|
let result = length $ filter isCircularPrime (takeWhile (< 1000000) primeSieve)
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 35\n"
|
"Project Euler, Problem 35\n"
|
@ -4,6 +4,8 @@
|
|||||||
--
|
--
|
||||||
-- (Please note that the palindromic number, in either base, may not include leading zeros.)
|
-- (Please note that the palindromic number, in either base, may not include leading zeros.)
|
||||||
|
|
||||||
|
module P036 (p036) where
|
||||||
|
|
||||||
toBinary :: Int -> [Int]
|
toBinary :: Int -> [Int]
|
||||||
toBinary 0 = []
|
toBinary 0 = []
|
||||||
toBinary 1 = [1]
|
toBinary 1 = [1]
|
||||||
@ -12,7 +14,8 @@ toBinary n = toBinary (n `div` 2) ++ [n `mod` 2]
|
|||||||
doublePalindrome :: Int -> Bool
|
doublePalindrome :: Int -> Bool
|
||||||
doublePalindrome n = show n == reverse (show n) && toBinary n == reverse (toBinary n)
|
doublePalindrome n = show n == reverse (show n) && toBinary n == reverse (toBinary n)
|
||||||
|
|
||||||
main = do
|
p036 :: IO ()
|
||||||
|
p036 = do
|
||||||
let result = sum $ filter doublePalindrome [1 .. 999999]
|
let result = sum $ filter doublePalindrome [1 .. 999999]
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 36\n"
|
"Project Euler, Problem 36\n"
|
@ -3,12 +3,15 @@
|
|||||||
--
|
--
|
||||||
-- What is the largest n-digit pandigital prime that exists?
|
-- What is the largest n-digit pandigital prime that exists?
|
||||||
|
|
||||||
|
module P041 (p041) where
|
||||||
|
|
||||||
import ProjectEuler (isPandigital, isPrime)
|
import ProjectEuler (isPandigital, isPrime)
|
||||||
|
|
||||||
maxPandigitalPrime :: Integer
|
maxPandigitalPrime :: Integer
|
||||||
maxPandigitalPrime = head $ filter isPrime (filter isPandigital [7654321, 7654319 ..])
|
maxPandigitalPrime = head $ filter isPrime (filter isPandigital [7654321, 7654319 ..])
|
||||||
|
|
||||||
main = do
|
p041 :: IO ()
|
||||||
|
p041 = do
|
||||||
let result = maxPandigitalPrime
|
let result = maxPandigitalPrime
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 41\n"
|
"Project Euler, Problem 41\n"
|
@ -1,12 +1,16 @@
|
|||||||
-- It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order.
|
-- It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order.
|
||||||
--
|
--
|
||||||
-- Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, contain the same digits.
|
-- Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, contain the same digits.
|
||||||
|
|
||||||
|
module P052 (p052) where
|
||||||
|
|
||||||
import Data.List (sort)
|
import Data.List (sort)
|
||||||
|
|
||||||
smallestPermutedMultiples :: Integer
|
smallestPermutedMultiples :: Integer
|
||||||
smallestPermutedMultiples = head [x | x <- [1 ..], sort (show x) == sort (show (2 * x)), sort (show x) == sort (show (3 * x)), sort (show x) == sort (show (4 * x)), sort (show x) == sort (show (5 * x)), sort (show x) == sort (show (6 * x))]
|
smallestPermutedMultiples = head [x | x <- [1 ..], sort (show x) == sort (show (2 * x)), sort (show x) == sort (show (3 * x)), sort (show x) == sort (show (4 * x)), sort (show x) == sort (show (5 * x)), sort (show x) == sort (show (6 * x))]
|
||||||
|
|
||||||
main = do
|
p052 :: IO ()
|
||||||
|
p052 = do
|
||||||
let result = smallestPermutedMultiples
|
let result = smallestPermutedMultiples
|
||||||
putStrLn $
|
putStrLn $
|
||||||
"Project Euler, Problem 52\n"
|
"Project Euler, Problem 52\n"
|
@ -44,6 +44,8 @@
|
|||||||
--
|
--
|
||||||
-- How many hands does Player 1 win?
|
-- How many hands does Player 1 win?
|
||||||
|
|
||||||
|
module P054 (p054) where
|
||||||
|
|
||||||
import Data.Function (on)
|
import Data.Function (on)
|
||||||
import Data.List (groupBy, maximumBy, minimumBy, sort, sortBy)
|
import Data.List (groupBy, maximumBy, minimumBy, sort, sortBy)
|
||||||
import Data.Maybe (fromJust)
|
import Data.Maybe (fromJust)
|
||||||
@ -236,7 +238,8 @@ playGame g
|
|||||||
ys = reverse . sort $ player2 g
|
ys = reverse . sort $ player2 g
|
||||||
in if xs > ys then 1 else -1
|
in if xs > ys then 1 else -1
|
||||||
|
|
||||||
main = do
|
p054 :: IO ()
|
||||||
|
p054 = do
|
||||||
contents <- readFile "p054_poker.txt"
|
contents <- readFile "p054_poker.txt"
|
||||||
let games = map readGame (lines contents)
|
let games = map readGame (lines contents)
|
||||||
result = sum $ filter (== 1) $ map playGame games
|
result = sum $ filter (== 1) $ map playGame games
|
66
Haskell/stack.yaml
Normal file
66
Haskell/stack.yaml
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
# 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/
|
||||||
|
|
||||||
|
# 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:
|
||||||
|
#
|
||||||
|
# snapshot: lts-22.28
|
||||||
|
# snapshot: nightly-2024-07-05
|
||||||
|
# snapshot: ghc-9.6.6
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
# snapshot: ./custom-snapshot.yaml
|
||||||
|
# snapshot: https://example.com/snapshots/2024-01-01.yaml
|
||||||
|
snapshot: lts-23.0
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# subdirs:
|
||||||
|
# - auto-update
|
||||||
|
# - wai
|
||||||
|
packages:
|
||||||
|
- .
|
||||||
|
# Dependency packages to be pulled from upstream that are not in the snapshot.
|
||||||
|
# These entries can reference officially published versions as well as
|
||||||
|
# forks / in-progress versions pinned to a git hash. For example:
|
||||||
|
#
|
||||||
|
# extra-deps:
|
||||||
|
# - acme-missiles-0.3
|
||||||
|
# - git: https://github.com/commercialhaskell/stack.git
|
||||||
|
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
|
||||||
|
#
|
||||||
|
# extra-deps: []
|
||||||
|
|
||||||
|
# Override default flag values for project 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: ">=3.1"
|
||||||
|
#
|
||||||
|
# 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
|
12
Haskell/stack.yaml.lock
Normal file
12
Haskell/stack.yaml.lock
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# This file was autogenerated by Stack.
|
||||||
|
# You should not edit this file by hand.
|
||||||
|
# For more information, please see the documentation at:
|
||||||
|
# https://docs.haskellstack.org/en/stable/lock_files
|
||||||
|
|
||||||
|
packages: []
|
||||||
|
snapshots:
|
||||||
|
- completed:
|
||||||
|
sha256: 9444fadfa30b67a93080254d53872478c087592ad64443e47c546cdcd13149ae
|
||||||
|
size: 678857
|
||||||
|
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/0.yaml
|
||||||
|
original: lts-23.0
|
Loading…
x
Reference in New Issue
Block a user