Skip to content

Instantly share code, notes, and snippets.

@oisdk
Created March 29, 2018 03:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oisdk/548297c50a33b06024d83cc8bfb7dd48 to your computer and use it in GitHub Desktop.
Save oisdk/548297c50a33b06024d83cc8bfb7dd48 to your computer and use it in GitHub Desktop.
{-# LANGUAGE DataKinds, UndecidableInstances, ConstraintKinds, GADTs, FlexibleInstances, EmptyCase, LambdaCase #-}
{-# OPTIONS_GHC -Wall #-}
{-# OPTIONS_GHC -fno-warn-unticked-promoted-constructors #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
import GHC.TypeLits
data Dict c where
Dict :: c => Dict c
class Impossible c where
absurd :: Dict c -> a
instance e ~ TypeError (Text "Can't show functions") => Impossible e where
absurd = \case
instance TypeError (Text "Can't show functions") => Eq (a -> b) where
(==) = absurd Dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment