Skip to content

Instantly share code, notes, and snippets.

@keksnicoh
keksnicoh / Sigma.hs
Last active October 31, 2020 16:21
Singletons - Dependent Pair
-- this is using template haskell to reduce boilerplate
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE StandaloneKindSignatures #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TemplateHaskell #-}
module SigmaCustomSing where
@keksnicoh
keksnicoh / solution.hs
Last active October 26, 2020 15:27
takehome-fp-interview solution
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeApplications #-}
module Test where
import Control.Applicative (Alternative (..), Applicative (liftA2))
import Control.Monad (MonadPlus (..), guard)
import Data.Char (isDigit, ord, toLower)