Quantcast
Channel: Lifting class instance in Haskell - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by Raoul Supercopter for Lifting class instance in Haskell

$
0
0

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 all articles
Browse latest Browse all 4

Trending Articles



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