Last active
February 9, 2024 20:32
-
-
Save appositum/48064937bdead1b757ccb0f02603a057 to your computer and use it in GitHub Desktop.
Type inequality constraint in Haskell
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 ConstraintKinds #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
type family TypeEq a b where | |
TypeEq a a = True | |
TypeEq a b = False | |
type a /= b = TypeEq a b ~ False | |
f :: (a /= b) => (a -> b) -> a -> b | |
f g a = g a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment