sequenceDiagram
participant Bors
participant Hydra
participant User
participant GitHub
participant BorsComment
participant Analyzer
participant Automation
participant Slack
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 DeriveFunctor #-} | |
{-# LANGUAGE LambdaCase #-} | |
module Arith where | |
-- do not import other stuff here | |
import Control.Applicative | |
( Alternative (empty, (<|>)) | |
, many |
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 ExistentialQuantification #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE InstanceSigs #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE RecordWildCards #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
import Data.String (IsString) |
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 Change () where | |
import Data.List (sortOn) | |
import Data.Ord (Down(..)) | |
import Control.Exception.Base (assert) | |
-- count the number of ways a `tot` can be realized using the given coins | |
-- any coin can be used any number of times | |
countChangeOpen :: Int -> [Int] -> Int | |
countChangeOpen tot coins = consumeOpen tot $ sortOn Down coins |
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 CodewarRanking (incProgress, newUser, rank, progress) where | |
import Data.Foldable (find) | |
-- just for differentiate the 2 Ints in the game | |
-- deriving Enum and Num would improve the code, how ? | |
newtype Progress = Progress Int | |
deriving (Eq, Show) | |
-- just for differentiate the 2 Ints in the game |
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 MultiWayIf #-} | |
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} | |
{-# OPTIONS_GHC -Wno-unused-top-binds #-} | |
{-# HLINT ignore "Redundant multi-way if" #-} | |
module Counting () where | |
-- some values | |
type S a = [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
{-# OPTIONS_GHC -Wno-unused-top-binds #-} | |
module Counting () where | |
-- some values | |
type S a = [a] | |
-- any combining operation between 2 values (+, - , * ...) | |
type Op a = a -> a -> 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
{-# LANGUAGE MultiWayIf #-} | |
{-# LANGUAGE TupleSections #-} | |
{-# HLINT ignore "Redundant multi-way if" #-} | |
import Control.Monad.Fix (fix) | |
import Data.Array (Array, array) | |
import qualified Data.Array as A | |
levCachedArray :: Eq a => [a] -> [a] -> 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 BlockArguments #-} | |
{-# LANGUAGE Rank2Types #-} | |
{-# LANGUAGE NoMonomorphismRestriction #-} | |
import Control.Monad.Fix (fix) | |
import Data.List (tails) | |
import Streaming (Of ((:>)), Stream) | |
import qualified Streaming.Prelude as S |
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 BlockArguments #-} | |
module CartesianProductEx where | |
import Control.Arrow ((***)) | |
import Data.List (sortOn) | |
import Test.Hspec (shouldBe) |