This file contains hidden or 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
| #!/usr/bin/env stack | |
| -- stack --resolver lts-9.21 --install-ghc runghc --package aeson --package lens --package protolude --package safe --package servant --package superrecord --package text --package time --package warp | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE NoImplicitPrelude #-} | |
| {-# LANGUAGE OverloadedLabels #-} | |
| {-# LANGUAGE OverloadedStrings #-} |
This file contains hidden or 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 ParserExperiment | |
| ( statementParser | |
| ) where | |
| import Control.Applicative ( (<*) ) | |
| import Data.Functor ( (<$) ) | |
| import Text.Parsec | |
| import Text.Parsec.Char ( upper ) | |
| type Identifier = String |
This file contains hidden or 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 BinChar | |
| -- %default total | |
| -- Binary literals | |
| data BinChar : Char -> Type where | |
| O : BinChar '0' | |
| I : BinChar '1' | |
| data Every : (a -> Type) -> List a -> Type where |
This file contains hidden or 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
| main = interact $ show . f . map read . words | |
| f (n:a:b:c:_) | |
| | b - a == c - b = arith !! n | |
| | otherwise = geo !! n | |
| where | |
| arith = [a, b ..] | |
| geo = if diffsigns || increasing | |
| then a:map (*d) geo | |
| else a:map (`div` e) geo |
This file contains hidden or 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
| main = interact $ show . f . map (map read . words) . lines | |
| f :: [[Int]] -> Int | |
| f ([n]:xs:_) | |
| | isArith xs = nthArith n xs | |
| | otherwise = nthGeom n xs | |
| isArith :: [Int] -> Bool | |
| isArith (a:b:c:_) = b - a == c - b |
This file contains hidden or 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
| property running : False | |
| property checkInterval : 30 | |
| on run | |
| tell application "System Events" | |
| if (exists application process "zoom.us") then | |
| running = True | |
| end if | |
| end tell | |
| end run |
This file contains hidden or 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 NoImplicitPrelude #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| module Lambda.Parser where | |
| import Viper.Prelude | |
| import Data.Attoparsec.Text | |
| import Data.Eq.Deriving ( deriveEq1 ) |
This file contains hidden or 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 SwipeCodes where | |
| import Data.List | |
| -- [x] Between 5 to 8 "digits" | |
| -- [x] At least 1 horizontal line was filled | |
| -- [x] It spanned all 3 horizontal lines | |
| -- [x] It spanned all 3 vertical | |
| -- [x] It started downward (may have come back up) | |
| -- [x] You can't use the same node twice and |
This file contains hidden or 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 SwipeCodes where | |
| import Data.List | |
| -- [x] Between 5 to 8 "digits" | |
| -- [x] At least 1 horizontal line was filled | |
| -- [x] It spanned all 3 horizontal lines | |
| -- [x] It spanned all 3 vertical | |
| -- [x] It started downward (may have come back up) | |
| -- [x] You can't use the same node twice and |
This file contains hidden or 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
| 1 | |
| 1 2 | |
| 1 2 3 | |
| 1 2 3 5 | |
| 1 2 3 5 4 | |
| 1 2 3 5 4 7 8 6 9 | |
| 1 2 3 5 4 7 8 9 6 | |
| 1 2 3 5 6 | |
| 1 2 3 5 6 9 8 4 7 |