Skip to content

Instantly share code, notes, and snippets.

View chshersh's full-sized avatar
🕵️‍♂️
Working on a super-secret OCaml project

Dmitrii Kovanikov chshersh

🕵️‍♂️
Working on a super-secret OCaml project
View GitHub Profile
@brendanzab
brendanzab / gist:d41c3ae485d66c07178749eaeeb9e5f7
Last active July 19, 2023 04:28
My personal list of Rust grievances (September 2021)

September 2022:

This has spread to a far wider audience than I had anticipated - probably my fault for using a title that is in hindsight catnip for link aggregators. I wrote this back in 2021 just as a bunch of personal thoughts of my experiences using Rust over the years (not always well thought through), and don't intend on trying to push them further, outside of personal experiments and projects.

Managing a living language is challenging and difficult work, and I am grateful for all the hard work that the Rust community and contributors put in given the difficult constraints they work within. Many of the things I listed below are not new, and there's been plenty of difficult discussions about many of them over the years, and some are being worked on or postponed, or rejected for various good reasons. For more thoughts, please see my comment below.

My personal list of Rust gr

@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
@vrom911
vrom911 / ChrisPenner.hs
Created October 19, 2020 20:43
My solutions to the Chris Penner's 'Silly Job Interview Questions In Haskell' post: https://chrispenner.ca/posts/interview
module ChrisPenner where
import Data.Array ((!))
import Data.Foldable (for_, foldl', maximumBy)
import Data.List (sort)
import Data.Map.Strict (Map)
import Data.Ord (comparing)
import qualified Data.Array as A
import qualified Data.Map.Strict as Map

A Journey into Haskell and Open Source

I want to write something to celebrate the latest and I hope the last release of wstunnel, a TCP/UDP tunneling websocket tool, and share with you at the same time my story with Haskell and OpenSource projects.

A venture into Haskell

This open source project is not my only one, but is found to my hearth because it brought me joy, despair, proud, shame and further reach that I wasn't even expecting at first. If you have not noticed, the program is written in Haskell. I started learning it, well 8 years ago now..., when I was studying abroad in South Korea. At the time I was struggling with the feeling that I was not enough, I already knew C++ and Java, but was feeling like stagnating while there was so much more that I wasn't knowing. I wanted to be more and thus I needed to dedicate myself to learn more in order to be better. This fear of stagnation is still present in me even today, and if you are working as a programmer, I t

@ChrisPenner
ChrisPenner / git-transplant
Last active February 12, 2021 15:26
Transplant commits from one source to another
#!/bin/bash
if [[ $# -ne 2 ]]; then
cat >&2 <<EOF
Transplant a branch from one root to another.
Handy if you've done a squash-merge and need to rebase <from> the old branch <onto> the new master.
Usage:
git transplant <from> <to>
where:
@AlexeyRaga
AlexeyRaga / 1CPrelude.hs
Created March 31, 2020 06:15
1с-подобный Хаскель
---------------- Базовое ----------------------
type Число = Int
type Строка = Text
type Строчное = Show
type ИО = IO
type Сравнимое = Eq
type Упорядоченное = Ord
печатать :: Строчное значение => значение -> ИО ()
печатать = print
@maksbotan
maksbotan / generic-validation.md
Last active July 5, 2020 20:34
Generic validation of nested data

Generic validation of nested data

TLDR

This technique helps validate arbitrary conditions in deeply nested structures without writing additional code — with the help of Haskell Generics.

It boils down to this pattern:

@monadplus
monadplus / profiling_haskell.md
Last active October 31, 2023 23:28
Haskell: Profiling

Profiling in Haskell

Do not get bogged down in microoptimizations before you've assessed any macro optimizations that are available. IO and the choice of algorithm dominate any low level changes you may make. In the end you have to think hard about your code!

Before starting to optimize:

  1. Is the -O2 flag on ?
  2. Profile: which part of the code is the slow one.
  3. Use the best algorithm in that part.
  4. Optimize: implement it in the most efficient way.
@tfausak
tfausak / invertible-syntax-descriptions.markdown
Last active February 2, 2024 20:58
Survey of invertible syntax description libraries for Haskell.

Invertible syntax descriptions

An "invertible syntax description" is something that can be used to both parse and generate a syntax. For example, instead of defining separate toJson and fromJson functions for a given data type, an invertible syntax description could be used to provide both. There are many Haskell libraries that provide this functionality or something close to it. As far as I can tell most of them are at least inspired by Invertible syntax descriptions by Tillmann Rendel and Klaus Ostermann.

Personally I am interested in using these for HTTP routing. I frequently want to be able to define a route such as /episodes/:id.json, dispatch based on that route, and generate links to that route. Doing so manually is tedious and error prone.

@matthewjberger
matthewjberger / instructions.md
Last active April 29, 2024 07:32
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache