Skip to content

Instantly share code, notes, and snippets.

View peterstorm's full-sized avatar

Peter Storm peterstorm

View GitHub Profile
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneKindSignatures #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
@peterstorm
peterstorm / IndexedStateMonad.hs
Created February 9, 2023 13:17
Testing Indexed State Monads
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE StandaloneKindSignatures #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
@peterstorm
peterstorm / dsl.scala
Created March 3, 2022 09:16
PrototypeDSL
object GeneratorDSL {
final abstract class NotSignedUp
final abstract class SignedUp
final abstract class AgreementCreated
final abstract class AgreementTerminated
sealed trait ActiveEvent
object ActiveEvent {
import cats.effect.syntax.all._
import cats.effect.{Deferred, Ref, Temporal}
import cats.syntax.all._
import domain.auth.LeadfamlyAccessToken
import scala.concurrent.duration._
trait TokenCache[F[_]]:
package finagleprime.endpoints
import org.http4s._
import org.http4s.dsl._
import cats.implicits._
import cats.effect.Sync
import cats.data.EitherT
final class Test[F[_]: Sync] extends Http4sDsl[F] {