Skip to content

Instantly share code, notes, and snippets.

View vrom911's full-sized avatar
🦄

Veronika Romashkina vrom911

🦄
View GitHub Profile
@chiroptical
chiroptical / babyShark.hs
Last active February 3, 2023 15:23
Baby shark as a Haskell program
{-# LANGUAGE BlockArguments #-}
module Main where
main :: IO ()
main = do
babyShark
do do do do do do babyShark
do do do do do do babyShark
do do do do do do babyShark
@graninas
graninas / haskell_design_patterns.md
Last active September 2, 2023 13:47
Haskell Design Patterns

Design patterns in Haskell

This is a list of patterns. I'm collecting this list with an idea to write a book similar to the GoF book.

My patterns:

  • Typed / Untyped pattern
  • Typed Avatar pattern (see Hydra and Node)
    • Typed Options pattern (see EulerHS)
  • Control Structure pattern (see CLI control structure in Hydra and similar in Node)
@ChrisPenner
ChrisPenner / Optics Cheatsheet.md
Last active April 12, 2024 14:24
Optics Cheatsheet
@chshersh
chshersh / TypeError.hs
Last active July 15, 2019 06:53
Examples of custom type errors
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
@chshersh
chshersh / Comonad.hs
Created March 25, 2019 11:07
Comonadic builders
#!/usr/bin/env cabal
{- cabal:
build-depends:
, base ^>= 4.12.0.0
, comonad ^>= 5.0
, pretty-simple ^>= 2.2
, text
-}
{-# LANGUAGE OverloadedStrings #-}
@chshersh
chshersh / parser-combinators-vs-parser-generators.md
Last active June 12, 2023 11:06
Per criterion comparison of Parser Generators and Parser Combinators

Legend:

  • ➖ poor (impossible or very hard to achieve)
  • ➕ good (possible but requires some dancing)
  • ✔️ excellent (very easy to achieve/have)

PC stands for parser combinators and PGparser generators.

Property Generators Combinators Description
Power ✔️ LALR ➕ LL(∞) PC can't handle left-recursive grammars (though, there's some article¹...).
@chshersh
chshersh / ghci.conf
Last active December 5, 2023 00:19
Config for GHCi with pretty output
-- To run:
-- cabal repl -b pretty-simple
--
-- Colorizing and pretty-printing ghci output
-- requires: pretty-simple
:set -interactive-print=Text.Pretty.Simple.pPrint
-- green bold lambdas and multiline mode
:set prompt "\ESC[1;32mλ: \ESC[m"
:set prompt-cont "\ESC[1;32mλ| \ESC[m"
@chshersh
chshersh / ArrayFun.hs
Last active August 15, 2019 05:27
Emulating array syntax with lens
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ViewPatterns #-}
-- | This module contains some approach for emulating array syntax from
-- imperative languages. The approach emulates only syntax, not efficiency.
-- Though if you like working with persistent arrays it may be good for you.
-- Also it's a fun exercise on lenses.
@saurabhnanda
saurabhnanda / haskell-interhsip.md
Last active November 18, 2018 15:42
Haskell Internship Bounty Program

Attention

This page has been moved to http://www.vacationlabs.com/haskell-bounty-program

Haskell Internship Bounty Program

Here's the general idea:

  • Solve a pre-defined problem (could be an open source contribution OR an internal tool) for a bounty (basically success-fee). Not looking at GSoC level funding or problems, but something that can be done in 1-2 weeks with a 50-250$ bounty.
  • Supported by mentoring and general help over slack/IRC.
@wh1tney
wh1tney / deploy-static-site-heroku.md
Last active April 23, 2024 17:49
How to deploy a static website to Heroku

Gist

This is a quick tutorial explaining how to get a static website hosted on Heroku.

Why do this?

Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions