Skip to content

Instantly share code, notes, and snippets.

@chrisdone
chrisdone / review.md
Last active August 14, 2023 23:40
Email message parsing in Haskell in 2018

Email message parsing in Haskell in 2018

Background: I am moving away from GMail to my own Haskell-based server (SMTP receiver/sender, web-based email client, spam filtering, etc.). All email to @chrisdone.com goes through this server (mx.chrisdone.com) as of today, and chrisdone@gmail.com forwards a copy of everything to it.

This is a summary/tracking document of my efforts to simply parse email messages in Haskell for the SMTP receiver.

@justinwoo
justinwoo / purs-11.7-to-12-guide.md
Last active January 6, 2019 16:34
See the PureScript Resources guide page at https://purescript-resources.readthedocs.io/en/latest/0.11.7-to-0.12.0.html. PureScript 0.11.7 -> PureScript 0.12.0 checklist

There are some changes you will need to make for most applications to be upgraded to PureScript 0.12. With some usage of editor commands, you should be able to convert any 20K LOC codebase in less than an hour.

Libraries

  • Remove eff, install effect
  • Remove dom and dom-*, use web-dom and such from purescript-web. Use type holes (?whatmethod) to discover new APIs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

How to upgrade to Purescript 0.12

Before we begin, the type search in Pursuit is a great way to search for the functions you need.

Reset your tooling by deleting the bower_components/, .psci_modules/, .pulp-cache/, .psc-package/ and output/ folders. Then run psc-package build --only-dependencies.

Import changes and effects

Using sed or your other favourite global replace tool to search and replace all occurences in the list

@parsonsmatt
parsonsmatt / prismatic.hs
Created June 5, 2018 20:49
I figured out a nice way to pluck exceptions out of a constraint!
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
@nadavrot
nadavrot / Matrix.md
Last active May 5, 2024 08:37
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@Icelandjack
Icelandjack / SystemF.hs
Last active November 27, 2018 02:00
System F
-- SYSTEM F
-- http://homepages.inf.ed.ac.uk/slindley/papers/embedding-f.pdf
--
-- Type-level lambdas
-- https://gist.github.com/AndrasKovacs/ac71371d0ca6e0995541e42cd3a3b0cf
{-# language TemplateHaskell, ScopedTypeVariables, RankNTypes,
TypeFamilies, UndecidableInstances, DeriveFunctor, GADTs,
TypeOperators, TypeApplications, AllowAmbiguousTypes,

Title

Haskell DJs: Compose a hit with Vinyl

Session Topics

  • Languages
  • Concepts
  • Libraries
@alfonsogarciacaro
alfonsogarciacaro / Deploy.md
Last active March 3, 2023 09:50
Deploying an F# ASP.NET Core app (Giraffe) to Azure

Deploying an F# ASP.NET Core app to Azure

Last week I spent a lot of time trying to deploy an F# ASP.NET Core app (a Giraffe app, specifically) to Azure because the information to complete all the steps was scattered in several places. So I'm writing this hopefully it will save the pain to others :)

Preparation

The following steps are mostly taken from this guide and it's only necessary to do them once:

  1. Create an account in Azure (or use an existing one)
  2. Create a resource group (or use an existing one)
@ekmett
ekmett / StateComonad.hs
Created January 6, 2018 15:53
The State Comonad
-- http://comonad.com/reader/2018/the-state-comonad/
-- https://www.reddit.com/r/haskell/comments/7oav51/i_made_a_monad_that_i_havent_seen_before_and_i/
{-# language DeriveFunctor #-}
import Control.Comonad
import Data.Semigroup
data Store s a = Store { peek :: s -> a, pos :: s } deriving Functor