-
-
Save Lysxia/3ec3f0f4f29fec7a000d811ec7c1e599 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 RankNTypes, DerivingStrategies, GeneralizedNewtypeDeriving #-} | |
-- Defaults to newtype | |
newtype T_Def = T_Def Bool | |
deriving (Eq, Ord, Bounded) | |
-- Stock | |
newtype T_S = T_S Bool | |
deriving stock (Eq, Ord, Bounded) | |
-- Newtype | |
newtype T_NT = T_NT Bool | |
deriving newtype (Eq, Ord, Bounded) | |
-- Defaults to newtype (unless DeriveFunctor or DeriveFoldable are on) | |
newtype F_NT a = F_NT (Either Int a) | |
deriving (Functor, Foldable) | |
-- Defaults to newtype, fails | |
-- newtype F_NT_BAD a = F_NT_BAD (forall r. Either r a) | |
-- deriving (Functor, Foldable) | |
main = return () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment