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
| PROJECT_NAME = <enter your project name here> | |
| help: ## Print documentation | |
| @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | |
| stylish-haskell: ## Apply stylish-haskell on all *.hs files | |
| @find . -type f -name "*.hs" -not -path '.git' -not -path '*.stack-work*' -print0 | xargs -0 stylish-haskell -i | |
| ghci: ## Run repl | |
| @stack ghci $(PROJECT_NAME):lib --haddock-deps --ghci-options=-fobject-code |
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
| {-| | |
| -- dependencies: | |
| -- - base >= 4.7 && < 5 | |
| -- - validity | |
| -- - hspec | |
| -- - genvalidity | |
| -- - genvalidity-hspec | |
| -} | |
| {-# LANGUAGE DeriveGeneric #-} |
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
| import Control.Exception | |
| import Control.Monad (forever, void) | |
| import Data.Char (toUpper) | |
| import GHC.IO.Handle.FD (fdToHandle) | |
| import Prelude | |
| import System.Exit | |
| import System.IO (BufferMode (..), hGetLine, hPrint, | |
| hPutStrLn, hSetBuffering, hClose) | |
| import System.Posix.Process (exitImmediately, forkProcess) | |
| import System.Process (createPipe, createPipeFd) |
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 IPC where | |
| import Control.Monad (forever) | |
| import Data.Char (toUpper) | |
| import GHC.IO.Handle.FD (fdToHandle) | |
| import Prelude | |
| import System.IO (BufferMode (..), hGetLine, hPrint, | |
| hPutStrLn, hSetBuffering) | |
| import System.Posix.Process (forkProcess) | |
| import System.Process (createPipeFd) |
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 Parser.Test where | |
| import RIO hiding (try, (<|>)) | |
| import Text.ParserCombinators.Parsec | |
| data Block = List [Block] | ListItem String | |
| deriving Show | |
| -- | Parser for 'BulletPoint' |
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 OverloadedStrings #-} | |
| module TestScrapbox where | |
| import Data.Maybe (isJust) | |
| import Data.String (fromString) | |
| import Data.Text (Text) | |
| import qualified Data.Text as T | |
| import Text.ParserCombinators.Parsec |
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 OverloadedStrings #-} | |
| module Table where | |
| import Control.Monad | |
| import Data.Attoparsec.Text as P | |
| import Data.Text (Text) | |
| import qualified Data.Text as T | |
| data Table = Table [Column] |
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
| Markdown | |
| [ Document ( ScrapText [ Context NoStyle [ SimpleText "Get started" ] ] ) | |
| , Thumbnail ( Url "https://gyazo.com/5f93e65a3b979ae5333aca4f32600611" ) | |
| , Document ( ScrapText [ Context NoStyle [ SimpleText "Welcome to your new Scrapbox project!" ] ] ) | |
| , BreakLine | |
| , Header ( HeaderSize 2 ) [ SimpleText "📝 Everything is editable" ] | |
| , BreakLine | |
| , BulletLine ( BulletSize 1 ) ( ScrapText [ Context NoStyle [ SimpleText "Click on any line and start typing to edit. " ] ] ) | |
| , BreakLine | |
| , BulletLine ( BulletSize 2 ) ( ScrapText [ Context NoStyle [ SimpleText "Press tab at the beginning of a line to indent and add a bullet point." ] ] ) |
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
| Markdown | |
| { getMarkdown = | |
| [ Simple | |
| ( ScrapText | |
| { getScrapText = | |
| [ Scrap | |
| { scrapStyle = NoStyle | |
| , scrapContent = [ PlainText "Get started" ] | |
| } | |
| ] |
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
| import Dhall (Interpret (..), Inject(..)) | |
| import qualified Dhall as D | |
| import Dhall.Core (pretty) | |
| import qualified Data.Text as T | |
| import GHC.Generics | |
| import Control.Monad.Trans.State.Strict (evalState) | |
| import Data.Functor.Contravariant | |
| data Person = Person { | |
| pName :: !Text |