This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Y2022.Day21.Solution where | |
import CommonParsers (Parser, nameP, numberP, runParser) | |
import Data.List (nub) | |
import Data.Map.Lazy (Map) | |
import qualified Data.Map.Lazy as Map | |
import qualified Text.Megaparsec as P | |
import qualified Text.Megaparsec.Char as PC | |
yearNr :: Int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE BangPatterns #-} | |
-- Description : Advent of Code - 2022 / Tag 19 | |
-- | |
-- see [Advent of Code 2022 - day 19](https://adventofcode.com/2022/day/19) | |
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} | |
{-# OPTIONS_GHC -Wno-name-shadowing #-} | |
module Y2022.Day19.Solution where | |
import CommonParsers (Parser, numberP, runParser) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Prelude | |
import Data.Symbol (class IsSymbol, SProxy(..)) | |
import Effect (Effect) | |
import Effect.Console (log) | |
import Prim.Row as Row | |
import Prim.RowList (kind RowList, Nil, Cons, class RowToList) | |
import Record (get) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE RankNTypes, DeriveFunctor #-} | |
module Riddle where | |
type T a b c = forall f . Functor f => (a -> f b) -> f c | |
to :: (a, b -> c) -> T a b c | |
to (a, b_c) f = fmap b_c (f a) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Data.List (unfoldr) | |
main = | |
putStrLn $ "Prüfe Rechnungsnummer 4711: " ++ show (pruefsummeFuerRechnungsNummern 4711) | |
pruefsummeFuerNetzwerkAdressen = | |
pruefsumme [5,1] 9 digitsRightToLeft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE TypeInType #-} | |
{-# LANGUAGE TypeOperators #-} | |
module VectMap where | |
import GHC.TypeLits | |
data Vect (n :: Nat) a where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cp ~/.local/bin/purescript/v0.12/purs ~/.local/bin/purs | |
pulp $@ | |
rm ~/.local/bin/purs | |
# - still got purs 0.11.7 from npm | |
# - have current purescript/purs compiled/installed with stack | |
# - move the version somewhere (I opted into the path above) | |
# - have .local/bin before your npm installed bins in your PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM fpco/stack-build:lts-11 as builder | |
ENV BUILD=/app | |
RUN mkdir -p $BUILD | |
COPY . $BUILD | |
WORKDIR $BUILD | |
RUN stack install --local-bin-path ./dist | |
FROM ubuntu:16.04 | |
RUN apt-get update | |
RUN apt-get install --yes libgmp-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE RankNTypes #-} | |
module Leibniz where | |
-- WANT this without GADTS!: | |
data Form res where | |
FInt :: Int -> Form Int | |
FAdd :: Form Int -> Form Int -> Form Int | |
FNull :: Form Int -> Form Bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE LambdaCase #-} | |
module Parser | |
( Parser | |
, parse | |
, Parser.fail | |
, succeed | |
, choose | |
, char | |
, digit |
NewerOlder