Skip to content

Instantly share code, notes, and snippets.

@phadej
Created August 2, 2020 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phadej/cc45d5b8f77454574f0dc417891ad3af to your computer and use it in GitHub Desktop.
Save phadej/cc45d5b8f77454574f0dc417891ad3af to your computer and use it in GitHub Desktop.
{-# LANGUAGE DeriveFunctor #-}
-- This are are fine
newtype F a = F ((a -> Bool) -> Bool) deriving Functor
newtype T a = T (a,a,a) deriving Functor
-- but if we define
newtype Fun a b = Fun (a -> b) -- and
data Tri a b c = Tri a b c
-- and try to
newtype F' a = F' (Fun (Fun a Bool) Bool) deriving Functor
newtype T' a = T' (Tri a a a) deriving Functor
-- then that will fail.
-- Meh.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment