Created
March 29, 2018 03:09
-
-
Save oisdk/548297c50a33b06024d83cc8bfb7dd48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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