Skip to content

Instantly share code, notes, and snippets.

View jkachmar's full-sized avatar
🏳️‍⚧️

jkachmar jkachmar

🏳️‍⚧️
View GitHub Profile
@jkachmar
jkachmar / stack.yaml
Last active January 29, 2020 17:02
GitHub Semantic w/ Stack
resolver: lts-13.23
packages:
- '.'
- vendor/haskell-tree-sitter
- vendor/haskell-tree-sitter/languages/go
- vendor/haskell-tree-sitter/languages/haskell
- vendor/haskell-tree-sitter/languages/java
- vendor/haskell-tree-sitter/languages/json
- vendor/haskell-tree-sitter/languages/php
- vendor/haskell-tree-sitter/languages/python
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PartialTypeSignatures #-}
module Main where
import Control.Exception.Safe (MonadMask)
import qualified Control.Exception.Safe as Exc
import Control.Monad.IO.Class (MonadIO)
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
@jkachmar
jkachmar / Main.hs
Last active May 19, 2022 13:20
"Simple" example for how to set up Servant to automatically retry its client requests
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
@jkachmar
jkachmar / package.yaml
Created October 18, 2018 21:16
Useful GHC flags
# NOTE:
# For details on warnings: https://downloads.haskell.org/~ghc/master/users-guide/using-warnings.html
#
# This list taken from https://medium.com/mercury-bank/enable-all-the-warnings-a0517bc081c3
ghc-options:
- -fwarn-tabs # Warn on tabs (spaces are better)
- -Weverything # Enable all warnings with -Weverything, then
# disable the ones we don’t care about
@jkachmar
jkachmar / Main.purs
Last active June 3, 2018 16:33
LambdaConf 2018 - Exercise 5
module Main where
import Prelude
import Control.Alt ((<|>))
import Control.Monad.Eff.Console (log, logShow)
import Data.Array (fromFoldable)
import Data.Bifunctor (bimap)
import Data.Either (fromRight)
import Data.Generic.Rep (class Generic)
@jkachmar
jkachmar / Main.purs
Last active May 28, 2018 23:15
LambdaConf 2018 - Exercise 4
module Main where
import Prelude
import Control.Monad.Eff.Console (log, logShow)
import Data.Array (fromFoldable)
import Data.Bifunctor (bimap)
import Data.Either (fromRight)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow)
@jkachmar
jkachmar / Main.purs
Last active May 28, 2018 19:20
LambdaConf 2018 - Exercise 3
module Main where
import Prelude
import Control.Monad.Eff.Console (log, logShow)
import Data.Array (fromFoldable)
import Data.Bifunctor (bimap)
import Data.Either (fromRight)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow)
@jkachmar
jkachmar / Main.purs
Last active May 28, 2018 19:29
LambdaConf 2018 - Exercise 2
module Main where
import Prelude
import Control.Monad.Eff.Console (log, logShow)
import Data.Array (fromFoldable)
import Data.Either (fromRight)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow)
import Data.List.NonEmpty (NonEmptyList, singleton)
@jkachmar
jkachmar / Main.purs
Last active May 28, 2018 19:26
LambdaConf 2018 - Exercise 1.2
module Main where
import Prelude
import Control.Monad.Eff.Console (log, logShow)
import Data.Array (fromFoldable)
import Data.List.NonEmpty (NonEmptyList, singleton)
import Data.String (null, length, toLower, toUpper)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow)
@jkachmar
jkachmar / Main.purs
Last active May 28, 2018 19:24
LambdaConf 2018 - Exercise 1.1
module Main where
import Prelude
import Control.Monad.Eff.Console (log, logShow)
import Data.Array (fromFoldable)
import Data.List.NonEmpty (NonEmptyList, singleton)
import Data.String (length, null, toLower, toUpper)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow)