{-# LANGUAGE PatternSynonyms #-}
{-# OPTIONS_GHC -Wincomplete-uni-patterns #-}
import Data.Functor.Identity

newtype T f t = C (f Double)
pattern T :: Double -> T Identity t
pattern T x = C (Identity x)

type R = T Identity ()

divide :: R -> R -> Double
divide x y = x'/y' where
    T x' = x -- pattern match is exhaustive, GHC thinks otherwise.
    T y' = y 
