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 QuasiQuotes #-} | |
module Main where | |
import Data.Foldable | |
import Data.Aeson.Lens | |
import Data.Aeson.Encode.Pretty | |
import Data.Aeson.QQ | |
import Control.Lens |
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
(use-package org | |
:config | |
(add-hook 'text-mode-hook #'visual-line-mode) | |
:custom | |
(org-hide-leading-stars 't) | |
(org-startup-folded 'content )) | |
(use-package org-roam-ui) | |
(defun my-org-journal-new-entry (prefix) |
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
data AddRemove = Add Int | Remove Int deriving Show | |
currentId :: AddRemove -> Int | |
currentId = \case | |
Add n -> n | |
Remove n -> n | |
toMap :: AddRemove -> M.Map Int (Maybe ()) | |
toMap = \case | |
Add n -> M.singleton n (Just ()) |
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 #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} |
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
import Control.Lens | |
import Data.Monoid | |
import Data.List.Extra | |
import Data.Foldable | |
select as fbs f s = | |
flip as s $ \a -> a <$ ( | |
flip (fbs a) s $ \b -> | |
snd <$> f (a,b) | |
) |
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
import Data.Void | |
import Text.Megaparsec | |
import Text.Megaparsec.Char | |
type Parser = Parsec Void String | |
main :: IO () | |
main = case runParser p "bruh" "\"123\", \"321\" , ," of | |
Left err -> print err | |
Right res -> print res |
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
{ nixpkgs ? import ./nix/nixpkgs-2020-09.nix | |
, hls ? true | |
, hoogle ? true | |
}: | |
let | |
packageName = "template"; | |
overlay = self: super: { | |
myHaskellPackages = |
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 UndecidableInstances #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE ConstraintKinds #-} |
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 RecordWildCards #-} | |
module Server (talk, newServer, Server) where | |
import Control.Concurrent.Async | |
import Control.Concurrent.STM | |
import Control.Exception | |
import Control.Monad | |
import Data.Foldable (traverse_) | |
import Data.Functor (void) |
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 | |
-- from "monoidal-containers" package | |
import qualified Data.IntMap.Monoidal.Strict as M | |
-- The thing with this IntMap is that whenever | |
-- its elements form a semigroup, the IntMaps | |
-- containing those elements themselves form | |
-- a monoid that works "pointwise" | |
-- Just type synonyms |
NewerOlder