Skip to content

Instantly share code, notes, and snippets.

View danidiaz's full-sized avatar

Daniel Díaz Carrete danidiaz

View GitHub Profile
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
@rampion
rampion / LetsGetDangerous.md
Last active January 20, 2020 05:02
Let's Get Dangerous
@gelisam
gelisam / FunDay.hs
Last active May 12, 2024 06:20
a concrete use for FunDay, the right-adjoint of Day
-- A concrete use case for the type which is to '(->)' as 'Day' is to '(,)'.
-- I call it "FunDay", but I don't know what its proper name is. I've been
-- trying to find a use for 'FunDay', and I think I've found a pretty neat one.
{-# LANGUAGE FlexibleContexts, FlexibleInstances, PolyKinds, RankNTypes, TypeSynonymInstances #-}
module Main where
import Test.DocTest
import Control.Monad.Except
import Control.Monad.Reader
@rylev
rylev / rust-in-large-organizations-notes.md
Last active June 12, 2025 16:06
Rust in Large Organizations Notes

Rust in Large Organizations

Initially taken by Niko Matsakis and lightly edited by Ryan Levick

Agenda

  • Introductions
  • Cargo inside large build systems
  • FFI
  • Foundations and financial support

Introduction

I was recently asked to explain why I felt disappointed by Haskell, as a language. And, well. Crucified for crucified, I might as well criticise Haskell publicly.

First though, I need to make it explicit that I claim no particular skill with the language - I will in fact vehemently (and convincingly!) argue that I'm a terrible Haskell programmer. And what I'm about to explain is not meant as The Truth, but my current understanding, potentially flawed, incomplete, or flat out incorrect. I welcome any attempt at proving me wrong, because when I dislike something that so many clever people worship, it's usually because I missed an important detail.

Another important point is that this is not meant to convey the idea that Haskell is a bad language. I do feel, however, that the vocal, and sometimes aggressive, reverence in which it's held might lead people to have unreasonable expectations. It certainly was my case, and the reason I'm writing this.

Type classes

I love the concept of type class

@owickstrom
owickstrom / HiggledyHedgehog.hs
Created July 1, 2019 19:37
Defining overridable default generators for Hedgehog using Higgledy
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE TypeApplications #-}
module HiggledyHedgehog where
import Control.Lens
import Data.Generic.HKD
import GHC.Generics (Generic)
import Hedgehog
@sjoerdvisscher
sjoerdvisscher / equipment.hs
Last active May 23, 2020 14:51
Proarrow equipment in Hask
{-# LANGUAGE
GADTs
, DataKinds
, PolyKinds
, RankNTypes
, TypeOperators
, KindSignatures
, TypeApplications
, FlexibleContexts
, FlexibleInstances
@phadej
phadej / SysF.hs
Last active June 16, 2019 21:11
Someone asked whether you can model SystemF(omega) in Haskell. I think you can.
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -Wall #-}
@vaibhavsagar
vaibhavsagar / default.nix
Created June 15, 2019 15:28
A `default.nix` for Semantic
let
nixpkgs-src = builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs-channels/archive/f197f57bd336746b53e5f1668ac7df1b63da7c9f.tar.gz";
sha256 = "0cj4h39fhrm0nzxgfcjxy457zhi2rajpgm6abas816srmr4bb6nn";
};
semantic-src = builtins.fetchTarball {
url = "https://github.com/github/semantic/archive/78dad094fa2380aef36cabd48d57f6122f1034ec.tar.gz";
sha256 = "0bk7f96fm9928nc2yv85cwchk43xh4yikbiqg7ngba5q6gj7xy04";
};
pkgs = import nixpkgs-src { config.allowBroken = true; };
@andrewthad
andrewthad / strictness_in_kinds.md
Created June 14, 2019 14:47
Strictness in Kinds

Strictness in Kinds

Let's tweak GHC's RuntimeRep stuff to try adding information about strictness. This information could be helpful for avoiding evaluating thunks that are guaranteed to already be evaluated. Presently, RuntimeRep is defined as:

data RuntimeRep

= LiftedRep