(相关问题Even more generalized newtype deriving)
我喜欢换行
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
newtype Foo = Foo { unFoo :: Int } deriving (Eq, Ord, Enum, Real, Num, Read, Integral, Show)
newtype Var = Var { unVar :: Int } deriving (Eq, Ord, Enum, Real, Num, Read, Integral, Show)
防止
doSomething :: Int -> Int -> Int
doSomething someFoo otherVar
是否可以自动导出所有可能的实例?
(这不推荐?,有更好的方法吗?)
谢谢!