Quantcast
Viewing latest article 3
Browse Latest Browse All 4

Answer by Raoul Supercopter for Lifting class instance in Haskell

GHC implements what you want : Extensions to the deriving mecanism.These modifications are often shown for future standard language extension (As seen on haskell' wiki)

To Enable this extension, you must use the following pragma

{-# GeneralizedNewtypeDeriving #-}

and then use a deriving on your newtype declaration, as usual

data SomeType a = SomeCons a deriving (Num)

Viewing latest article 3
Browse Latest Browse All 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>