typeMessageText (e1 :: k) (e2 :: k) (es :: [k]) ='Text"You require the following two effects from your computation:"':$$:'Text""':$$:'Text" '"':<>:'ShowType e1 ':<>:'Text"' and '"':<>:'ShowType e2 ':<>:'Text"'"':$$:'Text""':$$:'Text"However, your monad is capable of performing only the following effects:"':$$:'Text""':$$:'Text" "':<>:'ShowType es
typeMessageText (e1 :: k) (e2 :: k) (es :: [k])="You require the following two effects from your computation:"%""%" '"<> e1 <>"' and '"<> e2 <>"'"%""%"However, your monad is capable of performing only the following effects:"%""%" "<> es
使い方
{-# LANGUAGEDataKinds #-}{-# LANGUAGEExplicitNamespaces #-}{-# LANGUAGEPolyKinds #-}{-# LANGUAGETypeOperators #-}{-# LANGUAGEUndecidableInstances #-}import Type.Errors.Pretty (type (<>),type (%),TypeError)typeMessageText (e1 :: k) (e2 :: k) (es :: [k])="You require the following two effects from your computation:"%""%" '"<> e1 <>"' and '"<> e2 <>"'"%""%"However, your monad is capable of performing only the following effects:"%""%" "<> esinstanceTypeError (MessageTextIntBool'[MaybeInt, [a]]) =>Num [a]
λ stack repl --package type-errors-pretty Main.hs> [1] + [2]<interactive>:5:1: error:• You require the following two effects from your computation: 'Int' and 'Bool' However, your monad is capable of performing only the following effects: '[Maybe Int, [a]]• When checking the inferred typeit::forall a. ((TypeError...),Num a) => [a]