Prefer a newline+indent and then a newline for each parameter following a tag
div []
[]
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Data.List | |
import qualified Data.Text as T | |
getGroupTotal g = Sum . length $ foldr intersect (mconcat g) g | |
solvePartTwo = readFile "./input.txt" >>= print . mconcat . fmap getGroupTotal . parseInput |
{-# LANGUAGE OverloadedStrings #-} | |
import qualified Data.Graph as Graph | |
import Text.ParserCombinators.Parsec as P | |
sumEdges :: InputGraph -> [InputEdge] -> Maybe (Sum Int) | |
sumEdges input edges = | |
mconcat <$> | |
mapM | |
( \(key_, count_) -> |
{-# LANGUAGE OverloadedStrings #-} | |
import Text.ParserCombinators.Parsec as P | |
import Data.List (nub) | |
type PassportField = (String, String) | |
type Passport = [PassportField] | |
hexParser :: Parser String |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TupleSections #-} | |
module Main where | |
import Text.ParserCombinators.Parsec as P | |
type SeatingChart = [(Int, [Int])] | |
splitLeft :: [a] -> [a] |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
import Text.ParserCombinators.Parsec as P | |
data Slope = Tree | Snow deriving (Show) | |
type InputLines = [[Slope]] | |
traverseSlope :: (Int, Int) -> (Int, Int) -> [[Slope]] -> Int |
{-# LANGUAGE OverloadedStrings #-} | |
import Text.ParserCombinators.Parsec as P | |
data InputLine = InputLine | |
{ range :: (Int, Int), | |
charRequirement :: Char, | |
content :: String | |
} | |
deriving (Show) |
{-# LANGUAGE OverloadedStrings #-} | |
import Data.Text (pack, splitOn, unpack) | |
findMatchPartTwo :: Int -> [Int] -> Maybe Int | |
findMatchPartTwo total (x : xs) = | |
case (* x) <$> findMatchPartOne (total - x) xs of | |
Just m -> Just m | |
Nothing -> findMatchPartTwo total xs | |
findMatchPartTwo _ [] = Nothing |
import { startWith, map, constant, merge, combineArray, runEffects, tap } from '@most/core' | |
import { newDefaultScheduler } from '@most/scheduler' | |
const textVal$ = startWith( | |
'', | |
map( | |
(e) => (e.target as HTMLInputElement).value, | |
sources.fromDOMEvent('#text-input', 'input') | |
) | |
) |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Shpadoinkle as S | |
import Shpadoinkle.Backend.ParDiff | |
import Shpadoinkle.Html as H | |
import Data.Text |