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 Text.Pandoc.JSON | |
import Data.List | |
main = toJSONFilter removeComments | |
removeComments :: Block -> [Block] | |
removeComments e@(RawBlock (Format "html") s) = if isComment s then [] else [e] | |
removeComments e = [e] |
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 Text.Pandoc.JSON | |
main = toJSONFilter removeFootnote | |
removeFootnote :: Inline -> [Inline] | |
removeFootnote (Note _) = [] | |
removeFootnote e = [e] |
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 Text.Pandoc.JSON | |
import Data.List (isPrefixOf) | |
import Data.Char (isAlphaNum) | |
main = toJSONFilter insertSpaces | |
insertSpaces :: Inline -> Inline | |
insertSpaces l@(Link [Str x] (url, tit)) |
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 OverloadedStrings #-} | |
module Main | |
( main | |
) where | |
-------------------------------------------------------------------------------- | |
import Control.Concurrent (forkIO) | |
import Control.Applicative ((<$>)) |
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 OverloadedStrings #-} | |
{-# LANGUAGE TypeFamilies #-} | |
import Data.ByteString.Lazy () | |
import Text.Blaze.Html (Html) | |
import Text.Blaze.Renderer.Utf8 (renderMarkup) | |
import Control.Monad.Trans.Either (EitherT, runEitherT) | |
import Data.Proxy (Proxy (Proxy)) | |
import Servant.Server.Internal (HasServer (..), RouteMismatch (WrongMethod, NotFound), |
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 OverloadedStrings #-} | |
module Main where | |
-- https://groups.google.com/d/msgid/pandoc-discuss/45a32eb9-23b9-4df1-8c6e-2e08073df166%40googlegroups.com?utm_medium=email&utm_source=footer | |
import Text.Pandoc.JSON | |
import Text.Pandoc.Definition | |
import Text.Printf | |
import Data.Maybe |
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 DataKinds, TypeFamilies, TypeOperators, OverloadedStrings #-} | |
module M where | |
import Servant.Server | |
import Servant | |
import Data.Text (Text) | |
import Network.Wai.Handler.Warp | |
import Data.Proxy | |
myApi :: Proxy MyApi |
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 Filter where | |
import Text.Pandoc.JSON | |
import Text.Pandoc.Definition | |
main :: IO () | |
main = toJSONFilter scrub | |
scrub :: Block -> Block | |
scrub h@(Header level (uid, cs, kvs) title) |
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
-- https://wiki.haskell.org/Idiom_brackets | |
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts, FlexibleInstances, UndecidableInstances #-} | |
import Control.Applicative | |
import Control.Monad.Identity | |
class Applicative i => Idiomatic i f g | g -> f i where | |
idiomatic :: i f -> g | |
iI :: Idiomatic i f g => f -> g |
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 RepListMin where | |
repListMin :: [Int] -> [Int] | |
repListMin xs = res | |
where | |
(m, res) = repListMin' m xs | |
repListMin' :: Int -> [Int] -> (Int, [Int]) | |
repListMin' m [x] = (x, [m]) |