Skip to content

Instantly share code, notes, and snippets.

@JakobBruenker
Created August 29, 2019 21:48
Show Gist options
  • Save JakobBruenker/02a9d69ae6bfbf8305f16c2e2cfac659 to your computer and use it in GitHub Desktop.
Save JakobBruenker/02a9d69ae6bfbf8305f16c2e2cfac659 to your computer and use it in GitHub Desktop.
This produces (almost) 5000 lines of type error
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
module LongTypeError where
import Data.Singletons.Prelude
data Data f where
DataCon :: (a -> b) -> Data (a -> b)
function :: f -> Data f
function = undefined
type family TypeFam f fun where
TypeFam f (a -> b) = f a -> TypeFam f b
lift :: forall f fun . fun -> TypeFam f fun
lift fun = case function fun of
DataCon f -> \x -> _ (f <*> x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment