Skip to content

Instantly share code, notes, and snippets.

View emilypi's full-sized avatar
🥝
hot girl summer

Emily Pillmore emilypi

🥝
hot girl summer
View GitHub Profile
@emilypi
emilypi / ghci.conf
Last active July 9, 2021 16:49
My modest ghci.conf
-- -------------------------------------------------------------------- --
-- Default Extensions
:set -XRankNTypes
:set -XGADTs
:set -XTypeFamilies
:set -XTypeApplications
:set -XBangPatterns
:set -XMagicHash
:set -XMultiParamTypeClasses

Rule 110 problem Post-Mortem + Tuning

Here's a small, unordered bullet list of things I'd immediately change:

In Main.hs:

  • Unused MultiWayIf pragma
  • I forgot to enable -Wall, which would have shown spurious and unused imports. My bad.
  • Probably could have done better error handling for the parser

Yaml (Tweag Fellowship Proposal Annex)


This proposal represents the current understanding of the intent and implementation schedule for a new YAML library called Yaml that is YAML 1.2 spec-compliant, purely Haskell, and released under the BSD-3 clause license. In addition to the core library, we will implement a range of dependent libraries that will implement streaming, optic, and stream-transducer support in a modular way, with a minimal dependency footprint.

Introduction

YAML (YAML Ain't Markup Language) Haskell has two existing YAML 1.2 implementations publicly available through the Hackage ecosystem: yaml, and HsYaml. Both of these packages represents years of work and value for Haskell developers and businesses alike, and have developed into small ecosystems unto themselves in terms of downstream dependencies. Both libraries, unfortunately, also have irreconciliable flaws that w

On PVP + Restrictive Bounds

The prompt came from a tweet (later found out to be ranting into the void and not to be considered real advice) by a Stackage trustee:

Hey Haskell developers! STOP 👏 USING 👏 RESTRICTIVE 👏 UPPER 👏 BOUNDS! 👏 At least stop using them by default!

Part I

C: What do people consider the best practices on upper bounds in packages?

L: No build failures / No restrictive upper bounds. Pick one. (And stackage only works as a third alternative as long as you can afford to stay within it.)

{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RankNTypes #-}
module Main where
main :: IO ()
main = return ()
-- -------------------------------------------------------------------- --
-- An initial encoding of an untyped LC
{-# language ConstraintKinds #-}
{-# language GADTs #-}
{-# language KindSignatures #-}
{-# language MultiParamTypeClasses #-}
{-# language PatternSynonyms #-}
{-# language PolyKinds #-}
{-# language RankNTypes #-}
{-# language RoleAnnotations #-}
{-# language StandaloneKindSignatures #-}
{-# language TypeFamilies #-}

Managing Haskell

blah blah blah more things here

From my experience fundraising in Haskell, companies who use it all seem to have suffered from the same two flavors of problem:

  1. A rockstar comes in, dumps mindblowing code everywhere that dazzles the rest of the team and fools the product leads with pseudo-productivity until the rockstar leaves or finally wakes up. Cue the rest of the team death-marching for the next year or few years as the team attempts to juggle feature additions with excising or unraveling the impenetrable yarn-tangle of semantic misdirection.

  2. An especially productive senior or team lead spends their time on refactoring and generally spinning their wheels with respect to product delivery, and then fails to deliver on time, or at all. Cue the rest of the team struggling to keep up with the refactors. The team's knowledge of the state of the product suffers, confusion about goals sets in, the senior/lead effectively becomes an anti-team player, throwing curveballs at the rest o

{-# language TypeOperators #-}
{-# language PatternSynonyms #-}
{-# language MultiParamTypeClasses #-}
{-# language FlexibleContexts #-}
{-# language FlexibleInstances #-}
{-# language ViewPatterns #-}
module Sub where
import Control.Lens
@emilypi
emilypi / graded1.hs
Last active December 26, 2020 17:32
Graded semigroups/monoids/groups - two versions
{-# language FlexibleInstances #-}
{-# language DefaultSignatures #-}
{-# language RankNTypes #-}
{-# language MultiParamTypeClasses #-}
{-# language QuantifiedConstraints #-}
module Data.Group.Graded where
import Data.Functor.WithIndex
import Data.Group
import Data.Map (Map)
-- monoids
type Unit = ()
type a × b = (a,b)
type a → b = (->)
class Monoid a where
mempty :: Unit → a
mappend :: a × a → a